web: include unminified source of all javascript, to help packagers (fixes #161)
This commit is contained in:
parent
3b8b3d234e
commit
b0b9e56a9d
@ -105,9 +105,9 @@ instance Yesod App where
|
||||
$(widgetFile "normalize")
|
||||
addStylesheet $ StaticR css_bootstrap_css
|
||||
-- load jquery early:
|
||||
toWidgetHead [hamlet| <script type="text/javascript" src="@{StaticR jquery_js}"></script> |]
|
||||
toWidgetHead [hamlet| <script type="text/javascript" src="@{StaticR jquery_min_js}"></script> |]
|
||||
addScript $ StaticR jquery_url_js
|
||||
addScript $ StaticR jquery_flot_js
|
||||
addScript $ StaticR jquery_flot_min_js
|
||||
toWidget [hamlet| \<!--[if lte IE 8]> <script type="text/javascript" src="@{StaticR excanvas_min_js}"></script> <![endif]--> |]
|
||||
addScript $ StaticR select2_min_js
|
||||
addStylesheet $ StaticR select2_css
|
||||
|
||||
@ -26,16 +26,20 @@ extra-source-files:
|
||||
config/routes
|
||||
static/css/bootstrap.css
|
||||
static/select2.css
|
||||
static/select2.js
|
||||
static/select2.min.js
|
||||
static/select2-spinner.gif
|
||||
static/select2.png
|
||||
static/excanvas.js
|
||||
static/excanvas.min.js
|
||||
static/favicon.ico
|
||||
static/hledger.js
|
||||
static/img/glyphicons-halflings-white.png
|
||||
static/img/glyphicons-halflings.png
|
||||
static/jquery.flot.js
|
||||
static/jquery.flot.min.js
|
||||
static/jquery.js
|
||||
static/jquery.min.js
|
||||
static/jquery.url.js
|
||||
static/style.css
|
||||
templates/default-layout.hamlet
|
||||
|
||||
9813
hledger-web/static/jquery.js
vendored
9813
hledger-web/static/jquery.js
vendored
File diff suppressed because one or more lines are too long
6
hledger-web/static/jquery.min.js
vendored
Normal file
6
hledger-web/static/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1,164 @@
|
||||
jQuery.url=function(){var segments={};var parsed={};var options={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var parseUri=function(){str=decodeURI(options.url);var m=options.parser[options.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[options.key[i]]=m[i]||""}uri[options.q.name]={};uri[options.key[12]].replace(options.q.parser,function($0,$1,$2){if($1){uri[options.q.name][$1]=$2}});return uri};var key=function(key){if(!parsed.length){setUp()}if(key=="base"){if(parsed.port!==null&&parsed.port!==""){return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/"}else{return parsed.protocol+"://"+parsed.host+"/"}}return(parsed[key]==="")?null:parsed[key]};var param=function(item){if(!parsed.length){setUp()}return(parsed.queryKey[item]===null)?null:parsed.queryKey[item]};var setUp=function(){parsed=parseUri();getSegments()};var getSegments=function(){var p=parsed.path;segments=[];segments=parsed.path.length==1?{}:(p.charAt(p.length-1)=="/"?p.substring(1,p.length-1):path=p.substring(1)).split("/")};return{setMode:function(mode){strictMode=mode=="strict"?true:false;return this},setUrl:function(newUri){options.url=newUri===undefined?window.location:newUri;setUp();return this},segment:function(pos){if(!parsed.length){setUp()}if(pos===undefined){return segments.length}return(segments[pos]===""||segments[pos]===undefined)?null:segments[pos]},attr:key,param:param}}();
|
||||
// JQuery URL Parser plugin - https://github.com/allmarkedup/jQuery-URL-Parser
|
||||
// Written by Mark Perkins, mark@allmarkedup.com
|
||||
// License: http://unlicense.org/ (i.e. do what you want with it!)
|
||||
|
||||
;(function($, undefined) {
|
||||
|
||||
var tag2attr = {
|
||||
a : 'href',
|
||||
img : 'src',
|
||||
form : 'action',
|
||||
base : 'href',
|
||||
script : 'src',
|
||||
iframe : 'src',
|
||||
link : 'href'
|
||||
},
|
||||
|
||||
key = ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"], // keys available to query
|
||||
|
||||
aliases = { "anchor" : "fragment" }, // aliases for backwards compatability
|
||||
|
||||
parser = {
|
||||
strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, //less intuitive, more accurate to the specs
|
||||
loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
|
||||
},
|
||||
|
||||
querystring_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, // supports both ampersand and semicolon-delimted query string key/value pairs
|
||||
|
||||
fragment_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; // supports both ampersand and semicolon-delimted fragment key/value pairs
|
||||
|
||||
function parseUri( url, strictMode )
|
||||
{
|
||||
var str = decodeURI( url ),
|
||||
res = parser[ strictMode || false ? "strict" : "loose" ].exec( str ),
|
||||
uri = { attr : {}, param : {}, seg : {} },
|
||||
i = 14;
|
||||
|
||||
while ( i-- )
|
||||
{
|
||||
uri.attr[ key[i] ] = res[i] || "";
|
||||
}
|
||||
|
||||
// build query and fragment parameters
|
||||
|
||||
uri.param['query'] = {};
|
||||
uri.param['fragment'] = {};
|
||||
|
||||
uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){
|
||||
if ($1)
|
||||
{
|
||||
uri.param['query'][$1] = $2;
|
||||
}
|
||||
});
|
||||
|
||||
uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){
|
||||
if ($1)
|
||||
{
|
||||
uri.param['fragment'][$1] = $2;
|
||||
}
|
||||
});
|
||||
|
||||
// split path and fragement into segments
|
||||
|
||||
uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
|
||||
|
||||
uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
|
||||
|
||||
// compile a 'base' domain attribute
|
||||
|
||||
uri.attr['base'] = uri.attr.host ? uri.attr.protocol+"://"+uri.attr.host + (uri.attr.port ? ":"+uri.attr.port : '') : '';
|
||||
|
||||
return uri;
|
||||
};
|
||||
|
||||
function getAttrName( elm )
|
||||
{
|
||||
var tn = elm.tagName;
|
||||
if ( tn !== undefined ) return tag2attr[tn.toLowerCase()];
|
||||
return tn;
|
||||
}
|
||||
|
||||
$.fn.url = function( strictMode )
|
||||
{
|
||||
var url = '';
|
||||
|
||||
if ( this.length )
|
||||
{
|
||||
url = $(this).attr( getAttrName(this[0]) ) || '';
|
||||
}
|
||||
|
||||
return $.url({ url : url, strict : strictMode });
|
||||
};
|
||||
|
||||
$.url = function( opts )
|
||||
{
|
||||
var url = '',
|
||||
strict = false;
|
||||
|
||||
if ( typeof opts === 'string' )
|
||||
{
|
||||
url = opts;
|
||||
}
|
||||
else
|
||||
{
|
||||
opts = opts || {};
|
||||
strict = opts.strict || strict;
|
||||
url = opts.url === undefined ? window.location.toString() : opts.url;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
data : parseUri(url, strict),
|
||||
|
||||
// get various attributes from the URI
|
||||
attr : function( attr )
|
||||
{
|
||||
attr = aliases[attr] || attr;
|
||||
return attr !== undefined ? this.data.attr[attr] : this.data.attr;
|
||||
},
|
||||
|
||||
// return query string parameters
|
||||
param : function( param )
|
||||
{
|
||||
return param !== undefined ? this.data.param.query[param] : this.data.param.query;
|
||||
},
|
||||
|
||||
// return fragment parameters
|
||||
fparam : function( param )
|
||||
{
|
||||
return param !== undefined ? this.data.param.fragment[param] : this.data.param.fragment;
|
||||
},
|
||||
|
||||
// return path segments
|
||||
segment : function( seg )
|
||||
{
|
||||
if ( seg === undefined )
|
||||
{
|
||||
return this.data.seg.path;
|
||||
}
|
||||
else
|
||||
{
|
||||
seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
|
||||
return this.data.seg.path[seg];
|
||||
}
|
||||
},
|
||||
|
||||
// return fragment segments
|
||||
fsegment : function( seg )
|
||||
{
|
||||
if ( seg === undefined )
|
||||
{
|
||||
return this.data.seg.fragment;
|
||||
}
|
||||
else
|
||||
{
|
||||
seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
|
||||
return this.data.seg.fragment[seg];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
3054
hledger-web/static/select2.js
Normal file
3054
hledger-web/static/select2.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user