entry.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup BaseGroups Base classes for groups modules
  6. * @ingroup UnaModules
  7. *
  8. * @{
  9. */
  10. function BxBaseModGroupsEntry(oOptions) {
  11. this._sActionsUri = oOptions.sActionUri;
  12. this._sActionsUrl = oOptions.sActionUrl;
  13. this._sObjName = oOptions.sObjName == undefined ? 'oBxEventsEntry' : oOptions.sObjName;
  14. this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
  15. this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
  16. this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
  17. }
  18. BxBaseModGroupsEntry.prototype.connAction = function(oElement, sObject, sAction, iContentId) {
  19. var $this = this;
  20. var oParams = this._getDefaultData();
  21. oParams['s'] = 'entry';
  22. oParams['o'] = sObject;
  23. oParams['a'] = sAction;
  24. oParams['cpi'] = iContentId;
  25. if(oElement)
  26. this.loadingInButton(oElement, true);
  27. jQuery.get (
  28. this._sActionsUrl + 'get_questionnaire',
  29. oParams,
  30. function(oData) {
  31. if(oElement)
  32. $this.loadingInButton(oElement, false);
  33. processJsonData(oData);
  34. },
  35. 'json'
  36. );
  37. };
  38. BxBaseModGroupsEntry.prototype.connActionPerformed = function(oData) {
  39. bx_conn_action($('.bx-menu-item-profile-fan-' + oData.a + ' .bx-btn'), oData.o, oData.a, oData.cpi);
  40. };
  41. BxBaseModGroupsEntry.prototype.loadingInButton = function(e, bShow) {
  42. if($(e).length)
  43. bx_loading_btn($(e), bShow);
  44. else
  45. bx_loading($('body'), bShow);
  46. };
  47. BxBaseModGroupsEntry.prototype._getDefaultData = function() {
  48. var oDate = new Date();
  49. return jQuery.extend({}, this._oRequestParams, {_t:oDate.getTime()});
  50. };
  51. /** @} */