entry.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup Forum Forum
  6. * @ingroup UnaModules
  7. *
  8. * @{
  9. */
  10. function BxForumEntry(oOptions) {
  11. this._sActionsUrl = oOptions.sActionUrl;
  12. this._sObjName = oOptions.sObjName == undefined ? 'oFormEntry' : oOptions.sObjName;
  13. this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
  14. this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
  15. }
  16. BxForumEntry.prototype.updateStatus = function(oButton, sAction, iId) {
  17. this._performAction(oButton, sAction, iId);
  18. };
  19. BxForumEntry.prototype._performAction = function(oButton, sAction, iId) {
  20. var $this = this;
  21. var oDate = new Date();
  22. var oParams = {
  23. action: sAction,
  24. id: iId,
  25. _t: oDate.getTime()
  26. };
  27. $.get(
  28. this._sActionsUrl + 'update_status/',
  29. oParams,
  30. function(oData){
  31. processJsonData(oData);
  32. },
  33. 'json'
  34. );
  35. };