PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($file_manager,$dialog,popup) { this.initializeData = {layout_type: 0,buttons: ['facebook_like','tweet','google_plusone' ]}; this.map = [ {buttontype:1, buttonstyle:'horizontal'}, {buttontype:0, buttonstyle:'horizontal'}, {buttontype:0, buttonstyle:'horizontal'}, {buttontype:3}, {buttontype:1, buttonstyle:'vertical'}, {buttontype:0, buttonstyle:'vertical'}, {buttontype:0, buttonstyle:'vertical'} ]; this.replace_p0 = { 'compact2':'compact', 'hyves_respect':'hyves', 'linkedin_counter':'linkedin', 'stumbleupon_badge':'stumbleupon', 'facebook_like':'facebook', 'tweet':'twitter', 'google_plusone':'google_plusone_share', 'pinterest_pinit':'pinterest_share', }; this.replace_p1 = { 'compact':'compact2', 'hyves':'hyves_respect', 'linkedin':'linkedin_counter', 'stumbleupon':'stumbleupon_badge', 'facebook':'facebook_like', 'twitter':'tweet', 'google_plusone_share':'google_plusone', 'pinterest_share':'pinterest_pinit' }; this.multi_button = {'compact':[1,2],}; this.changelayout_type = function() { var buttons = this.module_data.buttons; var map = this.map; var replace_p0 = this.replace_p0; var replace_p1 = this.replace_p1; var l = this.module_data.layout_type || 0; l = map[l].buttontype; var r = l == 0 ? replace_p0 : replace_p1; for(var i = 0;i < buttons.length;i++) { if(r [ buttons[i] ] ) { buttons[i] = r [ buttons[i] ]; } } this.loadHtml(); }; this.controller = function($scope, $moduleInstance,communication) { $scope.changeLayout = function() { $moduleInstance.module_data = $scope.data; $moduleInstance.changelayout_type(); } $scope.openConfigButtonDialog = function() { popup.open({ name:'shareButtonConfig', controller: function($scope, $modalInstance) { $scope.ok = function() { // $scope.shareButtonConfigForm.submit(); $scope.$dismiss(); } } }) } $scope.openEditButtonDialog = function() { var modalInstance = $dialog.open({ templateUrl:getRelativeUrl() + 'api?path=content&action=getHtml&name=modules/share_buttons/edit_buttons', controller: function($scope,$modalInstance) { $scope.buttons=[]; $scope.sortableOptions = { connectWith: '.customize_buttons' }; $scope.ok = function() { $modalInstance.close($scope.buttons); } $scope.cancel = function() { $modalInstance.dismiss('cancel'); } communication.getSocialShareButtonList().then(function(json) { $scope.avaiable_buttons = json; var map = $scope.map; var layout_type = $moduleInstance.module_data.layout_type || 0; var map = $moduleInstance.map; var replace_p0 = $moduleInstance.replace_p0; var replace_p1 = $moduleInstance.replace_p1; var l = map[layout_type].buttontype; var r = l == 0 ? replace_p0 : replace_p1; var that = this; for(var j = 0;j < $moduleInstance.module_data.buttons.length;j++) { var flag = false; var ij = false; for(var i = 0;i < json.length;i++) { if($moduleInstance.module_data.buttons[j] == json[i].name) { flag = true; ij = i; } } if(flag) { $scope.buttons.push(angular.copy(json[ij])); $scope.avaiable_buttons.splice(ij,1); } } }); } }); modalInstance.result.then(function(data) { $moduleInstance.module_data.buttons = []; for(var i = 0;i < data.length;i++) { $moduleInstance.module_data.buttons.push(data[i].name); } }) } }; }); });
[+]
..
[-] 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]