BxDolView.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup UnaCore UNA Core
  6. * @{
  7. */
  8. function BxDolView(options)
  9. {
  10. this._sObjName = undefined == options.sObjName ? 'oView' : options.sObjName; // javascript object name, to run current object instance from onTimer
  11. this._sSystem = options.sSystem; // current comment system
  12. this._iAuthorId = options.iAuthorId; // this comment's author ID.
  13. this._iObjId = options.iObjId; // this object id comments
  14. this._sActionsUri = 'view.php';
  15. this._sActionsUrl = options.sRootUrl + this._sActionsUri; // actions url address
  16. this._sAnimationEffect = 'fade';
  17. this._iAnimationSpeed = 'slow';
  18. this._sSP = undefined == options.sStylePrefix ? 'bx-view' : options.sStylePrefix;
  19. this._aHtmlIds = options.aHtmlIds;
  20. }
  21. BxDolView.prototype.toggleByPopup = function(oLink) {
  22. var $this = this;
  23. var oData = this._getDefaultParams();
  24. oData['action'] = 'GetViewedBy';
  25. $(oLink).dolPopupAjax({
  26. id: this._aHtmlIds['by_popup'],
  27. url: bx_append_url_params(this._sActionsUri, oData)
  28. });
  29. };
  30. BxDolView.prototype._loadingInButton = function(e, bShow) {
  31. if($(e).length)
  32. bx_loading_btn($(e), bShow);
  33. else
  34. bx_loading($('body'), bShow);
  35. };
  36. BxDolView.prototype._getDefaultParams = function() {
  37. var oDate = new Date();
  38. return {
  39. sys: this._sSystem,
  40. id: this._iObjId,
  41. _t: oDate.getTime()
  42. };
  43. };
  44. /** @} */