Sha256: e04881067671cb6d11338ae8ecd4a4c6b7788d8e831fb9b4ce5d46a49cdfcc00

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

/**
 * angular-ui-ace - This directive allows you to add ACE editor elements.
 * @version v0.0.4 - 2013-08-19
 * @link http://angular-ui.github.com
 * @license MIT
 */
angular.module("ui.ace",[]).constant("uiAceConfig",{}).directive("uiAce",["uiAceConfig",function(a){if(angular.isUndefined(window.ace))throw new Error("ui-ace need ace to work... (o rly?)");return{restrict:"EA",require:"?ngModel",link:function(b,c,d,e){var f,g,h,i,j;f=a.ace||{},g=angular.extend({},f,b.$eval(d.uiAce)),h=window.ace.edit(c[0]),i=h.getSession(),j=function(a){return function(c){var f=i.getValue();f===b.$eval(d.value)||b.$$phase||(angular.isDefined(e)&&b.$apply(function(){e.$setViewValue(f)}),angular.isDefined(a)&&b.$apply(function(){if(!angular.isFunction(a))throw new Error("ui-ace use a function as callback.");a(c,h)}))}},angular.isDefined(g.showGutter)&&h.renderer.setShowGutter(g.showGutter),angular.isDefined(g.useWrapMode)&&i.setUseWrapMode(g.useWrapMode),angular.isFunction(g.onLoad)&&g.onLoad(h),angular.isString(g.theme)&&h.setTheme("ace/theme/"+g.theme),angular.isString(g.mode)&&i.setMode("ace/mode/"+g.mode),d.$observe("readonly",function(a){h.setReadOnly("true"===a)}),angular.isDefined(e)&&(e.$formatters.push(function(a){if(angular.isUndefined(a)||null===a)return"";if(angular.isObject(a)||angular.isArray(a))throw new Error("ui-ace cannot use an object or an array as a model");return a}),e.$render=function(){i.setValue(e.$viewValue)}),i.on("change",j(g.onChange))}}}]);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-repl-0.16.3 assets/js/libs/ui-ace.min.js
alf-repl-0.16.2 assets/js/libs/ui-ace.min.js
alf-repl-0.16.1 assets/js/libs/ui-ace.min.js