Cleans js templates.

This commit is contained in:
Lars Jung 2012-09-16 17:14:42 +02:00
parent 01d152ede5
commit aa92ab9e83
17 changed files with 67 additions and 97 deletions

View File

@ -57,6 +57,10 @@
.sep {
display: inline-block;
padding: 0 6px;
&:before {
content: '·'
}
}
&.default {
}

View File

@ -9,12 +9,12 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/
template = '<li class="crumb">' +
'<a>' +
'<img src="' + resource.image('crumb') + '" alt=">" />' +
'<span />' +
'<img src="' + resource.image('crumb') + '" alt=">"/>' +
'<span/>' +
'</a>' +
'</li>',
pageHintTemplate = '<img class="hint" src="' + resource.image('page') + '" alt="has index page" />',
statusHintTemplate = '<span class="hint"></span>',
pageHintTemplate = '<img class="hint" src="' + resource.image('page') + '" alt="has index page"/>',
statusHintTemplate = '<span class="hint"/>',
// updates the crumb for this single entry
update = function (entry, force) {

View File

@ -9,13 +9,13 @@ modulejs.define('ext/delete', ['_', '$', 'core/settings', 'core/entry', 'core/ev
deleteBtnTemplate = '<li id="delete">' +
'<a href="#">' +
'<img src="' + resource.image('delete') + '" alt="delete" />' +
'<img src="' + resource.image('delete') + '" alt="delete"/>' +
'<span class="l10n-delete">delete</span>' +
'</a>' +
'</li>',
authTemplate = '<div id="delete-auth">' +
'<input id="delete-auth-user" type="text" value="" placeholder="user" />' +
'<input id="delete-auth-password" type="text" value="" placeholder="password" />' +
'<input id="delete-auth-user" type="text" value="" placeholder="user"/>' +
'<input id="delete-auth-password" type="text" value="" placeholder="password"/>' +
'</div>',
selectedHrefsStr = '',

View File

@ -13,13 +13,13 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
downloadBtnTemplate = '<li id="download">' +
'<a href="#">' +
'<img src="' + resource.image('download') + '" alt="download" />' +
'<img src="' + resource.image('download') + '" alt="download"/>' +
'<span class="l10n-download">download</span>' +
'</a>' +
'</li>',
authTemplate = '<div id="download-auth">' +
'<input id="download-auth-user" type="text" value="" placeholder="user" />' +
'<input id="download-auth-password" type="text" value="" placeholder="password" />' +
'<input id="download-auth-user" type="text" value="" placeholder="user"/>' +
'<input id="download-auth-password" type="text" value="" placeholder="password"/>' +
'</div>',
selectedHrefsStr = '',

View File

@ -12,9 +12,9 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/entry', 'core/r
template = '<ul id="uploads" />',
uploadTemplate = '<li class="upload clearfix">' +
'<span class="name"></span>' +
'<span class="size"></span>' +
'<div class="progress"><div class="bar"></div></div>' +
'<span class="name"/>' +
'<span class="size"/>' +
'<div class="progress"><div class="bar"/></div>' +
'</li>',
init = function () {

View File

@ -9,11 +9,11 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], func
template = '<li id="filter">' +
'<span class="element">' +
'<img src="' + resource.image('filter') + '" alt="filter" />' +
'<input type="text" value="" placeholder="filter" />' +
'<img src="' + resource.image('filter') + '" alt="filter"/>' +
'<input type="text" value="" placeholder="filter"/>' +
'</span>' +
'</li>',
noMatchTemplate = '<div class="no-match l10n-noMatch">no match</div>',
noMatchTemplate = '<div class="no-match l10n-noMatch"/>',
$filter, $input, $noMatch,

View File

@ -30,9 +30,9 @@ modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/form
template = '<span id="langSelector">' +
'<span class="lang">en</span> - <span class="l10n-lang">english</span>' +
'<span class="langOptions"> <ul /> </span>' +
'<span class="langOptions"><ul/></span>' +
'</span>',
langOptionTemplate = '<li class="langOption" />',
langOptionTemplate = '<li class="langOption"/>',
storekey = 'h5ai.language',

View File

@ -10,22 +10,22 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
template = '<div id="pv-img-overlay" class="noSelection">' +
'<div id="pv-img-content">' +
'<img id="pv-img-image" />' +
'<img id="pv-img-image"/>' +
'</div>' +
'<div id="pv-img-close" />' +
'<div id="pv-img-prev" />' +
'<div id="pv-img-next" />' +
'<div id="pv-img-close"/>' +
'<div id="pv-img-prev"/>' +
'<div id="pv-img-next"/>' +
'<div id="pv-img-bottombar" class="clearfix">' +
'<ul id="pv-img-buttons">' +
'<li id="pv-img-bar-size" class="bar-left bar-label"></li>' +
'<li id="pv-img-bar-percent" class="bar-left bar-label"></li>' +
'<li id="pv-img-bar-label" class="bar-left bar-label"></li>' +
'<li id="pv-img-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '" /></li>' +
'<li id="pv-img-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '" /></a></li>' +
'<li id="pv-img-bar-fullscreen" class="bar-right bar-button"><img src="' + resource.image('preview/fullscreen') + '" /></li>' +
'<li id="pv-img-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '" /></li>' +
'<li id="pv-img-bar-idx" class="bar-right bar-label"></li>' +
'<li id="pv-img-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '" /></li>' +
'<li id="pv-img-bar-size" class="bar-left bar-label"/>' +
'<li id="pv-img-bar-percent" class="bar-left bar-label"/>' +
'<li id="pv-img-bar-label" class="bar-left bar-label"/>' +
'<li id="pv-img-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '"/></li>' +
'<li id="pv-img-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '"/></a></li>' +
'<li id="pv-img-bar-fullscreen" class="bar-right bar-button"><img src="' + resource.image('preview/fullscreen') + '"/></li>' +
'<li id="pv-img-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '"/></li>' +
'<li id="pv-img-bar-idx" class="bar-right bar-label"/>' +
'<li id="pv-img-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '"/></li>' +
'</ul>' +
'</div>' +
'</div>',

View File

@ -31,25 +31,25 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource',
settings = _.extend({}, defaults, allsettings['preview-txt']),
template = '<div id="pv-txt-overlay" class="noSelection">' +
'<div id="pv-txt-close" />' +
'<div id="pv-txt-close"/>' +
'<div id="pv-txt-content">' +
'<div id="pv-txt-text" />' +
'<div id="pv-txt-text"/>' +
'</div>' +
'<div id="pv-txt-bottombar" class="clearfix">' +
'<ul id="pv-txt-buttons">' +
'<li id="pv-txt-bar-size" class="bar-left bar-label"></li>' +
'<li id="pv-txt-bar-label" class="bar-left bar-label"></li>' +
'<li id="pv-txt-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '" /></li>' +
'<li id="pv-txt-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '" /></a></li>' +
'<li id="pv-txt-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '" /></li>' +
'<li id="pv-txt-bar-idx" class="bar-right bar-label"></li>' +
'<li id="pv-txt-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '" /></li>' +
'<li id="pv-txt-bar-size" class="bar-left bar-label"/>' +
'<li id="pv-txt-bar-label" class="bar-left bar-label"/>' +
'<li id="pv-txt-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '"/></li>' +
'<li id="pv-txt-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '"/></a></li>' +
'<li id="pv-txt-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '"/></li>' +
'<li id="pv-txt-bar-idx" class="bar-right bar-label"/>' +
'<li id="pv-txt-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '"/></li>' +
'</ul>' +
'</div>' +
'</div>',
templateText = '<pre id="pv-txt-text" />',
templateMarkdown = '<div id="pv-txt-text" class="markdown" />',
templateText = '<pre id="pv-txt-text"/>',
templateMarkdown = '<div id="pv-txt-text" class="markdown"/>',
currentEntries = [],
currentIdx = 0,

View File

@ -8,7 +8,7 @@ modulejs.define('ext/qrcode', ['_', '$', 'modernizr', 'core/settings', 'core/eve
settings = _.extend({}, defaults, allsettings.qrcode),
template = '<div id="qrcode"></div>',
template = '<div id="qrcode"/>',
$qrcode, hideTimeoutId,

View File

@ -11,7 +11,7 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio
l = 0, t = 0, w = 0, h = 0,
shrink = 1/3,
$document = $(document),
$selectionRect = $('<div id="selection-rect"></div>'),
$selectionRect = $('<div id="selection-rect"/>'),
publish = function () {

View File

@ -9,13 +9,13 @@ modulejs.define('ext/statusbar', ['_', '$', 'core/settings', 'core/format', 'cor
template = '<span class="statusbar">' +
'<span class="status default">' +
'<span class="folderTotal"></span> <span class="l10n-folders">folders</span>' +
'<span class="sep">·</span>' +
'<span class="fileTotal"></span> <span class="l10n-files">files</span>' +
'<span class="folderTotal"/> <span class="l10n-folders"/>' +
'<span class="sep"/>' +
'<span class="fileTotal"/> <span class="l10n-files"/>' +
'</span>' +
'<span class="status dynamic"></span>' +
'<span class="status dynamic"/>' +
'</span>',
sepTemplate = '<span class="sep">·</span>',
sepTemplate = '<span class="sep"/>',
$statusDynamic,
$statusDefault,

View File

@ -10,14 +10,14 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e
template = '<div class="entry">' +
'<span class="indicator none">' +
'<img src="' + resource.image('tree') + '" />' +
'<img src="' + resource.image('tree') + '"/>' +
'</span>' +
'<a>' +
'<span class="icon"><img /></span>' +
'<span class="label"></span>' +
'<span class="icon"><img/></span>' +
'<span class="label"/>' +
'</a>' +
'</span>',
statusHintTemplate = '<span class="hint"></span>',
statusHintTemplate = '<span class="hint"/>',
// updates the tree for this single entry
update = function (entry) {

View File

@ -11,23 +11,23 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
template = '<li class="entry">' +
'<a>' +
'<span class="icon small"><img /></span>' +
'<span class="icon big"><img /></span>' +
'<span class="label" />' +
'<span class="date" />' +
'<span class="size" />' +
'<span class="icon small"><img/></span>' +
'<span class="icon big"><img/></span>' +
'<span class="label"/>' +
'<span class="date"/>' +
'<span class="size"/>' +
'</a>' +
'</li>',
hintTemplate = '<span class="hint"></span>',
hintTemplate = '<span class="hint"/>',
listTemplate = '<ul>' +
'<li class="header">' +
'<a class="icon"></a>' +
'<a class="icon"/>' +
'<a class="label" href="#"><span class="l10n-name"></span></a>' +
'<a class="date" href="#"><span class="l10n-lastModified"></span></a>' +
'<a class="size" href="#"><span class="l10n-size"></span></a>' +
'</li>' +
'</ul>',
emptyTemplate = '<div class="empty l10n-empty">empty</div>',
emptyTemplate = '<div class="empty l10n-empty"/>',
// updates this single entry
update = function (entry, force) {

View File

@ -12,8 +12,8 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
template = '<li id="view-[MODE]" class="view">' +
'<a href="#">' +
'<img src="' + resource.image('view-[MODE]') + '" alt="view-[MODE]" />' +
'<span class="l10n-[MODE]">[MODE]</span>' +
'<img src="' + resource.image('view-[MODE]') + '" alt="view-[MODE]"/>' +
'<span class="l10n-[MODE]"/>' +
'</a>' +
'</li>',

View File

@ -1,17 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d<c.9;d++)i[c[d]]=a}2 o(c){1 a=r.H("J"),d=3;a.K=c;a.M="L/t";a.G="t";a.u=a.v=2(){6(!d&&(!8.7||8.7=="F"||8.7=="z")){d=q;e[c]=q;a:{4(1 p y e)6(e[p]==3)B a;j&&5.C(k)}a.u=a.v=x;a.D.O(a)}};r.N.R(a)}1 f=Q,l=h.P(),i={},e={},j=3,k=x,b;5.T=2(c){k=c;j=q};4(b=0;b<f.9;b++){1 m=f[b].w?f[b]:f[b].S(/\\s+/),g=m.w();n(m,g)}4(b=0;b<l.9;b++)6(g=i[l[b].E.A]){e[g]=3;o(g)}}})();',56,56,'|var|function|false|for|SyntaxHighlighter|if|readyState|this|length|||||||||||||||||true|document||javascript|onload|onreadystatechange|pop|null|in|complete|brush|break|highlight|parentNode|params|loaded|language|createElement|autoloader|script|src|text|type|body|removeChild|findElements|arguments|appendChild|split|all'.split('|'),0,{}))

View File

@ -1,17 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?<q>\\\\w+)\\\\]$","U"),i=1,p=0;p<a.7;p++)6((i=h.J(a[p]))!=1)2 i.q;2 1}(c,"G"),n)}},F:4(c,k,l,m,n,o){4 d(){9(3 a=H,b=0;b<a.7;b++)6(a[b]!==1){6(z a[b]=="L"&&a[b]!="")2 a[b]+"";6(z a[b]=="X"&&a[b].q!="")2 a[b].q+""}2 1}4 f(a,b,h){h=12.13(h);9(3 i=0;i<h.7;i++)h[i].V("15")==b&&a.Y(h[i])}3 g=[];f(g,c,"Z");f(g,c,"W");6(g.7!==0)9(c=0;c<g.7;c++){3 e=g[c],j=d(e.B["14"],e.10,e.B.v,e.v);6(j!==1){j=u.8.A(j,k,l,m,n,o);8.11(j,e)}}}};',62,68,'|null|return|var|function|defaults|if|length|SyntaxHighlighter|for|||||||||||||||||value|true|collapse|reverse|dp|language||first|line|typeof|parseParams|attributes|gutter|toolbar|toString|HighlightAll|firstline|arguments|split|exec|false|string|result|nocontrols|nogutter|brush|ruler|in|XRegExp|new|gi|getAttribute|textarea|object|push|pre|className|highlight|document|getElementsByTagName|class|name'.split('|'),0,{}))