PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($window,pageEdit_layout,$dialog, $controller,pageEdit_ddManager,$file_manager,$q,communication, pageEdit,pageEdit_event) { this.view; this.initializeData = {}; this._loadElement = function(element) { this.element = element; this.skin = this.skin || jQuery(element).attr('data-skin') || ''; this.system_id = this.system_id || jQuery(element).attr('rel') || 0; this.page_id = this.page_id || jQuery(element).attr('id'); var dataDiv = jQuery('script[type="text/json"]#'+this.page_id+'_data'); var dataString = dataDiv.html(); if(!this.is_clone_element) { var data = {}; try { data = $.parseJSON(unescape(dataString)); data = $.extend({},true,data); } catch(e) { // console.log(e); console.log(dataString); } this.module_data = this.module_data || data; } var viewDiv = jQuery('script[type="text/json"]#'+this.page_id+'_view'); if(this.view == undefined) this.view = viewDiv.html(); $(element).removeAttr('rel') dataDiv.remove(); viewDiv.remove(); var that = this; this.bindEvent(); this._loadAnimation(); }; this.controller = function($scope, $moduleInstance) { console.log($scope.data); $scope.change = function() { var template = window.twig({ data: $moduleInstance.view }); var html = template.render($scope.data) $moduleInstance.getElement().html(html); } }; this.openEditor = function() { var that = this; var modal = $dialog.open({ windowTemplateUrl:"template/dialog/window.html", templateUrl: getRelativeUrl() + 'api?path=base&action=getCustomModuleHtml&name='+ this.type, // size:'sm', backdrop:false, controller: function($scope,$modalInstance) { $window.module_editing = true; that.editing = true; if(that.bases) { for(var i in that.bases) { if(!that.bases.hasOwnProperty(i)) continue; if(that.bases[i].controller != undefined) { try { $controller(that.bases[i].controller, {$scope: $scope,$modalInstance:$modalInstance, $moduleInstance:that}) } catch(e) { console.log(e); } } } } try { $controller(that.controller, {$scope: $scope,$modalInstance:$modalInstance, $moduleInstance:that}) } catch(e) { console.log(e); } } }); modal.result.then(function() { delete $window.module_editing; delete that.editting; },function() { delete $window.module_editing; delete that.editting; }); return modal; }; }) });
[+]
..
[-] productlist.js
[edit]
[-] facebookvideo.js
[edit]
[-] newslist.js
[edit]
[-] image.js
[edit]
[-] video.js
[edit]
[-] button.js
[edit]
[-] zone.js
[edit]
[-] text.js
[edit]
[-] newscategory.js
[edit]
[-] googlemap.js
[edit]
[-] base_structure.js
[edit]
[-] contactform.js
[edit]
[-] spacer.js
[edit]
[-] infobox.js
[edit]
[-] html.js
[edit]
[-] testmodule.js
[edit]
[-] facebookcomment.js
[edit]
[-] iframe.js
[edit]
[-] twitterfeed.js
[edit]
[-] recentnews.js
[edit]
[-] audio_player.js
[edit]
[-] slick.js
[edit]
[-] newsdetail.js
[edit]
[-] facebookpost.js
[edit]
[-] pagezone.js
[edit]
[-] panigation.js
[edit]
[-] row.js
[edit]
[-] __custom_module_template.js
[edit]
[-] carousel.js
[edit]
[-] icon.js
[edit]
[-] typedtext.js
[edit]
[-] newscomment.js
[edit]
[-] box.js
[edit]
[-] base_custom.js
[edit]
[-] wordpress.js
[edit]
[-] base.js
[edit]
[-] column.js
[edit]
[-] fancytext.js
[edit]
[-] recentproduct.js
[edit]
[-] statcounter.js
[edit]
[-] tab.js
[edit]
[-] bootstrap_slider.js
[edit]
[-] ihover.js
[edit]
[-] line.js
[edit]
[-] blogger.js
[edit]
[-] slideshow.js
[edit]
[-] title.js
[edit]
[-] facebookpage.js
[edit]
[-] share_buttons.js
[edit]
[-] facebooklike.js
[edit]
[-] infobanner.js
[edit]
[-] rssfeed.js
[edit]
[-] flash.js
[edit]
[-] countdown.js
[edit]
[-] facebooksend.js
[edit]
[-] mailchimp.js
[edit]
[-] infotable.js
[edit]
[-] navbar.js
[edit]
[-] cycleslider.js
[edit]
[-] modal.js
[edit]
[-] embed.js
[edit]
[-] alert.js
[edit]
[-] progress_bar.js
[edit]
[-] accordion.js
[edit]
[-] youtube.js
[edit]
[-] social_buttons.js
[edit]
[-] productcategory.js
[edit]
[-] menu.js
[edit]
[-] pricetable.js
[edit]
[-] productdetail.js
[edit]
[-] gallery.js
[edit]