1
0

settings.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup UnaStudio UNA Studio
  6. * @{
  7. */
  8. function BxDolStudioSettings(oOptions) {
  9. this.sActionsUrl = oOptions.sActionUrl;
  10. this.sObjName = oOptions.sObjName == undefined ? 'oBxDolStudioSettings' : oOptions.sObjName;
  11. this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
  12. this.iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
  13. }
  14. /**
  15. * Is needed if AJAX is used to change (reload) pages.
  16. */
  17. BxDolStudioSettings.prototype.changePage = function(sType) {
  18. var oDate = new Date();
  19. var $this = this;
  20. $.get(
  21. this.sActionsUrl,
  22. {
  23. stg_action: 'get-page-by-type',
  24. stg_value: sType,
  25. _t:oDate.getTime()
  26. },
  27. function(oData) {
  28. if(oData.code != 0) {
  29. bx_alert(oData.message);
  30. return;
  31. }
  32. $('#bx-std-pc-menu > .bx-std-pmi-active').removeClass('bx-std-pmi-active');
  33. $('#bx-std-pmi-' + sType).addClass('bx-std-pmi-active');
  34. $('#bx-std-pc-content').bx_anim('hide', $this.sAnimationEffect, $this.iAnimationSpeed, function() {
  35. $(this).html(oData.content).bx_anim('show', $this.sAnimationEffect, $this.iAnimationSpeed);
  36. });
  37. },
  38. 'json'
  39. );
  40. return true;
  41. };
  42. /** @} */