PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($window) { this.initializeData = { texts:[ {label:'Well done! You successfully read this important alert message. '}, {label:'Heads up! This alert needs your attention, but it\'s not super important.'} ], prefix_text:'Before', postfix_text:'After', settings : { typeSpeed: 0, startDelay: 0, backSpeed: 0, backDelay: 500, showItems: 1, height: 0, margin: 0, padding: 0, loopCount:1 } }; this.getState = function() { return jQuery('#' + this.page_id + '_typed').data('typed'); }; this.controller = function($scope, $moduleInstance) { var state = $moduleInstance.getState(); var vtickerEl = jQuery('#' + $moduleInstance.page_id + '_typed'); $scope.animating = !vtickerEl.hasClass('completed'); vtickerEl.unbind("type_animating"); vtickerEl.bind("type_animating", function() { $scope.animating = true; $scope.$digest(); }); vtickerEl.unbind("type_completed"); vtickerEl.bind("type_completed", function() { $scope.animating = false; $scope.$digest(); }); $scope.editText = function(index) { getElement(index); $scope.data.texts[index].edit_mode = 1; } var getElement = function(index) { var state = $moduleInstance.getState(); if(state.topIndex!= undefined) { var topIndex = state.topIndex % state.itemCount; var realIndex = (index - topIndex) < 0 ? (state.itemCount + index - topIndex) : (index - topIndex); // console.log(state.itemCount,realIndex); //console.log(vtickerEl.children('ul').children('li').eq( realIndex)); return (vtickerEl.children('ul').children('li').eq( realIndex)); } } $scope.changeLabel = function(index) { if($scope.animating) return; var state = $moduleInstance.getState(); var label = $scope.data.texts[index].label; state.strings[index] = label; if(index == $scope.data.texts.length - 1) { jQuery('#' + $moduleInstance.page_id + '_typed').html(label); } } $scope.deleteText = function(index) { if($scope.animating) return; $scope.data.texts.splice(index,1); var alertElement = $moduleInstance.getElement().children().children('.alert:eq('+index+')'); alertElement.remove(); console.log(alertElement); } $scope.addText = function() { if($scope.animating) return; var state = $moduleInstance.getState(); var p = {icon:'fa fa-info-circle',label:'New Text.'}; $scope.data.texts.push(p); state.strings.push(p.label); } $scope.changePostfix = function() { var postElement = vtickerEl.nextAll('span:not(.typed-cursor)'); postElement.html($scope.data.postfix_text) } $scope.changePrefix = function() { var preElement = vtickerEl.prev('span:not(.typed-cursor)'); preElement.html($scope.data.prefix_text) } $scope.changeSettings = function() { this.typeSpeed = this.options.typeSpeed; this.startDelay = this.options.startDelay; this.backSpeed = this.options.backSpeed; this.backDelay = this.options.backDelay; } $scope.play = function() { play(); } $scope.stop = function() { stop(); } var play = function() { var state = $moduleInstance.getState(); $scope.animating = true; jQuery('.typed-cursor',$moduleInstance.getElement()).remove(); state.arrayPos = 0; state.stop = false; state.build(); } var stop = function() { var state = $moduleInstance.getState(); $scope.animating = false; state.stop = true; } }; }) });
[+]
..
[-] 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]