From b506405a2cd1b82c08c0a74ea3ac8e8064329a8c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 6 Aug 2012 19:28:56 +0200 Subject: [PATCH 001/143] Updates version to 0.22-dev. --- README.md | 5 +++++ makefile.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d1c80a4..39575fcb 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,11 @@ Run `makejs -t` to list all possible targets. ## Changelog +### v0.22 - *2012-??-??* + +* + + ### v0.21 - *2012-08-06* * fixes misaligned image previews diff --git a/makefile.js b/makefile.js index d10cc627..6e612864 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.21', +var version = '0.22-dev-1', root = path.resolve(__dirname), src = path.join(root, 'src'), From 49eb73075722eb4f8915468d5f2ea86dc3d42425 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Tue, 7 Aug 2012 13:48:01 +0200 Subject: [PATCH 002/143] Updates langs. --- src/_h5ai/config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index a70312bb..61cba1a4 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -403,7 +403,11 @@ var H5AI_CONFIG = { "parentDirectory": "Nadřazený adresář", "empty": "prázdný", "folders": "složek", - "files": "souborů" + "files": "souborů", + "download": "stáhnout", + "noMatch": "žádná shoda", + "dateFormat": "DD.MM.YYYY HH:mm", + "filter": "filtr" }, "de": { @@ -436,7 +440,8 @@ var H5AI_CONFIG = { "files": "αρχεία", "download": "μεταμόρφωση", "noMatch": "κανένα αποτέλεσμα", - "dateFormat": "DD/MM/YYYY HH:mm" + "dateFormat": "DD/MM/YYYY HH:mm", + "filter": "φίλτρο" }, "es": { From 4245f2019eaca6873509535e4d2867aa5fdb81b8 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Tue, 7 Aug 2012 15:51:50 +0200 Subject: [PATCH 003/143] Adds type diff. --- src/_h5ai/config.js | 4 +++- src/_h5ai/icons/16x16/diff.png | Bin 0 -> 586 bytes src/_h5ai/icons/48x48/diff.png | Bin 0 -> 2443 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 src/_h5ai/icons/16x16/diff.png create mode 100644 src/_h5ai/icons/48x48/diff.png diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 61cba1a4..92710955 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -193,6 +193,7 @@ var H5AI_CONFIG = { "c": "c", "cpp": "cpp", "css": "css", + "diff": "diff", "h": "c", "hpp": "cpp", "install": "plain", @@ -302,6 +303,7 @@ var H5AI_CONFIG = { "css": [".css", ".less"], "deb": [".deb"], "default": [], + "diff": [".diff", ".patch"], "doc": [".doc", ".docx", ".odm", ".odt", ".ott"], "draw": [".drw"], "eps": [".eps"], @@ -345,7 +347,7 @@ var H5AI_CONFIG = { "sql": [], "tar": [".tar"], "tex": [".tex"], - "text": [".diff", ".patch", ".text", ".txt"], + "text": [".text", ".txt"], "tiff": [".tiff"], "unknown": [], "vcal": [".vcal"], diff --git a/src/_h5ai/icons/16x16/diff.png b/src/_h5ai/icons/16x16/diff.png new file mode 100644 index 0000000000000000000000000000000000000000..5bef920766b333d4917efaf794b054b46632771c GIT binary patch literal 586 zcmV-Q0=4~#P)*9Rs1h``+!4`b3(7@xbNY z%Q@%cJNGKxZuhYe;>dBFZEg{&s`fQad#SWqt$r{Vj0FM#R8?K7*>M~ulL_PT_^URZ zPGh>R^XTM+UBlo@ug9)o@HP_R*ZVAY?>zuu8h^C_(RH1{U=ULpjfPAnlee*Vqtof2 z2_cYDl07{oWf-)3JyM3jo2@Op{SrUFwYU?x55Vv3;sQVjfl{m0WICN*$)MS6qS>~M zlyW72ZQJt^a%X1%q~dX2hr?LUE!MN^T;;FGeav0wHdC~RZ7!Z%%txqHDl(JFtYlEH z*XIU>LX|{f2Y`HjgF>MSKq9e2KEH7zKnO7h93MY(6F1%e2T*5#*|HC8>;s#%>Y96& zQnL4HkHhidLhXXVER=T&0GC{%JXKtS^M~jE*tiCkWw}(}2OrK0XJMC8vj2IX(vOl` zXIa+uFO}P)6TC_6 zUEAy3@mx+H_Tt&yS=)(mL%-5!XMXd$e9z@~=KRizs`CE~bFT?(6?XJNL@Xc$B>3hD z7Xqt5MOA}FtEy6SqvY7w*vRDMZbC*Ztf9`g6HlEcv?h+f9BmYt=aRQ{~*)#1;|1s-tF|wgsZ7_lfI! zH)yp$2a6_s4BT!j^W|q#+r2{)QQ)X z(}D)y`W_en9(P^$Ptk#%=b@_Dwv91{APBH+yRk^6Qo*)uEX!(IIJ#&M1hMby2*VI# zOrvl8zV$iEE169G0QiTh-i&?+Od~Ya2+YpTlFeqBnwlb=P7?$Hxm*t0wizBCW^Qhd zd_GSynIs4T%H=YnqoXV=EU>)13_xFBAFk_CE|)oc_%K(mUS)Q6mchY6Y}-av>Fw>s z_kA*%47ps6rKKen7Z>U7?xw$gZCgex(U3A~ffJQV<&RMft*opdB3PD1GMQ}BpzFFA zV@MW9Ebtrlq81BF6?Y&J_ipQl_d zQ!bauWHQ*cO+KIJ*s)_=xNw2h)m0qFVR(2L-}jlHpC_G8bKt;%HUT;Xg*e}j5^tTR zaZ{6O5Ev_$%i~cEMZ?+uB7{a!Cmpp!om)DcejfNxRr786PAk!{HrNltrsuVl!s=DO z-$ukKv1t=WU#Kd-otVH^C6`RH{vbg&ci) zJ7sBbZOTTYz9u5P{P4pdf)OE5#WsdUj}tF|7$gkPy8qT)Gd_0T5u$F>$}Nhz0EQR~ zygoTeP_uv+hLk-I+p>7+&_49LCLRL5Q!17I zQ12lkgsLduSQab3Puj8wMX*Jnt`QLk0}xaFHCDClF43CG#95%LtLp{eZ>suL$1qyA zfENS|WHNYR$cpEYb{t+D9fmJH1ls}2fg4{yWeIuwM}&p1ko}K>liCvb4bT=whkz$b zrPBGvi`9LUrO~@5dtZYd4T}J2SYBOyv)@66afLQ?=mqr!PtFcO0hGiMCC=8+dwYY3Yr| z3lX#?h!LUWd2}Tb*v5bhQWj9q9$lNx2ZGv_g&+(tVo(%6^s$YN5rY?cIK~00eMAH! zhCl;^wU3~%mf%GN=4J@y$f@qh+iHk%YDOvQ9qQ z2fz}mDcxSDI?~|V(S-osdTWL&R~8u=>1BF)9?P;gbLJTDymJX-3}L8rcPH4px0}(C z9QH45^r%+LPZ^LY!9U|;|Jp|HQ?NmIDCTp+!cP|H9_)@Ix0xu^=0bacXNtw*?^-u+ zspOH(CI~~tvN{**WM0r6kwsQ(>S-O~0Ty^c^^AO{0@O}$XMnd=b+%(R3h?&ZGhDe+ zWOTHTnVBM%C7eEel=t4dg6H|DLQhYEefx5Z?CrrmYoogrxB#?+K!Zaf$tUyh1XjTFs>VrPCHF) zu~-2zonJSg#O$_agkjimFVrd-F9Cm1)!B6mxYhHgT^qOovCWW&4awKnHD+_Q<#jjl z`1lum`QA4BG&1lA=BN+7P_pYpN(X(2NLNstA> ze9v%o=ql+QX+E9(lxGe-bJxr^nG3}xb8RjJ;6LdTJh}FNf|)mX&wI7m>my+gdjL4O z@8p(_lN;qi>$y;)L$p|HrVaM{HW-kS;63kQja$g=YFG@8S3m!=v$Lf8(_AcEWe(09gaFJfgOml`rI@@yE(^hl04y*whHyBChHW1|RL7r+IIyACU8hc++JEri!ED=MKIT69+^M~jX4lhr z>;3ff^z!-h=V#8HJNGUyQ{&u7rv=yrd<%F4*bnr!so>tCNR{{m@HsH2s@g~&M8p7n zzz|jPiTHW$8CIzZ@fEP3TKzMkE&mY_oA|@vy+#Q5s_I7@{|m(j>99w+x%~hD002ov JPDHLkV1n+ynA-pV literal 0 HcmV?d00001 From da438f2f0bf59cf1213cae4c511906220f15a969 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 8 Aug 2012 02:44:25 +0200 Subject: [PATCH 004/143] Adds new events. Adds autoupdate extension. --- src/_h5ai/config.js | 12 ++++++ src/_h5ai/js/inc/core/event.js | 2 +- src/_h5ai/js/inc/ext/autoupdate.js | 64 ++++++++++++++++++++++++++++++ src/_h5ai/js/inc/ext/crumb.js | 17 ++++++-- src/_h5ai/js/inc/ext/sort.js | 10 ++++- src/_h5ai/js/inc/ext/statusbar.js | 12 ++++++ src/_h5ai/js/inc/ext/tree.js | 12 ++++++ src/_h5ai/js/inc/main.js | 1 + src/_h5ai/js/inc/model/entry.js | 52 +++++++++++++++++++++--- src/_h5ai/js/inc/view/extended.js | 25 +++++++++++- 10 files changed, 195 insertions(+), 12 deletions(-) create mode 100644 src/_h5ai/js/inc/ext/autoupdate.js diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 92710955..bb64c0fa 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -51,6 +51,18 @@ var H5AI_CONFIG = { * Extensions in alphabetical order. */ + /* + * Watch current folder content. + * Folders possibly visible in the tree view that are not the + * current folder might not be updated. + * + * Interval will be a least 1000 milliseconds. + */ + "autoupdate": { + "enabled": true, + "interval": 5000 + }, + /* * Show a clickable breadcrumb. */ diff --git a/src/_h5ai/js/inc/core/event.js b/src/_h5ai/js/inc/core/event.js index 81ce4284..c6cb387a 100644 --- a/src/_h5ai/js/inc/core/event.js +++ b/src/_h5ai/js/inc/core/event.js @@ -13,7 +13,7 @@ modulejs.define('core/event', ['amplify'], function (amplify) { pub = function (topic, data) { - // console.log('EVENT PUB', topic, data); + console.log('EVENT PUB', topic, data); amplify.publish(topic, data); }; diff --git a/src/_h5ai/js/inc/ext/autoupdate.js b/src/_h5ai/js/inc/ext/autoupdate.js new file mode 100644 index 00000000..d8f837bb --- /dev/null +++ b/src/_h5ai/js/inc/ext/autoupdate.js @@ -0,0 +1,64 @@ + +modulejs.define('ext/autoupdate', ['_', '$', 'core/settings', 'core/event', 'core/resource', 'model/entry'], function (_, $, allsettings, event, resource, Entry) { + + var defaults = { + enabled: false, + interval: 5000 + }, + + settings = _.extend({}, defaults, allsettings.autoupdate), + + parseJson = function (entry, json) { + + var found = {}; + + _.each(json.entries, function (jsonEntry) { + + found[jsonEntry.absHref] = true; + Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content); + }); + + _.each(entry.content, function (e) { + if (!found[e.absHref]) { + Entry.remove(e.absHref); + } + }); + }, + + heartbeat = function () { + + var entry = Entry.get(); + + $.ajax({ + url: resource.api(), + data: { + action: 'getentries', + href: entry.absHref, + content: 1 + }, + dataType: 'json', + success: function (json) { + + parseJson(entry, json); + } + }); + + setTimeout(heartbeat, settings.interval); + }, + + init = function () { + + if (!settings.enabled) { + return; + } + + settings.interval = Math.max(1000, settings.interval); + + event.sub('ready', function () { + + setTimeout(heartbeat, settings.interval); + }); + }; + + init(); +}); diff --git a/src/_h5ai/js/inc/ext/crumb.js b/src/_h5ai/js/inc/ext/crumb.js index 07d8ebcb..859154b0 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', ['_', '$', 'core/settings', 'core/resource', 'core/entry'], function (_, $, allsettings, resource, entry) { +modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/entry'], function (_, $, allsettings, resource, event, entry) { var defaults = { enabled: false @@ -17,9 +17,9 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/ statusHintTemplate = '', // updates the crumb for this single entry - update = function (entry) { + update = function (entry, force) { - if (entry.$crumb && entry.$crumb.data('status') === entry.status) { + if (!force && entry.$crumb && entry.$crumb.data('status') === entry.status) { return entry.$crumb; } @@ -59,6 +59,13 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/ return $html; }, + onContentChanged = function (entry) { + + if (entry.$crumb) { + update(entry, true); + } + }, + // creates the complete crumb from entry down to the root init = function (entry) { @@ -78,6 +85,10 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/ update(e); }); }); + + event.sub('entry.created', onContentChanged); + event.sub('entry.removed', onContentChanged); + event.sub('entry.changed', onContentChanged); }; init(entry); diff --git a/src/_h5ai/js/inc/ext/sort.js b/src/_h5ai/js/inc/ext/sort.js index 1272bb39..35c0a253 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', ['_', '$', 'core/settings', 'core/resource', 'core/store'], function (_, $, allsettings, resource, store) { +modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/store'], function (_, $, allsettings, resource, event, store) { var defaults = { enabled: false, @@ -70,6 +70,11 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/s $('#extended .entry').detach().sort(order.fn).appendTo('#extended > ul'); }, + onContentChanged = function (entry) { + + sortBy(store.get(storekey) || settings.order); + }, + init = function () { if (!settings.enabled) { @@ -139,6 +144,9 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/s sortBy('s' + ($size.hasClass('ascending') ? 'd' : 'a')); event.preventDefault(); }); + + event.sub('entry.changed', onContentChanged); + event.sub('entry.created', onContentChanged); }; init(); diff --git a/src/_h5ai/js/inc/ext/statusbar.js b/src/_h5ai/js/inc/ext/statusbar.js index 112703c3..446eb241 100644 --- a/src/_h5ai/js/inc/ext/statusbar.js +++ b/src/_h5ai/js/inc/ext/statusbar.js @@ -53,7 +53,19 @@ modulejs.define('ext/statusbar', ['_', '$', 'core/settings', 'core/format', 'cor event.sub('statusbar', update); $('#bottombar > .center').append($statusbar); + event.sub('entry.created', function () { + var stats = entry.getStats(); + $folderTotal.text(stats.folders); + $fileTotal.text(stats.files); + }); + + event.sub('entry.removed', function () { + + var stats = entry.getStats(); + $folderTotal.text(stats.folders); + $fileTotal.text(stats.files); + }); event.sub('entry.mouseenter', function (entry) { diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 9ea16a40..0d01fcb0 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -186,6 +186,15 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e $tree.scrollpanel('update'); }, + onContentChanged = function (entry) { + + while (entry.parent) { + entry = entry.parent; + } + + update(entry); + }, + // creates the complete tree from entry down to the root init = function (entry, parser) { @@ -217,6 +226,9 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e }); event.sub('ready', adjustSpacing); + event.sub('entry.changed', onContentChanged); + event.sub('entry.created', onContentChanged); + event.sub('entry.removed', onContentChanged); $(window).on('resize', function () { diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index feacef09..e192f2db 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -23,6 +23,7 @@ // @include "view/spacing.js" // @include "view/viewmode.js" + // @include "ext/autoupdate.js" // @include "ext/crumb.js" // @include "ext/custom.js" // @include "ext/download.js" diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 4e6539a4..954a3dfb 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', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) { +modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], function (_, types, ajax, event) { var doc = document, domain = doc.domain, @@ -111,24 +111,62 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty absHref = forceEncoding(absHref || location); + var created = !cache[absHref], + changed = false; + var self = cache[absHref] || new Entry(absHref); if (_.isNumber(time)) { + if (self.time !== time) { + changed = true; + } self.time = time; } if (_.isNumber(size)) { + if (self.size !== size) { + changed = true; + } self.size = size; } if (status) { + if (self.status !== status) { + changed = true; + } self.status = status; } if (isContentFetched) { self.isContentFetched = true; } + if (created) { + event.pub('entry.created', self); + } else if (changed) { + event.pub('entry.changed', self); + } + return self; }, + removeEntry = function (absHref) { + + absHref = forceEncoding(absHref || location); + + var self = cache[absHref]; + + if (self) { + delete cache[absHref]; + if (self.parent) { + delete self.parent.content[self.absHref]; + } + _.each(self.content, function (entry) { + + removeEntry(entry.absHref); + }); + + event.pub('entry.removed', self); + } + }, + fetchStatus = function (absHref, callback) { var self = getEntry(absHref); @@ -202,6 +240,11 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty return this.absHref === location; }, + isInCurrentFolder: function () { + + return !!this.parent && this.parent.isCurrentFolder(); + }, + isDomain: function () { return this.absHref === '/'; @@ -276,9 +319,8 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty } }); - - - return { - get: getEntry + return window.ENTRY = { + get: getEntry, + remove: removeEntry }; }); diff --git a/src/_h5ai/js/inc/view/extended.js b/src/_h5ai/js/inc/view/extended.js index 8690f6b5..5f561c2f 100644 --- a/src/_h5ai/js/inc/view/extended.js +++ b/src/_h5ai/js/inc/view/extended.js @@ -29,9 +29,9 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c emptyTemplate = '
empty
', // updates this single entry - update = function (entry) { + update = function (entry, force) { - if (entry.$extended && entry.status && entry.$extended.data('status') === entry.status) { + if (!force && entry.$extended && entry.status && entry.$extended.data('status') === entry.status) { return entry.$extended; } @@ -125,6 +125,27 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c $extended .on('mouseenter', '.entry a', onMouseenter) .on('mouseleave', '.entry a', onMouseleave); + + event.sub('entry.changed', function (entry) { + + if (entry.isInCurrentFolder() && entry.$extended) { + update(entry, true); + } + }); + + event.sub('entry.created', function (entry) { + + if (entry.isInCurrentFolder() && !entry.$extended) { + $ul.append(update(entry, true)); + } + }); + + event.sub('entry.removed', function (entry) { + + if (entry.isInCurrentFolder() && entry.$extended) { + entry.$extended.remove(); + } + }); }; init(entry); From d76fad3a51727fa3f86ab94a7414c0e1976bb129 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 9 Aug 2012 11:34:20 +0200 Subject: [PATCH 005/143] Adds drag'n'drop upload. --- src/_h5ai/config.js | 6 +- src/_h5ai/css/inc/dropbox.less | 100 +++++ src/_h5ai/css/inc/preview-img.less | 11 + src/_h5ai/css/styles.less | 1 + src/_h5ai/images/delete.png | Bin 0 -> 616 bytes src/_h5ai/js/inc/ext/dropbox.js | 139 +++++++ src/_h5ai/js/inc/ext/preview-img.js | 29 +- src/_h5ai/js/inc/ext/preview-txt.js | 30 +- src/_h5ai/js/inc/ext/thumbnails.js | 7 +- src/_h5ai/js/inc/main.js | 1 + src/_h5ai/js/inc/view/extended.js | 2 +- src/_h5ai/js/lib/jquery.filedrop-0.1.0.js | 424 ++++++++++++++++++++++ src/_h5ai/js/scripts.js | 1 + src/_h5ai/php/api.php | 35 ++ src/_h5ai/uploads/README.md | 7 + 15 files changed, 766 insertions(+), 27 deletions(-) create mode 100644 src/_h5ai/css/inc/dropbox.less create mode 100644 src/_h5ai/images/delete.png create mode 100644 src/_h5ai/js/inc/ext/dropbox.js create mode 100755 src/_h5ai/js/lib/jquery.filedrop-0.1.0.js create mode 100644 src/_h5ai/uploads/README.md diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index bb64c0fa..86dc8053 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -60,7 +60,7 @@ var H5AI_CONFIG = { */ "autoupdate": { "enabled": true, - "interval": 5000 + "interval": 1000 }, /* @@ -213,7 +213,7 @@ var H5AI_CONFIG = { "java": "java", "makefile": "xml", "markdown": "plain", - "php": "php", + /*"php": "php",*/ "python": "python", "readme": "plain", "rb": "ruby", @@ -331,7 +331,7 @@ var H5AI_CONFIG = { "hpp": [".hpp"], "html": [".htm", ".html", ".shtml"], "ico": [".ico"], - "image": [".xpm"], + "image": [".svg", ".xpm"], "install": ["install"], "java": [".java"], "jpg": [".jpg", ".jpeg"], diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less new file mode 100644 index 00000000..d87a2f6c --- /dev/null +++ b/src/_h5ai/css/inc/dropbox.less @@ -0,0 +1,100 @@ + +#dropbox { + margin: 48px 24px; + padding: 24px 12px; + overflow: hidden; + + background-color: #f8f8f8; + border: 1px dashed #ccc; + border-radius: 10px; + + .transition(all 0.2s ease-in-out); + + .label { + text-align: center; + color: #eee; + font-size: 5em; + font-weight: bold; + } + + &.hint { + // color: #ccc; + // border-color: #aaa; + } + + &.match { + border-color: #555; + + .label { + color: #999; + } + } +} + +#uploads { + width: 450px; + margin: 12px auto; + padding: 0; + list-style: none; + + .upload { + color: #555; + font-size: 0.9em; + + .name { + display: inline-block; + white-space: nowrap; + width: 320px; + overflow: hidden; + + &:before { + display: inline-block; + content: '•'; + color: #55c; + width: 1em; + text-align: center; + padding-right: 1em; + } + } + + .size { + // display: inline-block; + display: none; + float: right; + white-space: nowrap; + + &:after { + content: ' bytes' + } + } + + .progress { + display: inline-block; + margin: 4px 8px; + + width: 84px; + height: 8px; + background-color: #ddd; + overflow: hidden; + float: right; + + .bar { + width: 0%; + height: 100%; + background-color: #999; + } + } + + &.finished .name:before { + // content: '✓✔'; + content: '✔'; + color: #008200; + } + &.error .name:before { + content: '✖'; + color: #c55; + } + } + +} + diff --git a/src/_h5ai/css/inc/preview-img.less b/src/_h5ai/css/inc/preview-img.less index 7e6f9540..6946de74 100644 --- a/src/_h5ai/css/inc/preview-img.less +++ b/src/_h5ai/css/inc/preview-img.less @@ -18,11 +18,22 @@ } +// @check-white: rgba(255,255,255,0.5); +// @check-black: rgba(0,0,0,0.2); +@check-white: #f8f8f8; +@check-black: #e8e8e8; #pv-img-image { max-width: 100%; max-height: 100%; border: 2px solid #fff; .border-radius(4px); + + background-color: @check-white; + background-image: + -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black), + -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black); + background-size: 60px 60px; + background-position: 0 0, 30px 30px } #pv-img-overlay.fullscreen { diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index 39281b71..427acd71 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -23,6 +23,7 @@ body { @import "inc/content"; @import "inc/extended"; +@import "inc/dropbox"; @import "inc/bottombar"; @import "inc/l10n"; diff --git a/src/_h5ai/images/delete.png b/src/_h5ai/images/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..9d8afaef4d4ffccb64e545646b2d9f33ab7c0e3c GIT binary patch literal 616 zcmV-u0+;=XP)NB#Epidy%J1W{)3X5}5#^IHZUR05b?N5Wi}Np!0bGUwV#lekRQ3D$Zo|m} zK)dGy03@CR00@d|WlA3kQB^Ag_!$NOfYfoEhxXG4`OdfBkl{q*s+D~Ez7SQ_3V`;g z5Pj#=vTL3<%@~j1);w?8Ikjv6{-_qjdc{m1Z>$yNzPB*R1O!*^dke=KYsGrS9JcdU z3yF7`JEi$pG;@Oq008cmYyp7(y_p4oAJ<)+Uv;Was$cbCh`|@QOIthpT0G`5CP19k zEP3~^AnzU)#97T^On?@Txl3C+`vBZOE+Pu' + + '
' + + '' + + '', + + init = function () { + + if (!settings.enabled) { + return; + } + + var $dropbox = $(template).appendTo('#content'); + + var uploads = {}; + + $dropbox.filedrop({ + + // The name of the $_FILES entry: + paramname: 'userfile', + + maxfiles: 24, + maxfilesize: 1024, + url: allsettings.h5aiAbsHref + 'php/api.php', + data: { + action: 'upload', + href: entry.absHref + }, + + dragOver: function () { + + $dropbox.addClass('match'); + }, + + dragLeave: function () { + + $dropbox.removeClass('match'); + }, + + docOver: function () { + + $dropbox.addClass('hint'); + }, + + docLeave: function () { + + $dropbox.removeClass('hint'); + }, + + drop: function () { + + $dropbox.removeClass('match hint'); + }, + + + beforeEach: function (file) { + + uploads[file.name] = $(uploadTemplate).appendTo('#uploads') + .find('.name').text(file.name).end() + .find('.size').text(file.size).end() + .find('.progress .bar').css('width', 0).end(); + + console.log('beforeEach', file); + }, + + uploadStarted: function (i, file, len) { + + console.log('uploadStarted', i, file, len); + }, + + progressUpdated: function (i, file, progress) { + + uploads[file.name] + .find('.progress .bar').css('width', '' + progress + '%'); + console.log('progressUpdated', i, file, progress); + }, + + uploadFinished: function (i, file, response) { + + uploads[file.name].addClass(response.code ? 'error' : 'finished'); + setTimeout(function () { + uploads[file.name].slideUp(400, function () { + + uploads[file.name].remove(); + }); + }, 5000); + console.log('uploadFinished', i, file, response); + }, + + afterAll: function () { + + // $('#uploads .upload').remove(); + }, + + + error: function (err, file) { + + uploads[file.name].addClass('error'); + setTimeout(function () { + uploads[file.name].slideUp(400, function () { + + uploads[file.name].remove(); + }); + }, 5000); + switch (err) { + case 'BrowserNotSupported': + console.log('ERROR', 'Your browser does not support HTML5 file uploads!'); + break; + case 'TooManyFiles': + console.log('ERROR', 'Too many files! Please select 5 at most! (configurable)'); + break; + case 'FileTooLarge': + console.log('ERROR', file.name + ' is too large! Please upload files up to 2mb (configurable).'); + break; + default: + break; + } + console.log('error', err, file); + } + }); + + + + + }; + + init(); +}); diff --git a/src/_h5ai/js/inc/ext/preview-img.js b/src/_h5ai/js/inc/ext/preview-img.js index 1ae586e2..64c50a71 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', ['_', '$', '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/event', 'core/entry'], function (_, $, allsettings, resource, store, event, entry) { var defaults = { enabled: false, @@ -149,7 +149,6 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', $('#pv-img-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref); }, 1); }); - }); }, @@ -201,13 +200,20 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', } }, - initEntry = function (entries, entry, idx) { + initEntry = function (entry) { - if (entry.$extended) { + if (entry.$extended && _.indexOf(settings.types, entry.type) >= 0) { entry.$extended.find('a').on('click', function (event) { event.preventDefault(); - onEnter(entries, idx); + + var matchedEntries = _.compact(_.map($('#extended .entry'), function (entry) { + + entry = $(entry).data('entry'); + return _.indexOf(settings.types, entry.type) >= 0 ? entry : null; + })); + + onEnter(matchedEntries, _.indexOf(matchedEntries, entry)); }); } }, @@ -218,13 +224,9 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', return; } - var imageEntries = _.filter(entry.content, function (entry) { + _.each(entry.content, function (e) { - return _.indexOf(settings.types, entry.type) >= 0; - }); - _.each(imageEntries, function (e, idx) { - - initEntry(imageEntries, e, idx); + initEntry(e); }); $(template).appendTo('body'); @@ -277,6 +279,11 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', } }); + event.sub('entry.created', function (entry) { + + initEntry(entry); + }); + $(window).on('resize load', adjustSize); }; diff --git a/src/_h5ai/js/inc/ext/preview-txt.js b/src/_h5ai/js/inc/ext/preview-txt.js index 8463e073..cfc6429b 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', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, allsettings, resource, store, entry) { +modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/event', 'core/entry'], function (_, $, allsettings, resource, store, event, entry) { var defaults = { enabled: false, @@ -16,7 +16,7 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', java: 'java', makefile: 'xml', markdown: 'plain', - php: 'php', + // php: 'php', python: 'python', readme: 'plain', rb: 'ruby', @@ -207,13 +207,20 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', } }, - initEntry = function (entries, entry, idx) { + initEntry = function (entry) { - if (entry.$extended) { + if (entry.$extended && _.indexOf(_.keys(settings.types), entry.type) >= 0) { entry.$extended.find('a').on('click', function (event) { event.preventDefault(); - onEnter(entries, idx); + + var matchedEntries = _.compact(_.map($('#extended .entry'), function (entry) { + + entry = $(entry).data('entry'); + return _.indexOf(_.keys(settings.types), entry.type) >= 0 ? entry : null; + })); + + onEnter(matchedEntries, _.indexOf(matchedEntries, entry)); }); } }, @@ -224,13 +231,9 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', return; } - var imageEntries = _.filter(entry.content, function (entry) { + _.each(entry.content, function (e) { - return _.indexOf(_.keys(settings.types), entry.type) >= 0; - }); - _.each(imageEntries, function (e, idx) { - - initEntry(imageEntries, e, idx); + initEntry(e); }); $(template).appendTo('body'); @@ -254,6 +257,11 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', event.stopPropagation(); }); + event.sub('entry.created', function (entry) { + + initEntry(entry); + }); + $(window).on('resize load', adjustSize); }; diff --git a/src/_h5ai/js/inc/ext/thumbnails.js b/src/_h5ai/js/inc/ext/thumbnails.js index 468e5a37..8bd87fdc 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', ['_', 'core/settings', 'core/entry', 'core/ajax'], function (_, allsettings, entry, ajax) { +modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/event', 'core/ajax'], function (_, allsettings, entry, event, ajax) { var defaults = { enabled: false, @@ -52,6 +52,11 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/aja _.each(entry.content, checkEntry); }, settings.delay); + + event.sub('entry.created', function (entry) { + + checkEntry(entry); + }); }; init(entry); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index e192f2db..6821c3e2 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -27,6 +27,7 @@ // @include "ext/crumb.js" // @include "ext/custom.js" // @include "ext/download.js" + // @include "ext/dropbox.js" // @include "ext/filter.js" // @include "ext/folderstatus.js" // @include "ext/google-analytics.js" diff --git a/src/_h5ai/js/inc/view/extended.js b/src/_h5ai/js/inc/view/extended.js index 5f561c2f..f8ff27bd 100644 --- a/src/_h5ai/js/inc/view/extended.js +++ b/src/_h5ai/js/inc/view/extended.js @@ -18,7 +18,7 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c '' + '', hintTemplate = '', - listTemplate = '
    ' + + listTemplate = '
      ' + '
    • ' + '' + '' + diff --git a/src/_h5ai/js/lib/jquery.filedrop-0.1.0.js b/src/_h5ai/js/lib/jquery.filedrop-0.1.0.js new file mode 100755 index 00000000..2d87013b --- /dev/null +++ b/src/_h5ai/js/lib/jquery.filedrop-0.1.0.js @@ -0,0 +1,424 @@ +/* + * Default text - jQuery plugin for html5 dragging files from desktop to browser + * + * Author: Weixi Yen + * + * Email: [Firstname][Lastname]@gmail.com + * + * Copyright (c) 2010 Resopollution + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + * Project home: + * http://www.github.com/weixiyen/jquery-filedrop + * + * Version: 0.1.0 + * + * Features: + * Allows sending of extra parameters with file. + * Works with Firefox 3.6+ + * Future-compliant with HTML5 spec (will work with Webkit browsers and IE9) + * Usage: + * See README at project homepage + * + */ +;(function($) { + + jQuery.event.props.push("dataTransfer"); + + var default_opts = { + fallback_id: '', + url: '', + refresh: 1000, + paramname: 'userfile', + allowedfiletypes:[], + maxfiles: 25, // Ignored if queuefiles is set > 0 + maxfilesize: 1, // MB file size limit + queuefiles: 0, // Max files before queueing (for large volume uploads) + queuewait: 200, // Queue wait time if full + data: {}, + headers: {}, + drop: empty, + dragEnter: empty, + dragOver: empty, + dragLeave: empty, + docEnter: empty, + docOver: empty, + docLeave: empty, + beforeEach: empty, + afterAll: empty, + rename: empty, + error: function(err, file, i) { + alert(err); + }, + uploadStarted: empty, + uploadFinished: empty, + progressUpdated: empty, + speedUpdated: empty + }, + errors = ["BrowserNotSupported", "TooManyFiles", "FileTooLarge", "FileTypeNotAllowed"], + doc_leave_timer, stop_loop = false, + files_count = 0, + files; + + $.fn.filedrop = function(options) { + var opts = $.extend({}, default_opts, options); + + this.on('drop', drop).on('dragenter', dragEnter).on('dragover', dragOver).on('dragleave', dragLeave); + $(document).on('drop', docDrop).on('dragenter', docEnter).on('dragover', docOver).on('dragleave', docLeave); + + $('#' + opts.fallback_id).change(function(e) { + opts.drop(e); + files = e.target.files; + files_count = files.length; + upload(); + }); + + function drop(e) { + opts.drop(e); + files = e.dataTransfer.files; + if (files === null || files === undefined) { + opts.error(errors[0]); + return false; + } + files_count = files.length; + upload(); + e.preventDefault(); + return false; + } + + function getBuilder(filename, filedata, mime, boundary) { + var dashdash = '--', + crlf = '\r\n', + builder = ''; + + if (opts.data) { + var params = $.param(opts.data).split(/&/); + + $.each(params, function() { + var pair = this.split(/=/, 2); + var name = decodeURIComponent(pair[0]); + var val = decodeURIComponent(pair[1]); + + builder += dashdash; + builder += boundary; + builder += crlf; + builder += 'Content-Disposition: form-data; name="' + name + '"'; + builder += crlf; + builder += crlf; + builder += val; + builder += crlf; + }); + } + + builder += dashdash; + builder += boundary; + builder += crlf; + builder += 'Content-Disposition: form-data; name="' + opts.paramname + '"'; + builder += '; filename="' + filename + '"'; + builder += crlf; + + builder += 'Content-Type: ' + mime; + builder += crlf; + builder += crlf; + + builder += filedata; + builder += crlf; + + builder += dashdash; + builder += boundary; + builder += dashdash; + builder += crlf; + return builder; + } + + function progress(e) { + if (e.lengthComputable) { + var percentage = Math.round((e.loaded * 100) / e.total); + if (this.currentProgress != percentage) { + + this.currentProgress = percentage; + opts.progressUpdated(this.index, this.file, this.currentProgress); + + var elapsed = new Date().getTime(); + var diffTime = elapsed - this.currentStart; + if (diffTime >= opts.refresh) { + var diffData = e.loaded - this.startData; + var speed = diffData / diffTime; // KB per second + opts.speedUpdated(this.index, this.file, speed); + this.startData = e.loaded; + this.currentStart = elapsed; + } + } + } + } + + // Respond to an upload + function upload() { + + stop_loop = false; + + if (!files) { + opts.error(errors[0]); + return false; + } + if(opts.allowedfiletypes.push && opts.allowedfiletypes.length){ + for(var fileIndex = files.length;fileIndex--;){ + if(!files[fileIndex].type || $.inArray(files[fileIndex].type, opts.allowedfiletypes) < 0){ + opts.error(errors[3]); + return false; + } + } + } + + var filesDone = 0, + filesRejected = 0; + + if (files_count > opts.maxfiles && opts.queuefiles === 0) { + opts.error(errors[1]); + return false; + } + + // Define queues to manage upload process + var workQueue = []; + var processingQueue = []; + var doneQueue = []; + + // Add everything to the workQueue + for (var i = 0; i < files_count; i++) { + workQueue.push(i); + } + + // Helper function to enable pause of processing to wait + // for in process queue to complete + var pause = function(timeout) { + setTimeout(process, timeout); + return; + } + + // Process an upload, recursive + var process = function() { + + var fileIndex; + + if (stop_loop) return false; + + // Check to see if are in queue mode + if (opts.queuefiles > 0 && processingQueue.length >= opts.queuefiles) { + + return pause(opts.queuewait); + + } else { + + // Take first thing off work queue + fileIndex = workQueue[0]; + workQueue.splice(0, 1); + + // Add to processing queue + processingQueue.push(fileIndex); + + } + + try { + if (beforeEach(files[fileIndex]) != false) { + if (fileIndex === files_count) return; + var reader = new FileReader(), + max_file_size = 1048576 * opts.maxfilesize; + + reader.index = fileIndex; + if (files[fileIndex].size > max_file_size) { + opts.error(errors[2], files[fileIndex], fileIndex); + // Remove from queue + processingQueue.forEach(function(value, key) { + if (value === fileIndex) processingQueue.splice(key, 1); + }); + filesRejected++; + return true; + } + reader.onloadend = send; + reader.readAsBinaryString(files[fileIndex]); + + } else { + filesRejected++; + } + } catch (err) { + // Remove from queue + processingQueue.forEach(function(value, key) { + if (value === fileIndex) processingQueue.splice(key, 1); + }); + opts.error(errors[0]); + return false; + } + + // If we still have work to do, + if (workQueue.length > 0) { + process(); + } + + }; + + var send = function(e) { + + var fileIndex = ((typeof(e.srcElement) === "undefined") ? e.target : e.srcElement).index + + // Sometimes the index is not attached to the + // event object. Find it by size. Hack for sure. + if (e.target.index == undefined) { + e.target.index = getIndexBySize(e.total); + } + + var xhr = new XMLHttpRequest(), + upload = xhr.upload, + file = files[e.target.index], + index = e.target.index, + start_time = new Date().getTime(), + boundary = '------multipartformboundary' + (new Date).getTime(), + builder; + + newName = rename(file.name); + mime = file.type + if (typeof newName === "string") { + builder = getBuilder(newName, e.target.result, mime, boundary); + } else { + builder = getBuilder(file.name, e.target.result, mime, boundary); + } + + upload.index = index; + upload.file = file; + upload.downloadStartTime = start_time; + upload.currentStart = start_time; + upload.currentProgress = 0; + upload.startData = 0; + upload.addEventListener("progress", progress, false); + + xhr.open("POST", opts.url, true); + xhr.setRequestHeader('content-type', 'multipart/form-data; boundary=' + boundary); + + // Add headers + $.each(opts.headers, function(k, v) { + xhr.setRequestHeader(k, v); + }); + + xhr.sendAsBinary(builder); + + opts.uploadStarted(index, file, files_count); + + xhr.onload = function() { + if (xhr.responseText) { + var now = new Date().getTime(), + timeDiff = now - start_time, + result = opts.uploadFinished(index, file, jQuery.parseJSON(xhr.responseText), timeDiff, xhr); + filesDone++; + + // Remove from processing queue + processingQueue.forEach(function(value, key) { + if (value === fileIndex) processingQueue.splice(key, 1); + }); + + // Add to donequeue + doneQueue.push(fileIndex); + + if (filesDone == files_count - filesRejected) { + afterAll(); + } + if (result === false) stop_loop = true; + } + + //Pass any errors to the error option + if(xhr.status != 200){ + opts.error(xhr.statusText); + } + + }; + + } + + // Initiate the processing loop + process(); + + } + + function getIndexBySize(size) { + for (var i = 0; i < files_count; i++) { + if (files[i].size == size) { + return i; + } + } + + return undefined; + } + + function rename(name) { + return opts.rename(name); + } + + function beforeEach(file) { + return opts.beforeEach(file); + } + + function afterAll() { + return opts.afterAll(); + } + + function dragEnter(e) { + clearTimeout(doc_leave_timer); + e.preventDefault(); + opts.dragEnter(e); + } + + function dragOver(e) { + clearTimeout(doc_leave_timer); + e.preventDefault(); + opts.docOver(e); + opts.dragOver(e); + } + + function dragLeave(e) { + clearTimeout(doc_leave_timer); + opts.dragLeave(e); + e.stopPropagation(); + } + + function docDrop(e) { + e.preventDefault(); + opts.docLeave(e); + return false; + } + + function docEnter(e) { + clearTimeout(doc_leave_timer); + e.preventDefault(); + opts.docEnter(e); + return false; + } + + function docOver(e) { + clearTimeout(doc_leave_timer); + e.preventDefault(); + opts.docOver(e); + return false; + } + + function docLeave(e) { + doc_leave_timer = setTimeout(function() { + opts.docLeave(e); + }, 200); + } + return this; + }; + function empty() {} + + try { + if (XMLHttpRequest.prototype.sendAsBinary) return; + XMLHttpRequest.prototype.sendAsBinary = function(datastr) { + function byteValue(x) { + return x.charCodeAt(0) & 0xff; + } + var ords = Array.prototype.map.call(datastr, byteValue); + var ui8a = new Uint8Array(ords); + this.send(ui8a.buffer); + } + } catch (e) {} + +})(jQuery); diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 2ce2f379..74f4beef 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -2,6 +2,7 @@ // jQuery libs // ----------- // @include "lib/jquery-1.7.2.min.js" +// @include "lib/jquery.filedrop-0.1.0.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" diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index e3d1a73a..306c405d 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -138,6 +138,41 @@ else if ($action === "getentries") { } +else if ($action === "upload") { + + list($href) = check_keys(array("href")); + + json_fail(1, "wrong HTTP method", strtolower($_SERVER["REQUEST_METHOD"]) !== "post"); + json_fail(2, "something went wrong", !array_key_exists("userfile", $_FILES)); + + $userfile = $_FILES["userfile"]; + + json_fail(3, "something went wrong: " . $userfile["error"], $userfile["error"] !== 0); + + $upload_dir = $h5ai->getAbsPath($href); + $dest = $upload_dir . "/" . $userfile["name"]; + + json_fail(4, "already exists: " . $userfile["name"], file_exists($dest)); + json_fail(5, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); + + json_exit(); +} + + +else if ($action === "delete") { + + list($href) = check_keys(array("href")); + + $absPath = $h5ai->getAbsPath($href); + + if (unlink($absPath)) { + json_exit(); + } else { + json_fail(1, "deletion failed"); + } +} + + else { json_fail(100, "unsupported action"); } diff --git a/src/_h5ai/uploads/README.md b/src/_h5ai/uploads/README.md new file mode 100644 index 00000000..f0fbb3dc --- /dev/null +++ b/src/_h5ai/uploads/README.md @@ -0,0 +1,7 @@ +# Cache + +This directory is used for server side caching. To use caching make this +directory writable for your webserver. + +There is no critical data in here. You can savely remove any content. This +will clear the cache. From 2f288703bff5eb27f2363a9f7a126bf611bf49aa Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:16:13 +0200 Subject: [PATCH 006/143] Updates jQuery to 1.8.0 --- src/_h5ai/js/lib/jquery-1.7.2.min.js | 4 ---- src/_h5ai/js/lib/jquery-1.8.0.min.js | 2 ++ src/_h5ai/js/scripts.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 src/_h5ai/js/lib/jquery-1.7.2.min.js create mode 100644 src/_h5ai/js/lib/jquery-1.8.0.min.js diff --git a/src/_h5ai/js/lib/jquery-1.7.2.min.js b/src/_h5ai/js/lib/jquery-1.7.2.min.js deleted file mode 100644 index 16ad06c5..00000000 --- a/src/_h5ai/js/lib/jquery-1.7.2.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! 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/lib/jquery-1.8.0.min.js b/src/_h5ai/js/lib/jquery-1.8.0.min.js new file mode 100644 index 00000000..f121291c --- /dev/null +++ b/src/_h5ai/js/lib/jquery-1.8.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v@1.8.0 jquery.com | jquery.org/license */ +(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.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):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
      a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
      t
      ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
      ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
      ",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

      ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
      ","
      "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
      ").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[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","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index 74f4beef..c705a392 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -1,7 +1,7 @@ // jQuery libs // ----------- -// @include "lib/jquery-1.7.2.min.js" +// @include "lib/jquery-1.8.0.min.js" // @include "lib/jquery.filedrop-0.1.0.js" // @include "lib/jquery.fracs-0.11.min.js" // @include "lib/jquery.mousewheel-3.0.6.js" From 9ac59739076e16193f9f64f007fb21e7e6b302b9 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:19:29 +0200 Subject: [PATCH 007/143] Reformats config comments. --- src/_h5ai/config.js | 293 +++++++++++++++++++++++--------------------- 1 file changed, 153 insertions(+), 140 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 86dc8053..9e94c144 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -1,26 +1,26 @@ /* - * h5ai {{version}} - * - * Configuration - * options, types and localization - */ +h5ai {{version}} + +Configuration +options, types and localization +*/ var H5AI_CONFIG = { "options": { /* - * The absolute links to webroot and h5ai. - * Do not change this unless you know what you are doing. - */ + The absolute links to webroot and h5ai. + Do not change this unless you know what you are doing. + */ "rootAbsHref": "/", "h5aiAbsHref": "/_h5ai/", /* - * Spacing of the main content. - * Left and right will be added to a minimum of 30px. Top and bottom - * are calculated relative to the top and bottom bar heights. - */ + Spacing of the main content. + Left and right will be added to a minimum of 30px. Top and bottom + are calculated relative to the top and bottom bar heights. + */ "spacing": { "maxWidth": 960, "top": 50, @@ -30,50 +30,55 @@ var H5AI_CONFIG = { }, /* - * An array of view modes the user may choose from. Currently there - * are two possible values: "details" and "icons". The first value - * indicates the default view mode. If only one value is given the - * view mode is fixed and the selector buttons are hidden. - * The user selected view mode is also stored local in modern browsers - * so that it will be persistent. - * - * Set parent folder labels to real folder names. - */ + An array of view modes the user may choose from. Currently there + are two possible values: "details" and "icons". The first value + indicates the default view mode. If only one value is given the + view mode is fixed and the selector buttons are hidden. + The user selected view mode is also stored local in modern browsers + so that it will be persistent. + + Set parent folder labels to real folder names. + */ "view": { - "modes": ["details", "icons"], + "modes": ["details", "list", "icons"], "setParentFolderLabels": true }, + /*** Extensions (in alphabetical order) ***/ /* - * Extensions in alphabetical order. - */ + Watch current folder content. + Folders possibly visible in the tree view that are not the + current folder might not be updated. - /* - * Watch current folder content. - * Folders possibly visible in the tree view that are not the - * current folder might not be updated. - * - * Interval will be a least 1000 milliseconds. - */ + Interval will be a least 1000 milliseconds. + */ "autoupdate": { "enabled": true, "interval": 1000 }, /* - * Show a clickable breadcrumb. - */ + Show a context menu when hovering a file entry. + */ + "context-menu": { + "enabled": true, + "deleteBtn": true + }, + + /* + Show a clickable breadcrumb. + */ "crumb": { "enabled": true }, /* - * Filenames of customized header and footer files to look for - * in each folder. - */ + Filenames of customized header and footer files to look for + in each folder. + */ "custom": { "enabled": true, "header": "_h5ai.header.html", @@ -81,82 +86,92 @@ var H5AI_CONFIG = { }, /* - * EXPLICITLY: USE "shell" ON YOUR OWN RISK. - * - * Requires PHP on the server. - * Enable packaged download of selected entries. - * Execution: "php", "shell". - * Supported formats: "tar", "zip". - */ - "download": { + File upload via drag'n'drop. Folders are not supported. + The working file size seems to be very broser dependent. + + Max file size is in MB. + */ + "dropbox": { "enabled": true, - "execution": "shell", - "format": "tar" + "maxfiles": 50, + "maxfilesize": 2000 }, /* - * Allow filtering the displayed files and folders. - * 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:". - */ + Requires PHP on the server. + Enable packaged download of selected entries. + Execution: "php", "shell". + Supported formats: "tar", "zip". + */ + "download": { + "enabled": true, + "execution": "shell", + "format": "zip" + }, + + /* + Allow filtering the displayed files and folders. + 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": { "enabled": true }, /* - * Requires PHP on the server. - * Calc the size of folders. - * Depends on du. - */ + Requires PHP on the server. + Calc the size of folders. + Depends on du. + */ "foldersize": { "enabled": true }, /* - * Associative array of folders and their HTTP status codes to - * avoid HEAD requests to that folders. The key (folder) must start - * and end with a slash (/). - * For example - * "/some/folder/": 200 - * will always return HTTP status 200 (OK), which will be interpreted - * as a non auto indexed folder, that means a folder containing an - * appropriate default index file. - */ + Associative array of folders and their HTTP status codes to + avoid HEAD requests to that folders. The key (folder) must start + and end with a slash (/). + For example + "/some/folder/": 200 + will always return HTTP status 200 (OK), which will be interpreted + as a non auto indexed folder, that means a folder containing an + appropriate default index file. + */ "folderstatus": { "enabled": true, "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 - */ + 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": true, "gaq": [] }, /* - * Localization, for example "en", "de" etc. - see "langs" below for - * possible values. Adjust it to your needs. If lang is not found in - * "langs" it defaults to "en". - * - * Optionally try to use browser language, falls back to previous - * specified language. - */ + Localization, for example "en", "de" etc. - see "langs" below for + possible values. Adjust it to your needs. If lang is not found in + "langs" it defaults to "en". + + Optionally try to use browser language, falls back to previous + specified language. + */ "l10n": { "enabled": true, "lang": "en", @@ -164,39 +179,39 @@ var H5AI_CONFIG = { }, /* - * Link the hover effects between crumb, main view and tree. - */ + Link the hover effects between crumb, main view and tree. + */ "link-hover-states": { "enabled": true }, /* - * Shows the server mode in the bottom left corner. - * display values: - * 0: only show mode - * 1: mode and servername - * 2: mode, servername and -version - */ + Shows the server mode in the bottom left corner. + display values: + 0: only show mode + 1: mode and servername + 2: mode, servername and -version + */ "mode": { "enabled": true, "display": 2 }, /* - * Show an image preview on click. - */ + Show an image preview on click. + */ "preview-img": { "enabled": true, "types": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"] }, /* - * Show text file preview on click. - * "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will - * be rendered as HTML. - * - * For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ - */ + Show text file preview on click. + "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will + be rendered as HTML. + + For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ + */ "preview-txt": { "enabled": true, "types": { @@ -226,46 +241,46 @@ var H5AI_CONFIG = { }, /* - * Show QRCodes on hovering files. - */ + Show QRCodes on hovering files. + */ "qrcode": { "enabled": true, "size": 150 }, /* - * Make entries selectable. At the moment only needed for packaged download. - */ + Make entries selectable. At the moment only needed for packaged download. + */ "select": { "enabled": true }, /* - * Default sort order is a two letter code. The first letter specifies - * the column: "n" for "Name", "d" for "Date" or "s" for "Size". The - * second letter specifies the sort order: "a" for "ascending" or "d" - * for "descending". - */ + Default sort order is a two letter code. The first letter specifies + the column: "n" for "Name", "d" for "Date" or "s" for "Size". The + second letter specifies the sort order: "a" for "ascending" or "d" + for "descending". + */ "sort": { "enabled": true, "order": "na" }, /* - * Show additional info in a statusbar. - */ + Show additional info in a statusbar. + */ "statusbar": { "enabled": true }, /* - * Requires PHP on the server. - * Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be - * writable for the Apache Server. - * - img thumbnails depend on PHP-GD - * - mov thumbnails depend on ffmpeg - * - doc thumbnails depend on convert - */ + Requires PHP on the server. + Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be + writable for the Apache Server. + - img thumbnails depend on PHP-GD + - mov thumbnails depend on ffmpeg + - doc thumbnails depend on convert + */ "thumbnails": { "enabled": true, "img": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"], @@ -275,21 +290,21 @@ var H5AI_CONFIG = { }, /* - * Replace window title with current breadcrumb. - */ + Replace window title with current breadcrumb. + */ "title": { "enabled": true }, /* - * Show a folder tree. - * Note that this tree might have side effects as it sends HEAD requests - * to the folders, and therefore will invoke index.php scripts. Use - * "folderstatus" above to avoid such requests. - * It might also affect performance significantly. - * - * Slide tree bar into viewport if there is enough space. - */ + Show a folder tree. + Note that this tree might have side effects as it sends HEAD requests + to the folders, and therefore will invoke index.php scripts. Use + "folderstatus" above to avoid such requests. + It might also affect performance significantly. + + Slide tree bar into viewport if there is enough space. + */ "tree": { "enabled": true, "slide": true @@ -297,9 +312,9 @@ var H5AI_CONFIG = { }, - /* - * File types mapped to file extensions. In alphabetical order. - */ + + /*** File types mapped to file extensions. In alphabetical order. ***/ + "types": { "archive": [".tar.bz2", ".tar.gz", ".tgz"], "audio": [".aif", ".flac", ".m4a", ".mid", ".mp3", ".mpa", ".ra", ".ogg", ".wav", ".wma"], @@ -369,14 +384,12 @@ var H5AI_CONFIG = { }, - /* - * Available translations. "en" in first place as a reference, otherwise in alphabetical order. - * - * Date format is used in detailed view, for example: "YYYY-MM-DD HH:mm:ss" - * Syntax as specified by Moment.js (http://momentjs.com) - */ + + /*** Available translations. ***/ + "langs": { + /* "en" in first place as a reference, otherwise in alphabetical order. */ "en": { "lang": "english", "details": "details", @@ -390,7 +403,7 @@ var H5AI_CONFIG = { "files": "files", "download": "download", "noMatch": "no match", - "dateFormat": "YYYY-MM-DD HH:mm", + "dateFormat": "YYYY-MM-DD HH:mm", /* syntax as specified on http://momentjs.com */ "filter": "filter" }, From 87b3c6bfee9a881f7a55650eb1de2abc0fc7363c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:21:12 +0200 Subject: [PATCH 008/143] Improves entry url encoding. --- 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 954a3dfb..9df15e94 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -8,6 +8,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], f return href .replace(/\/+/g, '/') + .replace(/ /g, '%20') .replace(/'/g, '%27') .replace(/\[/g, '%5B') .replace(/\]/g, '%5D') From 94deb369b1cb28d9c04bccf0f0b2e183b4617d49 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:22:41 +0200 Subject: [PATCH 009/143] Updates error messages for api upload function. --- src/_h5ai/php/api.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index 306c405d..9f44d14c 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -147,13 +147,14 @@ else if ($action === "upload") { $userfile = $_FILES["userfile"]; - json_fail(3, "something went wrong: " . $userfile["error"], $userfile["error"] !== 0); + json_fail(3, "something went wrong [" . $userfile["error"] . "]", $userfile["error"] !== 0); + json_fail(4, "folders not supported", file_get_contents($userfile["tmp_name"]) === "null"); $upload_dir = $h5ai->getAbsPath($href); $dest = $upload_dir . "/" . $userfile["name"]; - json_fail(4, "already exists: " . $userfile["name"], file_exists($dest)); - json_fail(5, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); + json_fail(5, "already exists", file_exists($dest)); + json_fail(6, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); json_exit(); } From befdf549520967c23efca9eb850696224ecdbc84 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:24:55 +0200 Subject: [PATCH 010/143] Style improvments. --- src/_h5ai/css/inc/dropbox.less | 23 ++++++++++++++--------- src/_h5ai/css/inc/extended.less | 2 ++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less index d87a2f6c..d551f6da 100644 --- a/src/_h5ai/css/inc/dropbox.less +++ b/src/_h5ai/css/inc/dropbox.less @@ -12,16 +12,11 @@ .label { text-align: center; - color: #eee; + color: #ddd; font-size: 5em; font-weight: bold; } - &.hint { - // color: #ccc; - // border-color: #aaa; - } - &.match { border-color: #555; @@ -44,7 +39,7 @@ .name { display: inline-block; white-space: nowrap; - width: 320px; + // width: 320px; overflow: hidden; &:before { @@ -58,7 +53,6 @@ } .size { - // display: inline-block; display: none; float: right; white-space: nowrap; @@ -68,6 +62,18 @@ } } + .error { + float: right; + white-space: nowrap; + color: #c55; + } + + .finished { + float: right; + white-space: nowrap; + color: #008200; + } + .progress { display: inline-block; margin: 4px 8px; @@ -86,7 +92,6 @@ } &.finished .name:before { - // content: '✓✔'; content: '✔'; color: #008200; } diff --git a/src/_h5ai/css/inc/extended.less b/src/_h5ai/css/inc/extended.less index e387b9c0..d4b885f9 100644 --- a/src/_h5ai/css/inc/extended.less +++ b/src/_h5ai/css/inc/extended.less @@ -283,6 +283,8 @@ list-style: none; li { + position: relative; + &.header { display: none; } From f915bdea3b7aee1a3d74d90d9a0c132908141997 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:26:48 +0200 Subject: [PATCH 011/143] Improves display of 'empty' string for empty folders. --- src/_h5ai/js/inc/view/extended.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/_h5ai/js/inc/view/extended.js b/src/_h5ai/js/inc/view/extended.js index f8ff27bd..e08033d1 100644 --- a/src/_h5ai/js/inc/view/extended.js +++ b/src/_h5ai/js/inc/view/extended.js @@ -18,7 +18,7 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c '' + '', hintTemplate = '', - listTemplate = '
        ' + + listTemplate = '
          ' + '
        • ' + '' + '' + @@ -100,7 +100,8 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c init = function (entry) { var $extended = $('#extended'), - $ul = $(listTemplate); + $ul = $(listTemplate), + $emtpy = $(emptyTemplate); if (entry.parent) { $ul.append(update(entry.parent)); @@ -117,9 +118,10 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c }); $extended.append($ul); + $extended.append($emtpy); - if (entry.isEmpty()) { - $extended.append($(emptyTemplate)); + if (!entry.isEmpty()) { + $emtpy.hide(); } $extended @@ -136,14 +138,21 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c event.sub('entry.created', function (entry) { if (entry.isInCurrentFolder() && !entry.$extended) { - $ul.append(update(entry, true)); + update(entry, true).hide().appendTo($ul).slideDown(400); + $emtpy.slideUp(400); } }); event.sub('entry.removed', function (entry) { if (entry.isInCurrentFolder() && entry.$extended) { - entry.$extended.remove(); + entry.$extended.slideUp(400, function () { + entry.$extended.remove(); + + if (entry.parent.isEmpty()) { + $emtpy.slideDown(400); + } + }); } }); }; From 14960af036318c859f3788c2263a67fa8638fd86 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:28:05 +0200 Subject: [PATCH 012/143] Dropbox feature nearly done. --- src/_h5ai/js/inc/ext/dropbox.js | 102 +++++++++++--------------------- 1 file changed, 33 insertions(+), 69 deletions(-) diff --git a/src/_h5ai/js/inc/ext/dropbox.js b/src/_h5ai/js/inc/ext/dropbox.js index 7e589b53..2415708a 100644 --- a/src/_h5ai/js/inc/ext/dropbox.js +++ b/src/_h5ai/js/inc/ext/dropbox.js @@ -1,8 +1,10 @@ -modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry'], function (_, $, allsettings, entry) { +modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/resource'], function (_, $, allsettings, entry, resource) { var defaults = { - enabled: true + enabled: false, + maxfiles: 5, + maxfilesize: 20 }, settings = _.extend({}, defaults, allsettings.dropbox), @@ -11,8 +13,8 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry'], functi uploadTemplate = '
        • ' + '' + - '
          ' + '' + + '
          ' + '
        • ', init = function () { @@ -23,16 +25,34 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry'], functi var $dropbox = $(template).appendTo('#content'); - var uploads = {}; + var uploads = {}, + afterUpload = function (err, file, timeout) { - $dropbox.filedrop({ + timeout = timeout || 5000; + + if (file) { + uploads[file.name] + .addClass(err ? 'error' : 'finished') + .find('.progress').replaceWith(err ? '' + err + '' : 'okay'); + + setTimeout(function () { + uploads[file.name].slideUp(400, function () { + + uploads[file.name].remove(); + delete uploads[file.name]; + }); + }, timeout); + } + }; + + // $dropbox.filedrop({ + $('html').filedrop({ - // The name of the $_FILES entry: paramname: 'userfile', - maxfiles: 24, - maxfilesize: 1024, - url: allsettings.h5aiAbsHref + 'php/api.php', + maxfiles: settings.maxfiles, + maxfilesize: settings.maxfilesize, + url: resource.api(), data: { action: 'upload', href: entry.absHref @@ -48,19 +68,9 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry'], functi $dropbox.removeClass('match'); }, - docOver: function () { - - $dropbox.addClass('hint'); - }, - - docLeave: function () { - - $dropbox.removeClass('hint'); - }, - drop: function () { - $dropbox.removeClass('match hint'); + $dropbox.removeClass('match'); }, @@ -70,69 +80,23 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry'], functi .find('.name').text(file.name).end() .find('.size').text(file.size).end() .find('.progress .bar').css('width', 0).end(); - - console.log('beforeEach', file); - }, - - uploadStarted: function (i, file, len) { - - console.log('uploadStarted', i, file, len); }, progressUpdated: function (i, file, progress) { - uploads[file.name] - .find('.progress .bar').css('width', '' + progress + '%'); - console.log('progressUpdated', i, file, progress); + uploads[file.name].find('.progress .bar').css('width', '' + progress + '%'); }, uploadFinished: function (i, file, response) { - uploads[file.name].addClass(response.code ? 'error' : 'finished'); - setTimeout(function () { - uploads[file.name].slideUp(400, function () { - - uploads[file.name].remove(); - }); - }, 5000); - console.log('uploadFinished', i, file, response); + afterUpload(response.code && response.msg, file); }, - afterAll: function () { - - // $('#uploads .upload').remove(); - }, - - error: function (err, file) { - uploads[file.name].addClass('error'); - setTimeout(function () { - uploads[file.name].slideUp(400, function () { - - uploads[file.name].remove(); - }); - }, 5000); - switch (err) { - case 'BrowserNotSupported': - console.log('ERROR', 'Your browser does not support HTML5 file uploads!'); - break; - case 'TooManyFiles': - console.log('ERROR', 'Too many files! Please select 5 at most! (configurable)'); - break; - case 'FileTooLarge': - console.log('ERROR', file.name + ' is too large! Please upload files up to 2mb (configurable).'); - break; - default: - break; - } - console.log('error', err, file); + afterUpload(err, file); } }); - - - - }; init(); From 45922c1e7bd7ec24fc662adfd02906199f8f21b5 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:29:15 +0200 Subject: [PATCH 013/143] Adds context menu with delete option. --- src/_h5ai/css/inc/context-menu.less | 37 ++++++++++++ src/_h5ai/css/styles.less | 1 + src/_h5ai/js/inc/ext/context-menu.js | 84 ++++++++++++++++++++++++++++ src/_h5ai/js/inc/main.js | 1 + 4 files changed, 123 insertions(+) create mode 100644 src/_h5ai/css/inc/context-menu.less create mode 100644 src/_h5ai/js/inc/ext/context-menu.js diff --git a/src/_h5ai/css/inc/context-menu.less b/src/_h5ai/css/inc/context-menu.less new file mode 100644 index 00000000..25b8ff91 --- /dev/null +++ b/src/_h5ai/css/inc/context-menu.less @@ -0,0 +1,37 @@ + +#extended .context-menu { + + display: block; + position: absolute; + right: 0; + top: 0; + background-color: rgb(241,241,241); + // border: 1px solid rgb(210,210,210); + border: 2px solid rgb(210,210,210); + color: #999; + z-index: 10; + font-size: 0.9em; + .border-radius(4px); + + ul { + margin: 0; + padding: 0; + list-style: none; + text-align: left; + + li { + // padding: 8px 12px 10px 12px; + padding: 4px 4px 4px 4px; + white-space: nowrap; + border-top: 1px solid rgb(231,231,231); + .transition(all 0.2s ease-in-out); + .border-radius(4px); + + &:hover { + color: #e80; + background-color: rgba(255,255,255,0.8); + } + } + } +} + diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index 427acd71..d1e5d46d 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -23,6 +23,7 @@ body { @import "inc/content"; @import "inc/extended"; +@import "inc/context-menu"; @import "inc/dropbox"; @import "inc/bottombar"; diff --git a/src/_h5ai/js/inc/ext/context-menu.js b/src/_h5ai/js/inc/ext/context-menu.js new file mode 100644 index 00000000..d0e3942d --- /dev/null +++ b/src/_h5ai/js/inc/ext/context-menu.js @@ -0,0 +1,84 @@ + +modulejs.define('ext/context-menu', ['_', '$', 'core/settings', 'core/entry', 'core/event', 'core/resource'], function (_, $, allsettings, entry, event, resource) { + + var defaults = { + enabled: false, + deleteBtn: false + }, + + settings = _.extend({}, defaults, allsettings['context-menu']), + + template = '
          ' + + '
            ' + + '
            ', + + // deleteTmp = '
          • delete
          • ', + deleteTmp = '
          • delete
          • ', + // deleteTmp = '
          • ', + + + createDeleteBtn = function (entry, $ul) { + + var $del = $(deleteTmp).appendTo($ul); + + $del.on('click', function (event) { + + console.log('delete', entry.label); + $.ajax({ + url: resource.api(), + data: { + action: 'delete', + href: entry.absHref + }, + dataType: 'json', + success: function (json) { + + } + }); + }); + }, + + createMenu = function (entry) { + + var $html = $(template), + $ul = $html.find('ul'); + + $html.on('click', function (event) { + + event.stopPropagation(); + event.preventDefault(); + }); + + createDeleteBtn(entry, $ul); + + entry.$extended.find('a').append($html); + }, + + init = function () { + + if (!settings.enabled) { + return; + } + + event.sub('entry.mouseenter', function (entry) { + + if (!entry.isFolder()) { + var ctx = entry.$extended.find('.context-menu'); + if (ctx.length) { + ctx.show(); + } else { + createMenu(entry); + } + } + }); + + event.sub('entry.mouseleave', function (entry) { + + // entry.$extended.find('.context-menu').remove(); + entry.$extended.find('.context-menu').hide(); + }); + + }; + + init(); +}); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index 6821c3e2..c7ad2afe 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -24,6 +24,7 @@ // @include "view/viewmode.js" // @include "ext/autoupdate.js" + // @include "ext/context-menu.js" // @include "ext/crumb.js" // @include "ext/custom.js" // @include "ext/download.js" From 91a9621648c93843033d4eb73920597cbd5a20c3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 02:41:03 +0200 Subject: [PATCH 014/143] Changes build process to use handelbars. --- makefile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile.js b/makefile.js index 6e612864..4b14e03b 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-1', +var version = '0.22-dev-2', root = path.resolve(__dirname), src = path.join(root, 'src'), @@ -120,7 +120,7 @@ module.exports = function (make) { $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') .modified(mapper) - .mustache(replacements) + .handlebars(replacements) .write($.OVERWRITE, mapper); $(root + ': README*, LICENSE*') @@ -146,7 +146,7 @@ module.exports = function (make) { $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') .modified(mapper) - .mustache(replacements) + .handlebars(replacements) .write($.OVERWRITE, mapper); $(root + ': README*, LICENSE*') From 0b6b2b0f330164dd69a2491a49d8ce027846faab Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 13:25:27 +0200 Subject: [PATCH 015/143] Changes context-menu to pure delete function. --- src/_h5ai/config.js | 7 +- src/_h5ai/css/inc/delete.less | 30 ++++++++ src/_h5ai/css/styles.less | 1 + src/_h5ai/js/inc/ext/context-menu.js | 84 --------------------- src/_h5ai/js/inc/ext/delete.js | 107 +++++++++++++++++++++++++++ src/_h5ai/js/inc/main.js | 2 +- src/_h5ai/php/api.php | 21 ++++-- 7 files changed, 158 insertions(+), 94 deletions(-) create mode 100644 src/_h5ai/css/inc/delete.less delete mode 100644 src/_h5ai/js/inc/ext/context-menu.js create mode 100644 src/_h5ai/js/inc/ext/delete.js diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 9e94c144..1ce1e655 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -61,11 +61,10 @@ var H5AI_CONFIG = { }, /* - Show a context menu when hovering a file entry. + Allow entry deletion. */ - "context-menu": { - "enabled": true, - "deleteBtn": true + "delete": { + "enabled": true }, /* diff --git a/src/_h5ai/css/inc/delete.less b/src/_h5ai/css/inc/delete.less new file mode 100644 index 00000000..6008c9d4 --- /dev/null +++ b/src/_h5ai/css/inc/delete.less @@ -0,0 +1,30 @@ + +#delete { + display: none; + .topbar-right; + .transition(all 0.2s ease-in-out); + + &.failed { + background-color: rgba(255,0,0,0.5); + } +} + +#delete-auth { + display: none; + position: fixed; + z-index: 5; + left: 0; + top: 0; + .vert-gradient(rgb(241,241,241), rgb(228,228,228)); + border: 1px solid rgb(210,210,210); + + input { + display: block; + margin: 4px 6px; + border: 1px solid rgb(210,210,210); + font-family: Ubuntu, sans-serif; + color: #555; + background-color: rgba(255,255,255,1); + width: 100px; + } +} diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index d1e5d46d..5aa4a380 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -19,6 +19,7 @@ body { @import "inc/topbar"; @import "inc/download"; +@import "inc/delete"; @import "inc/filter"; @import "inc/content"; diff --git a/src/_h5ai/js/inc/ext/context-menu.js b/src/_h5ai/js/inc/ext/context-menu.js deleted file mode 100644 index d0e3942d..00000000 --- a/src/_h5ai/js/inc/ext/context-menu.js +++ /dev/null @@ -1,84 +0,0 @@ - -modulejs.define('ext/context-menu', ['_', '$', 'core/settings', 'core/entry', 'core/event', 'core/resource'], function (_, $, allsettings, entry, event, resource) { - - var defaults = { - enabled: false, - deleteBtn: false - }, - - settings = _.extend({}, defaults, allsettings['context-menu']), - - template = '
            ' + - '
              ' + - '
              ', - - // deleteTmp = '
            • delete
            • ', - deleteTmp = '
            • delete
            • ', - // deleteTmp = '
            • ', - - - createDeleteBtn = function (entry, $ul) { - - var $del = $(deleteTmp).appendTo($ul); - - $del.on('click', function (event) { - - console.log('delete', entry.label); - $.ajax({ - url: resource.api(), - data: { - action: 'delete', - href: entry.absHref - }, - dataType: 'json', - success: function (json) { - - } - }); - }); - }, - - createMenu = function (entry) { - - var $html = $(template), - $ul = $html.find('ul'); - - $html.on('click', function (event) { - - event.stopPropagation(); - event.preventDefault(); - }); - - createDeleteBtn(entry, $ul); - - entry.$extended.find('a').append($html); - }, - - init = function () { - - if (!settings.enabled) { - return; - } - - event.sub('entry.mouseenter', function (entry) { - - if (!entry.isFolder()) { - var ctx = entry.$extended.find('.context-menu'); - if (ctx.length) { - ctx.show(); - } else { - createMenu(entry); - } - } - }); - - event.sub('entry.mouseleave', function (entry) { - - // entry.$extended.find('.context-menu').remove(); - entry.$extended.find('.context-menu').hide(); - }); - - }; - - init(); -}); diff --git a/src/_h5ai/js/inc/ext/delete.js b/src/_h5ai/js/inc/ext/delete.js new file mode 100644 index 00000000..086c9087 --- /dev/null +++ b/src/_h5ai/js/inc/ext/delete.js @@ -0,0 +1,107 @@ + +modulejs.define('ext/delete', ['_', '$', 'core/settings', 'core/entry', 'core/event', 'core/resource'], function (_, $, allsettings, entry, event, resource) { + + var defaults = { + enabled: false + }, + + settings = _.extend({}, defaults, allsettings['delete']), + + deleteBtnTemplate = '
            • ' + + '' + + 'delete' + + 'delete' + + '' + + '
            • ', + authTemplate = '
              ' + + '' + + '' + + '
              ', + + selectedHrefsStr = '', + $delete, $img, $deleteAuth, $deleteUser, $deletePassword, + + failed = function () { + + $delete.addClass('failed'); + setTimeout(function () { + $delete.removeClass('failed'); + }, 1000); + }, + + handleResponse = function (json) { + + $delete.removeClass('current'); + $img.attr('src', resource.image('delete')); + + if (!json || json.code) { + if (json && json.code === 401) { + $deleteAuth + .css({ + left: $delete.offset().left, + top: $delete.offset().top + $delete.outerHeight() + }) + .show(); + $deleteUser.focus(); + } + failed(); + } + }, + + requestDeletion = function (hrefsStr) { + + $delete.addClass('current'); + $img.attr('src', resource.image('loading.gif', true)); + $.ajax({ + url: resource.api(), + data: { + action: 'delete', + hrefs: hrefsStr, + user: $deleteUser.val(), + password: $deletePassword.val() + }, + dataType: 'json', + success: handleResponse + }); + }, + + onSelection = function (entries) { + + selectedHrefsStr = ''; + if (entries.length) { + selectedHrefsStr = _.map(entries, function (entry) { + + return entry.absHref; + }).join(':'); + $delete.appendTo('#navbar').show(); + } else { + $delete.hide(); + $deleteAuth.hide(); + } + }, + + init = function () { + + if (!settings.enabled) { + return; + } + + $delete = $(deleteBtnTemplate) + .find('a').on('click', function (event) { + + event.preventDefault(); + $deleteAuth.hide(); + requestDeletion(selectedHrefsStr); + }).end() + .appendTo('#navbar'); + $img = $delete.find('img'); + + $deleteAuth = $(authTemplate).appendTo('body'); + $deleteUser = $deleteAuth.find('#delete-auth-user'); + $deletePassword = $deleteAuth.find('#delete-auth-password'); + + event.sub('selection', onSelection); + }; + + init(); +}); diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index c7ad2afe..efe0ba0d 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -24,9 +24,9 @@ // @include "view/viewmode.js" // @include "ext/autoupdate.js" - // @include "ext/context-menu.js" // @include "ext/crumb.js" // @include "ext/custom.js" + // @include "ext/delete.js" // @include "ext/download.js" // @include "ext/dropbox.js" // @include "ext/filter.js" diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index 9f44d14c..c05fd0a1 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -162,14 +162,25 @@ else if ($action === "upload") { else if ($action === "delete") { - list($href) = check_keys(array("href")); + json_fail(1, "deletion disabled", !$options["delete"]["enabled"]); - $absPath = $h5ai->getAbsPath($href); + list($hrefs) = check_keys(array("hrefs")); - if (unlink($absPath)) { - json_exit(); + $hrefs = explode(":", trim($hrefs)); + $errors = array(); + + foreach ($hrefs as $href) { + $absPath = $h5ai->getAbsPath($href); + + if (!unlink($absPath)) { + $errors[] = $href; + } + } + + if ($errors->size) { + json_fail(1, "deletion failed for some"); } else { - json_fail(1, "deletion failed"); + json_exit(); } } From cc7d9ee91207080962fae28d98cd61335c17c86d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 13:36:51 +0200 Subject: [PATCH 016/143] Fixes selection update for deleted entries. --- src/_h5ai/config.js | 2 +- src/_h5ai/css/inc/context-menu.less | 9 ++------- src/_h5ai/js/inc/ext/select.js | 8 ++++++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 1ce1e655..0ec20073 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -40,7 +40,7 @@ var H5AI_CONFIG = { Set parent folder labels to real folder names. */ "view": { - "modes": ["details", "list", "icons"], + "modes": ["details", "icons"], "setParentFolderLabels": true }, diff --git a/src/_h5ai/css/inc/context-menu.less b/src/_h5ai/css/inc/context-menu.less index 25b8ff91..6014e527 100644 --- a/src/_h5ai/css/inc/context-menu.less +++ b/src/_h5ai/css/inc/context-menu.less @@ -6,12 +6,10 @@ right: 0; top: 0; background-color: rgb(241,241,241); - // border: 1px solid rgb(210,210,210); - border: 2px solid rgb(210,210,210); + border: 1px solid rgb(210,210,210); color: #999; z-index: 10; font-size: 0.9em; - .border-radius(4px); ul { margin: 0; @@ -20,12 +18,10 @@ text-align: left; li { - // padding: 8px 12px 10px 12px; - padding: 4px 4px 4px 4px; + padding: 8px 12px 10px 12px; white-space: nowrap; border-top: 1px solid rgb(231,231,231); .transition(all 0.2s ease-in-out); - .border-radius(4px); &:hover { color: #e80; @@ -34,4 +30,3 @@ } } } - diff --git a/src/_h5ai/js/inc/ext/select.js b/src/_h5ai/js/inc/ext/select.js index 6d89af00..f88f171c 100644 --- a/src/_h5ai/js/inc/ext/select.js +++ b/src/_h5ai/js/inc/ext/select.js @@ -125,6 +125,14 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio $selectionRect.hide().appendTo('body'); + event.sub('entry.removed', function (entry) { + + if (entry.$extended && entry.$extended.hasClass('selected')) { + entry.$extended.removeClass('selected'); + publish(); + } + }); + $document .on('mousedown', '.noSelection', noSelection) .on('mousedown', '.noSelectionUnlessCtrl,input,a', noSelectionUnlessCtrl) From 9d26d5ae7e09bb85b68b6a1fadabc5775c38eb14 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 13:39:09 +0200 Subject: [PATCH 017/143] Adds l10n for delete. --- makefile.js | 2 +- src/_h5ai/config.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/makefile.js b/makefile.js index 4b14e03b..b306f564 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-2', +var version = '0.22-dev-3', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 0ec20073..be4b5268 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -403,7 +403,8 @@ var H5AI_CONFIG = { "download": "download", "noMatch": "no match", "dateFormat": "YYYY-MM-DD HH:mm", /* syntax as specified on http://momentjs.com */ - "filter": "filter" + "filter": "filter", + "delete": "delete" }, "bg": { @@ -450,7 +451,8 @@ var H5AI_CONFIG = { "download": "Download", "noMatch": "keine Treffer", "dateFormat": "DD.MM.YYYY HH:mm", - "filter": "Filter" + "filter": "Filter", + "delete": "Löschen" }, "el": { From c160c89027377d5e5ee429c28df0208e8df53664 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 17:49:30 +0200 Subject: [PATCH 018/143] Sorts extensions in config.js --- makefile.js | 2 +- src/_h5ai/config.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/makefile.js b/makefile.js index b306f564..ab744904 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-3', +var version = '0.22-dev-5', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index be4b5268..5fce0fa7 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -60,13 +60,6 @@ var H5AI_CONFIG = { "interval": 1000 }, - /* - Allow entry deletion. - */ - "delete": { - "enabled": true - }, - /* Show a clickable breadcrumb. */ @@ -84,6 +77,13 @@ var H5AI_CONFIG = { "footer": "_h5ai.footer.html" }, + /* + Allow file deletion. + */ + "delete": { + "enabled": true + }, + /* File upload via drag'n'drop. Folders are not supported. The working file size seems to be very broser dependent. From 2a1f864e6f185fc9c4a54c4b35277311712637e3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 17:53:07 +0200 Subject: [PATCH 019/143] Fixes typos. --- 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 5fce0fa7..aee20f85 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -86,7 +86,7 @@ var H5AI_CONFIG = { /* File upload via drag'n'drop. Folders are not supported. - The working file size seems to be very broser dependent. + The working file size seems to be very browser dependent. Max file size is in MB. */ From 4c3267c1f8350a9cccd27665811722ee4d0db0d6 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 20:58:10 +0200 Subject: [PATCH 020/143] Removes unused folder uploads. --- src/_h5ai/uploads/README.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 src/_h5ai/uploads/README.md diff --git a/src/_h5ai/uploads/README.md b/src/_h5ai/uploads/README.md deleted file mode 100644 index f0fbb3dc..00000000 --- a/src/_h5ai/uploads/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Cache - -This directory is used for server side caching. To use caching make this -directory writable for your webserver. - -There is no critical data in here. You can savely remove any content. This -will clear the cache. From ff40e2129ff43a6028949d69df0d4733aa6bfdc4 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 21:41:25 +0200 Subject: [PATCH 021/143] Updates dropbox design. Now the content space is the dropzone. --- src/_h5ai/css/inc/dropbox.less | 30 +++++++----------------------- src/_h5ai/js/inc/ext/dropbox.js | 29 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less index d551f6da..b1fa3bc7 100644 --- a/src/_h5ai/css/inc/dropbox.less +++ b/src/_h5ai/css/inc/dropbox.less @@ -1,31 +1,17 @@ -#dropbox { - margin: 48px 24px; - padding: 24px 12px; - overflow: hidden; +#content { + border: 1px dashed #fff; + border-radius: 8px; - background-color: #f8f8f8; - border: 1px dashed #ccc; - border-radius: 10px; - - .transition(all 0.2s ease-in-out); - - .label { - text-align: center; - color: #ddd; - font-size: 5em; - font-weight: bold; + &.hint { + border-color: #ccc; } - &.match { - border-color: #555; - - .label { - color: #999; - } + border-style: solid; } } + #uploads { width: 450px; margin: 12px auto; @@ -100,6 +86,4 @@ color: #c55; } } - } - diff --git a/src/_h5ai/js/inc/ext/dropbox.js b/src/_h5ai/js/inc/ext/dropbox.js index 2415708a..62b940ec 100644 --- a/src/_h5ai/js/inc/ext/dropbox.js +++ b/src/_h5ai/js/inc/ext/dropbox.js @@ -9,7 +9,7 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r settings = _.extend({}, defaults, allsettings.dropbox), - template = '
              dropbox
                ', + template = '
                  ', uploadTemplate = '
                • ' + '' + @@ -23,12 +23,10 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r return; } - var $dropbox = $(template).appendTo('#content'); + var $content = $('#content').append(template); var uploads = {}, - afterUpload = function (err, file, timeout) { - - timeout = timeout || 5000; + afterUpload = function (err, file) { if (file) { uploads[file.name] @@ -41,12 +39,11 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r uploads[file.name].remove(); delete uploads[file.name]; }); - }, timeout); + }, 5000); } }; - // $dropbox.filedrop({ - $('html').filedrop({ + $content.filedrop({ paramname: 'userfile', @@ -58,19 +55,29 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r href: entry.absHref }, + docEnter: function () { + + $content.addClass('hint'); + }, + + docLeave: function () { + + $content.removeClass('hint'); + }, + dragOver: function () { - $dropbox.addClass('match'); + $content.addClass('match'); }, dragLeave: function () { - $dropbox.removeClass('match'); + $content.removeClass('match'); }, drop: function () { - $dropbox.removeClass('match'); + $content.removeClass('hint match'); }, From 71d22fb9e039a81b65d9b28a50aaf17c41baf148 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 22:05:29 +0200 Subject: [PATCH 022/143] Improves api security. --- src/_h5ai/css/inc/dropbox.less | 6 +++--- src/_h5ai/php/api.php | 25 ++++++++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less index b1fa3bc7..187867d4 100644 --- a/src/_h5ai/css/inc/dropbox.less +++ b/src/_h5ai/css/inc/dropbox.less @@ -2,12 +2,13 @@ #content { border: 1px dashed #fff; border-radius: 8px; + .transition(all 0.2s ease-in-out); &.hint { - border-color: #ccc; + border-color: #ddd; } &.match { - border-style: solid; + border-color: #aaa; } } @@ -25,7 +26,6 @@ .name { display: inline-block; white-space: nowrap; - // width: 320px; overflow: hidden; &:before { diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index c05fd0a1..3e8aef5b 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -151,10 +151,14 @@ else if ($action === "upload") { json_fail(4, "folders not supported", file_get_contents($userfile["tmp_name"]) === "null"); $upload_dir = $h5ai->getAbsPath($href); + $code = $h5ai->getHttpCode($href); + + json_fail(5, "upload dir no h5ai folder or ignored", $code !== "h5ai" || $h5ai->is_ignored($upload_dir)); + $dest = $upload_dir . "/" . $userfile["name"]; - json_fail(5, "already exists", file_exists($dest)); - json_fail(6, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); + json_fail(6, "already exists", file_exists($dest)); + json_fail(7, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); json_exit(); } @@ -170,10 +174,21 @@ else if ($action === "delete") { $errors = array(); foreach ($hrefs as $href) { - $absPath = $h5ai->getAbsPath($href); - if (!unlink($absPath)) { - $errors[] = $href; + $d = H5ai::normalize_path(dirname($href), true); + $n = basename($href); + + $code = $h5ai->getHttpCode($d); + if ($code == 401) { + } + + if ($code == "h5ai" && !$h5ai->is_ignored($n)) { + + $absPath = $h5ai->getAbsPath($href); + + if (!unlink($absPath)) { + $errors[] = $href; + } } } From f7fbd2e256e5ee46fe7d18a7b391b4152dabe659 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 11 Aug 2012 22:40:23 +0200 Subject: [PATCH 023/143] Fixed content transition. --- src/_h5ai/css/inc/dropbox.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less index 187867d4..48e1cc29 100644 --- a/src/_h5ai/css/inc/dropbox.less +++ b/src/_h5ai/css/inc/dropbox.less @@ -2,7 +2,7 @@ #content { border: 1px dashed #fff; border-radius: 8px; - .transition(all 0.2s ease-in-out); + .transition(border-color 0.2s ease-in-out); &.hint { border-color: #ddd; From 3e3b2813cd770b7a23dab33b27e8159b65f36c0b Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 11:48:34 +0200 Subject: [PATCH 024/143] Adds core/refresh. Refactors ext/autoupdate. --- src/_h5ai/js/inc/core/ajax.js | 22 ++++++++++++++++++ src/_h5ai/js/inc/core/refresh.js | 31 +++++++++++++++++++++++++ src/_h5ai/js/inc/ext/autoupdate.js | 36 ++---------------------------- src/_h5ai/js/inc/main.js | 1 + 4 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 src/_h5ai/js/inc/core/refresh.js diff --git a/src/_h5ai/js/inc/core/ajax.js b/src/_h5ai/js/inc/core/ajax.js index 1dec7865..40c9c35f 100644 --- a/src/_h5ai/js/inc/core/ajax.js +++ b/src/_h5ai/js/inc/core/ajax.js @@ -44,6 +44,27 @@ modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], functi }); }, + getEntries = function (href, content, callback) { + + $.ajax({ + url: resource.api(), + data: { + action: 'getentries', + href: href, + content: content + }, + dataType: 'json', + success: function (json) { + + callback(json); + }, + error: function () { + + callback(); + } + }); + }, + getArchive = function (data, callback) { $.ajax({ @@ -149,6 +170,7 @@ modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], functi return { getStatus: getStatus, getChecks: getChecks, + getEntries: getEntries, getArchive: getArchive, getThumbSrcSmall: getThumbSrcSmall, getThumbSrcBig: getThumbSrcBig, diff --git a/src/_h5ai/js/inc/core/refresh.js b/src/_h5ai/js/inc/core/refresh.js new file mode 100644 index 00000000..5e5ac7cf --- /dev/null +++ b/src/_h5ai/js/inc/core/refresh.js @@ -0,0 +1,31 @@ + +modulejs.define('core/refresh', ['_', 'core/ajax', 'model/entry'], function (_, ajax, Entry) { + + var parseJson = function (entry, json) { + + var found = {}; + + _.each(json.entries, function (jsonEntry) { + + found[jsonEntry.absHref] = true; + Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content); + }); + + _.each(entry.content, function (e) { + if (!found[e.absHref]) { + Entry.remove(e.absHref); + } + }); + }, + + refresh = function () { + + var entry = Entry.get(); + ajax.getEntries(entry.absHref, 1, function (json) { + + parseJson(entry, json); + }); + }; + + return refresh; +}); diff --git a/src/_h5ai/js/inc/ext/autoupdate.js b/src/_h5ai/js/inc/ext/autoupdate.js index d8f837bb..9f099ba1 100644 --- a/src/_h5ai/js/inc/ext/autoupdate.js +++ b/src/_h5ai/js/inc/ext/autoupdate.js @@ -1,5 +1,5 @@ -modulejs.define('ext/autoupdate', ['_', '$', 'core/settings', 'core/event', 'core/resource', 'model/entry'], function (_, $, allsettings, event, resource, Entry) { +modulejs.define('ext/autoupdate', ['_', '$', 'core/settings', 'core/event', 'core/refresh'], function (_, $, allsettings, event, refresh) { var defaults = { enabled: false, @@ -8,41 +8,9 @@ modulejs.define('ext/autoupdate', ['_', '$', 'core/settings', 'core/event', 'cor settings = _.extend({}, defaults, allsettings.autoupdate), - parseJson = function (entry, json) { - - var found = {}; - - _.each(json.entries, function (jsonEntry) { - - found[jsonEntry.absHref] = true; - Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content); - }); - - _.each(entry.content, function (e) { - if (!found[e.absHref]) { - Entry.remove(e.absHref); - } - }); - }, - heartbeat = function () { - var entry = Entry.get(); - - $.ajax({ - url: resource.api(), - data: { - action: 'getentries', - href: entry.absHref, - content: 1 - }, - dataType: 'json', - success: function (json) { - - parseJson(entry, json); - } - }); - + refresh(); setTimeout(heartbeat, settings.interval); }, diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index efe0ba0d..3ace56cb 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -9,6 +9,7 @@ // @include "core/format.js" // @include "core/langs.js" // @include "core/parser.js" + // @include "core/refresh.js" // @include "core/resource.js" // @include "core/settings.js" // @include "core/store.js" From 801ee05872eae1766c685359fa5ce0590f038e59 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 11:58:09 +0200 Subject: [PATCH 025/143] Adds refresh after delete an upload. --- src/_h5ai/config.js | 6 +++--- src/_h5ai/js/inc/ext/delete.js | 3 ++- src/_h5ai/js/inc/ext/dropbox.js | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index aee20f85..6c012efe 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -57,7 +57,7 @@ var H5AI_CONFIG = { */ "autoupdate": { "enabled": true, - "interval": 1000 + "interval": 5000 }, /* @@ -92,8 +92,8 @@ var H5AI_CONFIG = { */ "dropbox": { "enabled": true, - "maxfiles": 50, - "maxfilesize": 2000 + "maxfiles": 10, + "maxfilesize": 1000 }, /* diff --git a/src/_h5ai/js/inc/ext/delete.js b/src/_h5ai/js/inc/ext/delete.js index 086c9087..cd5c2d83 100644 --- a/src/_h5ai/js/inc/ext/delete.js +++ b/src/_h5ai/js/inc/ext/delete.js @@ -1,5 +1,5 @@ -modulejs.define('ext/delete', ['_', '$', 'core/settings', 'core/entry', 'core/event', 'core/resource'], function (_, $, allsettings, entry, event, resource) { +modulejs.define('ext/delete', ['_', '$', 'core/settings', 'core/entry', 'core/event', 'core/resource', 'core/refresh'], function (_, $, allsettings, entry, event, resource, refresh) { var defaults = { enabled: false @@ -46,6 +46,7 @@ modulejs.define('ext/delete', ['_', '$', 'core/settings', 'core/entry', 'core/ev } failed(); } + refresh(); }, requestDeletion = function (hrefsStr) { diff --git a/src/_h5ai/js/inc/ext/dropbox.js b/src/_h5ai/js/inc/ext/dropbox.js index 62b940ec..a63acb68 100644 --- a/src/_h5ai/js/inc/ext/dropbox.js +++ b/src/_h5ai/js/inc/ext/dropbox.js @@ -1,5 +1,5 @@ -modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/resource'], function (_, $, allsettings, entry, resource) { +modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/resource', 'core/refresh'], function (_, $, allsettings, entry, resource, refresh) { var defaults = { enabled: false, @@ -99,6 +99,11 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r afterUpload(response.code && response.msg, file); }, + afterAll: function () { + + refresh(); + }, + error: function (err, file) { afterUpload(err, file); From fbfbcd0439c3d62ebed656ada4e5c40a64e78aef Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 14:52:27 +0200 Subject: [PATCH 026/143] Separates translations. --- src/_h5ai/config.js | 364 +++------------------------------ src/_h5ai/js/inc/core/langs.js | 32 +-- src/_h5ai/js/inc/ext/l10n.js | 64 +++++- src/_h5ai/l10n/bg.json | 12 ++ src/_h5ai/l10n/cs.json | 16 ++ src/_h5ai/l10n/de.json | 17 ++ src/_h5ai/l10n/el.json | 16 ++ src/_h5ai/l10n/en.json | 18 ++ src/_h5ai/l10n/es.json | 13 ++ src/_h5ai/l10n/fr.json | 15 ++ src/_h5ai/l10n/hu.json | 15 ++ src/_h5ai/l10n/it.json | 12 ++ src/_h5ai/l10n/ja.json | 14 ++ src/_h5ai/l10n/lv.json | 15 ++ src/_h5ai/l10n/nb.json | 14 ++ src/_h5ai/l10n/nl.json | 10 + src/_h5ai/l10n/pl.json | 12 ++ src/_h5ai/l10n/pt.json | 12 ++ src/_h5ai/l10n/ro.json | 14 ++ src/_h5ai/l10n/ru.json | 12 ++ src/_h5ai/l10n/sk.json | 12 ++ src/_h5ai/l10n/sr.json | 14 ++ src/_h5ai/l10n/sv.json | 10 + src/_h5ai/l10n/tr.json | 13 ++ src/_h5ai/l10n/zh-cn.json | 13 ++ src/_h5ai/l10n/zh-tw.json | 13 ++ 26 files changed, 398 insertions(+), 374 deletions(-) create mode 100644 src/_h5ai/l10n/bg.json create mode 100644 src/_h5ai/l10n/cs.json create mode 100644 src/_h5ai/l10n/de.json create mode 100644 src/_h5ai/l10n/el.json create mode 100644 src/_h5ai/l10n/en.json create mode 100644 src/_h5ai/l10n/es.json create mode 100644 src/_h5ai/l10n/fr.json create mode 100644 src/_h5ai/l10n/hu.json create mode 100644 src/_h5ai/l10n/it.json create mode 100644 src/_h5ai/l10n/ja.json create mode 100644 src/_h5ai/l10n/lv.json create mode 100644 src/_h5ai/l10n/nb.json create mode 100644 src/_h5ai/l10n/nl.json create mode 100644 src/_h5ai/l10n/pl.json create mode 100644 src/_h5ai/l10n/pt.json create mode 100644 src/_h5ai/l10n/ro.json create mode 100644 src/_h5ai/l10n/ru.json create mode 100644 src/_h5ai/l10n/sk.json create mode 100644 src/_h5ai/l10n/sr.json create mode 100644 src/_h5ai/l10n/sv.json create mode 100644 src/_h5ai/l10n/tr.json create mode 100644 src/_h5ai/l10n/zh-cn.json create mode 100644 src/_h5ai/l10n/zh-tw.json diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 6c012efe..2fc253f2 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -248,7 +248,7 @@ var H5AI_CONFIG = { }, /* - Make entries selectable. At the moment only needed for packaged download. + Make entries selectable. At the moment only needed for packaged download and delete. */ "select": { "enabled": true @@ -312,7 +312,7 @@ var H5AI_CONFIG = { - /*** File types mapped to file extensions. In alphabetical order. ***/ + /*** File types mapped to file extensions ***/ "types": { "archive": [".tar.bz2", ".tar.gz", ".tgz"], @@ -384,343 +384,33 @@ var H5AI_CONFIG = { - /*** Available translations. ***/ + /*** Available translations ***/ "langs": { + /* defaults */ + "en": "english", - /* "en" in first place as a reference, otherwise in alphabetical order. */ - "en": { - "lang": "english", - "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", /* syntax as specified on http://momentjs.com */ - "filter": "filter", - "delete": "delete" - }, - - "bg": { - "lang": "български", - "details": "детайли", - "icons": "икони", - "name": "Име", - "lastModified": "Последна промяна", - "size": "Размер", - "parentDirectory": "Предходна директория", - "empty": "празно", - "folders": "папки", - "files": "файлове" - }, - - "cs": { - "lang": "čeština", - "details": "podrobnosti", - "icons": "ikony", - "name": "Název", - "lastModified": "Upraveno", - "size": "Velikost", - "parentDirectory": "Nadřazený adresář", - "empty": "prázdný", - "folders": "složek", - "files": "souborů", - "download": "stáhnout", - "noMatch": "žádná shoda", - "dateFormat": "DD.MM.YYYY HH:mm", - "filter": "filtr" - }, - - "de": { - "lang": "deutsch", - "details": "Details", - "icons": "Icons", - "name": "Name", - "lastModified": "Geändert", - "size": "Größe", - "parentDirectory": "Übergeordnetes Verzeichnis", - "empty": "leer", - "folders": "Ordner", - "files": "Dateien", - "download": "Download", - "noMatch": "keine Treffer", - "dateFormat": "DD.MM.YYYY HH:mm", - "filter": "Filter", - "delete": "Löschen" - }, - - "el": { - "lang": "ελληνικά", - "details": "λεπτομέρειες", - "icons": "εικονίδια", - "name": "Όνομα", - "lastModified": "Τελευταία τροποποίηση", - "size": "Μέγεθος", - "parentDirectory": "Προηγούμενος Κατάλογος", - "empty": "κενό", - "folders": "φάκελοι", - "files": "αρχεία", - "download": "μεταμόρφωση", - "noMatch": "κανένα αποτέλεσμα", - "dateFormat": "DD/MM/YYYY HH:mm", - "filter": "φίλτρο" - }, - - "es": { - "lang": "español", - "details": "Detalles", - "icons": "Íconos", - "name": "Nombre", - "lastModified": "Última modificación", - "size": "Tamaño", - "parentDirectory": "Directorio superior", - "empty": "vacío", - "folders": "Directorios", - "files": "Archivos", - "download": "Descargar" - }, - - "fr": { - "lang": "français", - "details": "détails", - "icons": "icônes", - "name": "Nom", - "lastModified": "Dernière modification", - "size": "Taille", - "parentDirectory": "Dossier parent", - "empty": "vide", - "folders": "Répertoires", - "files": "Fichiers", - "download": "télécharger", - "noMatch": "rien trouvé", - "dateFormat": "DD/MM/YYYY HH:mm" - }, - - "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", - "icons": "icone", - "name": "Nome", - "lastModified": "Ultima modifica", - "size": "Dimensione", - "parentDirectory": "Cartella Superiore", - "empty": "vuota", - "folders": "cartelle", - "files": "file" - }, - - "ja": { - "lang": "日本語", - "details": "詳細", - "icons": "アイコン", - "name": "名前", - "lastModified": "変更日", - "size": "サイズ", - "parentDirectory": "親フォルダ", - "empty": "項目なし", - "folders": "フォルダ", - "files": "ファイル", - "download": "ダウンロード", - "noMatch": "一致なし" - }, - - "lv": { - "lang": "latviešu", - "details": "detaļas", - "icons": "ikonas", - "name": "Nosaukums", - "lastModified": "Pēdējoreiz modificēts", - "size": "Izmērs", - "parentDirectory": "Vecākdirektorijs", - "empty": "tukšs", - "folders": "mapes", - "files": "faili", - "download": "lejupielādēt", - "noMatch": "nav sakritības", - "dateFormat": "YYYY-MM-DD HH:mm" - }, - - "nb": { - "lang": "norwegian", - "details": "detaljer", - "icons": "ikoner", - "name": "Navn", - "lastModified": "Sist endret", - "size": "Størrelse", - "parentDirectory": "Overordnet mappe", - "empty": "tom", - "folders": "mapper", - "files": "filer", - "download": "last ned", - "noMatch": "ingen treff" - }, - - "nl": { - "lang": "nederlands", - "details": "details", - "icons": "iconen", - "name": "Naam", - "lastModified": "Laatste wijziging", - "size": "Grootte", - "parentDirectory": "Bovenliggende map", - "empty": "lege" - }, - - "pl": { - "lang": "polski", - "details": "szczegóły", - "icons": "ikony", - "name": "Nazwa", - "lastModified": "Ostatnia modyfikacja", - "size": "Rozmiar", - "parentDirectory": "Katalog nadrzędny", - "empty": "pusty", - "folders": "foldery", - "files": "pliki" - }, - - "pt": { - "lang": "português", - "details": "detalhes", - "icons": "ícones", - "name": "Nome", - "lastModified": "Última modificação", - "size": "Tamanho", - "parentDirectory": "Diretório superior", - "empty": "vazio", - "folders": "pastas", - "files": "arquivos" - }, - - "ro": { - "lang": "română", - "details": "detalii", - "icons": "pictograme", - "name": "nume", - "lastModified": "ultima modificare", - "size": "mărime", - "parentDirectory": "dosar părinte", - "empty": "gol", - "folders": "dosar", - "files": "fişiere", - "download": "descarcă", - "noMatch": "0 rezultate" - }, - - "ru": { - "lang": "русский", - "details": "детали", - "icons": "иконки", - "name": "Имя", - "lastModified": "Последние изменения", - "size": "Размер", - "parentDirectory": "Главная директория", - "empty": "пусто", - "folders": "папки", - "files": "файлы" - }, - - "sk": { - "lang": "slovenčina", - "details": "podrobnosti", - "icons": "ikony", - "name": "Názov", - "lastModified": "Upravené", - "size": "Velkosť", - "parentDirectory": "Nadriadený priečinok", - "empty": "prázdny", - "folders": "priečinkov", - "files": "súborov" - }, - - "sr": { - "lang": "srpski", - "details": "detalji", - "icons": "ikone", - "name": "Ime", - "lastModified": "Poslednja modifikacija", - "size": "Veličina", - "parentDirectory": "Roditeljski direktorijum", - "empty": "prazno", - "folders": "direktorijum", - "files": "fajlovi", - "download": "download", - "noMatch": "bez poklapanja" - }, - - "sv": { - "lang": "svenska", - "details": "detaljerad", - "icons": "ikoner", - "name": "Filnamn", - "lastModified": "Senast ändrad", - "size": "Filstorlek", - "parentDirectory": "Till överordnad mapp", - "empty": "tom" - }, - - "tr": { - "lang": "türkçe", - "details": "detaylar", - "icons": "ikonlar", - "name": "İsim", - "lastModified": "Son Düzenleme", - "size": "Boyut", - "parentDirectory": "Üst Dizin", - "empty": "boş", - "folders": "klasörler", - "files": "dosyalar", - "download": "indir" - }, - - "zh-cn": { - "lang": "简体中文", - "details": "详情", - "icons": "图标", - "name": "文件名", - "lastModified": "上次修改", - "size": "大小", - "parentDirectory": "上层文件夹", - "empty": "空文件夹", - "folders": "文件夹", - "files": "文件", - "download": "下载" - }, - - "zh-tw": { - "lang": "正體中文", - "details": "詳細資料", - "icons": "圖示", - "name": "檔名", - "lastModified": "上次修改", - "size": "大小", - "parentDirectory": "上層目錄", - "empty": "空資料夾", - "folders": "資料夾", - "files": "檔案", - "download": "下載" - } + "bg": "български", + "cs": "čeština", + "de": "deutsch", + "el": "ελληνικά", + "es": "español", + "fr": "français", + "hu": "magyar", + "it": "italiano", + "ja": "日本語", + "lv": "latviešu", + "nb": "norwegian", + "nl": "nederlands", + "pl": "polski", + "pt": "português", + "ro": "română", + "ru": "русский", + "sk": "slovenčina", + "sr": "srpski", + "sv": "svenska", + "tr": "türkçe", + "zh-cn": "简体中文", + "zh-tw": "正體中文" } }; diff --git a/src/_h5ai/js/inc/core/langs.js b/src/_h5ai/js/inc/core/langs.js index 1c851f55..30b802cc 100644 --- a/src/_h5ai/js/inc/core/langs.js +++ b/src/_h5ai/js/inc/core/langs.js @@ -1,34 +1,12 @@ 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', - filter: 'filter' - }, + var langs = {}; - translations = {}, + _.each(_.extend({}, config.langs), function (trans, lang) { - parse = function (langs) { + langs[lang] = trans; + }); - _.each(langs, function (trans, lang) { - - translations[lang] = _.extend({}, defaults, trans); - }); - }; - - parse(_.extend({}, config.langs)); - - return translations; + return langs; }); diff --git a/src/_h5ai/js/inc/ext/l10n.js b/src/_h5ai/js/inc/ext/l10n.js index c16e2b77..cbc92122 100644 --- a/src/_h5ai/js/inc/ext/l10n.js +++ b/src/_h5ai/js/inc/ext/l10n.js @@ -7,6 +7,23 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form useBrowserLang: true }, + defaultTranslations = { + lang: 'english', + 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', + filter: 'filter' + }, + settings = _.extend({}, defaults, allsettings.l10n), template = '' + @@ -17,8 +34,35 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form storekey = 'h5ai.language', + loaded = { + en: _.extend({}, defaultTranslations) + }, currentLang = null, + loadLanguage = function (lang, callback) { + + if (loaded[lang]) { + + callback(loaded[lang]); + } else { + + $.ajax({ + url: allsettings.h5aiAbsHref + 'l10n/' + lang + '.json', + dataType: 'json', + success: function (json) { + + loaded[lang] = _.extend({}, defaultTranslations, json); + callback(loaded[lang]); + }, + error: function () { + + loaded[lang] = _.extend({}, defaultTranslations); + callback(loaded[lang]); + } + }); + } + }, + localize = function (langs, lang, useBrowserLang) { var storedLang = store.get(storekey); @@ -40,26 +84,26 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form lang = 'en'; } - currentLang = langs[lang]; - if (currentLang) { + loadLanguage(lang, function (currentLang) { + $.each(currentLang, function (key, value) { $('.l10n-' + key).text(value); }); $('.lang').text(lang); $('.langOption').removeClass('current'); $('.langOption.' + lang).addClass('current'); - } - format.setDefaultDateFormat(currentLang.dateFormat); + format.setDefaultDateFormat(currentLang.dateFormat); - $('#extended .entry .date').each(function () { + $('#extended .entry .date').each(function () { - var $this = $(this); + var $this = $(this); - $this.text(format.formatDate($this.data('time'))); + $this.text(format.formatDate($this.data('time'))); + }); + + $('#filter input').attr('placeholder', currentLang.filter); }); - - $('#filter input').attr('placeholder', currentLang.filter); }, initLangSelector = function (langs) { @@ -77,7 +121,7 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form $.each(sortedLangsKeys, function (idx, lang) { $(langOptionTemplate) .addClass(lang) - .text(lang + ' - ' + langs[lang].lang) + .text(lang + ' - ' + (_.isString(langs[lang]) ? langs[lang] : langs[lang].lang)) .appendTo($ul) .click(function () { store.put(storekey, lang); diff --git a/src/_h5ai/l10n/bg.json b/src/_h5ai/l10n/bg.json new file mode 100644 index 00000000..58cf98ae --- /dev/null +++ b/src/_h5ai/l10n/bg.json @@ -0,0 +1,12 @@ +{ + "lang": "български", + "details": "детайли", + "icons": "икони", + "name": "Име", + "lastModified": "Последна промяна", + "size": "Размер", + "parentDirectory": "Предходна директория", + "empty": "празно", + "folders": "папки", + "files": "файлове" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/cs.json b/src/_h5ai/l10n/cs.json new file mode 100644 index 00000000..6162436c --- /dev/null +++ b/src/_h5ai/l10n/cs.json @@ -0,0 +1,16 @@ +{ + "lang": "čeština", + "details": "podrobnosti", + "icons": "ikony", + "name": "Název", + "lastModified": "Upraveno", + "size": "Velikost", + "parentDirectory": "Nadřazený adresář", + "empty": "prázdný", + "folders": "složek", + "files": "souborů", + "download": "stáhnout", + "noMatch": "žádná shoda", + "dateFormat": "DD.MM.YYYY HH:mm", + "filter": "filtr" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/de.json b/src/_h5ai/l10n/de.json new file mode 100644 index 00000000..bf157c20 --- /dev/null +++ b/src/_h5ai/l10n/de.json @@ -0,0 +1,17 @@ +{ + "lang": "deutsch", + "details": "Details", + "icons": "Icons", + "name": "Name", + "lastModified": "Geändert", + "size": "Größe", + "parentDirectory": "Übergeordnetes Verzeichnis", + "empty": "leer", + "folders": "Ordner", + "files": "Dateien", + "download": "Download", + "noMatch": "keine Treffer", + "dateFormat": "DD.MM.YYYY HH:mm", + "filter": "Filter", + "delete": "Löschen" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/el.json b/src/_h5ai/l10n/el.json new file mode 100644 index 00000000..ac98d91a --- /dev/null +++ b/src/_h5ai/l10n/el.json @@ -0,0 +1,16 @@ +{ + "lang": "ελληνικά", + "details": "λεπτομέρειες", + "icons": "εικονίδια", + "name": "Όνομα", + "lastModified": "Τελευταία τροποποίηση", + "size": "Μέγεθος", + "parentDirectory": "Προηγούμενος Κατάλογος", + "empty": "κενό", + "folders": "φάκελοι", + "files": "αρχεία", + "download": "μεταμόρφωση", + "noMatch": "κανένα αποτέλεσμα", + "dateFormat": "DD/MM/YYYY HH:mm", + "filter": "φίλτρο" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/en.json b/src/_h5ai/l10n/en.json new file mode 100644 index 00000000..8272f498 --- /dev/null +++ b/src/_h5ai/l10n/en.json @@ -0,0 +1,18 @@ +/* only here as a reference, these values are the hardcoded defaults */ +{ + "lang": "english", + "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", /* syntax as specified on http://momentjs.com */ + "filter": "filter", + "delete": "delete" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/es.json b/src/_h5ai/l10n/es.json new file mode 100644 index 00000000..69aba445 --- /dev/null +++ b/src/_h5ai/l10n/es.json @@ -0,0 +1,13 @@ +{ + "lang": "español", + "details": "Detalles", + "icons": "Íconos", + "name": "Nombre", + "lastModified": "Última modificación", + "size": "Tamaño", + "parentDirectory": "Directorio superior", + "empty": "vacío", + "folders": "Directorios", + "files": "Archivos", + "download": "Descargar" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/fr.json b/src/_h5ai/l10n/fr.json new file mode 100644 index 00000000..0e8f2e2a --- /dev/null +++ b/src/_h5ai/l10n/fr.json @@ -0,0 +1,15 @@ +{ + "lang": "français", + "details": "détails", + "icons": "icônes", + "name": "Nom", + "lastModified": "Dernière modification", + "size": "Taille", + "parentDirectory": "Dossier parent", + "empty": "vide", + "folders": "Répertoires", + "files": "Fichiers", + "download": "télécharger", + "noMatch": "rien trouvé", + "dateFormat": "DD/MM/YYYY HH:mm" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/hu.json b/src/_h5ai/l10n/hu.json new file mode 100644 index 00000000..926b60f4 --- /dev/null +++ b/src/_h5ai/l10n/hu.json @@ -0,0 +1,15 @@ +{ + "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" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/it.json b/src/_h5ai/l10n/it.json new file mode 100644 index 00000000..4e733887 --- /dev/null +++ b/src/_h5ai/l10n/it.json @@ -0,0 +1,12 @@ +{ + "lang": "italiano", + "details": "dettagli", + "icons": "icone", + "name": "Nome", + "lastModified": "Ultima modifica", + "size": "Dimensione", + "parentDirectory": "Cartella Superiore", + "empty": "vuota", + "folders": "cartelle", + "files": "file" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/ja.json b/src/_h5ai/l10n/ja.json new file mode 100644 index 00000000..a3900f30 --- /dev/null +++ b/src/_h5ai/l10n/ja.json @@ -0,0 +1,14 @@ +{ + "lang": "日本語", + "details": "詳細", + "icons": "アイコン", + "name": "名前", + "lastModified": "変更日", + "size": "サイズ", + "parentDirectory": "親フォルダ", + "empty": "項目なし", + "folders": "フォルダ", + "files": "ファイル", + "download": "ダウンロード", + "noMatch": "一致なし" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/lv.json b/src/_h5ai/l10n/lv.json new file mode 100644 index 00000000..909e5427 --- /dev/null +++ b/src/_h5ai/l10n/lv.json @@ -0,0 +1,15 @@ +{ + "lang": "latviešu", + "details": "detaļas", + "icons": "ikonas", + "name": "Nosaukums", + "lastModified": "Pēdējoreiz modificēts", + "size": "Izmērs", + "parentDirectory": "Vecākdirektorijs", + "empty": "tukšs", + "folders": "mapes", + "files": "faili", + "download": "lejupielādēt", + "noMatch": "nav sakritības", + "dateFormat": "YYYY-MM-DD HH:mm" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/nb.json b/src/_h5ai/l10n/nb.json new file mode 100644 index 00000000..3e7f6c9b --- /dev/null +++ b/src/_h5ai/l10n/nb.json @@ -0,0 +1,14 @@ +{ + "lang": "norwegian", + "details": "detaljer", + "icons": "ikoner", + "name": "Navn", + "lastModified": "Sist endret", + "size": "Størrelse", + "parentDirectory": "Overordnet mappe", + "empty": "tom", + "folders": "mapper", + "files": "filer", + "download": "last ned", + "noMatch": "ingen treff" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/nl.json b/src/_h5ai/l10n/nl.json new file mode 100644 index 00000000..d9acc7e1 --- /dev/null +++ b/src/_h5ai/l10n/nl.json @@ -0,0 +1,10 @@ +{ + "lang": "nederlands", + "details": "details", + "icons": "iconen", + "name": "Naam", + "lastModified": "Laatste wijziging", + "size": "Grootte", + "parentDirectory": "Bovenliggende map", + "empty": "lege" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/pl.json b/src/_h5ai/l10n/pl.json new file mode 100644 index 00000000..963add81 --- /dev/null +++ b/src/_h5ai/l10n/pl.json @@ -0,0 +1,12 @@ +{ + "lang": "polski", + "details": "szczegóły", + "icons": "ikony", + "name": "Nazwa", + "lastModified": "Ostatnia modyfikacja", + "size": "Rozmiar", + "parentDirectory": "Katalog nadrzędny", + "empty": "pusty", + "folders": "foldery", + "files": "pliki" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/pt.json b/src/_h5ai/l10n/pt.json new file mode 100644 index 00000000..5e238ce0 --- /dev/null +++ b/src/_h5ai/l10n/pt.json @@ -0,0 +1,12 @@ +{ + "lang": "português", + "details": "detalhes", + "icons": "ícones", + "name": "Nome", + "lastModified": "Última modificação", + "size": "Tamanho", + "parentDirectory": "Diretório superior", + "empty": "vazio", + "folders": "pastas", + "files": "arquivos" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/ro.json b/src/_h5ai/l10n/ro.json new file mode 100644 index 00000000..87c3f2da --- /dev/null +++ b/src/_h5ai/l10n/ro.json @@ -0,0 +1,14 @@ +{ + "lang": "română", + "details": "detalii", + "icons": "pictograme", + "name": "nume", + "lastModified": "ultima modificare", + "size": "mărime", + "parentDirectory": "dosar părinte", + "empty": "gol", + "folders": "dosar", + "files": "fişiere", + "download": "descarcă", + "noMatch": "0 rezultate" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/ru.json b/src/_h5ai/l10n/ru.json new file mode 100644 index 00000000..e9486958 --- /dev/null +++ b/src/_h5ai/l10n/ru.json @@ -0,0 +1,12 @@ +{ + "lang": "русский", + "details": "детали", + "icons": "иконки", + "name": "Имя", + "lastModified": "Последние изменения", + "size": "Размер", + "parentDirectory": "Главная директория", + "empty": "пусто", + "folders": "папки", + "files": "файлы" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/sk.json b/src/_h5ai/l10n/sk.json new file mode 100644 index 00000000..58569d5e --- /dev/null +++ b/src/_h5ai/l10n/sk.json @@ -0,0 +1,12 @@ +{ + "lang": "slovenčina", + "details": "podrobnosti", + "icons": "ikony", + "name": "Názov", + "lastModified": "Upravené", + "size": "Velkosť", + "parentDirectory": "Nadriadený priečinok", + "empty": "prázdny", + "folders": "priečinkov", + "files": "súborov" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/sr.json b/src/_h5ai/l10n/sr.json new file mode 100644 index 00000000..899ab20f --- /dev/null +++ b/src/_h5ai/l10n/sr.json @@ -0,0 +1,14 @@ +{ + "lang": "srpski", + "details": "detalji", + "icons": "ikone", + "name": "Ime", + "lastModified": "Poslednja modifikacija", + "size": "Veličina", + "parentDirectory": "Roditeljski direktorijum", + "empty": "prazno", + "folders": "direktorijum", + "files": "fajlovi", + "download": "download", + "noMatch": "bez poklapanja" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/sv.json b/src/_h5ai/l10n/sv.json new file mode 100644 index 00000000..a39589bf --- /dev/null +++ b/src/_h5ai/l10n/sv.json @@ -0,0 +1,10 @@ +{ + "lang": "svenska", + "details": "detaljerad", + "icons": "ikoner", + "name": "Filnamn", + "lastModified": "Senast ändrad", + "size": "Filstorlek", + "parentDirectory": "Till överordnad mapp", + "empty": "tom" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/tr.json b/src/_h5ai/l10n/tr.json new file mode 100644 index 00000000..7595d8b7 --- /dev/null +++ b/src/_h5ai/l10n/tr.json @@ -0,0 +1,13 @@ +{ + "lang": "türkçe", + "details": "detaylar", + "icons": "ikonlar", + "name": "İsim", + "lastModified": "Son Düzenleme", + "size": "Boyut", + "parentDirectory": "Üst Dizin", + "empty": "boş", + "folders": "klasörler", + "files": "dosyalar", + "download": "indir" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/zh-cn.json b/src/_h5ai/l10n/zh-cn.json new file mode 100644 index 00000000..1f8e0c23 --- /dev/null +++ b/src/_h5ai/l10n/zh-cn.json @@ -0,0 +1,13 @@ +{ + "lang": "简体中文", + "details": "详情", + "icons": "图标", + "name": "文件名", + "lastModified": "上次修改", + "size": "大小", + "parentDirectory": "上层文件夹", + "empty": "空文件夹", + "folders": "文件夹", + "files": "文件", + "download": "下载" +} \ No newline at end of file diff --git a/src/_h5ai/l10n/zh-tw.json b/src/_h5ai/l10n/zh-tw.json new file mode 100644 index 00000000..2ff1ab01 --- /dev/null +++ b/src/_h5ai/l10n/zh-tw.json @@ -0,0 +1,13 @@ +{ + "lang": "正體中文", + "details": "詳細資料", + "icons": "圖示", + "name": "檔名", + "lastModified": "上次修改", + "size": "大小", + "parentDirectory": "上層目錄", + "empty": "空資料夾", + "folders": "資料夾", + "files": "檔案", + "download": "下載" +} \ No newline at end of file From 1be5e121b3496c1e1b41a70111a8be96b5151b7a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 14:56:05 +0200 Subject: [PATCH 027/143] Cleans code. --- src/_h5ai/js/inc/core/langs.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/_h5ai/js/inc/core/langs.js b/src/_h5ai/js/inc/core/langs.js index 30b802cc..9a7f1555 100644 --- a/src/_h5ai/js/inc/core/langs.js +++ b/src/_h5ai/js/inc/core/langs.js @@ -1,12 +1,5 @@ modulejs.define('core/langs', ['config', '_'], function (config, _) { - var langs = {}; - - _.each(_.extend({}, config.langs), function (trans, lang) { - - langs[lang] = trans; - }); - - return langs; + return _.extend({}, config.langs); }); From 35d85b4e99959fba6680e2bc3d9b8df0c5a08972 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 15:18:50 +0200 Subject: [PATCH 028/143] Renames autoupdate to autorefresh. --- src/_h5ai/config.js | 2 +- src/_h5ai/js/inc/ext/{autoupdate.js => autorefresh.js} | 4 ++-- src/_h5ai/js/inc/main.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/_h5ai/js/inc/ext/{autoupdate.js => autorefresh.js} (66%) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 2fc253f2..17e3117b 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -55,7 +55,7 @@ var H5AI_CONFIG = { Interval will be a least 1000 milliseconds. */ - "autoupdate": { + "autorefresh": { "enabled": true, "interval": 5000 }, diff --git a/src/_h5ai/js/inc/ext/autoupdate.js b/src/_h5ai/js/inc/ext/autorefresh.js similarity index 66% rename from src/_h5ai/js/inc/ext/autoupdate.js rename to src/_h5ai/js/inc/ext/autorefresh.js index 9f099ba1..ca9a4dee 100644 --- a/src/_h5ai/js/inc/ext/autoupdate.js +++ b/src/_h5ai/js/inc/ext/autorefresh.js @@ -1,12 +1,12 @@ -modulejs.define('ext/autoupdate', ['_', '$', 'core/settings', 'core/event', 'core/refresh'], function (_, $, allsettings, event, refresh) { +modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'core/refresh'], function (_, $, allsettings, event, refresh) { var defaults = { enabled: false, interval: 5000 }, - settings = _.extend({}, defaults, allsettings.autoupdate), + settings = _.extend({}, defaults, allsettings.autorefresh), heartbeat = function () { diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js index 3ace56cb..33e6abdf 100644 --- a/src/_h5ai/js/inc/main.js +++ b/src/_h5ai/js/inc/main.js @@ -24,7 +24,7 @@ // @include "view/spacing.js" // @include "view/viewmode.js" - // @include "ext/autoupdate.js" + // @include "ext/autorefresh.js" // @include "ext/crumb.js" // @include "ext/custom.js" // @include "ext/delete.js" From 9a447a83bd456acd0734483c12a433a74fd7fb3a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 15:43:33 +0200 Subject: [PATCH 029/143] Adds renaming. --- src/_h5ai/config.js | 7 +++++++ src/_h5ai/php/api.php | 29 ++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 17e3117b..9020bb90 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -247,6 +247,13 @@ var H5AI_CONFIG = { "size": 150 }, + /* + Allow to rename files. + */ + "rename": { + "enabled": false + }, + /* Make entries selectable. At the moment only needed for packaged download and delete. */ diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index 3e8aef5b..2b8659c4 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -193,13 +193,40 @@ else if ($action === "delete") { } if ($errors->size) { - json_fail(1, "deletion failed for some"); + json_fail(2, "deletion failed for some"); } else { json_exit(); } } +else if ($action === "rename") { + + json_fail(1, "renaming disabled", !$options["rename"]["enabled"]); + + list($href, $name) = check_keys(array("href", "name")); + + $d = H5ai::normalize_path(dirname($href), true); + $n = basename($href); + + $code = $h5ai->getHttpCode($d); + if ($code == 401) { + } + + if ($code == "h5ai" && !$h5ai->is_ignored($n)) { + + $absPath = $h5ai->getAbsPath($href); + $folder = H5ai::normalize_path(dirname($absPath)); + + if (!rename($absPath, $folder . "/" . $name)) { + json_fail(2, "renaming failed"); + } + } + + json_exit(); +} + + else { json_fail(100, "unsupported action"); } From 67e5779402854fb07bd86c4f55f380b143c8cb5d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 16:37:28 +0200 Subject: [PATCH 030/143] Ignore pattern might be absolute now. --- src/_h5ai/php/inc/H5ai.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/php/inc/H5ai.php b/src/_h5ai/php/inc/H5ai.php index 470c779b..64cd827e 100644 --- a/src/_h5ai/php/inc/H5ai.php +++ b/src/_h5ai/php/inc/H5ai.php @@ -160,7 +160,7 @@ class H5ai { if (is_dir($path)) { if ($dir = opendir($path)) { while (($file = readdir($dir)) !== false) { - if (!$this->is_ignored($file)) { + if (!$this->is_ignored($file) && !$this->is_ignored($this->getAbsHref($path) . $file)) { $content[] = $file; } } From 08f2f6e16522b083abb21c37e0edde78032ced78 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 16:44:58 +0200 Subject: [PATCH 031/143] Updates readme. --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39575fcb..1bb1e4d4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,12 @@ Run `makejs -t` to list all possible targets. ### v0.22 - *2012-??-??* -* +* adds auto-refresh (PHP) +* adds drag'n'drop upload (PHP) +* adds file deletion (PHP) +* PHP ignore patterns might include paths now +* localization now in separate files +* updates jQuery to 1.8.0 ### v0.21 - *2012-08-06* From 7b216484de6c9a9fb602ab44ed7da3c5b080c494 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 17:01:11 +0200 Subject: [PATCH 032/143] Adds DirectoryIndex to htaccess. --- src/_h5ai/.htaccess | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_h5ai/.htaccess b/src/_h5ai/.htaccess index 6751cfa3..d1f82f7a 100644 --- a/src/_h5ai/.htaccess +++ b/src/_h5ai/.htaccess @@ -1,6 +1,8 @@ Options -Indexes +DirectoryIndex index.html + Header set Cache-Control "public" ExpiresActive on From bdcab107ebb265547cd7342cc1e35c5e94c5bb93 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 17:27:54 +0200 Subject: [PATCH 033/143] Minor changes. --- makefile.js | 2 +- src/_h5ai/css/inc/dropbox.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.js b/makefile.js index ab744904..56ff53a9 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-5', +var version = '0.22-dev-8', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/css/inc/dropbox.less b/src/_h5ai/css/inc/dropbox.less index 48e1cc29..ed8dfefa 100644 --- a/src/_h5ai/css/inc/dropbox.less +++ b/src/_h5ai/css/inc/dropbox.less @@ -8,7 +8,7 @@ border-color: #ddd; } &.match { - border-color: #aaa; + border-color: #999; } } From a99c28f234c4c7e5389f44442dfa3784e5f456f7 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 22:19:40 +0200 Subject: [PATCH 034/143] Moves index.html to jade. Minor changes. --- makefile.js | 18 +++++-- src/_h5ai/apache/h5ai-header.html | 4 +- src/_h5ai/config.js | 2 +- src/_h5ai/config.php | 2 +- src/_h5ai/css/inc/h5ai-info.less | 2 +- src/_h5ai/index.html | 67 ------------------------- src/_h5ai/index.jade | 81 +++++++++++++++++++++++++++++++ src/_h5ai/php/h5ai-index.php | 4 +- 8 files changed, 101 insertions(+), 79 deletions(-) delete mode 100644 src/_h5ai/index.html create mode 100644 src/_h5ai/index.jade diff --git a/makefile.js b/makefile.js index 56ff53a9..cdf8db55 100644 --- a/makefile.js +++ b/makefile.js @@ -36,7 +36,7 @@ var version = '0.22-dev-8', mapper = function (blob) { - return blob.source.replace(src, build).replace(/\.less$/, '.css'); + return blob.source.replace(src, build).replace(/\.less$/, '.css').replace(/\.jade$/, '.html'); }, mapperRoot = function (blob) { @@ -118,7 +118,13 @@ module.exports = function (make) { .cssmin() .write($.OVERWRITE, mapper); - $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') + $(src + ': **/*.jade') + .modified(mapper) + .handlebars(replacements) + .jade() + .write($.OVERWRITE, mapper); + + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') .modified(mapper) .handlebars(replacements) .write($.OVERWRITE, mapper); @@ -144,7 +150,13 @@ module.exports = function (make) { // .cssmin() .write($.OVERWRITE, mapper); - $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**') + $(src + ': **/*.jade') + .modified(mapper) + .handlebars(replacements) + .jade() + .write($.OVERWRITE, mapper); + + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') .modified(mapper) .handlebars(replacements) .write($.OVERWRITE, mapper); diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index 6d37b825..10dc236c 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -1,7 +1,5 @@ - - - + diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 9020bb90..ad119a29 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -282,7 +282,7 @@ var H5AI_CONFIG = { /* Requires PHP on the server. Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be - writable for the Apache Server. + writable for the web Server. - img thumbnails depend on PHP-GD - mov thumbnails depend on ffmpeg - doc thumbnails depend on convert diff --git a/src/_h5ai/config.php b/src/_h5ai/config.php index 9670f96c..8292961d 100644 --- a/src/_h5ai/config.php +++ b/src/_h5ai/config.php @@ -12,7 +12,7 @@ $H5AI_CONFIG = array( /* * This configuration assumes that h5ai is installed - * in the webroot directory of the Apache server. + * in the webroot directory of the web server. */ "ROOT_ABS_PATH" => dirname(dirname(__FILE__)), diff --git a/src/_h5ai/css/inc/h5ai-info.less b/src/_h5ai/css/inc/h5ai-info.less index c1ad76ed..c8bac7cd 100644 --- a/src/_h5ai/css/inc/h5ai-info.less +++ b/src/_h5ai/css/inc/h5ai-info.less @@ -66,7 +66,7 @@ body#h5ai-info { margin: 4px 0 12px 12px; font-size: 0.7em; color: #aaa; - width: 300px; + width: 310px; line-height: 1.2em; } } diff --git a/src/_h5ai/index.html b/src/_h5ai/index.html deleted file mode 100644 index e39f567e..00000000 --- a/src/_h5ai/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - h5ai {{version}} server details - - - - - - - - - -

                  h5ai

                  - version {{version}} - {{stamp}} -

                  server supports

                  -
                    -
                  • php version? -
                    PHP version >= 5.2.1
                    -
                  • -
                  • cache? -
                    _h5ai/cache writable for the server
                    -
                  • -
                  • image thumbs? -
                    PHP GD extension with JPEG support available
                    -
                  • -
                  • movie thumbs? -
                    ffmpeg executable in a shell
                    -
                  • -
                  • pdf thumbs? -
                    convert executable in a shell
                    -
                  • -
                  • temp directory? -
                    temporary directory writable for the server
                    -
                  • -
                  • php tar and zip? -
                    PHP Phar extension available
                    -
                  • -
                  • shell tar? -
                    tar executable in a shell
                    -
                  • -
                  • shell zip? -
                    zip executable in a shell
                    -
                  • -
                  • folder size? -
                    du executable in a shell
                    -
                  • -
                  -
                  - - h5ai {{version}} - ⚡ JavaScript is disabled! ⚡ - ⚡ Some features disabled! Works best in modern browsers. ⚡ - - - -
                  - - - - \ No newline at end of file diff --git a/src/_h5ai/index.jade b/src/_h5ai/index.jade new file mode 100644 index 00000000..07e6a1bb --- /dev/null +++ b/src/_h5ai/index.jade @@ -0,0 +1,81 @@ +doctype 5 +//if lt IE 9 + +//[if gt IE 8]>= 5.2.1 + li.test( data-id="cache" ) + span.test-label cache + span.test-result ? + div.test-info _h5ai/cache writable for the server + li.test( data-id="thumbs" ) + span.test-label image thumbs + span.test-result ? + div.test-info PHP GD extension with JPEG support available + li.test( data-id="ffmpeg" ) + span.test-label movie thumbs + span.test-result ? + div.test-info ffmpeg executable in a shell + li.test( data-id="convert" ) + span.test-label pdf thumbs + span.test-result ? + div.test-info convert executable in a shell + li.test( data-id="temp" ) + span.test-label temp directory + span.test-result ? + div.test-info temporary directory writable for the server + li.test( data-id="archive" ) + span.test-label php tar and zip + span.test-result ? + div.test-info PHP Phar extension available + li.test( data-id="tar" ) + span.test-label shell tar + span.test-result ? + div.test-info tar executable in a shell + li.test( data-id="zip" ) + span.test-label shell zip + span.test-result ? + div.test-info zip executable in a shell + li.test( data-id="du" ) + span.test-label folder size + span.test-result ? + div.test-info du executable in a shell + + div#bottombar.clearfix + span.left + a#h5ai-reference( href="http://larsjung.de/h5ai", title="h5ai project page" ) h5ai {{version}} + span.hideOnJs.noJsMsg ⚡ JavaScript is disabled! ⚡ + span.oldBrowser + | ⚡ Some features disabled! Works best in + a( href="http://browsehappy.com" ) modern browsers + | . ⚡ + span.right + span.center + + script( src="/_h5ai/config.js" ) + script( src="/_h5ai/js/scripts.js" ) diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php index 75303370..856c0f98 100644 --- a/src/_h5ai/php/h5ai-index.php +++ b/src/_h5ai/php/h5ai-index.php @@ -1,8 +1,6 @@ - - - + From a6a95780da47783d932e79e6094fdd4a17144e99 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 12 Aug 2012 23:27:10 +0200 Subject: [PATCH 035/143] Improves build process. --- makefile.js | 2 +- src/_h5ai/js/inc/core/event.js | 2 +- src/_h5ai/js/inc/main.js | 71 ------------------------------- src/_h5ai/js/markdown.js | 2 +- src/_h5ai/js/modernizr.js | 2 +- src/_h5ai/js/scripts.js | 31 +++++++++++--- src/_h5ai/js/syntaxhighlighter.js | 29 +------------ 7 files changed, 29 insertions(+), 110 deletions(-) delete mode 100644 src/_h5ai/js/inc/main.js diff --git a/makefile.js b/makefile.js index cdf8db55..085e7dc0 100644 --- a/makefile.js +++ b/makefile.js @@ -98,7 +98,7 @@ module.exports = function (make) { make.target('lint', [], 'lint all JavaScript files with JSHint') .sync(function () { - $(src + '/_h5ai/js: **/*.js, ! *.min.js, ! inc/lib/**') + $(src + '/_h5ai/js: **/*.js, ! lib/**') .jshint(jshint); }); diff --git a/src/_h5ai/js/inc/core/event.js b/src/_h5ai/js/inc/core/event.js index c6cb387a..81ce4284 100644 --- a/src/_h5ai/js/inc/core/event.js +++ b/src/_h5ai/js/inc/core/event.js @@ -13,7 +13,7 @@ modulejs.define('core/event', ['amplify'], function (amplify) { pub = function (topic, data) { - console.log('EVENT PUB', topic, data); + // console.log('EVENT PUB', topic, data); amplify.publish(topic, data); }; diff --git a/src/_h5ai/js/inc/main.js b/src/_h5ai/js/inc/main.js deleted file mode 100644 index 33e6abdf..00000000 --- a/src/_h5ai/js/inc/main.js +++ /dev/null @@ -1,71 +0,0 @@ - -(function ($) { - 'use strict'; - - - // @include "core/ajax.js" - // @include "core/entry.js" - // @include "core/event.js" - // @include "core/format.js" - // @include "core/langs.js" - // @include "core/parser.js" - // @include "core/refresh.js" - // @include "core/resource.js" - // @include "core/settings.js" - // @include "core/store.js" - // @include "core/types.js" - - // @include "model/entry.js" - - // @include "parser/apache-autoindex.js" - // @include "parser/generic-json.js" - - // @include "view/extended.js" - // @include "view/spacing.js" - // @include "view/viewmode.js" - - // @include "ext/autorefresh.js" - // @include "ext/crumb.js" - // @include "ext/custom.js" - // @include "ext/delete.js" - // @include "ext/download.js" - // @include "ext/dropbox.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" - // @include "ext/preview-img.js" - // @include "ext/preview-txt.js" - // @include "ext/qrcode.js" - // @include "ext/select.js" - // @include "ext/sort.js" - // @include "ext/statusbar.js" - // @include "ext/thumbnails.js" - // @include "ext/title.js" - // @include "ext/tree.js" - - // @include "h5ai-info.js" - // @include "h5ai-main.js" - - - $(function () { - /*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 - // itself functions, so they have to be wrapped to not be handled as - // constructors. - modulejs.define('config', H5AI_CONFIG); - modulejs.define('amplify', amplify); - 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')); - }); - -}(jQuery)); diff --git a/src/_h5ai/js/markdown.js b/src/_h5ai/js/markdown.js index feb72b87..27be65e6 100644 --- a/src/_h5ai/js/markdown.js +++ b/src/_h5ai/js/markdown.js @@ -1,2 +1,2 @@ -// @include "lib/markdown-0.4.0.js" +// @include "lib/markdown-*.js" diff --git a/src/_h5ai/js/modernizr.js b/src/_h5ai/js/modernizr.js index bd219c57..4db8d9a1 100644 --- a/src/_h5ai/js/modernizr.js +++ b/src/_h5ai/js/modernizr.js @@ -1,2 +1,2 @@ -// @include "lib/modernizr-2.6.1.min.js" +// @include "lib/modernizr-*.js" diff --git a/src/_h5ai/js/scripts.js b/src/_h5ai/js/scripts.js index c705a392..2b3928df 100644 --- a/src/_h5ai/js/scripts.js +++ b/src/_h5ai/js/scripts.js @@ -1,12 +1,8 @@ // jQuery libs // ----------- -// @include "lib/jquery-1.8.0.min.js" -// @include "lib/jquery.filedrop-0.1.0.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" +// @include "lib/jquery-*.js" +// @include "lib/jquery.*.js" // other libs // ---------- @@ -20,4 +16,25 @@ // h5ai // ---- -// @include "inc/main.js" +(function ($) { + 'use strict'; + + // @include "inc/**/*.js" + + $(function () { + /*global H5AI_CONFIG, amplify, Base64, jQuery, Modernizr, moment, _ */ + + // `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); + 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')); + }); + +}(jQuery)); diff --git a/src/_h5ai/js/syntaxhighlighter.js b/src/_h5ai/js/syntaxhighlighter.js index 30955b80..1e2954bf 100644 --- a/src/_h5ai/js/syntaxhighlighter.js +++ b/src/_h5ai/js/syntaxhighlighter.js @@ -1,30 +1,3 @@ // @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" +// @include "lib/sh/shBrush*.js" From 7d324ce51f7a5a7f250873904a8c5e69da007603 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 00:09:33 +0200 Subject: [PATCH 036/143] Uses utf8_encode for uploaded files. --- src/_h5ai/php/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index 2b8659c4..c9d00134 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -155,7 +155,7 @@ else if ($action === "upload") { json_fail(5, "upload dir no h5ai folder or ignored", $code !== "h5ai" || $h5ai->is_ignored($upload_dir)); - $dest = $upload_dir . "/" . $userfile["name"]; + $dest = $upload_dir . "/" . utf8_encode($userfile["name"]); json_fail(6, "already exists", file_exists($dest)); json_fail(7, "can't move uploaded file", !move_uploaded_file($userfile["tmp_name"], $dest)); From 3617a7fb80f177cf73bc1944e5f5509783e31407 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 17:08:28 +0200 Subject: [PATCH 037/143] Updates readme and lv translation. --- README.md | 2 +- src/_h5ai/l10n/lv.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1bb1e4d4..6ae7b8dc 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Run `makejs -t` to list all possible targets. * adds file deletion (PHP) * PHP ignore patterns might include paths now * localization now in separate files -* updates jQuery to 1.8.0 +* updates [jQuery](http://jquery.com) to 1.8.0 ### v0.21 - *2012-08-06* diff --git a/src/_h5ai/l10n/lv.json b/src/_h5ai/l10n/lv.json index 909e5427..d396eba2 100644 --- a/src/_h5ai/l10n/lv.json +++ b/src/_h5ai/l10n/lv.json @@ -11,5 +11,6 @@ "files": "faili", "download": "lejupielādēt", "noMatch": "nav sakritības", - "dateFormat": "YYYY-MM-DD HH:mm" + "dateFormat": "YYYY-MM-DD HH:mm", + "filter": "filtrēt" } \ No newline at end of file From ee30ba509a2699246bdd1959ef88fb098a9eb43b Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 19:18:36 +0200 Subject: [PATCH 038/143] Adds @ to php checks to ignore exceptions. Updates el translation. --- src/_h5ai/l10n/el.json | 3 ++- src/_h5ai/php/api.php | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/_h5ai/l10n/el.json b/src/_h5ai/l10n/el.json index ac98d91a..f3b0dbd8 100644 --- a/src/_h5ai/l10n/el.json +++ b/src/_h5ai/l10n/el.json @@ -12,5 +12,6 @@ "download": "μεταμόρφωση", "noMatch": "κανένα αποτέλεσμα", "dateFormat": "DD/MM/YYYY HH:mm", - "filter": "φίλτρο" + "filter": "φίλτρο", + "delete": "διαγραφή" } \ No newline at end of file diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index c9d00134..752c3b67 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -105,13 +105,13 @@ else if ($action === "getchecks") { $gdinfo = gd_info(); $gd = array_key_exists("JPG Support", $gdinfo) && $gdinfo["JPG Support"] || array_key_exists("JPEG Support", $gdinfo) && $gdinfo["JPEG Support"]; } - $cache = is_writable($h5ai->getH5aiAbsPath() . "/cache"); - $temp = is_writable(sys_get_temp_dir()); - $tar = preg_match("/tar$/", `which tar`) > 0; - $zip = preg_match("/zip$/", `which zip`) > 0; - $convert = preg_match("/convert$/", `which convert`) > 0; - $ffmpeg = preg_match("/ffmpeg$/", `which ffmpeg`) > 0; - $du = preg_match("/du$/", `which du`) > 0; + $cache = @is_writable($h5ai->getH5aiAbsPath() . "/cache"); + $temp = @is_writable(sys_get_temp_dir()); + $tar = @preg_match("/tar$/", `which tar`) > 0; + $zip = @preg_match("/zip$/", `which zip`) > 0; + $convert = @preg_match("/convert$/", `which convert`) > 0; + $ffmpeg = @preg_match("/ffmpeg$/", `which ffmpeg`) > 0; + $du = @preg_match("/du$/", `which du`) > 0; json_exit(array( "php" => $php, From 1217d2d699dbe5c4d6c12bf916c8b3874fef8bf3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 21:08:42 +0200 Subject: [PATCH 039/143] Changes temp dir to cache dir. Adds auto deletion of temp packages. --- src/_h5ai/php/api.php | 12 ++++++++---- src/_h5ai/php/inc/Archive.php | 2 +- src/_h5ai/php/inc/H5ai.php | 13 +++++++++++++ src/_h5ai/php/inc/Thumb.php | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/_h5ai/php/api.php b/src/_h5ai/php/api.php index 752c3b67..1614abc3 100644 --- a/src/_h5ai/php/api.php +++ b/src/_h5ai/php/api.php @@ -31,6 +31,9 @@ function check_keys($keys) { return $values; } +function delete_tempfile($file) { + @unlink($file); +} list($action) = check_keys(array("action")); @@ -83,15 +86,16 @@ else if ($action === "getarchive") { json_fail(1, "downloads disabled", !$options["download"]["enabled"]); list($id, $as) = check_keys(array("id", "as")); - json_fail(2, "file not found", !preg_match("/^h5ai-selection-/", $id)); + json_fail(2, "file not found", !preg_match("/^package-/", $id)); - $target = H5ai::normalize_path(sys_get_temp_dir(), true) . $id; + $target = $h5ai->getTempAbsPath() . "/" . $id; json_fail(3, "file not found", !file_exists($target)); header("Content-Type: application/octet-stream"); header("Content-Length: " . filesize($target)); header("Content-Disposition: attachment; filename=\"$as\""); header("Connection: close"); + register_shutdown_function("delete_tempfile", $target); readfile($target); } @@ -105,8 +109,8 @@ else if ($action === "getchecks") { $gdinfo = gd_info(); $gd = array_key_exists("JPG Support", $gdinfo) && $gdinfo["JPG Support"] || array_key_exists("JPEG Support", $gdinfo) && $gdinfo["JPEG Support"]; } - $cache = @is_writable($h5ai->getH5aiAbsPath() . "/cache"); - $temp = @is_writable(sys_get_temp_dir()); + $cache = @is_writable($h5ai->getCacheAbsPath()); + $temp = @is_writable($h5ai->getTempAbsPath()); $tar = @preg_match("/tar$/", `which tar`) > 0; $zip = @preg_match("/zip$/", `which zip`) > 0; $convert = @preg_match("/convert$/", `which convert`) > 0; diff --git a/src/_h5ai/php/inc/Archive.php b/src/_h5ai/php/inc/Archive.php index 159e00a4..cc3fa634 100644 --- a/src/_h5ai/php/inc/Archive.php +++ b/src/_h5ai/php/inc/Archive.php @@ -29,7 +29,7 @@ class Archive { return 404; } - $target = H5ai::normalize_path(sys_get_temp_dir(), true) . "h5ai-selection-" . microtime(true) . rand() . "." . $format; + $target = $this->h5ai->getTempAbsPath() . "/package-" . sha1(microtime(true) . rand()) . "." . $format; try { if ($execution === "shell") { diff --git a/src/_h5ai/php/inc/H5ai.php b/src/_h5ai/php/inc/H5ai.php index 64cd827e..4cb2b8c2 100644 --- a/src/_h5ai/php/inc/H5ai.php +++ b/src/_h5ai/php/inc/H5ai.php @@ -86,6 +86,19 @@ class H5ai { } + public function getCacheAbsPath() { + + return $this->h5aiAbsPath . '/cache'; + } + + + public function getTempAbsPath() { + + // return H5ai::normalize_path(sys_get_temp_dir()); + return $this->h5aiAbsPath . '/cache'; + } + + public function getRootAbsHref() { return $this->rootAbsHref; diff --git a/src/_h5ai/php/inc/Thumb.php b/src/_h5ai/php/inc/Thumb.php index 667d206f..173df884 100644 --- a/src/_h5ai/php/inc/Thumb.php +++ b/src/_h5ai/php/inc/Thumb.php @@ -72,7 +72,7 @@ class Thumb { return null; } - $captureAbsPath = $this->h5ai->getH5aiAbsPath() . "/cache/capture-" . sha1($sourceAbsPath) . ".jpg"; + $captureAbsPath = $this->h5ai->getCacheAbsPath() . "/capture-" . sha1($sourceAbsPath) . ".jpg"; if (!file_exists($captureAbsPath) || filemtime($sourceAbsPath) >= filemtime($captureAbsPath)) { $cmd = str_replace("[SOURCE]", $sourceAbsPath, $cmd); From 09abaa9a3c7c70dd1fc85f180e9a86cb7b7d5826 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 21:11:32 +0200 Subject: [PATCH 040/143] Updates lv translation. --- src/_h5ai/l10n/lv.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_h5ai/l10n/lv.json b/src/_h5ai/l10n/lv.json index d396eba2..76e96f1f 100644 --- a/src/_h5ai/l10n/lv.json +++ b/src/_h5ai/l10n/lv.json @@ -12,5 +12,6 @@ "download": "lejupielādēt", "noMatch": "nav sakritības", "dateFormat": "YYYY-MM-DD HH:mm", - "filter": "filtrēt" + "filter": "filtrēt", + "delete": "izdzēst" } \ No newline at end of file From 1458623998d0d2549ea2d7f687f13c8e46d41eea Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 21:34:06 +0200 Subject: [PATCH 041/143] Updates Thumb to use defined paths. --- src/_h5ai/php/inc/H5ai.php | 32 +++++++++++++++++++------------- src/_h5ai/php/inc/Thumb.php | 8 ++++---- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/_h5ai/php/inc/H5ai.php b/src/_h5ai/php/inc/H5ai.php index 4cb2b8c2..b0029ebd 100644 --- a/src/_h5ai/php/inc/H5ai.php +++ b/src/_h5ai/php/inc/H5ai.php @@ -86,19 +86,6 @@ class H5ai { } - public function getCacheAbsPath() { - - return $this->h5aiAbsPath . '/cache'; - } - - - public function getTempAbsPath() { - - // return H5ai::normalize_path(sys_get_temp_dir()); - return $this->h5aiAbsPath . '/cache'; - } - - public function getRootAbsHref() { return $this->rootAbsHref; @@ -111,6 +98,25 @@ class H5ai { } + public function getCacheAbsPath() { + + return $this->h5aiAbsPath . '/cache'; + } + + + public function getCacheAbsHref() { + + return $this->h5aiAbsHref . 'cache/'; + } + + + public function getTempAbsPath() { + + // return H5ai::normalize_path(sys_get_temp_dir()); + return $this->h5aiAbsPath . '/cache'; + } + + public function getOptions() { return $this->options; diff --git a/src/_h5ai/php/inc/Thumb.php b/src/_h5ai/php/inc/Thumb.php index 173df884..cbaf01e4 100644 --- a/src/_h5ai/php/inc/Thumb.php +++ b/src/_h5ai/php/inc/Thumb.php @@ -47,10 +47,10 @@ class Thumb { return null; } - $name = "cache/thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg"; - // $name = "cache/thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".png"; - $thumbAbsHref = $this->h5ai->getH5aiAbsHref() . $name; - $thumbAbsPath = $this->h5ai->getH5aiAbsPath() . "/" . $name; + $name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg"; + // $name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".png"; + $thumbAbsPath = $this->h5ai->getCacheAbsPath() . "/" . $name; + $thumbAbsHref = $this->h5ai->getCacheAbsHref() . $name; if (!file_exists($thumbAbsPath) || filemtime($sourceAbsPath) >= filemtime($thumbAbsPath)) { $image = new Image(); From bf2cf3c0483780e9a38cfd11fc5b88b89dbcda8a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 21:39:27 +0200 Subject: [PATCH 042/143] Removes old code. --- src/_h5ai/php/inc/Thumb.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/_h5ai/php/inc/Thumb.php b/src/_h5ai/php/inc/Thumb.php index cbaf01e4..8f1ba24f 100644 --- a/src/_h5ai/php/inc/Thumb.php +++ b/src/_h5ai/php/inc/Thumb.php @@ -48,7 +48,6 @@ class Thumb { } $name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg"; - // $name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".png"; $thumbAbsPath = $this->h5ai->getCacheAbsPath() . "/" . $name; $thumbAbsHref = $this->h5ai->getCacheAbsHref() . $name; @@ -57,9 +56,6 @@ class Thumb { $image->setSource($sourceAbsPath); $image->thumb($mode, $width, $height); $image->saveDestJpeg($thumbAbsPath, 80); - - // $image->saveDestPng($thumbAbsPath, 9); - // Magic::thumb($mode, $sourceAbsPath, $thumbAbsPath, $width, $height); } return file_exists($thumbAbsPath) ? $thumbAbsHref : null; From 10c651c0a55f25a92a46ee8a48a2ae9956077268 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 13 Aug 2012 21:42:36 +0200 Subject: [PATCH 043/143] Updates readme. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6ae7b8dc..609ca786 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,9 @@ Run `makejs -t` to list all possible targets. * adds drag'n'drop upload (PHP) * adds file deletion (PHP) * PHP ignore patterns might include paths now +* temp download packages are now stored in the `_h5ai/cache` and deleted as soon as possible * localization now in separate files +* updates translations * updates [jQuery](http://jquery.com) to 1.8.0 From e53d72e9778e28c956ab51030050b008ee8df254 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 15 Aug 2012 12:20:42 +0200 Subject: [PATCH 044/143] More jade. --- makefile.js | 2 +- src/_h5ai/{index.jade => index.html.jade} | 0 src/_h5ai/php/h5ai-index.php | 72 --------------------- src/_h5ai/php/h5ai-index.php.jade | 77 +++++++++++++++++++++++ 4 files changed, 78 insertions(+), 73 deletions(-) rename src/_h5ai/{index.jade => index.html.jade} (100%) delete mode 100644 src/_h5ai/php/h5ai-index.php create mode 100644 src/_h5ai/php/h5ai-index.php.jade diff --git a/makefile.js b/makefile.js index 085e7dc0..cc86ac42 100644 --- a/makefile.js +++ b/makefile.js @@ -36,7 +36,7 @@ var version = '0.22-dev-8', mapper = function (blob) { - return blob.source.replace(src, build).replace(/\.less$/, '.css').replace(/\.jade$/, '.html'); + return blob.source.replace(src, build).replace(/\.less$/, '.css').replace(/\.jade$/, ''); }, mapperRoot = function (blob) { diff --git a/src/_h5ai/index.jade b/src/_h5ai/index.html.jade similarity index 100% rename from src/_h5ai/index.jade rename to src/_h5ai/index.html.jade diff --git a/src/_h5ai/php/h5ai-index.php b/src/_h5ai/php/h5ai-index.php deleted file mode 100644 index 856c0f98..00000000 --- a/src/_h5ai/php/h5ai-index.php +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - Directory index · styled with h5ai - - - - - - - - - -
                  - -
                  -
                  -
                  -
                  -
                  - - h5ai {{version}} - ⚡ JavaScript is disabled! ⚡ - ⚡ Some features disabled! Works best in modern browsers. ⚡ - - - -
                  - -
                  - getNoJsFallback(); - } ?> -
                  - - - - \ No newline at end of file diff --git a/src/_h5ai/php/h5ai-index.php.jade b/src/_h5ai/php/h5ai-index.php.jade new file mode 100644 index 00000000..3bf0a641 --- /dev/null +++ b/src/_h5ai/php/h5ai-index.php.jade @@ -0,0 +1,77 @@ +| +doctype 5 +//if lt IE 9 + +//[if gt IE 8]>getGenericJson(); + |}?> + + div#data-php-no-js-fallback.hideOnJs + |getNoJsFallback(); + |}?> + + script( src="/_h5ai/config.js" ) + script( src="/_h5ai/js/scripts.js" ) From 5a017a0d5aa9608f90bc30d5d766081b19ecf46a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 15 Aug 2012 12:32:00 +0200 Subject: [PATCH 045/143] _h5ai/index does not need to have absolute hrefs. --- src/_h5ai/index.html.jade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_h5ai/index.html.jade b/src/_h5ai/index.html.jade index 07e6a1bb..38bfa831 100644 --- a/src/_h5ai/index.html.jade +++ b/src/_h5ai/index.html.jade @@ -11,11 +11,11 @@ html.no-js( lang="en" ) title h5ai {{version}} server details meta( name="description", content="h5ai server details" ) meta( name="viewport", content="width=device-width" ) - link( rel="shortcut icon", type="image/png", href="/_h5ai/images/h5ai-16x16.png" ) - link( rel="apple-touch-icon", type="image/png", href="/_h5ai/images/h5ai-48x48.png" ) + link( rel="shortcut icon", type="image/png", href="images/h5ai-16x16.png" ) + link( rel="apple-touch-icon", type="image/png", href="images/h5ai-48x48.png" ) link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic|Ubuntu:400,700,400italic,700italic" ) - link( rel="stylesheet", href="/_h5ai/css/styles.css" ) - script( src="/_h5ai/js/modernizr.js" ) + link( rel="stylesheet", href="css/styles.css" ) + script( src="js/modernizr.js" ) body#h5ai-info @@ -77,5 +77,5 @@ html.no-js( lang="en" ) span.right span.center - script( src="/_h5ai/config.js" ) - script( src="/_h5ai/js/scripts.js" ) + script( src="config.js" ) + script( src="js/scripts.js" ) From fd89ea1d90d8c1c9ff231971cb324ab98568923f Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 15 Aug 2012 22:05:52 +0200 Subject: [PATCH 046/143] Abstracts h5ai-index.php. --- src/_h5ai/php/h5ai-index.php.jade | 84 ++++++++++++++++--------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/src/_h5ai/php/h5ai-index.php.jade b/src/_h5ai/php/h5ai-index.php.jade index 3bf0a641..0d2788b4 100644 --- a/src/_h5ai/php/h5ai-index.php.jade +++ b/src/_h5ai/php/h5ai-index.php.jade @@ -1,4 +1,38 @@ -| +|getH5aiAbsHref(); +| $isHeadRequest = stripos($_SERVER["REQUEST_METHOD"], "HEAD"); +|?> + +- var h5ai = "" +- var json = "getGenericJson(); }?>" +- var fallback = "getNoJsFallback(); }?>" + doctype 5 //if lt IE 9 @@ -12,11 +46,11 @@ html.no-js( lang="en" ) title Directory index · styled with h5ai {{version}} meta( name="description", content="Directory index styled with h5ai {{version}} (http://larsjung.de/h5ai)" ) meta( name="viewport", content="width=device-width" ) - link( rel="shortcut icon", type="image/png", href="/_h5ai/images/h5ai-16x16.png" ) - link( rel="apple-touch-icon", type="image/png", href="/_h5ai/images/h5ai-48x48.png" ) + link( rel="shortcut icon", type="image/png", href!="#{h5ai}images/h5ai-16x16.png" ) + link( rel="apple-touch-icon", type="image/png", href!="#{h5ai}images/h5ai-48x48.png" ) link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic|Ubuntu:400,700,400italic,700italic" ) - link( rel="stylesheet", href="/_h5ai/css/styles.css" ) - script( src="/_h5ai/js/modernizr.js" ) + link( rel="stylesheet", href!="#{h5ai}css/styles.css" ) + script( src!="#{h5ai}js/modernizr.js" ) body#h5ai-main @@ -37,41 +71,9 @@ html.no-js( lang="en" ) span.right span.center - div#data-generic-json.hidden - |getGenericJson(); - |}?> + div#data-generic-json.hidden !{json} - div#data-php-no-js-fallback.hideOnJs - |getNoJsFallback(); - |}?> + div#data-php-no-js-fallback.hideOnJs !{fallback} - script( src="/_h5ai/config.js" ) - script( src="/_h5ai/js/scripts.js" ) + script( src!="#{h5ai}config.js" ) + script( src!="#{h5ai}js/scripts.js" ) From f1a2a440793e34e297370c98d157f62af4010d0e Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 17 Aug 2012 16:35:25 +0200 Subject: [PATCH 047/143] Adds core/mode. Lots of changes to make installation more flexible. --- src/_h5ai/config.js | 5 +-- src/_h5ai/config.php | 8 +--- src/_h5ai/js/inc/core/mode.js | 12 ++++++ src/_h5ai/js/inc/core/parser.js | 11 +---- src/_h5ai/js/inc/core/refresh.js | 6 ++- src/_h5ai/js/inc/core/settings.js | 11 +++-- src/_h5ai/js/inc/ext/crumb.js | 5 +++ src/_h5ai/js/inc/ext/mode.js | 14 +++--- src/_h5ai/js/inc/ext/tree.js | 6 +++ src/_h5ai/js/inc/model/entry.js | 47 ++++++++++++++------- src/_h5ai/js/inc/parser/apache-autoindex.js | 14 +++--- src/_h5ai/js/inc/parser/generic-json.js | 29 +++++-------- src/_h5ai/php/inc/Entry.php | 16 ++++++- src/_h5ai/php/inc/H5ai.php | 14 +++--- 14 files changed, 116 insertions(+), 82 deletions(-) create mode 100644 src/_h5ai/js/inc/core/mode.js diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index ad119a29..48a08f31 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -10,10 +10,9 @@ var H5AI_CONFIG = { "options": { /* - The absolute links to webroot and h5ai. - Do not change this unless you know what you are doing. + The absolute link to h5ai. + Must point to the "_h5ai" directory. */ - "rootAbsHref": "/", "h5aiAbsHref": "/_h5ai/", /* diff --git a/src/_h5ai/config.php b/src/_h5ai/config.php index 8292961d..e7fcd80a 100644 --- a/src/_h5ai/config.php +++ b/src/_h5ai/config.php @@ -10,12 +10,6 @@ global $H5AI_CONFIG; $H5AI_CONFIG = array( - /* - * This configuration assumes that h5ai is installed - * in the webroot directory of the web server. - */ - "ROOT_ABS_PATH" => dirname(dirname(__FILE__)), - /* * Files/folders that should not be listed. Specified * by the complete filename or by a regular expression. @@ -26,7 +20,7 @@ $H5AI_CONFIG = array( /* * Folders that contain one of these files will be considered - * as none h5ai folders. + * not to be h5ai indexed folders. */ "INDEX_FILES" => array("index.html", "index.htm", "index.php") ); diff --git a/src/_h5ai/js/inc/core/mode.js b/src/_h5ai/js/inc/core/mode.js new file mode 100644 index 00000000..db8435ef --- /dev/null +++ b/src/_h5ai/js/inc/core/mode.js @@ -0,0 +1,12 @@ + +modulejs.define('core/mode', [], function () { + + var mode = { + // id: null, + // dataType: null, + // serverName: null, + // serverVersion: null + }; + + return mode; +}); diff --git a/src/_h5ai/js/inc/core/parser.js b/src/_h5ai/js/inc/core/parser.js index 9002ef30..6b06915e 100644 --- a/src/_h5ai/js/inc/core/parser.js +++ b/src/_h5ai/js/inc/core/parser.js @@ -9,14 +9,7 @@ modulejs.define('core/parser', ['$'], function ($) { } return { - id: 'none', - mode: null, - server: { - name: null, - version: null - }, - parse: function () { - return []; - } + dataType: 'N/A', + parse: function () { return []; } }; }); diff --git a/src/_h5ai/js/inc/core/refresh.js b/src/_h5ai/js/inc/core/refresh.js index 5e5ac7cf..a8271cee 100644 --- a/src/_h5ai/js/inc/core/refresh.js +++ b/src/_h5ai/js/inc/core/refresh.js @@ -1,5 +1,5 @@ -modulejs.define('core/refresh', ['_', 'core/ajax', 'model/entry'], function (_, ajax, Entry) { +modulejs.define('core/refresh', ['_', 'core/mode', 'core/ajax', 'model/entry'], function (_, mode, ajax, Entry) { var parseJson = function (entry, json) { @@ -20,6 +20,10 @@ modulejs.define('core/refresh', ['_', 'core/ajax', 'model/entry'], function (_, refresh = function () { + if (mode.id !== 'php') { + return; + } + var entry = Entry.get(); ajax.getEntries(entry.absHref, 1, function (json) { diff --git a/src/_h5ai/js/inc/core/settings.js b/src/_h5ai/js/inc/core/settings.js index 5111291e..257d4239 100644 --- a/src/_h5ai/js/inc/core/settings.js +++ b/src/_h5ai/js/inc/core/settings.js @@ -3,10 +3,13 @@ modulejs.define('core/settings', ['config', '_'], function (config, _) { var defaults = { rootAbsHref: '/', - h5aiAbsHref: '/_h5ai/', - server: 'unknown', - mode: 'unknown' + h5aiAbsHref: '/_h5ai/' }; - return _.extend({}, defaults, config.options); + var settings = _.extend({}, defaults, config.options); + + settings.h5aiAbsHref = settings.h5aiAbsHref.replace(/\/*$/, '/'); + settings.rootAbsHref = /^(.*\/)[^\/]+\/?$/.exec(settings.h5aiAbsHref)[1]; + + return settings; }); diff --git a/src/_h5ai/js/inc/ext/crumb.js b/src/_h5ai/js/inc/ext/crumb.js index 859154b0..43956067 100644 --- a/src/_h5ai/js/inc/ext/crumb.js +++ b/src/_h5ai/js/inc/ext/crumb.js @@ -39,6 +39,11 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/ $a.find('img').attr('src', resource.image('home')); } + if (entry.isRoot()) { + $html.addClass('root'); + $a.find('img').attr('src', resource.image('home')); + } + if (entry.isCurrentFolder()) { $html.addClass('current'); } diff --git a/src/_h5ai/js/inc/ext/mode.js b/src/_h5ai/js/inc/ext/mode.js index 6b2cd6c1..174eb2d3 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', ['_', '$', 'core/settings', 'core/parser'], function (_, $, allsettings, parser) { +modulejs.define('ext/mode', ['_', '$', 'core/mode', 'core/settings'], function (_, $, mode, allsettings) { var defaults = { enabled: false, @@ -16,14 +16,14 @@ modulejs.define('ext/mode', ['_', '$', 'core/settings', 'core/parser'], function var info = ''; - if (parser.mode) { - info += parser.mode; + if (mode.id) { + info += mode.id; } - if (settings.display > 0 && parser.server.name) { - info += (info ? ' on ' : '') + parser.server.name; + if (settings.display > 0 && mode.serverName) { + info += (info ? ' on ' : '') + mode.serverName; } - if (settings.display > 1 && parser.server.version) { - info += (info ? '-' : '') + parser.server.version; + if (settings.display > 1 && mode.serverVersion) { + info += (info ? '-' : '') + mode.serverVersion; } if (info) { diff --git a/src/_h5ai/js/inc/ext/tree.js b/src/_h5ai/js/inc/ext/tree.js index 0d01fcb0..062df7e8 100644 --- a/src/_h5ai/js/inc/ext/tree.js +++ b/src/_h5ai/js/inc/ext/tree.js @@ -61,6 +61,12 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e $img.attr('src', resource.icon('folder-home')); } + // is it the root? + if (entry.isRoot()) { + $html.addClass('root'); + $img.attr('src', resource.icon('folder-home')); + } + // is it the current folder? if (entry.isCurrentFolder()) { $html.addClass('current'); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 9df15e94..f3d799f3 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', ['_', 'core/types', 'core/ajax', 'core/event'], function (_, types, ajax, event) { +modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event', 'core/settings'], function (_, types, ajax, event, settings) { var doc = document, domain = doc.domain, @@ -59,33 +59,36 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], f reEndsWithSlash = /\/$/, + startsWith = function (sequence, part) { + + return sequence.length >= part.length && sequence.slice(0, part.length) === part; + }, + + createLabel = function (sequence) { - if (sequence.length > 1 && reEndsWithSlash.test(sequence)) { - sequence = sequence.slice(0, -1); - } + sequence = sequence.replace(reEndsWithSlash, ''); try { sequence = decodeURIComponent(sequence); } catch (e) {} return sequence; }, - reSplitPath = /^\/([^\/]+\/?)$/, - reSplitPath2 = /^(\/(?:.*\/)*?([^\/]+)\/)([^\/]+\/?)$/, + reSplitPath = /^(.*\/)([^\/]+\/?)$/, splitPath = function (sequence) { - var match; - if (sequence === '/') { return { parent: null, name: '/' }; } - match = reSplitPath2.exec(sequence); + + var match = reSplitPath.exec(sequence); if (match) { - return { parent: match[1], name: match[3] }; - } - match = reSplitPath.exec(sequence); - if (match) { - return { parent: '/', name: match[1] }; + var split = { parent: match[1], name: match[2] }; + + if (split.parent && !startsWith(split.parent, settings.rootAbsHref)) { + split.parent = null; + } + return split; } }, @@ -112,6 +115,10 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], f absHref = forceEncoding(absHref || location); + if (!startsWith(absHref, settings.rootAbsHref)) { + return null; + } + var created = !cache[absHref], changed = false; @@ -251,6 +258,16 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], f return this.absHref === '/'; }, + isRoot: function () { + + return this.absHref === settings.rootAbsHref; + }, + + isH5ai: function () { + + return this.absHref === settings.h5aiAbsHref; + }, + isEmpty: function () { return _.keys(this.content).length === 0; @@ -320,7 +337,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax', 'core/event'], f } }); - return window.ENTRY = { + return { get: getEntry, remove: removeEntry }; diff --git a/src/_h5ai/js/inc/parser/apache-autoindex.js b/src/_h5ai/js/inc/parser/apache-autoindex.js index 5123aeed..4190512c 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', ['_', '$', 'core/settings', 'core/format', 'model/entry'], function (_, $, settings, format, Entry) { +modulejs.define('parser/apache-autoindex', ['_', '$', 'core/mode', 'core/settings', 'core/format', 'model/entry'], function (_, $, mode, settings, format, Entry) { var parseTableRow = function (absHref, tr) { @@ -35,13 +35,13 @@ modulejs.define('parser/apache-autoindex', ['_', '$', 'core/settings', 'core/for return parseTable(absHref, $id.find('table')); }; + mode.id = 'aai'; + mode.dataType = 'apache-autoindex'; + mode.serverName = 'apache'; + mode.serverVersion = null; + return { - id: 'apache-autoindex', - mode: 'aai', - server: { - name: 'apache', - version: null - }, + dataType: 'apache-autoindex', parse: parse }; }); diff --git a/src/_h5ai/js/inc/parser/generic-json.js b/src/_h5ai/js/inc/parser/generic-json.js index eece589a..df7bcd5d 100644 --- a/src/_h5ai/js/inc/parser/generic-json.js +++ b/src/_h5ai/js/inc/parser/generic-json.js @@ -1,16 +1,11 @@ -modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry'], function (_, $, settings, Entry) { +modulejs.define('parser/generic-json', ['_', '$', 'core/mode', 'core/settings', 'model/entry'], function (_, $, mode, settings, Entry) { - var parser = { - id: 'generic-json', - mode: null, - server: { - name: null, - version: null - } - }, + var parseJson = function (absHref, json) { - parseJson = function (absHref, json) { + mode.id = json.id; + mode.serverName = json.serverName; + mode.serverVersion = json.serverVersion; if (_.has(json, 'customHeader')) { settings.custom.header = json.customHeader; @@ -18,13 +13,6 @@ modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry' if (_.has(json, 'customFooter')) { settings.custom.footer = json.customFooter; } - if (_.has(json, 'mode')) { - parser.mode = json.mode; - } - if (_.has(json, 'server')) { - parser.server = json.server; - } - return _.map(json.entries, function (jsonEntry) { return Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content); @@ -49,7 +37,10 @@ modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry' return parseJsonStr(absHref, $id.text()); }; - parser.parse = parse; + mode.dataType = 'generic-json'; - return parser; + return { + dataType: 'generic-json', + parse: parse + }; }); diff --git a/src/_h5ai/php/inc/Entry.php b/src/_h5ai/php/inc/Entry.php index 85101309..d9aab195 100644 --- a/src/_h5ai/php/inc/Entry.php +++ b/src/_h5ai/php/inc/Entry.php @@ -8,6 +8,12 @@ class Entry { private static $cache = array(); + private static function startsWith($sequence, $part) { + + return (substr($sequence, 0, strlen($part)) === $part); + } + + public static function get_cache() { return Entry::$cache; @@ -16,6 +22,11 @@ class Entry { public static function get($h5ai, $absPath, $absHref) { + if (!Entry::startsWith($absHref, $h5ai->getRootAbsHref())) { + error_log("ILLEGAL REQUEST: " . $absHref . ", " . $absPath . ", " . $h5ai->getRootAbsHref()); + return null; + } + if (array_key_exists($absHref, Entry::$cache)) { return Entry::$cache[$absHref]; } @@ -63,8 +74,9 @@ class Entry { } $this->parent = null; - if ($this->absHref !== "/") { - $this->parent = Entry::get($this->h5ai, H5ai::normalize_path(dirname($this->absPath)), H5ai::normalize_path(dirname($this->absHref), true)); + $parentAbsHref = H5ai::normalize_path(dirname($this->absHref), true); + if ($this->absHref !== "/" && Entry::startsWith($parentAbsHref, $h5ai->getRootAbsHref())) { + $this->parent = Entry::get($this->h5ai, H5ai::normalize_path(dirname($this->absPath)), $parentAbsHref); } $this->isContentFetched = false; diff --git a/src/_h5ai/php/inc/H5ai.php b/src/_h5ai/php/inc/H5ai.php index b0029ebd..b94defbb 100644 --- a/src/_h5ai/php/inc/H5ai.php +++ b/src/_h5ai/php/inc/H5ai.php @@ -56,9 +56,9 @@ class H5ai { $this->requested_from = H5ai::normalize_path($requested_from); $this->h5aiAbsPath = H5ai::normalize_path(H5AI_ABS_PATH); + $this->rootAbsPath = H5ai::normalize_path(dirname(H5AI_ABS_PATH)); global $H5AI_CONFIG; - $this->rootAbsPath = H5ai::normalize_path($H5AI_CONFIG["ROOT_ABS_PATH"]); $this->ignore_names = $H5AI_CONFIG["IGNORE"]; $this->ignore_patterns = $H5AI_CONFIG["IGNORE_PATTERNS"]; $this->index_files = $H5AI_CONFIG["INDEX_FILES"]; @@ -66,8 +66,8 @@ class H5ai { $this->config = H5ai::load_config($this->h5aiAbsPath . "/config.js"); $this->options = $this->config["options"]; - $this->rootAbsHref = H5ai::normalize_path($this->options["rootAbsHref"], true); $this->h5aiAbsHref = H5ai::normalize_path($this->options["h5aiAbsHref"], true); + $this->rootAbsHref = H5ai::normalize_path(dirname($this->options["h5aiAbsHref"]), true); $this->absHref = H5ai::normalize_path(preg_replace('/[^\\/]*$/', '', getenv("REQUEST_URI")), true); $this->absPath = $this->getAbsPath($this->absHref); @@ -275,14 +275,12 @@ class H5ai { $footer = $this->fileExists($footer ? $this->absPath . "/" . $footer : null) ? $footer : null; $json = array( - "entries" => $entries, + "id" => $this->requested_from === $this->h5aiAbsPath . "/php/h5ai-index.php" ? "php" : "idx.php", + "serverName" => strtolower(preg_replace("/\\/.*$/", "", getenv("SERVER_SOFTWARE"))), + "serverVersion" => strtolower(preg_replace("/^.*\\//", "", preg_replace("/\\s.*$/", "", getenv("SERVER_SOFTWARE")))), "customHeader" => $header, "customFooter" => $footer, - "mode" => $this->requested_from === $this->h5aiAbsPath . "/php/h5ai-index.php" ? "php" : "idx.php", - "server" => array( - "name" => strtolower(preg_replace("/\\/.*$/", "", getenv("SERVER_SOFTWARE"))), - "version" => strtolower(preg_replace("/^.*\\//", "", preg_replace("/\\s.*$/", "", getenv("SERVER_SOFTWARE")))) - ) + "entries" => $entries ); return json_encode($json) . "\n"; From 799f1ecd1326197736fe833e4aafa4fdbfb81f58 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 17 Aug 2012 16:51:10 +0200 Subject: [PATCH 048/143] Updates config.js comments. --- src/_h5ai/config.js | 51 +++++++++++++++---------------- src/_h5ai/js/inc/core/settings.js | 1 - 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 48a08f31..b279759d 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -47,7 +47,7 @@ var H5AI_CONFIG = { /*** Extensions (in alphabetical order) ***/ - /* + /* [php] Watch current folder content. Folders possibly visible in the tree view that are not the current folder might not be updated. @@ -59,14 +59,14 @@ var H5AI_CONFIG = { "interval": 5000 }, - /* + /* [all] Show a clickable breadcrumb. */ "crumb": { "enabled": true }, - /* + /* [all] Filenames of customized header and footer files to look for in each folder. */ @@ -76,14 +76,14 @@ var H5AI_CONFIG = { "footer": "_h5ai.footer.html" }, - /* + /* [php] Allow file deletion. */ "delete": { "enabled": true }, - /* + /* [php] File upload via drag'n'drop. Folders are not supported. The working file size seems to be very browser dependent. @@ -95,19 +95,18 @@ var H5AI_CONFIG = { "maxfilesize": 1000 }, - /* - Requires PHP on the server. + /* [php] Enable packaged download of selected entries. Execution: "php", "shell". Supported formats: "tar", "zip". */ "download": { "enabled": true, - "execution": "shell", + "execution": "php", "format": "zip" }, - /* + /* [all] Allow filtering the displayed files and folders. Will check entries for right order of characters, i.e. "ab" matches "ab", "axb", "xaxbx" but not "ba". @@ -120,8 +119,7 @@ var H5AI_CONFIG = { "enabled": true }, - /* - Requires PHP on the server. + /* [php] Calc the size of folders. Depends on du. */ @@ -129,7 +127,7 @@ var H5AI_CONFIG = { "enabled": true }, - /* + /* [all] Associative array of folders and their HTTP status codes to avoid HEAD requests to that folders. The key (folder) must start and end with a slash (/). @@ -144,7 +142,7 @@ var H5AI_CONFIG = { "folders": {} }, - /* + /* [all] Adds Google Analytics asynchronous tracking code. for example: @@ -162,7 +160,7 @@ var H5AI_CONFIG = { "gaq": [] }, - /* + /* [all] Localization, for example "en", "de" etc. - see "langs" below for possible values. Adjust it to your needs. If lang is not found in "langs" it defaults to "en". @@ -176,14 +174,14 @@ var H5AI_CONFIG = { "useBrowserLang": true }, - /* + /* [all] Link the hover effects between crumb, main view and tree. */ "link-hover-states": { "enabled": true }, - /* + /* [all] Shows the server mode in the bottom left corner. display values: 0: only show mode @@ -195,7 +193,7 @@ var H5AI_CONFIG = { "display": 2 }, - /* + /* [all] Show an image preview on click. */ "preview-img": { @@ -203,7 +201,7 @@ var H5AI_CONFIG = { "types": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"] }, - /* + /* [all] Show text file preview on click. "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will be rendered as HTML. @@ -238,7 +236,7 @@ var H5AI_CONFIG = { } }, - /* + /* [all] Show QRCodes on hovering files. */ "qrcode": { @@ -246,21 +244,21 @@ var H5AI_CONFIG = { "size": 150 }, - /* + /* [php] Allow to rename files. */ "rename": { "enabled": false }, - /* + /* [all] Make entries selectable. At the moment only needed for packaged download and delete. */ "select": { "enabled": true }, - /* + /* [all] Default sort order is a two letter code. The first letter specifies the column: "n" for "Name", "d" for "Date" or "s" for "Size". The second letter specifies the sort order: "a" for "ascending" or "d" @@ -271,15 +269,14 @@ var H5AI_CONFIG = { "order": "na" }, - /* + /* [all] Show additional info in a statusbar. */ "statusbar": { "enabled": true }, - /* - Requires PHP on the server. + /* [php] Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be writable for the web Server. - img thumbnails depend on PHP-GD @@ -294,14 +291,14 @@ var H5AI_CONFIG = { "delay": 1 }, - /* + /* [all] Replace window title with current breadcrumb. */ "title": { "enabled": true }, - /* + /* [all] Show a folder tree. Note that this tree might have side effects as it sends HEAD requests to the folders, and therefore will invoke index.php scripts. Use diff --git a/src/_h5ai/js/inc/core/settings.js b/src/_h5ai/js/inc/core/settings.js index 257d4239..1b6ef851 100644 --- a/src/_h5ai/js/inc/core/settings.js +++ b/src/_h5ai/js/inc/core/settings.js @@ -2,7 +2,6 @@ modulejs.define('core/settings', ['config', '_'], function (config, _) { var defaults = { - rootAbsHref: '/', h5aiAbsHref: '/_h5ai/' }; From 4c96efe1c78fcc4c1d94e0c1584ddea1b995cbc7 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 17 Aug 2012 22:56:24 +0200 Subject: [PATCH 049/143] Minor refactorings. --- makefile.js | 2 +- src/_h5ai/php/inc/Entry.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.js b/makefile.js index cc86ac42..b641cc2d 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-8', +var version = '0.22-dev-11', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/php/inc/Entry.php b/src/_h5ai/php/inc/Entry.php index d9aab195..eafdcfb1 100644 --- a/src/_h5ai/php/inc/Entry.php +++ b/src/_h5ai/php/inc/Entry.php @@ -8,7 +8,7 @@ class Entry { private static $cache = array(); - private static function startsWith($sequence, $part) { + private static function starts_with($sequence, $part) { return (substr($sequence, 0, strlen($part)) === $part); } @@ -22,7 +22,7 @@ class Entry { public static function get($h5ai, $absPath, $absHref) { - if (!Entry::startsWith($absHref, $h5ai->getRootAbsHref())) { + if (!Entry::starts_with($absHref, $h5ai->getRootAbsHref())) { error_log("ILLEGAL REQUEST: " . $absHref . ", " . $absPath . ", " . $h5ai->getRootAbsHref()); return null; } @@ -75,7 +75,7 @@ class Entry { $this->parent = null; $parentAbsHref = H5ai::normalize_path(dirname($this->absHref), true); - if ($this->absHref !== "/" && Entry::startsWith($parentAbsHref, $h5ai->getRootAbsHref())) { + if ($this->absHref !== "/" && Entry::starts_with($parentAbsHref, $h5ai->getRootAbsHref())) { $this->parent = Entry::get($this->h5ai, H5ai::normalize_path(dirname($this->absPath)), $parentAbsHref); } From 4b7aba378c4be09902718d1b3efb1ca415fa4d2c Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 19 Aug 2012 22:44:10 +0200 Subject: [PATCH 050/143] Changes on info index page. --- src/_h5ai/index.html.jade | 22 +++++++++++----------- src/_h5ai/js/inc/h5ai-info.js | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/_h5ai/index.html.jade b/src/_h5ai/index.html.jade index 38bfa831..a81c3cd1 100644 --- a/src/_h5ai/index.html.jade +++ b/src/_h5ai/index.html.jade @@ -30,9 +30,13 @@ html.no-js( lang="en" ) span.test-result ? div.test-info PHP version >= 5.2.1 li.test( data-id="cache" ) - span.test-label cache + span.test-label cache directory span.test-result ? - div.test-info _h5ai/cache writable for the server + div.test-info web server has write access + li.test( data-id="temp" ) + span.test-label temp directory + span.test-result ? + div.test-info web server has write access li.test( data-id="thumbs" ) span.test-label image thumbs span.test-result ? @@ -40,15 +44,11 @@ html.no-js( lang="en" ) li.test( data-id="ffmpeg" ) span.test-label movie thumbs span.test-result ? - div.test-info ffmpeg executable in a shell + div.test-info command 'ffmpeg' available li.test( data-id="convert" ) span.test-label pdf thumbs span.test-result ? - div.test-info convert executable in a shell - li.test( data-id="temp" ) - span.test-label temp directory - span.test-result ? - div.test-info temporary directory writable for the server + div.test-info command 'convert' available li.test( data-id="archive" ) span.test-label php tar and zip span.test-result ? @@ -56,15 +56,15 @@ html.no-js( lang="en" ) li.test( data-id="tar" ) span.test-label shell tar span.test-result ? - div.test-info tar executable in a shell + div.test-info command 'tar' available li.test( data-id="zip" ) span.test-label shell zip span.test-result ? - div.test-info zip executable in a shell + div.test-info command 'zip' available li.test( data-id="du" ) span.test-label folder size span.test-result ? - div.test-info du executable in a shell + div.test-info command 'du' available div#bottombar.clearfix span.left diff --git a/src/_h5ai/js/inc/h5ai-info.js b/src/_h5ai/js/inc/h5ai-info.js index 606d57cd..21a500b4 100644 --- a/src/_h5ai/js/inc/h5ai-info.js +++ b/src/_h5ai/js/inc/h5ai-info.js @@ -3,12 +3,12 @@ modulejs.define('h5ai-info', ['$', 'core/ajax'], function ($, ajax) { var setCheckResult = function (id, result) { - var $ele = $(id).find('.test-result'); + var $result = $(id).find('.test-result'); if (result) { - $ele.addClass('test-passed').text('yes'); + $result.addClass('test-passed').text('yes'); } else { - $ele.addClass('test-failed').text('no'); + $result.addClass('test-failed').text('no'); } }, From 1f15b636e2f921ca25b9fdb36aa4d2ea0a1d6e1a Mon Sep 17 00:00:00 2001 From: Antoine Date: Thu, 23 Aug 2012 18:25:17 +0300 Subject: [PATCH 051/143] Update French translation Add "filter" and "delete" strings to French translation. --- src/_h5ai/l10n/fr.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_h5ai/l10n/fr.json b/src/_h5ai/l10n/fr.json index 0e8f2e2a..ef29b765 100644 --- a/src/_h5ai/l10n/fr.json +++ b/src/_h5ai/l10n/fr.json @@ -11,5 +11,7 @@ "files": "Fichiers", "download": "télécharger", "noMatch": "rien trouvé", - "dateFormat": "DD/MM/YYYY HH:mm" + "dateFormat": "DD/MM/YYYY HH:mm", + "filter": "filtre", + "delete": "supprimer" } \ No newline at end of file From 491e0e4068f84e2d0acec47dc72e9850fee4f2d3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 24 Aug 2012 14:40:10 +0200 Subject: [PATCH 052/143] Replaces dev number with short git hash. --- makefile.js | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/makefile.js b/makefile.js index b641cc2d..a63a398e 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-11', +var version = '0.22-dev', root = path.resolve(__dirname), src = path.join(root, 'src'), @@ -69,22 +69,34 @@ module.exports = function (make) { }); - make.target('inc', [], 'increase build number, if any') - .sync(function () { + make.target('git-hash', [], 'get git hash tag') + .async(function (done, fail) { - var re = /-(\d+)$/; - var match = version.match(re); - - if (match) { - var number = parseInt(match[1], 10) + 1; - var newVersion = version.replace(re, '-' + number); - - $('makefile.js').replace([[version, newVersion]]).write($.OVERWRITE, 'makefile.js'); - - version = newVersion; - replacements.version = version; - Event.ok({ method: 'inc', message: 'version is now ' + version }); + if (!/-dev$/.test(version)) { + done(); + return; } + + var hash = '', + cmd = 'git', + args = ['rev-parse', '--short', 'HEAD'], + options = {}, + proc = child_process.spawn(cmd, args, options); + + proc.stdout.on('data', function (data) { + hash += ('' + data).replace(/\s*/g, ''); + }); + proc.on('exit', function (code) { + if (code) { + Event.error({ method: 'git-hash', message: cmd + ' exit code ' + code }); + fail(); + } else { + version += '-' + hash; + replacements.version = version; + Event.ok({ method: 'git-hash', message: 'version is now ' + version }); + done(); + } + }); }); @@ -103,7 +115,7 @@ module.exports = function (make) { }); - make.target('build', [], 'build all updated files') + make.target('build', ['git-hash'], 'build all updated files') .sync(function () { $(src + ': _h5ai/js/*.js') @@ -135,7 +147,7 @@ module.exports = function (make) { }); - make.target('build-uncompressed', [], 'build all updated files without compression') + make.target('build-uncompressed', ['git-hash'], 'build all updated files without compression') .sync(function () { $(src + ': _h5ai/js/*.js') @@ -167,7 +179,7 @@ module.exports = function (make) { }); - make.target('release', ['inc', 'clean', 'build'], 'create a zipball') + make.target('release', ['clean', 'build'], 'create a zipball') .async(function (done, fail) { var target = path.join(build, 'h5ai-' + version + '.zip'), @@ -178,9 +190,6 @@ module.exports = function (make) { Event.info({ method: 'exec', message: cmd + ' ' + args.join(' ') }); - // proc.stdout.on('data', function (data) { - // process.stdout.write(data); - // }); proc.stderr.on('data', function (data) { process.stderr.write(data); }); From 151f70773d05313fc98cbfae08b18b53be6b2dc5 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 31 Aug 2012 16:40:24 +0200 Subject: [PATCH 053/143] Updates h5bp to 4.0.0. --- LICENSE.txt => LICENSE.md | 0 README.md | 29 +- src/_h5ai/apache/h5ai-header.html | 2 +- src/_h5ai/css/inc/general.less | 24 ++ src/_h5ai/css/lib/h5bp-main.less | 298 +++++++++++++++ src/_h5ai/css/lib/h5bp-norm.less | 294 --------------- src/_h5ai/css/lib/h5bp-normalize.less | 504 ++++++++++++++++++++++++++ src/_h5ai/css/styles.less | 29 +- 8 files changed, 845 insertions(+), 335 deletions(-) rename LICENSE.txt => LICENSE.md (100%) create mode 100644 src/_h5ai/css/inc/general.less create mode 100644 src/_h5ai/css/lib/h5bp-main.less delete mode 100644 src/_h5ai/css/lib/h5bp-norm.less create mode 100644 src/_h5ai/css/lib/h5bp-normalize.less diff --git a/LICENSE.txt b/LICENSE.md similarity index 100% rename from LICENSE.txt rename to LICENSE.md diff --git a/README.md b/README.md index 609ca786..346a6583 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), -[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) +[AmplifyJS](http://amplifyjs.com) (MIT/GPL), +[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), +[HTML5 ★ Boilerplate](http://html5boilerplate.com) (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 @@ -53,6 +53,7 @@ Run `makejs -t` to list all possible targets. * localization now in separate files * updates translations * updates [jQuery](http://jquery.com) to 1.8.0 +* updates [HTML5 ★ Boilerplate](http://html5boilerplate.com) to 4.0.0 ### v0.21 - *2012-08-06* diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html index 10dc236c..a53da237 100644 --- a/src/_h5ai/apache/h5ai-header.html +++ b/src/_h5ai/apache/h5ai-header.html @@ -5,7 +5,7 @@ Directory index · styled with h5ai - + diff --git a/src/_h5ai/css/inc/general.less b/src/_h5ai/css/inc/general.less new file mode 100644 index 00000000..4546397d --- /dev/null +++ b/src/_h5ai/css/inc/general.less @@ -0,0 +1,24 @@ + +html { overflow-y: auto; } +::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } +::selection { background: #68A9FF; color: #fff; text-shadow: none; } + +body { + font-family: Ubuntu, sans-serif; + font-size: 13px; + color: #555; + background-color: #fff; + margin: 30px; +} + +html.js .hideOnJs, html.no-js .hideOnNoJs { + display: none; +} +html.oldie { + .oldBrowser { + display: inline !important; + } + #tree { + display: none !important; + } +} diff --git a/src/_h5ai/css/lib/h5bp-main.less b/src/_h5ai/css/lib/h5bp-main.less new file mode 100644 index 00000000..6990a847 --- /dev/null +++ b/src/_h5ai/css/lib/h5bp-main.less @@ -0,0 +1,298 @@ +/* + * HTML5 Boilerplate + * + * What follows is the result of much research on cross-browser styling. + * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, + * Kroc Camen, and the H5BP dev community and team. + */ + +/* ========================================================================== + Base styles: opinionated defaults + ========================================================================== */ + +html, +button, +input, +select, +textarea { + color: #222; +} + +body { + font-size: 1em; + line-height: 1.4; +} + +/* + * Remove text-shadow in selection highlight: h5bp.com/i + * These selection declarations have to be separate. + * Customize the background color to match your design. + */ + +::-moz-selection { + background: #b3d4fc; + text-shadow: none; +} + +::selection { + background: #b3d4fc; + text-shadow: none; +} + +/* + * A better looking default horizontal rule + */ + +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; + margin: 1em 0; + padding: 0; +} + +/* + * Remove the gap between images and the bottom of their containers: h5bp.com/i/440 + */ + +img { + vertical-align: middle; +} + +/* + * Remove default fieldset styles. + */ + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +/* + * Allow only vertical resizing of textareas. + */ + +textarea { + resize: vertical; +} + +/* ========================================================================== + Chrome Frame prompt + ========================================================================== */ + +.chromeframe { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} + +/* ========================================================================== + Author's custom styles + ========================================================================== */ + + + + + + + + + + + + + + + + + +/* ========================================================================== + Helper classes + ========================================================================== */ + +/* + * Image replacement + */ + +.ir { + background-color: transparent; + border: 0; + overflow: hidden; + /* IE 6/7 fallback */ + *text-indent: -9999px; +} + +.ir:before { + content: ""; + display: block; + width: 0; + height: 100%; +} + +/* + * Hide from both screenreaders and browsers: h5bp.com/u + */ + +.hidden { + display: none !important; + visibility: hidden; +} + +/* + * Hide only visually, but have it available for screenreaders: h5bp.com/v + */ + +.visuallyhidden { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + +/* + * Extends the .visuallyhidden class to allow the element to be focusable + * when navigated to via the keyboard: h5bp.com/p + */ + +.visuallyhidden.focusable:active, +.visuallyhidden.focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; +} + +/* + * Hide visually and from screenreaders, but maintain layout + */ + +.invisible { + visibility: hidden; +} + +/* + * Clearfix: contain floats + * + * For modern browsers + * 1. The space content is one way to avoid an Opera bug when the + * `contenteditable` attribute is included anywhere else in the document. + * Otherwise it causes space to appear at the top and bottom of elements + * that receive the `clearfix` class. + * 2. The use of `table` rather than `block` is only necessary if using + * `:before` to contain the top-margins of child elements. + */ + +.clearfix:before, +.clearfix:after { + content: " "; /* 1 */ + display: table; /* 2 */ +} + +.clearfix:after { + clear: both; +} + +/* + * For IE 6/7 only + * Include this rule to trigger hasLayout and contain floats. + */ + +.clearfix { + *zoom: 1; +} + +/* ========================================================================== + EXAMPLE Media Queries for Responsive Design. + Theses examples override the primary ('mobile first') styles. + Modify as content requires. + ========================================================================== */ + +@media only screen and (min-width: 35em) { + /* Style adjustments for viewports that meet the condition */ +} + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min-resolution: 144dpi) { + /* Style adjustments for high resolution devices */ +} + +/* ========================================================================== + Print styles. + Inlined to avoid required HTTP connection: h5bp.com/r + ========================================================================== */ + +@media print { + * { + background: transparent !important; + color: #000 !important; /* Black prints faster: h5bp.com/s */ + box-shadow:none !important; + text-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + /* + * Don't show links for images, or javascript/internal links + */ + + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; /* h5bp.com/t */ + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + @page { + margin: 0.5cm; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } +} diff --git a/src/_h5ai/css/lib/h5bp-norm.less b/src/_h5ai/css/lib/h5bp-norm.less deleted file mode 100644 index 9c73992b..00000000 --- a/src/_h5ai/css/lib/h5bp-norm.less +++ /dev/null @@ -1,294 +0,0 @@ -/* - * HTML5 ✰ Boilerplate - * - * What follows is the result of much research on cross-browser styling. - * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, - * Kroc Camen, and the H5BP dev community and team. - * - * Detailed information about this CSS: h5bp.com/css - * - * ==|== normalize ========================================================== - */ - - -/* ============================================================================= - HTML5 display definitions - ========================================================================== */ - -article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } -audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } -audio:not([controls]) { display: none; } -[hidden] { display: none; } - - -/* ============================================================================= - Base - ========================================================================== */ - -/* - * 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units - * 2. Force vertical scrollbar in non-IE - * 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%; } - -body { margin: 0; font-size: 13px; line-height: 1.231; } - -body, button, input, select, textarea { font-family: sans-serif; color: #222; } - -/* - * Remove text-shadow in selection highlight: h5bp.com/i - * These selection declarations have to be separate - * Also: hot pink! (or customize the background color to match your design) - */ - -::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; } -::selection { background: #fe57a1; color: #fff; text-shadow: none; } - - -/* ============================================================================= - Links - ========================================================================== */ - -a { color: #00e; } -a:visited { color: #551a8b; } -a:hover { color: #06e; } -a:focus { outline: thin dotted; } - -/* Improve readability when focused and hovered in all browsers: h5bp.com/h */ -a:hover, a:active { outline: 0; } - - -/* ============================================================================= - Typography - ========================================================================== */ - -abbr[title] { border-bottom: 1px dotted; } - -b, strong { font-weight: bold; } - -blockquote { margin: 1em 40px; } - -dfn { font-style: italic; } - -hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } - -ins { background: #ff9; color: #000; text-decoration: none; } - -mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } - -/* Redeclare monospace font family: h5bp.com/j */ -pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; } - -/* Improve readability of pre-formatted text in all browsers */ -pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } - -q { quotes: none; } -q:before, q:after { content: ""; content: none; } - -small { font-size: 85%; } - -/* Position subscript and superscript content without affecting line-height: h5bp.com/k */ -sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } -sup { top: -0.5em; } -sub { bottom: -0.25em; } - - -/* ============================================================================= - Lists - ========================================================================== */ - -ul, ol { margin: 1em 0; padding: 0 0 0 40px; } -dd { margin: 0 0 0 40px; } -nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } - - -/* ============================================================================= - Embedded content - ========================================================================== */ - -/* - * 1. Improve image quality when scaled in IE7: h5bp.com/d - * 2. Remove the gap between images and borders on image containers: h5bp.com/e - */ - -img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } - -/* - * Correct overflow not hidden in IE9 - */ - -svg:not(:root) { overflow: hidden; } - - -/* ============================================================================= - Figures - ========================================================================== */ - -figure { margin: 0; } - - -/* ============================================================================= - Forms - ========================================================================== */ - -form { margin: 0; } -fieldset { border: 0; margin: 0; padding: 0; } - -/* Indicate that 'label' will shift focus to the associated form element */ -label { cursor: pointer; } - -/* - * 1. Correct color not inheriting in IE6/7/8/9 - * 2. Correct alignment displayed oddly in IE6/7 - */ - -legend { border: 0; *margin-left: -7px; padding: 0; } - -/* - * 1. Correct font-size not inheriting in all browsers - * 2. Remove margins in FF3/4 S5 Chrome - * 3. Define consistent vertical alignment display in all browsers - */ - -button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; } - -/* - * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet) - * 2. Correct inner spacing displayed oddly in IE6/7 - */ - -button, input { line-height: normal; *overflow: visible; } - -/* - * Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7 - */ - -table button, table input { *overflow: auto; } - -/* - * 1. Display hand cursor for clickable form elements - * 2. Allow styling of clickable form elements in iOS - */ - -button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; } - -/* - * Consistent box sizing and appearance - */ - -input[type="checkbox"], input[type="radio"] { box-sizing: border-box; } -input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } -input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } - -/* - * Remove inner padding and border in FF3/4: h5bp.com/l - */ - -button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } - -/* - * 1. Remove default vertical scrollbar in IE6/7/8/9 - * 2. Allow only vertical resizing - */ - -textarea { overflow: auto; vertical-align: top; resize: vertical; } - -/* Colors for form validity */ -input:valid, textarea:valid { } -input:invalid, textarea:invalid { background-color: #f0dddd; } - - -/* ============================================================================= - Tables - ========================================================================== */ - -table { border-collapse: collapse; border-spacing: 0; } -td { vertical-align: top; } - - -/* ==|== primary styles ===================================================== - Author: - ========================================================================== */ - - - - - - - - - - - - - - - - -/* ==|== non-semantic helper classes ======================================== - Please define your styles before this section. - ========================================================================== */ - -/* For image replacement */ -.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; } -.ir br { display: none; } - -/* Hide from both screenreaders and browsers: h5bp.com/u */ -.hidden { display: none !important; visibility: hidden; } - -/* Hide only visually, but have it available for screenreaders: h5bp.com/v */ -.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } - -/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */ -.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } - -/* Hide visually and from screenreaders, but maintain layout */ -.invisible { visibility: hidden; } - -/* Contain floats: h5bp.com/q */ -.clearfix:before, .clearfix:after { content: ""; display: table; } -.clearfix:after { clear: both; } -.clearfix { zoom: 1; } - - - -/* ==|== media queries ====================================================== - PLACEHOLDER Media Queries for Responsive Design. - These override the primary ('mobile first') styles - Modify as content requires. - ========================================================================== */ - -@media only screen and (min-width: 480px) { - /* Style adjustments for viewports 480px and over go here */ - -} - -@media only screen and (min-width: 768px) { - /* Style adjustments for viewports 768px and over go here */ - -} - - - -/* ==|== print styles ======================================================= - Print styles. - Inlined to avoid required HTTP connection: h5bp.com/r - ========================================================================== */ - -@media print { - * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */ - a, a:visited { text-decoration: underline; } - a[href]:after { content: " (" attr(href) ")"; } - abbr[title]:after { content: " (" attr(title) ")"; } - .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */ - pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } - thead { display: table-header-group; } /* h5bp.com/t */ - tr, img { page-break-inside: avoid; } - img { max-width: 100% !important; } - @page { margin: 0.5cm; } - p, h2, h3 { orphans: 3; widows: 3; } - h2, h3 { page-break-after: avoid; } -} - diff --git a/src/_h5ai/css/lib/h5bp-normalize.less b/src/_h5ai/css/lib/h5bp-normalize.less new file mode 100644 index 00000000..d4210aac --- /dev/null +++ b/src/_h5ai/css/lib/h5bp-normalize.less @@ -0,0 +1,504 @@ +/*! normalize.css v1.0.1 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/* + * Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/* + * Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3, + * and Safari 4. + * Known issue: no IE 6 support. + */ + +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/* + * 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevents iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-size: 100%; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/* + * Addresses `font-family` inconsistency between `textarea` and other form + * elements. + */ + +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE 6/7. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/* + * Addresses `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/* + * Addresses font sizes and margins set differently in IE 6/7. + * Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE 7/8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Addresses styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE 6/7/8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE 6/7. + */ + +p, +pre { + margin: 1em 0; +} + +/* + * Corrects font family set oddly in IE 6, Safari 4/5, and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * Improves readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* + * Addresses CSS quotes not supported in IE 6/7. + */ + +q { + quotes: none; +} + +/* + * Addresses `quotes` property not supported in Safari 4. + */ + +q:before, +q:after { + content: ''; + content: none; +} + +/* + * Addresses inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/* + * Prevents `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ + +/* + * Addresses margins set differently in IE 6/7. + */ + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE 6/7. + */ + +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE 7. + */ + +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/* + * 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improves image quality when scaled in IE 7. + */ + +img { + border: 0; /* 1 */ + -ms-interpolation-mode: bicubic; /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/* + * Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/* + * Corrects margin displayed oddly in IE 6/7. + */ + +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE 6/7/8/9. + * 2. Corrects text not wrapping in Firefox 3. + * 3. Corrects alignment displayed oddly in IE 6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; + white-space: normal; /* 2 */ + *margin-left: -7px; /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers. + * 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improves appearance and consistency in all browsers. + */ + +button, +input, +select, +textarea { + font-size: 100%; /* 1 */ + margin: 0; /* 2 */ + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ +} + +/* + * Addresses Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/* + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Corrects inability to style clickable `input` types in iOS. + * 3. Improves usability and consistency of cursor style between image-type + * `input` and others. + * 4. Removes inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + *overflow: visible; /* 4 */ +} + +/* + * Re-set default cursor for disabled elements. + */ + +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE 8/9. + * 2. Removes excess padding in IE 8/9. + * 3. Removes excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ +} + +/* + * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in Firefox 3+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE 6/7/8/9. + * 2. Improves readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/* + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/src/_h5ai/css/styles.less b/src/_h5ai/css/styles.less index 5aa4a380..f09c9afb 100644 --- a/src/_h5ai/css/styles.less +++ b/src/_h5ai/css/styles.less @@ -1,21 +1,11 @@ -@import "lib/h5bp-norm"; +@import "lib/h5bp-normalize"; +@import "lib/h5bp-main"; @import "lib/mixins"; @import "lib/sh/shCore"; @import "lib/sh/shThemeDefault"; -html { overflow-y: auto; } -::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } -::selection { background: #68A9FF; color: #fff; text-shadow: none; } - -body { - font-family: Ubuntu, sans-serif; - font-size: 13px; - color: #555; - background-color: #fff; - margin: 30px; -} - +@import "inc/general"; @import "inc/topbar"; @import "inc/download"; @@ -40,16 +30,3 @@ body { @import "inc/responsive"; @import "inc/h5ai-info"; - - -html.js .hideOnJs, html.no-js .hideOnNoJs { - display: none; -} -html.oldie { - .oldBrowser { - display: inline !important; - } - #tree { - display: none !important; - } -} From b80eeeebbf7c19620a8ea5c731a1e8fa0251457f Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 31 Aug 2012 16:55:38 +0200 Subject: [PATCH 054/143] Adds background transition for img preview fullscreen mode. --- src/_h5ai/css/inc/preview-img.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_h5ai/css/inc/preview-img.less b/src/_h5ai/css/inc/preview-img.less index 6946de74..6d791b85 100644 --- a/src/_h5ai/css/inc/preview-img.less +++ b/src/_h5ai/css/inc/preview-img.less @@ -9,6 +9,7 @@ z-index: 100; background-color: rgba(0,0,0,0.5); + .transition(background-color 0.3s ease-in-out); text-align: center; } From 586c21a2c158aa39f7bdae65bd6acf909ec78948 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 31 Aug 2012 18:15:21 +0200 Subject: [PATCH 055/143] More jade. --- src/_h5ai/.htaccess | 2 +- src/_h5ai/apache/h5ai-footer.html | 6 ---- src/_h5ai/apache/h5ai-footer.html.jade | 10 ++++++ src/_h5ai/apache/h5ai-header.html | 36 --------------------- src/_h5ai/apache/h5ai-header.html.jade | 43 ++++++++++++++++++++++++++ src/_h5ai/php/h5ai-index.php.jade | 8 ++--- 6 files changed, 58 insertions(+), 47 deletions(-) delete mode 100644 src/_h5ai/apache/h5ai-footer.html create mode 100644 src/_h5ai/apache/h5ai-footer.html.jade delete mode 100644 src/_h5ai/apache/h5ai-header.html create mode 100644 src/_h5ai/apache/h5ai-header.html.jade diff --git a/src/_h5ai/.htaccess b/src/_h5ai/.htaccess index d1f82f7a..9540a5a2 100644 --- a/src/_h5ai/.htaccess +++ b/src/_h5ai/.htaccess @@ -13,7 +13,7 @@ DirectoryIndex index.html # cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5) ExpiresByType text/cache-manifest "access plus 0 seconds" - # your document html + # your document html ExpiresByType text/html "access plus 0 seconds" # data diff --git a/src/_h5ai/apache/h5ai-footer.html b/src/_h5ai/apache/h5ai-footer.html deleted file mode 100644 index 72b45348..00000000 --- a/src/_h5ai/apache/h5ai-footer.html +++ /dev/null @@ -1,6 +0,0 @@ - -
            - - - - \ No newline at end of file diff --git a/src/_h5ai/apache/h5ai-footer.html.jade b/src/_h5ai/apache/h5ai-footer.html.jade new file mode 100644 index 00000000..cf6d4d71 --- /dev/null +++ b/src/_h5ai/apache/h5ai-footer.html.jade @@ -0,0 +1,10 @@ + +- var h5ai = "/_h5ai/" + +// generated code ends here +| + +script( src!="#{h5ai}config.js" ) +script( src!="#{h5ai}js/scripts.js" ) + +| diff --git a/src/_h5ai/apache/h5ai-header.html b/src/_h5ai/apache/h5ai-header.html deleted file mode 100644 index a53da237..00000000 --- a/src/_h5ai/apache/h5ai-header.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - Directory index · styled with h5ai - - - - - - - - - -
            - -
            -
            -
            -
            -
            - - h5ai {{version}} - ⚡ JavaScript is disabled! ⚡ - ⚡ Some features disabled! Works best in modern browsers. ⚡ - - - -
            -
            - diff --git a/src/_h5ai/apache/h5ai-header.html.jade b/src/_h5ai/apache/h5ai-header.html.jade new file mode 100644 index 00000000..5faa5ee6 --- /dev/null +++ b/src/_h5ai/apache/h5ai-header.html.jade @@ -0,0 +1,43 @@ + +- var h5ai = "/_h5ai/" + +doctype 5 +//if lt IE 9 + +//[if gt IE 8]> +// + +div#topbar.clearfix + ul#navbar + +div#content + div#extended.clearfix + +div#bottombar.clearfix + span.left + a#h5ai-reference( href="http://larsjung.de/h5ai", title="h5ai project page" ) h5ai {{version}} + span.hideOnJs.noJsMsg ⚡ JavaScript is disabled! ⚡ + span.oldBrowser + | ⚡ Some features disabled! Works best in + a( href="http://browsehappy.com" ) modern browsers + | . ⚡ + span.right + span.center + +|
            +// The following code was generated by Apache's autoindex module. It is not valid HTML5, but gets removed from the DOM tree as soon as possible. The actual page should render as valid HTML5. diff --git a/src/_h5ai/php/h5ai-index.php.jade b/src/_h5ai/php/h5ai-index.php.jade index 0d2788b4..e1425c0c 100644 --- a/src/_h5ai/php/h5ai-index.php.jade +++ b/src/_h5ai/php/h5ai-index.php.jade @@ -63,11 +63,11 @@ html.no-js( lang="en" ) div#bottombar.clearfix span.left a#h5ai-reference( href="http://larsjung.de/h5ai", title="h5ai project page" ) h5ai {{version}} - span.hideOnJs.noJsMsg ⚡ JavaScript is disabled! ⚡ - span.oldBrowser - | ⚡ Some features disabled! Works best in + span.hideOnJs.noJsMsg ⚡ JavaScript is disabled! ⚡ + span.oldBrowser + | ⚡ Some features disabled! Works best in a( href="http://browsehappy.com" ) modern browsers - | . ⚡ + | . ⚡ span.right span.center From 07d67787d804db506b6a52ee2452759692abafb9 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 31 Aug 2012 19:44:59 +0200 Subject: [PATCH 056/143] Removes some blank lines. --- src/_h5ai/php/h5ai-index.php.jade | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/_h5ai/php/h5ai-index.php.jade b/src/_h5ai/php/h5ai-index.php.jade index e1425c0c..06f02e91 100644 --- a/src/_h5ai/php/h5ai-index.php.jade +++ b/src/_h5ai/php/h5ai-index.php.jade @@ -1,30 +1,21 @@ |getH5aiAbsHref(); | $isHeadRequest = stripos($_SERVER["REQUEST_METHOD"], "HEAD"); |?> From 47a1c0989c6972fb0e51e80fcaa7876f542ebb63 Mon Sep 17 00:00:00 2001 From: Tomer Cohen Date: Tue, 11 Sep 2012 22:02:00 +0300 Subject: [PATCH 057/143] Hebrew translation --- src/_h5ai/l10n/he.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/_h5ai/l10n/he.json diff --git a/src/_h5ai/l10n/he.json b/src/_h5ai/l10n/he.json new file mode 100644 index 00000000..1d92a908 --- /dev/null +++ b/src/_h5ai/l10n/he.json @@ -0,0 +1,18 @@ +/* only here as a reference, these values are the hardcoded defaults */ +{ + "lang": "עברית", + "details": "פרטים", + "icons": "צלמיות", + "name": "שם", + "lastModified": "שינוי אחרון", + "size": "גודל", + "parentDirectory": "תיקיית הורה", + "empty": "ריק", + "folders": "תיקיות", + "files": "קבצים", + "download": "הורדה", + "noMatch": "אין תוצאות", + "dateFormat": "DD.MM.YYYY HH:mm", /* syntax as specified on http://momentjs.com */ + "filter": "סינון", + "delete": "מחיקה" +} From d0544462d5464c54a4843694f80254c34f5caa7d Mon Sep 17 00:00:00 2001 From: Romain Sertelon Date: Wed, 12 Sep 2012 16:04:06 +0200 Subject: [PATCH 058/143] Adds Piwik Analytics support --- src/_h5ai/config.js | 9 ++++++ src/_h5ai/js/inc/ext/piwik-analytics.js | 40 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 src/_h5ai/js/inc/ext/piwik-analytics.js diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index b279759d..98f985ab 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -193,6 +193,15 @@ var H5AI_CONFIG = { "display": 2 }, + /* [all] + Adds Piwik tracker javascript code. + */ + "piwik-analytics": { + "enabled": false, + "baseURL": "mydomain.tld/piwik", /* no protocol */ + "idSite": 1 + }, + /* [all] Show an image preview on click. */ diff --git a/src/_h5ai/js/inc/ext/piwik-analytics.js b/src/_h5ai/js/inc/ext/piwik-analytics.js new file mode 100755 index 00000000..7f9105c2 --- /dev/null +++ b/src/_h5ai/js/inc/ext/piwik-analytics.js @@ -0,0 +1,40 @@ + +modulejs.define('ext/piwik-analytics', ['_', 'core/settings'], function (_, allsettings) { + + var defaults = { + enabled: false, + piwik: { + "baseURL": "not-set", + "idSite": 0 + } + }, + + template = function(baseURL, idSite) { + + return '' + } + + settings = _.extend({}, defaults, allsettings['piwik-analytics']), + + init = function () { + + if (!settings.enabled) { + return; + } + + var $body = $('body'); + + body.append(template(settings.baseURL, settings.idSite)); + }; + + init(); +}); From b727b29275f0e9be3721bc712cf371441824ff59 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 12 Sep 2012 20:48:15 +0200 Subject: [PATCH 059/143] Updates build process. --- makefile.js | 63 +++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/makefile.js b/makefile.js index a63a398e..2fc8c3e8 100644 --- a/makefile.js +++ b/makefile.js @@ -2,8 +2,7 @@ 'use strict'; -var path = require('path'), - child_process = require('child_process'); +var path = require('path'); var version = '0.22-dev', @@ -65,11 +64,14 @@ module.exports = function (make) { stamp: stamp.format('YYYY-MM-DD HH:mm:ss') }; - Event.info({ method: 'before', message: version + ' ' + replacements.stamp }); + Event.info({ + method: 'before', + message: version + ' ' + replacements.stamp + }); }); - make.target('git-hash', [], 'get git hash tag') + make.target('check-version', [], 'add git hash tag for dev builds') .async(function (done, fail) { if (!/-dev$/.test(version)) { @@ -77,25 +79,15 @@ module.exports = function (make) { return; } - var hash = '', - cmd = 'git', - args = ['rev-parse', '--short', 'HEAD'], - options = {}, - proc = child_process.spawn(cmd, args, options); + $.githash(root, function (err, hash) { - proc.stdout.on('data', function (data) { - hash += ('' + data).replace(/\s*/g, ''); - }); - proc.on('exit', function (code) { - if (code) { - Event.error({ method: 'git-hash', message: cmd + ' exit code ' + code }); - fail(); - } else { - version += '-' + hash; - replacements.version = version; - Event.ok({ method: 'git-hash', message: 'version is now ' + version }); - done(); - } + version += '-' + hash; + replacements.version = version; + Event.info({ + method: 'check-version', + message: 'version set to ' + version + }); + done(); }); }); @@ -115,7 +107,7 @@ module.exports = function (make) { }); - make.target('build', ['git-hash'], 'build all updated files') + make.target('build', ['check-version'], 'build all updated files') .sync(function () { $(src + ': _h5ai/js/*.js') @@ -147,7 +139,7 @@ module.exports = function (make) { }); - make.target('build-uncompressed', ['git-hash'], 'build all updated files without compression') + make.target('build-uncompressed', ['check-version'], 'build all updated files without compression') .sync(function () { $(src + ': _h5ai/js/*.js') @@ -182,25 +174,10 @@ module.exports = function (make) { make.target('release', ['clean', 'build'], 'create a zipball') .async(function (done, fail) { - var target = path.join(build, 'h5ai-' + version + '.zip'), - cmd = 'zip', - args = ['-ro', target, '_h5ai'], - options = { cwd: build }, - proc = child_process.spawn(cmd, args, options); - - Event.info({ method: 'exec', message: cmd + ' ' + args.join(' ') }); - - 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(); - } + $(build + ': _h5ai/**').shzip({ + target: path.join(build, 'h5ai-' + version + '.zip'), + dir: build, + callback: done }); }); }; From 2fecdef3e068cb32d76f561770357bb0989fe5ce Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 12 Sep 2012 20:55:27 +0200 Subject: [PATCH 060/143] Adds he translation to config. --- src/_h5ai/config.js | 1 + src/_h5ai/l10n/he.json | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index b279759d..4f896e8d 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -399,6 +399,7 @@ var H5AI_CONFIG = { "el": "ελληνικά", "es": "español", "fr": "français", + "he": "עברית", "hu": "magyar", "it": "italiano", "ja": "日本語", diff --git a/src/_h5ai/l10n/he.json b/src/_h5ai/l10n/he.json index 1d92a908..3fd7fbfb 100644 --- a/src/_h5ai/l10n/he.json +++ b/src/_h5ai/l10n/he.json @@ -1,4 +1,3 @@ -/* only here as a reference, these values are the hardcoded defaults */ { "lang": "עברית", "details": "פרטים", @@ -12,7 +11,7 @@ "files": "קבצים", "download": "הורדה", "noMatch": "אין תוצאות", - "dateFormat": "DD.MM.YYYY HH:mm", /* syntax as specified on http://momentjs.com */ + "dateFormat": "DD.MM.YYYY HH:mm", "filter": "סינון", "delete": "מחיקה" } From 6d188f127124c13107ebb68bce91b0282470dbf8 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 12 Sep 2012 21:35:24 +0200 Subject: [PATCH 061/143] Updates readme. --- README.md | 1 + src/_h5ai/l10n/he.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 346a6583..04ddd6a9 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Run `makejs -t` to list all possible targets. * temp download packages are now stored in the `_h5ai/cache` and deleted as soon as possible * localization now in separate files * updates translations +* adds `he` translation by [Tomer Cohen](https://github.com/tomer) * updates [jQuery](http://jquery.com) to 1.8.0 * updates [HTML5 ★ Boilerplate](http://html5boilerplate.com) to 4.0.0 diff --git a/src/_h5ai/l10n/he.json b/src/_h5ai/l10n/he.json index 3fd7fbfb..dc2336c5 100644 --- a/src/_h5ai/l10n/he.json +++ b/src/_h5ai/l10n/he.json @@ -14,4 +14,4 @@ "dateFormat": "DD.MM.YYYY HH:mm", "filter": "סינון", "delete": "מחיקה" -} +} \ No newline at end of file From 010b984a938b2c3c3df2e54afa2ecf6670a1e963 Mon Sep 17 00:00:00 2001 From: Romain Sertelon Date: Thu, 13 Sep 2012 15:59:26 +0200 Subject: [PATCH 062/143] Issues fixed --- src/_h5ai/js/inc/ext/piwik-analytics.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/_h5ai/js/inc/ext/piwik-analytics.js b/src/_h5ai/js/inc/ext/piwik-analytics.js index 7f9105c2..e56d9ad4 100755 --- a/src/_h5ai/js/inc/ext/piwik-analytics.js +++ b/src/_h5ai/js/inc/ext/piwik-analytics.js @@ -3,10 +3,8 @@ modulejs.define('ext/piwik-analytics', ['_', 'core/settings'], function (_, alls var defaults = { enabled: false, - piwik: { - "baseURL": "not-set", - "idSite": 0 - } + "baseURL": "not-set", + "idSite": 0 }, template = function(baseURL, idSite) { @@ -33,7 +31,7 @@ modulejs.define('ext/piwik-analytics', ['_', 'core/settings'], function (_, alls var $body = $('body'); - body.append(template(settings.baseURL, settings.idSite)); + $body.append(template(settings.baseURL, settings.idSite)); }; init(); From 07fcb40aab1936ce7b12718bdf6de55867c4b898 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 14 Sep 2012 00:25:20 +0200 Subject: [PATCH 063/143] Updates build process. --- makefile.js | 228 ++++++++++++------------- package.json | 12 ++ src/_h5ai/apache/autoindex.htaccess | 4 +- src/_h5ai/apache/h5ai-header.html.jade | 6 +- src/_h5ai/config.js | 2 +- src/_h5ai/config.php | 2 +- src/_h5ai/index.html.jade | 8 +- src/_h5ai/php/h5ai-index.php.jade | 8 +- 8 files changed, 134 insertions(+), 136 deletions(-) create mode 100644 package.json diff --git a/makefile.js b/makefile.js index 2fc8c3e8..b854df2a 100644 --- a/makefile.js +++ b/makefile.js @@ -2,10 +2,9 @@ 'use strict'; -var path = require('path'); +var path = require('path'), - -var version = '0.22-dev', + pkg = require('./package.json'), root = path.resolve(__dirname), src = path.join(root, 'src'), @@ -33,14 +32,18 @@ var version = '0.22-dev', ] }, - mapper = function (blob) { + handlebarsEnv = { + pkg: pkg + }, + + mapSrc = function (blob) { return blob.source.replace(src, build).replace(/\.less$/, '.css').replace(/\.jade$/, ''); }, - mapperRoot = function (blob) { + mapRoot = function (blob) { - return blob.source.replace(root, build + '/_h5ai'); + return blob.source.replace(root, path.join(build, '_h5ai')); }; @@ -48,136 +51,119 @@ module.exports = function (make) { var Event = make.Event, $ = make.fQuery, - moment = make.moment, - stamp, replacements; + moment = make.moment; + make.version('>=0.8'); make.defaults('build'); make.before(function () { - stamp = moment(); + handlebarsEnv.stamp = moment().format('YYYY-MM-DD HH:mm:ss'); + }); - replacements = { - version: version, - stamp: stamp.format('YYYY-MM-DD HH:mm:ss') - }; - Event.info({ - method: 'before', - message: version + ' ' + replacements.stamp + make.target('check-version', [], 'add git info to dev builds').async(function (done, fail) { + + if (!/-dev$/.test(pkg.version)) { + done(); + return; + } + + $.git(root, function (err, result) { + + pkg.version += '-' + result.revListMasterHead.length + '-' + result.revParseHead.slice(0, 7); + Event.info({ + method: 'check-version', + message: 'version set to ' + pkg.version + }); + done(); }); }); - make.target('check-version', [], 'add git hash tag for dev builds') - .async(function (done, fail) { + make.target('clean', [], 'delete build folder').sync(function () { - if (!/-dev$/.test(version)) { - done(); - return; - } + $.rmfr($.I_AM_SURE, build); + }); - $.githash(root, function (err, hash) { - version += '-' + hash; - replacements.version = version; - Event.info({ - method: 'check-version', - message: 'version set to ' + version - }); - done(); - }); - }); - - - make.target('clean', [], 'delete build folder') - .sync(function () { - - $.rmfr($.I_AM_SURE, build); - }); - - - make.target('lint', [], 'lint all JavaScript files with JSHint') - .sync(function () { - - $(src + '/_h5ai/js: **/*.js, ! lib/**') - .jshint(jshint); - }); - - - make.target('build', ['check-version'], 'build all updated files') - .sync(function () { - - $(src + ': _h5ai/js/*.js') - .modified(mapper, $(src + ': _h5ai/js/**')) - .includify() - .uglifyjs() - .write($.OVERWRITE, mapper); - - $(src + ': _h5ai/css/*.less') - .modified(mapper, $(src + ': _h5ai/css/**')) - .less() - .cssmin() - .write($.OVERWRITE, mapper); - - $(src + ': **/*.jade') - .modified(mapper) - .handlebars(replacements) - .jade() - .write($.OVERWRITE, mapper); - - $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') - .modified(mapper) - .handlebars(replacements) - .write($.OVERWRITE, mapper); - - $(root + ': README*, LICENSE*') - .modified(mapperRoot) - .write($.OVERWRITE, mapperRoot); - }); - - - make.target('build-uncompressed', ['check-version'], 'build all updated files without compression') - .sync(function () { - - $(src + ': _h5ai/js/*.js') - .modified(mapper, $(src + ': _h5ai/js/**')) - .includify() - // .uglifyjs() - .write($.OVERWRITE, mapper); - - $(src + ': _h5ai/css/*.less') - .modified(mapper, $(src + ': _h5ai/css/**')) - .less() - // .cssmin() - .write($.OVERWRITE, mapper); - - $(src + ': **/*.jade') - .modified(mapper) - .handlebars(replacements) - .jade() - .write($.OVERWRITE, mapper); - - $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') - .modified(mapper) - .handlebars(replacements) - .write($.OVERWRITE, mapper); - - $(root + ': README*, LICENSE*') - .modified(mapperRoot) - .write($.OVERWRITE, mapperRoot); - }); - - - make.target('release', ['clean', 'build'], 'create a zipball') - .async(function (done, fail) { - - $(build + ': _h5ai/**').shzip({ - target: path.join(build, 'h5ai-' + version + '.zip'), - dir: build, - callback: done - }); + make.target('lint', [], 'lint all JavaScript files with JSHint').sync(function () { + + $(path.join(src, '_h5ai', 'js') + ': **/*.js, ! lib/**') + .jshint(jshint); + }); + + + make.target('build', ['check-version'], 'build all updated files').sync(function () { + + $(src + ': _h5ai/js/*.js') + .modified(mapSrc, $(src + ': _h5ai/js/**')) + .includify() + .uglifyjs() + .write($.OVERWRITE, mapSrc); + + $(src + ': _h5ai/css/*.less') + .modified(mapSrc, $(src + ': _h5ai/css/**')) + .less() + .cssmin() + .write($.OVERWRITE, mapSrc); + + $(src + ': **/*.jade') + .modified(mapSrc) + .handlebars(handlebarsEnv) + .jade() + .write($.OVERWRITE, mapSrc); + + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') + .modified(mapSrc) + .handlebars(handlebarsEnv) + .write($.OVERWRITE, mapSrc); + + $(root + ': README*, LICENSE*') + .modified(mapRoot) + .write($.OVERWRITE, mapRoot); + }); + + + make.target('build-uncompressed', ['check-version'], 'build all updated files without compression').sync(function () { + + $(src + ': _h5ai/js/*.js') + .modified(mapSrc, $(src + ': _h5ai/js/**')) + .includify() + // .uglifyjs() + .write($.OVERWRITE, mapSrc); + + $(src + ': _h5ai/css/*.less') + .modified(mapSrc, $(src + ': _h5ai/css/**')) + .less() + // .cssmin() + .write($.OVERWRITE, mapSrc); + + $(src + ': **/*.jade') + .modified(mapSrc) + .handlebars(handlebarsEnv) + .jade() + .write($.OVERWRITE, mapSrc); + + $(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**, ! **/*.jade') + .modified(mapSrc) + .handlebars(handlebarsEnv) + .write($.OVERWRITE, mapSrc); + + $(root + ': README*, LICENSE*') + .modified(mapRoot) + .write($.OVERWRITE, mapRoot); + }); + + + make.target('release', ['clean', 'build'], 'create a zipball').async(function (done, fail) { + + $(build + ': _h5ai/**').shzip({ + target: path.join(build, 'h5ai-' + pkg.version + '.zip'), + dir: build, + callback: done }); + }); }; diff --git a/package.json b/package.json new file mode 100644 index 00000000..1c02ad21 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "h5ai", + "version": "0.22-dev", + "description": "a modern HTTP web server index", + "url": "http://larsjung.de/h5ai/", + "author": "Lars Jung ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/lrsjng/h5ai.git" + } +} diff --git a/src/_h5ai/apache/autoindex.htaccess b/src/_h5ai/apache/autoindex.htaccess index 99595977..05604834 100644 --- a/src/_h5ai/apache/autoindex.htaccess +++ b/src/_h5ai/apache/autoindex.htaccess @@ -1,5 +1,5 @@ ################################ -# h5ai {{version}} +# {{pkg.name}} {{pkg.version}} # customized .htaccess ################################ @@ -19,5 +19,5 @@ IndexOptions NameWidth=* IndexOptions SuppressDescription IndexOptions SuppressHTMLPreamble IndexOptions SuppressRules -IndexOptions Type=text/html;h5ai={{version}} +IndexOptions Type=text/html;h5ai={{pkg.version}} IndexOptions XHTML diff --git a/src/_h5ai/apache/h5ai-header.html.jade b/src/_h5ai/apache/h5ai-header.html.jade index 5faa5ee6..68cd5d78 100644 --- a/src/_h5ai/apache/h5ai-header.html.jade +++ b/src/_h5ai/apache/h5ai-header.html.jade @@ -11,8 +11,8 @@ doctype 5 head meta( charset="utf-8" ) meta( http-equiv="X-UA-Compatible", content="IE=edge,chrome=1" ) - title Directory index · styled with h5ai {{version}} - meta( name="description", content="Directory index styled with h5ai {{version}} (http://larsjung.de/h5ai)" ) + title Directory index · styled with {{pkg.name}} {{pkg.version}} + meta( name="description", content="Directory index styled with h5ai {{pkg.version}} (http://larsjung.de/h5ai)" ) meta( name="viewport", content="width=device-width" ) link( rel="shortcut icon", type="image/png", href!="#{h5ai}images/h5ai-16x16.png" ) link( rel="apple-touch-icon", type="image/png", href!="#{h5ai}images/h5ai-48x48.png" ) @@ -30,7 +30,7 @@ div#content div#bottombar.clearfix span.left - a#h5ai-reference( href="http://larsjung.de/h5ai", title="h5ai project page" ) h5ai {{version}} + a#h5ai-reference( href="http://larsjung.de/h5ai", title="h5ai project page" ) {{pkg.name}} {{pkg.version}} span.hideOnJs.noJsMsg ⚡ JavaScript is disabled! ⚡ span.oldBrowser | ⚡ Some features disabled! Works best in diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 4f896e8d..2584bd7c 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -1,5 +1,5 @@ /* -h5ai {{version}} +{{pkg.name}} {{pkg.version}} Configuration options, types and localization diff --git a/src/_h5ai/config.php b/src/_h5ai/config.php index e7fcd80a..ccdcce70 100644 --- a/src/_h5ai/config.php +++ b/src/_h5ai/config.php @@ -1,6 +1,6 @@ Date: Fri, 14 Sep 2012 00:45:58 +0200 Subject: [PATCH 064/143] Updates 3rd party libs. --- README.md | 2 +- src/_h5ai/js/lib/jquery-1.8.0.min.js | 2 -- src/_h5ai/js/lib/jquery-1.8.1.min.js | 2 ++ src/_h5ai/js/lib/modernizr-2.6.1.min.js | 4 ---- src/_h5ai/js/lib/modernizr-2.6.2.min.js | 4 ++++ src/_h5ai/js/lib/spin-1.2.5.min.js | 19 ------------------- src/_h5ai/js/lib/spin-1.2.6.min.js | 2 ++ src/_h5ai/js/scripts.js | 12 ++++++------ 8 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 src/_h5ai/js/lib/jquery-1.8.0.min.js create mode 100644 src/_h5ai/js/lib/jquery-1.8.1.min.js delete mode 100644 src/_h5ai/js/lib/modernizr-2.6.1.min.js create mode 100644 src/_h5ai/js/lib/modernizr-2.6.2.min.js delete mode 100644 src/_h5ai/js/lib/spin-1.2.5.min.js create mode 100644 src/_h5ai/js/lib/spin-1.2.6.min.js diff --git a/README.md b/README.md index 04ddd6a9..3cff84ac 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ 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), +[spin.js](http://fgnass.github.com/spin.js/) (MIT), [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL), [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 diff --git a/src/_h5ai/js/lib/jquery-1.8.0.min.js b/src/_h5ai/js/lib/jquery-1.8.0.min.js deleted file mode 100644 index f121291c..00000000 --- a/src/_h5ai/js/lib/jquery-1.8.0.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v@1.8.0 jquery.com | jquery.org/license */ -(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.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):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
            a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
            t
            ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
            ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
            ",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

            ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
            ","
            "],thead:[1,"","
            "],tr:[2,"","
            "],td:[3,"","
            "],col:[2,"","
            "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
            ","
            "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
            ").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[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","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/src/_h5ai/js/lib/jquery-1.8.1.min.js b/src/_h5ai/js/lib/jquery-1.8.1.min.js new file mode 100644 index 00000000..e7f2a292 --- /dev/null +++ b/src/_h5ai/js/lib/jquery-1.8.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v@1.8.1 jquery.com | jquery.org/license */ +(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.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):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
            a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
            t
            ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
            ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0),h[l]&&j.push(k);j.length&&t.push({elem:f,matches:j})}n.length>o&&t.push({elem:this,matches:n.slice(o)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function $(a,b,c,d){c=c||[],b=b||q;var e,f,g,j,k=b.nodeType;if(k!==1&&k!==9)return[];if(!a||typeof a!="string")return c;g=h(b);if(!g&&!d)if(e=L.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&i(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return u.apply(c,t.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&X&&b.getElementsByClassName)return u.apply(c,t.call(b.getElementsByClassName(j),0)),c}return bk(a,b,c,d,g)}function _(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function ba(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bb(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bc(a,b,c,d){var e,g,h,i,j,k,l,m,n,p,r=!c&&b!==q,s=(r?"":"")+a.replace(H,"$1"),u=y[o][s];if(u)return d?0:t.call(u,0);j=a,k=[],m=0,n=f.preFilter,p=f.filter;while(j){if(!e||(g=I.exec(j)))g&&(j=j.slice(g[0].length),h.selector=l),k.push(h=[]),l="",r&&(j=" "+j);e=!1;if(g=J.exec(j))l+=g[0],j=j.slice(g[0].length),e=h.push({part:g.pop().replace(H," "),string:g[0],captures:g});for(i in p)(g=S[i].exec(j))&&(!n[i]||(g=n[i](g,b,c)))&&(l+=g[0],j=j.slice(g[0].length),e=h.push({part:i,string:g.shift(),captures:g}));if(!e)break}return l&&(h.selector=l),d?j.length:j?$.error(a):t.call(y(s,k),0)}function bd(a,b,e,f){var g=b.dir,h=s++;return a||(a=function(a){return a===e}),b.first?function(b){while(b=b[g])if(b.nodeType===1)return a(b)&&b}:f?function(b){while(b=b[g])if(b.nodeType===1&&a(b))return b}:function(b){var e,f=h+"."+c,i=f+"."+d;while(b=b[g])if(b.nodeType===1){if((e=b[o])===i)return b.sizset;if(typeof e=="string"&&e.indexOf(f)===0){if(b.sizset)return b}else{b[o]=i;if(a(b))return b.sizset=!0,b;b.sizset=!1}}}}function be(a,b){return a?function(c){var d=b(c);return d&&a(d===!0?c:d)}:b}function bf(a,b,c){var d,e,g=0;for(;d=a[g];g++)f.relative[d.part]?e=bd(e,f.relative[d.part],b,c):e=be(e,f.filter[d.part].apply(null,d.captures.concat(b,c)));return e}function bg(a){return function(b){var c,d=0;for(;c=a[d];d++)if(c(b))return!0;return!1}}function bh(a,b,c,d){var e=0,f=b.length;for(;e0?i(h,c,g):[]}function bj(a,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s=0,t=a.length,v=S.POS,w=new RegExp("^"+v.source+"(?!"+A+")","i"),x=function(){var a=1,c=arguments.length-2;for(;al){g+=k.slice(l,n.index),l=p,q=[c],J.test(g)&&(m&&(q=m),m=e);if(r=O.test(g))g=g.slice(0,-5).replace(J,"$&*"),l++;n.length>1&&n[0].replace(w,x),m=bi(g,n[1],n[2],q,m,r)}g=""}}o||(g+=k),o=!1}g?J.test(g)?bh(g,m||[c],d,e):$(g,c,d,e?e.concat(m):m):u.apply(d,m)}return t===1?d:$.uniqueSort(d)}function bk(a,b,e,g,h){a=a.replace(H,"$1");var i,k,l,m,n,o,p,q,r,s,v=bc(a,b,h),w=b.nodeType;if(S.POS.test(a))return bj(v,b,e,g);if(g)i=t.call(g,0);else if(v.length===1){if((o=t.call(v[0],0)).length>2&&(p=o[0]).part==="ID"&&w===9&&!h&&f.relative[o[1].part]){b=f.find.ID(p.captures[0].replace(R,""),b,h)[0];if(!b)return e;a=a.slice(o.shift().string.length)}r=(v=N.exec(o[0].string))&&!v.index&&b.parentNode||b,q="";for(n=o.length-1;n>=0;n--){p=o[n],s=p.part,q=p.string+q;if(f.relative[s])break;if(f.order.test(s)){i=f.find[s](p.captures[0].replace(R,""),r,h);if(i==null)continue;a=a.slice(0,a.length-q.length)+q.replace(S[s],""),a||u.apply(e,t.call(i,0));break}}}if(a){k=j(a,b,h),c=k.dirruns++,i==null&&(i=f.find.TAG("*",N.test(a)&&b.parentNode||b));for(n=0;m=i[n];n++)d=k.runs++,k(m)&&e.push(m)}return e}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=a.document,r=q.documentElement,s=0,t=[].slice,u=[].push,v=function(a,b){return a[o]=b||!0,a},w=function(){var a={},b=[];return v(function(c,d){return b.push(c)>f.cacheLength&&delete a[b.shift()],a[c]=d},a)},x=w(),y=w(),z=w(),A="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",C=B.replace("w","w#"),D="([*^$|!~]?=)",E="\\["+A+"*("+B+")"+A+"*(?:"+D+A+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+C+")|)|)"+A+"*\\]",F=":("+B+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+E+")|[^:]|\\\\.)*|.*))\\)|)",G=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",H=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g"),I=new RegExp("^"+A+"*,"+A+"*"),J=new RegExp("^"+A+"*([\\x20\\t\\r\\n\\f>+~])"+A+"*"),K=new RegExp(F),L=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,M=/^:not/,N=/[\x20\t\r\n\f]*[+~]/,O=/:not\($/,P=/h\d/i,Q=/input|select|textarea|button/i,R=/\\(?!\\)/g,S={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+E),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),POS:new RegExp(G,"ig"),needsContext:new RegExp("^"+A+"*[>+~]|"+G,"i")},T=function(a){var b=q.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},U=T(function(a){return a.appendChild(q.createComment("")),!a.getElementsByTagName("*").length}),V=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),W=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),X=T(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),Y=T(function(a){a.id=o+0,a.innerHTML="
            ",r.insertBefore(a,r.firstChild);var b=q.getElementsByName&&q.getElementsByName(o).length===2+q.getElementsByName(o+0).length;return e=!q.getElementById(o),r.removeChild(a),b});try{t.call(r.childNodes,0)[0].nodeType}catch(Z){t=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}$.matches=function(a,b){return $(a,null,null,b)},$.matchesSelector=function(a,b){return $(b,null,null,[a]).length>0},g=$.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=g(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=g(b);return c},h=$.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},i=$.contains=r.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:r.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},$.attr=function(a,b){var c,d=h(a);return d||(b=b.toLowerCase()),f.attrHandle[b]?f.attrHandle[b](a):W||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},f=$.selectors={cacheLength:50,createPseudo:v,match:S,order:new RegExp("ID|TAG"+(Y?"|NAME":"")+(X?"|CLASS":"")),attrHandle:V?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:e?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:U?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(R,""),a[3]=(a[4]||a[5]||"").replace(R,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||$.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&$.error(a[0]),a},PSEUDO:function(a,b,c){var d,e;if(S.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(d=a[4])K.test(d)&&(e=bc(d,b,c,!0))&&(e=d.indexOf(")",d.length-e)-d.length)&&(d=d.slice(0,e),a[0]=a[0].slice(0,e)),a[2]=d;return a.slice(0,3)}},filter:{ID:e?function(a){return a=a.replace(R,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(R,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(R,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=x[o][a];return b||(b=x(a,new RegExp("(^|"+A+")"+a+"("+A+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=$.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return $.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=s++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[o]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[o]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e,g=f.pseudos[a]||f.pseudos[a.toLowerCase()];return g||$.error("unsupported pseudo: "+a),g[o]?g(b,c,d):g.length>1?(e=[a,a,"",b],function(a){return g(a,0,e)}):g}},pseudos:{not:v(function(a,b,c){var d=j(a.replace(H,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!f.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:v(function(a){return function(b){return(b.textContent||b.innerText||g(b)).indexOf(a)>-1}}),has:v(function(a){return function(b){return $(a,b).length>0}}),header:function(a){return P.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:_("radio"),checkbox:_("checkbox"),file:_("file"),password:_("password"),image:_("image"),submit:ba("submit"),reset:ba("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return Q.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e",a.querySelectorAll("[selected]").length||e.push("\\["+A+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

            ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+A+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bk=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return u.apply(f,t.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j,k,l,m=d.getAttribute("id"),n=m||o,p=N.test(a)&&d.parentNode||d;m?n=n.replace(c,"\\$&"):d.setAttribute("id",n),j=bc(a,d,h),n="[id='"+n+"']";for(k=0,l=j.length;k0})}(),f.setFilters.nth=f.setFilters.eq,f.filters=f.pseudos,$.attr=p.attr,p.find=$,p.expr=$.selectors,p.expr[":"]=p.expr.pseudos,p.unique=$.uniqueSort,p.text=$.getText,p.isXMLDoc=$.isXML,p.contains=$.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
            ","
            "],thead:[1,"","
            "],tr:[2,"","
            "],td:[3,"","
            "],col:[2,"","
            "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
            ","
            "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{cj=f.href}catch(cy){cj=e.createElement("a"),cj.href="",cj=cj.href}ck=ct.exec(cj.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
            ").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:cj,isLocal:cn.test(ck[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","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,ck[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==ck[1]&&i[2]==ck[2]&&(i[3]||(i[1]==="http:"?80:443))==(ck[3]||(ck[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cQ.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/src/_h5ai/js/lib/modernizr-2.6.1.min.js b/src/_h5ai/js/lib/modernizr-2.6.1.min.js deleted file mode 100644 index 4ccdbe86..00000000 --- a/src/_h5ai/js/lib/modernizr-2.6.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* 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/js/lib/modernizr-2.6.2.min.js b/src/_h5ai/js/lib/modernizr-2.6.2.min.js new file mode 100644 index 00000000..03d3b429 --- /dev/null +++ b/src/_h5ai/js/lib/modernizr-2.6.2.min.js @@ -0,0 +1,4 @@ +/* Modernizr 2.6.2 (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.2",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,typeof f!="undefined"&&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/js/lib/spin-1.2.5.min.js b/src/_h5ai/js/lib/spin-1.2.5.min.js deleted file mode 100644 index 7c1a54b6..00000000 --- a/src/_h5ai/js/lib/spin-1.2.5.min.js +++ /dev/null @@ -1,19 +0,0 @@ -//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>1):parseInt(n.left,10)+i)+"px",top:(n.top=="auto"?a.y-u.y+(e.offsetHeight>>1):parseInt(n.top,10)+i)+"px"})),r.setAttribute("aria-role","progressbar"),t.lines(r,t.opts);if(!s){var f=0,l=n.fps,h=l/n.speed,d=(1-n.opacity)/(h*n.trail/100),v=h/n.lines;(function m(){f++;for(var e=n.lines;e;e--){var i=Math.max(1-(f+e*v)%h*d,n.opacity);t.opacity(r,n.lines-e,i,n)}t.timeout=t.el&&setTimeout(m,~~(1e3/l))})()}return t},stop:function(){var e=this.el;return e&&(clearTimeout(this.timeout),e.parentNode&&e.parentNode.removeChild(e),this.el=n),this},lines:function(e,t){function i(e,r){return c(o(),{position:"absolute",width:t.length+t.width+"px",height:t.width+"px",background:e,boxShadow:r,transformOrigin:"left",transform:"rotate("+~~(360/t.lines*n+t.rotate)+"deg) translate("+t.radius+"px"+",0)",borderRadius:(t.corners*t.width>>1)+"px"})}var n=0,r;for(;n',t)}var t=c(o("group"),{behavior:"url(#default#VML)"});!l(t,"transform")&&t.adj?(a.addRule(".spin-vml","behavior:url(#default#VML)"),v.prototype.lines=function(t,n){function s(){return c(e("group",{coordsize:i+" "+i,coordorigin:-r+" "+ -r}),{width:i,height:i})}function l(t,i,o){u(a,u(c(s(),{rotation:360/n.lines*t+"deg",left:~~i}),u(c(e("roundrect",{arcsize:n.corners}),{width:r,height:n.width,left:n.radius,top:-n.width>>1,filter:o}),e("fill",{color:n.color,opacity:n.opacity}),e("stroke",{opacity:0}))))}var r=n.length+n.width,i=2*r,o=-(n.width+n.length)*2+"px",a=c(s(),{position:"absolute",top:o,left:o}),f;if(n.shadow)for(f=1;f<=n.lines;f++)l(f,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(f=1;f<=n.lines;f++)l(f);return u(t,a)},v.prototype.opacity=function(e,t,n,r){var i=e.firstChild;r=r.shadow&&r.lines||0,i&&t+r Date: Fri, 14 Sep 2012 09:59:52 +0200 Subject: [PATCH 065/143] Adds missing jQuery.spin plugin. --- src/_h5ai/js/lib/jquery.spin-1.2.6.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/_h5ai/js/lib/jquery.spin-1.2.6.js diff --git a/src/_h5ai/js/lib/jquery.spin-1.2.6.js b/src/_h5ai/js/lib/jquery.spin-1.2.6.js new file mode 100644 index 00000000..faa9a8dd --- /dev/null +++ b/src/_h5ai/js/lib/jquery.spin-1.2.6.js @@ -0,0 +1,21 @@ + +(function ($) { + + $.fn.spin = function (options) { + + return this.each(function () { + + var $this = $(this), + data = $this.data(); + + if (data.spinner) { + data.spinner.stop(); + delete data.spinner; + } + + if (options !== false) { + data.spinner = new Spinner($.extend({color: $this.css('color')}, options)).spin(this); + } + }); + }; +}(jQuery)); From 1aec23008e9115231b30799a62153d7b47d13fee Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 14 Sep 2012 15:32:33 +0200 Subject: [PATCH 066/143] Fixes piwik-analytics extension. --- README.md | 3 +- src/_h5ai/config.js | 3 +- src/_h5ai/js/inc/ext/piwik-analytics.js | 71 ++++++++++++------------- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 3cff84ac..cf9a7ab8 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,7 @@ Run `makejs -t` to list all possible targets. * localization now in separate files * updates translations * adds `he` translation by [Tomer Cohen](https://github.com/tomer) -* updates [jQuery](http://jquery.com) to 1.8.0 -* updates [HTML5 ★ Boilerplate](http://html5boilerplate.com) to 4.0.0 +* updates 3rd party libs ### v0.21 - *2012-08-06* diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 603235ea..6e028073 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -195,10 +195,11 @@ var H5AI_CONFIG = { /* [all] Adds Piwik tracker javascript code. + baseURL without protocol */ "piwik-analytics": { "enabled": false, - "baseURL": "mydomain.tld/piwik", /* no protocol */ + "baseURL": "mydomain.tld/piwik", "idSite": 1 }, diff --git a/src/_h5ai/js/inc/ext/piwik-analytics.js b/src/_h5ai/js/inc/ext/piwik-analytics.js index e56d9ad4..dd73f890 100755 --- a/src/_h5ai/js/inc/ext/piwik-analytics.js +++ b/src/_h5ai/js/inc/ext/piwik-analytics.js @@ -1,38 +1,33 @@ - -modulejs.define('ext/piwik-analytics', ['_', 'core/settings'], function (_, allsettings) { - - var defaults = { - enabled: false, - "baseURL": "not-set", - "idSite": 0 - }, - - template = function(baseURL, idSite) { - - return '' - } - - settings = _.extend({}, defaults, allsettings['piwik-analytics']), - - init = function () { - - if (!settings.enabled) { - return; - } - - var $body = $('body'); - - $body.append(template(settings.baseURL, settings.idSite)); - }; - - init(); -}); + +modulejs.define('ext/piwik-analytics', ['_', '$', 'core/settings'], function (_, $, allsettings) { + + var defaults = { + enabled: false, + baseURL: 'not-set', + idSite: 0 + }, + + settings = _.extend({}, defaults, allsettings['piwik-analytics']), + + init = function () { + + if (!settings.enabled) { + return; + } + + // reference: http://piwik.org/docs/javascript-tracking/ + + var pkBaseURL = (("https:" === document.location.protocol) ? "https://" : "http://") + settings.baseURL + '/'; + + $('