diff --git a/angular-highlightjs.js b/angular-highlightjs.js index e978501..148e0bf 100644 --- a/angular-highlightjs.js +++ b/angular-highlightjs.js @@ -1,6 +1,6 @@ /*! angular-highlightjs -version: 0.4.1 -build date: 2015-07-27 +version: 0.4.2 +build date: 2015-07-28 author: Chih-Hsuan Fan https://github.com/pc035860/angular-highlightjs.git */ diff --git a/angular-highlightjs.min.js b/angular-highlightjs.min.js index 84b6362..e2e7886 100644 --- a/angular-highlightjs.min.js +++ b/angular-highlightjs.min.js @@ -1,6 +1,6 @@ /*! angular-highlightjs -version: 0.4.1 -build date: 2015-07-27 +version: 0.4.2 +build date: 2015-07-28 author: Chih-Hsuan Fan https://github.com/pc035860/angular-highlightjs.git */ !function(a,b){"function"==typeof define&&define.amd?define(["angular","highlight.js"],b):"object"==typeof module&&module.exports?module.exports=b(require("angular"),require("highlight.js")):a.returnExports=b(a.angular,a.hljs)}(this,function(a,b){function c(b){var c=!0;return a.forEach(["source","include"],function(a){b[a]&&(c=!1)}),c}var d=a.module("hljs",[]);d.provider("hljsService",function(){var c={};return{setOptions:function(b){a.extend(c,b)},getOptions:function(){return a.copy(c)},$get:function(){return b}}}),d.factory("hljsCache",["$cacheFactory",function(a){return a("hljsCache")}]),d.controller("HljsCtrl",["hljsCache","hljsService",function(b,c){var d=this,e=null,f=null,g=null,h=null;d.init=function(a){e=a},d.setLanguage=function(a){f=a,g&&d.highlight(g)},d.highlightCallback=function(a){h=a},d.highlight=function(i){if(e){var j,k;g=i,f?(k=d._cacheKey(f,g),j=b.get(k),j||(j=c.highlight(f,c.fixMarkup(g),!0),b.put(k,j))):(k=d._cacheKey(g),j=b.get(k),j||(j=c.highlightAuto(c.fixMarkup(g)),b.put(k,j))),e.html(j.value),e.addClass(j.language),null!==h&&a.isFunction(h)&&h()}},d.clear=function(){e&&(g=null,e.text(""))},d.release=function(){e=null},d._cacheKey=function(){var a=Array.prototype.slice.call(arguments),b="!angular-highlightjs!";return a.join(b)}}]);var e,f,g,h;return e=["$compile","$parse",function(b,d){return{restrict:"EA",controller:"HljsCtrl",compile:function(e,f,g){var h=e[0].innerHTML.replace(/^(\r\n|\r|\n)/m,""),i=e[0].textContent.replace(/^(\r\n|\r|\n)/m,"");return e.html('
'),function(e,f,g,j){var k,l;if(a.isDefined(g.compile)&&(k=d(g.compile)),a.isDefined(g.escape)?l=d(g.escape):a.isDefined(g.noEscape)&&(l=d("false")),j.init(f.find("code")),g.onhighlight&&j.highlightCallback(function(){e.$eval(g.onhighlight)}),(h||i)&&c(g)){var m;m=l&&!l(e)?i:h,j.highlight(m),k&&k(e)&&b(f.find("code").contents())(e)}e.$on("$destroy",function(){j.release()})}}}}],f=function(b){return[function(){return{require:"?hljs",restrict:"A",link:function(c,d,e,f){f&&e.$observe(b,function(b){a.isDefined(b)&&f.setLanguage(b)})}}}]},g=function(b){return["$compile","$parse",function(c,d){return{require:"?hljs",restrict:"A",link:function(e,f,g,h){var i;h&&(a.isDefined(g.compile)&&(i=d(g.compile)),e.$watch(g[b],function(a,b){a?(h.highlight(a),i&&i(e)&&c(f.find("code").contents())(e)):h.clear()}))}}}]},h=function(b){return["$http","$templateCache","$q","$compile","$parse",function(c,d,e,f,g){return{require:"?hljs",restrict:"A",compile:function(h,i,j){var k=i[b];return function(b,h,i,j){var l,m=0;j&&(a.isDefined(i.compile)&&(l=g(i.compile)),b.$watch(k,function(g){var i=++m;if(g&&a.isString(g)){var k,n;k=d.get(g),k||(n=e.defer(),c.get(g,{cache:d,transformResponse:function(a,b){return a}}).success(function(a){i===m&&n.resolve(a)}).error(function(){i===m&&j.clear(),n.resolve()}),k=n.promise),e.when(k).then(function(c){c&&(a.isArray(c)?c=c[1]:a.isObject(c)&&(c=c.data),c=c.replace(/^(\r\n|\r|\n)/m,""),j.highlight(c),l&&l(b)&&f(h.find("code").contents())(b))})}else j.clear()}))}}}}]},d.directive("hljs",e).directive("language",f("language")).directive("source",g("source")).directive("include",h("include")),"hljs"});
\ No newline at end of file
diff --git a/bower.json b/bower.json
index 246eed5..66988a7 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-highlightjs",
- "version": "0.4.1",
+ "version": "0.4.2",
"description": "AngularJS directive for syntax highlighting with highlight.js.",
"main": "./build/angular-highlightjs.js",
"ignore": [
diff --git a/build/angular-highlightjs.js b/build/angular-highlightjs.js
index e978501..148e0bf 100644
--- a/build/angular-highlightjs.js
+++ b/build/angular-highlightjs.js
@@ -1,6 +1,6 @@
/*! angular-highlightjs
-version: 0.4.1
-build date: 2015-07-27
+version: 0.4.2
+build date: 2015-07-28
author: Chih-Hsuan Fan
https://github.com/pc035860/angular-highlightjs.git */
diff --git a/build/angular-highlightjs.min.js b/build/angular-highlightjs.min.js
index 84b6362..e2e7886 100644
--- a/build/angular-highlightjs.min.js
+++ b/build/angular-highlightjs.min.js
@@ -1,6 +1,6 @@
/*! angular-highlightjs
-version: 0.4.1
-build date: 2015-07-27
+version: 0.4.2
+build date: 2015-07-28
author: Chih-Hsuan Fan
https://github.com/pc035860/angular-highlightjs.git */
!function(a,b){"function"==typeof define&&define.amd?define(["angular","highlight.js"],b):"object"==typeof module&&module.exports?module.exports=b(require("angular"),require("highlight.js")):a.returnExports=b(a.angular,a.hljs)}(this,function(a,b){function c(b){var c=!0;return a.forEach(["source","include"],function(a){b[a]&&(c=!1)}),c}var d=a.module("hljs",[]);d.provider("hljsService",function(){var c={};return{setOptions:function(b){a.extend(c,b)},getOptions:function(){return a.copy(c)},$get:function(){return b}}}),d.factory("hljsCache",["$cacheFactory",function(a){return a("hljsCache")}]),d.controller("HljsCtrl",["hljsCache","hljsService",function(b,c){var d=this,e=null,f=null,g=null,h=null;d.init=function(a){e=a},d.setLanguage=function(a){f=a,g&&d.highlight(g)},d.highlightCallback=function(a){h=a},d.highlight=function(i){if(e){var j,k;g=i,f?(k=d._cacheKey(f,g),j=b.get(k),j||(j=c.highlight(f,c.fixMarkup(g),!0),b.put(k,j))):(k=d._cacheKey(g),j=b.get(k),j||(j=c.highlightAuto(c.fixMarkup(g)),b.put(k,j))),e.html(j.value),e.addClass(j.language),null!==h&&a.isFunction(h)&&h()}},d.clear=function(){e&&(g=null,e.text(""))},d.release=function(){e=null},d._cacheKey=function(){var a=Array.prototype.slice.call(arguments),b="!angular-highlightjs!";return a.join(b)}}]);var e,f,g,h;return e=["$compile","$parse",function(b,d){return{restrict:"EA",controller:"HljsCtrl",compile:function(e,f,g){var h=e[0].innerHTML.replace(/^(\r\n|\r|\n)/m,""),i=e[0].textContent.replace(/^(\r\n|\r|\n)/m,"");return e.html('
'),function(e,f,g,j){var k,l;if(a.isDefined(g.compile)&&(k=d(g.compile)),a.isDefined(g.escape)?l=d(g.escape):a.isDefined(g.noEscape)&&(l=d("false")),j.init(f.find("code")),g.onhighlight&&j.highlightCallback(function(){e.$eval(g.onhighlight)}),(h||i)&&c(g)){var m;m=l&&!l(e)?i:h,j.highlight(m),k&&k(e)&&b(f.find("code").contents())(e)}e.$on("$destroy",function(){j.release()})}}}}],f=function(b){return[function(){return{require:"?hljs",restrict:"A",link:function(c,d,e,f){f&&e.$observe(b,function(b){a.isDefined(b)&&f.setLanguage(b)})}}}]},g=function(b){return["$compile","$parse",function(c,d){return{require:"?hljs",restrict:"A",link:function(e,f,g,h){var i;h&&(a.isDefined(g.compile)&&(i=d(g.compile)),e.$watch(g[b],function(a,b){a?(h.highlight(a),i&&i(e)&&c(f.find("code").contents())(e)):h.clear()}))}}}]},h=function(b){return["$http","$templateCache","$q","$compile","$parse",function(c,d,e,f,g){return{require:"?hljs",restrict:"A",compile:function(h,i,j){var k=i[b];return function(b,h,i,j){var l,m=0;j&&(a.isDefined(i.compile)&&(l=g(i.compile)),b.$watch(k,function(g){var i=++m;if(g&&a.isString(g)){var k,n;k=d.get(g),k||(n=e.defer(),c.get(g,{cache:d,transformResponse:function(a,b){return a}}).success(function(a){i===m&&n.resolve(a)}).error(function(){i===m&&j.clear(),n.resolve()}),k=n.promise),e.when(k).then(function(c){c&&(a.isArray(c)?c=c[1]:a.isObject(c)&&(c=c.data),c=c.replace(/^(\r\n|\r|\n)/m,""),j.highlight(c),l&&l(b)&&f(h.find("code").contents())(b))})}else j.clear()}))}}}}]},d.directive("hljs",e).directive("language",f("language")).directive("source",g("source")).directive("include",h("include")),"hljs"});
\ No newline at end of file
diff --git a/package.json b/package.json
index b368a7b..6b9e02e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-highlightjs",
- "version": "0.4.1",
+ "version": "0.4.2",
"description": "AngularJS directive for syntax highlighting with highlight.js",
"main": "./build/angular-highlightjs.js",
"directories": {},