| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup UnaStudio UNA Studio
- * @{
- */
- function BxDolStudioDesigner(oOptions) {
- this.sActionsUrl = oOptions.sActionUrl;
- this.sObjName = oOptions.sObjName == undefined ? 'oBxDolStudioDesigner' : oOptions.sObjName;
- this.sParamPrefix = oOptions.sParamPrefix == undefined ? 'dsg' : oOptions.sParamPrefix;
- this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
- this.iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
- }
- BxDolStudioDesigner.prototype.makeDefault = function(sUri) {
- var $this = this;
- var oDate = new Date();
- var aParams = {_t: oDate.getTime()};
- aParams[this.sParamPrefix + '_action'] = 'make_default';
- aParams[this.sParamPrefix + '_value'] = sUri;
- $.post(
- this.sActionsUrl,
- aParams,
- function(oData) {
- if(oData.code != 0 && oData.message.length > 0) {
- bx_alert(oData.message);
- return;
- }
- document.location.href = document.location.href;
- },
- 'json'
- );
- };
- BxDolStudioDesigner.prototype.deleteIcon = function(sName) {
- var $this = this;
- var oDate = new Date();
- var aParams = {_t: oDate.getTime()};
- aParams[this.sParamPrefix + '_action'] = 'delete_icon';
- aParams[this.sParamPrefix + '_value'] = sName;
- $.post(
- this.sActionsUrl,
- aParams,
- function(oData) {
- if(oData.code != 0 && oData.message.length > 0) {
- bx_alert(oData.message);
- return;
- }
- $('.adm-dsg-ip-' + sName).bx_anim('hide', $this.sAnimationEffect, $this.iAnimationSpeed, function() {
- $(this).remove();
- });
- },
- 'json'
- );
- };
- BxDolStudioDesigner.prototype.deleteCover = function(sType, iId) {
- var $this = this;
- var oDate = new Date();
- var aParams = {_t: oDate.getTime()};
- aParams[this.sParamPrefix + '_action'] = 'delete_cover';
- aParams[this.sParamPrefix + '_value'] = sType;
- $.post(
- this.sActionsUrl,
- aParams,
- function(oData) {
- if(oData.code != 0 && oData.message.length > 0) {
- bx_alert(oData.message);
- return;
- }
- $('#bx-dsg-cover-' + iId).bx_anim('hide', $this.sAnimationEffect, $this.iAnimationSpeed, function() {
- $(this).remove();
- });
- },
- 'json'
- );
- };
- /** @} */
|