PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
social_buttons
define(['module/base'],function(base) { return createModuleDefinition([base], function($file_manager,$dialog, pageEdit_event) { this.initializeData = { arrange:'horizontal', style:'circle', align:'left', buttons: [{type: 'facebook', title:'Facebook', link:'#'}, {type: 'twitter', title:'Twitter', link:'#'}, {type: 'rss', title:'RSS', link:'#'}, ] }; this.controller = function($scope, $moduleInstance) { $scope.editImageItem = function(index) { if($scope.editing_item == index) return false; $scope.editing_item = $scope.data.buttons[index]; $scope.editing = true; $scope.editing_index = index; }; $scope.addImageItem = function() { var n = {type: 'facebook', title:'Facebook', link:'#'}; $scope.data.buttons.push(n); $scope.editImageItem($scope.data.buttons.length-1); var buttons = $moduleInstance.getElement().children('.buttons').children('ul'); var li = jQuery('<li/>'); buttons.append(li); var a = jQuery('<a/>').attr('class','social_icon social_icon_'+n.type); a.attr('title',n.title); a.attr('href',n.link); li.append(a); } $scope.changeButton = function() { var buttons = $moduleInstance.getElement().children('.buttons'); var li = buttons.children('ul').children('li:eq(' + $scope.editing_index+')'); var a = li.children('a').attr('class','social_icon social_icon_' + $scope.editing_item.type); a.attr('title',$scope.editing_item.title); a.attr('href',$scope.editing_item.link); }; $scope.deleteImageItem = function(index) { if(index == $scope.editing_index) $scope.editing=false; $moduleInstance.module_data = $scope.data; $scope.data.buttons.splice(index ,1); var buttons = $moduleInstance.getElement().children('.buttons'); var li = buttons.children('ul').children('li:eq(' + index+')'); li.remove(); }; $scope.changeArrange = function(data) { $moduleInstance.module_data = $scope.data; var id = $moduleInstance.page_id; var buttons = $moduleInstance.getElement().children('.buttons'); var css = '#' + id + ' li'; buttons.removeClass('vertical-buttons'); $scope.data.arrange == 'vertical' ? buttons.addClass('vertical-buttons') : ''; }; $scope.changeAlign = function(data) { $moduleInstance.module_data = $scope.data; var id = $moduleInstance.page_id; var buttons = $moduleInstance.getElement().children('.buttons'); var a = ['left','right','center']; for(var i =0;i < a.length;i++) buttons.removeClass('text-'+a[i]); buttons.addClass('text-'+$scope.data.align); }; $scope.changeStyle = function(data) { var id = $moduleInstance.page_id; var css = '#' + id + ' a'; var buttons = $moduleInstance.getElement().children('.buttons'); var v = $scope.data.style == 'character' ? 'uppercase' : 'lowercase'; var a = ['uppercase','lowercase']; for(var i =0;i < a.length;i++) buttons.removeClass('text-'+a[i]); buttons.addClass('text-'+v); } }; }); });
[+]
..
[-] frontend_view.php
[edit]
[-] backend.php
[edit]
[-] backend.js
[edit]
[-] frontend_script.php
[edit]
[-] frontend_class.php
[edit]