{:uriI"file:///Users/jaunkst/Docker/alchemy_cms/app/assets/javascripts/alchemy_cms/modules/directives/angular-redactor.js?type=application/javascript&pipeline=self&id=1acfe039fad1d2b681070daf059359592f760b0968ed0bfcd5e3b11e26ba57f8:ET:load_pathI"=/Users/jaunkst/Docker/alchemy_cms/app/assets/javascripts;F: filenameI"p/Users/jaunkst/Docker/alchemy_cms/app/assets/javascripts/alchemy_cms/modules/directives/angular-redactor.js;T: nameI"4alchemy_cms/modules/directives/angular-redactor;T:logical_pathI" * * additional options: * redactor: hash (pass in a redactor options hash) * */ var redactorOptions = {}; angular.module('angular-redactor', []) .constant('redactorOptions', redactorOptions) .directive('redactor', ['$timeout', function($timeout) { return { restrict: 'A', require: 'ngModel', link: function(scope, element, attrs, ngModel) { // Expose scope var with loaded state of Redactor scope.redactorLoaded = false; var updateModel = function updateModel(value) { // $timeout to avoid $digest collision $timeout(function() { scope.$apply(function() { ngModel.$setViewValue(value); }); }); }, options = { changeCallback: updateModel }, additionalOptions = attrs.redactor ? scope.$eval(attrs.redactor) : {}, editor, $_element = angular.element(element); angular.extend(options, redactorOptions, additionalOptions); // prevent collision with the constant values on ChangeCallback var changeCallback = additionalOptions.changeCallback || redactorOptions.changeCallback; if (changeCallback) { options.changeCallback = function(value) { updateModel.call(this, value); changeCallback.call(this, value); } } // put in timeout to avoid $digest collision. call render() to // set the initial value. $timeout(function() { editor = $_element.redactor(options); ngModel.$render(); }); ngModel.$render = function() { if(angular.isDefined(editor)) { $timeout(function() { $_element.redactor('code.set', ngModel.$viewValue || ''); $_element.redactor('placeholder.toggle'); scope.redactorLoaded = true; }); } }; } }; }]); })(); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"~file-digest:///Users/jaunkst/Docker/alchemy_cms/app/assets/javascripts/alchemy_cms/modules/directives/angular-redactor.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%eM#-z6)2HYKo5: lengthi :integrityI"9sha-256-n/LylL1ls02c4iMcLeKiejYpkDJIWYVLkOe+b7XpNX8=;T:dependencies_digest"%rB#xyart6j:idI"E1acfe039fad1d2b681070daf059359592f760b0968ed0bfcd5e3b11e26ba57f8;F: mtimel+zBU