PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
infobox
define(['module/base'],function(base) { return createModuleDefinition([base], function($window,$file_manager) { this.initializeData = { title:'This is an icon box.', description:'Write a short description, that will describe the title or something informational and useful.', icon_type:'fa', icon:"fa-filter", image_type:'icon', size:30, align:'top' }; this.controller = function($scope, $moduleInstance) { $scope.changeSize = function() { $moduleInstance.getElement().find('.sts-icon').css('font-size', $scope.data.size + 'px'); } $scope.changeIcon = function() { var icon_inner = $moduleInstance.getElement().find('.sts-icon-inner'); if($scope.data.image_type=='image') { icon_inner.html('<img src="' + $scope.data.image + '">'); } if($scope.data.image_type=='icon') { icon_inner.html('<span class="icon ' + $scope.data.icon_type + ' ' + $scope.data.icon + '"></span>'); } if($scope.data.image_type=='text') { icon_inner.html('<span class="text">' + $scope.data.text_icon + '</span>'); } $moduleInstance.getElement().find('.sts-icon').attr('class', 'sts-icon sts-icon-' + $scope.data.image_type); $moduleInstance.module_data.icon = $scope.data.icon; } $scope.enter_url_mode = 0; $scope.selectFile = function() { $file_manager.open().result.then(function(images) { if(images.length == 0) return; var image = images[0]; $scope.data.image = (image.full_url); $scope.changeSource(); }); } $scope.onUploadComplete = function(files) { if(files!= undefined && files.length > 0) { var file = files[0].response; $scope.data.image = (file.full_url); $scope.changeSource(); } }; $scope.changeSource = function() { $moduleInstance.module_data.image = $scope.data.image; $scope.changeIcon(); } $scope.changeTitle = function() { var title = $moduleInstance.getElement().find('.info_title'); title.children('h3').html($scope.data.title); } $scope.changeDescription = function() { var title = $moduleInstance.getElement().find('.info_description'); title.children('p').html($scope.data.description); } $types = { fa:'font-awesome', glyphicon:'bootstrap', flaticon:'linecons', typcn:'typicons', oi:'open-iconic' }; $scope.font_type = $types[$scope.data.icon_type]; $scope.changeIconType = function() { $scope.font_type = $types[$scope.data.icon_type]; var icon = $moduleInstance.getElement().find('.sts-icon-inner').children('.icon'); icon.attr('class','icon '+ $scope.data.icon_type + ' ' + $scope.data.icon); } $scope.changeAlign = function() { $moduleInstance.getElement().children(".info_box").attr('class', 'info_box info_box_' + $scope.data.align); } }; }) });
[+]
..
[-] frontend_view.php
[edit]
[-] backend.php
[edit]
[-] backend.js
[edit]
[-] frontend_class.php
[edit]