From 09c8cf04af948d073558272d27cc6b0ee7445435 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 11 May 2012 19:09:01 +0200 Subject: [PATCH 01/67] Version is now 0.21-pre. --- README.md | 5 +++++ build.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cb51e95..5eee6a0e 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h ## Changelog +### v0.21 - *2012-05-??* + +* + + ### v0.20 - *2012-05-11* * adds image preview diff --git a/build.properties b/build.properties index 6afaa586..849a0818 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ # project project.name = h5ai -project.version = 0.20 +project.version = 0.21-pre # src src.dir = src From 3d06b0b81a807e83630ab2406bf8685303c60c91 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 28 May 2012 15:06:07 +0200 Subject: [PATCH 02/67] Adds hu translation. --- README.md | 174 ++++++++++++++++++++++---------------------- src/_h5ai/config.js | 16 ++++ 2 files changed, 102 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 5eee6a0e..fbf52fa1 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h ## Changelog -### v0.21 - *2012-05-??* +### v0.21 - *2012-??* -* +* adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) ### v0.20 - *2012-05-11* @@ -65,12 +65,12 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * switches from [Datejs](http://www.datejs.com) to [Moment.js](http://momentjs.com) * adds [underscore.js](http://underscorejs.org) * fixes mousewheel problems, updates [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) to 3.0.6 -* updates lv translation -* adds ro translation by [Jakob Cosoroabă](http://github.com/midday) -* adds ja translation by [metasta](http://github.com/metasta) -* adds nb translation by [Sindre Sorhus](http://github.com/sindresorhus) -* adds sr translation by [vBm](http://github.com/vBm) -* adds gr translation by [xhmikosr](http://github.com/xhmikosr) +* updates `lv` translation +* adds `ro` translation by [Jakob Cosoroabă](http://github.com/midday) +* adds `ja` translation by [metasta](http://github.com/metasta) +* adds `nb` translation by [Sindre Sorhus](http://github.com/sindresorhus) +* adds `sr` translation by [vBm](http://github.com/vBm) +* adds `gr` translation by [xhmikosr](http://github.com/xhmikosr) ### v0.18 - *2012-02-24* @@ -90,8 +90,8 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * improves url hashes * updates year in `LICENSE.TXT` * updates es translation -* adds zh-tw translation by [Yao Wei](http://github.com/medicalwei) -* updates zh-cn translation +* adds `zh-tw` translation by [Yao Wei](http://github.com/medicalwei) +* updates `zh-cn` translation ### v0.17 - *2011-11-28* @@ -126,33 +126,33 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h ### v0.15.2 - *2011-09-18* -* added it translation by [Salvo Gentile](http://github.com/SalvoGentile) and [Marco Patriarca](http://github.com/Fexys) -* switched build process from scripp to wepp +* adds `it` translation by [Salvo Gentile](http://github.com/SalvoGentile) and [Marco Patriarca](http://github.com/Fexys) +* switches build process from scripp to wepp ### v0.15.1 - *2011-09-06* -* fixed security issues with the zipped download feature -* made zipped download optional (but enabled by default) +* fixes security issues with the zipped download feature +* makes zipped download optional (but enabled by default) ### v0.15 - *2011-09-04* -* added zipped download for selected files -* cleaned and refactored +* adds zipped download for selected files +* cleans and refactores ### v0.14.1 - *2011-09-01* * display meta information in bottom bar (icon view) -* added zh-cn translation by [Dongsheng Cai](http://github.com/dongsheng) -* added pl translation by Radosław Zając -* added ru translation by Богдан Илюхин +* adds `zh-cn` translation by [Dongsheng Cai](http://github.com/dongsheng) +* adds `pl` translation by Radosław Zając +* adds `ru` translation by Богдан Илюхин ### v0.14 - *2011-08-16* -* added image thumbnails for PHP version +* adds image thumbnails for PHP version * new option `slideTree` to turn off auto slide in @@ -163,180 +163,178 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h ### v0.13.1 - *2011-08-12* -* ~~hopefully fixed that PHP doesn't get interpreted~~ :/ -* fixed initial tree display -* added sort order option -* added/fixed some translations -* added lv translation by Sandis Veinbergs +* fixes initial tree display +* adds sort order option +* adds/fixes some translations +* adds `lv` translation by Sandis Veinbergs ### v0.13 - *2011-08-06* -* added PHP implementation! (should work with PHP 5.2+) -* added new options -* changed layout of the bottom bar to display status information -* added language selector to the bottom bar -* quoted keys in `options.js` to make it valid json -* changed value of option `lang` from `undefined` to `null` -* added some new keys to `h5aiLangs` -* added browser caching rules for css and js -* added pt translation by [Jonnathan](http://github.com/jonnsl) -* added bg translation by George Andonov +* adds PHP implementation! (should work with PHP 5.2+) +* adds new options +* changes layout of the bottom bar to display status information +* adds language selector to the bottom bar +* quotes keys in `options.js` to make it valid json +* changes value of option `lang` from `undefined` to `null` +* adds some new keys to `h5aiLangs` +* adds browser caching rules for css and js +* adds `pt` translation by [Jonnathan](http://github.com/jonnsl) +* adds `bg` translation by George Andonov ### v0.12.3 - *2011-07-30* -* added tr translation by [Batuhan Icoz](http://github.com/batuhanicoz) +* adds `tr` translation by [Batuhan Icoz](http://github.com/batuhanicoz) ### v0.12.2 - *2011-07-30* -* added es translation by Jose David Calderon Serrano +* adds `es` translation by Jose David Calderon Serrano ### v0.12.1 - *2011-07-29* -* fixed unchecked use of console.log +* fixes unchecked use of console.log ### v0.12 - *2011-07-28* -* improved performance +* improves performance ### v0.11 - *2011-07-27* -* changed license to MIT license, see `LICENSE.txt` +* changes license to MIT license, see `LICENSE.txt` ### v0.10.2 - *2011-07-26* -* improved tree scrollbar +* improves tree scrollbar ### v0.10.1 - *2011-07-24* -* fixed problems with ' in links +* fixes problems with ' in links ### v0.10 - *2011-07-24* -* fixed problems with XAMPP on Windows (see `dot.htaccess` comments for instructions) -* fixed tree fade-in-fade-out effect for small displays ([issue #6](http://github.com/lrsjng/h5ai/issues/6)) -* added custom scrollbar to tree ([issue #6](http://github.com/lrsjng/h5ai/issues/6)) -* fixed broken links caused by URI encoding/decoding ([issue #9](http://github.com/lrsjng/h5ai/issues/9)) -* added "empty" to localization (hope Google Translate did a good job here) +* fixes problems with XAMPP on Windows (see `dot.htaccess` comments for instructions) +* fixes tree fade-in-fade-out effect for small displays ([issue #6](http://github.com/lrsjng/h5ai/issues/6)) +* adds custom scrollbar to tree ([issue #6](http://github.com/lrsjng/h5ai/issues/6)) +* fixes broken links caused by URI encoding/decoding ([issue #9](http://github.com/lrsjng/h5ai/issues/9)) +* adds "empty" to localization (hope Google Translate did a good job here) ### v0.9 - *2011-07-18* -* linked hover states between crumb, extended view and tree -* fixed size of tree view (now there's a ugly scrollbar, hopefully will be fixed) -* refactored js to improve performance and cleaned code -* added caching for folder status codes and content -* added fr translation by [Nicolas](http://github.com/Nicosmos) -* added nl translation by [Stefan de Konink](http://github.com/skinkie) -* added sv translation by Oscar Carlsson +* links hover states between crumb, extended view and tree +* fixes size of tree view (now there's a ugly scrollbar, hopefully will be fixed) +* refactores js to improve performance and cleaned code +* adds caching for folder status codes and content +* adds `fr` translation by [Nicolas](http://github.com/Nicosmos) +* adds `nl` translation by [Stefan de Konink](http://github.com/skinkie) +* adds `sv` translation by Oscar Carlsson ### v0.8 - *2011-07-08* -* removed slashes from folder labels +* removes slashes from folder labels * optionally rename parent folder entries to real folder names, see `options.js` * long breadcrumbs (multiple rows) no longer hide content * error folder icons are opaque now -* refactored js a lot (again...) +* refactores js a lot (again...) ### v0.7 - *2011-07-07* -* removed shadows +* removes shadows * smarter tree side bar ### v0.6 - *2011-07-05* -* refactored js -* added localization, see `options.js` +* refactores js +* adds localization, see `options.js` ### v0.5.3 - *2011-07-04* -* refactored js -* added basic options support via `options.js` -* commented `options.js` -* optional tree sidebar +* refactores js +* adds basic options support via `options.js` +* adds comments to `options.js` +* adds optional tree sidebar ### v0.5.2 - *2011-07-02* * details view adjusts to window width -* linked icon for *.gz and *.bz2 +* links icon for *.gz and *.bz2 ### v0.5.1 - *2011-07-01* -* disabled tree sidebar for now, since it had unwanted side effects +* disables tree sidebar for now, since it had unwanted side effects ### v0.5 - *2011-07-01* -* added tree sidebar +* adds tree sidebar * some refactorings ### v0.4 - *2011-06-27* -* added better fallback, in case JavaScript is disabled -* rewrote js, fixed middle-button click etc. problems -* refactored css -* sorted, added and moved icons and images -* updated dot.access +* adds better fallback, in case JavaScript is disabled +* rewrites js, fixed middle-button click etc. problems +* refactors css +* sorts, adds and moves icons and images +* updates dot.access ### v0.3.2 - *2011-06-24* -* removed lib versions from file names -* added 'empty' indicator for icons view +* removes lib versions from file names +* adds 'empty' indicator for icons view ### v0.3.1 - *2011-06-24* -* refactored js -* added `folderClick` and `fileClick` callback hooks -* fixed .emtpy style +* refactores js +* adds `folderClick` and `fileClick` callback hooks +* fixes .emtpy style ### v0.3 - *2011-06-23* -* included build stuff, files previously found in the base directory are now located in folder `target` +* includes build stuff, files previously found in the base directory are now located in folder `target` * styles and scripts are now minified -* added Modernizr 2.0.4 for future use -* updated jQuery to version 1.6.1 +* adds Modernizr 2.0.4 for future use +* updates jQuery to version 1.6.1 ### v0.2.3 - *2011-06-17* * more refactoring in main.js -* ~~added custom js support, and global includes~~ *removed, only custom top and bottom sections supported* ### v0.2.2 - *2011-06-16* -* refactored a lot, added some comments -* included fixes from [NumEricR](http://github.com/NumEricR) -* added top/bottom message support, only basicly styled +* refactores a lot, adds some comments +* includes fixes from [NumEricR](http://github.com/NumEricR) +* adds top/bottom message support, only basicly styled ### v0.2.1 - *2011-06-16* -* fixed croped filenames -* fixed missing .png extension in header -* added some color to the links -* added changelog +* fixes croped filenames +* fixes missing .png extension in header +* adds some color to the links +* adds changelog ### v0.2 - *2011-06-15* -* added icon view +* adds icon view diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 69e33277..6a636446 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -408,6 +408,22 @@ var H5AI_CONFIG = { "noMatch": "Κανένα Ταίριασμα" }, + "hu": { + "lang": "magyar", + "details": "részletek", + "icons": "ikonok", + "name": "Név", + "lastModified": "Utoljára módosítva", + "size": "Méret", + "parentDirectory": "Szülő könyvtár", + "empty": "üres", + "folders": "mappák", + "files": "fájlok", + "download": "letöltés", + "noMatch": "nincs találat", + "dateFormat": "YYYY-MM-DD HH:mm" + }, + "it": { "lang": "italiano", "details": "dettagli", From 85f0af61d0194c5a1a269ecc5dc4ef31aac8ba1a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 28 May 2012 18:33:25 +0200 Subject: [PATCH 03/67] Moves LICENSE and README to folder _h5ai in the release package. --- build.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.xml b/build.xml index 9d20dbf7..605ed551 100644 --- a/build.xml +++ b/build.xml @@ -23,6 +23,8 @@ + + From 6c3f271a3e24b68219b6a31bef483ddeebadb2a5 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 7 Jun 2012 21:22:04 +0200 Subject: [PATCH 04/67] Bundles jQuery with the main script. --- src/_h5ai/apache/h5ai-header.html | 2 -- src/_h5ai/config.js | 12 ++++++------ src/_h5ai/index.html | 2 -- src/_h5ai/js/inc/lib/jquery-1.7.2.min.js | 4 ++++ src/_h5ai/js/scripts.js | 1 + src/_h5ai/php/h5ai-index.php | 2 -- 6 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 src/_h5ai/js/inc/lib/jquery-1.7.2.min.js diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index 8bb246af..a31604e2 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -31,8 +31,6 @@ - -
diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 6a636446..c5039f2f 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -63,7 +63,7 @@ var H5AI_CONFIG = { * in each folder. */ "custom": { - "enabled": false, + "enabled": true, "header": "_h5ai.header.html", "footer": "_h5ai.footer.html" }, @@ -97,7 +97,7 @@ var H5AI_CONFIG = { * Depends on du. */ "foldersize": { - "enabled": false + "enabled": true }, /* @@ -111,7 +111,7 @@ var H5AI_CONFIG = { * appropriate default index file. */ "folderstatus": { - "enabled": false, + "enabled": true, "folders": {} }, @@ -160,7 +160,7 @@ var H5AI_CONFIG = { * Show QRCodes on hovering files. */ "qrcode": { - "enabled": false, + "enabled": true, "size": 150 }, @@ -198,11 +198,11 @@ var H5AI_CONFIG = { * - doc thumbnails depend on convert */ "thumbnails": { - "enabled": false, + "enabled": true, "img": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"], "mov": ["video"], "doc": ["pdf", "ps"], - "delay": 1000 + "delay": 1 }, /* diff --git a/src/_h5ai/index.html b/src/_h5ai/index.html index 4e0cc40b..7cb45c4f 100644 --- a/src/_h5ai/index.html +++ b/src/_h5ai/index.html @@ -62,8 +62,6 @@
- - diff --git a/src/_h5ai/js/inc/lib/jquery-1.7.2.min.js b/src/_h5ai/js/inc/lib/jquery-1.7.2.min.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/src/_h5ai/js/inc/lib/jquery-1.7.2.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 410614e6..43c1c6e4 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -1,6 +1,7 @@ // jQuery libs // ----------- +// @include "inc/lib/jquery-1.7.2.min.js" // @include "inc/lib/jquery.fracs-0.11.min.js" // @include "inc/lib/jquery.mousewheel-3.0.6.js" // @include "inc/lib/jquery.qrcode.js" diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index b7e464c9..cea357df 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -32,8 +32,6 @@
- -
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( -a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f -.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index cea357df..0541244d 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -9,10 +9,10 @@ Directory index · styled with h5ai - + - + From 76e89820ebd00d2c129602099536563caa866e92 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 4 Jul 2012 16:28:19 +0200 Subject: [PATCH 06/67] Updates jQuery.scrollpanel. --- src/_h5ai/css/inc/l10n.less | 7 +- src/_h5ai/css/inc/tree.less | 7 +- src/_h5ai/js/inc/ext/l10n.js | 4 +- src/_h5ai/js/inc/ext/tree.js | 12 +- .../js/inc/lib/jquery.scrollpanel-0.1.min.js | 2 + src/_h5ai/js/inc/lib/jquery.scrollpanel.js | 156 ------------------ src/_h5ai/js/scripts.js | 2 +- 7 files changed, 18 insertions(+), 172 deletions(-) create mode 100644 src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js delete mode 100644 src/_h5ai/js/inc/lib/jquery.scrollpanel.js diff --git a/src/_h5ai/css/inc/l10n.less b/src/_h5ai/css/inc/l10n.less index c47f9746..730e1e67 100644 --- a/src/_h5ai/css/inc/l10n.less +++ b/src/_h5ai/css/inc/l10n.less @@ -14,15 +14,16 @@ background-color: rgb(241,241,241); border: 1px solid rgb(210,210,210); - > .scrollbar { + .sp-scrollbar { margin: 0; width: 6px; background-color: rgb(210,210,210); + cursor: pointer; - .drag { + .sp-thumb { background-color: rgb(180,180,180); } - &.dragOn .drag { + &.active .sp-thumb { background-color: rgb(150,150,150); } } diff --git a/src/_h5ai/css/inc/tree.less b/src/_h5ai/css/inc/tree.less index 1462593b..f310ebac 100644 --- a/src/_h5ai/css/inc/tree.less +++ b/src/_h5ai/css/inc/tree.less @@ -11,17 +11,18 @@ background-color: rgb(241,241,241); border-right: 2px solid rgb(221,221,221); - > .scrollbar { + .sp-scrollbar { margin: 8px 8px 8px 0; width: 6px; background-color: rgb(210,210,210); .border-radius(3px); + cursor: pointer; - .drag { + .sp-thumb { background-color: rgb(180,180,180); .border-radius(3px); } - &.dragOn .drag { + &.active .sp-thumb { background-color: rgb(150,150,150); } } diff --git a/src/_h5ai/js/inc/ext/l10n.js b/src/_h5ai/js/inc/ext/l10n.js index e384025a..5598f41e 100644 --- a/src/_h5ai/js/inc/ext/l10n.js +++ b/src/_h5ai/js/inc/ext/l10n.js @@ -92,7 +92,9 @@ module.define('ext/l10n', [jQuery, 'core/settings', 'core/langs', 'core/format', .css('top', '-' + $langOptions.outerHeight() + 'px') .stop(true, true) .fadeIn(); - $langOptions.get(0).updateScrollbar(); + + // needs to be updated twice for initial fade in rendering :/ + $langOptions.scrollpanel('update').scrollpanel('update'); }, function () { $langOptions diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 94e9a9a6..8295ebd5 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -101,15 +101,14 @@ module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event createOnIndicatorClick = function (parser) { var $tree = $('#tree'), - tree = $tree.get(0), slide = function (entry, $indicator, $content, down) { entry.isContentVisible = down; $indicator.removeClass('open close').addClass(down ? 'open' : 'close'); - tree.updateScrollbar(true); + $tree.scrollpanel('update', true); $content[down ? 'slideDown' : 'slideUp'](function () { - tree.updateScrollbar(); + $tree.scrollpanel('update'); }); }; @@ -175,7 +174,6 @@ module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event adjustSpacing = function () { var $tree = $('#tree'), - tree = $tree[0], winHeight = $(window).height(), navHeight = $('#topbar').outerHeight(), footerHeight = $('#bottombar').outerHeight(); @@ -185,9 +183,7 @@ module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event height: winHeight - navHeight - footerHeight - 16 }); - if (tree.updateScrollbar) { - tree.updateScrollbar(); - } + $tree.scrollpanel('update'); }, // creates the complete tree from entry down to the root @@ -208,7 +204,7 @@ module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event adjustSpacing(); shiftTree(false, true); - setTimeout(function () { $tree.get(0).updateScrollbar(); }, 1); + $tree.scrollpanel('update'); }); $tree diff --git a/src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js b/src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js new file mode 100644 index 00000000..c7cf6768 --- /dev/null +++ b/src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery.scrollpanel 0.1 - //larsjung.de/scrollpanel - MIT License */ +(function(a){"use strict";var b=a(window),c="scrollpanel",d={prefix:"sp-"},e=function(b,c){var e=this;e.$el=a(b),e.settings=a.extend({},d,c);var f=e.settings.prefix;e.mouseOffsetY=0,e.updateId=0,e.scrollProxy=a.proxy(e.scroll,e),(!e.$el.css("position")||e.$el.css("position")==="static")&&e.$el.css("position","relative"),e.$scrollbar=a('
'),e.$thumb=a('
').appendTo(e.$scrollbar),e.$el.addClass(f+"host").wrapInner('
').append(e.$scrollbar),e.$viewport=e.$el.find("> ."+f+"viewport"),e.$container=e.$viewport.find("> ."+f+"container"),e.$el.on("mousewheel",function(a,b,c,d){e.$viewport.scrollTop(e.$viewport.scrollTop()-50*d),e.update(),a.preventDefault(),a.stopPropagation()}).on("scroll",function(){e.update()}),e.$viewport.css({paddingRight:e.$scrollbar.outerWidth(!0),height:e.$el.height(),overflow:"hidden"}),e.$container.css({overflow:"hidden"}),e.$scrollbar.css({position:"absolute",top:0,right:0,overflow:"hidden"}).on("mousedown",function(a){e.mouseOffsetY=e.$thumb.outerHeight()/2,e.onMousedown(a)}).each(function(){e.onselectstart=function(){return!1}}),e.$thumb.css({position:"absolute",left:0,width:"100%"}).on("mousedown",function(a){e.mouseOffsetY=a.pageY-e.$thumb.offset().top,e.onMousedown(a)}),e.update()};a.extend(e.prototype,{update:function(a){var b=this;b.updateId&&!a?(clearInterval(b.updateId),b.updateId=0):!b.updateId&&a&&(b.updateId=setInterval(function(){b.update(!0)},50)),b.$viewport.css("height",b.$el.height());var c=b.$el.height(),d=b.$container.outerHeight(),e=b.$viewport.scrollTop(),f=e/d,g=Math.min(c/d,1),h=b.$scrollbar.height();g<1?(b.$scrollbar.css({height:b.$el.innerHeight()+h-b.$scrollbar.outerHeight(!0)}).fadeIn(50),b.$thumb.css({top:h*f,height:h*g})):b.$scrollbar.fadeOut(50)},scroll:function(a){var b=this,c=(a.pageY-b.$scrollbar.offset().top-b.mouseOffsetY)/b.$scrollbar.height();b.$viewport.scrollTop(b.$container.outerHeight()*c),b.update(),a.preventDefault(),a.stopPropagation()},onMousedown:function(a){var c=this;c.scroll(a),c.$scrollbar.addClass("active"),b.on("mousemove",c.scrollProxy).one("mouseup",function(a){c.$scrollbar.removeClass("active"),b.off("mousemove",c.scrollProxy),c.scroll(a)})}}),a.fn[c]=function(b,d){return this.each(function(){var f=a(this),g=f.data(c);g||(g=new e(this,b),g.update(),f.data(c,g)),b==="update"&&g.update(d)})}})(jQuery) \ No newline at end of file diff --git a/src/_h5ai/js/inc/lib/jquery.scrollpanel.js b/src/_h5ai/js/inc/lib/jquery.scrollpanel.js deleted file mode 100644 index f0d074bd..00000000 --- a/src/_h5ai/js/inc/lib/jquery.scrollpanel.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * jQuery.scrollpanel - * author: Lars Jung - * license: MIT - * - * still quick and dirty! - */ -(function (window, $) { - "use strict"; - - var $window = $(window), - init = function (htmlElement) { - - var $element = $(htmlElement), - $scrollbar, $drag, $wrapper, $content, mouseOffsetY, updateId, - update, scroll; - - if (!$element.css("position") || $element.css("position") === "static") { - $element.css("position", "relative"); - } - - $scrollbar = $("
"); - $drag = $("
").appendTo($scrollbar); - $element - .wrapInner("
") - .append($scrollbar); - $wrapper = $element.find("> .wrapper"); - $content = $wrapper.find("> .content"); - mouseOffsetY = 0; - - update = function (repeat) { - - var visibleHeight, contentHeight, scrollTop, scrollTopFrac, visVertFrac; - - if (updateId && !repeat) { - clearInterval(updateId); - updateId = undefined; - } else if (!updateId && repeat) { - updateId = setInterval(function() { update(true); }, 50); - } - - $wrapper.css("height", $element.height()); - visibleHeight = $element.height(); - contentHeight = $content.outerHeight(); - scrollTop = $wrapper.scrollTop(); - scrollTopFrac = scrollTop / contentHeight; - visVertFrac = Math.min(visibleHeight / contentHeight, 1); - - if (visVertFrac < 1) { - $scrollbar - .fadeIn(50) - .css({ - height: $element.innerHeight() + $scrollbar.height() - $scrollbar.outerHeight(true) - }); - $drag - .css({ - top: $scrollbar.height() * scrollTopFrac, - height: $scrollbar.height() * visVertFrac - }); - } else { - $scrollbar.fadeOut(50); - } - }; - - scroll = function (event) { - - var clickFrac = (event.pageY - $scrollbar.offset().top - mouseOffsetY) / $scrollbar.height(); - - $wrapper.scrollTop($content.outerHeight() * clickFrac); - update(); - event.preventDefault(); - }; - - $element - .on('mousewheel', function (event, delta, deltaX, deltaY) { - - $wrapper.scrollTop($wrapper.scrollTop() - 50 * deltaY); - update(); - event.stopPropagation(); - event.preventDefault(); - }) - .on('scroll', update); - $element.get(0).updateScrollbar = update; - $wrapper - .css({ - "padding-right": $scrollbar.outerWidth(true), - height: $element.height(), - overflow: "hidden" - }); - $scrollbar - .css({ - position: "absolute", - top: 0, - right: 0, - overflow: "hidden", - cursor: "pointer" - }) - .mousedown(function (event) { - - mouseOffsetY = $drag.outerHeight() / 2; - scroll(event); - $scrollbar.addClass("dragOn"); - $window - .bind("mousemove", scroll) - .one("mouseup", function (event) { - - $scrollbar.removeClass("dragOn"); - $window.unbind("mousemove", scroll); - scroll(event); - event.stopPropagation(); - }); - event.preventDefault(); - }) - .each(function () { - - this.onselectstart = function () { - - return false; - }; - }); - $drag - .css({ - position: "absolute", - left: 0, - width: "100%" - }) - .mousedown(function (event) { - - mouseOffsetY = event.pageY - $drag.offset().top; - scroll(event); - $scrollbar.addClass("dragOn"); - $window - .bind("mousemove", scroll) - .one("mouseup", function (event) { - - $scrollbar.removeClass("dragOn"); - $window.unbind("mousemove", scroll); - scroll(event); - event.stopPropagation(); - }); - event.stopPropagation(); - }); - - update(); - }; - - - $.fn.scrollpanel = function () { - - return this.each(function () { - - init(this); - }); - }; - -}(window, jQuery)); diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 43c1c6e4..c1edc8f2 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -5,7 +5,7 @@ // @include "inc/lib/jquery.fracs-0.11.min.js" // @include "inc/lib/jquery.mousewheel-3.0.6.js" // @include "inc/lib/jquery.qrcode.js" -// @include "inc/lib/jquery.scrollpanel.js" +// @include "inc/lib/jquery.scrollpanel-0.1.min.js" // underscore libs // --------------- From 9266be970842b8ad131ee4237cb94a8a53cdac67 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 4 Jul 2012 21:30:33 +0200 Subject: [PATCH 07/67] Updates jQuery.qrcode to 0.2 and jQuery.scrollpanel to 0.1. --- README.md | 6 +- src/_h5ai/js/inc/ext/tree.js | 24 +- src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js | 2 + src/_h5ai/js/inc/lib/jquery.qrcode.js | 130 -- src/_h5ai/js/inc/lib/qrcode.js | 1634 ----------------- src/_h5ai/js/scripts.js | 2 +- 6 files changed, 23 insertions(+), 1775 deletions(-) create mode 100644 src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js delete mode 100644 src/_h5ai/js/inc/lib/jquery.qrcode.js delete mode 100644 src/_h5ai/js/inc/lib/qrcode.js diff --git a/README.md b/README.md index fbf52fa1..a56807e5 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,10 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * [Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL) * [HTML5 ★ Boilerplate](http://html5boilerplate.com) * [jQuery](http://jquery.com) (MIT/GPL) -* [jQuery.fracs](http://larsjung.de/fracs) (MIT) +* [jQuery.fracs](http://larsjung.de/fracs/) (MIT) * [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT) +* [jQuery.qrcode](http://larsjung.de/qrcode/) (MIT) +* [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT) * [modernizr](http://www.modernizr.com) (MIT/BSD) * [Moment.js](http://momentjs.com) (MIT) * [qrcode](http://www.d-project.com/qrcode/index.html) (MIT) @@ -33,6 +35,8 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h ### v0.21 - *2012-??* * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) +* updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 +* updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 ### v0.20 - *2012-05-11* diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 8295ebd5..014dc0f2 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -193,27 +193,33 @@ module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event return; } - var $tree = $('
').appendTo('body'); + var $tree = $('
') + .appendTo('body') + .scrollpanel() + .on('click', '.indicator', createOnIndicatorClick(parser)) + .on('mouseenter', function () { + + shiftTree(true); + }) + .on('mouseleave', function () { + + shiftTree(); + }); fetchTree(entry, parser, function (root) { $tree - .append(update(root)) - .scrollpanel() + .find('.sp-container').append(update(root)).end() .show(); adjustSpacing(); shiftTree(false, true); - $tree.scrollpanel('update'); }); - $tree - .on('click', '.indicator', createOnIndicatorClick(parser)) - .on('mouseenter', function () { shiftTree(true); }) - .on('mouseleave', function () { shiftTree(); }); - event.sub('ready', adjustSpacing); + $(window).on('resize', function () { + adjustSpacing(); shiftTree(); }); diff --git a/src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js b/src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js new file mode 100644 index 00000000..99a664b1 --- /dev/null +++ b/src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js @@ -0,0 +1,2 @@ +/*! jQuery.qrcode 0.2 - //larsjung.de/qrcode - MIT License */ +(function(a){"use strict";var b=function(a,b,c){var d=g(a,b);return d.addData(c),d.make(),d},c=function(a){for(var c=2;c<=40;c+=1)try{return b(c,"L",a)}catch(d){}return null},d=function(b){var d=c(b.text),e=a("").attr("width",b.width).attr("height",b.height),f=e[0].getContext("2d");b.bgColor&&(f.fillStyle=b.bgColor,f.fillRect(0,0,b.width,b.height));if(d){var g=d.getModuleCount(),h=b.width/g,i=b.height/g,j,k;f.beginPath();for(j=0;j").css({position:"relative",left:0,top:0,padding:0,margin:0,width:b.width,height:b.height});b.bgColor&&e.css("background-color",b.bgColor);if(d){var f=d.getModuleCount(),g=Math.floor(b.width/f),h=Math.floor(b.height/f),i=Math.floor(.5*(b.width-g*f)),j=Math.floor(.5*(b.height-h*f)),k,l;for(k=0;k").css({left:i+l*g,top:j+k*h}).appendTo(e);e.children().css({position:"absolute",padding:0,margin:0,width:g,height:h,"background-color":b.color})}return e},f={render:"canvas",width:256,height:256,color:"#000",bgColor:null,text:"no text"};a.fn.qrcode=function(b){var c=a.extend({},f,b);return this.each(function(){a(this).append(c.render==="canvas"?d(c):e(c))})};var g=function(){function g(a,b){if(typeof a.length=="undefined")throw new Error(a.length+"/"+b);var c=function(){var c=0;while(c=7&&x(a),p==null&&(p=B(k,l,q)),z(p,b)},t=function(a,b){for(var c=-1;c<=7;c+=1){if(a+c<=-1||n<=a+c)continue;for(var d=-1;d<=7;d+=1){if(b+d<=-1||n<=b+d)continue;0<=c&&c<=6&&(d==0||d==6)||0<=d&&d<=6&&(c==0||c==6)||2<=c&&c<=4&&2<=d&&d<=4?m[a+c][b+d]=!0:m[a+c][b+d]=!1}}},u=function(){var a=0,b=0;for(var c=0;c<8;c+=1){s(!0,c);var d=e.getLostPoint(r);if(c==0||a>d)a=d,b=c}return b},v=function(){for(var a=8;a>c&1)==1;m[Math.floor(c/3)][c%3+n-8-3]=d}for(var c=0;c<18;c+=1){var d=!a&&(b>>c&1)==1;m[c%3+n-8-3][Math.floor(c/3)]=d}},y=function(a,b){var c=l<<3|b,d=e.getBCHTypeInfo(c);for(var f=0;f<15;f+=1){var g=!a&&(d>>f&1)==1;f<6?m[f][8]=g:f<8?m[f+1][8]=g:m[n-15+f][8]=g}for(var f=0;f<15;f+=1){var g=!a&&(d>>f&1)==1;f<8?m[8][n-f-1]=g:f<9?m[8][15-f-1+1]=g:m[8][15-f-1]=g}m[n-8][8]=!a},z=function(a,b){var c=-1,d=n-1,f=7,g=0,h=e.getMaskFunction(b);for(var i=n-1;i>0;i-=2){i==6&&(i-=1);for(;;){for(var j=0;j<2;j+=1)if(m[d][i-j]==null){var k=!1;g>>f&1)==1);var l=h(d,i-j);l&&(k=!k),m[d][i-j]=k,f-=1,f==-1&&(g+=1,f=7)}d+=c;if(d<0||n<=d){d-=c,c=-c;break}}}},A=function(a,b){var c=0,d=0,f=0,h=new Array(b.length),i=new Array(b.length);for(var j=0;j=0?p.get(q):0}}var r=0;for(var m=0;mm*8)throw new Error("code length overflow. ("+j.getLengthInBits()+">"+m*8+")");j.getLengthInBits()+4<=m*8&&j.put(0,4);while(j.getLengthInBits()%8!=0)j.putBit(!1);for(;;){if(j.getLengthInBits()>=m*8)break;j.put(d,8);if(j.getLengthInBits()>=m*8)break;j.put(f,8)}return A(j,g)};return r.addData=function(a){var b=j(a);q.push(b),p=null},r.isDark=function(a,b){if(a<0||n<=a||b<0||n<=b)throw new Error(a+","+b);return m[a][b]},r.getModuleCount=function(){return n},r.make=function(){s(!1,u())},r.createTableTag=function(a,b){a=a||2,b=typeof b=="undefined"?a*4:b;var c="";c+='
";for(var e=0;e';c+=""}return c+="",c+="
",c},r.createImgTag=function(a,b){a=a||2,b=typeof b=="undefined"?a*4:b;var c=r.getModuleCount()*a+b*2,d=b,e=c-b;return o(c,c,function(b,c){if(d<=b&&b>>8),b.push(g&255)):b.push(d)}}return b}};var b={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},c={L:1,M:0,Q:3,H:2},d={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},e=function(){var a=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],c=1335,e=7973,h=21522,i={},j=function(a){var b=0;while(a!=0)b+=1,a>>>=1;return b};return i.getBCHTypeInfo=function(a){var b=a<<10;while(j(b)-j(c)>=0)b^=c<=0)b^=e<5&&(c+=3+f-5)}for(var d=0;d=256)b-=255;return a[b]},d}(),h=function(){var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(a,b){var c={};return c.totalCount=a,c.dataCount=b,c},d={},e=function(b,d){switch(d){case c.L:return a[(b-1)*4+0];case c.M:return a[(b-1)*4+1];case c.Q:return a[(b-1)*4+2];case c.H:return a[(b-1)*4+3];default:return undefined}};return d.getRSBlocks=function(a,c){var d=e(a,c);if(typeof d=="undefined")throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);var f=d.length/3,g=new Array;for(var h=0;h>>7-b%8&1)==1},c.put=function(a,b){for(var d=0;d>>b-d-1&1)==1)},c.getLengthInBits=function(){return b},c.putBit=function(c){var d=Math.floor(b/8);a.length<=d&&a.push(0),c&&(a[d]|=128>>>b%8),b+=1},c},j=function(c){var d=b.MODE_8BIT_BYTE,e=c,f=a.stringToBytes(c),g={};return g.getMode=function(){return d},g.getLength=function(a){return f.length},g.write=function(a){for(var b=0;b>>8)},b.writeBytes=function(a,c,d){c=c||0,d=d||a.length;for(var e=0;e0&&(b+=","),b+=a[c];return b+="]",b},b},l=function(){var a=0,b=0,c=0,d="",e={},f=function(a){d+=String.fromCharCode(g(a&63))},g=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)};return e.writeByte=function(d){a=a<<8|d&255,b+=8,c+=1;while(b>=6)f(a>>>b-6),b-=6},e.flush=function(){b>0&&(f(a<<6-b),a=0,b=0);if(c%3!=0){var e=3-c%3;for(var g=0;g=b.length){if(e==0)return-1;throw new Error("unexpected end of file./"+e)}var a=b.charAt(c);c+=1;if(a=="=")return e=0,-1;if(a.match(/^\s$/))continue;d=d<<6|g(a.charCodeAt(0)),e+=6}var f=d>>>e-8&255;return e-=8,f};var g=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw new Error("c:"+a)};return f},n=function(a,b){var c=a,d=b,e=new Array(a*b),f={};f.setPixel=function(a,b,d){e[b*c+a]=d},f.write=function(a){a.writeString("GIF87a"),a.writeShort(c),a.writeShort(d),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(0),a.writeByte(0),a.writeByte(0),a.writeByte(255),a.writeByte(255),a.writeByte(255),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(c),a.writeShort(d),a.writeByte(0);var b=2,e=h(b);a.writeByte(b);var f=0;while(e.length-f>255)a.writeByte(255),a.writeBytes(e,f,255),f+=255;a.writeByte(e.length-f),a.writeBytes(e,f,e.length-f),a.writeByte(0),a.writeString(";")};var g=function(a){var b=a,c=0,d=0,e={};return e.write=function(a,e){if(a>>>e!=0)throw new Error("length over");while(c+e>=8)b.writeByte(255&(a<>>=8-c,d=0,c=0;d=a<0&&b.writeByte(d)},e},h=function(a){var b=1<').attr('width', settings.width).attr('height', settings.height), - ctx = $canvas[0].getContext('2d'); - - if (settings.bgColor) { - ctx.fillStyle = settings.bgColor; - ctx.fillRect(0, 0, settings.width, settings.height); - } - - if (qr) { - var moduleCount = qr.getModuleCount(), - moduleWidth = settings.width / moduleCount, - moduleHeight = settings.height / moduleCount, - row, col; - - ctx.beginPath(); - for (row = 0; row < moduleCount; row += 1) { - for (col = 0; col < moduleCount; col += 1) { - if (qr.isDark(row, col)) { - ctx.rect(col * moduleWidth, row * moduleHeight, moduleWidth, moduleHeight); - } - } - } - ctx.fillStyle = settings.color; - ctx.fill(); - } - - return $canvas; - }, - createDiv = function (settings) { - - var qr = createBestQr(settings.text), - $div = $('
').css({ - position: 'relative', - left: 0, - top: 0, - padding: 0, - margin: 0, - width: settings.width, - height: settings.height - }); - - if (settings.bgColor) { - $div.css('background-color', settings.bgColor); - } - - if (qr) { - var moduleCount = qr.getModuleCount(), - moduleWidth = Math.floor(settings.width / moduleCount), - moduleHeight = Math.floor(settings.height / moduleCount), - offsetLeft = Math.floor(0.5 * (settings.width - moduleWidth * moduleCount)), - offsetTop = Math.floor(0.5 * (settings.height - moduleHeight * moduleCount)), - row, col; - - for (row = 0; row < moduleCount; row++) { - for (col = 0; col < moduleCount; col++) { - if (qr.isDark(row, col)) { - $('
') - .css({ - left: offsetLeft + col * moduleWidth, - top: offsetTop + row * moduleHeight - }) - .appendTo($div); - } - } - } - - $div.children() - .css({ - position: 'absolute', - padding: 0, - margin: 0, - width: moduleWidth, - height: moduleHeight, - 'background-color': settings.color - }); - } - - return $div; - }, - - defaults = { - render: 'canvas', - width: 256, - height: 256, - color: '#000', - bgColor: null, - text: 'no text' - }; - - $.fn.qrcode = function(options) { - - var settings = $.extend({}, defaults, options); - - $(this).append(settings.render === 'canvas' ? createCanvas(settings) : createDiv(settings)); - }; - -}(jQuery)); diff --git a/src/_h5ai/js/inc/lib/qrcode.js b/src/_h5ai/js/inc/lib/qrcode.js deleted file mode 100644 index c80e8177..00000000 --- a/src/_h5ai/js/inc/lib/qrcode.js +++ /dev/null @@ -1,1634 +0,0 @@ -//--------------------------------------------------------------------- -// -// QR Code Generator for JavaScript -// -// Copyright (c) 2009 Kazuhiko Arase -// -// URL: http://www.d-project.com/ -// -// Licensed under the MIT license: -// http://www.opensource.org/licenses/mit-license.php -// -// The word 'QR Code' is registered trademark of -// DENSO WAVE INCORPORATED -// http://www.denso-wave.com/qrcode/faqpatent-e.html -// -//--------------------------------------------------------------------- - -var qrcode = function() { - - //--------------------------------------------------------------------- - // qrcode - //--------------------------------------------------------------------- - - /** - * qrcode - * @param typeNumber 1 to 10 - * @param errorCorrectLevel 'L','M','Q','H' - */ - var qrcode = function(typeNumber, errorCorrectLevel) { - - var PAD0 = 0xEC; - var PAD1 = 0x11; - - var _typeNumber = typeNumber; - var _errorCorrectLevel = QRErrorCorrectLevel[errorCorrectLevel]; - var _modules = null; - var _moduleCount = 0; - var _dataCache = null; - var _dataList = new Array(); - - var _this = {}; - - var makeImpl = function(test, maskPattern) { - - _moduleCount = _typeNumber * 4 + 17; - _modules = function(moduleCount) { - var modules = new Array(moduleCount); - for (var row = 0; row < moduleCount; row += 1) { - modules[row] = new Array(moduleCount); - for (var col = 0; col < moduleCount; col += 1) { - modules[row][col] = null; - } - } - return modules; - }(_moduleCount); - - setupPositionProbePattern(0, 0); - setupPositionProbePattern(_moduleCount - 7, 0); - setupPositionProbePattern(0, _moduleCount - 7); - setupPositionAdjustPattern(); - setupTimingPattern(); - setupTypeInfo(test, maskPattern); - - if (_typeNumber >= 7) { - setupTypeNumber(test); - } - - if (_dataCache == null) { - _dataCache = createData(_typeNumber, _errorCorrectLevel, _dataList); - } - - mapData(_dataCache, maskPattern); - }; - - var setupPositionProbePattern = function(row, col) { - - for (var r = -1; r <= 7; r += 1) { - - if (row + r <= -1 || _moduleCount <= row + r) continue; - - for (var c = -1; c <= 7; c += 1) { - - if (col + c <= -1 || _moduleCount <= col + c) continue; - - if ( (0 <= r && r <= 6 && (c == 0 || c == 6) ) - || (0 <= c && c <= 6 && (r == 0 || r == 6) ) - || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) { - _modules[row + r][col + c] = true; - } else { - _modules[row + r][col + c] = false; - } - } - } - }; - - var getBestMaskPattern = function() { - - var minLostPoint = 0; - var pattern = 0; - - for (var i = 0; i < 8; i += 1) { - - makeImpl(true, i); - - var lostPoint = QRUtil.getLostPoint(_this); - - if (i == 0 || minLostPoint > lostPoint) { - minLostPoint = lostPoint; - pattern = i; - } - } - - return pattern; - }; - - var setupTimingPattern = function() { - - for (var r = 8; r < _moduleCount - 8; r += 1) { - if (_modules[r][6] != null) { - continue; - } - _modules[r][6] = (r % 2 == 0); - } - - for (var c = 8; c < _moduleCount - 8; c += 1) { - if (_modules[6][c] != null) { - continue; - } - _modules[6][c] = (c % 2 == 0); - } - }; - - var setupPositionAdjustPattern = function() { - - var pos = QRUtil.getPatternPosition(_typeNumber); - - for (var i = 0; i < pos.length; i += 1) { - - for (var j = 0; j < pos.length; j += 1) { - - var row = pos[i]; - var col = pos[j]; - - if (_modules[row][col] != null) { - continue; - } - - for (var r = -2; r <= 2; r += 1) { - - for (var c = -2; c <= 2; c += 1) { - - if (r == -2 || r == 2 || c == -2 || c == 2 - || (r == 0 && c == 0) ) { - _modules[row + r][col + c] = true; - } else { - _modules[row + r][col + c] = false; - } - } - } - } - } - }; - - var setupTypeNumber = function(test) { - - var bits = QRUtil.getBCHTypeNumber(_typeNumber); - - for (var i = 0; i < 18; i += 1) { - var mod = (!test && ( (bits >> i) & 1) == 1); - _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod; - } - - for (var i = 0; i < 18; i += 1) { - var mod = (!test && ( (bits >> i) & 1) == 1); - _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod; - } - }; - - var setupTypeInfo = function(test, maskPattern) { - - var data = (_errorCorrectLevel << 3) | maskPattern; - var bits = QRUtil.getBCHTypeInfo(data); - - // vertical - for (var i = 0; i < 15; i += 1) { - - var mod = (!test && ( (bits >> i) & 1) == 1); - - if (i < 6) { - _modules[i][8] = mod; - } else if (i < 8) { - _modules[i + 1][8] = mod; - } else { - _modules[_moduleCount - 15 + i][8] = mod; - } - } - - // horizontal - for (var i = 0; i < 15; i += 1) { - - var mod = (!test && ( (bits >> i) & 1) == 1); - - if (i < 8) { - _modules[8][_moduleCount - i - 1] = mod; - } else if (i < 9) { - _modules[8][15 - i - 1 + 1] = mod; - } else { - _modules[8][15 - i - 1] = mod; - } - } - - // fixed module - _modules[_moduleCount - 8][8] = (!test); - }; - - var mapData = function(data, maskPattern) { - - var inc = -1; - var row = _moduleCount - 1; - var bitIndex = 7; - var byteIndex = 0; - var maskFunc = QRUtil.getMaskFunction(maskPattern); - - for (var col = _moduleCount - 1; col > 0; col -= 2) { - - if (col == 6) col -= 1; - - while (true) { - - for (var c = 0; c < 2; c += 1) { - - if (_modules[row][col - c] == null) { - - var dark = false; - - if (byteIndex < data.length) { - dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1); - } - - var mask = maskFunc(row, col - c); - - if (mask) { - dark = !dark; - } - - _modules[row][col - c] = dark; - bitIndex -= 1; - - if (bitIndex == -1) { - byteIndex += 1; - bitIndex = 7; - } - } - } - - row += inc; - - if (row < 0 || _moduleCount <= row) { - row -= inc; - inc = -inc; - break; - } - } - } - }; - - var createBytes = function(buffer, rsBlocks) { - - var offset = 0; - - var maxDcCount = 0; - var maxEcCount = 0; - - var dcdata = new Array(rsBlocks.length); - var ecdata = new Array(rsBlocks.length); - - for (var r = 0; r < rsBlocks.length; r += 1) { - - var dcCount = rsBlocks[r].dataCount; - var ecCount = rsBlocks[r].totalCount - dcCount; - - maxDcCount = Math.max(maxDcCount, dcCount); - maxEcCount = Math.max(maxEcCount, ecCount); - - dcdata[r] = new Array(dcCount); - - for (var i = 0; i < dcdata[r].length; i += 1) { - dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset]; - } - offset += dcCount; - - var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); - var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1); - - var modPoly = rawPoly.mod(rsPoly); - ecdata[r] = new Array(rsPoly.getLength() - 1); - for (var i = 0; i < ecdata[r].length; i += 1) { - var modIndex = i + modPoly.getLength() - ecdata[r].length; - ecdata[r][i] = (modIndex >= 0)? modPoly.get(modIndex) : 0; - } - } - - var totalCodeCount = 0; - for (var i = 0; i < rsBlocks.length; i += 1) { - totalCodeCount += rsBlocks[i].totalCount; - } - - var data = new Array(totalCodeCount); - var index = 0; - - for (var i = 0; i < maxDcCount; i += 1) { - for (var r = 0; r < rsBlocks.length; r += 1) { - if (i < dcdata[r].length) { - data[index] = dcdata[r][i]; - index += 1; - } - } - } - - for (var i = 0; i < maxEcCount; i += 1) { - for (var r = 0; r < rsBlocks.length; r += 1) { - if (i < ecdata[r].length) { - data[index] = ecdata[r][i]; - index += 1; - } - } - } - - return data; - }; - - var createData = function(typeNumber, errorCorrectLevel, dataList) { - - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); - - var buffer = qrBitBuffer(); - - for (var i = 0; i < dataList.length; i += 1) { - var data = dataList[i]; - buffer.put(data.getMode(), 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); - data.write(buffer); - } - - // calc num max data. - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i += 1) { - totalDataCount += rsBlocks[i].dataCount; - } - - if (buffer.getLengthInBits() > totalDataCount * 8) { - throw new Error('code length overflow. (' - + buffer.getLengthInBits() - + '>' - + totalDataCount * 8 - + ')'); - } - - // end code - if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { - buffer.put(0, 4); - } - - // padding - while (buffer.getLengthInBits() % 8 != 0) { - buffer.putBit(false); - } - - // padding - while (true) { - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(PAD0, 8); - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(PAD1, 8); - } - - return createBytes(buffer, rsBlocks); - }; - - _this.addData = function(data) { - var newData = qr8BitByte(data); - _dataList.push(newData); - _dataCache = null; - }; - - _this.isDark = function(row, col) { - if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) { - throw new Error(row + ',' + col); - } - return _modules[row][col]; - }; - - _this.getModuleCount = function() { - return _moduleCount; - }; - - _this.make = function() { - makeImpl(false, getBestMaskPattern() ); - }; - - _this.createTableTag = function(cellSize, margin) { - - cellSize = cellSize || 2; - margin = (typeof margin == 'undefined')? cellSize * 4 : margin; - - var qrHtml = ''; - - qrHtml += ''; - qrHtml += ''; - - for (var r = 0; r < _this.getModuleCount(); r += 1) { - - qrHtml += ''; - - for (var c = 0; c < _this.getModuleCount(); c += 1) { - qrHtml += ''; - } - - qrHtml += ''; - qrHtml += '
'; - } - - qrHtml += '
'; - - return qrHtml; - }; - - _this.createImgTag = function(cellSize, margin) { - - cellSize = cellSize || 2; - margin = (typeof margin == 'undefined')? cellSize * 4 : margin; - - var size = _this.getModuleCount() * cellSize + margin * 2; - var min = margin; - var max = size - margin; - - return createImgTag(size, size, function(x, y) { - if (min <= x && x < max && min <= y && y < max) { - var c = Math.floor( (x - min) / cellSize); - var r = Math.floor( (y - min) / cellSize); - return _this.isDark(r, c)? 0 : 1; - } else { - return 1; - } - } ); - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // qrcode.stringToBytes - //--------------------------------------------------------------------- - - qrcode.stringToBytes = function(s) { - var bytes = new Array(); - for (var i = 0; i < s.length; i += 1) { - var c = s.charCodeAt(i); - bytes.push(c & 0xff); - } - return bytes; - }; - - //--------------------------------------------------------------------- - // qrcode.createStringToBytes - //--------------------------------------------------------------------- - - /** - * @param unicodeData base64 string of byte array. - * [16bit Unicode],[16bit Bytes], ... - * @param numChars - */ - qrcode.createStringToBytes = function(unicodeData, numChars) { - - // create conversion map. - - var unicodeMap = function() { - - var bin = base64DecodeInputStream(unicodeData); - var read = function() { - var b = bin.read(); - if (b == -1) throw new Error(); - return b; - }; - - var count = 0; - var unicodeMap = {}; - while (true) { - var b0 = bin.read(); - if (b0 == -1) break; - var b1 = read(); - var b2 = read(); - var b3 = read(); - var k = String.fromCharCode( (b0 << 8) | b1); - var v = (b2 << 8) | b3; - unicodeMap[k] = v; - count += 1; - } - if (count != numChars) { - throw new Error(count + ' != ' + numChars); - } - - return unicodeMap; - }(); - - var unknownChar = '?'.charCodeAt(0); - - return function(s) { - var bytes = new Array(); - for (var i = 0; i < s.length; i += 1) { - var c = s.charCodeAt(i); - if (c < 128) { - bytes.push(c); - } else { - var b = unicodeMap[s.charAt(i)]; - if (typeof b == 'number') { - if ( (b & 0xff) == b) { - // 1byte - bytes.push(b); - } else { - // 2bytes - bytes.push(b >>> 8); - bytes.push(b & 0xff); - } - } else { - bytes.push(unknownChar); - } - } - } - return bytes; - }; - }; - - //--------------------------------------------------------------------- - // QRMode - //--------------------------------------------------------------------- - - var QRMode = { - MODE_NUMBER : 1 << 0, - MODE_ALPHA_NUM : 1 << 1, - MODE_8BIT_BYTE : 1 << 2, - MODE_KANJI : 1 << 3 - }; - - //--------------------------------------------------------------------- - // QRErrorCorrectLevel - //--------------------------------------------------------------------- - - var QRErrorCorrectLevel = { - L : 1, - M : 0, - Q : 3, - H : 2 - }; - - //--------------------------------------------------------------------- - // QRMaskPattern - //--------------------------------------------------------------------- - - var QRMaskPattern = { - PATTERN000 : 0, - PATTERN001 : 1, - PATTERN010 : 2, - PATTERN011 : 3, - PATTERN100 : 4, - PATTERN101 : 5, - PATTERN110 : 6, - PATTERN111 : 7 - }; - - //--------------------------------------------------------------------- - // QRUtil - //--------------------------------------------------------------------- - - var QRUtil = function() { - - var PATTERN_POSITION_TABLE = [ - [], - [6, 18], - [6, 22], - [6, 26], - [6, 30], - [6, 34], - [6, 22, 38], - [6, 24, 42], - [6, 26, 46], - [6, 28, 50], - [6, 30, 54], - [6, 32, 58], - [6, 34, 62], - [6, 26, 46, 66], - [6, 26, 48, 70], - [6, 26, 50, 74], - [6, 30, 54, 78], - [6, 30, 56, 82], - [6, 30, 58, 86], - [6, 34, 62, 90], - [6, 28, 50, 72, 94], - [6, 26, 50, 74, 98], - [6, 30, 54, 78, 102], - [6, 28, 54, 80, 106], - [6, 32, 58, 84, 110], - [6, 30, 58, 86, 114], - [6, 34, 62, 90, 118], - [6, 26, 50, 74, 98, 122], - [6, 30, 54, 78, 102, 126], - [6, 26, 52, 78, 104, 130], - [6, 30, 56, 82, 108, 134], - [6, 34, 60, 86, 112, 138], - [6, 30, 58, 86, 114, 142], - [6, 34, 62, 90, 118, 146], - [6, 30, 54, 78, 102, 126, 150], - [6, 24, 50, 76, 102, 128, 154], - [6, 28, 54, 80, 106, 132, 158], - [6, 32, 58, 84, 110, 136, 162], - [6, 26, 54, 82, 110, 138, 166], - [6, 30, 58, 86, 114, 142, 170] - ]; - var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0); - var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0); - var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1); - - var _this = {}; - - var getBCHDigit = function(data) { - var digit = 0; - while (data != 0) { - digit += 1; - data >>>= 1; - } - return digit; - }; - - _this.getBCHTypeInfo = function(data) { - var d = data << 10; - while (getBCHDigit(d) - getBCHDigit(G15) >= 0) { - d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) ); - } - return ( (data << 10) | d) ^ G15_MASK; - }; - - _this.getBCHTypeNumber = function(data) { - var d = data << 12; - while (getBCHDigit(d) - getBCHDigit(G18) >= 0) { - d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) ); - } - return (data << 12) | d; - }; - - _this.getPatternPosition = function(typeNumber) { - return PATTERN_POSITION_TABLE[typeNumber - 1]; - }; - - _this.getMaskFunction = function(maskPattern) { - - switch (maskPattern) { - - case QRMaskPattern.PATTERN000 : - return function(i, j) { return (i + j) % 2 == 0; }; - case QRMaskPattern.PATTERN001 : - return function(i, j) { return i % 2 == 0; }; - case QRMaskPattern.PATTERN010 : - return function(i, j) { return j % 3 == 0; }; - case QRMaskPattern.PATTERN011 : - return function(i, j) { return (i + j) % 3 == 0; }; - case QRMaskPattern.PATTERN100 : - return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; }; - case QRMaskPattern.PATTERN101 : - return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; }; - case QRMaskPattern.PATTERN110 : - return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; }; - case QRMaskPattern.PATTERN111 : - return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; }; - - default : - throw new Error('bad maskPattern:' + maskPattern); - } - }; - - _this.getErrorCorrectPolynomial = function(errorCorrectLength) { - var a = qrPolynomial([1], 0); - for (var i = 0; i < errorCorrectLength; i += 1) { - a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) ); - } - return a; - }; - - _this.getLengthInBits = function(mode, type) { - - if (1 <= type && type < 10) { - - // 1 - 9 - - switch(mode) { - case QRMode.MODE_NUMBER : return 10; - case QRMode.MODE_ALPHA_NUM : return 9; - case QRMode.MODE_8BIT_BYTE : return 8; - case QRMode.MODE_KANJI : return 8; - default : - throw new Error('mode:' + mode); - } - - } else if (type < 27) { - - // 10 - 26 - - switch(mode) { - case QRMode.MODE_NUMBER : return 12; - case QRMode.MODE_ALPHA_NUM : return 11; - case QRMode.MODE_8BIT_BYTE : return 16; - case QRMode.MODE_KANJI : return 10; - default : - throw new Error('mode:' + mode); - } - - } else if (type < 41) { - - // 27 - 40 - - switch(mode) { - case QRMode.MODE_NUMBER : return 14; - case QRMode.MODE_ALPHA_NUM : return 13; - case QRMode.MODE_8BIT_BYTE : return 16; - case QRMode.MODE_KANJI : return 12; - default : - throw new Error('mode:' + mode); - } - - } else { - throw new Error('type:' + type); - } - }; - - _this.getLostPoint = function(qrcode) { - - var moduleCount = qrcode.getModuleCount(); - - var lostPoint = 0; - - // LEVEL1 - - for (var row = 0; row < moduleCount; row += 1) { - for (var col = 0; col < moduleCount; col += 1) { - - var sameCount = 0; - var dark = qrcode.isDark(row, col); - - for (var r = -1; r <= 1; r += 1) { - - if (row + r < 0 || moduleCount <= row + r) { - continue; - } - - for (var c = -1; c <= 1; c += 1) { - - if (col + c < 0 || moduleCount <= col + c) { - continue; - } - - if (r == 0 && c == 0) { - continue; - } - - if (dark == qrcode.isDark(row + r, col + c) ) { - sameCount += 1; - } - } - } - - if (sameCount > 5) { - lostPoint += (3 + sameCount - 5); - } - } - }; - - // LEVEL2 - - for (var row = 0; row < moduleCount - 1; row += 1) { - for (var col = 0; col < moduleCount - 1; col += 1) { - var count = 0; - if (qrcode.isDark(row, col) ) count += 1; - if (qrcode.isDark(row + 1, col) ) count += 1; - if (qrcode.isDark(row, col + 1) ) count += 1; - if (qrcode.isDark(row + 1, col + 1) ) count += 1; - if (count == 0 || count == 4) { - lostPoint += 3; - } - } - } - - // LEVEL3 - - for (var row = 0; row < moduleCount; row += 1) { - for (var col = 0; col < moduleCount - 6; col += 1) { - if (qrcode.isDark(row, col) - && !qrcode.isDark(row, col + 1) - && qrcode.isDark(row, col + 2) - && qrcode.isDark(row, col + 3) - && qrcode.isDark(row, col + 4) - && !qrcode.isDark(row, col + 5) - && qrcode.isDark(row, col + 6) ) { - lostPoint += 40; - } - } - } - - for (var col = 0; col < moduleCount; col += 1) { - for (var row = 0; row < moduleCount - 6; row += 1) { - if (qrcode.isDark(row, col) - && !qrcode.isDark(row + 1, col) - && qrcode.isDark(row + 2, col) - && qrcode.isDark(row + 3, col) - && qrcode.isDark(row + 4, col) - && !qrcode.isDark(row + 5, col) - && qrcode.isDark(row + 6, col) ) { - lostPoint += 40; - } - } - } - - // LEVEL4 - - var darkCount = 0; - - for (var col = 0; col < moduleCount; col += 1) { - for (var row = 0; row < moduleCount; row += 1) { - if (qrcode.isDark(row, col) ) { - darkCount += 1; - } - } - } - - var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; - lostPoint += ratio * 10; - - return lostPoint; - }; - - return _this; - }(); - - //--------------------------------------------------------------------- - // QRMath - //--------------------------------------------------------------------- - - var QRMath = function() { - - var EXP_TABLE = new Array(256); - var LOG_TABLE = new Array(256); - - // initialize tables - for (var i = 0; i < 8; i += 1) { - EXP_TABLE[i] = 1 << i; - } - for (var i = 8; i < 256; i += 1) { - EXP_TABLE[i] = EXP_TABLE[i - 4] - ^ EXP_TABLE[i - 5] - ^ EXP_TABLE[i - 6] - ^ EXP_TABLE[i - 8]; - } - for (var i = 0; i < 255; i += 1) { - LOG_TABLE[EXP_TABLE[i] ] = i; - } - - var _this = {}; - - _this.glog = function(n) { - - if (n < 1) { - throw new Error('glog(' + n + ')'); - } - - return LOG_TABLE[n]; - }; - - _this.gexp = function(n) { - - while (n < 0) { - n += 255; - } - - while (n >= 256) { - n -= 255; - } - - return EXP_TABLE[n]; - }; - - return _this; - }(); - - //--------------------------------------------------------------------- - // qrPolynomial - //--------------------------------------------------------------------- - - function qrPolynomial(num, shift) { - - if (typeof num.length == 'undefined') { - throw new Error(num.length + '/' + shift); - } - - var _num = function() { - var offset = 0; - while (offset < num.length && num[offset] == 0) { - offset += 1; - } - var _num = new Array(num.length - offset + shift); - for (var i = 0; i < num.length - offset; i += 1) { - _num[i] = num[i + offset]; - } - return _num; - }(); - - var _this = {}; - - _this.get = function(index) { - return _num[index]; - }; - - _this.getLength = function() { - return _num.length; - }; - - _this.multiply = function(e) { - - var num = new Array(_this.getLength() + e.getLength() - 1); - - for (var i = 0; i < _this.getLength(); i += 1) { - for (var j = 0; j < e.getLength(); j += 1) { - num[i + j] ^= QRMath.gexp(QRMath.glog(_this.get(i) ) + QRMath.glog(e.get(j) ) ); - } - } - - return qrPolynomial(num, 0); - }; - - _this.mod = function(e) { - - if (_this.getLength() - e.getLength() < 0) { - return _this; - } - - var ratio = QRMath.glog(_this.get(0) ) - QRMath.glog(e.get(0) ); - - var num = new Array(_this.getLength() ); - for (var i = 0; i < _this.getLength(); i += 1) { - num[i] = _this.get(i); - } - - for (var i = 0; i < e.getLength(); i += 1) { - num[i] ^= QRMath.gexp(QRMath.glog(e.get(i) ) + ratio); - } - - // recursive call - return qrPolynomial(num, 0).mod(e); - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // QRRSBlock - //--------------------------------------------------------------------- - - var QRRSBlock = function() { - - var RS_BLOCK_TABLE = [ - - // L - // M - // Q - // H - - // 1 - [1, 26, 19], - [1, 26, 16], - [1, 26, 13], - [1, 26, 9], - - // 2 - [1, 44, 34], - [1, 44, 28], - [1, 44, 22], - [1, 44, 16], - - // 3 - [1, 70, 55], - [1, 70, 44], - [2, 35, 17], - [2, 35, 13], - - // 4 - [1, 100, 80], - [2, 50, 32], - [2, 50, 24], - [4, 25, 9], - - // 5 - [1, 134, 108], - [2, 67, 43], - [2, 33, 15, 2, 34, 16], - [2, 33, 11, 2, 34, 12], - - // 6 - [2, 86, 68], - [4, 43, 27], - [4, 43, 19], - [4, 43, 15], - - // 7 - [2, 98, 78], - [4, 49, 31], - [2, 32, 14, 4, 33, 15], - [4, 39, 13, 1, 40, 14], - - // 8 - [2, 121, 97], - [2, 60, 38, 2, 61, 39], - [4, 40, 18, 2, 41, 19], - [4, 40, 14, 2, 41, 15], - - // 9 - [2, 146, 116], - [3, 58, 36, 2, 59, 37], - [4, 36, 16, 4, 37, 17], - [4, 36, 12, 4, 37, 13], - - // 10 - [2, 86, 68, 2, 87, 69], - [4, 69, 43, 1, 70, 44], - [6, 43, 19, 2, 44, 20], - [6, 43, 15, 2, 44, 16] - ]; - - var qrRSBlock = function(totalCount, dataCount) { - var _this = {}; - _this.totalCount = totalCount; - _this.dataCount = dataCount; - return _this; - }; - - var _this = {}; - - var getRsBlockTable = function(typeNumber, errorCorrectLevel) { - - switch(errorCorrectLevel) { - case QRErrorCorrectLevel.L : - return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; - case QRErrorCorrectLevel.M : - return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; - case QRErrorCorrectLevel.Q : - return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; - case QRErrorCorrectLevel.H : - return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; - default : - return undefined; - } - }; - - _this.getRSBlocks = function(typeNumber, errorCorrectLevel) { - - var rsBlock = getRsBlockTable(typeNumber, errorCorrectLevel); - - if (typeof rsBlock == 'undefined') { - throw new Error('bad rs block @ typeNumber:' + typeNumber + - '/errorCorrectLevel:' + errorCorrectLevel); - } - - var length = rsBlock.length / 3; - - var list = new Array(); - - for (var i = 0; i < length; i += 1) { - - var count = rsBlock[i * 3 + 0]; - var totalCount = rsBlock[i * 3 + 1]; - var dataCount = rsBlock[i * 3 + 2]; - - for (var j = 0; j < count; j += 1) { - list.push(qrRSBlock(totalCount, dataCount) ); - } - } - - return list; - }; - - return _this; - }(); - - //--------------------------------------------------------------------- - // qrBitBuffer - //--------------------------------------------------------------------- - - var qrBitBuffer = function() { - - var _buffer = new Array(); - var _length = 0; - - var _this = {}; - - _this.getBuffer = function() { - return _buffer; - }; - - _this.get = function(index) { - var bufIndex = Math.floor(index / 8); - return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1; - }; - - _this.put = function(num, length) { - for (var i = 0; i < length; i += 1) { - _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1); - } - }; - - _this.getLengthInBits = function() { - return _length; - }; - - _this.putBit = function(bit) { - - var bufIndex = Math.floor(_length / 8); - if (_buffer.length <= bufIndex) { - _buffer.push(0); - } - - if (bit) { - _buffer[bufIndex] |= (0x80 >>> (_length % 8) ); - } - - _length += 1; - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // qr8BitByte - //--------------------------------------------------------------------- - - var qr8BitByte = function(data) { - - var _mode = QRMode.MODE_8BIT_BYTE; - var _data = data; - var _bytes = qrcode.stringToBytes(data); - - var _this = {}; - - _this.getMode = function() { - return _mode; - }; - - _this.getLength = function(buffer) { - return _bytes.length; - }; - - _this.write = function(buffer) { - for (var i = 0; i < _bytes.length; i += 1) { - buffer.put(_bytes[i], 8); - } - }; - - return _this; - }; - - //===================================================================== - // GIF Support etc. - // - - //--------------------------------------------------------------------- - // byteArrayOutputStream - //--------------------------------------------------------------------- - - var byteArrayOutputStream = function() { - - var _bytes = new Array(); - - var _this = {}; - - _this.writeByte = function(b) { - _bytes.push(b & 0xff); - }; - - _this.writeShort = function(i) { - _this.writeByte(i); - _this.writeByte(i >>> 8); - }; - - _this.writeBytes = function(b, off, len) { - off = off || 0; - len = len || b.length; - for (var i = 0; i < len; i += 1) { - _this.writeByte(b[i + off]); - } - }; - - _this.writeString = function(s) { - for (var i = 0; i < s.length; i += 1) { - _this.writeByte(s.charCodeAt(i) ); - } - }; - - _this.toByteArray = function() { - return _bytes; - }; - - _this.toString = function() { - var s = ''; - s += '['; - for (var i = 0; i < _bytes.length; i += 1) { - if (i > 0) { - s += ','; - } - s += _bytes[i]; - } - s += ']'; - return s; - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // base64EncodeOutputStream - //--------------------------------------------------------------------- - - var base64EncodeOutputStream = function() { - - var _buffer = 0; - var _buflen = 0; - var _length = 0; - var _base64 = ''; - - var _this = {}; - - var writeEncoded = function(b) { - _base64 += String.fromCharCode(encode(b & 0x3f) ); - }; - - var encode = function(n) { - if (n < 0) { - // error. - } else if (n < 26) { - return 0x41 + n; - } else if (n < 52) { - return 0x61 + (n - 26); - } else if (n < 62) { - return 0x30 + (n - 52); - } else if (n == 62) { - return 0x2b; - } else if (n == 63) { - return 0x2f; - } - throw new Error('n:' + n); - }; - - _this.writeByte = function(n) { - - _buffer = (_buffer << 8) | (n & 0xff); - _buflen += 8; - _length += 1; - - while (_buflen >= 6) { - writeEncoded(_buffer >>> (_buflen - 6) ); - _buflen -= 6; - } - }; - - _this.flush = function() { - - if (_buflen > 0) { - writeEncoded(_buffer << (6 - _buflen) ); - _buffer = 0; - _buflen = 0; - } - - if (_length % 3 != 0) { - // padding - var padlen = 3 - _length % 3; - for (var i = 0; i < padlen; i += 1) { - _base64 += '='; - } - } - }; - - _this.toString = function() { - return _base64; - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // base64DecodeInputStream - //--------------------------------------------------------------------- - - var base64DecodeInputStream = function(str) { - - var _str = str; - var _pos = 0; - var _buffer = 0; - var _buflen = 0; - - var _this = {}; - - _this.read = function() { - - while (_buflen < 8) { - - if (_pos >= _str.length) { - if (_buflen == 0) { - return -1; - } - throw new Error('unexpected end of file./' + _buflen); - } - - var c = _str.charAt(_pos); - _pos += 1; - - if (c == '=') { - _buflen = 0; - return -1; - } else if (c.match(/^\s$/) ) { - // ignore if whitespace. - continue; - } - - _buffer = (_buffer << 6) | decode(c.charCodeAt(0) ); - _buflen += 6; - } - - var n = (_buffer >>> (_buflen - 8) ) & 0xff; - _buflen -= 8; - return n; - }; - - var decode = function(c) { - if (0x41 <= c && c <= 0x5a) { - return c - 0x41; - } else if (0x61 <= c && c <= 0x7a) { - return c - 0x61 + 26; - } else if (0x30 <= c && c <= 0x39) { - return c - 0x30 + 52; - } else if (c == 0x2b) { - return 62; - } else if (c == 0x2f) { - return 63; - } else { - throw new Error('c:' + c); - } - }; - - return _this; - }; - - //--------------------------------------------------------------------- - // gifImage (B/W) - //--------------------------------------------------------------------- - - var gifImage = function(width, height) { - - var _width = width; - var _height = height; - var _data = new Array(width * height); - - var _this = {}; - - _this.setPixel = function(x, y, pixel) { - _data[y * _width + x] = pixel; - }; - - _this.write = function(out) { - - //--------------------------------- - // GIF Signature - - out.writeString('GIF87a'); - - //--------------------------------- - // Screen Descriptor - - out.writeShort(_width); - out.writeShort(_height); - - out.writeByte(0x80); // 2bit - out.writeByte(0); - out.writeByte(0); - - //--------------------------------- - // Global Color Map - - // black - out.writeByte(0x00); - out.writeByte(0x00); - out.writeByte(0x00); - - // white - out.writeByte(0xff); - out.writeByte(0xff); - out.writeByte(0xff); - - //--------------------------------- - // Image Descriptor - - out.writeString(','); - out.writeShort(0); - out.writeShort(0); - out.writeShort(_width); - out.writeShort(_height); - out.writeByte(0); - - //--------------------------------- - // Local Color Map - - //--------------------------------- - // Raster Data - - var lzwMinCodeSize = 2; - var raster = getLZWRaster(lzwMinCodeSize); - - out.writeByte(lzwMinCodeSize); - - var offset = 0; - - while (raster.length - offset > 255) { - out.writeByte(255); - out.writeBytes(raster, offset, 255); - offset += 255; - } - - out.writeByte(raster.length - offset); - out.writeBytes(raster, offset, raster.length - offset); - out.writeByte(0x00); - - //--------------------------------- - // GIF Terminator - out.writeString(';'); - }; - - var bitOutputStream = function(out) { - - var _out = out; - var _bitLength = 0; - var _bitBuffer = 0; - - var _this = {}; - - _this.write = function(data, length) { - - if ( (data >>> length) != 0) { - throw new Error('length over'); - } - - while (_bitLength + length >= 8) { - _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) ); - length -= (8 - _bitLength); - data >>>= (8 - _bitLength); - _bitBuffer = 0; - _bitLength = 0; - } - - _bitBuffer = (data << _bitLength) | _bitBuffer; - _bitLength = _bitLength + length; - }; - - _this.flush = function() { - if (_bitLength > 0) { - _out.writeByte(_bitBuffer); - } - }; - - return _this; - }; - - var getLZWRaster = function(lzwMinCodeSize) { - - var clearCode = 1 << lzwMinCodeSize; - var endCode = (1 << lzwMinCodeSize) + 1; - var bitLength = lzwMinCodeSize + 1; - - // Setup LZWTable - var table = lzwTable(); - - for (var i = 0; i < clearCode; i += 1) { - table.add(String.fromCharCode(i) ); - } - table.add(String.fromCharCode(clearCode) ); - table.add(String.fromCharCode(endCode) ); - - var byteOut = byteArrayOutputStream(); - var bitOut = bitOutputStream(byteOut); - - // clear code - bitOut.write(clearCode, bitLength); - - var dataIndex = 0; - - var s = String.fromCharCode(_data[dataIndex]); - dataIndex += 1; - - while (dataIndex < _data.length) { - - var c = String.fromCharCode(_data[dataIndex]); - dataIndex += 1; - - if (table.contains(s + c) ) { - - s = s + c; - - } else { - - bitOut.write(table.indexOf(s), bitLength); - - if (table.size() < 0xfff) { - - if (table.size() == (1 << bitLength) ) { - bitLength += 1; - } - - table.add(s + c); - } - - s = c; - } - } - - bitOut.write(table.indexOf(s), bitLength); - - // end code - bitOut.write(endCode, bitLength); - - bitOut.flush(); - - return byteOut.toByteArray(); - }; - - var lzwTable = function() { - - var _map = {}; - var _size = 0; - - var _this = {}; - - _this.add = function(key) { - if (_this.contains(key) ) { - throw new Error('dup key:' + key); - } - _map[key] = _size; - _size += 1; - }; - - _this.size = function() { - return _size; - }; - - _this.indexOf = function(key) { - return _map[key]; - }; - - _this.contains = function(key) { - return typeof _map[key] != 'undefined'; - }; - - return _this; - }; - - return _this; - }; - - var createImgTag = function(width, height, getPixel, alt) { - - var gif = gifImage(width, height); - for (var y = 0; y < height; y += 1) { - for (var x = 0; x < width; x += 1) { - gif.setPixel(x, y, getPixel(x, y) ); - } - } - - var b = byteArrayOutputStream(); - gif.write(b); - - var base64 = base64EncodeOutputStream(); - var bytes = b.toByteArray(); - for (var i = 0; i < bytes.length; i += 1) { - base64.writeByte(bytes[i]); - } - base64.flush(); - - var img = ''; - img += ' Date: Sun, 8 Jul 2012 15:04:14 +0200 Subject: [PATCH 08/67] Updates to modulejs 0.1. --- src/_h5ai/js/inc/core/entry.js | 2 +- src/_h5ai/js/inc/core/event.js | 2 +- src/_h5ai/js/inc/core/format.js | 2 +- src/_h5ai/js/inc/core/parser.js | 6 +- src/_h5ai/js/inc/core/resource.js | 2 +- src/_h5ai/js/inc/core/settings.js | 6 +- src/_h5ai/js/inc/core/store.js | 2 +- src/_h5ai/js/inc/ext/crumb.js | 2 +- src/_h5ai/js/inc/ext/custom.js | 2 +- src/_h5ai/js/inc/ext/download.js | 2 +- src/_h5ai/js/inc/ext/filter.js | 2 +- src/_h5ai/js/inc/ext/folderstatus.js | 2 +- src/_h5ai/js/inc/ext/l10n.js | 2 +- src/_h5ai/js/inc/ext/link-hover-states.js | 2 +- src/_h5ai/js/inc/ext/mode.js | 2 +- src/_h5ai/js/inc/ext/preview-img.js | 2 +- src/_h5ai/js/inc/ext/qrcode.js | 2 +- src/_h5ai/js/inc/ext/select.js | 2 +- src/_h5ai/js/inc/ext/sort.js | 2 +- src/_h5ai/js/inc/ext/statusbar.js | 2 +- src/_h5ai/js/inc/ext/thumbnails.js | 2 +- src/_h5ai/js/inc/ext/title.js | 2 +- src/_h5ai/js/inc/ext/tree.js | 2 +- src/_h5ai/js/inc/h5ai-info.js | 2 +- src/_h5ai/js/inc/h5ai-main.js | 15 +- src/_h5ai/js/inc/lib/module.js | 198 -------------------- src/_h5ai/js/inc/lib/modulejs-0.1.js | 168 +++++++++++++++++ src/_h5ai/js/inc/lib/modulejs-debug-0.1.js | 133 +++++++++++++ src/_h5ai/js/inc/main.js | 8 +- src/_h5ai/js/inc/model/entry.js | 11 +- src/_h5ai/js/inc/parser/apache-autoindex.js | 2 +- src/_h5ai/js/inc/parser/generic-json.js | 2 +- src/_h5ai/js/inc/view/extended.js | 2 +- src/_h5ai/js/inc/view/spacing.js | 2 +- src/_h5ai/js/inc/view/viewmode.js | 2 +- src/_h5ai/js/scripts.js | 3 +- 36 files changed, 360 insertions(+), 242 deletions(-) delete mode 100644 src/_h5ai/js/inc/lib/module.js create mode 100644 src/_h5ai/js/inc/lib/modulejs-0.1.js create mode 100644 src/_h5ai/js/inc/lib/modulejs-debug-0.1.js diff --git a/src/_h5ai/js/inc/core/entry.js b/src/_h5ai/js/inc/core/entry.js index b86bfd23..033970b3 100644 --- a/src/_h5ai/js/inc/core/entry.js +++ b/src/_h5ai/js/inc/core/entry.js @@ -1,5 +1,5 @@ -module.define('core/entry', [jQuery, 'core/parser', 'model/entry'], function ($, parser, Entry) { +modulejs.define('core/entry', ['jQuery', 'core/parser', 'model/entry'], function ($, parser, Entry) { var absHref = document.location.pathname.replace(/[^\/]*$/, ''); diff --git a/src/_h5ai/js/inc/core/event.js b/src/_h5ai/js/inc/core/event.js index f8e84334..81ce4284 100644 --- a/src/_h5ai/js/inc/core/event.js +++ b/src/_h5ai/js/inc/core/event.js @@ -1,5 +1,5 @@ -module.define('core/event', [amplify], function (amplify) { +modulejs.define('core/event', ['amplify'], function (amplify) { var sub = function (topic, callback) { diff --git a/src/_h5ai/js/inc/core/format.js b/src/_h5ai/js/inc/core/format.js index c2008664..4fbeba5a 100644 --- a/src/_h5ai/js/inc/core/format.js +++ b/src/_h5ai/js/inc/core/format.js @@ -1,5 +1,5 @@ -module.define('core/format', [moment], function (moment) { +modulejs.define('core/format', ['moment'], function (moment) { var reParseSize = /^\s*([\.\d]+)\s*([kmgt]?)b?\s*$/i, treshhold = 1000.0, diff --git a/src/_h5ai/js/inc/core/parser.js b/src/_h5ai/js/inc/core/parser.js index b5daacb5..0f06d463 100644 --- a/src/_h5ai/js/inc/core/parser.js +++ b/src/_h5ai/js/inc/core/parser.js @@ -1,11 +1,11 @@ -module.define('core/parser', [jQuery], function ($) { +modulejs.define('core/parser', ['jQuery'], function ($) { if ($('#data-apache-autoindex').length) { - return module.require('parser/apache-autoindex'); + return modulejs.require('parser/apache-autoindex'); } if ($('#data-generic-json').length) { - return module.require('parser/generic-json'); + return modulejs.require('parser/generic-json'); } return { diff --git a/src/_h5ai/js/inc/core/resource.js b/src/_h5ai/js/inc/core/resource.js index add1636a..17baed3c 100644 --- a/src/_h5ai/js/inc/core/resource.js +++ b/src/_h5ai/js/inc/core/resource.js @@ -1,5 +1,5 @@ -module.define('core/resource', ['core/settings'], function (settings) { +modulejs.define('core/resource', ['core/settings'], function (settings) { var api = function () { diff --git a/src/_h5ai/js/inc/core/settings.js b/src/_h5ai/js/inc/core/settings.js index e279cc2c..bbb74f32 100644 --- a/src/_h5ai/js/inc/core/settings.js +++ b/src/_h5ai/js/inc/core/settings.js @@ -1,5 +1,5 @@ -module.define('core/settings', [H5AI_CONFIG], function (config) { +modulejs.define('core/settings', ['H5AI_CONFIG'], function (config) { var defaults = { rootAbsHref: '/', @@ -12,7 +12,7 @@ module.define('core/settings', [H5AI_CONFIG], function (config) { }); -module.define('core/types', [H5AI_CONFIG], function (config) { +modulejs.define('core/types', ['H5AI_CONFIG'], function (config) { var reEndsWithSlash = /\/$/, reStartsWithDot = /^\./, @@ -61,7 +61,7 @@ module.define('core/types', [H5AI_CONFIG], function (config) { }); -module.define('core/langs', [H5AI_CONFIG], function (config) { +modulejs.define('core/langs', ['H5AI_CONFIG'], function (config) { var defaults = { lang: 'unknown', diff --git a/src/_h5ai/js/inc/core/store.js b/src/_h5ai/js/inc/core/store.js index 04d297b1..ca7f6715 100644 --- a/src/_h5ai/js/inc/core/store.js +++ b/src/_h5ai/js/inc/core/store.js @@ -1,5 +1,5 @@ -module.define('core/store', [amplify], function (amplify) { +modulejs.define('core/store', ['amplify'], function (amplify) { var put = function (key, value) { diff --git a/src/_h5ai/js/inc/ext/crumb.js b/src/_h5ai/js/inc/ext/crumb.js index d34dfb55..8622a546 100644 --- a/src/_h5ai/js/inc/ext/crumb.js +++ b/src/_h5ai/js/inc/ext/crumb.js @@ -1,5 +1,5 @@ -module.define('ext/crumb', [jQuery, 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { +modulejs.define('ext/crumb', ['jQuery', 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/custom.js b/src/_h5ai/js/inc/ext/custom.js index 2154026d..dd5fce91 100644 --- a/src/_h5ai/js/inc/ext/custom.js +++ b/src/_h5ai/js/inc/ext/custom.js @@ -1,5 +1,5 @@ -module.define('ext/custom', [jQuery, 'core/settings'], function ($, allsettings) { +modulejs.define('ext/custom', ['jQuery', 'core/settings'], function ($, allsettings) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/download.js b/src/_h5ai/js/inc/ext/download.js index cc88cb1c..af007f37 100644 --- a/src/_h5ai/js/inc/ext/download.js +++ b/src/_h5ai/js/inc/ext/download.js @@ -1,5 +1,5 @@ -module.define('ext/download', [jQuery, 'core/settings', 'core/resource', 'core/event'], function ($, allsettings, resource, event) { +modulejs.define('ext/download', ['jQuery', 'core/settings', 'core/resource', 'core/event'], function ($, allsettings, resource, event) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/filter.js b/src/_h5ai/js/inc/ext/filter.js index 67762858..b0ce24cf 100644 --- a/src/_h5ai/js/inc/ext/filter.js +++ b/src/_h5ai/js/inc/ext/filter.js @@ -1,5 +1,5 @@ -module.define('ext/filter', [jQuery, 'core/settings', 'core/resource'], function ($, allsettings, resource) { +modulejs.define('ext/filter', ['jQuery', 'core/settings', 'core/resource'], function ($, allsettings, resource) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/folderstatus.js b/src/_h5ai/js/inc/ext/folderstatus.js index c4d95254..9d1326ad 100644 --- a/src/_h5ai/js/inc/ext/folderstatus.js +++ b/src/_h5ai/js/inc/ext/folderstatus.js @@ -1,5 +1,5 @@ -module.define('ext/folderstatus', [jQuery, 'core/settings'], function ($, allsettings) { +modulejs.define('ext/folderstatus', ['jQuery', 'core/settings'], function ($, allsettings) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/l10n.js b/src/_h5ai/js/inc/ext/l10n.js index 5598f41e..ca8ed7bd 100644 --- a/src/_h5ai/js/inc/ext/l10n.js +++ b/src/_h5ai/js/inc/ext/l10n.js @@ -1,5 +1,5 @@ -module.define('ext/l10n', [jQuery, 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event'], function ($, allsettings, langs, format, store, event) { +modulejs.define('ext/l10n', ['jQuery', 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event'], function ($, allsettings, langs, format, store, event) { var defaults = { enabled: true, diff --git a/src/_h5ai/js/inc/ext/link-hover-states.js b/src/_h5ai/js/inc/ext/link-hover-states.js index ea65755f..5b5db61e 100644 --- a/src/_h5ai/js/inc/ext/link-hover-states.js +++ b/src/_h5ai/js/inc/ext/link-hover-states.js @@ -1,5 +1,5 @@ -module.define('ext/link-hover-states', [jQuery, 'core/settings'], function ($, allsettings) { +modulejs.define('ext/link-hover-states', ['jQuery', 'core/settings'], function ($, allsettings) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/mode.js b/src/_h5ai/js/inc/ext/mode.js index 90cdf9ae..7253d9df 100644 --- a/src/_h5ai/js/inc/ext/mode.js +++ b/src/_h5ai/js/inc/ext/mode.js @@ -1,5 +1,5 @@ -module.define('ext/mode', [jQuery, 'core/settings', 'core/parser'], function ($, allsettings, parser) { +modulejs.define('ext/mode', ['jQuery', 'core/settings', 'core/parser'], function ($, allsettings, parser) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 6f601d2c..814abef2 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -1,5 +1,5 @@ -module.define('ext/preview-img', [jQuery, 'core/settings', 'core/resource', 'core/store', 'core/entry'], function ($, allsettings, resource, store, entry) { +modulejs.define('ext/preview-img', ['jQuery', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function ($, allsettings, resource, store, entry) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/qrcode.js b/src/_h5ai/js/inc/ext/qrcode.js index 62b15304..c325009a 100644 --- a/src/_h5ai/js/inc/ext/qrcode.js +++ b/src/_h5ai/js/inc/ext/qrcode.js @@ -1,5 +1,5 @@ -module.define('ext/qrcode', [jQuery, 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('ext/qrcode', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/select.js b/src/_h5ai/js/inc/ext/select.js index eb0ea1ba..c19d600c 100644 --- a/src/_h5ai/js/inc/ext/select.js +++ b/src/_h5ai/js/inc/ext/select.js @@ -1,5 +1,5 @@ -module.define('ext/select', [jQuery, 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/sort.js b/src/_h5ai/js/inc/ext/sort.js index c30efef1..9b12b0cd 100644 --- a/src/_h5ai/js/inc/ext/sort.js +++ b/src/_h5ai/js/inc/ext/sort.js @@ -1,5 +1,5 @@ -module.define('ext/sort', [jQuery, 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { +modulejs.define('ext/sort', ['jQuery', 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/statusbar.js b/src/_h5ai/js/inc/ext/statusbar.js index e8d9b16c..6d985e44 100644 --- a/src/_h5ai/js/inc/ext/statusbar.js +++ b/src/_h5ai/js/inc/ext/statusbar.js @@ -1,5 +1,5 @@ -module.define('ext/statusbar', [jQuery, 'core/settings', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, format, event, entry) { +modulejs.define('ext/statusbar', ['jQuery', 'core/settings', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, format, event, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/thumbnails.js b/src/_h5ai/js/inc/ext/thumbnails.js index 896e25e2..2dac49fb 100644 --- a/src/_h5ai/js/inc/ext/thumbnails.js +++ b/src/_h5ai/js/inc/ext/thumbnails.js @@ -1,5 +1,5 @@ -module.define('ext/thumbnails', [jQuery, 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { +modulejs.define('ext/thumbnails', ['jQuery', 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/title.js b/src/_h5ai/js/inc/ext/title.js index d49081f1..2a9097e1 100644 --- a/src/_h5ai/js/inc/ext/title.js +++ b/src/_h5ai/js/inc/ext/title.js @@ -1,5 +1,5 @@ -module.define('ext/title', [jQuery, 'core/settings', 'core/entry'], function ($, allsettings, entry) { +modulejs.define('ext/title', ['jQuery', 'core/settings', 'core/entry'], function ($, allsettings, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 014dc0f2..3d2decc2 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -1,5 +1,5 @@ -module.define('ext/tree', [jQuery, 'core/settings', 'core/resource', 'core/event', 'core/entry', 'core/parser'], function ($, allsettings, resource, event, entry, parser) { +modulejs.define('ext/tree', ['jQuery', 'core/settings', 'core/resource', 'core/event', 'core/entry', 'core/parser'], function ($, allsettings, resource, event, entry, parser) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/h5ai-info.js b/src/_h5ai/js/inc/h5ai-info.js index 9ad9bd48..640fd3b5 100644 --- a/src/_h5ai/js/inc/h5ai-info.js +++ b/src/_h5ai/js/inc/h5ai-info.js @@ -1,5 +1,5 @@ -module.define('h5ai-info', [jQuery, 'core/resource'], function ($, resource) { +modulejs.define('h5ai-info', ['jQuery', 'core/resource'], function ($, resource) { var setCheckResult = function (id, result) { diff --git a/src/_h5ai/js/inc/h5ai-main.js b/src/_h5ai/js/inc/h5ai-main.js index 222d1f64..19003056 100644 --- a/src/_h5ai/js/inc/h5ai-main.js +++ b/src/_h5ai/js/inc/h5ai-main.js @@ -1,18 +1,19 @@ -module.define('h5ai-main', [jQuery, 'core/event', 'core/settings'], function ($, event, settings) { +modulejs.define('h5ai-main', ['jQuery', 'core/event', 'core/settings'], function ($, event, settings) { event.pub('beforeView'); - module.require('view/extended'); - module.require('view/viewmode'); - module.require('view/spacing'); + modulejs.require('view/extended'); + modulejs.require('view/viewmode'); + modulejs.require('view/spacing'); event.pub('beforeExt'); - _.each(module.getIds(/^ext\/.+/), function (id) { + // _.each(modulejs.getIds(/^ext\/.+/), function (id) { - module.require(id); - }); + // modulejs.require(id); + // }); + modulejs.require(/^ext\/.+/); event.pub('ready'); }); diff --git a/src/_h5ai/js/inc/lib/module.js b/src/_h5ai/js/inc/lib/module.js deleted file mode 100644 index 689d5271..00000000 --- a/src/_h5ai/js/inc/lib/module.js +++ /dev/null @@ -1,198 +0,0 @@ -/*! - * module.js - * author: Lars Jung - * license: MIT - */ - -(function (global, name) { - 'use strict'; - - var err = function (message) { - - throw name + ' exception: ' + message; - }; - - if (!_) { - err(name + ' depends on underscore'); - } - - var self = {}, - previous = global[name], - - noConflict = function () { - - if (global[name] === self) { - global[name] = previous; - } - return self; - }, - - definitions = {}, - modules = {}, - - findDepsUnsafe = function (ids) { - - var self = this; - var deps = []; - - if (_.isString(ids)) { - - var def = definitions[ids]; - if (def) { - _.each(def.deps, function (id) { - - deps = deps.concat(findDepsUnsafe(id)); - }); - deps.push(def.id); - } else { - deps.push(ids); - } - } else if (_.isArray(ids)) { - - _.each(ids, function (id) { - - deps = deps.concat(findDepsUnsafe(id)); - }); - } - - return _.uniq(deps); - }, - - findDeps = function (ids) { - - if (ids) { - try { - return findDepsUnsafe(ids); - } catch (e) { - err('cyclic dependencies for ids "' + ids + '"'); - } - } else { - var res = {}; - _.each(definitions, function (def, id) { - - res[id] = findDeps(id); - }); - return res; - } - }, - - log = function (showInvDeps) { - - var allDeps = findDeps(), - allInvDeps = {}, - out = ''; - - if (!showInvDeps) { - _.each(allDeps, function (deps, id) { - - deps.pop(); - out += (_.has(modules, id) ? '* ' : ' ') + id + ' -> [ ' + deps.join(', ') + ' ]\n'; - }); - } else { - _.each(definitions, function (def) { - - var invDeps = []; - _.each(allDeps, function (depIds, id) { - - if (_.indexOf(depIds, def.id) >= 0) { - invDeps.push(id); - } - }); - allInvDeps[def.id] = invDeps; - }); - - _.each(allInvDeps, function (invDeps, id) { - - invDeps.shift(); - out += (_.has(modules, id) ? '* ' : ' ') + id + ' <- [ ' + invDeps.join(', ') + ' ]\n'; - }); - } - - return out; - }, - - define = function (id, deps, fn) { - - if (_.isFunction(deps)) { - fn = deps; - deps = []; - } - if (!_.isString(id)) { - err('id must be a string "' + id + '"'); - } - if (!_.isArray(deps)) { - err('dependencies must be an array "' + deps + '"'); - } - if (!_.isFunction(fn)) { - err('constructor must be a function "' + fn + '"'); - } - if (definitions[id]) { - err('id already defined "' + id + '"'); - } - - definitions[id] = { - id: id, - deps: deps, - fn: fn - }; - }, - - getIds = function (regexp) { - - var ids = _.map(definitions, function (def) { - - return def.id; - }); - - if (!_.isRegExp(regexp)) { - return ids; - } - - return _.filter(ids, function (id) { - - return regexp.test(id); - }); - }, - - isDefined = function (id) { - - return _.isString(id) ? !!definitions[id] : !!id; - }, - - require = function (id) { - - if (!_.isString(id)) { - return id; - } - - if (_.has(modules, id)) { - return modules[id]; - } - - var def = definitions[id]; - if (!def) { - err('id not defined "' + id + '"'); - } - - var deps = _.map(def.deps, function (depId) { - - return require(depId); - }); - - var obj = def.fn.apply(this, deps); - modules[id] = obj; - return obj; - }; - - _.extend(self, { - noConflict: noConflict, - log: log, - define: define, - require: require, - getIds: getIds, - isDefined: isDefined - }); - - global[name] = self; - -}(this, 'module')); diff --git a/src/_h5ai/js/inc/lib/modulejs-0.1.js b/src/_h5ai/js/inc/lib/modulejs-0.1.js new file mode 100644 index 00000000..ff7dfd54 --- /dev/null +++ b/src/_h5ai/js/inc/lib/modulejs-0.1.js @@ -0,0 +1,168 @@ +/*! modulejs 0.1 - //larsjung.de/qrcode - MIT License */ + +(function (global, _, name) { + 'use strict'; + + + // throws error + var err = function (condition, code, message) { + + if (condition) { + if (console && console.error) { + console.error(name + ' error: [' + code + '] ' + message); + } + throw { + code: code, + msg: name + ' error: ' + message + }; + } + }; + + // make sure underscore is loaded + err(!_, 1, name + ' requires underscore'); + + + // ModuleJs + // ======== + var ModuleJs = function () { + + var self = this; + + // module definitions + self.definitions = {}; + + // module instances + self.instances = {}; + + // define + // ------ + // Defines a module. + self.define = function (id, deps, fn) { + + // sort arguments + if (_.isFunction(deps)) { + fn = deps; + deps = []; + } + // check arguments + err(!_.isString(id), 11, 'id must be a string "' + id + '"'); + err(self.definitions[id], 12, 'id already defined "' + id + '"'); + err(!_.isFunction(fn), 13, 'constructor for "' + id + '" must be a function "' + fn + '"'); + err(!_.isArray(deps), 14, 'dependencies for "' + id + '" must be an array "' + deps + '"'); + + // map definition + self.definitions[id] = { + id: id, + deps: deps, + fn: fn + }; + }; + + // predefined + // ---------- + // Registers a predefined object. + self.predefined = function (id, instance, check) { + + if (_.isFunction(check)) { + check = !!check(); + } + if (!_.isBoolean(check)) { + check = instance !== undefined; + } + err(!check, 21, 'check for predefined "' + id + '" failed'); + + self.define(id, [], function () { + + return instance; + }); + }; + + // Returns an instance for `id`, checked against require-`stack` for + // cyclic dependencies. + self._require = function (id, stack) { + + err(!_.isString(id), 31, 'id must be a string "' + id + '"'); + + if (_.has(self.instances, id)) { + return self.instances[id]; + } + + var def = self.definitions[id]; + err(!def, 32, 'id not defined "' + id + '"'); + + stack = (stack || []).slice(0); + stack.push(id); + var deps = _.map(def.deps, function (depId) { + + err(_.indexOf(stack, depId) >= 0, 33, 'cyclic dependencies: ' + stack + ' & ' + depId); + + return self._require(depId, stack); + }); + + var obj = def.fn.apply(global, deps); + self.instances[id] = obj; + return obj; + }; + + // require + // ------- + // Returns an instance for `id`. + self.require = function (arg) { + + if (_.isArray(arg)) { + + return _.map(arg, function (id) { + + return self._require(id); + }); + } + + if (_.isRegExp(arg)) { + + var res = {}; + _.each(_.keys(self.definitions), function (id) { + + if (arg.test(id)) { + res[id] = self._require(id); + } + }); + return res; + } + + return self._require(arg); + }; + + // Registers public API on the global object. + self.register = function (name) { + + var previous = global[name], + api = { + define: self.define, + predefined: self.predefined, + require: self.require, + noConflict: function () { + + if (global[name] === api) { + global[name] = previous; + } + return api; + } + }; + + global[name] = api; + }; + }; + + + var modulejs = new ModuleJs(); + modulejs.register(name); + + + // debugger + // -------- + var debugName = name.toUpperCase(); + if (_.isFunction(global[debugName])) { + global[debugName] = new global[debugName](modulejs); + } + +}(this, _, 'modulejs')); diff --git a/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js b/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js new file mode 100644 index 00000000..5f4f7b7c --- /dev/null +++ b/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js @@ -0,0 +1,133 @@ +/*! modulejs-debug 0.1 - //larsjung.de/qrcode - MIT License */ + +(function (global, _, name) { + 'use strict'; + + + var Debugger = function (modulejs) { + + + var self = this; + + + self.modulejs = modulejs; + + + self.clear = function () { + + modulejs.definitions = {}; + modulejs.instances = {}; + }; + + + self.isDefined = function (id) { + + return _.isString(id) && !!modulejs.definitions[id]; + }; + + + self.ids = function (regexp) { + + var ids = _.map(modulejs.definitions, function (def) { + + return def.id; + }); + + if (!_.isRegExp(regexp)) { + return ids; + } + + return _.filter(ids, function (id) { + + return regexp.test(id); + }); + }; + + + var _deps = function (id, stack) { + + var deps = []; + + var def = modulejs.definitions[id]; + if (def) { + stack = (stack || []).slice(0); + stack.push(id); + _.each(def.deps, function (depId) { + + if (_.indexOf(stack, depId) >= 0) { + deps = deps.concat([false, def.id]); + return deps; + } + + deps = deps.concat(_deps(depId, stack)); + deps.push(depId); + }); + } + + return _.uniq(deps); + }; + + + self.deps = function (ids) { + + if (_.isString(ids)) { + + return _deps(ids); + } else if (_.isArray(ids)) { + + var deps = []; + _.each(ids, function (id) { + + deps = deps.concat(_deps(id)); + }); + return _.uniq(deps); + } + + var res = {}; + _.each(modulejs.definitions, function (def, id) { + + res[id] = _deps(id); + }); + return res; + }; + + + self.log = function (showInvDeps) { + + var allDeps = self.deps(), + allInvDeps = {}, + out = '\n'; + + if (!showInvDeps) { + _.each(allDeps, function (deps, id) { + + out += (_.has(modulejs.instances, id) ? '* ' : ' ') + id + ' -> [ ' + deps.join(', ') + ' ]\n'; + }); + } else { + _.each(modulejs.definitions, function (def) { + + var invDeps = []; + _.each(allDeps, function (depIds, id) { + + if (_.indexOf(depIds, def.id) >= 0) { + invDeps.push(id); + } + }); + allInvDeps[def.id] = invDeps; + }); + + _.each(allInvDeps, function (invDeps, id) { + + out += (_.has(modulejs.instances, id) ? '* ' : ' ') + id + ' <- [ ' + invDeps.join(', ') + ' ]\n'; + }); + } + + return out; + }; + }; + + + global[name.toUpperCase()] = Debugger; + + +}(this, _, 'modulejs')); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index d59debb8..9c116a76 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -2,6 +2,12 @@ (function ($) { 'use strict'; + modulejs.predefined('jQuery', jQuery); + modulejs.predefined('amplify', amplify); + modulejs.predefined('moment', moment); + modulejs.predefined('H5AI_CONFIG', H5AI_CONFIG); + + // @include "core/entry.js" // @include "core/event.js" // @include "core/format.js" @@ -42,7 +48,7 @@ $(function () { - module.require($('body').attr('id')); + modulejs.require($('body').attr('id')); }); }(jQuery)); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 22052ee3..b6c2730e 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -1,5 +1,5 @@ -module.define('model/entry', [jQuery, 'core/types'], function ($, types) { +modulejs.define('model/entry', ['jQuery', 'core/types'], function ($, types) { var domain = document.domain, location = document.location.pathname.replace(/[^\/]*$/, ''), @@ -132,7 +132,14 @@ module.define('model/entry', [jQuery, 'core/types'], function ($, types) { return self; }, - folderstatus = module.isDefined('ext/folderstatus') ? module.require('ext/folderstatus') : {}, + // folderstatus = module.isDefined('ext/folderstatus') ? module.require('ext/folderstatus') : {}, + folderstatus = (function () { + + var id = 'ext/folderstatus', + res = modulejs.require(new RegExp('^' + id + '$')); + + return res.id ? res.id : {}; + }()), fetchStatus = function (absHref, callback) { diff --git a/src/_h5ai/js/inc/parser/apache-autoindex.js b/src/_h5ai/js/inc/parser/apache-autoindex.js index e0c244f2..caa1d71a 100644 --- a/src/_h5ai/js/inc/parser/apache-autoindex.js +++ b/src/_h5ai/js/inc/parser/apache-autoindex.js @@ -1,5 +1,5 @@ -module.define('parser/apache-autoindex', [jQuery, 'core/settings', 'core/format', 'model/entry'], function ($, settings, format, Entry) { +modulejs.define('parser/apache-autoindex', ['jQuery', 'core/settings', 'core/format', 'model/entry'], function ($, settings, format, Entry) { var parseTableRow = function (absHref, tr) { diff --git a/src/_h5ai/js/inc/parser/generic-json.js b/src/_h5ai/js/inc/parser/generic-json.js index 64157102..672377b5 100644 --- a/src/_h5ai/js/inc/parser/generic-json.js +++ b/src/_h5ai/js/inc/parser/generic-json.js @@ -1,5 +1,5 @@ -module.define('parser/generic-json', [jQuery, 'core/settings', 'model/entry'], function ($, settings, Entry) { +modulejs.define('parser/generic-json', ['jQuery', 'core/settings', 'model/entry'], function ($, settings, Entry) { var parser = { id: 'generic-json', diff --git a/src/_h5ai/js/inc/view/extended.js b/src/_h5ai/js/inc/view/extended.js index 04dba993..a1f29e37 100644 --- a/src/_h5ai/js/inc/view/extended.js +++ b/src/_h5ai/js/inc/view/extended.js @@ -1,5 +1,5 @@ -module.define('view/extended', [jQuery, 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, resource, format, event, entry) { +modulejs.define('view/extended', ['jQuery', 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, resource, format, event, entry) { var defaults = { modes: ['details', 'icons'], diff --git a/src/_h5ai/js/inc/view/spacing.js b/src/_h5ai/js/inc/view/spacing.js index 77e37784..6055fa8c 100644 --- a/src/_h5ai/js/inc/view/spacing.js +++ b/src/_h5ai/js/inc/view/spacing.js @@ -1,5 +1,5 @@ -module.define('view/spacing', [jQuery, 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('view/spacing', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { var defaults = { maxWidth: 960, diff --git a/src/_h5ai/js/inc/view/viewmode.js b/src/_h5ai/js/inc/view/viewmode.js index c78ed480..a321acbb 100644 --- a/src/_h5ai/js/inc/view/viewmode.js +++ b/src/_h5ai/js/inc/view/viewmode.js @@ -1,5 +1,5 @@ -module.define('view/viewmode', [jQuery, 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { +modulejs.define('view/viewmode', ['jQuery', 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { var defaults = { modes: ['details', 'list', 'icons'], diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 3e40e7e2..889b2ebe 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -10,7 +10,8 @@ // underscore libs // --------------- // @include "inc/lib/underscore-1.3.1.min.js" -// @include "inc/lib/module.js" +// @-include "inc/lib/modulejs-debug-0.1.js" +// @include "inc/lib/modulejs-0.1.js" // other libs // ---------- From 84a2ed582f35fce81a0b0b0cb211e6d137e3adb0 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 9 Jul 2012 00:43:01 +0200 Subject: [PATCH 09/67] Minor refactorings. --- src/_h5ai/js/inc/lib/modulejs-0.1.js | 8 ++++---- src/_h5ai/js/inc/model/entry.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/_h5ai/js/inc/lib/modulejs-0.1.js b/src/_h5ai/js/inc/lib/modulejs-0.1.js index ff7dfd54..3dd1ef8b 100644 --- a/src/_h5ai/js/inc/lib/modulejs-0.1.js +++ b/src/_h5ai/js/inc/lib/modulejs-0.1.js @@ -8,12 +8,12 @@ var err = function (condition, code, message) { if (condition) { - if (console && console.error) { - console.error(name + ' error: [' + code + '] ' + message); - } throw { code: code, - msg: name + ' error: ' + message + msg: message, + toString: function () { + return name + ' error: ' + message; + } }; } }; diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index b6c2730e..665fcbda 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -132,13 +132,13 @@ modulejs.define('model/entry', ['jQuery', 'core/types'], function ($, types) { return self; }, - // folderstatus = module.isDefined('ext/folderstatus') ? module.require('ext/folderstatus') : {}, folderstatus = (function () { - var id = 'ext/folderstatus', - res = modulejs.require(new RegExp('^' + id + '$')); + try { + return modulejs.require('ext/folderstatus'); + } catch (e) {} - return res.id ? res.id : {}; + return []; }()), fetchStatus = function (absHref, callback) { From d47b996c9f437c4a11f92186bfd6eae476abf669 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 11 Jul 2012 01:00:39 +0200 Subject: [PATCH 10/67] Updates modulejs to 0.2. --- jshint.json | 2 +- src/_h5ai/js/inc/h5ai-main.js | 9 +- src/_h5ai/js/inc/lib/modulejs-0.1.js | 168 -------------- src/_h5ai/js/inc/lib/modulejs-0.2.js | 247 +++++++++++++++++++++ src/_h5ai/js/inc/lib/modulejs-debug-0.1.js | 133 ----------- src/_h5ai/js/inc/main.js | 20 +- src/_h5ai/js/scripts.js | 8 +- 7 files changed, 270 insertions(+), 317 deletions(-) delete mode 100644 src/_h5ai/js/inc/lib/modulejs-0.1.js create mode 100644 src/_h5ai/js/inc/lib/modulejs-0.2.js delete mode 100644 src/_h5ai/js/inc/lib/modulejs-debug-0.1.js diff --git a/jshint.json b/jshint.json index a6bf7604..4fa8185f 100644 --- a/jshint.json +++ b/jshint.json @@ -21,7 +21,7 @@ "H5AI_CONFIG", "jQuery", "Modernizr", - "module", + "modulejs", "moment", "_" ] diff --git a/src/_h5ai/js/inc/h5ai-main.js b/src/_h5ai/js/inc/h5ai-main.js index 19003056..f0d6811a 100644 --- a/src/_h5ai/js/inc/h5ai-main.js +++ b/src/_h5ai/js/inc/h5ai-main.js @@ -9,11 +9,12 @@ modulejs.define('h5ai-main', ['jQuery', 'core/event', 'core/settings'], function event.pub('beforeExt'); - // _.each(modulejs.getIds(/^ext\/.+/), function (id) { + _.each(modulejs.state(), function (state, id) { - // modulejs.require(id); - // }); - modulejs.require(/^ext\/.+/); + if (/^ext\/.+/.test(id)) { + modulejs.require(id); + } + }); event.pub('ready'); }); diff --git a/src/_h5ai/js/inc/lib/modulejs-0.1.js b/src/_h5ai/js/inc/lib/modulejs-0.1.js deleted file mode 100644 index 3dd1ef8b..00000000 --- a/src/_h5ai/js/inc/lib/modulejs-0.1.js +++ /dev/null @@ -1,168 +0,0 @@ -/*! modulejs 0.1 - //larsjung.de/qrcode - MIT License */ - -(function (global, _, name) { - 'use strict'; - - - // throws error - var err = function (condition, code, message) { - - if (condition) { - throw { - code: code, - msg: message, - toString: function () { - return name + ' error: ' + message; - } - }; - } - }; - - // make sure underscore is loaded - err(!_, 1, name + ' requires underscore'); - - - // ModuleJs - // ======== - var ModuleJs = function () { - - var self = this; - - // module definitions - self.definitions = {}; - - // module instances - self.instances = {}; - - // define - // ------ - // Defines a module. - self.define = function (id, deps, fn) { - - // sort arguments - if (_.isFunction(deps)) { - fn = deps; - deps = []; - } - // check arguments - err(!_.isString(id), 11, 'id must be a string "' + id + '"'); - err(self.definitions[id], 12, 'id already defined "' + id + '"'); - err(!_.isFunction(fn), 13, 'constructor for "' + id + '" must be a function "' + fn + '"'); - err(!_.isArray(deps), 14, 'dependencies for "' + id + '" must be an array "' + deps + '"'); - - // map definition - self.definitions[id] = { - id: id, - deps: deps, - fn: fn - }; - }; - - // predefined - // ---------- - // Registers a predefined object. - self.predefined = function (id, instance, check) { - - if (_.isFunction(check)) { - check = !!check(); - } - if (!_.isBoolean(check)) { - check = instance !== undefined; - } - err(!check, 21, 'check for predefined "' + id + '" failed'); - - self.define(id, [], function () { - - return instance; - }); - }; - - // Returns an instance for `id`, checked against require-`stack` for - // cyclic dependencies. - self._require = function (id, stack) { - - err(!_.isString(id), 31, 'id must be a string "' + id + '"'); - - if (_.has(self.instances, id)) { - return self.instances[id]; - } - - var def = self.definitions[id]; - err(!def, 32, 'id not defined "' + id + '"'); - - stack = (stack || []).slice(0); - stack.push(id); - var deps = _.map(def.deps, function (depId) { - - err(_.indexOf(stack, depId) >= 0, 33, 'cyclic dependencies: ' + stack + ' & ' + depId); - - return self._require(depId, stack); - }); - - var obj = def.fn.apply(global, deps); - self.instances[id] = obj; - return obj; - }; - - // require - // ------- - // Returns an instance for `id`. - self.require = function (arg) { - - if (_.isArray(arg)) { - - return _.map(arg, function (id) { - - return self._require(id); - }); - } - - if (_.isRegExp(arg)) { - - var res = {}; - _.each(_.keys(self.definitions), function (id) { - - if (arg.test(id)) { - res[id] = self._require(id); - } - }); - return res; - } - - return self._require(arg); - }; - - // Registers public API on the global object. - self.register = function (name) { - - var previous = global[name], - api = { - define: self.define, - predefined: self.predefined, - require: self.require, - noConflict: function () { - - if (global[name] === api) { - global[name] = previous; - } - return api; - } - }; - - global[name] = api; - }; - }; - - - var modulejs = new ModuleJs(); - modulejs.register(name); - - - // debugger - // -------- - var debugName = name.toUpperCase(); - if (_.isFunction(global[debugName])) { - global[debugName] = new global[debugName](modulejs); - } - -}(this, _, 'modulejs')); diff --git a/src/_h5ai/js/inc/lib/modulejs-0.2.js b/src/_h5ai/js/inc/lib/modulejs-0.2.js new file mode 100644 index 00000000..4d34c0b3 --- /dev/null +++ b/src/_h5ai/js/inc/lib/modulejs-0.2.js @@ -0,0 +1,247 @@ +/*! modulejs 0.2 - //larsjung.de/modulejs - MIT License */ + +(function (global, name) { + 'use strict'; + + + var objProto = Object.prototype, + arrayForEach = Array.prototype.forEach, + isType = function (arg, type) { + + return objProto.toString.call(arg) === '[object ' + type + ']'; + }, + isString = function (arg) { + + return isType(arg, 'String'); + }, + isFunction = function (arg) { + + return isType(arg, 'Function'); + }, + isArray = Array.isArray || function (arg) { + + return isType(arg, 'Array'); + }, + isObject = function (arg) { + + return arg === new Object(arg); + }, + has = function (arg, id) { + + return objProto.hasOwnProperty.call(arg, id); + }, + each = function (obj, iterator, context) { + + if (arrayForEach && obj.forEach === arrayForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i += 1) { + iterator.call(context, obj[i], i, obj); + } + } else { + for (var key in obj) { + if (has(obj, key)) { + iterator.call(context, obj[key], key, obj); + } + } + } + }, + contains = function (array, item) { + + for (var i = 0, l = array.length; i < l; i += 1) { + if (array[i] === item) { + return true; + } + } + return false; + }, + uniq = function (array) { + + var elements = {}, + result = []; + + each(array, function (el) { + + if (!has(elements, el)) { + result.push(el); + elements[el] = 1; + } + }); + + return result; + }, + err = function (condition, code, message) { + + if (condition) { + throw { + code: code, + msg: message, + toString: function () { + return name + ' error ' + code + ': ' + message; + } + }; + } + }, + + // Module definitions. + definitions = {}, + + // Module instances. + instances = {}, + + resolve = function (id, cold, stack) { + + err(!isString(id), 31, 'id must be a string "' + id + '"'); + + if (!cold && has(instances, id)) { + return instances[id]; + } + + var def = definitions[id]; + err(!def, 32, 'id not defined "' + id + '"'); + + stack = (stack || []).slice(0); + stack.push(id); + + var deps = []; + + each(def.deps, function (depId, idx) { + + err(contains(stack, depId), 33, 'cyclic dependencies: ' + stack + ' & ' + depId); + + if (cold) { + deps = deps.concat(resolve(depId, cold, stack)); + deps.push(depId); + } else { + deps[idx] = resolve(depId, cold, stack); + } + }); + + if (cold) { + return uniq(deps); + } + + var obj = def.fn.apply(global, deps); + instances[id] = obj; + return obj; + }, + + + + // Public methods + // -------------- + + // ### define + // Defines a module for `id: String`, optional `deps: Array[String]`, + // `arg: Object/function`. + define = function (id, deps, arg) { + + // sort arguments + if (arg === undefined) { + arg = deps; + deps = []; + } + // check arguments + err(!isString(id), 11, 'id must be a string "' + id + '"'); + err(definitions[id], 12, 'id already defined "' + id + '"'); + err(!isArray(deps), 13, 'dependencies for "' + id + '" must be an array "' + deps + '"'); + err(!isObject(arg) && !isFunction(arg), 14, 'arg for "' + id + '" must be object or function "' + arg + '"'); + + // accept definition + definitions[id] = { + id: id, + deps: deps, + fn: isFunction(arg) ? arg : function () { return arg; } + }; + }, + + // ### require + // Returns an instance for `id`. + require = function (id) { + + return resolve(id); + }, + + // ### state + // Returns an object that holds infos about the current definitions and dependencies. + state = function () { + + var res = {}; + + each(definitions, function (def, id) { + + res[id] = { + + // direct dependencies + deps: def.deps.slice(0), + + // transitive dependencies + reqs: resolve(id, true), + + // already initiated/required + init: has(instances, id) + }; + }); + + each(definitions, function (def, id) { + + var inv = []; + each(definitions, function (def2, id2) { + + if (contains(res[id2].reqs, id)) { + inv.push(id2); + } + }); + + // all inverse dependencies + res[id].reqd = inv; + }); + + return res; + }, + + // ### log + // Returns a string that displays module dependencies. + log = function (inv) { + + var out = '\n'; + + each(state(), function (st, id) { + + var list = inv ? st.reqd : st.reqs; + out += (st.init ? '* ' : ' ') + id + ' -> [ ' + list.join(', ') + ' ]\n'; + }); + + return out; + }; + + + // Register Public API + // ------------------- + global[name] = { + define: define, + require: require, + state: state, + log: log + }; + + // Uncomment to run internal tests. + /* + if (global[name.toUpperCase()] === true) { + global[name.toUpperCase()] = { + isString: isString, + isFunction: isFunction, + isArray: isArray, + isObject: isObject, + has: has, + each: each, + contains: contains, + uniq: uniq, + err: err, + definitions: definitions, + instances: instances, + resolve: resolve + }; + } // */ + +}(this, 'modulejs')); diff --git a/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js b/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js deleted file mode 100644 index 5f4f7b7c..00000000 --- a/src/_h5ai/js/inc/lib/modulejs-debug-0.1.js +++ /dev/null @@ -1,133 +0,0 @@ -/*! modulejs-debug 0.1 - //larsjung.de/qrcode - MIT License */ - -(function (global, _, name) { - 'use strict'; - - - var Debugger = function (modulejs) { - - - var self = this; - - - self.modulejs = modulejs; - - - self.clear = function () { - - modulejs.definitions = {}; - modulejs.instances = {}; - }; - - - self.isDefined = function (id) { - - return _.isString(id) && !!modulejs.definitions[id]; - }; - - - self.ids = function (regexp) { - - var ids = _.map(modulejs.definitions, function (def) { - - return def.id; - }); - - if (!_.isRegExp(regexp)) { - return ids; - } - - return _.filter(ids, function (id) { - - return regexp.test(id); - }); - }; - - - var _deps = function (id, stack) { - - var deps = []; - - var def = modulejs.definitions[id]; - if (def) { - stack = (stack || []).slice(0); - stack.push(id); - _.each(def.deps, function (depId) { - - if (_.indexOf(stack, depId) >= 0) { - deps = deps.concat([false, def.id]); - return deps; - } - - deps = deps.concat(_deps(depId, stack)); - deps.push(depId); - }); - } - - return _.uniq(deps); - }; - - - self.deps = function (ids) { - - if (_.isString(ids)) { - - return _deps(ids); - } else if (_.isArray(ids)) { - - var deps = []; - _.each(ids, function (id) { - - deps = deps.concat(_deps(id)); - }); - return _.uniq(deps); - } - - var res = {}; - _.each(modulejs.definitions, function (def, id) { - - res[id] = _deps(id); - }); - return res; - }; - - - self.log = function (showInvDeps) { - - var allDeps = self.deps(), - allInvDeps = {}, - out = '\n'; - - if (!showInvDeps) { - _.each(allDeps, function (deps, id) { - - out += (_.has(modulejs.instances, id) ? '* ' : ' ') + id + ' -> [ ' + deps.join(', ') + ' ]\n'; - }); - } else { - _.each(modulejs.definitions, function (def) { - - var invDeps = []; - _.each(allDeps, function (depIds, id) { - - if (_.indexOf(depIds, def.id) >= 0) { - invDeps.push(id); - } - }); - allInvDeps[def.id] = invDeps; - }); - - _.each(allInvDeps, function (invDeps, id) { - - out += (_.has(modulejs.instances, id) ? '* ' : ' ') + id + ' <- [ ' + invDeps.join(', ') + ' ]\n'; - }); - } - - return out; - }; - }; - - - global[name.toUpperCase()] = Debugger; - - -}(this, _, 'modulejs')); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index 9c116a76..cf153fd1 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -2,11 +2,6 @@ (function ($) { 'use strict'; - modulejs.predefined('jQuery', jQuery); - modulejs.predefined('amplify', amplify); - modulejs.predefined('moment', moment); - modulejs.predefined('H5AI_CONFIG', H5AI_CONFIG); - // @include "core/entry.js" // @include "core/event.js" @@ -48,6 +43,21 @@ $(function () { + // define it on doc ready, so the script order in the doc doesn't matter + modulejs.define('H5AI_CONFIG', H5AI_CONFIG); + modulejs.define('amplify', amplify); + + // `jQuery` and `moment` are itself functions, so they have to be wrapped + // to not be taken as a constructor + modulejs.define('jQuery', function () { + + return jQuery; + }); + modulejs.define('moment', function () { + + return moment; + }); + modulejs.require($('body').attr('id')); }); diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 889b2ebe..4f5b768f 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -7,15 +7,11 @@ // @include "inc/lib/jquery.qrcode-0.2.min.js" // @include "inc/lib/jquery.scrollpanel-0.1.min.js" -// underscore libs -// --------------- -// @include "inc/lib/underscore-1.3.1.min.js" -// @-include "inc/lib/modulejs-debug-0.1.js" -// @include "inc/lib/modulejs-0.1.js" - // other libs // ---------- +// @include "inc/lib/underscore-1.3.1.min.js" // @include "inc/lib/amplify-1.1.0.min.js" +// @include "inc/lib/modulejs-0.2.js" // @include "inc/lib/moment-1.5.0.min.js" // @include "inc/lib/json2.js" // @include "inc/lib/base64.js" From 875b4fbe0ecfe76dc9a0821a480d8ddcfe0199fe Mon Sep 17 00:00:00 2001 From: Manuel Bieh Date: Thu, 12 Jul 2012 11:14:40 +0200 Subject: [PATCH 11/67] Fixed "Call to undefined method PharData::add_file()" -> Method is called addFile (camel cased, http://am.php.net/manual/de/phar.addfile.php) --- src/_h5ai/php/inc/Archive.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/php/inc/Archive.php b/src/_h5ai/php/inc/Archive.php index c3c6d255..159e00a4 100644 --- a/src/_h5ai/php/inc/Archive.php +++ b/src/_h5ai/php/inc/Archive.php @@ -55,7 +55,7 @@ class Archive { $archive->addEmptyDir($archivedDir); } foreach ($this->files as $realFile => $archivedFile) { - $archive->add_file($realFile, $archivedFile); // very, very slow :/ + $archive->addFile($realFile, $archivedFile); // very, very slow :/ } } From a7ffda422b41aff1da60d7566fb6b84b68ffae1d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 12 Jul 2012 13:25:16 +0200 Subject: [PATCH 12/67] Minor changes in build.xml. --- build.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index 605ed551..68c8127c 100644 --- a/build.xml +++ b/build.xml @@ -56,10 +56,11 @@ - + - + + From 52ffd8720a4213fcdf654f16ab1c49095d4d96ad Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 12 Jul 2012 23:27:49 +0200 Subject: [PATCH 13/67] Starts fixing cmd/control select issues on mac. --- src/_h5ai/js/inc/ext/select.js | 35 ++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/js/inc/ext/select.js b/src/_h5ai/js/inc/ext/select.js index c19d600c..cbb4da0a 100644 --- a/src/_h5ai/js/inc/ext/select.js +++ b/src/_h5ai/js/inc/ext/select.js @@ -13,6 +13,33 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio $document = $(document), $selectionRect = $('
'), + ctrlKeyPressed = false, + + isCtrlKey = function (code) { + + // http://github.com/madrobby/keymaster/blob/master/keymaster.js + return code === 17 || code === 91 || code === 92 || code === 93 || code === 224; + }, + + onFocus = function () { + + ctrlKeyPressed = false; + }, + + onKeydown = function (event) { + + if (isCtrlKey(event.keyCode)) { + ctrlKeyPressed = true; + } + }, + + onKeyup = function (event) { + + if (isCtrlKey(event.keyCode)) { + ctrlKeyPressed = false; + } + }, + publish = function () { var entries = _.map($('#extended .entry.selected'), function (entryElement) { @@ -90,7 +117,7 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio event.preventDefault(); $(':focus').blur(); - if (!event.ctrlKey) { + if (!ctrlKeyPressed) { $('#extended .entry').removeClass('selected'); publish(); } @@ -112,7 +139,7 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio noSelectionUnlessCtrl = function (event) { - if (!event.ctrlKey) { + if (!ctrlKeyPressed) { noSelection(event); } }, @@ -125,7 +152,11 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio $selectionRect.hide().appendTo('body'); + $(window).on('focus', onFocus); + $document + .on('keydown', onKeydown) + .on('keyup', onKeyup) .on('mousedown', '.noSelection', noSelection) .on('mousedown', '.noSelectionUnlessCtrl,input,a', noSelectionUnlessCtrl) .on('mousedown', selectionStart); From 018a574d5e0224d253d992d0a78750c576688631 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 13 Jul 2012 13:16:05 +0200 Subject: [PATCH 14/67] Another take on command button that doesn't work. --- src/_h5ai/js/inc/ext/select.js | 35 ++-------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/src/_h5ai/js/inc/ext/select.js b/src/_h5ai/js/inc/ext/select.js index cbb4da0a..29fbc358 100644 --- a/src/_h5ai/js/inc/ext/select.js +++ b/src/_h5ai/js/inc/ext/select.js @@ -13,33 +13,6 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio $document = $(document), $selectionRect = $('
'), - ctrlKeyPressed = false, - - isCtrlKey = function (code) { - - // http://github.com/madrobby/keymaster/blob/master/keymaster.js - return code === 17 || code === 91 || code === 92 || code === 93 || code === 224; - }, - - onFocus = function () { - - ctrlKeyPressed = false; - }, - - onKeydown = function (event) { - - if (isCtrlKey(event.keyCode)) { - ctrlKeyPressed = true; - } - }, - - onKeyup = function (event) { - - if (isCtrlKey(event.keyCode)) { - ctrlKeyPressed = false; - } - }, - publish = function () { var entries = _.map($('#extended .entry.selected'), function (entryElement) { @@ -117,7 +90,7 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio event.preventDefault(); $(':focus').blur(); - if (!ctrlKeyPressed) { + if (!event.ctrlKey && !event.metaKey) { $('#extended .entry').removeClass('selected'); publish(); } @@ -139,7 +112,7 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio noSelectionUnlessCtrl = function (event) { - if (!ctrlKeyPressed) { + if (!event.ctrlKey && !event.metaKey) { noSelection(event); } }, @@ -152,11 +125,7 @@ modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], functio $selectionRect.hide().appendTo('body'); - $(window).on('focus', onFocus); - $document - .on('keydown', onKeydown) - .on('keyup', onKeyup) .on('mousedown', '.noSelection', noSelection) .on('mousedown', '.noSelectionUnlessCtrl,input,a', noSelectionUnlessCtrl) .on('mousedown', selectionStart); From 64640ada8390dc8e1e352231da9410e527fd3a18 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 13 Jul 2012 17:57:02 +0200 Subject: [PATCH 15/67] Adds ajax abstraction. Refactors global dependencies. --- jshint.json | 9 +- src/_h5ai/js/inc/core/ajax.js | 157 ++++++++++++++++++++ src/_h5ai/js/inc/core/entry.js | 2 +- src/_h5ai/js/inc/core/format.js | 2 +- src/_h5ai/js/inc/core/parser.js | 2 +- src/_h5ai/js/inc/core/settings.js | 6 +- src/_h5ai/js/inc/ext/crumb.js | 2 +- src/_h5ai/js/inc/ext/custom.js | 18 +-- src/_h5ai/js/inc/ext/download.js | 47 ++---- src/_h5ai/js/inc/ext/filter.js | 2 +- src/_h5ai/js/inc/ext/folderstatus.js | 2 +- src/_h5ai/js/inc/ext/l10n.js | 2 +- src/_h5ai/js/inc/ext/link-hover-states.js | 2 +- src/_h5ai/js/inc/ext/mode.js | 2 +- src/_h5ai/js/inc/ext/preview-img.js | 2 +- src/_h5ai/js/inc/ext/qrcode.js | 4 +- src/_h5ai/js/inc/ext/select.js | 2 +- src/_h5ai/js/inc/ext/sort.js | 2 +- src/_h5ai/js/inc/ext/statusbar.js | 2 +- src/_h5ai/js/inc/ext/thumbnails.js | 42 ++---- src/_h5ai/js/inc/ext/title.js | 2 +- src/_h5ai/js/inc/ext/tree.js | 2 +- src/_h5ai/js/inc/h5ai-info.js | 40 ++--- src/_h5ai/js/inc/h5ai-main.js | 2 +- src/_h5ai/js/inc/main.js | 25 ++-- src/_h5ai/js/inc/model/entry.js | 22 +-- src/_h5ai/js/inc/parser/apache-autoindex.js | 2 +- src/_h5ai/js/inc/parser/generic-json.js | 2 +- src/_h5ai/js/inc/view/extended.js | 2 +- src/_h5ai/js/inc/view/spacing.js | 2 +- src/_h5ai/js/inc/view/viewmode.js | 2 +- 31 files changed, 245 insertions(+), 167 deletions(-) create mode 100644 src/_h5ai/js/inc/core/ajax.js diff --git a/jshint.json b/jshint.json index 4fa8185f..7db98e63 100644 --- a/jshint.json +++ b/jshint.json @@ -16,13 +16,6 @@ // Globals "predef": [ - "amplify", - "Base64", - "H5AI_CONFIG", - "jQuery", - "Modernizr", - "modulejs", - "moment", - "_" + "modulejs" ] } \ No newline at end of file diff --git a/src/_h5ai/js/inc/core/ajax.js b/src/_h5ai/js/inc/core/ajax.js new file mode 100644 index 00000000..1dec7865 --- /dev/null +++ b/src/_h5ai/js/inc/core/ajax.js @@ -0,0 +1,157 @@ + +modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], function ($, amplify, base64, resource) { + + var reContentType = /^text\/html;h5ai=/, + + getStatus = function (href, withContent, callback) { + + $.ajax({ + url: href, + type: withContent ? 'GET' : 'HEAD', + complete: function (xhr) { + + var res = { + status: xhr.status, + content: xhr.responseText + }; + + if (xhr.status === 200 && reContentType.test(xhr.getResponseHeader('Content-Type'))) { + res.status = 'h5ai'; + } + + callback(res); + } + }); + }, + + getChecks = function (callback) { + + $.ajax({ + url: resource.api(), + data: { + action: 'getchecks' + }, + type: 'POST', + dataType: 'json', + success: function (json) { + + callback(json); + }, + error: function () { + + callback(); + } + }); + }, + + getArchive = function (data, callback) { + + $.ajax({ + url: resource.api(), + data: { + action: 'archive', + execution: data.execution, + format: data.format, + hrefs: data.hrefs + }, + type: 'POST', + dataType: 'json', + beforeSend: function (xhr) { + + if (data.user) { + xhr.setRequestHeader('Authorization', 'Basic ' + base64.encode(data.user + ':' + data.password)); + } + }, + success: function (json) { + + callback(json); + }, + error: function () { + + callback(); + } + }); + }, + + getThumbSrc = function (data, callback) { + + $.ajax({ + url: resource.api(), + data: { + action: 'getthumbsrc', + type: data.type, + href: data.href, + mode: data.mode, + width: data.width, + height: data.height + }, + type: 'POST', + dataType: 'json', + success: function (json) { + + if (json.code === 0) { + callback(json.absHref); + } + callback(); + }, + error: function () { + + callback(); + } + }); + }, + + getThumbSrcSmall = function (type, href, callback) { + + getThumbSrc( + { + type: type, + href: href, + mode: 'square', + width: 16, + height: 16 + }, + callback + ); + }, + + getThumbSrcBig = function (type, href, callback) { + + getThumbSrc( + { + type: type, + href: href, + mode: 'rational', + width: 100, + height: 48 + }, + callback + ); + }, + + getHtml = function (url, callback) { + + $.ajax({ + url: url, + dataType: 'html', + success: function (html) { + + callback(html); + }, + error: function () { + + callback(); + } + }); + }; + + + return { + getStatus: getStatus, + getChecks: getChecks, + getArchive: getArchive, + getThumbSrcSmall: getThumbSrcSmall, + getThumbSrcBig: getThumbSrcBig, + getHtml: getHtml + }; +}); diff --git a/src/_h5ai/js/inc/core/entry.js b/src/_h5ai/js/inc/core/entry.js index 033970b3..3e82d5fc 100644 --- a/src/_h5ai/js/inc/core/entry.js +++ b/src/_h5ai/js/inc/core/entry.js @@ -1,5 +1,5 @@ -modulejs.define('core/entry', ['jQuery', 'core/parser', 'model/entry'], function ($, parser, Entry) { +modulejs.define('core/entry', ['$', 'core/parser', 'model/entry'], function ($, parser, Entry) { var absHref = document.location.pathname.replace(/[^\/]*$/, ''); diff --git a/src/_h5ai/js/inc/core/format.js b/src/_h5ai/js/inc/core/format.js index 4fbeba5a..f59245f5 100644 --- a/src/_h5ai/js/inc/core/format.js +++ b/src/_h5ai/js/inc/core/format.js @@ -1,5 +1,5 @@ -modulejs.define('core/format', ['moment'], function (moment) { +modulejs.define('core/format', ['_', 'moment'], function (_, moment) { var reParseSize = /^\s*([\.\d]+)\s*([kmgt]?)b?\s*$/i, treshhold = 1000.0, diff --git a/src/_h5ai/js/inc/core/parser.js b/src/_h5ai/js/inc/core/parser.js index 0f06d463..f840d052 100644 --- a/src/_h5ai/js/inc/core/parser.js +++ b/src/_h5ai/js/inc/core/parser.js @@ -1,5 +1,5 @@ -modulejs.define('core/parser', ['jQuery'], function ($) { +modulejs.define('core/parser', ['$'], function ($) { if ($('#data-apache-autoindex').length) { return modulejs.require('parser/apache-autoindex'); diff --git a/src/_h5ai/js/inc/core/settings.js b/src/_h5ai/js/inc/core/settings.js index bbb74f32..25fb084e 100644 --- a/src/_h5ai/js/inc/core/settings.js +++ b/src/_h5ai/js/inc/core/settings.js @@ -1,5 +1,5 @@ -modulejs.define('core/settings', ['H5AI_CONFIG'], function (config) { +modulejs.define('core/settings', ['config', '_'], function (config, _) { var defaults = { rootAbsHref: '/', @@ -12,7 +12,7 @@ modulejs.define('core/settings', ['H5AI_CONFIG'], function (config) { }); -modulejs.define('core/types', ['H5AI_CONFIG'], function (config) { +modulejs.define('core/types', ['config', '_'], function (config, _) { var reEndsWithSlash = /\/$/, reStartsWithDot = /^\./, @@ -61,7 +61,7 @@ modulejs.define('core/types', ['H5AI_CONFIG'], function (config) { }); -modulejs.define('core/langs', ['H5AI_CONFIG'], function (config) { +modulejs.define('core/langs', ['config', '_'], function (config, _) { var defaults = { lang: 'unknown', diff --git a/src/_h5ai/js/inc/ext/crumb.js b/src/_h5ai/js/inc/ext/crumb.js index 8622a546..07d8ebcb 100644 --- a/src/_h5ai/js/inc/ext/crumb.js +++ b/src/_h5ai/js/inc/ext/crumb.js @@ -1,5 +1,5 @@ -modulejs.define('ext/crumb', ['jQuery', 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { +modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/entry'], function (_, $, allsettings, resource, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/custom.js b/src/_h5ai/js/inc/ext/custom.js index dd5fce91..95be1a5a 100644 --- a/src/_h5ai/js/inc/ext/custom.js +++ b/src/_h5ai/js/inc/ext/custom.js @@ -1,5 +1,5 @@ -modulejs.define('ext/custom', ['jQuery', 'core/settings'], function ($, allsettings) { +modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/ajax'], function (_, $, allsettings, ajax) { var defaults = { enabled: false, @@ -16,23 +16,19 @@ modulejs.define('ext/custom', ['jQuery', 'core/settings'], function ($, allsetti } if (_.isString(settings.header)) { - $.ajax({ - url: settings.header, - dataType: 'html', - success: function (data) { + ajax.getHtml(settings.header, function (html) { - $('
' + data + '
').prependTo('#content'); + if (html) { + $('
' + html + '
').prependTo('#content'); } }); } if (_.isString(settings.footer)) { - $.ajax({ - url: settings.footer, - dataType: 'html', - success: function (data) { + ajax.getHtml(settings.footer, function (html) { - $('').appendTo('#content'); + if (html) { + $('').appendTo('#content'); } }); } diff --git a/src/_h5ai/js/inc/ext/download.js b/src/_h5ai/js/inc/ext/download.js index af007f37..719555f9 100644 --- a/src/_h5ai/js/inc/ext/download.js +++ b/src/_h5ai/js/inc/ext/download.js @@ -1,5 +1,5 @@ -modulejs.define('ext/download', ['jQuery', 'core/settings', 'core/resource', 'core/event'], function ($, allsettings, resource, event) { +modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/ajax'], function (_, $, allsettings, resource, event, ajax) { var defaults = { enabled: false, @@ -33,19 +33,19 @@ modulejs.define('ext/download', ['jQuery', 'core/settings', 'core/resource', 'co }, 1000); }, - handleResponse = function (response) { + handleResponse = function (json) { $download.removeClass('current'); $img.attr('src', resource.image('download')); - if (response) { - if (response.code === 0) { + if (json) { + if (json.code === 0) { setTimeout(function () { // wait here so the img above can be updated in time - window.location = resource.api() + '?action=getarchive&id=' + response.id + '&as=h5ai-selection.' + settings.format; + window.location = resource.api() + '?action=getarchive&id=' + json.id + '&as=h5ai-selection.' + settings.format; }, 200); } else { - if (response.code === 401) { + if (json.code === 401) { $downloadAuth .css({ left: $download.offset().left, @@ -65,34 +65,13 @@ modulejs.define('ext/download', ['jQuery', 'core/settings', 'core/resource', 'co $download.addClass('current'); $img.attr('src', resource.image('loading.gif', true)); - $.ajax({ - url: resource.api(), - data: { - action: 'archive', - execution: settings.execution, - format: settings.format, - hrefs: hrefsStr - }, - type: 'POST', - dataType: 'json', - beforeSend: function (xhr) { - - var user = $downloadUser.val(), - password = $downloadPassword.val(); - - if (user) { - xhr.setRequestHeader('Authorization', 'Basic ' + Base64.encode(user + ':' + password)); - } - }, - success: function (response) { - - handleResponse(response); - }, - error: function () { - - handleResponse(); - } - }); + ajax.getArchive({ + execution: settings.execution, + format: settings.format, + hrefs: hrefsStr, + user: $downloadUser.val(), + password: $downloadPassword.val() + }, handleResponse); }, onSelection = function (entries) { diff --git a/src/_h5ai/js/inc/ext/filter.js b/src/_h5ai/js/inc/ext/filter.js index b0ce24cf..2af67a7b 100644 --- a/src/_h5ai/js/inc/ext/filter.js +++ b/src/_h5ai/js/inc/ext/filter.js @@ -1,5 +1,5 @@ -modulejs.define('ext/filter', ['jQuery', 'core/settings', 'core/resource'], function ($, allsettings, resource) { +modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], function (_, $, allsettings, resource) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/folderstatus.js b/src/_h5ai/js/inc/ext/folderstatus.js index 9d1326ad..4c110db4 100644 --- a/src/_h5ai/js/inc/ext/folderstatus.js +++ b/src/_h5ai/js/inc/ext/folderstatus.js @@ -1,5 +1,5 @@ -modulejs.define('ext/folderstatus', ['jQuery', 'core/settings'], function ($, allsettings) { +modulejs.define('ext/folderstatus', ['_', 'core/settings'], function (_, allsettings) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/l10n.js b/src/_h5ai/js/inc/ext/l10n.js index ca8ed7bd..daf7c3f0 100644 --- a/src/_h5ai/js/inc/ext/l10n.js +++ b/src/_h5ai/js/inc/ext/l10n.js @@ -1,5 +1,5 @@ -modulejs.define('ext/l10n', ['jQuery', 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event'], function ($, allsettings, langs, format, store, event) { +modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event'], function (_, $, allsettings, langs, format, store, event) { var defaults = { enabled: true, diff --git a/src/_h5ai/js/inc/ext/link-hover-states.js b/src/_h5ai/js/inc/ext/link-hover-states.js index 5b5db61e..dc403b19 100644 --- a/src/_h5ai/js/inc/ext/link-hover-states.js +++ b/src/_h5ai/js/inc/ext/link-hover-states.js @@ -1,5 +1,5 @@ -modulejs.define('ext/link-hover-states', ['jQuery', 'core/settings'], function ($, allsettings) { +modulejs.define('ext/link-hover-states', ['_', '$', 'core/settings'], function (_, $, allsettings) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/mode.js b/src/_h5ai/js/inc/ext/mode.js index 7253d9df..6b2cd6c1 100644 --- a/src/_h5ai/js/inc/ext/mode.js +++ b/src/_h5ai/js/inc/ext/mode.js @@ -1,5 +1,5 @@ -modulejs.define('ext/mode', ['jQuery', 'core/settings', 'core/parser'], function ($, allsettings, parser) { +modulejs.define('ext/mode', ['_', '$', 'core/settings', 'core/parser'], function (_, $, allsettings, parser) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 814abef2..628c676f 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -1,5 +1,5 @@ -modulejs.define('ext/preview-img', ['jQuery', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function ($, allsettings, resource, store, entry) { +modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, allsettings, resource, store, entry) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/qrcode.js b/src/_h5ai/js/inc/ext/qrcode.js index c325009a..cdd183b0 100644 --- a/src/_h5ai/js/inc/ext/qrcode.js +++ b/src/_h5ai/js/inc/ext/qrcode.js @@ -1,5 +1,5 @@ -modulejs.define('ext/qrcode', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('ext/qrcode', ['_', '$', 'modernizr', 'core/settings', 'core/event'], function (_, $, modernizr, allsettings, event) { var defaults = { enabled: false, @@ -15,7 +15,7 @@ modulejs.define('ext/qrcode', ['jQuery', 'core/settings', 'core/event'], functio update = function (entry) { $context.find('.qrcode').empty().qrcode({ - render: Modernizr.canvas ? 'canvas' : 'div', + render: modernizr.canvas ? 'canvas' : 'div', width: settings.size, height: settings.size, color: '#333', diff --git a/src/_h5ai/js/inc/ext/select.js b/src/_h5ai/js/inc/ext/select.js index 29fbc358..6d89af00 100644 --- a/src/_h5ai/js/inc/ext/select.js +++ b/src/_h5ai/js/inc/ext/select.js @@ -1,5 +1,5 @@ -modulejs.define('ext/select', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], function (_, $, allsettings, event) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/sort.js b/src/_h5ai/js/inc/ext/sort.js index 9b12b0cd..1272bb39 100644 --- a/src/_h5ai/js/inc/ext/sort.js +++ b/src/_h5ai/js/inc/ext/sort.js @@ -1,5 +1,5 @@ -modulejs.define('ext/sort', ['jQuery', 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { +modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/store'], function (_, $, allsettings, resource, store) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/ext/statusbar.js b/src/_h5ai/js/inc/ext/statusbar.js index 6d985e44..112703c3 100644 --- a/src/_h5ai/js/inc/ext/statusbar.js +++ b/src/_h5ai/js/inc/ext/statusbar.js @@ -1,5 +1,5 @@ -modulejs.define('ext/statusbar', ['jQuery', 'core/settings', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, format, event, entry) { +modulejs.define('ext/statusbar', ['_', '$', 'core/settings', 'core/format', 'core/event', 'core/entry'], function (_, $, allsettings, format, event, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/thumbnails.js b/src/_h5ai/js/inc/ext/thumbnails.js index 2dac49fb..468e5a37 100644 --- a/src/_h5ai/js/inc/ext/thumbnails.js +++ b/src/_h5ai/js/inc/ext/thumbnails.js @@ -1,5 +1,5 @@ -modulejs.define('ext/thumbnails', ['jQuery', 'core/settings', 'core/resource', 'core/entry'], function ($, allsettings, resource, entry) { +modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/ajax'], function (_, allsettings, entry, ajax) { var defaults = { enabled: false, @@ -11,46 +11,32 @@ modulejs.define('ext/thumbnails', ['jQuery', 'core/settings', 'core/resource', ' settings = _.extend({}, defaults, allsettings.thumbnails), - requestThumb = function ($img, data) { - - $.getJSON(resource.api(), data, function (json) { - - if (json.code === 0) { - $img.addClass('thumb').attr('src', json.absHref); - } - }); - }, - checkEntry = function (entry) { if (entry.$extended) { var type = null; - if ($.inArray(entry.type, settings.img) >= 0) { + if (_.indexOf(settings.img, entry.type) >= 0) { type = 'img'; - } else if ($.inArray(entry.type, settings.mov) >= 0) { + } else if (_.indexOf(settings.mov, entry.type) >= 0) { type = 'mov'; - } else if ($.inArray(entry.type, settings.doc) >= 0) { + } else if (_.indexOf(settings.doc, entry.type) >= 0) { type = 'doc'; } if (type) { - requestThumb(entry.$extended.find('.icon.small img'), { - action: 'getthumbsrc', - type: type, - href: entry.absHref, - mode: 'square', - width: 16, - height: 16 + ajax.getThumbSrcSmall(type, entry.absHref, function (src) { + + if (src) { + entry.$extended.find('.icon.small img').addClass('thumb').attr('src', src); + } }); - requestThumb(entry.$extended.find('.icon.big img'), { - action: 'getthumbsrc', - type: type, - href: entry.absHref, - mode: 'rational', - width: 100, - height: 48 + ajax.getThumbSrcBig(type, entry.absHref, function (src) { + + if (src) { + entry.$extended.find('.icon.big img').addClass('thumb').attr('src', src); + } }); } } diff --git a/src/_h5ai/js/inc/ext/title.js b/src/_h5ai/js/inc/ext/title.js index 2a9097e1..3bea5c81 100644 --- a/src/_h5ai/js/inc/ext/title.js +++ b/src/_h5ai/js/inc/ext/title.js @@ -1,5 +1,5 @@ -modulejs.define('ext/title', ['jQuery', 'core/settings', 'core/entry'], function ($, allsettings, entry) { +modulejs.define('ext/title', ['_', 'core/settings', 'core/entry'], function (_, allsettings, entry) { var defaults = { enabled: false diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 3d2decc2..9ea16a40 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -1,5 +1,5 @@ -modulejs.define('ext/tree', ['jQuery', 'core/settings', 'core/resource', 'core/event', 'core/entry', 'core/parser'], function ($, allsettings, resource, event, entry, parser) { +modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/entry', 'core/parser'], function (_, $, allsettings, resource, event, entry, parser) { var defaults = { enabled: false, diff --git a/src/_h5ai/js/inc/h5ai-info.js b/src/_h5ai/js/inc/h5ai-info.js index 640fd3b5..606d57cd 100644 --- a/src/_h5ai/js/inc/h5ai-info.js +++ b/src/_h5ai/js/inc/h5ai-info.js @@ -1,5 +1,5 @@ -modulejs.define('h5ai-info', ['jQuery', 'core/resource'], function ($, resource) { +modulejs.define('h5ai-info', ['$', 'core/ajax'], function ($, ajax) { var setCheckResult = function (id, result) { @@ -12,37 +12,17 @@ modulejs.define('h5ai-info', ['jQuery', 'core/resource'], function ($, resource) } }, - handleChecksResponse = function (response) { - - $('.test').each(function () { - - setCheckResult(this, response && response[$(this).data('id')]); - }); - }, - - checks = function () { - - $.ajax({ - url: resource.api(), - data: { - action: 'getchecks' - }, - type: 'POST', - dataType: 'json', - success: function (response) { - - handleChecksResponse(response); - }, - error: function () { - - handleChecksResponse(); - } - }); - }, - init = function () { - checks(); + ajax.getChecks(function (json) { + + if (json) { + $('.test').each(function () { + + setCheckResult(this, json[$(this).data('id')]); + }); + } + }); }; init(); diff --git a/src/_h5ai/js/inc/h5ai-main.js b/src/_h5ai/js/inc/h5ai-main.js index f0d6811a..cdda40ff 100644 --- a/src/_h5ai/js/inc/h5ai-main.js +++ b/src/_h5ai/js/inc/h5ai-main.js @@ -1,5 +1,5 @@ -modulejs.define('h5ai-main', ['jQuery', 'core/event', 'core/settings'], function ($, event, settings) { +modulejs.define('h5ai-main', ['_', 'core/event', 'core/settings'], function (_, event, settings) { event.pub('beforeView'); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index cf153fd1..656ce41b 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -3,6 +3,7 @@ 'use strict'; + // @include "core/ajax.js" // @include "core/entry.js" // @include "core/event.js" // @include "core/format.js" @@ -42,21 +43,19 @@ $(function () { + /*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, _ */ - // define it on doc ready, so the script order in the doc doesn't matter - modulejs.define('H5AI_CONFIG', H5AI_CONFIG); + // Register predefined globals on doc ready, so the script order inside + // the document doesn't matter. `jQuery`, `moment` and `underscore` are + // itself functions, so they have to be wrapped to not be handled as + // constructors. + modulejs.define('config', H5AI_CONFIG); modulejs.define('amplify', amplify); - - // `jQuery` and `moment` are itself functions, so they have to be wrapped - // to not be taken as a constructor - modulejs.define('jQuery', function () { - - return jQuery; - }); - modulejs.define('moment', function () { - - return moment; - }); + modulejs.define('base64', Base64); + modulejs.define('$', function () { return jQuery; }); + modulejs.define('modernizr', Modernizr); + modulejs.define('moment', function () { return moment; }); + modulejs.define('_', function () { return _; }); modulejs.require($('body').attr('id')); }); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 665fcbda..cac504a0 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -1,5 +1,5 @@ -modulejs.define('model/entry', ['jQuery', 'core/types'], function ($, types) { +modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) { var domain = document.domain, location = document.location.pathname.replace(/[^\/]*$/, ''), @@ -56,25 +56,13 @@ modulejs.define('model/entry', ['jQuery', 'core/types'], function ($, types) { }, - reContentType = /^text\/html;h5ai=/, - ajaxRequest = function (self, parser, callback) { - $.ajax({ - url: self.absHref, - type: parser ? 'GET' : 'HEAD', - complete: function (xhr) { + ajax.getStatus(self.absHref, parser, function (response) { - if (xhr.status === 200 && reContentType.test(xhr.getResponseHeader('Content-Type'))) { - self.status = 'h5ai'; - if (parser) { - parser.parse(self.absHref, xhr.responseText); - } - } else { - self.status = xhr.status; - } - - callback(self); + self.status = response.status; + if (parser && response.status === 'h5ai') { + parser.parse(self.absHref, response.content); } }); }, diff --git a/src/_h5ai/js/inc/parser/apache-autoindex.js b/src/_h5ai/js/inc/parser/apache-autoindex.js index caa1d71a..5123aeed 100644 --- a/src/_h5ai/js/inc/parser/apache-autoindex.js +++ b/src/_h5ai/js/inc/parser/apache-autoindex.js @@ -1,5 +1,5 @@ -modulejs.define('parser/apache-autoindex', ['jQuery', 'core/settings', 'core/format', 'model/entry'], function ($, settings, format, Entry) { +modulejs.define('parser/apache-autoindex', ['_', '$', 'core/settings', 'core/format', 'model/entry'], function (_, $, settings, format, Entry) { var parseTableRow = function (absHref, tr) { diff --git a/src/_h5ai/js/inc/parser/generic-json.js b/src/_h5ai/js/inc/parser/generic-json.js index 672377b5..64a742be 100644 --- a/src/_h5ai/js/inc/parser/generic-json.js +++ b/src/_h5ai/js/inc/parser/generic-json.js @@ -1,5 +1,5 @@ -modulejs.define('parser/generic-json', ['jQuery', 'core/settings', 'model/entry'], function ($, settings, Entry) { +modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry'], function (_, $, settings, Entry) { var parser = { id: 'generic-json', diff --git a/src/_h5ai/js/inc/view/extended.js b/src/_h5ai/js/inc/view/extended.js index a1f29e37..8690f6b5 100644 --- a/src/_h5ai/js/inc/view/extended.js +++ b/src/_h5ai/js/inc/view/extended.js @@ -1,5 +1,5 @@ -modulejs.define('view/extended', ['jQuery', 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/entry'], function ($, allsettings, resource, format, event, entry) { +modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/entry'], function (_, $, allsettings, resource, format, event, entry) { var defaults = { modes: ['details', 'icons'], diff --git a/src/_h5ai/js/inc/view/spacing.js b/src/_h5ai/js/inc/view/spacing.js index 6055fa8c..a559979e 100644 --- a/src/_h5ai/js/inc/view/spacing.js +++ b/src/_h5ai/js/inc/view/spacing.js @@ -1,5 +1,5 @@ -modulejs.define('view/spacing', ['jQuery', 'core/settings', 'core/event'], function ($, allsettings, event) { +modulejs.define('view/spacing', ['_', '$', 'core/settings', 'core/event'], function (_, $, allsettings, event) { var defaults = { maxWidth: 960, diff --git a/src/_h5ai/js/inc/view/viewmode.js b/src/_h5ai/js/inc/view/viewmode.js index a321acbb..10b17308 100644 --- a/src/_h5ai/js/inc/view/viewmode.js +++ b/src/_h5ai/js/inc/view/viewmode.js @@ -1,5 +1,5 @@ -modulejs.define('view/viewmode', ['jQuery', 'core/settings', 'core/resource', 'core/store'], function ($, allsettings, resource, store) { +modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'core/store'], function (_, $, allsettings, resource, store) { var defaults = { modes: ['details', 'list', 'icons'], From f6d24d050fa2c9c960677317f6577fe501b8f6ab Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 16:34:12 +0200 Subject: [PATCH 16/67] Splits settings.js. --- src/_h5ai/js/inc/core/langs.js | 33 ++++++++++++ src/_h5ai/js/inc/core/parser.js | 5 ++ src/_h5ai/js/inc/core/settings.js | 83 ------------------------------- src/_h5ai/js/inc/core/types.js | 48 ++++++++++++++++++ src/_h5ai/js/inc/h5ai-main.js | 2 +- src/_h5ai/js/inc/main.js | 2 + 6 files changed, 89 insertions(+), 84 deletions(-) create mode 100644 src/_h5ai/js/inc/core/langs.js create mode 100644 src/_h5ai/js/inc/core/types.js diff --git a/src/_h5ai/js/inc/core/langs.js b/src/_h5ai/js/inc/core/langs.js new file mode 100644 index 00000000..21fc57fb --- /dev/null +++ b/src/_h5ai/js/inc/core/langs.js @@ -0,0 +1,33 @@ + +modulejs.define('core/langs', ['config', '_'], function (config, _) { + + var defaults = { + lang: 'unknown', + details: 'details', + icons: 'icons', + name: 'Name', + lastModified: 'Last modified', + size: 'Size', + parentDirectory: 'Parent Directory', + empty: 'empty', + folders: 'folders', + files: 'files', + download: 'download', + noMatch: 'no match', + dateFormat: 'YYYY-MM-DD HH:mm' + }, + + translations = {}, + + parse = function (langs) { + + _.each(langs, function (trans, lang) { + + translations[lang] = _.extend({}, defaults, trans); + }); + }; + + parse(_.extend({}, config.langs)); + + return translations; +}); diff --git a/src/_h5ai/js/inc/core/parser.js b/src/_h5ai/js/inc/core/parser.js index f840d052..9002ef30 100644 --- a/src/_h5ai/js/inc/core/parser.js +++ b/src/_h5ai/js/inc/core/parser.js @@ -10,6 +10,11 @@ modulejs.define('core/parser', ['$'], function ($) { return { id: 'none', + mode: null, + server: { + name: null, + version: null + }, parse: function () { return []; } diff --git a/src/_h5ai/js/inc/core/settings.js b/src/_h5ai/js/inc/core/settings.js index 25fb084e..5111291e 100644 --- a/src/_h5ai/js/inc/core/settings.js +++ b/src/_h5ai/js/inc/core/settings.js @@ -10,86 +10,3 @@ modulejs.define('core/settings', ['config', '_'], function (config, _) { return _.extend({}, defaults, config.options); }); - - -modulejs.define('core/types', ['config', '_'], function (config, _) { - - var reEndsWithSlash = /\/$/, - reStartsWithDot = /^\./, - - fileExts = {}, - fileNames = {}, - - parse = function (types) { - - _.each(types, function (matches, type) { - - _.each(matches, function (match) { - - match = match.toLowerCase(); - - if (reStartsWithDot.test(match)) { - fileExts[match] = type; - } else { - fileNames[match] = type; - } - }); - }); - }, - - getType = function (sequence) { - - if (reEndsWithSlash.test(sequence)) { - return 'folder'; - } - - sequence = sequence.toLowerCase(); - - var slashidx = sequence.lastIndexOf('/'), - name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence, - dotidx = sequence.lastIndexOf('.'), - ext = dotidx >= 0 ? sequence.substr(dotidx) : sequence; - - return fileNames[name] || fileExts[ext] || 'unknown'; - }; - - parse(_.extend({}, config.types)); - - return { - getType: getType - }; -}); - - -modulejs.define('core/langs', ['config', '_'], function (config, _) { - - var defaults = { - lang: 'unknown', - details: 'details', - icons: 'icons', - name: 'Name', - lastModified: 'Last modified', - size: 'Size', - parentDirectory: 'Parent Directory', - empty: 'empty', - folders: 'folders', - files: 'files', - download: 'download', - noMatch: 'no match', - dateFormat: 'YYYY-MM-DD HH:mm' - }, - - translations = {}, - - parse = function (langs) { - - _.each(langs, function (trans, lang) { - - translations[lang] = _.extend({}, defaults, trans); - }); - }; - - parse(_.extend({}, config.langs)); - - return translations; -}); diff --git a/src/_h5ai/js/inc/core/types.js b/src/_h5ai/js/inc/core/types.js new file mode 100644 index 00000000..f02f9dae --- /dev/null +++ b/src/_h5ai/js/inc/core/types.js @@ -0,0 +1,48 @@ + +modulejs.define('core/types', ['config', '_'], function (config, _) { + + var reEndsWithSlash = /\/$/, + reStartsWithDot = /^\./, + + fileExts = {}, + fileNames = {}, + + parse = function (types) { + + _.each(types, function (matches, type) { + + _.each(matches, function (match) { + + match = match.toLowerCase(); + + if (reStartsWithDot.test(match)) { + fileExts[match] = type; + } else { + fileNames[match] = type; + } + }); + }); + }, + + getType = function (sequence) { + + if (reEndsWithSlash.test(sequence)) { + return 'folder'; + } + + sequence = sequence.toLowerCase(); + + var slashidx = sequence.lastIndexOf('/'), + name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence, + dotidx = sequence.lastIndexOf('.'), + ext = dotidx >= 0 ? sequence.substr(dotidx) : sequence; + + return fileNames[name] || fileExts[ext] || 'unknown'; + }; + + parse(_.extend({}, config.types)); + + return { + getType: getType + }; +}); diff --git a/src/_h5ai/js/inc/h5ai-main.js b/src/_h5ai/js/inc/h5ai-main.js index cdda40ff..0d6906ce 100644 --- a/src/_h5ai/js/inc/h5ai-main.js +++ b/src/_h5ai/js/inc/h5ai-main.js @@ -4,8 +4,8 @@ modulejs.define('h5ai-main', ['_', 'core/event', 'core/settings'], function (_, event.pub('beforeView'); modulejs.require('view/extended'); - modulejs.require('view/viewmode'); modulejs.require('view/spacing'); + modulejs.require('view/viewmode'); event.pub('beforeExt'); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index 656ce41b..6449574b 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -7,10 +7,12 @@ // @include "core/entry.js" // @include "core/event.js" // @include "core/format.js" + // @include "core/langs.js" // @include "core/parser.js" // @include "core/resource.js" // @include "core/settings.js" // @include "core/store.js" + // @include "core/types.js" // @include "model/entry.js" From 87f9ada878c5712a2fc03e08799ec063b28e7c17 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 16:42:07 +0200 Subject: [PATCH 17/67] Updates readme. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a56807e5..60a401b4 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT) * [jQuery.qrcode](http://larsjung.de/qrcode/) (MIT) * [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT) -* [modernizr](http://www.modernizr.com) (MIT/BSD) +* [Modernizr](http://www.modernizr.com) (MIT/BSD) +* [modulejs](http://larsjung.de/modulejs/) (MIT) * [Moment.js](http://momentjs.com) (MIT) -* [qrcode](http://www.d-project.com/qrcode/index.html) (MIT) -* [underscore.js](http://underscorejs.org) (MIT) +* [Underscore.js](http://underscorejs.org) (MIT) ## Changelog @@ -37,6 +37,7 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 +* updates to [modulejs](http://larsjung.de/modulejs/) 0.2 ### v0.20 - *2012-05-11* From 74450a252acef3e5b817d3a4752fdd4e8480ddf0 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 16:47:35 +0200 Subject: [PATCH 18/67] Updates readme. --- README.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 60a401b4..8a9ca522 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,19 @@ please create [a new issue](http://github.com/lrsjng/h5ai/issues/new). h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h5ai/blob/master/LICENSE.txt). - -## h5ai profits from these great projects - -* [AmplifyJS](http://amplifyjs.com) (MIT/GPL) -* [Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL) -* [HTML5 ★ Boilerplate](http://html5boilerplate.com) -* [jQuery](http://jquery.com) (MIT/GPL) -* [jQuery.fracs](http://larsjung.de/fracs/) (MIT) -* [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT) -* [jQuery.qrcode](http://larsjung.de/qrcode/) (MIT) -* [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT) -* [Modernizr](http://www.modernizr.com) (MIT/BSD) -* [modulejs](http://larsjung.de/modulejs/) (MIT) -* [Moment.js](http://momentjs.com) (MIT) -* [Underscore.js](http://underscorejs.org) (MIT) +h5ai profits from these great projects: +[AmplifyJS](http://amplifyjs.com) (MIT/GPL), +[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), +[HTML5 ★ Boilerplate](http://html5boilerplate.com), +[jQuery](http://jquery.com) (MIT/GPL), +[jQuery.fracs](http://larsjung.de/fracs/) (MIT), +[jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT), +[jQuery.qrcode](http://larsjung.de/qrcode/) (MIT), +[jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT), +[Modernizr](http://www.modernizr.com) (MIT/BSD), +[modulejs](http://larsjung.de/modulejs/) (MIT), +[Moment.js](http://momentjs.com) (MIT), +[Underscore.js](http://underscorejs.org) (MIT) ## Changelog From 93d13d6177141eb5f3c6684df84f04de9b10282f Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 16:49:02 +0200 Subject: [PATCH 19/67] Updates readme. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a9ca522..18735444 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ please create [a new issue](http://github.com/lrsjng/h5ai/issues/new). * Sources: h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h5ai/blob/master/LICENSE.txt). - -h5ai profits from these great projects: +It profits from these great projects: [AmplifyJS](http://amplifyjs.com) (MIT/GPL), [Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), [HTML5 ★ Boilerplate](http://html5boilerplate.com), From 864687aedfd960d73df3e85b5f7401f0e59e5544 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 18:26:22 +0200 Subject: [PATCH 20/67] Fixes broken callback in tree. --- src/_h5ai/js/inc/model/entry.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index cac504a0..45699801 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -64,6 +64,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty if (parser && response.status === 'h5ai') { parser.parse(self.absHref, response.content); } + callback(self); }); }, From 2282a0ba7110107094699976feaf980ed17125a0 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jul 2012 19:45:30 +0200 Subject: [PATCH 21/67] Fixes problems with misalgined image previews. --- src/_h5ai/js/inc/ext/preview-img.js | 10 ++++++++-- src/_h5ai/js/inc/model/entry.js | 20 ++++---------------- src/_h5ai/js/inc/parser/generic-json.js | 8 ++++---- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 628c676f..7bd43375 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -129,9 +129,15 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', clearTimeout(spinnerTimeout); $container.spin(false); - $img.attr('src', src).show(); + // $img.hide().attr('src', src).fadeIn(100); + $img.fadeOut(100, function () { - adjustSize(); + $img.attr('src', src).fadeIn(200); + setTimeout(adjustSize, 1); + }); + + // adjustSize(); + // setTimeout(adjustSize, 1); $('#preview-bar-label').text(currentEntries[currentIdx].label); $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 45699801..85d080c8 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -31,27 +31,15 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty sequence = sequence.replace(/\/+/g, '/'); if (sequence === '/') { - return { - parent: null, - parentname: null, - name: '/' - }; + return { parent: null, name: '/' }; } match = reSplitPath2.exec(sequence); if (match) { - return { - parent: match[1], - parentname: match[2], - name: match[3] - }; + return { parent: match[1], name: match[3] }; } match = reSplitPath.exec(sequence); if (match) { - return { - parent: '/', - parentname: '/', - name: match[1] - }; + return { parent: '/', name: match[1] }; } }, @@ -127,7 +115,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty return modulejs.require('ext/folderstatus'); } catch (e) {} - return []; + return {}; }()), fetchStatus = function (absHref, callback) { diff --git a/src/_h5ai/js/inc/parser/generic-json.js b/src/_h5ai/js/inc/parser/generic-json.js index 64a742be..eece589a 100644 --- a/src/_h5ai/js/inc/parser/generic-json.js +++ b/src/_h5ai/js/inc/parser/generic-json.js @@ -12,16 +12,16 @@ modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry' parseJson = function (absHref, json) { - if (json.hasOwnProperty('customHeader')) { + if (_.has(json, 'customHeader')) { settings.custom.header = json.customHeader; } - if (json.hasOwnProperty('customFooter')) { + if (_.has(json, 'customFooter')) { settings.custom.footer = json.customFooter; } - if (json.hasOwnProperty('mode')) { + if (_.has(json, 'mode')) { parser.mode = json.mode; } - if (json.hasOwnProperty('server')) { + if (_.has(json, 'server')) { parser.server = json.server; } From b6d6bf8ba75ee76f2234c844924908587a493418 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 15 Jul 2012 14:06:16 +0200 Subject: [PATCH 22/67] Cleans code. --- src/_h5ai/js/inc/ext/preview-img.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 7bd43375..48300411 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -129,16 +129,12 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', clearTimeout(spinnerTimeout); $container.spin(false); - // $img.hide().attr('src', src).fadeIn(100); $img.fadeOut(100, function () { $img.attr('src', src).fadeIn(200); setTimeout(adjustSize, 1); }); - // adjustSize(); - // setTimeout(adjustSize, 1); - $('#preview-bar-label').text(currentEntries[currentIdx].label); $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); $('#preview-bar-size').text('' + width + 'x' + height); From 17c31fc9d9280a60eda68a8e6ba5f9163c79d274 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 15 Jul 2012 18:58:10 +0200 Subject: [PATCH 23/67] Fixes issue 72: Duplicate tree entries and emtpy main view. --- src/_h5ai/js/inc/core/entry.js | 2 +- src/_h5ai/js/inc/model/entry.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/js/inc/core/entry.js b/src/_h5ai/js/inc/core/entry.js index 3e82d5fc..9764904b 100644 --- a/src/_h5ai/js/inc/core/entry.js +++ b/src/_h5ai/js/inc/core/entry.js @@ -1,7 +1,7 @@ modulejs.define('core/entry', ['$', 'core/parser', 'model/entry'], function ($, parser, Entry) { - var absHref = document.location.pathname.replace(/[^\/]*$/, ''); + var absHref = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''); parser.parse(absHref, $('body')); $('#data-apache-autoindex').remove(); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 85d080c8..dbbad6ac 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -2,7 +2,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) { var domain = document.domain, - location = document.location.pathname.replace(/[^\/]*$/, ''), + location = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''), // utils From 1828855f636c0cb2dd10b91d8fcac8b4dc69fb89 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 15 Jul 2012 19:34:20 +0200 Subject: [PATCH 24/67] Single source of truth for current location. --- src/_h5ai/js/inc/core/entry.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/_h5ai/js/inc/core/entry.js b/src/_h5ai/js/inc/core/entry.js index 9764904b..289ab15c 100644 --- a/src/_h5ai/js/inc/core/entry.js +++ b/src/_h5ai/js/inc/core/entry.js @@ -1,12 +1,11 @@ modulejs.define('core/entry', ['$', 'core/parser', 'model/entry'], function ($, parser, Entry) { - var absHref = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''); + var entry = Entry.get(); - parser.parse(absHref, $('body')); + parser.parse(entry.absHref, $('body')); $('#data-apache-autoindex').remove(); - var entry = Entry.get(absHref); entry.status = 'h5ai'; if (entry.parent) { entry.parent.isParentFolder = true; From 4724214b9e6e590ceef8d75a2d76745f41fe11a3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 15 Jul 2012 23:29:21 +0200 Subject: [PATCH 25/67] Adds no-js fallback to PHP verison. --- src/_h5ai/apache/h5ai-footer.html | 2 + src/_h5ai/apache/h5ai-header.html | 2 - src/_h5ai/css/inc/apache-autoindex-table.less | 7 +++- src/_h5ai/php/h5ai-index.php | 10 ++++- src/_h5ai/php/inc/H5ai.php | 39 +++++++++++++++++++ 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/_h5ai/apache/h5ai-footer.html b/src/_h5ai/apache/h5ai-footer.html index 12a8c4d2..72b45348 100644 --- a/src/_h5ai/apache/h5ai-footer.html +++ b/src/_h5ai/apache/h5ai-footer.html @@ -1,4 +1,6 @@
+ + \ No newline at end of file diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index e4ec45bc..77d8aca1 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -31,8 +31,6 @@
- -
@@ -25,7 +25,7 @@
- h5ai %BUILD_VERSION% + h5ai {{version}} ⚡ JavaScript is disabled! ⚡ ⚡ Some features disabled! Works best in modern browsers. ⚡ From 65b1823c5d3a715dc8b2c21c0cbe57d6f658f6c9 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 2 Aug 2012 22:26:52 +0200 Subject: [PATCH 37/67] Updates Modernizr to 2.6.1. --- makefile.js | 4 ++-- src/_h5ai/apache/h5ai-header.html | 2 +- src/_h5ai/index.html | 2 +- src/_h5ai/js/modernizr-2.5.3.min.js | 4 ---- src/_h5ai/js/modernizr.min.js | 4 ++++ src/_h5ai/php/h5ai-index.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 src/_h5ai/js/modernizr-2.5.3.min.js create mode 100644 src/_h5ai/js/modernizr.min.js diff --git a/makefile.js b/makefile.js index b311df52..4abdd38d 100644 --- a/makefile.js +++ b/makefile.js @@ -7,7 +7,7 @@ var path = require('path'), moment = require('moment'); -var version = '0.21-dev-30', +var version = '0.21-dev-31', root = path.resolve(__dirname), src = path.join(root, 'src'), @@ -63,7 +63,7 @@ module.exports = function (make, $) { stamp: stamp.format('YYYY-MM-DD HH:mm:ss') }; - $.info({ method: 'before', message: version + ' ' + replacements.stamp.human }); + $.info({ method: 'before', message: version + ' ' + replacements.stamp }); }; diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index d0da7cf1..2e62d06e 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -13,7 +13,7 @@ - +
diff --git a/src/_h5ai/index.html b/src/_h5ai/index.html index 70cc3a99..7eca9645 100644 --- a/src/_h5ai/index.html +++ b/src/_h5ai/index.html @@ -13,7 +13,7 @@ - +

h5ai

diff --git a/src/_h5ai/js/modernizr-2.5.3.min.js b/src/_h5ai/js/modernizr-2.5.3.min.js deleted file mode 100644 index a985ad0b..00000000 --- a/src/_h5ai/js/modernizr-2.5.3.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.5.3 (Custom Build) | MIT & BSD - * Build: http://www.modernizr.com/download/#-opacity-rgba-canvas-history-audio-video-shiv-cssclasses-prefixes - */ -;window.Modernizr=function(a,b,c){function v(a){j.cssText=a}function w(a,b){return v(m.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},n.history=function(){return!!a.history&&!!history.pushState},n.rgba=function(){return v("background-color:rgba(150,255,150,.5)"),y(j.backgroundColor,"rgba")},n.opacity=function(){return w("opacity:.55"),/^0.55$/.test(j.opacity)},n.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},n.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c};for(var A in n)u(n,A)&&(s=A.toLowerCase(),e[s]=n[A](),q.push((e[s]?"":"no-")+s));return v(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=m,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document); \ No newline at end of file diff --git a/src/_h5ai/js/modernizr.min.js b/src/_h5ai/js/modernizr.min.js new file mode 100644 index 00000000..4ccdbe86 --- /dev/null +++ b/src/_h5ai/js/modernizr.min.js @@ -0,0 +1,4 @@ +/* Modernizr 2.6.1 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-opacity-rgba-canvas-history-audio-video-shiv-cssclasses-prefixes + */ +;window.Modernizr=function(a,b,c){function v(a){j.cssText=a}function w(a,b){return v(m.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.6.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},n.history=function(){return!!a.history&&!!history.pushState},n.rgba=function(){return v("background-color:rgba(150,255,150,.5)"),y(j.backgroundColor,"rgba")},n.opacity=function(){return w("opacity:.55"),/^0.55$/.test(j.opacity)},n.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},n.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c};for(var A in n)u(n,A)&&(s=A.toLowerCase(),e[s]=n[A](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},v(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document); \ No newline at end of file diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index 81606b97..2ef519b9 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -14,7 +14,7 @@ - +
From e25e5b72f4eea5ed1169b6846a2004cc925c9912 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 2 Aug 2012 23:13:43 +0200 Subject: [PATCH 38/67] Adds Google Analytics support (async). --- src/_h5ai/config.js | 18 ++++++++++++++ src/_h5ai/js/inc/ext/google-analytics.js | 30 ++++++++++++++++++++++++ src/_h5ai/js/inc/main.js | 1 + 3 files changed, 49 insertions(+) create mode 100644 src/_h5ai/js/inc/ext/google-analytics.js diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 096ede71..5589798c 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -115,6 +115,24 @@ var H5AI_CONFIG = { "folders": {} }, + /* + * Adds Google Analytics asynchronous tracking code. + * + * for example: + * "gaq": [ + * ["_setAccount", "UA-xxxxxx-x"], + * ["_setDomainName", ".your-domain.tld"], + * ["_trackPageview"], + * ["_trackPageLoadTime"] + * ] + * + * see: http://support.google.com/googleanalytics/bin/topic.py?hl=en&topic=27612 + */ + "google-analytics": { + "enabled": false, + "gaq": [] + }, + /* * Localization, for example "en", "de" etc. - see "langs" below for * possible values. Adjust it to your needs. If lang is not found in diff --git a/src/_h5ai/js/inc/ext/google-analytics.js b/src/_h5ai/js/inc/ext/google-analytics.js new file mode 100644 index 00000000..60a82d33 --- /dev/null +++ b/src/_h5ai/js/inc/ext/google-analytics.js @@ -0,0 +1,30 @@ + +modulejs.define('ext/google-analytics', ['_', 'core/settings'], function (_, allsettings) { + + var defaults = { + enabled: false, + gaq: [] + }, + + settings = _.extend({}, defaults, allsettings['google-analytics']), + + init = function () { + + if (!settings.enabled) { + return; + } + + window._gaq = settings.gaq; + + var strScript = 'script', + doc = document, + newScriptTag = doc.createElement(strScript), + firstScriptTag = doc.getElementsByTagName(strScript)[0]; + + newScriptTag.async = true; + newScriptTag.src = ('https:' === location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + firstScriptTag.parentNode.insertBefore(newScriptTag, firstScriptTag); + }; + + init(); +}); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index 6449574b..e656c598 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -28,6 +28,7 @@ // @include "ext/download.js" // @include "ext/filter.js" // @include "ext/folderstatus.js" + // @include "ext/google-analytics.js" // @include "ext/l10n.js" // @include "ext/link-hover-states.js" // @include "ext/mode.js" From eaf6ad3fcb127d24fa3f18104d23f2714fb489c1 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 2 Aug 2012 23:14:45 +0200 Subject: [PATCH 39/67] Updates readme. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0d5c95ac..d185c806 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ It profits from these great projects: * fixes misaligned image previews * adds no JavaScript fallback to PHP version * fixes duplicate tree entries and empty main views +* adds Google Analytics support (async) * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 From 9e6c61251386e956e3f8c2365b54be94e54bb82b Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 00:03:27 +0200 Subject: [PATCH 40/67] Improves filter. See readme and config.js. --- .gitignore | 2 ++ README.md | 1 + src/_h5ai/config.js | 8 ++++++-- src/_h5ai/js/inc/ext/filter.js | 10 +++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 97b30e70..fc2bd57b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ build local *.sublime-* + +test diff --git a/README.md b/README.md index d185c806..eb76137b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ It profits from these great projects: * adds no JavaScript fallback to PHP version * fixes duplicate tree entries and empty main views * adds Google Analytics support (async) +* improves filter (now case-insensitive, now only checks if chars in right order) * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 5589798c..88e6dc61 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -84,7 +84,11 @@ var H5AI_CONFIG = { /* * Allow filtering the displayed files and folders. - * Note: filters will be treated as JavaScript regular expressions + * Will check entries for right order of characters, i.e. + * "ab" matches "ab", "axb", "xaxbx" but not "ba". + * Space separated sequences get OR-ed. + * + * Filters will be treated as JavaScript regular expressions * if you prefix them with "re:". */ "filter": { @@ -129,7 +133,7 @@ var H5AI_CONFIG = { * see: http://support.google.com/googleanalytics/bin/topic.py?hl=en&topic=27612 */ "google-analytics": { - "enabled": false, + "enabled": true, "gaq": [] }, diff --git a/src/_h5ai/js/inc/ext/filter.js b/src/_h5ai/js/inc/ext/filter.js index 2af67a7b..ec75b5ce 100644 --- a/src/_h5ai/js/inc/ext/filter.js +++ b/src/_h5ai/js/inc/ext/filter.js @@ -61,7 +61,6 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], func escapeRegExp = function (sequence) { return sequence.replace(/[\-\[\]{}()*+?.,\\$\^|#\s]/g, '\\$&'); - // return sequence.replace(/[|()\[{.+*?^$\\]/g,"\\$0"); }, parseFilterSequence = function (sequence) { @@ -72,10 +71,15 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], func sequence = $.map($.trim(sequence).split(/\s+/), function (part) { - return escapeRegExp(part); + return _.map(part.split(''), function (char) { + + return escapeRegExp(char); + }).join('.*?'); + + // return escapeRegExp(part); }).join('|'); - return new RegExp(sequence); + return new RegExp(sequence, 'i'); }, update = function () { From 77f301057b14299e832fa7a9fbdc26ca54e11da4 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 00:06:43 +0200 Subject: [PATCH 41/67] Updates readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb76137b..406c75b8 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ It profits from these great projects: * adds no JavaScript fallback to PHP version * fixes duplicate tree entries and empty main views * adds Google Analytics support (async) -* improves filter (now case-insensitive, now only checks if chars in right order) +* improves filter (now ignorecase, now only checks if chars in right order) * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 From 87103f1c3f2121dcbe8854c5bbd95c4efae0ee4c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 00:29:26 +0200 Subject: [PATCH 42/67] changes language code 'gr' to 'el'. --- README.md | 1 + src/_h5ai/config.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 406c75b8..88568b73 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ It profits from these great projects: * fixes duplicate tree entries and empty main views * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) +* changes language code 'gr' to 'el' * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 88e6dc61..19c6e0d3 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -386,6 +386,21 @@ var H5AI_CONFIG = { "dateFormat": "DD.MM.YYYY HH:mm" }, + "el": { + "lang": "ελληνικά", + "details": "Λεπτομέρειες", + "icons": "Εικονίδια", + "name": "Όνομα", + "lastModified": "Τελευταία Τροποποίηση", + "size": "Μέγεθος", + "parentDirectory": "Προηγούμενος Κατάλογος", + "empty": "κενό", + "folders": "Φάκελοι", + "files": "Αρχεία", + "download": "Μεταμόρφωση", + "noMatch": "Κανένα Ταίριασμα" + }, + "es": { "lang": "español", "details": "Detalles", @@ -416,21 +431,6 @@ var H5AI_CONFIG = { "dateFormat": "DD/MM/YYYY HH:mm" }, - "gr": { - "lang": "ελληνικά", - "details": "Λεπτομέρειες", - "icons": "Εικονίδια", - "name": "Όνομα", - "lastModified": "Τελευταία Τροποποίηση", - "size": "Μέγεθος", - "parentDirectory": "Προηγούμενος Κατάλογος", - "empty": "κενό", - "folders": "Φάκελοι", - "files": "Αρχεία", - "download": "Μεταμόρφωση", - "noMatch": "Κανένα Ταίριασμα" - }, - "hu": { "lang": "magyar", "details": "részletek", From 695d5148bb0b3c2dff4893f4a256ea52f8340330 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 00:32:07 +0200 Subject: [PATCH 43/67] updates readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88568b73..5e1d7393 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ It profits from these great projects: * fixes duplicate tree entries and empty main views * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) -* changes language code 'gr' to 'el' +* changes language code `gr` to `el` * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 From 7ad5958487032ee4ae458119a7781f9f6c444673 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 00:49:28 +0200 Subject: [PATCH 44/67] Updates libs. --- README.md | 4 +- src/_h5ai/js/inc/lib/moment-1.5.0.min.js | 6 - src/_h5ai/js/inc/lib/underscore-1.3.1.min.js | 31 - .../js/{inc => }/lib/amplify-1.1.0.min.js | 0 src/_h5ai/js/{inc => }/lib/base64.js | 0 .../js/{inc => }/lib/jquery-1.7.2.min.js | 0 .../js/{inc => }/lib/jquery.fracs-0.11.min.js | 0 .../{inc => }/lib/jquery.mousewheel-3.0.6.js | 0 .../js/{inc => }/lib/jquery.qrcode-0.2.min.js | 0 .../lib/jquery.scrollpanel-0.1.min.js | 0 .../lib/json2.js => lib/json2-2011.10.19.js} | 2 +- src/_h5ai/js/{inc => }/lib/modulejs-0.2.js | 0 src/_h5ai/js/lib/moment-1.7.0.js | 1106 +++++++++++++++++ src/_h5ai/js/{inc => }/lib/spin-1.2.5.min.js | 0 src/_h5ai/js/lib/underscore-1.3.3.js | 1059 ++++++++++++++++ src/_h5ai/js/scripts.js | 24 +- 16 files changed, 2181 insertions(+), 51 deletions(-) delete mode 100644 src/_h5ai/js/inc/lib/moment-1.5.0.min.js delete mode 100644 src/_h5ai/js/inc/lib/underscore-1.3.1.min.js rename src/_h5ai/js/{inc => }/lib/amplify-1.1.0.min.js (100%) rename src/_h5ai/js/{inc => }/lib/base64.js (100%) rename src/_h5ai/js/{inc => }/lib/jquery-1.7.2.min.js (100%) rename src/_h5ai/js/{inc => }/lib/jquery.fracs-0.11.min.js (100%) rename src/_h5ai/js/{inc => }/lib/jquery.mousewheel-3.0.6.js (100%) rename src/_h5ai/js/{inc => }/lib/jquery.qrcode-0.2.min.js (100%) rename src/_h5ai/js/{inc => }/lib/jquery.scrollpanel-0.1.min.js (100%) rename src/_h5ai/js/{inc/lib/json2.js => lib/json2-2011.10.19.js} (99%) rename src/_h5ai/js/{inc => }/lib/modulejs-0.2.js (100%) create mode 100644 src/_h5ai/js/lib/moment-1.7.0.js rename src/_h5ai/js/{inc => }/lib/spin-1.2.5.min.js (100%) create mode 100644 src/_h5ai/js/lib/underscore-1.3.3.js diff --git a/README.md b/README.md index 5e1d7393..8ff4a30c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ It profits from these great projects: ## Changelog -### v0.21 - *2012-??* +### v0.21 - *2012-08-??* * fixes misaligned image previews * adds no JavaScript fallback to PHP version @@ -41,6 +41,8 @@ It profits from these great projects: * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 * updates to [modulejs](http://larsjung.de/modulejs/) 0.2 +* updates to [Moment.js](http://momentjs.com) 1.7.0 +* updates to [Underscore.js](http://underscorejs.org) 1.3.3 ### v0.20 - *2012-05-11* diff --git a/src/_h5ai/js/inc/lib/moment-1.5.0.min.js b/src/_h5ai/js/inc/lib/moment-1.5.0.min.js deleted file mode 100644 index c3c10990..00000000 --- a/src/_h5ai/js/inc/lib/moment-1.5.0.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// moment.js -// version : 1.5.0 -// author : Tim Wood -// license : MIT -// momentjs.com -(function(a,b){function u(a,b){this._d=a,this._isUTC=!!b}function v(a,b){var c=a+"";while(c.length11?q.pm:q.am;case"A":return i>11?q.PM:q.AM;case"H":return i;case"HH":return v(i,2);case"h":return i%12||12;case"hh":return v(i%12||12,2);case"m":return m;case"mm":return v(m,2);case"s":return n;case"ss":return v(n,2);case"zz":case"z":return(b._d.toString().match(l)||[""])[0].replace(k,"");case"Z":return(o<0?"-":"+")+v(~~(Math.abs(o)/60),2)+":"+v(~~(Math.abs(o)%60),2);case"ZZ":return(o<0?"-":"+")+v(~~(10*Math.abs(o)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return z(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=b.month(),f=b.date(),g=b.year(),h=b.day(),i=b.hours(),m=b.minutes(),n=b.seconds(),o=-b.zone(),p=c.ordinal,q=c.meridiem;return d.replace(j,r)}function A(b,d){function p(a,b){var d;switch(a){case"M":case"MM":e[1]=~~b-1;break;case"MMM":case"MMMM":for(d=0;d<12;d++)if(c.monthsParse[d].test(b)){e[1]=d;break}break;case"D":case"DD":case"DDD":case"DDDD":e[2]=~~b;break;case"YY":b=~~b,e[0]=b+(b>70?1900:2e3);break;case"YYYY":e[0]=~~Math.abs(b);break;case"a":case"A":o=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"Z":case"ZZ":h=!0,d=(b||"").match(r),d&&d[1]&&(f=~~d[1]),d&&d[2]&&(g=~~d[2]),d&&d[0]==="+"&&(f=-f,g=-g)}}var e=[0,0,1,0,0,0,0],f=0,g=0,h=!1,i=b.match(n),j=d.match(m),k=Math.min(i.length,j.length),l,o;for(l=0;l2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); diff --git a/src/_h5ai/js/inc/lib/amplify-1.1.0.min.js b/src/_h5ai/js/lib/amplify-1.1.0.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/amplify-1.1.0.min.js rename to src/_h5ai/js/lib/amplify-1.1.0.min.js diff --git a/src/_h5ai/js/inc/lib/base64.js b/src/_h5ai/js/lib/base64.js similarity index 100% rename from src/_h5ai/js/inc/lib/base64.js rename to src/_h5ai/js/lib/base64.js diff --git a/src/_h5ai/js/inc/lib/jquery-1.7.2.min.js b/src/_h5ai/js/lib/jquery-1.7.2.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/jquery-1.7.2.min.js rename to src/_h5ai/js/lib/jquery-1.7.2.min.js diff --git a/src/_h5ai/js/inc/lib/jquery.fracs-0.11.min.js b/src/_h5ai/js/lib/jquery.fracs-0.11.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/jquery.fracs-0.11.min.js rename to src/_h5ai/js/lib/jquery.fracs-0.11.min.js diff --git a/src/_h5ai/js/inc/lib/jquery.mousewheel-3.0.6.js b/src/_h5ai/js/lib/jquery.mousewheel-3.0.6.js similarity index 100% rename from src/_h5ai/js/inc/lib/jquery.mousewheel-3.0.6.js rename to src/_h5ai/js/lib/jquery.mousewheel-3.0.6.js diff --git a/src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js b/src/_h5ai/js/lib/jquery.qrcode-0.2.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/jquery.qrcode-0.2.min.js rename to src/_h5ai/js/lib/jquery.qrcode-0.2.min.js diff --git a/src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js b/src/_h5ai/js/lib/jquery.scrollpanel-0.1.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/jquery.scrollpanel-0.1.min.js rename to src/_h5ai/js/lib/jquery.scrollpanel-0.1.min.js diff --git a/src/_h5ai/js/inc/lib/json2.js b/src/_h5ai/js/lib/json2-2011.10.19.js similarity index 99% rename from src/_h5ai/js/inc/lib/json2.js rename to src/_h5ai/js/lib/json2-2011.10.19.js index 2dbf60d3..3b0c872d 100644 --- a/src/_h5ai/js/inc/lib/json2.js +++ b/src/_h5ai/js/lib/json2-2011.10.19.js @@ -1,5 +1,5 @@ /* - http://www.JSON.org/json2.js + json2.js 2011-10-19 Public Domain. diff --git a/src/_h5ai/js/inc/lib/modulejs-0.2.js b/src/_h5ai/js/lib/modulejs-0.2.js similarity index 100% rename from src/_h5ai/js/inc/lib/modulejs-0.2.js rename to src/_h5ai/js/lib/modulejs-0.2.js diff --git a/src/_h5ai/js/lib/moment-1.7.0.js b/src/_h5ai/js/lib/moment-1.7.0.js new file mode 100644 index 00000000..95520c0d --- /dev/null +++ b/src/_h5ai/js/lib/moment-1.7.0.js @@ -0,0 +1,1106 @@ +// moment.js +// version : 1.7.0 +// author : Tim Wood +// license : MIT +// momentjs.com + +(function (Date, undefined) { + + /************************************ + Constants + ************************************/ + + var moment, + VERSION = "1.7.0", + round = Math.round, i, + // internal storage for language config files + languages = {}, + currentLanguage = 'en', + + // check for nodeJS + hasModule = (typeof module !== 'undefined' && module.exports), + + // Parameters to check for on the lang config. This list of properties + // will be inherited from English if not provided in a language + // definition. monthsParse is also a lang config property, but it + // cannot be inherited and as such cannot be enumerated here. + langConfigProperties = 'months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem'.split('|'), + + // ASP.NET json date format regex + aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, + + // format tokens + formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g, + localFormattingTokens = /(LT|LL?L?L?)/g, + formattingRemoveEscapes = /(^\[)|(\\)|\]$/g, + + // parsing tokens + parseMultipleFormatChunker = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi, + + // parsing token regexes + parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 + parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 + parseTokenThreeDigits = /\d{3}/, // 000 - 999 + parseTokenFourDigits = /\d{1,4}/, // 0 - 9999 + parseTokenWord = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i, // any word characters or numbers + parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z + parseTokenT = /T/i, // T (ISO seperator) + + // preliminary iso regex + // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 + isoRegex = /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/, + isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', + + // iso time formats and regexes + isoTimes = [ + ['HH:mm:ss.S', /T\d\d:\d\d:\d\d\.\d{1,3}/], + ['HH:mm:ss', /T\d\d:\d\d:\d\d/], + ['HH:mm', /T\d\d:\d\d/], + ['HH', /T\d\d/] + ], + + // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] + parseTimezoneChunker = /([\+\-]|\d\d)/gi, + + // getter and setter names + proxyGettersAndSetters = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), + unitMillisecondFactors = { + 'Milliseconds' : 1, + 'Seconds' : 1e3, + 'Minutes' : 6e4, + 'Hours' : 36e5, + 'Days' : 864e5, + 'Months' : 2592e6, + 'Years' : 31536e6 + }, + + // format function strings + formatFunctions = {}, + + /* + * moment.fn.format uses new Function() to create an inlined formatting function. + * Results are a 3x speed boost + * http://jsperf.com/momentjs-cached-format-functions + * + * These strings are appended into a function using replaceFormatTokens and makeFormatFunction + */ + formatFunctionStrings = { + // a = placeholder + // b = placeholder + // t = the current moment being formatted + // v = getValueAtKey function + // o = language.ordinal function + // p = leftZeroFill function + // m = language.meridiem value or function + M : '(a=t.month()+1)', + MMM : 'v("monthsShort",t.month())', + MMMM : 'v("months",t.month())', + D : '(a=t.date())', + DDD : '(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))', + d : '(a=t.day())', + dd : 'v("weekdaysMin",t.day())', + ddd : 'v("weekdaysShort",t.day())', + dddd : 'v("weekdays",t.day())', + w : '(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))', + YY : 'p(t.year()%100,2)', + YYYY : 'p(t.year(),4)', + a : 'm(t.hours(),t.minutes(),!0)', + A : 'm(t.hours(),t.minutes(),!1)', + H : 't.hours()', + h : 't.hours()%12||12', + m : 't.minutes()', + s : 't.seconds()', + S : '~~(t.milliseconds()/100)', + SS : 'p(~~(t.milliseconds()/10),2)', + SSS : 'p(t.milliseconds(),3)', + Z : '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)', + ZZ : '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)' + }, + + ordinalizeTokens = 'DDD w M D d'.split(' '), + paddedTokens = 'M D H h m s w'.split(' '); + + while (ordinalizeTokens.length) { + i = ordinalizeTokens.pop(); + formatFunctionStrings[i + 'o'] = formatFunctionStrings[i] + '+o(a)'; + } + while (paddedTokens.length) { + i = paddedTokens.pop(); + formatFunctionStrings[i + i] = 'p(' + formatFunctionStrings[i] + ',2)'; + } + formatFunctionStrings.DDDD = 'p(' + formatFunctionStrings.DDD + ',3)'; + + + /************************************ + Constructors + ************************************/ + + + // Moment prototype object + function Moment(date, isUTC, lang) { + this._d = date; + this._isUTC = !!isUTC; + this._a = date._a || null; + date._a = null; + this._lang = lang || false; + } + + // Duration Constructor + function Duration(duration) { + var data = this._data = {}, + years = duration.years || duration.y || 0, + months = duration.months || duration.M || 0, + weeks = duration.weeks || duration.w || 0, + days = duration.days || duration.d || 0, + hours = duration.hours || duration.h || 0, + minutes = duration.minutes || duration.m || 0, + seconds = duration.seconds || duration.s || 0, + milliseconds = duration.milliseconds || duration.ms || 0; + + // representation for dateAddRemove + this._milliseconds = milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 36e5; // 1000 * 60 * 60 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = months + + years * 12; + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + seconds += absRound(milliseconds / 1000); + + data.seconds = seconds % 60; + minutes += absRound(seconds / 60); + + data.minutes = minutes % 60; + hours += absRound(minutes / 60); + + data.hours = hours % 24; + days += absRound(hours / 24); + + days += weeks * 7; + data.days = days % 30; + + months += absRound(days / 30); + + data.months = months % 12; + years += absRound(months / 12); + + data.years = years; + + this._lang = false; + } + + + /************************************ + Helpers + ************************************/ + + + function absRound(number) { + if (number < 0) { + return Math.ceil(number); + } else { + return Math.floor(number); + } + } + + // left zero fill a number + // see http://jsperf.com/left-zero-filling for performance comparison + function leftZeroFill(number, targetLength) { + var output = number + ''; + while (output.length < targetLength) { + output = '0' + output; + } + return output; + } + + // helper function for _.addTime and _.subtractTime + function addOrSubtractDurationFromMoment(mom, duration, isAdding) { + var ms = duration._milliseconds, + d = duration._days, + M = duration._months, + currentDate; + + if (ms) { + mom._d.setTime(+mom + ms * isAdding); + } + if (d) { + mom.date(mom.date() + d * isAdding); + } + if (M) { + currentDate = mom.date(); + mom.date(1) + .month(mom.month() + M * isAdding) + .date(Math.min(currentDate, mom.daysInMonth())); + } + } + + // check if is an array + function isArray(input) { + return Object.prototype.toString.call(input) === '[object Array]'; + } + + // compare two arrays, return the number of differences + function compareArrays(array1, array2) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if (~~array1[i] !== ~~array2[i]) { + diffs++; + } + } + return diffs + lengthDiff; + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function dateFromArray(input, asUTC) { + var i, date; + for (i = 1; i < 7; i++) { + input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i]; + } + // we store whether we used utc or not in the input array + input[7] = asUTC; + date = new Date(0); + if (asUTC) { + date.setUTCFullYear(input[0], input[1], input[2]); + date.setUTCHours(input[3], input[4], input[5], input[6]); + } else { + date.setFullYear(input[0], input[1], input[2]); + date.setHours(input[3], input[4], input[5], input[6]); + } + date._a = input; + return date; + } + + // Loads a language definition into the `languages` cache. The function + // takes a key and optionally values. If not in the browser and no values + // are provided, it will load the language file module. As a convenience, + // this function also returns the language values. + function loadLang(key, values) { + var i, m, + parse = []; + + if (!values && hasModule) { + values = require('./lang/' + key); + } + + for (i = 0; i < langConfigProperties.length; i++) { + // If a language definition does not provide a value, inherit + // from English + values[langConfigProperties[i]] = values[langConfigProperties[i]] || + languages.en[langConfigProperties[i]]; + } + + for (i = 0; i < 12; i++) { + m = moment([2000, i]); + parse[i] = new RegExp('^' + (values.months[i] || values.months(m, '')) + + '|^' + (values.monthsShort[i] || values.monthsShort(m, '')).replace('.', ''), 'i'); + } + values.monthsParse = values.monthsParse || parse; + + languages[key] = values; + + return values; + } + + // Determines which language definition to use and returns it. + // + // With no parameters, it will return the global language. If you + // pass in a language key, such as 'en', it will return the + // definition for 'en', so long as 'en' has already been loaded using + // moment.lang. If you pass in a moment or duration instance, it + // will decide the language based on that, or default to the global + // language. + function getLangDefinition(m) { + var langKey = (typeof m === 'string') && m || + m && m._lang || + null; + + return langKey ? (languages[langKey] || loadLang(langKey)) : moment; + } + + + /************************************ + Formatting + ************************************/ + + + // helper for building inline formatting functions + function replaceFormatTokens(token) { + return formatFunctionStrings[token] ? + ("'+(" + formatFunctionStrings[token] + ")+'") : + token.replace(formattingRemoveEscapes, "").replace(/\\?'/g, "\\'"); + } + + // helper for recursing long date formatting tokens + function replaceLongDateFormatTokens(input) { + return getLangDefinition().longDateFormat[input] || input; + } + + function makeFormatFunction(format) { + var output = "var a,b;return '" + + format.replace(formattingTokens, replaceFormatTokens) + "';", + Fn = Function; // get around jshint + // t = the current moment being formatted + // v = getValueAtKey function + // o = language.ordinal function + // p = leftZeroFill function + // m = language.meridiem value or function + return new Fn('t', 'v', 'o', 'p', 'm', output); + } + + function makeOrGetFormatFunction(format) { + if (!formatFunctions[format]) { + formatFunctions[format] = makeFormatFunction(format); + } + return formatFunctions[format]; + } + + // format date using native date object + function formatMoment(m, format) { + var lang = getLangDefinition(m); + + function getValueFromArray(key, index) { + return lang[key].call ? lang[key](m, format) : lang[key][index]; + } + + while (localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + } + + if (!formatFunctions[format]) { + formatFunctions[format] = makeFormatFunction(format); + } + + return formatFunctions[format](m, getValueFromArray, lang.ordinal, leftZeroFill, lang.meridiem); + } + + + /************************************ + Parsing + ************************************/ + + + // get the regex to find the next token + function getParseRegexForToken(token) { + switch (token) { + case 'DDDD': + return parseTokenThreeDigits; + case 'YYYY': + return parseTokenFourDigits; + case 'S': + case 'SS': + case 'SSS': + case 'DDD': + return parseTokenOneToThreeDigits; + case 'MMM': + case 'MMMM': + case 'dd': + case 'ddd': + case 'dddd': + case 'a': + case 'A': + return parseTokenWord; + case 'Z': + case 'ZZ': + return parseTokenTimezone; + case 'T': + return parseTokenT; + case 'MM': + case 'DD': + case 'YY': + case 'HH': + case 'hh': + case 'mm': + case 'ss': + case 'M': + case 'D': + case 'd': + case 'H': + case 'h': + case 'm': + case 's': + return parseTokenOneOrTwoDigits; + default : + return new RegExp(token.replace('\\', '')); + } + } + + // function to convert string input to date + function addTimeToArrayFromToken(token, input, datePartArray, config) { + var a; + //console.log('addTime', format, input); + switch (token) { + // MONTH + case 'M' : // fall through to MM + case 'MM' : + datePartArray[1] = (input == null) ? 0 : ~~input - 1; + break; + case 'MMM' : // fall through to MMMM + case 'MMMM' : + for (a = 0; a < 12; a++) { + if (getLangDefinition().monthsParse[a].test(input)) { + datePartArray[1] = a; + break; + } + } + break; + // DAY OF MONTH + case 'D' : // fall through to DDDD + case 'DD' : // fall through to DDDD + case 'DDD' : // fall through to DDDD + case 'DDDD' : + if (input != null) { + datePartArray[2] = ~~input; + } + break; + // YEAR + case 'YY' : + input = ~~input; + datePartArray[0] = input + (input > 70 ? 1900 : 2000); + break; + case 'YYYY' : + datePartArray[0] = ~~Math.abs(input); + break; + // AM / PM + case 'a' : // fall through to A + case 'A' : + config.isPm = ((input + '').toLowerCase() === 'pm'); + break; + // 24 HOUR + case 'H' : // fall through to hh + case 'HH' : // fall through to hh + case 'h' : // fall through to hh + case 'hh' : + datePartArray[3] = ~~input; + break; + // MINUTE + case 'm' : // fall through to mm + case 'mm' : + datePartArray[4] = ~~input; + break; + // SECOND + case 's' : // fall through to ss + case 'ss' : + datePartArray[5] = ~~input; + break; + // MILLISECOND + case 'S' : + case 'SS' : + case 'SSS' : + datePartArray[6] = ~~ (('0.' + input) * 1000); + break; + // TIMEZONE + case 'Z' : // fall through to ZZ + case 'ZZ' : + config.isUTC = true; + a = (input + '').match(parseTimezoneChunker); + if (a && a[1]) { + config.tzh = ~~a[1]; + } + if (a && a[2]) { + config.tzm = ~~a[2]; + } + // reverse offsets + if (a && a[0] === '+') { + config.tzh = -config.tzh; + config.tzm = -config.tzm; + } + break; + } + } + + // date from string and format string + function makeDateFromStringAndFormat(string, format) { + var datePartArray = [0, 0, 1, 0, 0, 0, 0], + config = { + tzh : 0, // timezone hour offset + tzm : 0 // timezone minute offset + }, + tokens = format.match(formattingTokens), + i, parsedInput; + + for (i = 0; i < tokens.length; i++) { + parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0]; + string = string.replace(getParseRegexForToken(tokens[i]), ''); + addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config); + } + // handle am pm + if (config.isPm && datePartArray[3] < 12) { + datePartArray[3] += 12; + } + // if is 12 am, change hours to 0 + if (config.isPm === false && datePartArray[3] === 12) { + datePartArray[3] = 0; + } + // handle timezone + datePartArray[3] += config.tzh; + datePartArray[4] += config.tzm; + // return + return dateFromArray(datePartArray, config.isUTC); + } + + // date from string and array of format strings + function makeDateFromStringAndArray(string, formats) { + var output, + inputParts = string.match(parseMultipleFormatChunker) || [], + formattedInputParts, + scoreToBeat = 99, + i, + currentDate, + currentScore; + for (i = 0; i < formats.length; i++) { + currentDate = makeDateFromStringAndFormat(string, formats[i]); + formattedInputParts = formatMoment(new Moment(currentDate), formats[i]).match(parseMultipleFormatChunker) || []; + currentScore = compareArrays(inputParts, formattedInputParts); + if (currentScore < scoreToBeat) { + scoreToBeat = currentScore; + output = currentDate; + } + } + return output; + } + + // date from iso format + function makeDateFromString(string) { + var format = 'YYYY-MM-DDT', + i; + if (isoRegex.exec(string)) { + for (i = 0; i < 4; i++) { + if (isoTimes[i][1].exec(string)) { + format += isoTimes[i][0]; + break; + } + } + return parseTokenTimezone.exec(string) ? + makeDateFromStringAndFormat(string, format + ' Z') : + makeDateFromStringAndFormat(string, format); + } + return new Date(string); + } + + + /************************************ + Relative Time + ************************************/ + + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { + var rt = lang.relativeTime[string]; + return (typeof rt === 'function') ? + rt(number || 1, !!withoutSuffix, string, isFuture) : + rt.replace(/%d/i, number || 1); + } + + function relativeTime(milliseconds, withoutSuffix, lang) { + var seconds = round(Math.abs(milliseconds) / 1000), + minutes = round(seconds / 60), + hours = round(minutes / 60), + days = round(hours / 24), + years = round(days / 365), + args = seconds < 45 && ['s', seconds] || + minutes === 1 && ['m'] || + minutes < 45 && ['mm', minutes] || + hours === 1 && ['h'] || + hours < 22 && ['hh', hours] || + days === 1 && ['d'] || + days <= 25 && ['dd', days] || + days <= 45 && ['M'] || + days < 345 && ['MM', round(days / 30)] || + years === 1 && ['y'] || ['yy', years]; + args[2] = withoutSuffix; + args[3] = milliseconds > 0; + args[4] = lang; + return substituteTimeAgo.apply({}, args); + } + + + /************************************ + Top Level Functions + ************************************/ + + + moment = function (input, format) { + if (input === null || input === '') { + return null; + } + var date, + matched; + // parse Moment object + if (moment.isMoment(input)) { + return new Moment(new Date(+input._d), input._isUTC, input._lang); + // parse string and format + } else if (format) { + if (isArray(format)) { + date = makeDateFromStringAndArray(input, format); + } else { + date = makeDateFromStringAndFormat(input, format); + } + // evaluate it as a JSON-encoded date + } else { + matched = aspNetJsonRegex.exec(input); + date = input === undefined ? new Date() : + matched ? new Date(+matched[1]) : + input instanceof Date ? input : + isArray(input) ? dateFromArray(input) : + typeof input === 'string' ? makeDateFromString(input) : + new Date(input); + } + + return new Moment(date); + }; + + // creating with utc + moment.utc = function (input, format) { + if (isArray(input)) { + return new Moment(dateFromArray(input, true), true); + } + // if we don't have a timezone, we need to add one to trigger parsing into utc + if (typeof input === 'string' && !parseTokenTimezone.exec(input)) { + input += ' +0000'; + if (format) { + format += ' Z'; + } + } + return moment(input, format).utc(); + }; + + // creating with unix timestamp (in seconds) + moment.unix = function (input) { + return moment(input * 1000); + }; + + // duration + moment.duration = function (input, key) { + var isDuration = moment.isDuration(input), + isNumber = (typeof input === 'number'), + duration = (isDuration ? input._data : (isNumber ? {} : input)), + ret; + + if (isNumber) { + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } + + ret = new Duration(duration); + + if (isDuration) { + ret._lang = input._lang; + } + + return ret; + }; + + // humanizeDuration + // This method is deprecated in favor of the new Duration object. Please + // see the moment.duration method. + moment.humanizeDuration = function (num, type, withSuffix) { + return moment.duration(num, type === true ? null : type).humanize(type === true ? true : withSuffix); + }; + + // version number + moment.version = VERSION; + + // default format + moment.defaultFormat = isoFormat; + + // This function will load languages and then set the global language. If + // no arguments are passed in, it will simply return the current global + // language key. + moment.lang = function (key, values) { + var i; + + if (!key) { + return currentLanguage; + } + if (values || !languages[key]) { + loadLang(key, values); + } + if (languages[key]) { + // deprecated, to get the language definition variables, use the + // moment.fn.lang method or the getLangDefinition function. + for (i = 0; i < langConfigProperties.length; i++) { + moment[langConfigProperties[i]] = languages[key][langConfigProperties[i]]; + } + moment.monthsParse = languages[key].monthsParse; + currentLanguage = key; + } + }; + + // returns language data + moment.langData = getLangDefinition; + + // compare moment object + moment.isMoment = function (obj) { + return obj instanceof Moment; + }; + + // for typechecking Duration objects + moment.isDuration = function (obj) { + return obj instanceof Duration; + }; + + // Set default language, other languages will inherit from English. + moment.lang('en', { + months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), + monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), + weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), + weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), + weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), + longDateFormat : { + LT : "h:mm A", + L : "MM/DD/YYYY", + LL : "MMMM D YYYY", + LLL : "MMMM D YYYY LT", + LLLL : "dddd, MMMM D YYYY LT" + }, + meridiem : function (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + }, + calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[last] dddd [at] LT', + sameElse : 'L' + }, + relativeTime : { + future : "in %s", + past : "%s ago", + s : "a few seconds", + m : "a minute", + mm : "%d minutes", + h : "an hour", + hh : "%d hours", + d : "a day", + dd : "%d days", + M : "a month", + MM : "%d months", + y : "a year", + yy : "%d years" + }, + ordinal : function (number) { + var b = number % 10; + return (~~ (number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + } + }); + + + /************************************ + Moment Prototype + ************************************/ + + + moment.fn = Moment.prototype = { + + clone : function () { + return moment(this); + }, + + valueOf : function () { + return +this._d; + }, + + unix : function () { + return Math.floor(+this._d / 1000); + }, + + toString : function () { + return this._d.toString(); + }, + + toDate : function () { + return this._d; + }, + + toArray : function () { + var m = this; + return [ + m.year(), + m.month(), + m.date(), + m.hours(), + m.minutes(), + m.seconds(), + m.milliseconds(), + !!this._isUTC + ]; + }, + + isValid : function () { + if (this._a) { + return !compareArrays(this._a, (this._a[7] ? moment.utc(this) : this).toArray()); + } + return !isNaN(this._d.getTime()); + }, + + utc : function () { + this._isUTC = true; + return this; + }, + + local : function () { + this._isUTC = false; + return this; + }, + + format : function (inputString) { + return formatMoment(this, inputString ? inputString : moment.defaultFormat); + }, + + add : function (input, val) { + var dur = val ? moment.duration(+val, input) : moment.duration(input); + addOrSubtractDurationFromMoment(this, dur, 1); + return this; + }, + + subtract : function (input, val) { + var dur = val ? moment.duration(+val, input) : moment.duration(input); + addOrSubtractDurationFromMoment(this, dur, -1); + return this; + }, + + diff : function (input, val, asFloat) { + var inputMoment = this._isUTC ? moment(input).utc() : moment(input).local(), + zoneDiff = (this.zone() - inputMoment.zone()) * 6e4, + diff = this._d - inputMoment._d - zoneDiff, + year = this.year() - inputMoment.year(), + month = this.month() - inputMoment.month(), + date = this.date() - inputMoment.date(), + output; + if (val === 'months') { + output = year * 12 + month + date / 30; + } else if (val === 'years') { + output = year + (month + date / 30) / 12; + } else { + output = val === 'seconds' ? diff / 1e3 : // 1000 + val === 'minutes' ? diff / 6e4 : // 1000 * 60 + val === 'hours' ? diff / 36e5 : // 1000 * 60 * 60 + val === 'days' ? diff / 864e5 : // 1000 * 60 * 60 * 24 + val === 'weeks' ? diff / 6048e5 : // 1000 * 60 * 60 * 24 * 7 + diff; + } + return asFloat ? output : round(output); + }, + + from : function (time, withoutSuffix) { + return moment.duration(this.diff(time)).lang(this._lang).humanize(!withoutSuffix); + }, + + fromNow : function (withoutSuffix) { + return this.from(moment(), withoutSuffix); + }, + + calendar : function () { + var diff = this.diff(moment().sod(), 'days', true), + calendar = this.lang().calendar, + allElse = calendar.sameElse, + format = diff < -6 ? allElse : + diff < -1 ? calendar.lastWeek : + diff < 0 ? calendar.lastDay : + diff < 1 ? calendar.sameDay : + diff < 2 ? calendar.nextDay : + diff < 7 ? calendar.nextWeek : allElse; + return this.format(typeof format === 'function' ? format.apply(this) : format); + }, + + isLeapYear : function () { + var year = this.year(); + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + }, + + isDST : function () { + return (this.zone() < moment([this.year()]).zone() || + this.zone() < moment([this.year(), 5]).zone()); + }, + + day : function (input) { + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + return input == null ? day : + this.add({ d : input - day }); + }, + + startOf: function (val) { + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (val.replace(/s$/, '')) { + case 'year': + this.month(0); + /* falls through */ + case 'month': + this.date(1); + /* falls through */ + case 'day': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + /* falls through */ + } + return this; + }, + + endOf: function (val) { + return this.startOf(val).add(val.replace(/s?$/, 's'), 1).subtract('ms', 1); + }, + + sod: function () { + return this.clone().startOf('day'); + }, + + eod: function () { + // end of day = start of day plus 1 day, minus 1 millisecond + return this.clone().endOf('day'); + }, + + zone : function () { + return this._isUTC ? 0 : this._d.getTimezoneOffset(); + }, + + daysInMonth : function () { + return moment.utc([this.year(), this.month() + 1, 0]).date(); + }, + + // If passed a language key, it will set the language for this + // instance. Otherwise, it will return the language configuration + // variables for this instance. + lang : function (lang) { + if (lang === undefined) { + return getLangDefinition(this); + } else { + this._lang = lang; + return this; + } + } + }; + + // helper for adding shortcuts + function makeGetterAndSetter(name, key) { + moment.fn[name] = function (input) { + var utc = this._isUTC ? 'UTC' : ''; + if (input != null) { + this._d['set' + utc + key](input); + return this; + } else { + return this._d['get' + utc + key](); + } + }; + } + + // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds) + for (i = 0; i < proxyGettersAndSetters.length; i ++) { + makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase(), proxyGettersAndSetters[i]); + } + + // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear') + makeGetterAndSetter('year', 'FullYear'); + + + /************************************ + Duration Prototype + ************************************/ + + + moment.duration.fn = Duration.prototype = { + weeks : function () { + return absRound(this.days() / 7); + }, + + valueOf : function () { + return this._milliseconds + + this._days * 864e5 + + this._months * 2592e6; + }, + + humanize : function (withSuffix) { + var difference = +this, + rel = this.lang().relativeTime, + output = relativeTime(difference, !withSuffix, this.lang()); + + if (withSuffix) { + output = (difference <= 0 ? rel.past : rel.future).replace(/%s/i, output); + } + + return output; + }, + + lang : moment.fn.lang + }; + + function makeDurationGetter(name) { + moment.duration.fn[name] = function () { + return this._data[name]; + }; + } + + function makeDurationAsGetter(name, factor) { + moment.duration.fn['as' + name] = function () { + return +this / factor; + }; + } + + for (i in unitMillisecondFactors) { + if (unitMillisecondFactors.hasOwnProperty(i)) { + makeDurationAsGetter(i, unitMillisecondFactors[i]); + makeDurationGetter(i.toLowerCase()); + } + } + + makeDurationAsGetter('Weeks', 6048e5); + + + /************************************ + Exposing Moment + ************************************/ + + + // CommonJS module is defined + if (hasModule) { + module.exports = moment; + } + /*global ender:false */ + if (typeof ender === 'undefined') { + // here, `this` means `window` in the browser, or `global` on the server + // add `moment` as a global object via a string identifier, + // for Closure Compiler "advanced" mode + this['moment'] = moment; + } + /*global define:false */ + if (typeof define === "function" && define.amd) { + define("moment", [], function () { + return moment; + }); + } +}).call(this, Date); diff --git a/src/_h5ai/js/inc/lib/spin-1.2.5.min.js b/src/_h5ai/js/lib/spin-1.2.5.min.js similarity index 100% rename from src/_h5ai/js/inc/lib/spin-1.2.5.min.js rename to src/_h5ai/js/lib/spin-1.2.5.min.js diff --git a/src/_h5ai/js/lib/underscore-1.3.3.js b/src/_h5ai/js/lib/underscore-1.3.3.js new file mode 100644 index 00000000..f6f7e2f2 --- /dev/null +++ b/src/_h5ai/js/lib/underscore-1.3.3.js @@ -0,0 +1,1059 @@ +// Underscore.js 1.3.3 +// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the MIT license. +// Portions of Underscore are inspired or borrowed from Prototype, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `global` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Establish the object that gets returned to break out of a loop iteration. + var breaker = {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var slice = ArrayProto.slice, + unshift = ArrayProto.unshift, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeForEach = ArrayProto.forEach, + nativeMap = ArrayProto.map, + nativeReduce = ArrayProto.reduce, + nativeReduceRight = ArrayProto.reduceRight, + nativeFilter = ArrayProto.filter, + nativeEvery = ArrayProto.every, + nativeSome = ArrayProto.some, + nativeIndexOf = ArrayProto.indexOf, + nativeLastIndexOf = ArrayProto.lastIndexOf, + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { return new wrapper(obj); }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object via a string identifier, + // for Closure Compiler "advanced" mode. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root['_'] = _; + } + + // Current version. + _.VERSION = '1.3.3'; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles objects with the built-in `forEach`, arrays, and raw objects. + // Delegates to **ECMAScript 5**'s native `forEach` if available. + var each = _.each = _.forEach = function(obj, iterator, context) { + if (obj == null) return; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + for (var key in obj) { + if (_.has(obj, key)) { + if (iterator.call(context, obj[key], key, obj) === breaker) return; + } + } + } + }; + + // Return the results of applying the iterator to each element. + // Delegates to **ECMAScript 5**'s native `map` if available. + _.map = _.collect = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); + each(obj, function(value, index, list) { + results[results.length] = iterator.call(context, value, index, list); + }); + if (obj.length === +obj.length) results.length = obj.length; + return results; + }; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. + _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduce && obj.reduce === nativeReduce) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + } + each(obj, function(value, index, list) { + if (!initial) { + memo = value; + initial = true; + } else { + memo = iterator.call(context, memo, value, index, list); + } + }); + if (!initial) throw new TypeError('Reduce of empty array with no initial value'); + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. + _.reduceRight = _.foldr = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + } + var reversed = _.toArray(obj).reverse(); + if (context && !initial) iterator = _.bind(iterator, context); + return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator); + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, iterator, context) { + var result; + any(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Delegates to **ECMAScript 5**'s native `filter` if available. + // Aliased as `select`. + _.filter = _.select = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); + each(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) results[results.length] = value; + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + each(obj, function(value, index, list) { + if (!iterator.call(context, value, index, list)) results[results.length] = value; + }); + return results; + }; + + // Determine whether all of the elements match a truth test. + // Delegates to **ECMAScript 5**'s native `every` if available. + // Aliased as `all`. + _.every = _.all = function(obj, iterator, context) { + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); + each(obj, function(value, index, list) { + if (!(result = result && iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if at least one element in the object matches a truth test. + // Delegates to **ECMAScript 5**'s native `some` if available. + // Aliased as `any`. + var any = _.some = _.any = function(obj, iterator, context) { + iterator || (iterator = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); + each(obj, function(value, index, list) { + if (result || (result = iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if a given value is included in the array or object using `===`. + // Aliased as `contains`. + _.include = _.contains = function(obj, target) { + var found = false; + if (obj == null) return found; + if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; + found = any(obj, function(value) { + return value === target; + }); + return found; + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + return _.map(obj, function(value) { + return (_.isFunction(method) ? method || value : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, function(value){ return value[key]; }); + }; + + // Return the maximum element or (element-based computation). + _.max = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.max.apply(Math, obj); + if (!iterator && _.isEmpty(obj)) return -Infinity; + var result = {computed : -Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed >= result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.min.apply(Math, obj); + if (!iterator && _.isEmpty(obj)) return Infinity; + var result = {computed : Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed < result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Shuffle an array. + _.shuffle = function(obj) { + var shuffled = [], rand; + each(obj, function(value, index, list) { + rand = Math.floor(Math.random() * (index + 1)); + shuffled[index] = shuffled[rand]; + shuffled[rand] = value; + }); + return shuffled; + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, val, context) { + var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; + return _.pluck(_.map(obj, function(value, index, list) { + return { + value : value, + criteria : iterator.call(context, value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + if (a === void 0) return 1; + if (b === void 0) return -1; + return a < b ? -1 : a > b ? 1 : 0; + }), 'value'); + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = function(obj, val) { + var result = {}; + var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; + each(obj, function(value, index) { + var key = iterator(value, index); + (result[key] || (result[key] = [])).push(value); + }); + return result; + }; + + // Use a comparator function to figure out at what index an object should + // be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iterator) { + iterator || (iterator = _.identity); + var low = 0, high = array.length; + while (low < high) { + var mid = (low + high) >> 1; + iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; + } + return low; + }; + + // Safely convert anything iterable into a real, live array. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (_.isArguments(obj)) return slice.call(obj); + if (obj.toArray && _.isFunction(obj.toArray)) return obj.toArray(); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + return _.isArray(obj) ? obj.length : _.keys(obj).length; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + }; + + // Returns everything but the last entry of the array. Especcialy useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if ((n != null) && !guard) { + return slice.call(array, Math.max(array.length - n, 0)); + } else { + return array[array.length - 1]; + } + }; + + // Returns everything but the first entry of the array. Aliased as `tail`. + // Especially useful on the arguments object. Passing an **index** will return + // the rest of the values in the array from that index onward. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = function(array, index, guard) { + return slice.call(array, (index == null) || guard ? 1 : index); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, function(value){ return !!value; }); + }; + + // Return a completely flattened version of an array. + _.flatten = function(array, shallow) { + return _.reduce(array, function(memo, value) { + if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value)); + memo[memo.length] = value; + return memo; + }, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iterator) { + var initial = iterator ? _.map(array, iterator) : array; + var results = []; + // The `isSorted` flag is irrelevant if the array only contains two elements. + if (array.length < 3) isSorted = true; + _.reduce(initial, function (memo, value, index) { + if (isSorted ? _.last(memo) !== value || !memo.length : !_.include(memo, value)) { + memo.push(value); + results.push(array[index]); + } + return memo; + }, []); + return results; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(_.flatten(arguments, true)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. (Aliased as "intersect" for back-compat.) + _.intersection = _.intersect = function(array) { + var rest = slice.call(arguments, 1); + return _.filter(_.uniq(array), function(item) { + return _.every(rest, function(other) { + return _.indexOf(other, item) >= 0; + }); + }); + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = _.flatten(slice.call(arguments, 1), true); + return _.filter(array, function(value){ return !_.include(rest, value); }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + var args = slice.call(arguments); + var length = _.max(_.pluck(args, 'length')); + var results = new Array(length); + for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); + return results; + }; + + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), + // we need this function. Return the position of the first occurrence of an + // item in an array, or -1 if the item is not included in the array. + // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i, l; + if (isSorted) { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); + for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i; + return -1; + }; + + // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. + _.lastIndexOf = function(array, item) { + if (array == null) return -1; + if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); + var i = array.length; + while (i--) if (i in array && array[i] === item) return i; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = arguments[2] || 1; + + var len = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(len); + + while(idx < len) { + range[idx++] = start; + start += step; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Binding with arguments is also known as `curry`. + // Delegates to **ECMAScript 5**'s native `Function.bind` if available. + // We check for `func.bind` first, to fail fast when `func` is undefined. + _.bind = function bind(func, context) { + var bound, args; + if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError; + args = slice.call(arguments, 2); + return bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + ctor.prototype = func.prototype; + var self = new ctor; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (Object(result) === result) return result; + return self; + }; + }; + + // Bind all of an object's methods to that object. Useful for ensuring that + // all callbacks defined on an object belong to it. + _.bindAll = function(obj) { + var funcs = slice.call(arguments, 1); + if (funcs.length == 0) funcs = _.functions(obj); + each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memo = {}; + hasher || (hasher = _.identity); + return function() { + var key = hasher.apply(this, arguments); + return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + }; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ return func.apply(null, args); }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. + _.throttle = function(func, wait) { + var context, args, timeout, throttling, more, result; + var whenDone = _.debounce(function(){ more = throttling = false; }, wait); + return function() { + context = this; args = arguments; + var later = function() { + timeout = null; + if (more) func.apply(context, args); + whenDone(); + }; + if (!timeout) timeout = setTimeout(later, wait); + if (throttling) { + more = true; + } else { + result = func.apply(context, args); + } + whenDone(); + throttling = true; + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) func.apply(context, args); + }; + if (immediate && !timeout) func.apply(context, args); + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = function(func) { + var ran = false, memo; + return function() { + if (ran) return memo; + ran = true; + return memo = func.apply(this, arguments); + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return function() { + var args = [func].concat(slice.call(arguments, 0)); + return wrapper.apply(this, args); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var funcs = arguments; + return function() { + var args = arguments; + for (var i = funcs.length - 1; i >= 0; i--) { + args = [funcs[i].apply(this, args)]; + } + return args[0]; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + if (times <= 0) return func(); + return function() { + if (--times < 1) { return func.apply(this, arguments); } + }; + }; + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = nativeKeys || function(obj) { + if (obj !== Object(obj)) throw new TypeError('Invalid object'); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + return _.map(obj, _.identity); + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + each(slice.call(arguments, 1), function(source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + }); + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj) { + var result = {}; + each(_.flatten(slice.call(arguments, 1)), function(key) { + if (key in obj) result[key] = obj[key]; + }); + return result; + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + each(slice.call(arguments, 1), function(source) { + for (var prop in source) { + if (obj[prop] == null) obj[prop] = source[prop]; + } + }); + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function. + function eq(a, b, stack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. + if (a === b) return a !== 0 || 1 / a == 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a._chain) a = a._wrapped; + if (b._chain) b = b._wrapped; + // Invoke a custom `isEqual` method if one is provided. + if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b); + if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a); + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className != toString.call(b)) return false; + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = stack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (stack[length] == a) return true; + } + // Add the first object to the stack of traversed objects. + stack.push(a); + var size = 0, result = true; + // Recursively compare objects and arrays. + if (className == '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size == b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + // Ensure commutative equality for sparse arrays. + if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break; + } + } + } else { + // Objects with different constructors are not equivalent. + if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false; + // Deep compare objects. + for (var key in a) { + if (_.has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break; + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (_.has(b, key) && !(size--)) break; + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + stack.pop(); + return result; + } + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType == 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) == '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + return obj === Object(obj); + }; + + // Is a given variable an arguments object? + _.isArguments = function(obj) { + return toString.call(obj) == '[object Arguments]'; + }; + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return !!(obj && _.has(obj, 'callee')); + }; + } + + // Is a given value a function? + _.isFunction = function(obj) { + return toString.call(obj) == '[object Function]'; + }; + + // Is a given value a string? + _.isString = function(obj) { + return toString.call(obj) == '[object String]'; + }; + + // Is a given value a number? + _.isNumber = function(obj) { + return toString.call(obj) == '[object Number]'; + }; + + // Is a given object a finite number? + _.isFinite = function(obj) { + return _.isNumber(obj) && isFinite(obj); + }; + + // Is the given value `NaN`? + _.isNaN = function(obj) { + // `NaN` is the only value for which `===` is not reflexive. + return obj !== obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + }; + + // Is a given value a date? + _.isDate = function(obj) { + return toString.call(obj) == '[object Date]'; + }; + + // Is the given value a regular expression? + _.isRegExp = function(obj) { + return toString.call(obj) == '[object RegExp]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Has own property? + _.has = function(obj, key) { + return hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iterators. + _.identity = function(value) { + return value; + }; + + // Run a function **n** times. + _.times = function (n, iterator, context) { + for (var i = 0; i < n; i++) iterator.call(context, i); + }; + + // Escape a string for HTML interpolation. + _.escape = function(string) { + return (''+string).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/'); + }; + + // If the value of the named property is a function then invoke it; + // otherwise, return it. + _.result = function(object, property) { + if (object == null) return null; + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; + }; + + // Add your own custom functions to the Underscore object, ensuring that + // they're correctly added to the OOP wrapper as well. + _.mixin = function(obj) { + each(_.functions(obj), function(name){ + addToWrapper(name, _[name] = obj[name]); + }); + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = idCounter++; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /.^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + '\\': '\\', + "'": "'", + 'r': '\r', + 'n': '\n', + 't': '\t', + 'u2028': '\u2028', + 'u2029': '\u2029' + }; + + for (var p in escapes) escapes[escapes[p]] = p; + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + var unescaper = /\\(\\|'|r|n|t|u2028|u2029)/g; + + // Within an interpolation, evaluation, or escaping, remove HTML escaping + // that had been previously added. + var unescape = function(code) { + return code.replace(unescaper, function(match, escape) { + return escapes[escape]; + }); + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + settings = _.defaults(settings || {}, _.templateSettings); + + // Compile the template source, taking care to escape characters that + // cannot be included in a string literal and then unescape them in code + // blocks. + var source = "__p+='" + text + .replace(escaper, function(match) { + return '\\' + escapes[match]; + }) + .replace(settings.escape || noMatch, function(match, code) { + return "'+\n_.escape(" + unescape(code) + ")+\n'"; + }) + .replace(settings.interpolate || noMatch, function(match, code) { + return "'+\n(" + unescape(code) + ")+\n'"; + }) + .replace(settings.evaluate || noMatch, function(match, code) { + return "';\n" + unescape(code) + "\n;__p+='"; + }) + "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __p='';" + + "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" + + source + "return __p;\n"; + + var render = new Function(settings.variable || 'obj', '_', source); + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for build time + // precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + + source + '}'; + + return template; + }; + + // Add a "chain" function, which will delegate to the wrapper. + _.chain = function(obj) { + return _(obj).chain(); + }; + + // The OOP Wrapper + // --------------- + + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + var wrapper = function(obj) { this._wrapped = obj; }; + + // Expose `wrapper.prototype` as `_.prototype` + _.prototype = wrapper.prototype; + + // Helper function to continue chaining intermediate results. + var result = function(obj, chain) { + return chain ? _(obj).chain() : obj; + }; + + // A method to easily add functions to the OOP wrapper. + var addToWrapper = function(name, func) { + wrapper.prototype[name] = function() { + var args = slice.call(arguments); + unshift.call(args, this._wrapped); + return result(func.apply(_, args), this._chain); + }; + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + wrapper.prototype[name] = function() { + var wrapped = this._wrapped; + method.apply(wrapped, arguments); + var length = wrapped.length; + if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0]; + return result(wrapped, this._chain); + }; + }); + + // Add all accessor Array functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + wrapper.prototype[name] = function() { + return result(method.apply(this._wrapped, arguments), this._chain); + }; + }); + + // Start chaining a wrapped Underscore object. + wrapper.prototype.chain = function() { + this._chain = true; + return this; + }; + + // Extracts the result from a wrapped and chained object. + wrapper.prototype.value = function() { + return this._wrapped; + }; + +}).call(this); diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 4f5b768f..2ce2f379 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -1,21 +1,21 @@ // jQuery libs // ----------- -// @include "inc/lib/jquery-1.7.2.min.js" -// @include "inc/lib/jquery.fracs-0.11.min.js" -// @include "inc/lib/jquery.mousewheel-3.0.6.js" -// @include "inc/lib/jquery.qrcode-0.2.min.js" -// @include "inc/lib/jquery.scrollpanel-0.1.min.js" +// @include "lib/jquery-1.7.2.min.js" +// @include "lib/jquery.fracs-0.11.min.js" +// @include "lib/jquery.mousewheel-3.0.6.js" +// @include "lib/jquery.qrcode-0.2.min.js" +// @include "lib/jquery.scrollpanel-0.1.min.js" // other libs // ---------- -// @include "inc/lib/underscore-1.3.1.min.js" -// @include "inc/lib/amplify-1.1.0.min.js" -// @include "inc/lib/modulejs-0.2.js" -// @include "inc/lib/moment-1.5.0.min.js" -// @include "inc/lib/json2.js" -// @include "inc/lib/base64.js" -// @include "inc/lib/spin-1.2.5.min.js" +// @include "lib/underscore-1.3.3.js" +// @include "lib/amplify-1.1.0.min.js" +// @include "lib/modulejs-0.2.js" +// @include "lib/moment-1.7.0.js" +// @include "lib/json2-2011.10.19.js" +// @include "lib/base64.js" +// @include "lib/spin-1.2.5.min.js" // h5ai // ---- From f5e7b10d946d0c543f5f4bacfe2faea3b9850da7 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 01:06:23 +0200 Subject: [PATCH 45/67] Refactores css. --- src/_h5ai/css/{inc => lib}/h5bp-norm.less | 3 +-- src/_h5ai/css/{inc => lib}/mixins.less | 0 src/_h5ai/css/styles.less | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/_h5ai/css/{inc => lib}/h5bp-norm.less (98%) rename src/_h5ai/css/{inc => lib}/mixins.less (100%) diff --git a/src/_h5ai/css/inc/h5bp-norm.less b/src/_h5ai/css/lib/h5bp-norm.less similarity index 98% rename from src/_h5ai/css/inc/h5bp-norm.less rename to src/_h5ai/css/lib/h5bp-norm.less index 5f8ff766..9c73992b 100644 --- a/src/_h5ai/css/inc/h5bp-norm.less +++ b/src/_h5ai/css/lib/h5bp-norm.less @@ -31,8 +31,7 @@ audio:not([controls]) { display: none; } * 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g */ -//html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } -html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } +html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { margin: 0; font-size: 13px; line-height: 1.231; } diff --git a/src/_h5ai/css/inc/mixins.less b/src/_h5ai/css/lib/mixins.less similarity index 100% rename from src/_h5ai/css/inc/mixins.less rename to src/_h5ai/css/lib/mixins.less diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index 4d16a23b..1f0da274 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -1,7 +1,8 @@ -@import "inc/h5bp-norm"; -@import "inc/mixins"; +@import "lib/h5bp-norm"; +@import "lib/mixins"; +html { overflow-y: auto; } ::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } ::selection { background: #68A9FF; color: #fff; text-shadow: none; } From 38011bd9a74f1e93c904a25afdbf7978ffda2010 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 11:46:12 +0200 Subject: [PATCH 46/67] Adds date format for 'el'. --- makefile.js | 2 +- src/_h5ai/config.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/makefile.js b/makefile.js index 4abdd38d..573b1975 100644 --- a/makefile.js +++ b/makefile.js @@ -7,7 +7,7 @@ var path = require('path'), moment = require('moment'); -var version = '0.21-dev-31', +var version = '0.21-dev-32', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 19c6e0d3..9b78b920 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -398,7 +398,8 @@ var H5AI_CONFIG = { "folders": "Φάκελοι", "files": "Αρχεία", "download": "Μεταμόρφωση", - "noMatch": "Κανένα Ταίριασμα" + "noMatch": "Κανένα Ταίριασμα", + "dateFormat": "DD/MM/YYYY HH:mm" }, "es": { From a3c68c61f8d702f441cc59d8fd02e3e5ad686405 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 11:55:32 +0200 Subject: [PATCH 47/67] Updates lang 'el' --- src/_h5ai/config.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 9b78b920..15b6ced6 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -388,17 +388,17 @@ var H5AI_CONFIG = { "el": { "lang": "ελληνικά", - "details": "Λεπτομέρειες", - "icons": "Εικονίδια", + "details": "λεπτομέρειες", + "icons": "εικονίδια", "name": "Όνομα", - "lastModified": "Τελευταία Τροποποίηση", + "lastModified": "Τελευταία τροποποίηση", "size": "Μέγεθος", "parentDirectory": "Προηγούμενος Κατάλογος", "empty": "κενό", - "folders": "Φάκελοι", - "files": "Αρχεία", - "download": "Μεταμόρφωση", - "noMatch": "Κανένα Ταίριασμα", + "folders": "φάκελοι", + "files": "αρχεία", + "download": "μεταμόρφωση", + "noMatch": "κανένα ταίριασμα", "dateFormat": "DD/MM/YYYY HH:mm" }, From ce75e45b03edecb63a4f3d546c7b8e2ef243888c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 12:35:04 +0200 Subject: [PATCH 48/67] Updates 'el'. --- src/_h5ai/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 15b6ced6..a249a859 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -398,7 +398,7 @@ var H5AI_CONFIG = { "folders": "φάκελοι", "files": "αρχεία", "download": "μεταμόρφωση", - "noMatch": "κανένα ταίριασμα", + "noMatch": "κανένα αποτέλεσμα", "dateFormat": "DD/MM/YYYY HH:mm" }, From 0ff3d900fea8dc827211fe040997a11b032ea9a2 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 15:09:04 +0200 Subject: [PATCH 49/67] Adds localization for filter placeholder. --- README.md | 1 + src/_h5ai/config.js | 6 ++++-- src/_h5ai/js/inc/core/langs.js | 3 ++- src/_h5ai/js/inc/ext/l10n.js | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8ff4a30c..a1e37087 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ It profits from these great projects: * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) * changes language code `gr` to `el` +* adds localization for filter placeholder * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) * updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2 * updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1 diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index a249a859..88e0efe3 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -341,7 +341,8 @@ var H5AI_CONFIG = { "files": "files", "download": "download", "noMatch": "no match", - "dateFormat": "YYYY-MM-DD HH:mm" + "dateFormat": "YYYY-MM-DD HH:mm", + "filter": "filter" }, "bg": { @@ -383,7 +384,8 @@ var H5AI_CONFIG = { "files": "Dateien", "download": "Download", "noMatch": "keine Treffer", - "dateFormat": "DD.MM.YYYY HH:mm" + "dateFormat": "DD.MM.YYYY HH:mm", + "filter": "Filter" }, "el": { diff --git a/src/_h5ai/js/inc/core/langs.js b/src/_h5ai/js/inc/core/langs.js index 21fc57fb..1c851f55 100644 --- a/src/_h5ai/js/inc/core/langs.js +++ b/src/_h5ai/js/inc/core/langs.js @@ -14,7 +14,8 @@ modulejs.define('core/langs', ['config', '_'], function (config, _) { files: 'files', download: 'download', noMatch: 'no match', - dateFormat: 'YYYY-MM-DD HH:mm' + dateFormat: 'YYYY-MM-DD HH:mm', + filter: 'filter' }, translations = {}, diff --git a/src/_h5ai/js/inc/ext/l10n.js b/src/_h5ai/js/inc/ext/l10n.js index daf7c3f0..c16e2b77 100644 --- a/src/_h5ai/js/inc/ext/l10n.js +++ b/src/_h5ai/js/inc/ext/l10n.js @@ -58,6 +58,8 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form $this.text(format.formatDate($this.data('time'))); }); + + $('#filter input').attr('placeholder', currentLang.filter); }, initLangSelector = function (langs) { From a6fdf653a102e5493c9a940fb2e97cd70d79be22 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 3 Aug 2012 17:09:48 +0200 Subject: [PATCH 50/67] Updates makefile. --- makefile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile.js b/makefile.js index 573b1975..115c3cce 100644 --- a/makefile.js +++ b/makefile.js @@ -7,7 +7,7 @@ var path = require('path'), moment = require('moment'); -var version = '0.21-dev-32', +var version = '0.21-dev-33', root = path.resolve(__dirname), src = path.join(root, 'src'), @@ -116,7 +116,7 @@ module.exports = function (make, $) { .cssmin() .write($.OVERWRITE, mapper); - $(src + ': **, **/*/.*, ! _h5ai/js/**, ! _h5ai/css/**') + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') .modified(mapper) .mustache(replacements) .write($.OVERWRITE, mapper); @@ -142,7 +142,7 @@ module.exports = function (make, $) { // .cssmin() .write($.OVERWRITE, mapper); - $(src + ': **, **/*/.*, ! _h5ai/js/**, ! _h5ai/css/**') + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') .modified(mapper) .mustache(replacements) .write($.OVERWRITE, mapper); From 2bcf6593a98793ddac4c55534b330c5bdbc5c21d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 4 Aug 2012 01:10:44 +0200 Subject: [PATCH 51/67] Adds keyboard support to image preview. --- makefile.js | 2 +- src/_h5ai/js/inc/ext/preview-img.js | 109 +++++++++++++++++++--------- 2 files changed, 74 insertions(+), 37 deletions(-) diff --git a/makefile.js b/makefile.js index 115c3cce..d90f48be 100644 --- a/makefile.js +++ b/makefile.js @@ -7,7 +7,7 @@ var path = require('path'), moment = require('moment'); -var version = '0.21-dev-33', +var version = '0.21-dev-34', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 48300411..ed6b4877 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -60,7 +60,6 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', rect = $img.fracs('rect'); if (!rect) { - // console.log('RECT FAILED!'); return; } rect = rect.relativeTo($('#preview-overlay').fracs('rect')); @@ -79,7 +78,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', }); }, - preload = function (src, callback) { + preloadImg = function (src, callback) { var $hidden = $('
') .css({ @@ -102,9 +101,8 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', .attr('src', src); }, - showImg = function (entries, idx) { + onIndexChange = function (idx) { - currentEntries = entries; currentIdx = (idx + currentEntries.length) % currentEntries.length; var $container = $('#preview-content'), @@ -124,7 +122,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $('#preview-overlay').stop(true, true).fadeIn(200); $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); - preload(src, function (width, height) { + preloadImg(src, function (width, height) { clearTimeout(spinnerTimeout); $container.spin(false); @@ -132,18 +130,76 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $img.fadeOut(100, function () { $img.attr('src', src).fadeIn(200); - setTimeout(adjustSize, 1); + + // small timeout, so $img is visible + setTimeout(function () { + adjustSize(); + $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); + }, 1); }); $('#preview-bar-label').text(currentEntries[currentIdx].label); - $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); + $('#preview-bar-percent').text('···%'); $('#preview-bar-size').text('' + width + 'x' + height); $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); $('#preview-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); }); }, - checkEntry = function (entry) { + onEnter = function (entries, idx) { + + $(window).on('keydown', onKeydown); + currentEntries = entries; + onIndexChange(idx); + }, + + onNext = function () { + + onIndexChange(currentIdx + 1); + }, + + onPrevious = function () { + + onIndexChange(currentIdx - 1); + }, + + onExit = function () { + + $(window).off('keydown', onKeydown); + $('#preview-overlay').stop(true, true).fadeOut(200); + }, + + onFullscreen = function () { + + isFullscreen = !isFullscreen; + store.put(storekey, isFullscreen); + + adjustSize(); + + if (isFullscreen) { + $('#preview-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen')); + $('#preview-bottombar').fadeOut(400); + } else { + $('#preview-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen')); + $('#preview-bottombar').fadeIn(200); + } + }, + + onKeydown = function (event) { + + var key = event.which; + if (key === 27) { // esc + onExit(); + } else if (key === 37 || key === 40) { // left, down + onPrevious(); + } else if (key === 38 || key === 39) { // up, right + onNext(); + } else if (key === 70) { // f + onFullscreen(); + } + }, + + initEntry = function (entry) { if (entry.$extended && $.inArray(entry.type, settings.types) >= 0) { @@ -160,7 +216,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', return _.indexOf(settings.types, entry.type) >= 0; }); - showImg(entries, _.indexOf(entries, entry)); + onEnter(entries, _.indexOf(entries, entry)); }); } }, @@ -173,60 +229,41 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $(template).appendTo('body'); - _.each(entry.content, checkEntry); + _.each(entry.content, initEntry); + + $('#preview-bar-prev, #preview-prev').on('click', onPrevious); + $('#preview-bar-next, #preview-next').on('click', onNext); + $('#preview-bar-close, #preview-close').on('click', onExit); + $('#preview-bar-fullscreen').on('click', onFullscreen); + $('#preview-overlay').on('keydown', onKeydown); - $('#preview-bar-prev, #preview-prev').on('click', function (event) { - // event.stopPropagation(); - showImg(currentEntries, currentIdx - 1); - }); $('#preview-prev') .on('mouseenter', function (event) { - // event.stopPropagation(); $('#preview-bar-prev').addClass('hover'); }) .on('mouseleave', function (event) { - // event.stopPropagation(); $('#preview-bar-prev').removeClass('hover'); }); - $('#preview-bar-next, #preview-next').on('click', function (event) { - // event.stopPropagation(); - showImg(currentEntries, currentIdx + 1); - }); $('#preview-next') .on('mouseenter', function (event) { - // event.stopPropagation(); $('#preview-bar-next').addClass('hover'); }) .on('mouseleave', function (event) { - // event.stopPropagation(); $('#preview-bar-next').removeClass('hover'); }); - $('#preview-bar-close, #preview-close').on('click', function () { - // event.stopPropagation(); - $('#preview-overlay').stop(true, true).fadeOut(200); - }); $('#preview-close') .on('mouseenter', function (event) { - // event.stopPropagation(); $('#preview-bar-close').addClass('hover'); }) .on('mouseleave', function (event) { - // event.stopPropagation(); $('#preview-bar-close').removeClass('hover'); }); - $('#preview-bar-fullscreen').on('click', function (event) { - // event.stopPropagation(); - isFullscreen = !isFullscreen; - store.put(storekey, isFullscreen); - $('#preview-bar-fullscreen').find('img').attr('src', isFullscreen ? resource.image('preview/no-fullscreen') : resource.image('preview/fullscreen')); - adjustSize(); - }); $('#preview-overlay') - .on('mousedown', function (event) { + .on('click mousedown mousemove keydown keypress', function (event) { event.stopPropagation(); }) From 974392d2eba9fcb3a9868dc33c3703c08dd32b8c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 4 Aug 2012 15:41:42 +0200 Subject: [PATCH 52/67] Cleans preview-img code. --- README.md | 1 + src/_h5ai/js/inc/ext/preview-img.js | 79 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index a1e37087..6d906196 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ It profits from these great projects: * fixes duplicate tree entries and empty main views * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) +* adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc) * changes language code `gr` to `el` * adds localization for filter placeholder * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index ed6b4877..0a877f82 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -65,16 +65,16 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', rect = rect.relativeTo($('#preview-overlay').fracs('rect')); $('#preview-prev').css({ - 'left': rect.left, - 'top': rect.top, - 'width': rect.width / 2, - 'height': rect.height + left: rect.left, + top: rect.top, + width: rect.width / 2, + height: rect.height }); $('#preview-next').css({ - 'left': rect.left + rect.width / 2, - 'top': rect.top, - 'width': rect.width / 2, - 'height': rect.height + left: rect.left + rect.width / 2, + top: rect.top, + width: rect.width / 2, + height: rect.height }); }, @@ -97,6 +97,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $hidden.remove(); callback(width, height); + // setTimeout(function () { callback(width, height); }, 1000); // for testing }) .attr('src', src); }, @@ -119,9 +120,6 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', }); }, 200); - $('#preview-overlay').stop(true, true).fadeIn(200); - $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); - preloadImg(src, function (width, height) { clearTimeout(spinnerTimeout); @@ -135,20 +133,21 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', setTimeout(function () { adjustSize(); $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); + $('#preview-bar-label').text(currentEntries[currentIdx].label); + $('#preview-bar-size').text('' + width + 'x' + height); + $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); + $('#preview-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); }, 1); }); - $('#preview-bar-label').text(currentEntries[currentIdx].label); - $('#preview-bar-percent').text('···%'); - $('#preview-bar-size').text('' + width + 'x' + height); - $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); - $('#preview-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); }); }, onEnter = function (entries, idx) { $(window).on('keydown', onKeydown); + $('#preview-overlay').stop(true, true).fadeIn(200); + currentEntries = entries; onIndexChange(idx); }, @@ -188,35 +187,25 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', onKeydown = function (event) { var key = event.which; + if (key === 27) { // esc onExit(); - } else if (key === 37 || key === 40) { // left, down + } else if (key === 8 || key === 37 || key === 40) { // backspace, left, down onPrevious(); - } else if (key === 38 || key === 39) { // up, right + } else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right onNext(); } else if (key === 70) { // f onFullscreen(); } }, - initEntry = function (entry) { + initEntry = function (entries, entry, idx) { - if (entry.$extended && $.inArray(entry.type, settings.types) >= 0) { - - var $a = entry.$extended.find('a'); - $a.on('click', function (event) { + if (entry.$extended) { + entry.$extended.find('a').on('click', function (event) { event.preventDefault(); - - var entries = _.filter(_.map($('#extended .entry'), function (entry) { - - return $(entry).data('entry'); - }), function (entry) { - - return _.indexOf(settings.types, entry.type) >= 0; - }); - - onEnter(entries, _.indexOf(entries, entry)); + onEnter(entries, idx); }); } }, @@ -227,10 +216,16 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', return; } + var imageEntries = _.filter(entry.content, function (entry) { + + return _.indexOf(settings.types, entry.type) >= 0; + }); + _.each(imageEntries, function (e, idx) { + + initEntry(imageEntries, e, idx); + }); + $(template).appendTo('body'); - - _.each(entry.content, initEntry); - $('#preview-bar-prev, #preview-prev').on('click', onPrevious); $('#preview-bar-next, #preview-next').on('click', onNext); $('#preview-bar-close, #preview-close').on('click', onExit); @@ -238,26 +233,26 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $('#preview-overlay').on('keydown', onKeydown); $('#preview-prev') - .on('mouseenter', function (event) { + .on('mouseenter', function () { $('#preview-bar-prev').addClass('hover'); }) - .on('mouseleave', function (event) { + .on('mouseleave', function () { $('#preview-bar-prev').removeClass('hover'); }); $('#preview-next') - .on('mouseenter', function (event) { + .on('mouseenter', function () { $('#preview-bar-next').addClass('hover'); }) - .on('mouseleave', function (event) { + .on('mouseleave', function () { $('#preview-bar-next').removeClass('hover'); }); $('#preview-close') - .on('mouseenter', function (event) { + .on('mouseenter', function () { $('#preview-bar-close').addClass('hover'); }) - .on('mouseleave', function (event) { + .on('mouseleave', function () { $('#preview-bar-close').removeClass('hover'); }); From 90b0b97e22fce2f84835af4e31eaadaee12d7fd7 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 4 Aug 2012 21:47:22 +0200 Subject: [PATCH 53/67] Adds text file preview and highlighting. --- README.md | 2 + makefile.js | 2 +- src/_h5ai/config.js | 20 ++ .../inc/{preview.less => preview-img.less} | 36 +- src/_h5ai/css/inc/preview-txt.less | 127 +++++++ src/_h5ai/css/lib/sh/shCore.less | 226 ++++++++++++ src/_h5ai/css/lib/sh/shCoreDefault.less | 328 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreDjango.less | 331 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreEclipse.less | 339 ++++++++++++++++++ src/_h5ai/css/lib/sh/shCoreEmacs.less | 324 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreFadeToGrey.less | 328 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreMDUltra.less | 324 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreMidnight.less | 324 +++++++++++++++++ src/_h5ai/css/lib/sh/shCoreRDark.less | 324 +++++++++++++++++ src/_h5ai/css/lib/sh/shThemeDefault.less | 117 ++++++ src/_h5ai/css/lib/sh/shThemeDjango.less | 120 +++++++ src/_h5ai/css/lib/sh/shThemeEclipse.less | 128 +++++++ src/_h5ai/css/lib/sh/shThemeEmacs.less | 113 ++++++ src/_h5ai/css/lib/sh/shThemeFadeToGrey.less | 117 ++++++ src/_h5ai/css/lib/sh/shThemeMDUltra.less | 113 ++++++ src/_h5ai/css/lib/sh/shThemeMidnight.less | 113 ++++++ src/_h5ai/css/lib/sh/shThemeRDark.less | 113 ++++++ src/_h5ai/css/styles.less | 5 +- src/_h5ai/images/preview/image.png | Bin 589 -> 0 bytes src/_h5ai/images/preview/raw.png | Bin 0 -> 597 bytes src/_h5ai/js/inc/ext/preview-img.js | 108 +++--- src/_h5ai/js/inc/ext/preview-txt.js | 198 ++++++++++ src/_h5ai/js/inc/main.js | 4 +- src/_h5ai/js/lib/sh/shAutoloader.js | 17 + src/_h5ai/js/lib/sh/shBrushAS3.js | 59 +++ src/_h5ai/js/lib/sh/shBrushAppleScript.js | 75 ++++ src/_h5ai/js/lib/sh/shBrushBash.js | 59 +++ src/_h5ai/js/lib/sh/shBrushCSharp.js | 65 ++++ src/_h5ai/js/lib/sh/shBrushColdFusion.js | 100 ++++++ src/_h5ai/js/lib/sh/shBrushCpp.js | 97 +++++ src/_h5ai/js/lib/sh/shBrushCss.js | 91 +++++ src/_h5ai/js/lib/sh/shBrushDelphi.js | 55 +++ src/_h5ai/js/lib/sh/shBrushDiff.js | 41 +++ src/_h5ai/js/lib/sh/shBrushErlang.js | 52 +++ src/_h5ai/js/lib/sh/shBrushGroovy.js | 67 ++++ src/_h5ai/js/lib/sh/shBrushJScript.js | 52 +++ src/_h5ai/js/lib/sh/shBrushJava.js | 57 +++ src/_h5ai/js/lib/sh/shBrushJavaFX.js | 58 +++ src/_h5ai/js/lib/sh/shBrushPerl.js | 72 ++++ src/_h5ai/js/lib/sh/shBrushPhp.js | 88 +++++ src/_h5ai/js/lib/sh/shBrushPlain.js | 33 ++ src/_h5ai/js/lib/sh/shBrushPowerShell.js | 74 ++++ src/_h5ai/js/lib/sh/shBrushPython.js | 64 ++++ src/_h5ai/js/lib/sh/shBrushRuby.js | 55 +++ src/_h5ai/js/lib/sh/shBrushSass.js | 94 +++++ src/_h5ai/js/lib/sh/shBrushScala.js | 51 +++ src/_h5ai/js/lib/sh/shBrushSql.js | 66 ++++ src/_h5ai/js/lib/sh/shBrushVb.js | 56 +++ src/_h5ai/js/lib/sh/shBrushXml.js | 69 ++++ src/_h5ai/js/lib/sh/shCore.js | 17 + src/_h5ai/js/lib/sh/shLegacy.js | 17 + src/_h5ai/js/scripts.js | 17 + 57 files changed, 5924 insertions(+), 78 deletions(-) rename src/_h5ai/css/inc/{preview.less => preview-img.less} (81%) create mode 100644 src/_h5ai/css/inc/preview-txt.less create mode 100644 src/_h5ai/css/lib/sh/shCore.less create mode 100644 src/_h5ai/css/lib/sh/shCoreDefault.less create mode 100644 src/_h5ai/css/lib/sh/shCoreDjango.less create mode 100644 src/_h5ai/css/lib/sh/shCoreEclipse.less create mode 100644 src/_h5ai/css/lib/sh/shCoreEmacs.less create mode 100644 src/_h5ai/css/lib/sh/shCoreFadeToGrey.less create mode 100644 src/_h5ai/css/lib/sh/shCoreMDUltra.less create mode 100644 src/_h5ai/css/lib/sh/shCoreMidnight.less create mode 100644 src/_h5ai/css/lib/sh/shCoreRDark.less create mode 100644 src/_h5ai/css/lib/sh/shThemeDefault.less create mode 100644 src/_h5ai/css/lib/sh/shThemeDjango.less create mode 100644 src/_h5ai/css/lib/sh/shThemeEclipse.less create mode 100644 src/_h5ai/css/lib/sh/shThemeEmacs.less create mode 100644 src/_h5ai/css/lib/sh/shThemeFadeToGrey.less create mode 100755 src/_h5ai/css/lib/sh/shThemeMDUltra.less create mode 100644 src/_h5ai/css/lib/sh/shThemeMidnight.less create mode 100644 src/_h5ai/css/lib/sh/shThemeRDark.less delete mode 100644 src/_h5ai/images/preview/image.png create mode 100644 src/_h5ai/images/preview/raw.png create mode 100644 src/_h5ai/js/inc/ext/preview-txt.js create mode 100644 src/_h5ai/js/lib/sh/shAutoloader.js create mode 100644 src/_h5ai/js/lib/sh/shBrushAS3.js create mode 100644 src/_h5ai/js/lib/sh/shBrushAppleScript.js create mode 100644 src/_h5ai/js/lib/sh/shBrushBash.js create mode 100644 src/_h5ai/js/lib/sh/shBrushCSharp.js create mode 100644 src/_h5ai/js/lib/sh/shBrushColdFusion.js create mode 100644 src/_h5ai/js/lib/sh/shBrushCpp.js create mode 100644 src/_h5ai/js/lib/sh/shBrushCss.js create mode 100644 src/_h5ai/js/lib/sh/shBrushDelphi.js create mode 100644 src/_h5ai/js/lib/sh/shBrushDiff.js create mode 100644 src/_h5ai/js/lib/sh/shBrushErlang.js create mode 100644 src/_h5ai/js/lib/sh/shBrushGroovy.js create mode 100644 src/_h5ai/js/lib/sh/shBrushJScript.js create mode 100644 src/_h5ai/js/lib/sh/shBrushJava.js create mode 100644 src/_h5ai/js/lib/sh/shBrushJavaFX.js create mode 100644 src/_h5ai/js/lib/sh/shBrushPerl.js create mode 100644 src/_h5ai/js/lib/sh/shBrushPhp.js create mode 100644 src/_h5ai/js/lib/sh/shBrushPlain.js create mode 100644 src/_h5ai/js/lib/sh/shBrushPowerShell.js create mode 100644 src/_h5ai/js/lib/sh/shBrushPython.js create mode 100644 src/_h5ai/js/lib/sh/shBrushRuby.js create mode 100644 src/_h5ai/js/lib/sh/shBrushSass.js create mode 100644 src/_h5ai/js/lib/sh/shBrushScala.js create mode 100644 src/_h5ai/js/lib/sh/shBrushSql.js create mode 100644 src/_h5ai/js/lib/sh/shBrushVb.js create mode 100644 src/_h5ai/js/lib/sh/shBrushXml.js create mode 100644 src/_h5ai/js/lib/sh/shCore.js create mode 100644 src/_h5ai/js/lib/sh/shLegacy.js diff --git a/README.md b/README.md index 6d906196..382a410a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ It profits from these great projects: [Modernizr](http://www.modernizr.com) (MIT/BSD), [modulejs](http://larsjung.de/modulejs/) (MIT), [Moment.js](http://momentjs.com) (MIT), +[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL), [Underscore.js](http://underscorejs.org) (MIT) @@ -37,6 +38,7 @@ It profits from these great projects: * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) * adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc) +* adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (keys: left, right, esc) * changes language code `gr` to `el` * adds localization for filter placeholder * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) diff --git a/makefile.js b/makefile.js index d90f48be..eff91e22 100644 --- a/makefile.js +++ b/makefile.js @@ -7,7 +7,7 @@ var path = require('path'), moment = require('moment'); -var version = '0.21-dev-34', +var version = '0.21-dev-37', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 88e0efe3..cb7e6962 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -178,6 +178,26 @@ var H5AI_CONFIG = { "types": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"] }, + /* + * Show text file preview on click. + * "types" maps file types to SyntaxHighligher brushes. + * + * For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ + */ + "preview-txt": { + "enabled": true, + "types": { + "authors": "plain", + "copying": "plain", + "css": "css", + "install": "plain", + "readme": "plain", + "script": "shell", + "text": "plain", + "js": "js" + } + }, + /* * Show QRCodes on hovering files. */ diff --git a/src/_h5ai/css/inc/preview.less b/src/_h5ai/css/inc/preview-img.less similarity index 81% rename from src/_h5ai/css/inc/preview.less rename to src/_h5ai/css/inc/preview-img.less index 76c0a198..ce670329 100644 --- a/src/_h5ai/css/inc/preview.less +++ b/src/_h5ai/css/inc/preview-img.less @@ -1,5 +1,5 @@ -#preview-overlay { +#pv-img-overlay { display: none; position: fixed; left: 0; @@ -8,43 +8,40 @@ bottom: 0; z-index: 100; - background-color: #111; + // background-color: #111; + background-color: rgba(0,0,0,0.9); text-align: center; } -#preview-content { +#pv-img-content { position: fixed; - #preview-img { - max-width: 100%; - max-height: 100%; - } - #preview-mov { - max-width: 100%; - max-height: 100%; - } } -#preview-close { +#pv-img-image { + max-width: 100%; + max-height: 100%; +} + +#pv-img-close { position: fixed; width: 100%; height: 100%; cursor: pointer; } -#preview-prev { +#pv-img-prev { position: fixed; cursor: pointer; } -#preview-next { +#pv-img-next { position: fixed; cursor: pointer; } - -#preview-buttons, #preview-topbuttons { +#pv-img-buttons, #pv-img-topbuttons { list-style: none; list-style-image: none; margin: 0; @@ -101,9 +98,7 @@ } } - - -#preview-topbar { +#pv-img-topbar { position: fixed; z-index: 5; width: 100%; @@ -113,8 +108,7 @@ border-bottom: 1px solid rgb(27,27,27); } - -#preview-bottombar { +#pv-img-bottombar { position: fixed; z-index: 5; width: 100%; diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less new file mode 100644 index 00000000..381f190b --- /dev/null +++ b/src/_h5ai/css/inc/preview-txt.less @@ -0,0 +1,127 @@ + +#pv-txt-overlay { + display: none; + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 100; + + background-color: rgba(0,0,0,0.9); + + text-align: center; +} + +#pv-txt-content { + max-width: 960px; + margin: 0 auto; + padding: 10px; + background-color: #fff; + border: 2px solid rgba(0,0,0,0.5); + text-align: left; + overflow: auto; + position: relative; +} + +#pv-txt-text { + .syntaxhighlighter { + overflow: visible !important; + } +} + +#pv-txt-close { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + cursor: pointer; +} + +#pv-txt-prev { + position: fixed; + cursor: pointer; +} + +#pv-txt-next { + position: fixed; + cursor: pointer; +} + +#pv-txt-buttons, #pv-txt-topbuttons { + list-style: none; + list-style-image: none; + margin: 0; + padding: 0; + + img { + position: relative; + top: -2px; + width: 16px; + height: 16px; + } + img + span, img + input { + margin-left: 6px; + } + input { + background-color: rgba(255,255,255,0.1); + border: none; + color: #ccc; + } + + .bar-label { + display: block; + color: #ccc; + height: 30px; + line-height: 30px; + padding: 0 10px; + opacity: 0.7; + .transition(all 0.2s ease-in-out); + } + + .bar-highlight { + background-color: rgba(255,255,255,0.1); + opacity: 1.0; + } + + @bar-sep-border: 1px solid rgba(255,255,255,0.05); + + .bar-button { + .bar-label; + cursor: pointer; + &:hover, &.hover { + .bar-highlight; + } + } + + .bar-left { + float: left; + border-right: @bar-sep-border; + } + + .bar-right { + float: right; + border-left: @bar-sep-border; + } +} + +#pv-txt-topbar { + position: fixed; + z-index: 5; + width: 100%; + left: 0; + top: 0; + .vert-gradient(rgb(37,37,37), rgb(24,24,24)); + border-bottom: 1px solid rgb(27,27,27); +} + +#pv-txt-bottombar { + position: fixed; + z-index: 5; + width: 100%; + left: 0; + bottom: 0; + .vert-gradient(rgb(27,27,27), rgb(14,14,14)); + border-top: 1px solid rgb(45,45,45); +} diff --git a/src/_h5ai/css/lib/sh/shCore.less b/src/_h5ai/css/lib/sh/shCore.less new file mode 100644 index 00000000..34f6864a --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCore.less @@ -0,0 +1,226 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreDefault.less b/src/_h5ai/css/lib/sh/shCoreDefault.less new file mode 100644 index 00000000..08f9e10e --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreDefault.less @@ -0,0 +1,328 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: white !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #e0e0e0 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: black !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #6ce26c !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #6ce26c !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: blue !important; + background: white !important; + border: 1px solid #6ce26c !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: blue !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #6ce26c !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: black !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #008200 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: blue !important; +} +.syntaxhighlighter .keyword { + color: #006699 !important; +} +.syntaxhighlighter .preprocessor { + color: gray !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #006699 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreDjango.less b/src/_h5ai/css/lib/sh/shCoreDjango.less new file mode 100644 index 00000000..1db1f70c --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreDjango.less @@ -0,0 +1,331 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #233729 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: #f8f8f8 !important; +} +.syntaxhighlighter .gutter { + color: #497958 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #41a83e !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #41a83e !important; + color: #0a2b1d !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #96dd3b !important; + background: black !important; + border: 1px solid #41a83e !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #96dd3b !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: white !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #41a83e !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #ffe862 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #f8f8f8 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #336442 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #9df39f !important; +} +.syntaxhighlighter .keyword { + color: #96dd3b !important; +} +.syntaxhighlighter .preprocessor { + color: #91bb9e !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #96dd3b !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #eb939a !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #91bb9e !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #edef7d !important; +} + +.syntaxhighlighter .comments { + font-style: italic !important; +} +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreEclipse.less b/src/_h5ai/css/lib/sh/shCoreEclipse.less new file mode 100644 index 00000000..a45de9fd --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreEclipse.less @@ -0,0 +1,339 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: white !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #c3defe !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #787878 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #d4d0c8 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #d4d0c8 !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #3f5fbf !important; + background: white !important; + border: 1px solid #d4d0c8 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #3f5fbf !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #aa7700 !important; +} +.syntaxhighlighter .toolbar { + color: #a0a0a0 !important; + background: #d4d0c8 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #a0a0a0 !important; +} +.syntaxhighlighter .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #3f5fbf !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #2a00ff !important; +} +.syntaxhighlighter .keyword { + color: #7f0055 !important; +} +.syntaxhighlighter .preprocessor { + color: #646464 !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #7f0055 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} +.syntaxhighlighter .xml .keyword { + color: #3f7f7f !important; + font-weight: normal !important; +} +.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { + color: #7f007f !important; +} +.syntaxhighlighter .xml .string { + font-style: italic !important; + color: #2a00ff !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreEmacs.less b/src/_h5ai/css/lib/sh/shCoreEmacs.less new file mode 100644 index 00000000..706c77a0 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreEmacs.less @@ -0,0 +1,324 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: black !important; +} +.syntaxhighlighter .line.alt1 { + background-color: black !important; +} +.syntaxhighlighter .line.alt2 { + background-color: black !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #2a3133 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: #d3d3d3 !important; +} +.syntaxhighlighter .gutter { + color: #d3d3d3 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #990000 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #990000 !important; + color: black !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #ebdb8d !important; + background: black !important; + border: 1px solid #990000 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #ebdb8d !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #ff7d27 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #990000 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #9ccff4 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #d3d3d3 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #ff7d27 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #ff9e7b !important; +} +.syntaxhighlighter .keyword { + color: aqua !important; +} +.syntaxhighlighter .preprocessor { + color: #aec4de !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #81cef9 !important; +} +.syntaxhighlighter .constants { + color: #ff9e7b !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: aqua !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #ebdb8d !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff7d27 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #aec4de !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less b/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less new file mode 100644 index 00000000..6101eba5 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less @@ -0,0 +1,328 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: #121212 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #121212 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #121212 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #2c2c29 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: white !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #3185b9 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #3185b9 !important; + color: #121212 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #3185b9 !important; + background: black !important; + border: 1px solid #3185b9 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #3185b9 !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #d01d33 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #3185b9 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #96daff !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: white !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #696854 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #e3e658 !important; +} +.syntaxhighlighter .keyword { + color: #d01d33 !important; +} +.syntaxhighlighter .preprocessor { + color: #435a5f !important; +} +.syntaxhighlighter .variable { + color: #898989 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #aaaaaa !important; +} +.syntaxhighlighter .constants { + color: #96daff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #d01d33 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #ffc074 !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #4a8cdb !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #96daff !important; +} + +.syntaxhighlighter .functions { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreMDUltra.less b/src/_h5ai/css/lib/sh/shCoreMDUltra.less new file mode 100644 index 00000000..2923ce73 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreMDUltra.less @@ -0,0 +1,324 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: #222222 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #222222 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #222222 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #253e5a !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: lime !important; +} +.syntaxhighlighter .gutter { + color: #38566f !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #222222 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #428bdd !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #428bdd !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: lime !important; +} +.syntaxhighlighter .toolbar { + color: #aaaaff !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #aaaaff !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #9ccff4 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: lime !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #428bdd !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: lime !important; +} +.syntaxhighlighter .keyword { + color: #aaaaff !important; +} +.syntaxhighlighter .preprocessor { + color: #8aa6c1 !important; +} +.syntaxhighlighter .variable { + color: aqua !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ff8000 !important; +} +.syntaxhighlighter .constants { + color: yellow !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #aaaaff !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: red !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: yellow !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreMidnight.less b/src/_h5ai/css/lib/sh/shCoreMidnight.less new file mode 100644 index 00000000..e3733eed --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreMidnight.less @@ -0,0 +1,324 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #253e5a !important; +} +.syntaxhighlighter .line.highlighted.number { + color: #38566f !important; +} +.syntaxhighlighter table caption { + color: #d1edff !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #0f192a !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #428bdd !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #428bdd !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #1dc116 !important; +} +.syntaxhighlighter .toolbar { + color: #d1edff !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #d1edff !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #8aa6c1 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #d1edff !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #428bdd !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #1dc116 !important; +} +.syntaxhighlighter .keyword { + color: #b43d3d !important; +} +.syntaxhighlighter .preprocessor { + color: #8aa6c1 !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #b43d3d !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #f8bb00 !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: white !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/lib/sh/shCoreRDark.less b/src/_h5ai/css/lib/sh/shCoreRDark.less new file mode 100644 index 00000000..d0936838 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shCoreRDark.less @@ -0,0 +1,324 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + position: relative !important; + overflow: auto !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} + +.syntaxhighlighter { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #323e41 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: #b9bdb6 !important; +} +.syntaxhighlighter table caption { + color: #b9bdb6 !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #1b2426 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #5ba1cf !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #5ba1cf !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #5ce638 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #e0e8ff !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #b9bdb6 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #878a85 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #5ce638 !important; +} +.syntaxhighlighter .keyword { + color: #5ba1cf !important; +} +.syntaxhighlighter .preprocessor { + color: #435a5f !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #5ba1cf !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #e0e8ff !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: white !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeDefault.less b/src/_h5ai/css/lib/sh/shThemeDefault.less new file mode 100644 index 00000000..13654117 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeDefault.less @@ -0,0 +1,117 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: white !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #e0e0e0 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: black !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #6ce26c !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #6ce26c !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: blue !important; + background: white !important; + border: 1px solid #6ce26c !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: blue !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #6ce26c !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: black !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #008200 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: blue !important; +} +.syntaxhighlighter .keyword { + color: #006699 !important; +} +.syntaxhighlighter .preprocessor { + color: gray !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #006699 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeDjango.less b/src/_h5ai/css/lib/sh/shThemeDjango.less new file mode 100644 index 00000000..d8b43134 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeDjango.less @@ -0,0 +1,120 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #0a2b1d !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #233729 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: #f8f8f8 !important; +} +.syntaxhighlighter .gutter { + color: #497958 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #41a83e !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #41a83e !important; + color: #0a2b1d !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #96dd3b !important; + background: black !important; + border: 1px solid #41a83e !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #96dd3b !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: white !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #41a83e !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #ffe862 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #f8f8f8 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #336442 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #9df39f !important; +} +.syntaxhighlighter .keyword { + color: #96dd3b !important; +} +.syntaxhighlighter .preprocessor { + color: #91bb9e !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #96dd3b !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #eb939a !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #91bb9e !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #edef7d !important; +} + +.syntaxhighlighter .comments { + font-style: italic !important; +} +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeEclipse.less b/src/_h5ai/css/lib/sh/shThemeEclipse.less new file mode 100644 index 00000000..77377d95 --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeEclipse.less @@ -0,0 +1,128 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: white !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #c3defe !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #787878 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #d4d0c8 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #d4d0c8 !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #3f5fbf !important; + background: white !important; + border: 1px solid #d4d0c8 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #3f5fbf !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #aa7700 !important; +} +.syntaxhighlighter .toolbar { + color: #a0a0a0 !important; + background: #d4d0c8 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #a0a0a0 !important; +} +.syntaxhighlighter .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #3f5fbf !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #2a00ff !important; +} +.syntaxhighlighter .keyword { + color: #7f0055 !important; +} +.syntaxhighlighter .preprocessor { + color: #646464 !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #7f0055 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} +.syntaxhighlighter .xml .keyword { + color: #3f7f7f !important; + font-weight: normal !important; +} +.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { + color: #7f007f !important; +} +.syntaxhighlighter .xml .string { + font-style: italic !important; + color: #2a00ff !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeEmacs.less b/src/_h5ai/css/lib/sh/shThemeEmacs.less new file mode 100644 index 00000000..dae5053f --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeEmacs.less @@ -0,0 +1,113 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: black !important; +} +.syntaxhighlighter .line.alt1 { + background-color: black !important; +} +.syntaxhighlighter .line.alt2 { + background-color: black !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #2a3133 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: #d3d3d3 !important; +} +.syntaxhighlighter .gutter { + color: #d3d3d3 !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #990000 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #990000 !important; + color: black !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #ebdb8d !important; + background: black !important; + border: 1px solid #990000 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #ebdb8d !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #ff7d27 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #990000 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #9ccff4 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #d3d3d3 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #ff7d27 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #ff9e7b !important; +} +.syntaxhighlighter .keyword { + color: aqua !important; +} +.syntaxhighlighter .preprocessor { + color: #aec4de !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #81cef9 !important; +} +.syntaxhighlighter .constants { + color: #ff9e7b !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: aqua !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #ebdb8d !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff7d27 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #aec4de !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeFadeToGrey.less b/src/_h5ai/css/lib/sh/shThemeFadeToGrey.less new file mode 100644 index 00000000..8fbd871f --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeFadeToGrey.less @@ -0,0 +1,117 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: #121212 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #121212 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #121212 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #2c2c29 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: white !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #3185b9 !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #3185b9 !important; + color: #121212 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #3185b9 !important; + background: black !important; + border: 1px solid #3185b9 !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #3185b9 !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #d01d33 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #3185b9 !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #96daff !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: white !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #696854 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #e3e658 !important; +} +.syntaxhighlighter .keyword { + color: #d01d33 !important; +} +.syntaxhighlighter .preprocessor { + color: #435a5f !important; +} +.syntaxhighlighter .variable { + color: #898989 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #aaaaaa !important; +} +.syntaxhighlighter .constants { + color: #96daff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #d01d33 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #ffc074 !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #4a8cdb !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #96daff !important; +} + +.syntaxhighlighter .functions { + font-weight: bold !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeMDUltra.less b/src/_h5ai/css/lib/sh/shThemeMDUltra.less new file mode 100755 index 00000000..f4db39cd --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeMDUltra.less @@ -0,0 +1,113 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: #222222 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #222222 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #222222 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #253e5a !important; +} +.syntaxhighlighter .line.highlighted.number { + color: white !important; +} +.syntaxhighlighter table caption { + color: lime !important; +} +.syntaxhighlighter .gutter { + color: #38566f !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #222222 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #428bdd !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #428bdd !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: lime !important; +} +.syntaxhighlighter .toolbar { + color: #aaaaff !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #aaaaff !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #9ccff4 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: lime !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #428bdd !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: lime !important; +} +.syntaxhighlighter .keyword { + color: #aaaaff !important; +} +.syntaxhighlighter .preprocessor { + color: #8aa6c1 !important; +} +.syntaxhighlighter .variable { + color: aqua !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ff8000 !important; +} +.syntaxhighlighter .constants { + color: yellow !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #aaaaff !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: red !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: yellow !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeMidnight.less b/src/_h5ai/css/lib/sh/shThemeMidnight.less new file mode 100644 index 00000000..c49563cc --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeMidnight.less @@ -0,0 +1,113 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #0f192a !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #253e5a !important; +} +.syntaxhighlighter .line.highlighted.number { + color: #38566f !important; +} +.syntaxhighlighter table caption { + color: #d1edff !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #0f192a !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #428bdd !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #428bdd !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #1dc116 !important; +} +.syntaxhighlighter .toolbar { + color: #d1edff !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: #d1edff !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #8aa6c1 !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #d1edff !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #428bdd !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #1dc116 !important; +} +.syntaxhighlighter .keyword { + color: #b43d3d !important; +} +.syntaxhighlighter .preprocessor { + color: #8aa6c1 !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #f7e741 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #b43d3d !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #f8bb00 !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: white !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/lib/sh/shThemeRDark.less b/src/_h5ai/css/lib/sh/shThemeRDark.less new file mode 100644 index 00000000..6305a10e --- /dev/null +++ b/src/_h5ai/css/lib/sh/shThemeRDark.less @@ -0,0 +1,113 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.alt1 { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.alt2 { + background-color: #1b2426 !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #323e41 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: #b9bdb6 !important; +} +.syntaxhighlighter table caption { + color: #b9bdb6 !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #435a5f !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #435a5f !important; + color: #1b2426 !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: #5ba1cf !important; + background: black !important; + border: 1px solid #435a5f !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: #5ba1cf !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: #5ce638 !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #435a5f !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: #e0e8ff !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: #b9bdb6 !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #878a85 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: #5ce638 !important; +} +.syntaxhighlighter .keyword { + color: #5ba1cf !important; +} +.syntaxhighlighter .preprocessor { + color: #435a5f !important; +} +.syntaxhighlighter .variable { + color: #ffaa3e !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ffaa3e !important; +} +.syntaxhighlighter .constants { + color: #e0e8ff !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #5ba1cf !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: #e0e8ff !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: white !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: #ffaa3e !important; +} diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index 1f0da274..39281b71 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -1,6 +1,8 @@ @import "lib/h5bp-norm"; @import "lib/mixins"; +@import "lib/sh/shCore"; +@import "lib/sh/shThemeDefault"; html { overflow-y: auto; } ::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } @@ -29,7 +31,8 @@ body { @import "inc/context"; @import "inc/apache-autoindex-table"; -@import "inc/preview"; +@import "inc/preview-img"; +@import "inc/preview-txt"; @import "inc/responsive"; diff --git a/src/_h5ai/images/preview/image.png b/src/_h5ai/images/preview/image.png deleted file mode 100644 index 5b4ad3093424b844d90a31fd57a80df3caaf640e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 589 zcmV-T01T*S>q^* z@@{g2IF57Lwmr0MdsxhQo_E=7HlKT*cNxcVZm^#LNs<6C7z~DnVT=H_+kDtG8jUN{ zG~cXND^{!3<{yJNj&U4k*lxE+Kp(&`jJ-oC%QCL7udnVJss>yHK_I{f;NdP;A)agOxlwQ~{d0 zt~;*litD$(Fpfy!aMcG#PUtd&yzPNzebWdL-$-4W0ik@aD{Dt_l%3rbahcf0W8 bU1EU0xPdfL3wRt)00000NkvXXu0mjf{$%{} diff --git a/src/_h5ai/images/preview/raw.png b/src/_h5ai/images/preview/raw.png new file mode 100644 index 0000000000000000000000000000000000000000..cde6412eb92c4322cf8fe6b5a39bfc3dc38edd82 GIT binary patch literal 597 zcmV-b0;>IqP)?9t#qY}5?cucP3Wfe z6|#`oxbiVX=t4ptKqwX(3Q_1H#nOelLE^@OQWzwN3l}=I&Xm(dqL>+>J#gS$KJGdH zf4ElxkASDZ6Cgw|{s6bYPZ3$~;T&0(b-7q9T*q<5pNqx9wJhrrI1&;3set3@bo#}0 z-LQxRx+|s7b^UiN7JDTk-~3zyLd)ecEF$D`x%akhdmETYB(!d~d%j+;!$3$W^>XL# zOhj%p0M~T^uxt#&wv;AwLd)I1{k*6?X7}hv6u%?`(EFJ2}(VyR;%yIzrS5jI-QnA zqw)QJ8fd_qY&QG4QmMSvb^WpHy1(l6`o~_c_c`!6_T|0RlT<2oQLEK{q*AF1-~>?r jRN%J*oB~%OVgdXGJ~Ibe${bk*00000NkvXXu0mjfbr=Uo literal 0 HcmV?d00001 diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 0a877f82..98d6c3d2 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -8,24 +8,24 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', settings = _.extend({}, defaults, allsettings['preview-img']), - template = '
' + - '
' + - '' + + template = '
' + + '
' + + '' + '
' + - '
' + - '
' + - '
' + - '
' + - '
    ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + - '
  • ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
      ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + '
    ' + '
    ' + '
    ', @@ -39,8 +39,8 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', adjustSize = function () { var rect = $(window).fracs('viewport'), - $container = $('#preview-content'), - $img = $('#preview-img'), + $container = $('#pv-img-content'), + $img = $('#pv-img-image'), margin = isFullscreen ? 0 : 20, barheight = isFullscreen ? 0 : 31; @@ -62,15 +62,15 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', if (!rect) { return; } - rect = rect.relativeTo($('#preview-overlay').fracs('rect')); + rect = rect.relativeTo($('#pv-img-overlay').fracs('rect')); - $('#preview-prev').css({ + $('#pv-img-prev').css({ left: rect.left, top: rect.top, width: rect.width / 2, height: rect.height }); - $('#preview-next').css({ + $('#pv-img-next').css({ left: rect.left + rect.width / 2, top: rect.top, width: rect.width / 2, @@ -106,8 +106,8 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', currentIdx = (idx + currentEntries.length) % currentEntries.length; - var $container = $('#preview-content'), - $img = $('#preview-img'), + var $container = $('#pv-img-content'), + $img = $('#pv-img-image'), src = currentEntries[currentIdx].absHref, spinnerTimeout = setTimeout(function () { @@ -129,14 +129,14 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $img.attr('src', src).fadeIn(200); - // small timeout, so $img is visible + // small timeout, so $img is visible and therefor $img.width is available setTimeout(function () { adjustSize(); - $('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); - $('#preview-bar-label').text(currentEntries[currentIdx].label); - $('#preview-bar-size').text('' + width + 'x' + height); - $('#preview-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); - $('#preview-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); + $('#pv-img-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%'); + $('#pv-img-bar-label').text(currentEntries[currentIdx].label); + $('#pv-img-bar-size').text('' + width + 'x' + height); + $('#pv-img-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length); + $('#pv-img-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); }, 1); }); @@ -146,7 +146,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', onEnter = function (entries, idx) { $(window).on('keydown', onKeydown); - $('#preview-overlay').stop(true, true).fadeIn(200); + $('#pv-img-overlay').stop(true, true).fadeIn(200); currentEntries = entries; onIndexChange(idx); @@ -165,7 +165,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', onExit = function () { $(window).off('keydown', onKeydown); - $('#preview-overlay').stop(true, true).fadeOut(200); + $('#pv-img-overlay').stop(true, true).fadeOut(200); }, onFullscreen = function () { @@ -176,11 +176,11 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', adjustSize(); if (isFullscreen) { - $('#preview-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen')); - $('#preview-bottombar').fadeOut(400); + $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen')); + $('#pv-img-bottombar').fadeOut(400); } else { - $('#preview-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen')); - $('#preview-bottombar').fadeIn(200); + $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen')); + $('#pv-img-bottombar').fadeIn(200); } }, @@ -226,38 +226,38 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', }); $(template).appendTo('body'); - $('#preview-bar-prev, #preview-prev').on('click', onPrevious); - $('#preview-bar-next, #preview-next').on('click', onNext); - $('#preview-bar-close, #preview-close').on('click', onExit); - $('#preview-bar-fullscreen').on('click', onFullscreen); - $('#preview-overlay').on('keydown', onKeydown); + $('#pv-img-bar-prev, #pv-img-prev').on('click', onPrevious); + $('#pv-img-bar-next, #pv-img-next').on('click', onNext); + $('#pv-img-bar-close, #pv-img-close').on('click', onExit); + $('#pv-img-bar-fullscreen').on('click', onFullscreen); + $('#pv-img-overlay').on('keydown', onKeydown); - $('#preview-prev') + $('#pv-img-prev') .on('mouseenter', function () { - $('#preview-bar-prev').addClass('hover'); + $('#pv-img-bar-prev').addClass('hover'); }) .on('mouseleave', function () { - $('#preview-bar-prev').removeClass('hover'); + $('#pv-img-bar-prev').removeClass('hover'); }); - $('#preview-next') + $('#pv-img-next') .on('mouseenter', function () { - $('#preview-bar-next').addClass('hover'); + $('#pv-img-bar-next').addClass('hover'); }) .on('mouseleave', function () { - $('#preview-bar-next').removeClass('hover'); + $('#pv-img-bar-next').removeClass('hover'); }); - $('#preview-close') + $('#pv-img-close') .on('mouseenter', function () { - $('#preview-bar-close').addClass('hover'); + $('#pv-img-bar-close').addClass('hover'); }) .on('mouseleave', function () { - $('#preview-bar-close').removeClass('hover'); + $('#pv-img-bar-close').removeClass('hover'); }); - $('#preview-overlay') + $('#pv-img-overlay') .on('click mousedown mousemove keydown keypress', function (event) { event.stopPropagation(); @@ -265,12 +265,12 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', .on('mousemove', function (event) { if (isFullscreen) { - var rect = $('#preview-overlay').fracs('rect'); + var rect = $('#pv-img-overlay').fracs('rect'); if (rect.bottom - event.pageY < 64) { - $('#preview-bottombar').fadeIn(200); + $('#pv-img-bottombar').fadeIn(200); } else { - $('#preview-bottombar').fadeOut(400); + $('#pv-img-bottombar').fadeOut(400); } } }); diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js new file mode 100644 index 00000000..803065ee --- /dev/null +++ b/src/_h5ai/js/inc/ext/preview-txt.js @@ -0,0 +1,198 @@ + +modulejs.define('ext/preview-txt', ['_', '$', 'sh', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, SH, allsettings, resource, store, entry) { + + var defaults = { + enabled: false, + types: { + text: 'plain', + js: 'js' + } + }, + + settings = _.extend({}, defaults, allsettings['preview-txt']), + + template = '
    ' + + '
    ' + + '
    ' + + '
    ' +
    +						'
    ' + + '
    ' + + '
      ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    • ' + + '
    ' + + '
    ' + + '
    ', + + templateText = '
    ',
    +
    +		currentEntries = [],
    +		currentIdx = 0,
    +
    +		adjustSize = function () {
    +
    +			var rect = $(window).fracs('viewport'),
    +				$container = $('#pv-txt-content'),
    +				margin = 20,
    +				barheight = 31;
    +
    +			$container.css({
    +				width: rect.width - 2 * margin,
    +				height: rect.height - 2 * margin - barheight - 32,
    +				left: margin,
    +				top: margin
    +			});
    +		},
    +
    +		preloadText = function (absHref, callback) {
    +
    +			$.ajax({
    +				url: absHref,
    +				dataType: 'text',
    +				success: function (content) {
    +
    +					callback(content);
    +					// setTimeout(function () { callback(content); }, 1000); // for testing
    +				},
    +				error: function (jqXHR, textStatus, errorThrown) {
    +
    +					callback('[ajax error] ' + textStatus);
    +				}
    +			});
    +		},
    +
    +		onIndexChange = function (idx) {
    +
    +			currentIdx = (idx + currentEntries.length) % currentEntries.length;
    +
    +			var $container = $('#pv-txt-content'),
    +				$text = $('#pv-txt-text'),
    +				current = currentEntries[currentIdx],
    +				spinnerTimeout = setTimeout(function () {
    +
    +					$container.spin({
    +						length: 12,
    +						width: 4,
    +						radius: 24,
    +						color: '#ccc',
    +						shadow: true
    +					});
    +				}, 200);
    +
    +			preloadText(current.absHref, function (content) {
    +
    +				clearTimeout(spinnerTimeout);
    +				$container.spin(false);
    +
    +				$text.fadeOut(100, function () {
    +
    +					var $nText = $(templateText).hide().addClass('toolbar: false; brush:').addClass(settings.types[current.type] || 'plain').text(content);
    +
    +					$text.replaceWith($nText);
    +					SH.highlight({}, $nText[0]);
    +					$nText.fadeIn(200);
    +
    +					adjustSize();
    +					$('#pv-txt-bar-label').text(current.label);
    +					$('#pv-txt-bar-size').text('' + current.size + ' bytes');
    +					$('#pv-txt-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length);
    +					$('#pv-txt-bar-original').find('a').attr('href', current.absHref);
    +				});
    +			});
    +		},
    +
    +		onEnter = function (entries, idx) {
    +
    +			$(window).on('keydown', onKeydown);
    +			$('#pv-txt-overlay').stop(true, true).fadeIn(200);
    +
    +			currentEntries = entries;
    +			onIndexChange(idx);
    +		},
    +
    +		onNext = function () {
    +
    +			onIndexChange(currentIdx + 1);
    +		},
    +
    +		onPrevious = function () {
    +
    +			onIndexChange(currentIdx - 1);
    +		},
    +
    +		onExit = function () {
    +
    +			$(window).off('keydown', onKeydown);
    +			$('#pv-txt-overlay').stop(true, true).fadeOut(200);
    +		},
    +
    +		onKeydown = function (event) {
    +
    +			var key = event.which;
    +
    +			if (key === 27) { // esc
    +				onExit();
    +			} else if (key === 37) { // left
    +				onPrevious();
    +			} else if (key === 39) { // right
    +				onNext();
    +			}
    +		},
    +
    +		initEntry = function (entries, entry, idx) {
    +
    +			if (entry.$extended) {
    +				entry.$extended.find('a').on('click', function (event) {
    +
    +					event.preventDefault();
    +					onEnter(entries, idx);
    +				});
    +			}
    +		},
    +
    +		init = function (entry) {
    +
    +			if (!settings.enabled) {
    +				return;
    +			}
    +
    +			var imageEntries = _.filter(entry.content, function (entry) {
    +
    +				return _.indexOf(_.keys(settings.types), entry.type) >= 0;
    +			});
    +			_.each(imageEntries, function (e, idx) {
    +
    +				initEntry(imageEntries, e, idx);
    +			});
    +
    +			$(template).appendTo('body');
    +			$('#pv-txt-bar-prev').on('click', onPrevious);
    +			$('#pv-txt-bar-next').on('click', onNext);
    +			$('#pv-txt-bar-close, #pv-txt-close').on('click', onExit);
    +			$('#pv-txt-overlay').on('keydown', onKeydown);
    +
    +			$('#pv-txt-close')
    +				.on('mouseenter', function () {
    +					$('#pv-txt-bar-close').addClass('hover');
    +				})
    +				.on('mouseleave', function () {
    +					$('#pv-txt-bar-close').removeClass('hover');
    +				});
    +
    +
    +			$('#pv-txt-overlay')
    +				.on('click mousedown mousemove keydown keypress', function (event) {
    +
    +					event.stopPropagation();
    +				});
    +
    +			$(window).on('resize load', adjustSize);
    +		};
    +
    +	init(entry);
    +});
    diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js
    index e656c598..1b5e5195 100644
    --- a/src/_h5ai/js/inc/main.js
    +++ b/src/_h5ai/js/inc/main.js
    @@ -33,6 +33,7 @@
     	// @include "ext/link-hover-states.js"
     	// @include "ext/mode.js"
     	// @include "ext/preview-img.js"
    +	// @include "ext/preview-txt.js"
     	// @include "ext/qrcode.js"
     	// @include "ext/select.js"
     	// @include "ext/sort.js"
    @@ -46,7 +47,7 @@
     
     
     	$(function () {
    -		/*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, _ */
    +		/*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, SyntaxHighlighter, _ */
     
     		// Register predefined globals on doc ready, so the script order inside
     		// the document doesn't matter. `jQuery`, `moment` and `underscore` are
    @@ -58,6 +59,7 @@
     		modulejs.define('$', function () { return jQuery; });
     		modulejs.define('modernizr', Modernizr);
     		modulejs.define('moment', function () { return moment; });
    +		modulejs.define('sh', SyntaxHighlighter);
     		modulejs.define('_', function () { return _; });
     
     		modulejs.require($('body').attr('id'));
    diff --git a/src/_h5ai/js/lib/sh/shAutoloader.js b/src/_h5ai/js/lib/sh/shAutoloader.js
    new file mode 100644
    index 00000000..4e29bdde
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shAutoloader.js
    @@ -0,0 +1,17 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g,
    +			    css: 'color2' },
    +
    +			{ regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
    +			    css: 'keyword' },
    +
    +			{ regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals
    +			    css: 'keyword' },
    +
    +			{ regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
    +			    css: 'color3' },
    +
    +			{ regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
    +			    css: 'color3' },
    +
    +			{ regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
    +			{ regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
    +		];
    +	};
    +
    +	Brush.prototype = new SyntaxHighlighter.Highlighter();
    +	Brush.aliases = ['applescript'];
    +
    +	SyntaxHighlighter.brushes.AppleScript = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushBash.js b/src/_h5ai/js/lib/sh/shBrushBash.js
    new file mode 100644
    index 00000000..8c296969
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushBash.js
    @@ -0,0 +1,59 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'if fi then elif else for do done until while break continue case function return in eq ne ge le';
    +		var commands =  'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
    +						'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
    +						'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
    +						'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
    +						'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
    +						'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
    +						'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
    +						'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
    +						'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
    +						'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
    +						'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
    +						'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
    +						'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
    +						'vi watch wc whereis which who whoami Wget xargs yes'
    +						;
    +
    +		this.regexList = [
    +			{ regex: /^#!.*$/gm,											css: 'preprocessor bold' },
    +			{ regex: /\/[\w-\/]+/gm,										css: 'plain' },
    +			{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments,		css: 'comments' },		// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,			css: 'string' },		// double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,			css: 'string' },		// single quoted strings
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),			css: 'keyword' },		// keywords
    +			{ regex: new RegExp(this.getKeywords(commands), 'gm'),			css: 'functions' }		// commands
    +			];
    +	}
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['bash', 'shell'];
    +
    +	SyntaxHighlighter.brushes.Bash = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushCSharp.js b/src/_h5ai/js/lib/sh/shBrushCSharp.js
    new file mode 100644
    index 00000000..079214ef
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushCSharp.js
    @@ -0,0 +1,65 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'abstract as base bool break byte case catch char checked class const ' +
    +						'continue decimal default delegate do double else enum event explicit ' +
    +						'extern false finally fixed float for foreach get goto if implicit in int ' +
    +						'interface internal is lock long namespace new null object operator out ' +
    +						'override params private protected public readonly ref return sbyte sealed set ' +
    +						'short sizeof stackalloc static string struct switch this throw true try ' +
    +						'typeof uint ulong unchecked unsafe ushort using virtual void while';
    +
    +		function fixComments(match, regexInfo)
    +		{
    +			var css = (match[0].indexOf("///") == 0)
    +				? 'color1'
    +				: 'comments'
    +				;
    +			
    +			return [new SyntaxHighlighter.Match(match[0], match.index, css)];
    +		}
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	func : fixComments },		// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },			// multiline comments
    +			{ regex: /@"(?:[^"]|"")*"/g,								css: 'string' },			// @-quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },			// strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },			// strings
    +			{ regex: /^\s*#.*/gm,										css: 'preprocessor' },		// preprocessor tags like #region and #endregion
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' },			// c# keyword
    +			{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g,	css: 'keyword' },			// contextual keyword: 'partial'
    +			{ regex: /\byield(?=\s+(?:return|break)\b)/g,				css: 'keyword' }			// contextual keyword: 'yield'
    +			];
    +		
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['c#', 'c-sharp', 'csharp'];
    +
    +	SyntaxHighlighter.brushes.CSharp = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    +
    diff --git a/src/_h5ai/js/lib/sh/shBrushColdFusion.js b/src/_h5ai/js/lib/sh/shBrushColdFusion.js
    new file mode 100644
    index 00000000..627dbb9b
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushColdFusion.js
    @@ -0,0 +1,100 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Jen
    +		// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
    +	
    +		var funcs	=	'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + 
    +						'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + 
    +						'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + 
    +						'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + 
    +						'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + 
    +						'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + 
    +						'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + 
    +						'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + 
    +						'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + 
    +						'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + 
    +						'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + 
    +						'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + 
    +						'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + 
    +						'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + 
    +						'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + 
    +						'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + 
    +						'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + 
    +						'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + 
    +						'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + 
    +						'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + 
    +						'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + 
    +						'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + 
    +						'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + 
    +						'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + 
    +						'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + 
    +						'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + 
    +						'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + 
    +						'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + 
    +						'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + 
    +						'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + 
    +						'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + 
    +						'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + 
    +						'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + 
    +						'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + 
    +						'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + 
    +						'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + 
    +						'XmlValidate Year YesNoFormat';
    +
    +		var keywords =	'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + 
    +						'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + 
    +						'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + 
    +						'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + 
    +						'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + 
    +						'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + 
    +						'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + 
    +						'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + 
    +						'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + 
    +						'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + 
    +						'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + 
    +						'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + 
    +						'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + 
    +						'cfwindow cfxml cfzip cfzipparam';
    +
    +		var operators =	'all and any between cross in join like not null or outer some';
    +
    +		this.regexList = [
    +			{ regex: new RegExp('--(.*)$', 'gm'),						css: 'comments' },  // one line and multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.xmlComments,			css: 'comments' },    // single quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },    // double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },    // single quoted strings
    +			{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),		css: 'functions' }, // functions
    +			{ regex: new RegExp(this.getKeywords(operators), 'gmi'),	css: 'color1' },    // operators and such
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),		css: 'keyword' }    // keyword
    +			];
    +	}
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['coldfusion','cf'];
    +	
    +	SyntaxHighlighter.brushes.ColdFusion = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushCpp.js b/src/_h5ai/js/lib/sh/shBrushCpp.js
    new file mode 100644
    index 00000000..9f70d3ae
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushCpp.js
    @@ -0,0 +1,97 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Copyright 2006 Shin, YoungJin
    +	
    +		var datatypes =	'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
    +						'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
    +						'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
    +						'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
    +						'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
    +						'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
    +						'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
    +						'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
    +						'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
    +						'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
    +						'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
    +						'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
    +						'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
    +						'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
    +						'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
    +						'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
    +						'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
    +						'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
    +						'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
    +						'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
    +						'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
    +						'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
    +						'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
    +						'va_list wchar_t wctrans_t wctype_t wint_t signed';
    +
    +		var keywords =	'break case catch class const __finally __exception __try ' +
    +						'const_cast continue private public protected __declspec ' +
    +						'default delete deprecated dllexport dllimport do dynamic_cast ' +
    +						'else enum explicit extern if for friend goto inline ' +
    +						'mutable naked namespace new noinline noreturn nothrow ' +
    +						'register reinterpret_cast return selectany ' +
    +						'sizeof static static_cast struct switch template this ' +
    +						'thread throw true false try typedef typeid typename union ' +
    +						'using uuid virtual void volatile whcar_t while';
    +					
    +		var functions =	'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
    +						'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
    +						'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
    +						'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
    +						'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
    +						'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
    +						'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
    +						'fwrite getc getchar gets perror printf putc putchar puts remove ' +
    +						'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
    +						'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
    +						'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
    +						'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
    +						'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
    +						'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
    +						'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
    +						'clock ctime difftime gmtime localtime mktime strftime time';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },			// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },			// multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },			// strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },			// strings
    +			{ regex: /^ *#.*/gm,										css: 'preprocessor' },
    +			{ regex: new RegExp(this.getKeywords(datatypes), 'gm'),		css: 'color1 bold' },
    +			{ regex: new RegExp(this.getKeywords(functions), 'gm'),		css: 'functions bold' },
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword bold' }
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['cpp', 'c'];
    +
    +	SyntaxHighlighter.brushes.Cpp = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushCss.js b/src/_h5ai/js/lib/sh/shBrushCss.js
    new file mode 100644
    index 00000000..4297a9a6
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushCss.js
    @@ -0,0 +1,91 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		function getKeywordsCSS(str)
    +		{
    +			return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
    +		};
    +	
    +		function getValuesCSS(str)
    +		{
    +			return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
    +		};
    +
    +		var keywords =	'ascent azimuth background-attachment background-color background-image background-position ' +
    +						'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
    +						'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
    +						'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
    +						'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
    +						'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
    +						'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
    +						'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
    +						'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
    +						'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
    +						'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
    +						'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
    +						'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
    +						'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
    +
    +		var values =	'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
    +						'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
    +						'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
    +						'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
    +						'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
    +						'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
    +						'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
    +						'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
    +						'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
    +						'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
    +						'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
    +						'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
    +						'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
    +						'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
    +
    +		var fonts =		'[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
    +	
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },	// multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },	// double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },	// single quoted strings
    +			{ regex: /\#[a-fA-F0-9]{3,6}/g,								css: 'value' },		// html colors
    +			{ regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g,				css: 'value' },		// sizes
    +			{ regex: /!important/g,										css: 'color3' },	// !important
    +			{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'),		css: 'keyword' },	// keywords
    +			{ regex: new RegExp(getValuesCSS(values), 'g'),				css: 'value' },		// values
    +			{ regex: new RegExp(this.getKeywords(fonts), 'g'),			css: 'color1' }		// fonts
    +			];
    +
    +		this.forHtmlScript({ 
    +			left: /(<|<)\s*style.*?(>|>)/gi, 
    +			right: /(<|<)\/\s*style\s*(>|>)/gi 
    +			});
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['css'];
    +
    +	SyntaxHighlighter.brushes.CSS = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushDelphi.js b/src/_h5ai/js/lib/sh/shBrushDelphi.js
    new file mode 100644
    index 00000000..e1060d44
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushDelphi.js
    @@ -0,0 +1,55 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
    +						'case char class comp const constructor currency destructor div do double ' +
    +						'downto else end except exports extended false file finalization finally ' +
    +						'for function goto if implementation in inherited int64 initialization ' +
    +						'integer interface is label library longint longword mod nil not object ' +
    +						'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
    +						'pint64 pointer private procedure program property pshortstring pstring ' +
    +						'pvariant pwidechar pwidestring protected public published raise real real48 ' +
    +						'record repeat set shl shortint shortstring shr single smallint string then ' +
    +						'threadvar to true try type unit until uses val var varirnt while widechar ' +
    +						'widestring with word write writeln xor';
    +
    +		this.regexList = [
    +			{ regex: /\(\*[\s\S]*?\*\)/gm,								css: 'comments' },  	// multiline comments (* *)
    +			{ regex: /{(?!\$)[\s\S]*?}/gm,								css: 'comments' },  	// multiline comments { }
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },  	// one line
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },		// strings
    +			{ regex: /\{\$[a-zA-Z]+ .+\}/g,								css: 'color1' },		// compiler Directives and Region tags
    +			{ regex: /\b[\d\.]+\b/g,									css: 'value' },			// numbers 12345
    +			{ regex: /\$[a-zA-Z0-9]+\b/g,								css: 'value' },			// numbers $F5D3
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),		css: 'keyword' }		// keyword
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['delphi', 'pascal', 'pas'];
    +
    +	SyntaxHighlighter.brushes.Delphi = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushDiff.js b/src/_h5ai/js/lib/sh/shBrushDiff.js
    new file mode 100644
    index 00000000..e9b14fc5
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushDiff.js
    @@ -0,0 +1,41 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		this.regexList = [
    +			{ regex: /^\+\+\+.*$/gm,		css: 'color2' },
    +			{ regex: /^\-\-\-.*$/gm,		css: 'color2' },
    +			{ regex: /^\s.*$/gm,			css: 'color1' },
    +			{ regex: /^@@.*@@$/gm,			css: 'variable' },
    +			{ regex: /^\+[^\+]{1}.*$/gm,	css: 'string' },
    +			{ regex: /^\-[^\-]{1}.*$/gm,	css: 'comments' }
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['diff', 'patch'];
    +
    +	SyntaxHighlighter.brushes.Diff = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushErlang.js b/src/_h5ai/js/lib/sh/shBrushErlang.js
    new file mode 100644
    index 00000000..6ba7d9da
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushErlang.js
    @@ -0,0 +1,52 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Jean-Lou Dupont
    +		// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html  
    +
    +		// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
    +		var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
    +			'case catch cond div end fun if let not of or orelse '+
    +			'query receive rem try when xor'+
    +			// additional
    +			' module export import define';
    +
    +		this.regexList = [
    +			{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), 			css: 'constants' },
    +			{ regex: new RegExp("\\%.+", 'gm'), 						css: 'comments' },
    +			{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), 				css: 'preprocessor' },
    +			{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), 			css: 'functions' },
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },
    +			{ regex: new RegExp(this.getKeywords(keywords),	'gm'),		css: 'keyword' }
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['erl', 'erlang'];
    +
    +	SyntaxHighlighter.brushes.Erland = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushGroovy.js b/src/_h5ai/js/lib/sh/shBrushGroovy.js
    new file mode 100644
    index 00000000..6ec5c185
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushGroovy.js
    @@ -0,0 +1,67 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Andres Almiray
    +		// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
    +
    +		var keywords =	'as assert break case catch class continue def default do else extends finally ' +
    +						'if in implements import instanceof interface new package property return switch ' +
    +						'throw throws try while public protected private static';
    +		var types    =  'void boolean byte char short int long float double';
    +		var constants = 'null';
    +		var methods   = 'allProperties count get size '+
    +						'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
    +						'findIndexOf grep inject max min reverseEach sort ' +
    +						'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
    +						'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
    +						'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
    +						'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
    +						'transformChar transformLine withOutputStream withPrintWriter withStream ' +
    +						'withStreams withWriter withWriterAppend write writeLine '+
    +						'dump inspect invokeMethod print println step times upto use waitForOrKill '+
    +						'getText';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,				css: 'comments' },		// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,					css: 'comments' },		// multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,					css: 'string' },		// strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,					css: 'string' },		// strings
    +			{ regex: /""".*"""/g,													css: 'string' },		// GStrings
    +			{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'),	css: 'value' },			// numbers
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),					css: 'keyword' },		// goovy keyword
    +			{ regex: new RegExp(this.getKeywords(types), 'gm'),						css: 'color1' },		// goovy/java type
    +			{ regex: new RegExp(this.getKeywords(constants), 'gm'),					css: 'constants' },		// constants
    +			{ regex: new RegExp(this.getKeywords(methods), 'gm'),					css: 'functions' }		// methods
    +			];
    +
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	}
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['groovy'];
    +
    +	SyntaxHighlighter.brushes.Groovy = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushJScript.js b/src/_h5ai/js/lib/sh/shBrushJScript.js
    new file mode 100644
    index 00000000..ff98daba
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushJScript.js
    @@ -0,0 +1,52 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'break case catch continue ' +
    +						'default delete do else false  ' +
    +						'for function if in instanceof ' +
    +						'new null return super switch ' +
    +						'this throw true try typeof var while with'
    +						;
    +
    +		var r = SyntaxHighlighter.regexLib;
    +		
    +		this.regexList = [
    +			{ regex: r.multiLineDoubleQuotedString,					css: 'string' },			// double quoted strings
    +			{ regex: r.multiLineSingleQuotedString,					css: 'string' },			// single quoted strings
    +			{ regex: r.singleLineCComments,							css: 'comments' },			// one line comments
    +			{ regex: r.multiLineCComments,							css: 'comments' },			// multiline comments
    +			{ regex: /\s*#.*/gm,									css: 'preprocessor' },		// preprocessor tags like #region and #endregion
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),	css: 'keyword' }			// keywords
    +			];
    +	
    +		this.forHtmlScript(r.scriptScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['js', 'jscript', 'javascript'];
    +
    +	SyntaxHighlighter.brushes.JScript = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushJava.js b/src/_h5ai/js/lib/sh/shBrushJava.js
    new file mode 100644
    index 00000000..d692fd63
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushJava.js
    @@ -0,0 +1,57 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'abstract assert boolean break byte case catch char class const ' +
    +						'continue default do double else enum extends ' +
    +						'false final finally float for goto if implements import ' +
    +						'instanceof int interface long native new null ' +
    +						'package private protected public return ' +
    +						'short static strictfp super switch synchronized this throw throws true ' +
    +						'transient try void volatile while';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },		// one line comments
    +			{ regex: /\/\*([^\*][\s\S]*)?\*\//gm,						css: 'comments' },	 	// multiline comments
    +			{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm,					css: 'preprocessor' },	// documentation comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },		// strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },		// strings
    +			{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi,				css: 'value' },			// numbers
    +			{ regex: /(?!\@interface\b)\@[\$\w]+\b/g,					css: 'color1' },		// annotation @anno
    +			{ regex: /\@interface\b/g,									css: 'color2' },		// @interface keyword
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' }		// java keyword
    +			];
    +
    +		this.forHtmlScript({
    +			left	: /(<|<)%[@!=]?/g, 
    +			right	: /%(>|>)/g 
    +		});
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['java'];
    +
    +	SyntaxHighlighter.brushes.Java = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushJavaFX.js b/src/_h5ai/js/lib/sh/shBrushJavaFX.js
    new file mode 100644
    index 00000000..1a150a6a
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushJavaFX.js
    @@ -0,0 +1,58 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Patrick Webster
    +		// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
    +		var datatypes =	'Boolean Byte Character Double Duration '
    +						+ 'Float Integer Long Number Short String Void'
    +						;
    +
    +		var keywords = 'abstract after and as assert at before bind bound break catch class '
    +						+ 'continue def delete else exclusive extends false finally first for from '
    +						+ 'function if import in indexof init insert instanceof into inverse last '
    +						+ 'lazy mixin mod nativearray new not null on or override package postinit '
    +						+ 'protected public public-init public-read replace return reverse sizeof '
    +						+ 'step super then this throw true try tween typeof var where while with '
    +						+ 'attribute let private readonly static trigger'
    +						;
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },
    +			{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' },	// numbers
    +			{ regex: new RegExp(this.getKeywords(datatypes), 'gm'),		css: 'variable' },	// datatypes
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' }
    +		];
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['jfx', 'javafx'];
    +
    +	SyntaxHighlighter.brushes.JavaFX = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushPerl.js b/src/_h5ai/js/lib/sh/shBrushPerl.js
    new file mode 100644
    index 00000000..d94a2e0e
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushPerl.js
    @@ -0,0 +1,72 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by David Simmons-Duffin and Marty Kube
    +	
    +		var funcs = 
    +			'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + 
    +			'chroot close closedir connect cos crypt defined delete each endgrent ' + 
    +			'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + 
    +			'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + 
    +			'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + 
    +			'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + 
    +			'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + 
    +			'getservbyname getservbyport getservent getsockname getsockopt glob ' + 
    +			'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + 
    +			'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + 
    +			'oct open opendir ord pack pipe pop pos print printf prototype push ' + 
    +			'quotemeta rand read readdir readline readlink readpipe recv rename ' + 
    +			'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + 
    +			'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + 
    +			'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + 
    +			'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + 
    +			'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + 
    +			'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + 
    +			'undef unlink unpack unshift utime values vec wait waitpid warn write';
    +    
    +		var keywords =  
    +			'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
    +			'for foreach goto if import last local my next no our package redo ref ' + 
    +			'require return sub tie tied unless untie until use wantarray while';
    +    
    +		this.regexList = [
    +			{ regex: new RegExp('#[^!].*$', 'gm'),					css: 'comments' },
    +			{ regex: new RegExp('^\\s*#!.*$', 'gm'),				css: 'preprocessor' }, // shebang
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,	css: 'string' },
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,	css: 'string' },
    +			{ regex: new RegExp('(\\$|@|%)\\w+', 'g'),				css: 'variable' },
    +			{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),	css: 'functions' },
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),	css: 'keyword' }
    +		    ];
    +
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
    +	}
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases		= ['perl', 'Perl', 'pl'];
    +
    +	SyntaxHighlighter.brushes.Perl = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushPhp.js b/src/_h5ai/js/lib/sh/shBrushPhp.js
    new file mode 100644
    index 00000000..95e6e432
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushPhp.js
    @@ -0,0 +1,88 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var funcs	=	'abs acos acosh addcslashes addslashes ' +
    +						'array_change_key_case array_chunk array_combine array_count_values array_diff '+
    +						'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
    +						'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
    +						'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
    +						'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
    +						'array_push array_rand array_reduce array_reverse array_search array_shift '+
    +						'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
    +						'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
    +						'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
    +						'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
    +						'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
    +						'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
    +						'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
    +						'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
    +						'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
    +						'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
    +						'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
    +						'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
    +						'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
    +						'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
    +						'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
    +						'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
    +						'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
    +						'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
    +						'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
    +						'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
    +						'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
    +						'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
    +						'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
    +						'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
    +						'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
    +						'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
    +						'strtoupper strtr strval substr substr_compare';
    +
    +		var keywords =	'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
    +						'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
    +						'function include include_once global goto if implements interface instanceof namespace new ' +
    +						'old_function or private protected public return require require_once static switch ' +
    +						'throw try use var while xor ';
    +		
    +		var constants	= '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },			// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },			// multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },			// double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },			// single quoted strings
    +			{ regex: /\$\w+/g,											css: 'variable' },			// variables
    +			{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),		css: 'functions' },			// common functions
    +			{ regex: new RegExp(this.getKeywords(constants), 'gmi'),	css: 'constants' },			// constants
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' }			// keyword
    +			];
    +
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['php'];
    +
    +	SyntaxHighlighter.brushes.Php = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushPlain.js b/src/_h5ai/js/lib/sh/shBrushPlain.js
    new file mode 100644
    index 00000000..9f7d9e90
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushPlain.js
    @@ -0,0 +1,33 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['text', 'plain'];
    +
    +	SyntaxHighlighter.brushes.Plain = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushPowerShell.js b/src/_h5ai/js/lib/sh/shBrushPowerShell.js
    new file mode 100644
    index 00000000..0be17529
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushPowerShell.js
    @@ -0,0 +1,74 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributes by B.v.Zanten, Getronics
    +		// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
    +
    +		var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
    +					'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
    +					'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
    +					'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
    +					'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
    +					'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
    +					'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
    +					'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
    +					'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
    +					'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
    +					'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
    +					'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
    +					'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
    +					'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
    +					'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
    +					'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
    +					'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
    +					'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
    +					'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
    +					'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
    +					'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
    +		var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
    +					'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
    +					'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
    +					'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
    +					'spps spsv sv tee cat cd cp h history kill lp ls ' +
    +					'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
    +					'erase rd ren type % \\?';
    +
    +		this.regexList = [
    +			{ regex: /#.*$/gm,										css: 'comments' },  // one line comments
    +			{ regex: /\$[a-zA-Z0-9]+\b/g,							css: 'value'   },   // variables $Computer1
    +			{ regex: /\-[a-zA-Z]+\b/g,								css: 'keyword' },   // Operators    -not  -and  -eq
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,	css: 'string' },    // strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,	css: 'string' },    // strings
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),	css: 'keyword' },
    +			{ regex: new RegExp(this.getKeywords(alias), 'gmi'),	css: 'keyword' }
    +		];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['powershell', 'ps'];
    +
    +	SyntaxHighlighter.brushes.PowerShell = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushPython.js b/src/_h5ai/js/lib/sh/shBrushPython.js
    new file mode 100644
    index 00000000..ce774629
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushPython.js
    @@ -0,0 +1,64 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Gheorghe Milas and Ahmad Sherif
    +	
    +		var keywords =  'and assert break class continue def del elif else ' +
    +						'except exec finally for from global if import in is ' +
    +						'lambda not or pass print raise return try yield while';
    +
    +		var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
    +					'chr classmethod cmp coerce compile complex delattr dict dir ' +
    +					'divmod enumerate eval execfile file filter float format frozenset ' +
    +					'getattr globals hasattr hash help hex id input int intern ' +
    +					'isinstance issubclass iter len list locals long map max min next ' +
    +					'object oct open ord pow print property range raw_input reduce ' +
    +					'reload repr reversed round set setattr slice sorted staticmethod ' +
    +					'str sum super tuple type type unichr unicode vars xrange zip';
    +
    +		var special =  'None True False self cls class_';
    +
    +		this.regexList = [
    +				{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
    +				{ regex: /^\s*@\w+/gm, 										css: 'decorator' },
    +				{ regex: /(['\"]{3})([^\1])*?\1/gm, 						css: 'comments' },
    +				{ regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, 					css: 'string' },
    +				{ regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, 				css: 'string' },
    +				{ regex: /\+|\-|\*|\/|\%|=|==/gm, 							css: 'keyword' },
    +				{ regex: /\b\d+\.?\w*/g, 									css: 'value' },
    +				{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),		css: 'functions' },
    +				{ regex: new RegExp(this.getKeywords(keywords), 'gm'), 		css: 'keyword' },
    +				{ regex: new RegExp(this.getKeywords(special), 'gm'), 		css: 'color1' }
    +				];
    +			
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['py', 'python'];
    +
    +	SyntaxHighlighter.brushes.Python = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushRuby.js b/src/_h5ai/js/lib/sh/shBrushRuby.js
    new file mode 100644
    index 00000000..ff82130a
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushRuby.js
    @@ -0,0 +1,55 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Erik Peterson.
    +	
    +		var keywords =	'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
    +						'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
    +						'self super then throw true undef unless until when while yield';
    +
    +		var builtins =	'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
    +						'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
    +						'ThreadGroup Thread Time TrueClass';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments,	css: 'comments' },		// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },		// double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },		// single quoted strings
    +			{ regex: /\b[A-Z0-9_]+\b/g,									css: 'constants' },		// constants
    +			{ regex: /:[a-z][A-Za-z0-9_]*/g,							css: 'color2' },		// symbols
    +			{ regex: /(\$|@@|@)\w+/g,									css: 'variable bold' },	// $global, @instance, and @@class variables
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' },		// keywords
    +			{ regex: new RegExp(this.getKeywords(builtins), 'gm'),		css: 'color1' }			// builtins
    +			];
    +
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['ruby', 'rails', 'ror', 'rb'];
    +
    +	SyntaxHighlighter.brushes.Ruby = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushSass.js b/src/_h5ai/js/lib/sh/shBrushSass.js
    new file mode 100644
    index 00000000..aa04da09
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushSass.js
    @@ -0,0 +1,94 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		function getKeywordsCSS(str)
    +		{
    +			return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
    +		};
    +	
    +		function getValuesCSS(str)
    +		{
    +			return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
    +		};
    +
    +		var keywords =	'ascent azimuth background-attachment background-color background-image background-position ' +
    +						'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
    +						'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
    +						'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
    +						'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
    +						'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
    +						'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
    +						'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
    +						'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
    +						'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
    +						'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
    +						'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
    +						'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
    +						'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
    +		
    +		var values =	'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
    +						'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
    +						'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+
    +						'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
    +						'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
    +						'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
    +						'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
    +						'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
    +						'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
    +						'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
    +						'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
    +						'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
    +						'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
    +						'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
    +		
    +		var fonts =		'[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
    +		
    +		var statements		= '!important !default';
    +		var preprocessor	= '@import @extend @debug @warn @if @for @while @mixin @include';
    +		
    +		var r = SyntaxHighlighter.regexLib;
    +		
    +		this.regexList = [
    +			{ regex: r.multiLineCComments,								css: 'comments' },		// multiline comments
    +			{ regex: r.singleLineCComments,								css: 'comments' },		// singleline comments
    +			{ regex: r.doubleQuotedString,								css: 'string' },		// double quoted strings
    +			{ regex: r.singleQuotedString,								css: 'string' },		// single quoted strings
    +			{ regex: /\#[a-fA-F0-9]{3,6}/g,								css: 'value' },			// html colors
    +			{ regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g,			css: 'value' },			// sizes
    +			{ regex: /\$\w+/g,											css: 'variable' },		// variables
    +			{ regex: new RegExp(this.getKeywords(statements), 'g'),		css: 'color3' },		// statements
    +			{ regex: new RegExp(this.getKeywords(preprocessor), 'g'),	css: 'preprocessor' },	// preprocessor
    +			{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'),		css: 'keyword' },		// keywords
    +			{ regex: new RegExp(getValuesCSS(values), 'g'),				css: 'value' },			// values
    +			{ regex: new RegExp(this.getKeywords(fonts), 'g'),			css: 'color1' }			// fonts
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['sass', 'scss'];
    +
    +	SyntaxHighlighter.brushes.Sass = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushScala.js b/src/_h5ai/js/lib/sh/shBrushScala.js
    new file mode 100644
    index 00000000..4b0b6f04
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushScala.js
    @@ -0,0 +1,51 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		// Contributed by Yegor Jbanov and David Bernard.
    +	
    +		var keywords =	'val sealed case def true trait implicit forSome import match object null finally super ' +
    +						'override try lazy for var catch throw type extends class while with new final yield abstract ' +
    +						'else do if return protected private this package false';
    +
    +		var keyops =	'[_:=><%#@]+';
    +
    +		this.regexList = [
    +			{ regex: SyntaxHighlighter.regexLib.singleLineCComments,			css: 'comments' },	// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineCComments,				css: 'comments' },	// multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString,	css: 'string' },	// multi-line strings
    +			{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString,    css: 'string' },	// double-quoted string
    +			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,				css: 'string' },	// strings
    +			{ regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi,								css: 'value' },		// numbers
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),				css: 'keyword' },	// keywords
    +			{ regex: new RegExp(keyops, 'gm'),									css: 'keyword' }	// scala keyword
    +			];
    +	}
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['scala'];
    +
    +	SyntaxHighlighter.brushes.Scala = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushSql.js b/src/_h5ai/js/lib/sh/shBrushSql.js
    new file mode 100644
    index 00000000..5c2cd880
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushSql.js
    @@ -0,0 +1,66 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var funcs	=	'abs avg case cast coalesce convert count current_timestamp ' +
    +						'current_user day isnull left lower month nullif replace right ' +
    +						'session_user space substring sum system_user upper user year';
    +
    +		var keywords =	'absolute action add after alter as asc at authorization begin bigint ' +
    +						'binary bit by cascade char character check checkpoint close collate ' +
    +						'column commit committed connect connection constraint contains continue ' +
    +						'create cube current current_date current_time cursor database date ' +
    +						'deallocate dec decimal declare default delete desc distinct double drop ' +
    +						'dynamic else end end-exec escape except exec execute false fetch first ' +
    +						'float for force foreign forward free from full function global goto grant ' +
    +						'group grouping having hour ignore index inner insensitive insert instead ' +
    +						'int integer intersect into is isolation key last level load local max min ' +
    +						'minute modify move name national nchar next no numeric of off on only ' +
    +						'open option order out output partial password precision prepare primary ' +
    +						'prior privileges procedure public read real references relative repeatable ' +
    +						'restrict return returns revoke rollback rollup rows rule schema scroll ' +
    +						'second section select sequence serializable set size smallint static ' +
    +						'statistics table temp temporary then time timestamp to top transaction ' +
    +						'translation trigger true truncate uncommitted union unique update values ' +
    +						'varchar varying view when where with work';
    +
    +		var operators =	'all and any between cross in join like not null or outer some';
    +
    +		this.regexList = [
    +			{ regex: /--(.*)$/gm,												css: 'comments' },			// one line and multiline comments
    +			{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString,	css: 'string' },			// double quoted strings
    +			{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString,	css: 'string' },			// single quoted strings
    +			{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),				css: 'color2' },			// functions
    +			{ regex: new RegExp(this.getKeywords(operators), 'gmi'),			css: 'color1' },			// operators and such
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),				css: 'keyword' }			// keyword
    +			];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['sql'];
    +
    +	SyntaxHighlighter.brushes.Sql = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    +
    diff --git a/src/_h5ai/js/lib/sh/shBrushVb.js b/src/_h5ai/js/lib/sh/shBrushVb.js
    new file mode 100644
    index 00000000..be845dc0
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushVb.js
    @@ -0,0 +1,56 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		var keywords =	'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
    +						'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
    +						'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
    +						'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
    +						'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
    +						'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
    +						'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
    +						'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
    +						'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
    +						'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
    +						'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
    +						'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
    +						'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
    +						'Variant When While With WithEvents WriteOnly Xor';
    +
    +		this.regexList = [
    +			{ regex: /'.*$/gm,										css: 'comments' },			// one line comments
    +			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,	css: 'string' },			// strings
    +			{ regex: /^\s*#.*$/gm,									css: 'preprocessor' },		// preprocessor tags like #region and #endregion
    +			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),	css: 'keyword' }			// vb keyword
    +			];
    +
    +		this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['vb', 'vbnet'];
    +
    +	SyntaxHighlighter.brushes.Vb = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shBrushXml.js b/src/_h5ai/js/lib/sh/shBrushXml.js
    new file mode 100644
    index 00000000..69d9fd0b
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shBrushXml.js
    @@ -0,0 +1,69 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +;(function()
    +{
    +	// CommonJS
    +	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
    +
    +	function Brush()
    +	{
    +		function process(match, regexInfo)
    +		{
    +			var constructor = SyntaxHighlighter.Match,
    +				code = match[0],
    +				tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code),
    +				result = []
    +				;
    +		
    +			if (match.attributes != null) 
    +			{
    +				var attributes,
    +					regex = new XRegExp('(? [\\w:\\-\\.]+)' +
    +										'\\s*=\\s*' +
    +										'(? ".*?"|\'.*?\'|\\w+)',
    +										'xg');
    +
    +				while ((attributes = regex.exec(code)) != null) 
    +				{
    +					result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
    +					result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
    +				}
    +			}
    +
    +			if (tag != null)
    +				result.push(
    +					new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
    +				);
    +
    +			return result;
    +		}
    +	
    +		this.regexList = [
    +			{ regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'),			css: 'color2' },	// 
    +			{ regex: SyntaxHighlighter.regexLib.xmlComments,												css: 'comments' },	// 
    +			{ regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process }
    +		];
    +	};
    +
    +	Brush.prototype	= new SyntaxHighlighter.Highlighter();
    +	Brush.aliases	= ['xml', 'xhtml', 'xslt', 'html'];
    +
    +	SyntaxHighlighter.brushes.Xml = Brush;
    +
    +	// CommonJS
    +	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
    +})();
    diff --git a/src/_h5ai/js/lib/sh/shCore.js b/src/_h5ai/js/lib/sh/shCore.js
    new file mode 100644
    index 00000000..b47b6454
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shCore.js
    @@ -0,0 +1,17 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+="                    ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
    diff --git a/src/_h5ai/js/lib/sh/shLegacy.js b/src/_h5ai/js/lib/sh/shLegacy.js
    new file mode 100644
    index 00000000..6d9fd4d1
    --- /dev/null
    +++ b/src/_h5ai/js/lib/sh/shLegacy.js
    @@ -0,0 +1,17 @@
    +/**
    + * SyntaxHighlighter
    + * http://alexgorbatchev.com/SyntaxHighlighter
    + *
    + * SyntaxHighlighter is donationware. If you are using it, please donate.
    + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    + *
    + * @version
    + * 3.0.83 (July 02 2010)
    + * 
    + * @copyright
    + * Copyright (C) 2004-2010 Alex Gorbatchev.
    + *
    + * @license
    + * Dual licensed under the MIT and GPL licenses.
    + */
    +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?\\\\w+)\\\\]$","U"),i=1,p=0;p
    Date: Sun, 5 Aug 2012 02:37:52 +0200
    Subject: [PATCH 54/67] Updates text preview styling.
    
    ---
     src/_h5ai/apache/h5ai-header.html   | 2 +-
     src/_h5ai/css/inc/preview-txt.less  | 5 +++++
     src/_h5ai/css/lib/sh/shCore.less    | 6 ++++--
     src/_h5ai/js/inc/ext/preview-txt.js | 4 ++--
     src/_h5ai/php/h5ai-index.php        | 2 +-
     5 files changed, 13 insertions(+), 6 deletions(-)
    
    diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html
    index 2e62d06e..656d1937 100644
    --- a/src/_h5ai/apache/h5ai-header.html
    +++ b/src/_h5ai/apache/h5ai-header.html
    @@ -11,7 +11,7 @@
     	
     	
     	
    -	
    +	
     	
     	
     
    diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less
    index 381f190b..da9bd3b5 100644
    --- a/src/_h5ai/css/inc/preview-txt.less
    +++ b/src/_h5ai/css/inc/preview-txt.less
    @@ -27,6 +27,11 @@
     #pv-txt-text {
     	.syntaxhighlighter {
     		overflow: visible !important;
    +
    +		.gutter .line {
    +			border-right: none !important;
    +			// border-right: 3px solid #6CE26C !important;
    +		}
     	}
     }
     
    diff --git a/src/_h5ai/css/lib/sh/shCore.less b/src/_h5ai/css/lib/sh/shCore.less
    index 34f6864a..41aa11aa 100644
    --- a/src/_h5ai/css/lib/sh/shCore.less
    +++ b/src/_h5ai/css/lib/sh/shCore.less
    @@ -44,10 +44,12 @@
       vertical-align: baseline !important;
       width: auto !important;
       box-sizing: content-box !important;
    -  font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
    +  // font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
    +  font-family: "Ubuntu Mono", "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
       font-weight: normal !important;
       font-style: normal !important;
    -  font-size: 1em !important;
    +  // font-size: 1em !important;
    +  font-size: 16px !important;
       min-height: inherit !important;
       min-height: auto !important;
     }
    diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js
    index 803065ee..894f989f 100644
    --- a/src/_h5ai/js/inc/ext/preview-txt.js
    +++ b/src/_h5ai/js/inc/ext/preview-txt.js
    @@ -42,9 +42,9 @@ modulejs.define('ext/preview-txt', ['_', '$', 'sh', 'core/settings', 'core/resou
     				barheight = 31;
     
     			$container.css({
    -				width: rect.width - 2 * margin,
    +				// width: rect.width - 2 * margin,
     				height: rect.height - 2 * margin - barheight - 32,
    -				left: margin,
    +				// left: margin,
     				top: margin
     			});
     		},
    diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php
    index 2ef519b9..5b070d2f 100644
    --- a/src/_h5ai/php/h5ai-index.php
    +++ b/src/_h5ai/php/h5ai-index.php
    @@ -12,7 +12,7 @@
     	
     	
     	
    -	
    +	
     	
     	
     
    
    From a0a8882db7905e3c813075504ed826891d5d9fb6 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 02:56:28 +0200
    Subject: [PATCH 55/67] Updates readme.
    
    ---
     README.md | 8 +++-----
     1 file changed, 3 insertions(+), 5 deletions(-)
    
    diff --git a/README.md b/README.md
    index 382a410a..d696c940 100644
    --- a/README.md
    +++ b/README.md
    @@ -4,11 +4,9 @@ Please don't use files from the `src` folder for installation.
     They need to be preprocessed to work correctly. You'll find a preprocessed
     package on the [project page](http://larsjung.de/h5ai).
     
    -To report a bug or make a feature request
    -please create [a new issue](http://github.com/lrsjng/h5ai/issues/new).
    -
    -* Website with download, docs and demo: 
    -* Sources: 
    +* to report a bug or make a feature request please create [a new issue](http://github.com/lrsjng/h5ai/issues/new) on GitHub
    +* website with download, docs and demo: 
    +* sources: 
     
     h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h5ai/blob/master/LICENSE.txt).
     It profits from these great projects:
    
    From 725cb1a6b8ffdaa440cf074826a906884471f904 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 17:33:19 +0200
    Subject: [PATCH 56/67] Updates makefile to work with fQuery 0.3.0.
    
    ---
     makefile.js | 22 ++++++++++++----------
     1 file changed, 12 insertions(+), 10 deletions(-)
    
    diff --git a/makefile.js b/makefile.js
    index eff91e22..8d1e6c60 100644
    --- a/makefile.js
    +++ b/makefile.js
    @@ -3,8 +3,7 @@
     
     
     var path = require('path'),
    -	child_process = require('child_process'),
    -	moment = require('moment');
    +	child_process = require('child_process');
     
     
     var version = '0.21-dev-37',
    @@ -46,15 +45,18 @@ var version = '0.21-dev-37',
     	};
     
     
    -module.exports = function (make, $) {
    +module.exports = function (make) {
     
    -	var stamp, replacements;
    +	var Event = make.Event,
    +		$ = make.fQuery,
    +		moment = make.moment,
    +		stamp, replacements;
     
     
     	make.defaults('build');
     
     
    -	make.before = function () {
    +	make.before(function () {
     
     		stamp = moment();
     
    @@ -63,8 +65,8 @@ module.exports = function (make, $) {
     			stamp: stamp.format('YYYY-MM-DD HH:mm:ss')
     		};
     
    -		$.info({ method: 'before', message: version + ' ' + replacements.stamp });
    -	};
    +		Event.info({ method: 'before', message: version + ' ' + replacements.stamp });
    +	});
     
     
     	make.target('inc', [], 'increase build number, if any')
    @@ -81,7 +83,7 @@ module.exports = function (make, $) {
     
     				version = newVersion;
     				replacements.version = version;
    -				$.ok({ method: 'inc', message: 'version is now ' + version });
    +				Event.ok({ method: 'inc', message: 'version is now ' + version });
     			}
     		});
     
    @@ -163,10 +165,10 @@ module.exports = function (make, $) {
     			child_process.exec(command, options, function (error, stdout, stderr) {
     
     				if (error === null) {
    -					$.ok({ method: 'zip', message: target });
    +					Event.ok({ method: 'zip', message: target });
     					done();
     				} else {
    -					$.error({ method: 'zip', message: stderr });
    +					Event.error({ method: 'zip', message: stderr });
     					fail();
     				}
     			});
    
    From a8e0474cca4a9a6689ea2b54a5fb9a69357ec98b Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 17:39:33 +0200
    Subject: [PATCH 57/67] Updates readme.
    
    ---
     README.md | 14 ++++++++++++++
     1 file changed, 14 insertions(+)
    
    diff --git a/README.md b/README.md
    index d696c940..b111e738 100644
    --- a/README.md
    +++ b/README.md
    @@ -25,6 +25,20 @@ It profits from these great projects:
     [Underscore.js](http://underscorejs.org) (MIT)
     
     
    +## Build
    +
    +A prebuilt package can be found on the [project page](http://larsjung.de/h5ai). But if you want to build
    +h5ai yourself you have to install `fQuery` first:
    +
    +    > npm install -g fquery
    +
    +To build the project run the following command from this root directory
    +
    +    > makejs
    +
    +Run `makejs -t` to list all possible targets.
    +
    +
     ## Changelog
     
     
    
    From 0f948a56d8d30c1f51ea5642ffa9bd0041ed4130 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 17:42:06 +0200
    Subject: [PATCH 58/67] Updates readme.
    
    ---
     README.md | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index b111e738..13164368 100644
    --- a/README.md
    +++ b/README.md
    @@ -2,7 +2,7 @@
     
     Please don't use files from the `src` folder for installation.
     They need to be preprocessed to work correctly. You'll find a preprocessed
    -package on the [project page](http://larsjung.de/h5ai).
    +package on the [project page](http://larsjung.de/h5ai/).
     
     * to report a bug or make a feature request please create [a new issue](http://github.com/lrsjng/h5ai/issues/new) on GitHub
     * website with download, docs and demo: 
    @@ -27,12 +27,12 @@ It profits from these great projects:
     
     ## Build
     
    -A prebuilt package can be found on the [project page](http://larsjung.de/h5ai). But if you want to build
    -h5ai yourself you have to install `fQuery` first:
    +A prebuilt package can be found on the [project page](http://larsjung.de/h5ai/). If you want to build
    +h5ai yourself you need to install [fQuery](http://larsjung.de/fquery/) first:
     
         > npm install -g fquery
     
    -To build the project run the following command from this root directory
    +To build the project run the following command inside the project's root directory
     
         > makejs
     
    
    From d4a213beacf2fd4719c338090ad93cc24d257803 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 19:56:26 +0200
    Subject: [PATCH 59/67] Updates makefile.js.
    
    ---
     README.md                          |  3 ++-
     makefile.js                        | 27 ++++++++++++++++++---------
     src/_h5ai/css/inc/preview-txt.less |  1 -
     3 files changed, 20 insertions(+), 11 deletions(-)
    
    diff --git a/README.md b/README.md
    index 13164368..0a94f027 100644
    --- a/README.md
    +++ b/README.md
    @@ -25,6 +25,7 @@ It profits from these great projects:
     [Underscore.js](http://underscorejs.org) (MIT)
     
     
    +
     ## Build
     
     A prebuilt package can be found on the [project page](http://larsjung.de/h5ai/). If you want to build
    @@ -39,8 +40,8 @@ To build the project run the following command inside the project's root directo
     Run `makejs -t` to list all possible targets.
     
     
    -## Changelog
     
    +## Changelog
     
     ### v0.21 - *2012-08-??*
     
    diff --git a/makefile.js b/makefile.js
    index 8d1e6c60..32daec06 100644
    --- a/makefile.js
    +++ b/makefile.js
    @@ -6,7 +6,7 @@ var path = require('path'),
     	child_process = require('child_process');
     
     
    -var version = '0.21-dev-37',
    +var version = '0.21-dev-43',
     
     	root = path.resolve(__dirname),
     	src = path.join(root, 'src'),
    @@ -159,17 +159,26 @@ module.exports = function (make) {
     		.async(function (done, fail) {
     
     			var target = path.join(build, 'h5ai-' + version + '.zip'),
    -				command = 'zip -ro ' + target + ' _h5ai',
    -				options = { cwd: build };
    +				cmd = 'zip',
    +				args = ['-ro', target, '_h5ai'],
    +				options = { cwd: build },
    +				proc = child_process.spawn(cmd, args, options);
     
    -			child_process.exec(command, options, function (error, stdout, stderr) {
    +			Event.info({ method: 'exec', message: cmd + ' ' + args.join(' ') });
     
    -				if (error === null) {
    -					Event.ok({ method: 'zip', message: target });
    -					done();
    -				} else {
    -					Event.error({ method: 'zip', message: stderr });
    +			// proc.stdout.on('data', function (data) {
    +				// process.stdout.write(data);
    +			// });
    +			proc.stderr.on('data', function (data) {
    +				process.stderr.write(data);
    +			});
    +			proc.on('exit', function (code) {
    +				if (code) {
    +					Event.error({ method: 'exec', message: cmd + ' exit code ' + code });
     					fail();
    +				} else {
    +					Event.ok({ method: 'exec', message: 'created zipball ' + target });
    +					done();
     				}
     			});
     		});
    diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less
    index da9bd3b5..97e8db62 100644
    --- a/src/_h5ai/css/inc/preview-txt.less
    +++ b/src/_h5ai/css/inc/preview-txt.less
    @@ -30,7 +30,6 @@
     
     		.gutter .line {
     			border-right: none !important;
    -			// border-right: 3px solid #6CE26C !important;
     		}
     	}
     }
    
    From 298d2e2efd117388c03d6093c93d4fe97d36f025 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Sun, 5 Aug 2012 22:01:40 +0200
    Subject: [PATCH 60/67] Loads SyntaxHighlighter on demand.
    
    ---
     makefile.js                         |  2 +-
     src/_h5ai/js/inc/ext/preview-txt.js | 27 ++++++++++++++++++++++++--
     src/_h5ai/js/inc/main.js            |  3 +--
     src/_h5ai/js/scripts.js             | 17 ----------------
     src/_h5ai/js/syntaxhighlighter.js   | 30 +++++++++++++++++++++++++++++
     5 files changed, 57 insertions(+), 22 deletions(-)
     create mode 100644 src/_h5ai/js/syntaxhighlighter.js
    
    diff --git a/makefile.js b/makefile.js
    index 32daec06..37397772 100644
    --- a/makefile.js
    +++ b/makefile.js
    @@ -6,7 +6,7 @@ var path = require('path'),
     	child_process = require('child_process');
     
     
    -var version = '0.21-dev-43',
    +var version = '0.21-dev-45',
     
     	root = path.resolve(__dirname),
     	src = path.join(root, 'src'),
    diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js
    index 894f989f..d145e487 100644
    --- a/src/_h5ai/js/inc/ext/preview-txt.js
    +++ b/src/_h5ai/js/inc/ext/preview-txt.js
    @@ -1,5 +1,5 @@
     
    -modulejs.define('ext/preview-txt', ['_', '$', 'sh', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, SH, allsettings, resource, store, entry) {
    +modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, allsettings, resource, store, entry) {
     
     	var defaults = {
     			enabled: false,
    @@ -34,6 +34,24 @@ modulejs.define('ext/preview-txt', ['_', '$', 'sh', 'core/settings', 'core/resou
     		currentEntries = [],
     		currentIdx = 0,
     
    +		loadSyntaxhighlighter = function (callback) {
    +
    +			var id = 'SyntaxHighlighter';
    +
    +			if (window[id]) {
    +				callback(window[id]);
    +			} else {
    +				$.ajax({
    +					url: allsettings.h5aiAbsHref + 'js/syntaxhighlighter.js',
    +					dataType: 'script',
    +					complete: function () {
    +
    +						callback(window[id]);
    +					}
    +				});
    +			}
    +		},
    +
     		adjustSize = function () {
     
     			var rect = $(window).fracs('viewport'),
    @@ -94,7 +112,12 @@ modulejs.define('ext/preview-txt', ['_', '$', 'sh', 'core/settings', 'core/resou
     					var $nText = $(templateText).hide().addClass('toolbar: false; brush:').addClass(settings.types[current.type] || 'plain').text(content);
     
     					$text.replaceWith($nText);
    -					SH.highlight({}, $nText[0]);
    +					loadSyntaxhighlighter(function (sh) {
    +
    +						if (sh) {
    +							sh.highlight({}, $nText[0]);
    +						}
    +					});
     					$nText.fadeIn(200);
     
     					adjustSize();
    diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js
    index 1b5e5195..feacef09 100644
    --- a/src/_h5ai/js/inc/main.js
    +++ b/src/_h5ai/js/inc/main.js
    @@ -47,7 +47,7 @@
     
     
     	$(function () {
    -		/*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, SyntaxHighlighter, _ */
    +		/*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, _ */
     
     		// Register predefined globals on doc ready, so the script order inside
     		// the document doesn't matter. `jQuery`, `moment` and `underscore` are
    @@ -59,7 +59,6 @@
     		modulejs.define('$', function () { return jQuery; });
     		modulejs.define('modernizr', Modernizr);
     		modulejs.define('moment', function () { return moment; });
    -		modulejs.define('sh', SyntaxHighlighter);
     		modulejs.define('_', function () { return _; });
     
     		modulejs.require($('body').attr('id'));
    diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js
    index 3b00fe15..2ce2f379 100644
    --- a/src/_h5ai/js/scripts.js
    +++ b/src/_h5ai/js/scripts.js
    @@ -17,23 +17,6 @@
     // @include "lib/base64.js"
     // @include "lib/spin-1.2.5.min.js"
     
    -// @include "lib/sh/shCore.js"
    -// @include "lib/sh/shBrushBash.js"
    -// @include "lib/sh/shBrushCSharp.js"
    -// @include "lib/sh/shBrushCpp.js"
    -// @include "lib/sh/shBrushCss.js"
    -// @include "lib/sh/shBrushDiff.js"
    -// @include "lib/sh/shBrushJScript.js"
    -// @include "lib/sh/shBrushJava.js"
    -// @include "lib/sh/shBrushPerl.js"
    -// @include "lib/sh/shBrushPhp.js"
    -// @include "lib/sh/shBrushPlain.js"
    -// @include "lib/sh/shBrushPython.js"
    -// @include "lib/sh/shBrushRuby.js"
    -// @include "lib/sh/shBrushSass.js"
    -// @include "lib/sh/shBrushXml.js"
    -
    -
     // h5ai
     // ----
     // @include "inc/main.js"
    diff --git a/src/_h5ai/js/syntaxhighlighter.js b/src/_h5ai/js/syntaxhighlighter.js
    new file mode 100644
    index 00000000..30955b80
    --- /dev/null
    +++ b/src/_h5ai/js/syntaxhighlighter.js
    @@ -0,0 +1,30 @@
    +
    +// @include "lib/sh/shCore.js"
    +// @-include "lib/sh/shLegacy.js"
    +// @-include "lib/sh/shAutoloader.js"
    +
    +// @include "lib/sh/shBrushAS3.js"
    +// @include "lib/sh/shBrushAppleScript.js"
    +// @include "lib/sh/shBrushBash.js"
    +// @include "lib/sh/shBrushCSharp.js"
    +// @include "lib/sh/shBrushColdFusion.js"
    +// @include "lib/sh/shBrushCpp.js"
    +// @include "lib/sh/shBrushCss.js"
    +// @include "lib/sh/shBrushDelphi.js"
    +// @include "lib/sh/shBrushDiff.js"
    +// @include "lib/sh/shBrushErlang.js"
    +// @include "lib/sh/shBrushGroovy.js"
    +// @include "lib/sh/shBrushJScript.js"
    +// @include "lib/sh/shBrushJava.js"
    +// @include "lib/sh/shBrushJavaFX.js"
    +// @include "lib/sh/shBrushPerl.js"
    +// @include "lib/sh/shBrushPhp.js"
    +// @include "lib/sh/shBrushPlain.js"
    +// @include "lib/sh/shBrushPowerShell.js"
    +// @include "lib/sh/shBrushPython.js"
    +// @include "lib/sh/shBrushRuby.js"
    +// @include "lib/sh/shBrushSass.js"
    +// @include "lib/sh/shBrushScala.js"
    +// @include "lib/sh/shBrushSql.js"
    +// @include "lib/sh/shBrushVb.js"
    +// @include "lib/sh/shBrushXml.js"
    
    From 9c1142bd025ef8497b50c5d7ab190de56d138b57 Mon Sep 17 00:00:00 2001
    From: Lars Jung 
    Date: Mon, 6 Aug 2012 00:21:00 +0200
    Subject: [PATCH 61/67] Adds markdown preview rendering. Adds markdown type and
     icons.
    
    ---
     README.md                                     |    4 +-
     src/_h5ai/apache/h5ai-header.html             |    2 +-
     src/_h5ai/config.js                           |    7 +-
     src/_h5ai/css/inc/preview-txt.less            |   22 +
     src/_h5ai/icons/16x16/markdown.png            |  Bin 0 -> 627 bytes
     src/_h5ai/icons/48x48/markdown.png            |  Bin 0 -> 2680 bytes
     src/_h5ai/index.html                          |    2 +-
     src/_h5ai/js/inc/ext/preview-txt.js           |   58 +-
     src/_h5ai/js/lib/markdown-0.4.0.js            | 1616 +++++++++++++++++
     .../modernizr-2.6.1.min.js}                   |    0
     src/_h5ai/js/markdown.js                      |    2 +
     src/_h5ai/js/modernizr.js                     |    2 +
     src/_h5ai/php/h5ai-index.php                  |    2 +-
     13 files changed, 1696 insertions(+), 21 deletions(-)
     create mode 100644 src/_h5ai/icons/16x16/markdown.png
     create mode 100644 src/_h5ai/icons/48x48/markdown.png
     create mode 100644 src/_h5ai/js/lib/markdown-0.4.0.js
     rename src/_h5ai/js/{modernizr.min.js => lib/modernizr-2.6.1.min.js} (100%)
     create mode 100644 src/_h5ai/js/markdown.js
     create mode 100644 src/_h5ai/js/modernizr.js
    
    diff --git a/README.md b/README.md
    index 0a94f027..e17b08bc 100644
    --- a/README.md
    +++ b/README.md
    @@ -18,6 +18,7 @@ It profits from these great projects:
     [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT),
     [jQuery.qrcode](http://larsjung.de/qrcode/) (MIT),
     [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT),
    +[markdown-js](http://github.com/evilstreak/markdown-js) (MIT),
     [Modernizr](http://www.modernizr.com) (MIT/BSD),
     [modulejs](http://larsjung.de/modulejs/) (MIT),
     [Moment.js](http://momentjs.com) (MIT),
    @@ -25,7 +26,6 @@ It profits from these great projects:
     [Underscore.js](http://underscorejs.org) (MIT)
     
     
    -
     ## Build
     
     A prebuilt package can be found on the [project page](http://larsjung.de/h5ai/). If you want to build
    @@ -52,6 +52,8 @@ Run `makejs -t` to list all possible targets.
     * improves filter (now ignorecase, now only checks if chars in right order)
     * adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc)
     * adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (keys: left, right, esc)
    +* adds Markdown preview
    +* adds new type and icon `markdown`
     * changes language code `gr` to `el`
     * adds localization for filter placeholder
     * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo)
    diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html
    index 656d1937..c76e67c7 100644
    --- a/src/_h5ai/apache/h5ai-header.html
    +++ b/src/_h5ai/apache/h5ai-header.html
    @@ -13,7 +13,7 @@
     	
     	
     	
    -	
    +	
     
     
     	
    diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index cb7e6962..f6e14fda 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -180,7 +180,8 @@ var H5AI_CONFIG = { /* * Show text file preview on click. - * "types" maps file types to SyntaxHighligher brushes. + * "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will + * be rendered to HTML. * * For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ */ @@ -191,6 +192,7 @@ var H5AI_CONFIG = { "copying": "plain", "css": "css", "install": "plain", + "markdown": "plain", "readme": "plain", "script": "shell", "text": "plain", @@ -310,6 +312,7 @@ var H5AI_CONFIG = { "js": [".js", ".json"], "log": [".log", "changelog"], "makefile": [".pom", "build.xml", "pom.xml"], + "markdown": [".markdown", ".md"], "package": [], "pdf": [".pdf"], "php": [".php"], @@ -330,7 +333,7 @@ var H5AI_CONFIG = { "sql": [], "tar": [".tar"], "tex": [".tex"], - "text": [".diff", ".markdown", ".md", ".patch", ".text", ".txt"], + "text": [".diff", ".patch", ".text", ".txt"], "tiff": [".tiff"], "unknown": [], "vcal": [".vcal"], diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less index 97e8db62..e784f40f 100644 --- a/src/_h5ai/css/inc/preview-txt.less +++ b/src/_h5ai/css/inc/preview-txt.less @@ -32,6 +32,28 @@ border-right: none !important; } } + + &.markdown { + font-size: 16px; + padding: 8px 24px; + + a, a:active, a:visited { + color: #2080FF; + text-decoration: none; + cursor: pointer; + + &:hover { + color: #68A9FF; + } + } + + pre, code { + font-family: "Ubuntu Mono", monospace; + } + code { + color: #393; + } + } } #pv-txt-close { diff --git a/src/_h5ai/icons/16x16/markdown.png b/src/_h5ai/icons/16x16/markdown.png new file mode 100644 index 0000000000000000000000000000000000000000..25c8373c61a921752a7e6a7177817212e9e5bfcf GIT binary patch literal 627 zcmV-(0*w8MP)ukaG?EdWB~FW(&FL z7~eF=Fh?Xwf|POS N002ovPDHLkV1h8F5N7}Y literal 0 HcmV?d00001 diff --git a/src/_h5ai/icons/48x48/markdown.png b/src/_h5ai/icons/48x48/markdown.png new file mode 100644 index 0000000000000000000000000000000000000000..62ed33c904707f4fbdca3f97b897dc1c3266a6bf GIT binary patch literal 2680 zcmV-;3WxQHP)t^fffsa zAc+yg7@~wo_@ap)z{JE4q92Hnm`F_2m{1ZvVS+|NjI9yS57ky0!77CE)|$dnw#%~H z?Y`Z;?|0^$jp{6w zN^_HwlfQrX;fEg=Ld+UtY5>9*qeqYabno814{EImbHkpQ!5bX~KnQVJf%|&H zI(@xTN{$~t{><&S-~K(|yfH@kZjuH@$HvC)Qc4j=Y$3#D2j5MPF$Sd+V`F1?0i#XK zfeSgnP=9~_kW#AU!)Rxp)C~B#qJ!Dr-#-Kl0Uy8xqFO-G7(@7qcGyWCc;spBdFaWu z_P@VA!3|&g3G++E|HhUU3=v$(Cg#8ZL6Z-@_#++ujou3(`0(5^Th>xK=G(W$x=_jz}6j-8u_`SKm(y!g`F)aqW_JHP(pah^W-G7mlW zTaLeZ27sCKdA|ARGraK9Tm0$RJ3R99gR%X0z!c!NqaSp#IIjKecc)vym=Qt zI`BM)Upd9yw_V%v?SuF1Wz9gA*H2CH%V++|-s`sVvtJ$N^ZUm5`rS7H@V9@R4oDlP zJFY!yK-<%ch0f=XzQxq+5e z+l^PZz3=Oe@q_@B9cqx>+{PaP|GCndvolK^c=Z0@oumIe&9{I2EVJkHjI7DEd~1y1 z{9*ymQy{>$ExZmnr%UwlMbeGLaT1-0S5Cao-tjFhZTt6ZC)<D1rx+jG zNIL1TZ+t6%K6dhwbaj)k3th4?|9ImJPd@t+*N<&vZn41dU@rhij-O_*Kf|*xzDh2W z;{LmC6CLJ+(|*D>H^?;id;5@5CXUE;d+X6 zDiOR_cNM9GO{MCRFIHF=B7anW$jG)R1R#{wxUNELgQpEjX|yre`7$b1;PjbuXalb6 zu~euarC{rZLEbyNfMp4k(pZ*ccp!^yTP&@Vv1DUn*N^n^{?t5~bOOh=IKNcHwj@d$ z#>X}=H(#Vwts!Lto0Tu)B@0L)uq=r!1yTwe$LeSRmXydudu`&>im1WffUMEkxq8bw zvOUSzkqgVUJL4BcN@;d%8g6kTt6IPf&9*-SQQa+3C>n3Wi6rb=QGd;(6CaBgQi>L! z;oq?SP@8PKiGCC(o~O{p;CTwAG@eqFD|M9Cl&f_-tS<}~pZCgPc$24NS zZApY|hEmzM4+yCn?^;q)tvB+6FyJKY;GJ@%j%`__Q%(zp4h3d_x5b4#r2-Cw^MJEl z!b_}h^1Y8JR_kO_2|T6gNjfYRDvS*DvQn;6ELZV7gJlU)Nt+GB{Y=g*0gc%h8S3TC z^a4r8rdoH|wqb~ce3^39C6lsQ$XD3EXBz^rmrJ-#YaR%3Ahw(qmXuf$M8a;#1&MkI zZ?Km;Z{F293^9BtRqFIKvogS*-J5_$`E5zbwvB7rTq|z2?OKugK(^CN#Lj>WCyGub z#l;l&G+iM2Og8h!YI8=^g}N>&yCpHd77{|xpG#wax%mP^{TUJo8?7{TrEx5YV_VEE z7Dy!>GN}YB#R^Ir268_^>f939RD!cJOKceFqf+zOv->LSd>J=UM2cn&)XW1i5;xoOfYrlJyeqK$d&&9B-SUPIA?{fv(Sexu&@(5FJ^kR;1RSX`NmuoJrr*NA!k8t^>3&oS9xg zX^rQppxyOUP-k`1ABVLq4`|&e+B|In4kVf}`PFx(D3xmfq*6Avv_J^dDaBx}hf2-G z7|0hJYlZ8sUeC$*XBo<6nVeZ9mrY_>7AGfWnnfL?Qx3J73kZzS+{Bj8}j12TLw_GIYI0ylK*)+3@E2I++J2tJMH zn%&3)wrvHqkZrdnf)*FDq(nLbnjG*Y<(8@SXZXVBb}_$PVz93Vc^OY?j4>qZC90v) zJL1yuyApAmNdCQl4d&8dOc3%erx9_S@Ui+g;rY-L6B8@lI_XlM|IYw-$h?6xG3uxR zH6VZJ(4kYEP6(qNMHPPB>tgz#;Xa2B9XbW%o0tO^Dgz%p@x&8HT-VLqci(+mwr}5_ z^*@qQVp$h>5j|##`wid6l*1iErvK~f^xGyTCW_BJ_uL0hJ@wQP8Yh%xxUjh^fDzyt z;Cf&S(APEuS61>gfS&-~0nQm?OmH$Ogpj}hu#N`!#FfF>QR*~|m<5)MF&ZLAs{ld> mn}%zB8vohDGsd)>BK`+iZ&0MNCm84e0000Whp literal 0 HcmV?d00001 diff --git a/src/_h5ai/index.html b/src/_h5ai/index.html index 7eca9645..295c8bee 100644 --- a/src/_h5ai/index.html +++ b/src/_h5ai/index.html @@ -13,7 +13,7 @@ - +

    h5ai

    diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js index d145e487..b1dcbdd5 100644 --- a/src/_h5ai/js/inc/ext/preview-txt.js +++ b/src/_h5ai/js/inc/ext/preview-txt.js @@ -4,6 +4,13 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', var defaults = { enabled: false, types: { + authors: 'plain', + copying: 'plain', + css: 'css', + install: 'plain', + markdown: 'plain', + readme: 'plain', + script: 'shell', text: 'plain', js: 'js' } @@ -14,7 +21,7 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', template = '
    ' + '
    ' + '
    ' + - '
    ' +
    +							'
    ' + '
    ' + '
    ' + '
      ' + @@ -30,27 +37,34 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', '
    ', templateText = '
    ',
    +		templateMarkdown = '
    ', currentEntries = [], currentIdx = 0, - loadSyntaxhighlighter = function (callback) { + loadScript = function (url, globalId, callback) { - var id = 'SyntaxHighlighter'; - - if (window[id]) { - callback(window[id]); + if (window[globalId]) { + callback(window[globalId]); } else { $.ajax({ - url: allsettings.h5aiAbsHref + 'js/syntaxhighlighter.js', + url: url, dataType: 'script', complete: function () { - callback(window[id]); + callback(window[globalId]); } }); } }, + loadSyntaxhighlighter = function (callback) { + + loadScript(allsettings.h5aiAbsHref + 'js/syntaxhighlighter.js', 'SyntaxHighlighter', callback); + }, + loadMarkdown = function (callback) { + + loadScript(allsettings.h5aiAbsHref + 'js/markdown.js', 'markdown', callback); + }, adjustSize = function () { @@ -109,15 +123,29 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', $text.fadeOut(100, function () { - var $nText = $(templateText).hide().addClass('toolbar: false; brush:').addClass(settings.types[current.type] || 'plain').text(content); + var $nText; - $text.replaceWith($nText); - loadSyntaxhighlighter(function (sh) { + if (current.type === 'markdown') { + $nText = $(templateMarkdown).hide(); + $text.replaceWith($nText); - if (sh) { - sh.highlight({}, $nText[0]); - } - }); + loadMarkdown(function (md) { + + if (md) { + $nText.html(md.toHTML(content)); + } + }); + } else { + $nText = $(templateText).hide().addClass('toolbar: false; brush:').addClass(settings.types[current.type] || 'plain').text(content); + $text.replaceWith($nText); + + loadSyntaxhighlighter(function (sh) { + + if (sh) { + sh.highlight({}, $nText[0]); + } + }); + } $nText.fadeIn(200); adjustSize(); diff --git a/src/_h5ai/js/lib/markdown-0.4.0.js b/src/_h5ai/js/lib/markdown-0.4.0.js new file mode 100644 index 00000000..dbf670ee --- /dev/null +++ b/src/_h5ai/js/lib/markdown-0.4.0.js @@ -0,0 +1,1616 @@ +// Released under MIT license +// Copyright (c) 2009-2010 Dominic Baggott +// Copyright (c) 2009-2010 Ash Berlin +// Copyright (c) 2011 Christoph Dorn (http://www.christophdorn.com) + +(function( expose ) { + +/** + * class Markdown + * + * Markdown processing in Javascript done right. We have very particular views + * on what constitutes 'right' which include: + * + * - produces well-formed HTML (this means that em and strong nesting is + * important) + * + * - has an intermediate representation to allow processing of parsed data (We + * in fact have two, both as [JsonML]: a markdown tree and an HTML tree). + * + * - is easily extensible to add new dialects without having to rewrite the + * entire parsing mechanics + * + * - has a good test suite + * + * This implementation fulfills all of these (except that the test suite could + * do with expanding to automatically run all the fixtures from other Markdown + * implementations.) + * + * ##### Intermediate Representation + * + * *TODO* Talk about this :) Its JsonML, but document the node names we use. + * + * [JsonML]: http://jsonml.org/ "JSON Markup Language" + **/ +var Markdown = expose.Markdown = function Markdown(dialect) { + switch (typeof dialect) { + case "undefined": + this.dialect = Markdown.dialects.Gruber; + break; + case "object": + this.dialect = dialect; + break; + default: + if (dialect in Markdown.dialects) { + this.dialect = Markdown.dialects[dialect]; + } + else { + throw new Error("Unknown Markdown dialect '" + String(dialect) + "'"); + } + break; + } + this.em_state = []; + this.strong_state = []; + this.debug_indent = ""; +}; + +/** + * parse( markdown, [dialect] ) -> JsonML + * - markdown (String): markdown string to parse + * - dialect (String | Dialect): the dialect to use, defaults to gruber + * + * Parse `markdown` and return a markdown document as a Markdown.JsonML tree. + **/ +expose.parse = function( source, dialect ) { + // dialect will default if undefined + var md = new Markdown( dialect ); + return md.toTree( source ); +}; + +/** + * toHTML( markdown, [dialect] ) -> String + * toHTML( md_tree ) -> String + * - markdown (String): markdown string to parse + * - md_tree (Markdown.JsonML): parsed markdown tree + * + * Take markdown (either as a string or as a JsonML tree) and run it through + * [[toHTMLTree]] then turn it into a well-formated HTML fragment. + **/ +expose.toHTML = function toHTML( source , dialect , options ) { + var input = expose.toHTMLTree( source , dialect , options ); + + return expose.renderJsonML( input ); +}; + +/** + * toHTMLTree( markdown, [dialect] ) -> JsonML + * toHTMLTree( md_tree ) -> JsonML + * - markdown (String): markdown string to parse + * - dialect (String | Dialect): the dialect to use, defaults to gruber + * - md_tree (Markdown.JsonML): parsed markdown tree + * + * Turn markdown into HTML, represented as a JsonML tree. If a string is given + * to this function, it is first parsed into a markdown tree by calling + * [[parse]]. + **/ +expose.toHTMLTree = function toHTMLTree( input, dialect , options ) { + // convert string input to an MD tree + if ( typeof input ==="string" ) input = this.parse( input, dialect ); + + // Now convert the MD tree to an HTML tree + + // remove references from the tree + var attrs = extract_attr( input ), + refs = {}; + + if ( attrs && attrs.references ) { + refs = attrs.references; + } + + var html = convert_tree_to_html( input, refs , options ); + merge_text_nodes( html ); + return html; +}; + +// For Spidermonkey based engines +function mk_block_toSource() { + return "Markdown.mk_block( " + + uneval(this.toString()) + + ", " + + uneval(this.trailing) + + ", " + + uneval(this.lineNumber) + + " )"; +} + +// node +function mk_block_inspect() { + var util = require('util'); + return "Markdown.mk_block( " + + util.inspect(this.toString()) + + ", " + + util.inspect(this.trailing) + + ", " + + util.inspect(this.lineNumber) + + " )"; + +} + +var mk_block = Markdown.mk_block = function(block, trail, line) { + // Be helpful for default case in tests. + if ( arguments.length == 1 ) trail = "\n\n"; + + var s = new String(block); + s.trailing = trail; + // To make it clear its not just a string + s.inspect = mk_block_inspect; + s.toSource = mk_block_toSource; + + if (line != undefined) + s.lineNumber = line; + + return s; +}; + +function count_lines( str ) { + var n = 0, i = -1; + while ( ( i = str.indexOf('\n', i+1) ) !== -1) n++; + return n; +} + +// Internal - split source into rough blocks +Markdown.prototype.split_blocks = function splitBlocks( input, startLine ) { + // [\s\S] matches _anything_ (newline or space) + var re = /([\s\S]+?)($|\n(?:\s*\n|$)+)/g, + blocks = [], + m; + + var line_no = 1; + + if ( ( m = /^(\s*\n)/.exec(input) ) != null ) { + // skip (but count) leading blank lines + line_no += count_lines( m[0] ); + re.lastIndex = m[0].length; + } + + while ( ( m = re.exec(input) ) !== null ) { + blocks.push( mk_block( m[1], m[2], line_no ) ); + line_no += count_lines( m[0] ); + } + + return blocks; +}; + +/** + * Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ] + * - block (String): the block to process + * - next (Array): the following blocks + * + * Process `block` and return an array of JsonML nodes representing `block`. + * + * It does this by asking each block level function in the dialect to process + * the block until one can. Succesful handling is indicated by returning an + * array (with zero or more JsonML nodes), failure by a false value. + * + * Blocks handlers are responsible for calling [[Markdown#processInline]] + * themselves as appropriate. + * + * If the blocks were split incorrectly or adjacent blocks need collapsing you + * can adjust `next` in place using shift/splice etc. + * + * If any of this default behaviour is not right for the dialect, you can + * define a `__call__` method on the dialect that will get invoked to handle + * the block processing. + */ +Markdown.prototype.processBlock = function processBlock( block, next ) { + var cbs = this.dialect.block, + ord = cbs.__order__; + + if ( "__call__" in cbs ) { + return cbs.__call__.call(this, block, next); + } + + for ( var i = 0; i < ord.length; i++ ) { + //D:this.debug( "Testing", ord[i] ); + var res = cbs[ ord[i] ].call( this, block, next ); + if ( res ) { + //D:this.debug(" matched"); + if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) ) + this.debug(ord[i], "didn't return a proper array"); + //D:this.debug( "" ); + return res; + } + } + + // Uhoh! no match! Should we throw an error? + return []; +}; + +Markdown.prototype.processInline = function processInline( block ) { + return this.dialect.inline.__call__.call( this, String( block ) ); +}; + +/** + * Markdown#toTree( source ) -> JsonML + * - source (String): markdown source to parse + * + * Parse `source` into a JsonML tree representing the markdown document. + **/ +// custom_tree means set this.tree to `custom_tree` and restore old value on return +Markdown.prototype.toTree = function toTree( source, custom_root ) { + var blocks = source instanceof Array ? source : this.split_blocks( source ); + + // Make tree a member variable so its easier to mess with in extensions + var old_tree = this.tree; + try { + this.tree = custom_root || this.tree || [ "markdown" ]; + + blocks: + while ( blocks.length ) { + var b = this.processBlock( blocks.shift(), blocks ); + + // Reference blocks and the like won't return any content + if ( !b.length ) continue blocks; + + this.tree.push.apply( this.tree, b ); + } + return this.tree; + } + finally { + if ( custom_root ) { + this.tree = old_tree; + } + } +}; + +// Noop by default +Markdown.prototype.debug = function () { + var args = Array.prototype.slice.call( arguments); + args.unshift(this.debug_indent); + if (typeof print !== "undefined") + print.apply( print, args ); + if (typeof console !== "undefined" && typeof console.log !== "undefined") + console.log.apply( null, args ); +} + +Markdown.prototype.loop_re_over_block = function( re, block, cb ) { + // Dont use /g regexps with this + var m, + b = block.valueOf(); + + while ( b.length && (m = re.exec(b) ) != null) { + b = b.substr( m[0].length ); + cb.call(this, m); + } + return b; +}; + +/** + * Markdown.dialects + * + * Namespace of built-in dialects. + **/ +Markdown.dialects = {}; + +/** + * Markdown.dialects.Gruber + * + * The default dialect that follows the rules set out by John Gruber's + * markdown.pl as closely as possible. Well actually we follow the behaviour of + * that script which in some places is not exactly what the syntax web page + * says. + **/ +Markdown.dialects.Gruber = { + block: { + atxHeader: function atxHeader( block, next ) { + var m = block.match( /^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/ ); + + if ( !m ) return undefined; + + var header = [ "header", { level: m[ 1 ].length } ]; + Array.prototype.push.apply(header, this.processInline(m[ 2 ])); + + if ( m[0].length < block.length ) + next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) ); + + return [ header ]; + }, + + setextHeader: function setextHeader( block, next ) { + var m = block.match( /^(.*)\n([-=])\2\2+(?:\n|$)/ ); + + if ( !m ) return undefined; + + var level = ( m[ 2 ] === "=" ) ? 1 : 2; + var header = [ "header", { level : level }, m[ 1 ] ]; + + if ( m[0].length < block.length ) + next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) ); + + return [ header ]; + }, + + code: function code( block, next ) { + // | Foo + // |bar + // should be a code block followed by a paragraph. Fun + // + // There might also be adjacent code block to merge. + + var ret = [], + re = /^(?: {0,3}\t| {4})(.*)\n?/, + lines; + + // 4 spaces + content + if ( !block.match( re ) ) return undefined; + + block_search: + do { + // Now pull out the rest of the lines + var b = this.loop_re_over_block( + re, block.valueOf(), function( m ) { ret.push( m[1] ); } ); + + if (b.length) { + // Case alluded to in first comment. push it back on as a new block + next.unshift( mk_block(b, block.trailing) ); + break block_search; + } + else if (next.length) { + // Check the next block - it might be code too + if ( !next[0].match( re ) ) break block_search; + + // Pull how how many blanks lines follow - minus two to account for .join + ret.push ( block.trailing.replace(/[^\n]/g, '').substring(2) ); + + block = next.shift(); + } + else { + break block_search; + } + } while (true); + + return [ [ "code_block", ret.join("\n") ] ]; + }, + + horizRule: function horizRule( block, next ) { + // this needs to find any hr in the block to handle abutting blocks + var m = block.match( /^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/ ); + + if ( !m ) { + return undefined; + } + + var jsonml = [ [ "hr" ] ]; + + // if there's a leading abutting block, process it + if ( m[ 1 ] ) { + jsonml.unshift.apply( jsonml, this.processBlock( m[ 1 ], [] ) ); + } + + // if there's a trailing abutting block, stick it into next + if ( m[ 3 ] ) { + next.unshift( mk_block( m[ 3 ] ) ); + } + + return jsonml; + }, + + // There are two types of lists. Tight and loose. Tight lists have no whitespace + // between the items (and result in text just in the
  • ) and loose lists, + // which have an empty line between list items, resulting in (one or more) + // paragraphs inside the
  • . + // + // There are all sorts weird edge cases about the original markdown.pl's + // handling of lists: + // + // * Nested lists are supposed to be indented by four chars per level. But + // if they aren't, you can get a nested list by indenting by less than + // four so long as the indent doesn't match an indent of an existing list + // item in the 'nest stack'. + // + // * The type of the list (bullet or number) is controlled just by the + // first item at the indent. Subsequent changes are ignored unless they + // are for nested lists + // + lists: (function( ) { + // Use a closure to hide a few variables. + var any_list = "[*+-]|\\d+\\.", + bullet_list = /[*+-]/, + number_list = /\d+\./, + // Capture leading indent as it matters for determining nested lists. + is_list_re = new RegExp( "^( {0,3})(" + any_list + ")[ \t]+" ), + indent_re = "(?: {0,3}\\t| {4})"; + + // TODO: Cache this regexp for certain depths. + // Create a regexp suitable for matching an li for a given stack depth + function regex_for_depth( depth ) { + + return new RegExp( + // m[1] = indent, m[2] = list_type + "(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\s+)|" + + // m[3] = cont + "(^" + indent_re + "{0," + (depth-1) + "}[ ]{0,4})" + ); + } + function expand_tab( input ) { + return input.replace( / {0,3}\t/g, " " ); + } + + // Add inline content `inline` to `li`. inline comes from processInline + // so is an array of content + function add(li, loose, inline, nl) { + if (loose) { + li.push( [ "para" ].concat(inline) ); + return; + } + // Hmmm, should this be any block level element or just paras? + var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == "para" + ? li[li.length -1] + : li; + + // If there is already some content in this list, add the new line in + if (nl && li.length > 1) inline.unshift(nl); + + for (var i=0; i < inline.length; i++) { + var what = inline[i], + is_str = typeof what == "string"; + if (is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == "string" ) { + add_to[ add_to.length-1 ] += what; + } + else { + add_to.push( what ); + } + } + } + + // contained means have an indent greater than the current one. On + // *every* line in the block + function get_contained_blocks( depth, blocks ) { + + var re = new RegExp( "^(" + indent_re + "{" + depth + "}.*?\\n?)*$" ), + replace = new RegExp("^" + indent_re + "{" + depth + "}", "gm"), + ret = []; + + while ( blocks.length > 0 ) { + if ( re.exec( blocks[0] ) ) { + var b = blocks.shift(), + // Now remove that indent + x = b.replace( replace, ""); + + ret.push( mk_block( x, b.trailing, b.lineNumber ) ); + } + break; + } + return ret; + } + + // passed to stack.forEach to turn list items up the stack into paras + function paragraphify(s, i, stack) { + var list = s.list; + var last_li = list[list.length-1]; + + if (last_li[1] instanceof Array && last_li[1][0] == "para") { + return; + } + if (i+1 == stack.length) { + // Last stack frame + // Keep the same array, but replace the contents + last_li.push( ["para"].concat( last_li.splice(1) ) ); + } + else { + var sublist = last_li.pop(); + last_li.push( ["para"].concat( last_li.splice(1) ), sublist ); + } + } + + // The matcher function + return function( block, next ) { + var m = block.match( is_list_re ); + if ( !m ) return undefined; + + function make_list( m ) { + var list = bullet_list.exec( m[2] ) + ? ["bulletlist"] + : ["numberlist"]; + + stack.push( { list: list, indent: m[1] } ); + return list; + } + + + var stack = [], // Stack of lists for nesting. + list = make_list( m ), + last_li, + loose = false, + ret = [ stack[0].list ], + i; + + // Loop to search over block looking for inner block elements and loose lists + loose_search: + while( true ) { + // Split into lines preserving new lines at end of line + var lines = block.split( /(?=\n)/ ); + + // We have to grab all lines for a li and call processInline on them + // once as there are some inline things that can span lines. + var li_accumulate = ""; + + // Loop over the lines in this block looking for tight lists. + tight_search: + for (var line_no=0; line_no < lines.length; line_no++) { + var nl = "", + l = lines[line_no].replace(/^\n/, function(n) { nl = n; return ""; }); + + // TODO: really should cache this + var line_re = regex_for_depth( stack.length ); + + m = l.match( line_re ); + //print( "line:", uneval(l), "\nline match:", uneval(m) ); + + // We have a list item + if ( m[1] !== undefined ) { + // Process the previous list item, if any + if ( li_accumulate.length ) { + add( last_li, loose, this.processInline( li_accumulate ), nl ); + // Loose mode will have been dealt with. Reset it + loose = false; + li_accumulate = ""; + } + + m[1] = expand_tab( m[1] ); + var wanted_depth = Math.floor(m[1].length/4)+1; + //print( "want:", wanted_depth, "stack:", stack.length); + if ( wanted_depth > stack.length ) { + // Deep enough for a nested list outright + //print ( "new nested list" ); + list = make_list( m ); + last_li.push( list ); + last_li = list[1] = [ "listitem" ]; + } + else { + // We aren't deep enough to be strictly a new level. This is + // where Md.pl goes nuts. If the indent matches a level in the + // stack, put it there, else put it one deeper then the + // wanted_depth deserves. + var found = false; + for (i = 0; i < stack.length; i++) { + if ( stack[ i ].indent != m[1] ) continue; + list = stack[ i ].list; + stack.splice( i+1 ); + found = true; + break; + } + + if (!found) { + //print("not found. l:", uneval(l)); + wanted_depth++; + if (wanted_depth <= stack.length) { + stack.splice(wanted_depth); + //print("Desired depth now", wanted_depth, "stack:", stack.length); + list = stack[wanted_depth-1].list; + //print("list:", uneval(list) ); + } + else { + //print ("made new stack for messy indent"); + list = make_list(m); + last_li.push(list); + } + } + + //print( uneval(list), "last", list === stack[stack.length-1].list ); + last_li = [ "listitem" ]; + list.push(last_li); + } // end depth of shenegains + nl = ""; + } + + // Add content + if (l.length > m[0].length) { + li_accumulate += nl + l.substr( m[0].length ); + } + } // tight_search + + if ( li_accumulate.length ) { + add( last_li, loose, this.processInline( li_accumulate ), nl ); + // Loose mode will have been dealt with. Reset it + loose = false; + li_accumulate = ""; + } + + // Look at the next block - we might have a loose list. Or an extra + // paragraph for the current li + var contained = get_contained_blocks( stack.length, next ); + + // Deal with code blocks or properly nested lists + if (contained.length > 0) { + // Make sure all listitems up the stack are paragraphs + forEach( stack, paragraphify, this); + + last_li.push.apply( last_li, this.toTree( contained, [] ) ); + } + + var next_block = next[0] && next[0].valueOf() || ""; + + if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) { + block = next.shift(); + + // Check for an HR following a list: features/lists/hr_abutting + var hr = this.dialect.block.horizRule( block, next ); + + if (hr) { + ret.push.apply(ret, hr); + break; + } + + // Make sure all listitems up the stack are paragraphs + forEach( stack, paragraphify, this); + + loose = true; + continue loose_search; + } + break; + } // loose_search + + return ret; + }; + })(), + + blockquote: function blockquote( block, next ) { + if ( !block.match( /^>/m ) ) + return undefined; + + var jsonml = []; + + // separate out the leading abutting block, if any + if ( block[ 0 ] != ">" ) { + var lines = block.split( /\n/ ), + prev = []; + + // keep shifting lines until you find a crotchet + while ( lines.length && lines[ 0 ][ 0 ] != ">" ) { + prev.push( lines.shift() ); + } + + // reassemble! + block = lines.join( "\n" ); + jsonml.push.apply( jsonml, this.processBlock( prev.join( "\n" ), [] ) ); + } + + // if the next block is also a blockquote merge it in + while ( next.length && next[ 0 ][ 0 ] == ">" ) { + var b = next.shift(); + block = new String(block + block.trailing + b); + block.trailing = b.trailing; + } + + // Strip off the leading "> " and re-process as a block. + var input = block.replace( /^> ?/gm, '' ), + old_tree = this.tree; + jsonml.push( this.toTree( input, [ "blockquote" ] ) ); + + return jsonml; + }, + + referenceDefn: function referenceDefn( block, next) { + var re = /^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/; + // interesting matches are [ , ref_id, url, , title, title ] + + if ( !block.match(re) ) + return undefined; + + // make an attribute node if it doesn't exist + if ( !extract_attr( this.tree ) ) { + this.tree.splice( 1, 0, {} ); + } + + var attrs = extract_attr( this.tree ); + + // make a references hash if it doesn't exist + if ( attrs.references === undefined ) { + attrs.references = {}; + } + + var b = this.loop_re_over_block(re, block, function( m ) { + + if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' ) + m[2] = m[2].substring( 1, m[2].length - 1 ); + + var ref = attrs.references[ m[1].toLowerCase() ] = { + href: m[2] + }; + + if (m[4] !== undefined) + ref.title = m[4]; + else if (m[5] !== undefined) + ref.title = m[5]; + + } ); + + if (b.length) + next.unshift( mk_block( b, block.trailing ) ); + + return []; + }, + + para: function para( block, next ) { + // everything's a para! + return [ ["para"].concat( this.processInline( block ) ) ]; + } + } +}; + +Markdown.dialects.Gruber.inline = { + + __oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) { + var m, + res, + lastIndex = 0; + + patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__; + var re = new RegExp( "([\\s\\S]*?)(" + (patterns_or_re.source || patterns_or_re) + ")" ); + + m = re.exec( text ); + if (!m) { + // Just boring text + return [ text.length, text ]; + } + else if ( m[1] ) { + // Some un-interesting text matched. Return that first + return [ m[1].length, m[1] ]; + } + + var res; + if ( m[2] in this.dialect.inline ) { + res = this.dialect.inline[ m[2] ].call( + this, + text.substr( m.index ), m, previous_nodes || [] ); + } + // Default for now to make dev easier. just slurp special and output it. + res = res || [ m[2].length, m[2] ]; + return res; + }, + + __call__: function inline( text, patterns ) { + + var out = [], + res; + + function add(x) { + //D:self.debug(" adding output", uneval(x)); + if (typeof x == "string" && typeof out[out.length-1] == "string") + out[ out.length-1 ] += x; + else + out.push(x); + } + + while ( text.length > 0 ) { + res = this.dialect.inline.__oneElement__.call(this, text, patterns, out ); + text = text.substr( res.shift() ); + forEach(res, add ) + } + + return out; + }, + + // These characters are intersting elsewhere, so have rules for them so that + // chunks of plain text blocks don't include them + "]": function () {}, + "}": function () {}, + + "\\": function escaped( text ) { + // [ length of input processed, node/children to add... ] + // Only esacape: \ ` * _ { } [ ] ( ) # * + - . ! + if ( text.match( /^\\[\\`\*_{}\[\]()#\+.!\-]/ ) ) + return [ 2, text[1] ]; + else + // Not an esacpe + return [ 1, "\\" ]; + }, + + "![": function image( text ) { + + // Unlike images, alt text is plain text only. no other elements are + // allowed in there + + // ![Alt text](/path/to/img.jpg "Optional title") + // 1 2 3 4 <--- captures + var m = text.match( /^!\[(.*?)\][ \t]*\([ \t]*(\S*)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/ ); + + if ( m ) { + if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' ) + m[2] = m[2].substring( 1, m[2].length - 1 ); + + m[2] = this.dialect.inline.__call__.call( this, m[2], /\\/ )[0]; + + var attrs = { alt: m[1], href: m[2] || "" }; + if ( m[4] !== undefined) + attrs.title = m[4]; + + return [ m[0].length, [ "img", attrs ] ]; + } + + // ![Alt text][id] + m = text.match( /^!\[(.*?)\][ \t]*\[(.*?)\]/ ); + + if ( m ) { + // We can't check if the reference is known here as it likely wont be + // found till after. Check it in md tree->hmtl tree conversion + return [ m[0].length, [ "img_ref", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ]; + } + + // Just consume the '![' + return [ 2, "![" ]; + }, + + "[": function link( text ) { + + var orig = String(text); + // Inline content is possible inside `link text` + var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' ); + + // No closing ']' found. Just consume the [ + if ( !res ) return [ 1, '[' ]; + + var consumed = 1 + res[ 0 ], + children = res[ 1 ], + link, + attrs; + + // At this point the first [...] has been parsed. See what follows to find + // out which kind of link we are (reference or direct url) + text = text.substr( consumed ); + + // [link text](/path/to/img.jpg "Optional title") + // 1 2 3 <--- captures + // This will capture up to the last paren in the block. We then pull + // back based on if there a matching ones in the url + // ([here](/url/(test)) + // The parens have to be balanced + var m = text.match( /^\s*\([ \t]*(\S+)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/ ); + if ( m ) { + var url = m[1]; + consumed += m[0].length; + + if ( url && url[0] == '<' && url[url.length-1] == '>' ) + url = url.substring( 1, url.length - 1 ); + + // If there is a title we don't have to worry about parens in the url + if ( !m[3] ) { + var open_parens = 1; // One open that isn't in the capture + for (var len = 0; len < url.length; len++) { + switch ( url[len] ) { + case '(': + open_parens++; + break; + case ')': + if ( --open_parens == 0) { + consumed -= url.length - len; + url = url.substring(0, len); + } + break; + } + } + } + + // Process escapes only + url = this.dialect.inline.__call__.call( this, url, /\\/ )[0]; + + attrs = { href: url || "" }; + if ( m[3] !== undefined) + attrs.title = m[3]; + + link = [ "link", attrs ].concat( children ); + return [ consumed, link ]; + } + + // [Alt text][id] + // [Alt text] [id] + m = text.match( /^\s*\[(.*?)\]/ ); + + if ( m ) { + + consumed += m[ 0 ].length; + + // [links][] uses links as its reference + attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) }; + + link = [ "link_ref", attrs ].concat( children ); + + // We can't check if the reference is known here as it likely wont be + // found till after. Check it in md tree->hmtl tree conversion. + // Store the original so that conversion can revert if the ref isn't found. + return [ consumed, link ]; + } + + // [id] + // Only if id is plain (no formatting.) + if ( children.length == 1 && typeof children[0] == "string" ) { + + attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) }; + link = [ "link_ref", attrs, children[0] ]; + return [ consumed, link ]; + } + + // Just consume the '[' + return [ 1, "[" ]; + }, + + + "<": function autoLink( text ) { + var m; + + if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/ ) ) != null ) { + if ( m[3] ) { + return [ m[0].length, [ "link", { href: "mailto:" + m[3] }, m[3] ] ]; + + } + else if ( m[2] == "mailto" ) { + return [ m[0].length, [ "link", { href: m[1] }, m[1].substr("mailto:".length ) ] ]; + } + else + return [ m[0].length, [ "link", { href: m[1] }, m[1] ] ]; + } + + return [ 1, "<" ]; + }, + + "`": function inlineCode( text ) { + // Inline code block. as many backticks as you like to start it + // Always skip over the opening ticks. + var m = text.match( /(`+)(([\s\S]*?)\1)/ ); + + if ( m && m[2] ) + return [ m[1].length + m[2].length, [ "inlinecode", m[3] ] ]; + else { + // TODO: No matching end code found - warn! + return [ 1, "`" ]; + } + }, + + " \n": function lineBreak( text ) { + return [ 3, [ "linebreak" ] ]; + } + +}; + +// Meta Helper/generator method for em and strong handling +function strong_em( tag, md ) { + + var state_slot = tag + "_state", + other_slot = tag == "strong" ? "em_state" : "strong_state"; + + function CloseTag(len) { + this.len_after = len; + this.name = "close_" + md; + } + + return function ( text, orig_match ) { + + if (this[state_slot][0] == md) { + // Most recent em is of this type + //D:this.debug("closing", md); + this[state_slot].shift(); + + // "Consume" everything to go back to the recrusion in the else-block below + return[ text.length, new CloseTag(text.length-md.length) ]; + } + else { + // Store a clone of the em/strong states + var other = this[other_slot].slice(), + state = this[state_slot].slice(); + + this[state_slot].unshift(md); + + //D:this.debug_indent += " "; + + // Recurse + var res = this.processInline( text.substr( md.length ) ); + //D:this.debug_indent = this.debug_indent.substr(2); + + var last = res[res.length - 1]; + + //D:this.debug("processInline from", tag + ": ", uneval( res ) ); + + var check = this[state_slot].shift(); + if (last instanceof CloseTag) { + res.pop(); + // We matched! Huzzah. + var consumed = text.length - last.len_after; + return [ consumed, [ tag ].concat(res) ]; + } + else { + // Restore the state of the other kind. We might have mistakenly closed it. + this[other_slot] = other; + this[state_slot] = state; + + // We can't reuse the processed result as it could have wrong parsing contexts in it. + return [ md.length, md ]; + } + } + }; // End returned function +} + +Markdown.dialects.Gruber.inline["**"] = strong_em("strong", "**"); +Markdown.dialects.Gruber.inline["__"] = strong_em("strong", "__"); +Markdown.dialects.Gruber.inline["*"] = strong_em("em", "*"); +Markdown.dialects.Gruber.inline["_"] = strong_em("em", "_"); + + +// Build default order from insertion order. +Markdown.buildBlockOrder = function(d) { + var ord = []; + for ( var i in d ) { + if ( i == "__order__" || i == "__call__" ) continue; + ord.push( i ); + } + d.__order__ = ord; +}; + +// Build patterns for inline matcher +Markdown.buildInlinePatterns = function(d) { + var patterns = []; + + for ( var i in d ) { + // __foo__ is reserved and not a pattern + if ( i.match( /^__.*__$/) ) continue; + var l = i.replace( /([\\.*+?|()\[\]{}])/g, "\\$1" ) + .replace( /\n/, "\\n" ); + patterns.push( i.length == 1 ? l : "(?:" + l + ")" ); + } + + patterns = patterns.join("|"); + d.__patterns__ = patterns; + //print("patterns:", uneval( patterns ) ); + + var fn = d.__call__; + d.__call__ = function(text, pattern) { + if (pattern != undefined) { + return fn.call(this, text, pattern); + } + else + { + return fn.call(this, text, patterns); + } + }; +}; + +Markdown.DialectHelpers = {}; +Markdown.DialectHelpers.inline_until_char = function( text, want ) { + var consumed = 0, + nodes = []; + + while ( true ) { + if ( text[ consumed ] == want ) { + // Found the character we were looking for + consumed++; + return [ consumed, nodes ]; + } + + if ( consumed >= text.length ) { + // No closing char found. Abort. + return null; + } + + res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) ); + consumed += res[ 0 ]; + // Add any returned nodes. + nodes.push.apply( nodes, res.slice( 1 ) ); + } +} + +// Helper function to make sub-classing a dialect easier +Markdown.subclassDialect = function( d ) { + function Block() {} + Block.prototype = d.block; + function Inline() {} + Inline.prototype = d.inline; + + return { block: new Block(), inline: new Inline() }; +}; + +Markdown.buildBlockOrder ( Markdown.dialects.Gruber.block ); +Markdown.buildInlinePatterns( Markdown.dialects.Gruber.inline ); + +Markdown.dialects.Maruku = Markdown.subclassDialect( Markdown.dialects.Gruber ); + +Markdown.dialects.Maruku.processMetaHash = function processMetaHash( meta_string ) { + var meta = split_meta_hash( meta_string ), + attr = {}; + + for ( var i = 0; i < meta.length; ++i ) { + // id: #foo + if ( /^#/.test( meta[ i ] ) ) { + attr.id = meta[ i ].substring( 1 ); + } + // class: .foo + else if ( /^\./.test( meta[ i ] ) ) { + // if class already exists, append the new one + if ( attr['class'] ) { + attr['class'] = attr['class'] + meta[ i ].replace( /./, " " ); + } + else { + attr['class'] = meta[ i ].substring( 1 ); + } + } + // attribute: foo=bar + else if ( /\=/.test( meta[ i ] ) ) { + var s = meta[ i ].split( /\=/ ); + attr[ s[ 0 ] ] = s[ 1 ]; + } + } + + return attr; +} + +function split_meta_hash( meta_string ) { + var meta = meta_string.split( "" ), + parts = [ "" ], + in_quotes = false; + + while ( meta.length ) { + var letter = meta.shift(); + switch ( letter ) { + case " " : + // if we're in a quoted section, keep it + if ( in_quotes ) { + parts[ parts.length - 1 ] += letter; + } + // otherwise make a new part + else { + parts.push( "" ); + } + break; + case "'" : + case '"' : + // reverse the quotes and move straight on + in_quotes = !in_quotes; + break; + case "\\" : + // shift off the next letter to be used straight away. + // it was escaped so we'll keep it whatever it is + letter = meta.shift(); + default : + parts[ parts.length - 1 ] += letter; + break; + } + } + + return parts; +} + +Markdown.dialects.Maruku.block.document_meta = function document_meta( block, next ) { + // we're only interested in the first block + if ( block.lineNumber > 1 ) return undefined; + + // document_meta blocks consist of one or more lines of `Key: Value\n` + if ( ! block.match( /^(?:\w+:.*\n)*\w+:.*$/ ) ) return undefined; + + // make an attribute node if it doesn't exist + if ( !extract_attr( this.tree ) ) { + this.tree.splice( 1, 0, {} ); + } + + var pairs = block.split( /\n/ ); + for ( p in pairs ) { + var m = pairs[ p ].match( /(\w+):\s*(.*)$/ ), + key = m[ 1 ].toLowerCase(), + value = m[ 2 ]; + + this.tree[ 1 ][ key ] = value; + } + + // document_meta produces no content! + return []; +}; + +Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) { + // check if the last line of the block is an meta hash + var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ ); + if ( !m ) return undefined; + + // process the meta hash + var attr = this.dialect.processMetaHash( m[ 2 ] ); + + var hash; + + // if we matched ^ then we need to apply meta to the previous block + if ( m[ 1 ] === "" ) { + var node = this.tree[ this.tree.length - 1 ]; + hash = extract_attr( node ); + + // if the node is a string (rather than JsonML), bail + if ( typeof node === "string" ) return undefined; + + // create the attribute hash if it doesn't exist + if ( !hash ) { + hash = {}; + node.splice( 1, 0, hash ); + } + + // add the attributes in + for ( a in attr ) { + hash[ a ] = attr[ a ]; + } + + // return nothing so the meta hash is removed + return []; + } + + // pull the meta hash off the block and process what's left + var b = block.replace( /\n.*$/, "" ), + result = this.processBlock( b, [] ); + + // get or make the attributes hash + hash = extract_attr( result[ 0 ] ); + if ( !hash ) { + hash = {}; + result[ 0 ].splice( 1, 0, hash ); + } + + // attach the attributes to the block + for ( a in attr ) { + hash[ a ] = attr[ a ]; + } + + return result; +}; + +Markdown.dialects.Maruku.block.definition_list = function definition_list( block, next ) { + // one or more terms followed by one or more definitions, in a single block + var tight = /^((?:[^\s:].*\n)+):\s+([\s\S]+)$/, + list = [ "dl" ], + i; + + // see if we're dealing with a tight or loose block + if ( ( m = block.match( tight ) ) ) { + // pull subsequent tight DL blocks out of `next` + var blocks = [ block ]; + while ( next.length && tight.exec( next[ 0 ] ) ) { + blocks.push( next.shift() ); + } + + for ( var b = 0; b < blocks.length; ++b ) { + var m = blocks[ b ].match( tight ), + terms = m[ 1 ].replace( /\n$/, "" ).split( /\n/ ), + defns = m[ 2 ].split( /\n:\s+/ ); + + // print( uneval( m ) ); + + for ( i = 0; i < terms.length; ++i ) { + list.push( [ "dt", terms[ i ] ] ); + } + + for ( i = 0; i < defns.length; ++i ) { + // run inline processing over the definition + list.push( [ "dd" ].concat( this.processInline( defns[ i ].replace( /(\n)\s+/, "$1" ) ) ) ); + } + } + } + else { + return undefined; + } + + return [ list ]; +}; + +Markdown.dialects.Maruku.inline[ "{:" ] = function inline_meta( text, matches, out ) { + if ( !out.length ) { + return [ 2, "{:" ]; + } + + // get the preceeding element + var before = out[ out.length - 1 ]; + + if ( typeof before === "string" ) { + return [ 2, "{:" ]; + } + + // match a meta hash + var m = text.match( /^\{:\s*((?:\\\}|[^\}])*)\s*\}/ ); + + // no match, false alarm + if ( !m ) { + return [ 2, "{:" ]; + } + + // attach the attributes to the preceeding element + var meta = this.dialect.processMetaHash( m[ 1 ] ), + attr = extract_attr( before ); + + if ( !attr ) { + attr = {}; + before.splice( 1, 0, attr ); + } + + for ( var k in meta ) { + attr[ k ] = meta[ k ]; + } + + // cut out the string and replace it with nothing + return [ m[ 0 ].length, "" ]; +}; + +Markdown.buildBlockOrder ( Markdown.dialects.Maruku.block ); +Markdown.buildInlinePatterns( Markdown.dialects.Maruku.inline ); + +var isArray = Array.isArray || function(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; +}; + +var forEach; +// Don't mess with Array.prototype. Its not friendly +if ( Array.prototype.forEach ) { + forEach = function( arr, cb, thisp ) { + return arr.forEach( cb, thisp ); + }; +} +else { + forEach = function(arr, cb, thisp) { + for (var i = 0; i < arr.length; i++) { + cb.call(thisp || arr, arr[i], i, arr); + } + } +} + +function extract_attr( jsonml ) { + return isArray(jsonml) + && jsonml.length > 1 + && typeof jsonml[ 1 ] === "object" + && !( isArray(jsonml[ 1 ]) ) + ? jsonml[ 1 ] + : undefined; +} + + + +/** + * renderJsonML( jsonml[, options] ) -> String + * - jsonml (Array): JsonML array to render to XML + * - options (Object): options + * + * Converts the given JsonML into well-formed XML. + * + * The options currently understood are: + * + * - root (Boolean): wether or not the root node should be included in the + * output, or just its children. The default `false` is to not include the + * root itself. + */ +expose.renderJsonML = function( jsonml, options ) { + options = options || {}; + // include the root element in the rendered output? + options.root = options.root || false; + + var content = []; + + if ( options.root ) { + content.push( render_tree( jsonml ) ); + } + else { + jsonml.shift(); // get rid of the tag + if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) { + jsonml.shift(); // get rid of the attributes + } + + while ( jsonml.length ) { + content.push( render_tree( jsonml.shift() ) ); + } + } + + return content.join( "\n\n" ); +}; + +function escapeHTML( text ) { + return text.replace( /&/g, "&" ) + .replace( //g, ">" ) + .replace( /"/g, """ ) + .replace( /'/g, "'" ); +} + +function render_tree( jsonml ) { + // basic case + if ( typeof jsonml === "string" ) { + return escapeHTML( jsonml ); + } + + var tag = jsonml.shift(), + attributes = {}, + content = []; + + if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) { + attributes = jsonml.shift(); + } + + while ( jsonml.length ) { + content.push( arguments.callee( jsonml.shift() ) ); + } + + var tag_attrs = ""; + for ( var a in attributes ) { + tag_attrs += " " + a + '="' + escapeHTML( attributes[ a ] ) + '"'; + } + + // be careful about adding whitespace here for inline elements + if ( tag == "img" || tag == "br" || tag == "hr" ) { + return "<"+ tag + tag_attrs + "/>"; + } + else { + return "<"+ tag + tag_attrs + ">" + content.join( "" ) + ""; + } +} + +function convert_tree_to_html( tree, references, options ) { + var i; + options = options || {}; + + // shallow clone + var jsonml = tree.slice( 0 ); + + if (typeof options.preprocessTreeNode === "function") { + jsonml = options.preprocessTreeNode(jsonml, references); + } + + // Clone attributes if they exist + var attrs = extract_attr( jsonml ); + if ( attrs ) { + jsonml[ 1 ] = {}; + for ( i in attrs ) { + jsonml[ 1 ][ i ] = attrs[ i ]; + } + attrs = jsonml[ 1 ]; + } + + // basic case + if ( typeof jsonml === "string" ) { + return jsonml; + } + + // convert this node + switch ( jsonml[ 0 ] ) { + case "header": + jsonml[ 0 ] = "h" + jsonml[ 1 ].level; + delete jsonml[ 1 ].level; + break; + case "bulletlist": + jsonml[ 0 ] = "ul"; + break; + case "numberlist": + jsonml[ 0 ] = "ol"; + break; + case "listitem": + jsonml[ 0 ] = "li"; + break; + case "para": + jsonml[ 0 ] = "p"; + break; + case "markdown": + jsonml[ 0 ] = "html"; + if ( attrs ) delete attrs.references; + break; + case "code_block": + jsonml[ 0 ] = "pre"; + i = attrs ? 2 : 1; + var code = [ "code" ]; + code.push.apply( code, jsonml.splice( i ) ); + jsonml[ i ] = code; + break; + case "inlinecode": + jsonml[ 0 ] = "code"; + break; + case "img": + jsonml[ 1 ].src = jsonml[ 1 ].href; + delete jsonml[ 1 ].href; + break; + case "linebreak": + jsonml[ 0 ] = "br"; + break; + case "link": + jsonml[ 0 ] = "a"; + break; + case "link_ref": + jsonml[ 0 ] = "a"; + + // grab this ref and clean up the attribute node + var ref = references[ attrs.ref ]; + + // if the reference exists, make the link + if ( ref ) { + delete attrs.ref; + + // add in the href and title, if present + attrs.href = ref.href; + if ( ref.title ) { + attrs.title = ref.title; + } + + // get rid of the unneeded original text + delete attrs.original; + } + // the reference doesn't exist, so revert to plain text + else { + return attrs.original; + } + break; + case "img_ref": + jsonml[ 0 ] = "img"; + + // grab this ref and clean up the attribute node + var ref = references[ attrs.ref ]; + + // if the reference exists, make the link + if ( ref ) { + delete attrs.ref; + + // add in the href and title, if present + attrs.src = ref.href; + if ( ref.title ) { + attrs.title = ref.title; + } + + // get rid of the unneeded original text + delete attrs.original; + } + // the reference doesn't exist, so revert to plain text + else { + return attrs.original; + } + break; + } + + // convert all the children + i = 1; + + // deal with the attribute node, if it exists + if ( attrs ) { + // if there are keys, skip over it + for ( var key in jsonml[ 1 ] ) { + i = 2; + } + // if there aren't, remove it + if ( i === 1 ) { + jsonml.splice( i, 1 ); + } + } + + for ( ; i < jsonml.length; ++i ) { + jsonml[ i ] = arguments.callee( jsonml[ i ], references, options ); + } + + return jsonml; +} + + +// merges adjacent text nodes into a single node +function merge_text_nodes( jsonml ) { + // skip the tag name and attribute hash + var i = extract_attr( jsonml ) ? 2 : 1; + + while ( i < jsonml.length ) { + // if it's a string check the next item too + if ( typeof jsonml[ i ] === "string" ) { + if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === "string" ) { + // merge the second string into the first and remove it + jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ]; + } + else { + ++i; + } + } + // if it's not a string recurse + else { + arguments.callee( jsonml[ i ] ); + ++i; + } + } +} + +} )( (function() { + if ( typeof exports === "undefined" ) { + window.markdown = {}; + return window.markdown; + } + else { + return exports; + } +} )() ); diff --git a/src/_h5ai/js/modernizr.min.js b/src/_h5ai/js/lib/modernizr-2.6.1.min.js similarity index 100% rename from src/_h5ai/js/modernizr.min.js rename to src/_h5ai/js/lib/modernizr-2.6.1.min.js diff --git a/src/_h5ai/js/markdown.js b/src/_h5ai/js/markdown.js new file mode 100644 index 00000000..feb72b87 --- /dev/null +++ b/src/_h5ai/js/markdown.js @@ -0,0 +1,2 @@ + +// @include "lib/markdown-0.4.0.js" diff --git a/src/_h5ai/js/modernizr.js b/src/_h5ai/js/modernizr.js new file mode 100644 index 00000000..bd219c57 --- /dev/null +++ b/src/_h5ai/js/modernizr.js @@ -0,0 +1,2 @@ + +// @include "lib/modernizr-2.6.1.min.js" diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index 5b070d2f..0ed92425 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -14,7 +14,7 @@ - +
    From 8c2c02fe8278d81ba903f4d87a614c1ddaa34dc9 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 00:25:25 +0200 Subject: [PATCH 62/67] Updates readme. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e17b08bc..b409f652 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ Run `makejs -t` to list all possible targets. * improves filter (now ignorecase, now only checks if chars in right order) * adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc) * adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (keys: left, right, esc) -* adds Markdown preview -* adds new type and icon `markdown` +* adds Markdown preview with [markdown-js](http://github.com/evilstreak/markdown-js) +* adds new type `markdown` * changes language code `gr` to `el` * adds localization for filter placeholder * adds `hu` translation by [Rodolffo](http://github.com/Rodolffo) From c29b681c1b3d343b5b58428a6ce06869261063b8 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 00:26:43 +0200 Subject: [PATCH 63/67] Updates readme. --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b409f652..6db5f849 100644 --- a/README.md +++ b/README.md @@ -10,20 +10,20 @@ package on the [project page](http://larsjung.de/h5ai/). h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h5ai/blob/master/LICENSE.txt). It profits from these great projects: -[AmplifyJS](http://amplifyjs.com) (MIT/GPL), -[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), +[AmplifyJS](http://amplifyjs.com) (MIT/GPL), +[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), [HTML5 ★ Boilerplate](http://html5boilerplate.com), -[jQuery](http://jquery.com) (MIT/GPL), -[jQuery.fracs](http://larsjung.de/fracs/) (MIT), -[jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT), -[jQuery.qrcode](http://larsjung.de/qrcode/) (MIT), -[jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT), -[markdown-js](http://github.com/evilstreak/markdown-js) (MIT), -[Modernizr](http://www.modernizr.com) (MIT/BSD), -[modulejs](http://larsjung.de/modulejs/) (MIT), -[Moment.js](http://momentjs.com) (MIT), -[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL), -[Underscore.js](http://underscorejs.org) (MIT) +[jQuery](http://jquery.com) (MIT/GPL), +[jQuery.fracs](http://larsjung.de/fracs/) (MIT), +[jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT), +[jQuery.qrcode](http://larsjung.de/qrcode/) (MIT), +[jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT), +[markdown-js](http://github.com/evilstreak/markdown-js) (MIT), +[Modernizr](http://www.modernizr.com) (MIT/BSD), +[modulejs](http://larsjung.de/modulejs/) (MIT), +[Moment.js](http://momentjs.com) (MIT), +[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL), +[Underscore.js](http://underscorejs.org) (MIT) ## Build From 219234dfdd4a8300afa349a754376682ea7fd5c3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 01:03:54 +0200 Subject: [PATCH 64/67] Minor style changes. --- src/_h5ai/css/inc/preview-txt.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less index e784f40f..f4efdcc6 100644 --- a/src/_h5ai/css/inc/preview-txt.less +++ b/src/_h5ai/css/inc/preview-txt.less @@ -51,7 +51,7 @@ font-family: "Ubuntu Mono", monospace; } code { - color: #393; + color: #008200; } } } From 61ae46386ea67fb4a57b3d8a8e647019f7936a0e Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 14:10:20 +0200 Subject: [PATCH 65/67] Updates config. --- makefile.js | 2 +- src/_h5ai/config.js | 16 +- src/_h5ai/css/lib/sh/shCoreDefault.less | 328 -------------------- src/_h5ai/css/lib/sh/shCoreDjango.less | 331 -------------------- src/_h5ai/css/lib/sh/shCoreEclipse.less | 339 --------------------- src/_h5ai/css/lib/sh/shCoreEmacs.less | 324 -------------------- src/_h5ai/css/lib/sh/shCoreFadeToGrey.less | 328 -------------------- src/_h5ai/css/lib/sh/shCoreMDUltra.less | 324 -------------------- src/_h5ai/css/lib/sh/shCoreMidnight.less | 324 -------------------- src/_h5ai/css/lib/sh/shCoreRDark.less | 324 -------------------- src/_h5ai/js/inc/ext/preview-txt.js | 14 +- src/_h5ai/js/lib/sh/shBrushJScript.js | 6 +- 12 files changed, 31 insertions(+), 2629 deletions(-) delete mode 100644 src/_h5ai/css/lib/sh/shCoreDefault.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreDjango.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreEclipse.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreEmacs.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreFadeToGrey.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreMDUltra.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreMidnight.less delete mode 100644 src/_h5ai/css/lib/sh/shCoreRDark.less diff --git a/makefile.js b/makefile.js index 37397772..85a5c757 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.21-dev-45', +var version = '0.21-dev-46', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index f6e14fda..a70312bb 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -181,7 +181,7 @@ var H5AI_CONFIG = { /* * Show text file preview on click. * "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will - * be rendered to HTML. + * be rendered as HTML. * * For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ */ @@ -190,13 +190,25 @@ var H5AI_CONFIG = { "types": { "authors": "plain", "copying": "plain", + "c": "c", + "cpp": "cpp", "css": "css", + "h": "c", + "hpp": "cpp", "install": "plain", + "log": "plain", + "java": "java", + "makefile": "xml", "markdown": "plain", + "php": "php", + "python": "python", "readme": "plain", + "rb": "ruby", + "rtf": "plain", "script": "shell", "text": "plain", - "js": "js" + "js": "js", + "xml": "xml" } }, diff --git a/src/_h5ai/css/lib/sh/shCoreDefault.less b/src/_h5ai/css/lib/sh/shCoreDefault.less deleted file mode 100644 index 08f9e10e..00000000 --- a/src/_h5ai/css/lib/sh/shCoreDefault.less +++ /dev/null @@ -1,328 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: white !important; -} -.syntaxhighlighter .line.alt1 { - background-color: white !important; -} -.syntaxhighlighter .line.alt2 { - background-color: white !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #e0e0e0 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: black !important; -} -.syntaxhighlighter table caption { - color: black !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #6ce26c !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #6ce26c !important; - color: white !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: blue !important; - background: white !important; - border: 1px solid #6ce26c !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: blue !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: red !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #6ce26c !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: black !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: black !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #008200 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: blue !important; -} -.syntaxhighlighter .keyword { - color: #006699 !important; -} -.syntaxhighlighter .preprocessor { - color: gray !important; -} -.syntaxhighlighter .variable { - color: #aa7700 !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #ff1493 !important; -} -.syntaxhighlighter .constants { - color: #0066cc !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #006699 !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: gray !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: red !important; -} - -.syntaxhighlighter .keyword { - font-weight: bold !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreDjango.less b/src/_h5ai/css/lib/sh/shCoreDjango.less deleted file mode 100644 index 1db1f70c..00000000 --- a/src/_h5ai/css/lib/sh/shCoreDjango.less +++ /dev/null @@ -1,331 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: #0a2b1d !important; -} -.syntaxhighlighter .line.alt1 { - background-color: #0a2b1d !important; -} -.syntaxhighlighter .line.alt2 { - background-color: #0a2b1d !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #233729 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: white !important; -} -.syntaxhighlighter table caption { - color: #f8f8f8 !important; -} -.syntaxhighlighter .gutter { - color: #497958 !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #41a83e !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #41a83e !important; - color: #0a2b1d !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #96dd3b !important; - background: black !important; - border: 1px solid #41a83e !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #96dd3b !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: white !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #41a83e !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #ffe862 !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: #f8f8f8 !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #336442 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #9df39f !important; -} -.syntaxhighlighter .keyword { - color: #96dd3b !important; -} -.syntaxhighlighter .preprocessor { - color: #91bb9e !important; -} -.syntaxhighlighter .variable { - color: #ffaa3e !important; -} -.syntaxhighlighter .value { - color: #f7e741 !important; -} -.syntaxhighlighter .functions { - color: #ffaa3e !important; -} -.syntaxhighlighter .constants { - color: #e0e8ff !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #96dd3b !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: #eb939a !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #91bb9e !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #edef7d !important; -} - -.syntaxhighlighter .comments { - font-style: italic !important; -} -.syntaxhighlighter .keyword { - font-weight: bold !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreEclipse.less b/src/_h5ai/css/lib/sh/shCoreEclipse.less deleted file mode 100644 index a45de9fd..00000000 --- a/src/_h5ai/css/lib/sh/shCoreEclipse.less +++ /dev/null @@ -1,339 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: white !important; -} -.syntaxhighlighter .line.alt1 { - background-color: white !important; -} -.syntaxhighlighter .line.alt2 { - background-color: white !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #c3defe !important; -} -.syntaxhighlighter .line.highlighted.number { - color: white !important; -} -.syntaxhighlighter table caption { - color: black !important; -} -.syntaxhighlighter .gutter { - color: #787878 !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #d4d0c8 !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #d4d0c8 !important; - color: white !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #3f5fbf !important; - background: white !important; - border: 1px solid #d4d0c8 !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #3f5fbf !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: #aa7700 !important; -} -.syntaxhighlighter .toolbar { - color: #a0a0a0 !important; - background: #d4d0c8 !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: #a0a0a0 !important; -} -.syntaxhighlighter .toolbar a:hover { - color: red !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: black !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #3f5fbf !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #2a00ff !important; -} -.syntaxhighlighter .keyword { - color: #7f0055 !important; -} -.syntaxhighlighter .preprocessor { - color: #646464 !important; -} -.syntaxhighlighter .variable { - color: #aa7700 !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #ff1493 !important; -} -.syntaxhighlighter .constants { - color: #0066cc !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #7f0055 !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: gray !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: red !important; -} - -.syntaxhighlighter .keyword { - font-weight: bold !important; -} -.syntaxhighlighter .xml .keyword { - color: #3f7f7f !important; - font-weight: normal !important; -} -.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { - color: #7f007f !important; -} -.syntaxhighlighter .xml .string { - font-style: italic !important; - color: #2a00ff !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreEmacs.less b/src/_h5ai/css/lib/sh/shCoreEmacs.less deleted file mode 100644 index 706c77a0..00000000 --- a/src/_h5ai/css/lib/sh/shCoreEmacs.less +++ /dev/null @@ -1,324 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: black !important; -} -.syntaxhighlighter .line.alt1 { - background-color: black !important; -} -.syntaxhighlighter .line.alt2 { - background-color: black !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #2a3133 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: white !important; -} -.syntaxhighlighter table caption { - color: #d3d3d3 !important; -} -.syntaxhighlighter .gutter { - color: #d3d3d3 !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #990000 !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #990000 !important; - color: black !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #ebdb8d !important; - background: black !important; - border: 1px solid #990000 !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #ebdb8d !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: #ff7d27 !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #990000 !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #9ccff4 !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: #d3d3d3 !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #ff7d27 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #ff9e7b !important; -} -.syntaxhighlighter .keyword { - color: aqua !important; -} -.syntaxhighlighter .preprocessor { - color: #aec4de !important; -} -.syntaxhighlighter .variable { - color: #ffaa3e !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #81cef9 !important; -} -.syntaxhighlighter .constants { - color: #ff9e7b !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: aqua !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: #ebdb8d !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #ff7d27 !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #aec4de !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less b/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less deleted file mode 100644 index 6101eba5..00000000 --- a/src/_h5ai/css/lib/sh/shCoreFadeToGrey.less +++ /dev/null @@ -1,328 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: #121212 !important; -} -.syntaxhighlighter .line.alt1 { - background-color: #121212 !important; -} -.syntaxhighlighter .line.alt2 { - background-color: #121212 !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #2c2c29 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: white !important; -} -.syntaxhighlighter table caption { - color: white !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #3185b9 !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #3185b9 !important; - color: #121212 !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #3185b9 !important; - background: black !important; - border: 1px solid #3185b9 !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #3185b9 !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: #d01d33 !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #3185b9 !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #96daff !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: white !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #696854 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #e3e658 !important; -} -.syntaxhighlighter .keyword { - color: #d01d33 !important; -} -.syntaxhighlighter .preprocessor { - color: #435a5f !important; -} -.syntaxhighlighter .variable { - color: #898989 !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #aaaaaa !important; -} -.syntaxhighlighter .constants { - color: #96daff !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #d01d33 !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: #ffc074 !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #4a8cdb !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #96daff !important; -} - -.syntaxhighlighter .functions { - font-weight: bold !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreMDUltra.less b/src/_h5ai/css/lib/sh/shCoreMDUltra.less deleted file mode 100644 index 2923ce73..00000000 --- a/src/_h5ai/css/lib/sh/shCoreMDUltra.less +++ /dev/null @@ -1,324 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: #222222 !important; -} -.syntaxhighlighter .line.alt1 { - background-color: #222222 !important; -} -.syntaxhighlighter .line.alt2 { - background-color: #222222 !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #253e5a !important; -} -.syntaxhighlighter .line.highlighted.number { - color: white !important; -} -.syntaxhighlighter table caption { - color: lime !important; -} -.syntaxhighlighter .gutter { - color: #38566f !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #435a5f !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #435a5f !important; - color: #222222 !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #428bdd !important; - background: black !important; - border: 1px solid #435a5f !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #428bdd !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: lime !important; -} -.syntaxhighlighter .toolbar { - color: #aaaaff !important; - background: #435a5f !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: #aaaaff !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #9ccff4 !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: lime !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #428bdd !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: lime !important; -} -.syntaxhighlighter .keyword { - color: #aaaaff !important; -} -.syntaxhighlighter .preprocessor { - color: #8aa6c1 !important; -} -.syntaxhighlighter .variable { - color: aqua !important; -} -.syntaxhighlighter .value { - color: #f7e741 !important; -} -.syntaxhighlighter .functions { - color: #ff8000 !important; -} -.syntaxhighlighter .constants { - color: yellow !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #aaaaff !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: red !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: yellow !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #ffaa3e !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreMidnight.less b/src/_h5ai/css/lib/sh/shCoreMidnight.less deleted file mode 100644 index e3733eed..00000000 --- a/src/_h5ai/css/lib/sh/shCoreMidnight.less +++ /dev/null @@ -1,324 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: #0f192a !important; -} -.syntaxhighlighter .line.alt1 { - background-color: #0f192a !important; -} -.syntaxhighlighter .line.alt2 { - background-color: #0f192a !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #253e5a !important; -} -.syntaxhighlighter .line.highlighted.number { - color: #38566f !important; -} -.syntaxhighlighter table caption { - color: #d1edff !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #435a5f !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #435a5f !important; - color: #0f192a !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #428bdd !important; - background: black !important; - border: 1px solid #435a5f !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #428bdd !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: #1dc116 !important; -} -.syntaxhighlighter .toolbar { - color: #d1edff !important; - background: #435a5f !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: #d1edff !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #8aa6c1 !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: #d1edff !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #428bdd !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #1dc116 !important; -} -.syntaxhighlighter .keyword { - color: #b43d3d !important; -} -.syntaxhighlighter .preprocessor { - color: #8aa6c1 !important; -} -.syntaxhighlighter .variable { - color: #ffaa3e !important; -} -.syntaxhighlighter .value { - color: #f7e741 !important; -} -.syntaxhighlighter .functions { - color: #ffaa3e !important; -} -.syntaxhighlighter .constants { - color: #e0e8ff !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #b43d3d !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: #f8bb00 !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: white !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #ffaa3e !important; -} diff --git a/src/_h5ai/css/lib/sh/shCoreRDark.less b/src/_h5ai/css/lib/sh/shCoreRDark.less deleted file mode 100644 index d0936838..00000000 --- a/src/_h5ai/css/lib/sh/shCoreRDark.less +++ /dev/null @@ -1,324 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - font-size: 1em !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} - -.syntaxhighlighter { - background-color: #1b2426 !important; -} -.syntaxhighlighter .line.alt1 { - background-color: #1b2426 !important; -} -.syntaxhighlighter .line.alt2 { - background-color: #1b2426 !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #323e41 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: #b9bdb6 !important; -} -.syntaxhighlighter table caption { - color: #b9bdb6 !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #435a5f !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #435a5f !important; - color: #1b2426 !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: #5ba1cf !important; - background: black !important; - border: 1px solid #435a5f !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: #5ba1cf !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: #5ce638 !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #435a5f !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: #e0e8ff !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: #b9bdb6 !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #878a85 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: #5ce638 !important; -} -.syntaxhighlighter .keyword { - color: #5ba1cf !important; -} -.syntaxhighlighter .preprocessor { - color: #435a5f !important; -} -.syntaxhighlighter .variable { - color: #ffaa3e !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #ffaa3e !important; -} -.syntaxhighlighter .constants { - color: #e0e8ff !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #5ba1cf !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: #e0e8ff !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: white !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: #ffaa3e !important; -} diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js index b1dcbdd5..7667213e 100644 --- a/src/_h5ai/js/inc/ext/preview-txt.js +++ b/src/_h5ai/js/inc/ext/preview-txt.js @@ -6,13 +6,25 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', types: { authors: 'plain', copying: 'plain', + c: 'c', + cpp: 'cpp', css: 'css', + h: 'c', + hpp: 'cpp', install: 'plain', + log: 'plain', + java: 'java', + makefile: 'xml', markdown: 'plain', + php: 'php', + python: 'python', readme: 'plain', + rb: 'ruby', + rtf: 'plain', script: 'shell', text: 'plain', - js: 'js' + js: 'js', + xml: 'xml' } }, diff --git a/src/_h5ai/js/lib/sh/shBrushJScript.js b/src/_h5ai/js/lib/sh/shBrushJScript.js index ff98daba..d52a77b2 100644 --- a/src/_h5ai/js/lib/sh/shBrushJScript.js +++ b/src/_h5ai/js/lib/sh/shBrushJScript.js @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * @@ -29,7 +29,7 @@ ; var r = SyntaxHighlighter.regexLib; - + this.regexList = [ { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings @@ -38,7 +38,7 @@ { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords ]; - + this.forHtmlScript(r.scriptScriptTags); }; From a8a6871ebdbfc44bbace68a89c93727db0742b4d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 16:47:17 +0200 Subject: [PATCH 66/67] Updates preview styles. --- README.md | 2 +- src/_h5ai/css/inc/preview-img.less | 14 ++++++++++++-- src/_h5ai/css/inc/preview-txt.less | 5 +++-- src/_h5ai/js/inc/ext/preview-img.js | 18 ++++++++++-------- src/_h5ai/js/inc/ext/preview-txt.js | 4 ++-- src/_h5ai/js/lib/spin-1.2.5.min.js | 27 ++++++++++++++------------- 6 files changed, 42 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 6db5f849..6c6b5a49 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Run `makejs -t` to list all possible targets. * adds Google Analytics support (async) * improves filter (now ignorecase, now only checks if chars in right order) * adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc) -* adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (keys: left, right, esc) +* adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (same keys as img preview) * adds Markdown preview with [markdown-js](http://github.com/evilstreak/markdown-js) * adds new type `markdown` * changes language code `gr` to `el` diff --git a/src/_h5ai/css/inc/preview-img.less b/src/_h5ai/css/inc/preview-img.less index ce670329..7e6f9540 100644 --- a/src/_h5ai/css/inc/preview-img.less +++ b/src/_h5ai/css/inc/preview-img.less @@ -8,8 +8,7 @@ bottom: 0; z-index: 100; - // background-color: #111; - background-color: rgba(0,0,0,0.9); + background-color: rgba(0,0,0,0.5); text-align: center; } @@ -22,6 +21,17 @@ #pv-img-image { max-width: 100%; max-height: 100%; + border: 2px solid #fff; + .border-radius(4px); +} + +#pv-img-overlay.fullscreen { + background-color: #111; + + #pv-img-image { + border: 0; + .border-radius(0); + } } #pv-img-close { diff --git a/src/_h5ai/css/inc/preview-txt.less b/src/_h5ai/css/inc/preview-txt.less index f4efdcc6..ddcbcbf3 100644 --- a/src/_h5ai/css/inc/preview-txt.less +++ b/src/_h5ai/css/inc/preview-txt.less @@ -8,7 +8,7 @@ bottom: 0; z-index: 100; - background-color: rgba(0,0,0,0.9); + background-color: rgba(0,0,0,0.5); text-align: center; } @@ -18,7 +18,8 @@ margin: 0 auto; padding: 10px; background-color: #fff; - border: 2px solid rgba(0,0,0,0.5); + border: 2px solid #fff; + .border-radius(4px); text-align: left; overflow: auto; position: relative; diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 98d6c3d2..1ae586e2 100644 --- a/src/_h5ai/js/inc/ext/preview-img.js +++ b/src/_h5ai/js/inc/ext/preview-img.js @@ -76,6 +76,16 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', width: rect.width / 2, height: rect.height }); + + if (isFullscreen) { + $('#pv-img-overlay').addClass('fullscreen'); + $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen')); + $('#pv-img-bottombar').fadeOut(400); + } else { + $('#pv-img-overlay').removeClass('fullscreen'); + $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen')); + $('#pv-img-bottombar').fadeIn(200); + } }, preloadImg = function (src, callback) { @@ -174,14 +184,6 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', store.put(storekey, isFullscreen); adjustSize(); - - if (isFullscreen) { - $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen')); - $('#pv-img-bottombar').fadeOut(400); - } else { - $('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen')); - $('#pv-img-bottombar').fadeIn(200); - } }, onKeydown = function (event) { diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js index 7667213e..8463e073 100644 --- a/src/_h5ai/js/inc/ext/preview-txt.js +++ b/src/_h5ai/js/inc/ext/preview-txt.js @@ -200,9 +200,9 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', if (key === 27) { // esc onExit(); - } else if (key === 37) { // left + } else if (key === 8 || key === 37 || key === 40) { // backspace, left, down onPrevious(); - } else if (key === 39) { // right + } else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right onNext(); } }, diff --git a/src/_h5ai/js/lib/spin-1.2.5.min.js b/src/_h5ai/js/lib/spin-1.2.5.min.js index 16764fba..7c1a54b6 100644 --- a/src/_h5ai/js/lib/spin-1.2.5.min.js +++ b/src/_h5ai/js/lib/spin-1.2.5.min.js @@ -1,18 +1,19 @@ //fgnass.github.com/spin.js#v1.2.5 (function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)}b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c',b)}var b=l(g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d Date: Mon, 6 Aug 2012 19:17:27 +0200 Subject: [PATCH 67/67] Adds font references. --- src/_h5ai/apache/h5ai-header.html | 2 +- src/_h5ai/index.html | 2 +- src/_h5ai/php/h5ai-index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index c76e67c7..6d37b825 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -11,7 +11,7 @@ - + diff --git a/src/_h5ai/index.html b/src/_h5ai/index.html index 295c8bee..e39f567e 100644 --- a/src/_h5ai/index.html +++ b/src/_h5ai/index.html @@ -11,7 +11,7 @@ - + diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index 0ed92425..75303370 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -12,7 +12,7 @@ - +