PATH:
home
/
letacommog
/
letaweb
/
scripts
/* Angular popup module */ angular.module('ui.popup',['ngCkeditor','ui.colorpicker','stgrid','ui.bootstrap','ui.dialog','pagemanager.communication','ui.category_edit','pagemanager.file_manager','ngStorage','pagemanger.authentication']). value('options', { name:'', controller : 'popupmodalController', postData:{} }) .service('popup', ['$controller','options','$dialog','communication',function($controller,options,$dialog,communication) { this.open = function(opt) { return $dialog.open({ template: $('#popup_backend_template_'+ opt.name).html(), controller: function($scope,$modalInstance) { try { $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; var ctrlInstance, ctrlLocals = {}; if(opt.controller ) { ctrlLocals.$scope = $scope; ctrlLocals.$modalInstance = $modalInstance; ctrlInstance = $controller(opt.controller,ctrlLocals); } } catch(e) { console.log(e); } }, size: opt.size, backdrop:opt.backdrop }); } }]) .service('popup_form', ['$controller','options','$dialog','communication',function($controller,options,$dialog,communication) { this.open = function(opt) { return $dialog.open({ template: $('#popup_backend_template_'+ opt.name).html(), controller: function($scope,$modalInstance) { try { $scope.data = angular.copy(opt.data || {}); $scope.errors = {}; $scope.close = function () { $dialog.confirm2( { title:window.t('LBL_DISCARD_CHANGE_QUESTION'), message:window.t('LBL_DISCARD_CHANGE_MESSAGE') }).result.then(function(result) { if(result == 1) $scope._save().then(function(data) { $modalInstance.close(data); }); else $modalInstance.dismiss('cancel'); }); }; $scope.save = function() { var valid = true; if($scope.form) { valid = ($scope.form.$valid); } if(valid) $scope._save().then(function(data) { if(data.success!= undefined && !data.success) return; $modalInstance.close(data); }); else console.log($scope.form.$error); } $scope.save_new = function() { $scope._save().then(function(data) { $modalInstance.close(data); }); } $scope._save = function() { var data = $scope.data; if(angular.isDefined(opt.form_name)) { data = {}; data[opt.form_name] = $scope.data; } var saveAction = opt.save_action || 'saveForm'; return communication.api(saveAction, data, opt.execute_path, false).then(function(data) { return data; }, function(data) { $scope.errors = data.message; return data; }); } var ctrlInstance, ctrlLocals = {}; if(opt.controller ) { ctrlLocals.$scope = $scope; ctrlLocals.$modalInstance = $modalInstance; ctrlInstance = $controller(opt.controller,ctrlLocals); } } catch(e) { console.log(e); } }, size: opt.size, backdrop:false }); } }]) .service('popup_grid', ['popup','$controller','options','$dialog','communication',function(popup,$controller,options,$dialog,communication) { this.open = function(opt) { return popup.open({ name: opt.name, controller: function($scope,$modalInstance) { $scope.gridInstance={}; try { $scope.close = function () { $modalInstance.dismiss('cancel'); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; $scope.ok = function() { var rows = $scope.gridInstance.selections; $modalInstance.close(rows); console.log(rows); } var ctrlInstance, ctrlLocals = {}; if(opt.controller ) { ctrlLocals.$scope = $scope; ctrlLocals.$modalInstance = $modalInstance; ctrlInstance = $controller(opt.controller,ctrlLocals); } } catch(e) { console.log(e); } }, size: opt.size, backdrop:true }); } }]) .controller('popupmodalController',['$scope','options',function($scope, options) { $scope.popupData = {}; communication.api('getFormData',options.postData) .then(function(response) { $scope.popupData = response; }); }]);
[+]
..
[+]
sample_images
[-] ssultils.js
[edit]
[-] dialog.js
[edit]
[-] colorpicker.js
[edit]
[-] script.js
[edit]
[+]
libraries
[-] ui.dbfilter-editing.js
[edit]
[-] stgrid.js
[edit]
[-] ui.category-editing.js
[edit]
[-] forms.js
[edit]
[-] player.swf
[edit]
[-] language.js
[edit]
[-] im.js
[edit]
[-] terms_en.js
[edit]
[-] skinutils.js
[edit]
[-] create_page.js
[edit]
[-] ihover.js
[edit]
[-] builder.js
[edit]
[-] ui.tab-content.js
[edit]
[-] admin.js
[edit]
[-] ui.tab-editing.js
[edit]
[-] login.js
[edit]
[-] popup.js
[edit]
[-] ecommerce.js
[edit]
[-] stEditor.js
[edit]
[-] colorutils.js
[edit]
[-] livedemo.js
[edit]
[-] palette.js
[edit]
[+]
editor