Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
');if(attrs.taToolbar)_toolbar.attr("ta-toolbar",attrs.taToolbar);if(attrs.taToolbarClass)_toolbar.attr("ta-toolbar-class",attrs.taToolbarClass);if(attrs.taToolbarGroupClass)_toolbar.attr("ta-toolbar-group-class",attrs.taToolbarGroupClass);if(attrs.taToolbarButtonClass)_toolbar.attr("ta-toolbar-button-class",attrs.taToolbarButtonClass);if(attrs.taToolbarActiveButtonClass)_toolbar.attr("ta-toolbar-active-button-class",attrs.taToolbarActiveButtonClass);if(attrs.taFocussedClass)_toolbar.attr("ta-focussed-class",attrs.taFocussedClass);element.prepend(_toolbar);$compile(_toolbar)(scope.$parent);_editorFunctions=textAngularManager.registerEditor(scope._name,scope,["textAngularToolbar"+_serial])}scope.$on("$destroy",function(){textAngularManager.unregisterEditor(scope._name);angular.element(window).off("blur");angular.element(window).off("resize",scope.handlePopoverEvents);angular.element(window).off("scroll",scope.handlePopoverEvents)});scope.$on("ta-element-select",function(event,element){if(_editorFunctions.triggerElementSelect(event,element)){scope["reApplyOnSelectorHandlerstaTextElement"+_serial]()}});scope.$on("ta-drop-event",function(event,element,dropEvent,dataTransfer){if(dataTransfer&&dataTransfer.files&&dataTransfer.files.length>0){scope.displayElements.text[0].focus();taSelection.setSelectionToElementEnd(dropEvent.target);angular.forEach(dataTransfer.files,function(file){try{$q.when(scope.fileDropHandler(file,scope.wrapSelection)||scope.fileDropHandler!==scope.defaultFileDropHandler&&$q.when(scope.defaultFileDropHandler(file,scope.wrapSelection))).then(function(){scope["updateTaBindtaTextElement"+_serial]()})}catch(error){$log.error(error)}});dropEvent.preventDefault();dropEvent.stopPropagation()}else{$timeout(function(){scope["updateTaBindtaTextElement"+_serial]()},0)}});scope._bUpdateSelectedStyles=false;angular.element(window).on("blur",function(){scope._bUpdateSelectedStyles=false;scope.focussed=false});scope.updateSelectedStyles=function(){var _selection;if(_updateSelectedStylesTimeout)$timeout.cancel(_updateSelectedStylesTimeout);if((_selection=taSelection.getSelectionElement())!==undefined&&_selection.parentNode!==scope.displayElements.text[0]){_editorFunctions.updateSelectedStyles(angular.element(_selection))}else _editorFunctions.updateSelectedStyles();if(scope._bUpdateSelectedStyles)_updateSelectedStylesTimeout=$timeout(scope.updateSelectedStyles,200)};_keydown=function(){if(!scope.focussed){scope._bUpdateSelectedStyles=false;return}if(!scope._bUpdateSelectedStyles){scope._bUpdateSelectedStyles=true;scope.$apply(function(){scope.updateSelectedStyles()})}};scope.displayElements.html.on("keydown",_keydown);scope.displayElements.text.on("keydown",_keydown);_keyup=function(){scope._bUpdateSelectedStyles=false};scope.displayElements.html.on("keyup",_keyup);scope.displayElements.text.on("keyup",_keyup);_keypress=function(event,eventData){if(taSelection.getSelection){var _selection=taSelection.getSelection();if(taSelection.getSelectionElement()&&taSelection.getSelectionElement().nodeName.toLowerCase()==="a"){if(_selection.start.element.nodeType===3&&_selection.start.element.textContent.length===_selection.end.offset){taSelection.setSelectionAfterElement(taSelection.getSelectionElement())}if(_selection.start.element.nodeType===3&&_selection.start.offset===0){taSelection.setSelectionBeforeElement(taSelection.getSelectionElement())}}}if(eventData)angular.extend(event,eventData);scope.$apply(function(){if(_editorFunctions.sendKeyCommand(event)){if(!scope._bUpdateSelectedStyles){scope.updateSelectedStyles()}event.preventDefault();return false}})};scope.displayElements.html.on("keypress",_keypress);scope.displayElements.text.on("keypress",_keypress);_mouseup=function(){scope._bUpdateSelectedStyles=false;$timeout(function(){scope.updateSelectedStyles()},0)};scope.displayElements.html.on("mouseup",_mouseup);scope.displayElements.text.on("mouseup",_mouseup)}}}]);textAngular.service("textAngularManager",["taToolExecuteAction","taTools","taRegisterTool","$interval","$rootScope","$log",function(taToolExecuteAction,taTools,taRegisterTool,$interval,$rootScope,$log){var toolbars={},editors={};var timeRecentModification=0;var updateStyles=function(selectedElement){angular.forEach(editors,function(editor){editor.editorFunctions.updateSelectedStyles(selectedElement)})};var triggerInterval=50;var triggerIntervalTimer;var setupTriggerUpdateStyles=function(){timeRecentModification=Date.now();triggerIntervalTimer=$interval(function(){updateStyles();triggerIntervalTimer=undefined},triggerInterval,1)};$rootScope.$on("destroy",function(){if(triggerIntervalTimer){$interval.cancel(triggerIntervalTimer);triggerIntervalTimer=undefined}});var touchModification=function(){if(Math.abs(Date.now()-timeRecentModification)>triggerInterval){setupTriggerUpdateStyles()}};return{registerEditor:function(editorName,editorScope,targetToolbars){if(!editorName||editorName==="")throw"textAngular Error: An editor requires a name";if(!editorScope)throw"textAngular Error: An editor requires a scope";if(editors[editorName])throw'textAngular Error: An Editor with name "'+editorName+'" already exists';editors[editorName]={scope:editorScope,toolbars:targetToolbars,toolbarScopes:[],_registerToolbarScope:function(toolbarScope){if(this.toolbars.indexOf(toolbarScope.name)>=0){this.toolbarScopes.push(toolbarScope)}},editorFunctions:{disable:function(){angular.forEach(editors[editorName].toolbarScopes,function(toolbarScope){toolbarScope.disabled=true})},enable:function(){angular.forEach(editors[editorName].toolbarScopes,function(toolbarScope){toolbarScope.disabled=false})},focus:function(){angular.forEach(editors[editorName].toolbarScopes,function(toolbarScope){toolbarScope._parent=editorScope;toolbarScope.disabled=false;toolbarScope.focussed=true});editorScope.focussed=true},unfocus:function(){angular.forEach(editors[editorName].toolbarScopes,function(toolbarScope){toolbarScope.disabled=true;toolbarScope.focussed=false});editorScope.focussed=false},updateSelectedStyles:function(selectedElement){angular.forEach(editors[editorName].toolbarScopes,function(toolbarScope){angular.forEach(toolbarScope.tools,function(toolScope){if(toolScope.activeState){toolbarScope._parent=editorScope;toolScope.active=toolScope.activeState(selectedElement)}})})},sendKeyCommand:function(event){var result=false;if(event.ctrlKey||event.metaKey||event.specialKey)angular.forEach(taTools,function(tool,name){if(tool.commandKeyCode&&(tool.commandKeyCode===event.which||tool.commandKeyCode===event.specialKey)){for(var _t=0;_t0){for(var _i=0;_i");if(toolDefinition&&toolDefinition["class"])toolElement.addClass(toolDefinition["class"]);else toolElement.addClass(scope.classes.toolbarButton);toolElement.attr("name",toolScope.name);toolElement.attr("ta-button","ta-button");toolElement.attr("ng-disabled","isDisabled()");toolElement.attr("tabindex","-1");toolElement.attr("ng-click","executeAction()");toolElement.attr("ng-class","displayActiveToolClass(active)");if(toolDefinition&&toolDefinition.tooltiptext){toolElement.attr("title",toolDefinition.tooltiptext)}if(toolDefinition&&!toolDefinition.display&&!toolScope._display){toolElement[0].innerHTML="";if(toolDefinition.buttontext)toolElement[0].innerHTML=toolDefinition.buttontext;if(toolDefinition.iconclass){var icon=angular.element(""),content=toolElement[0].innerHTML;icon.addClass(toolDefinition.iconclass);toolElement[0].innerHTML="";toolElement.append(icon);if(content&&content!=="")toolElement.append(" "+content)}}toolScope._lastToolDefinition=angular.copy(toolDefinition);return $compile(toolElement)(toolScope)};scope.tools={};scope._parent={disabled:true,showHtml:false,queryFormatBlockState:function(){return false},queryCommandState:function(){return false}};var defaultChildScope={$window:$window,$editor:function(){return scope._parent},isDisabled:function(){if(this.name==="html"&&scope._parent.startAction){return false}return typeof this.$eval("disabled")!=="function"&&this.$eval("disabled")||this.$eval("disabled()")||this.name!=="html"&&this.$editor().showHtml||this.$parent.disabled||this.$editor().disabled},displayActiveToolClass:function(active){return active?scope.classes.toolbarButtonActive:""},executeAction:taToolExecuteAction};angular.forEach(scope.toolbar,function(group){var groupElement=angular.element("
");groupElement.addClass(scope.classes.toolbarGroup);angular.forEach(group,function(tool){scope.tools[tool]=angular.extend(scope.$new(true),taTools[tool],defaultChildScope,{name:tool});scope.tools[tool].$element=setupToolElement(taTools[tool],scope.tools[tool]);groupElement.append(scope.tools[tool].$element)});element.append(groupElement)});scope.updateToolDisplay=function(key,_newTool,forceNew){var toolInstance=scope.tools[key];if(toolInstance){if(toolInstance._lastToolDefinition&&!forceNew)_newTool=angular.extend({},toolInstance._lastToolDefinition,_newTool);if(_newTool.buttontext===null&&_newTool.iconclass===null&&_newTool.display===null)throw'textAngular Error: Tool Definition for updating "'+key+'" does not have a valid display/iconclass/buttontext value';if(_newTool.buttontext===null){delete _newTool.buttontext}if(_newTool.iconclass===null){delete _newTool.iconclass}if(_newTool.display===null){delete _newTool.display}var toolElement=setupToolElement(_newTool,toolInstance);toolInstance.$element.replaceWith(toolElement);toolInstance.$element=toolElement}};scope.addTool=function(key,_newTool,groupIndex,index){scope.tools[key]=angular.extend(scope.$new(true),taTools[key],defaultChildScope,{name:key});scope.tools[key].$element=setupToolElement(taTools[key],scope.tools[key]);var group;if(groupIndex===undefined)groupIndex=scope.toolbar.length-1;group=angular.element(element.children()[groupIndex]);if(index===undefined){group.append(scope.tools[key].$element);scope.toolbar[groupIndex][scope.toolbar[groupIndex].length-1]=key}else{group.children().eq(index).after(scope.tools[key].$element);scope.toolbar[groupIndex][index]=key}};textAngularManager.registerToolbar(scope);scope.$on("$destroy",function(){textAngularManager.unregisterToolbar(scope.name)})}}}]);textAngular.directive("textAngularVersion",["textAngularManager",function(textAngularManager){var version=textAngularManager.getVersion();return{restrict:"EA",link:function(scope,element,attrs){element.html(version)}}}]);