init
This commit is contained in:
.gitignoreCHANGELOG.txtLICENSE-GPLLICENSE-MITREADME.mdgrunt.jsjquery.ui.datepicker-ru.jsmakezippackage.json
libs
bootstrap204
css
img
js
bootstrap211
css
img
js
bootstrap221
css
img
js
jquery-ui-1.9.1.custom
css
redmond
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_55_fbec88_40x100.pngui-bg_glass_75_d0e5f5_1x400.pngui-bg_glass_85_dfeffc_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_gloss-wave_55_5c9ccc_500x100.pngui-bg_inset-hard_100_f5f8f9_1x100.pngui-bg_inset-hard_100_fcfdfd_1x100.pngui-icons_217bc0_256x240.pngui-icons_2e83ff_256x240.pngui-icons_469bdd_256x240.pngui-icons_6da8d5_256x240.pngui-icons_cd0a0a_256x240.pngui-icons_d8e7f3_256x240.pngui-icons_f9bd01_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.csssmoothness
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_75_ffffff_40x100.pngui-bg_glass_55_fbf9ee_1x400.pngui-bg_glass_65_ffffff_1x400.pngui-bg_glass_75_dadada_1x400.pngui-bg_glass_75_e6e6e6_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_highlight-soft_75_cccccc_1x100.pngui-icons_222222_256x240.pngui-icons_2e83ff_256x240.pngui-icons_454545_256x240.pngui-icons_888888_256x240.pngui-icons_cd0a0a_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.cssjs
jquery-ui-datepicker
jquery
mockjax
poshytip
jquery.poshytip.jsjquery.poshytip.min.jsjquery.poshytip_corrected.js
tip-darkgray
tip-green
tip-skyblue
tip-twitter
tip-violet
tip-yellow
tip-yellowsimple
qunit
src
containers
editable-container.csseditable-container.jseditable-inline.jseditable-popover.jseditable-poshytip.jseditable-tooltip.js
editable-form
editable-form-bootstrap.jseditable-form-jqueryui.jseditable-form-utils.jseditable-form.csseditable-form.js
img
element
inputs
abstract.js
date
bootstrap-datepicker.jsdate.jsdatepicker.css
dateui.jsselect.jstext.jstextarea.jslocales
bootstrap-datepicker.bg.jsbootstrap-datepicker.br.jsbootstrap-datepicker.cs.jsbootstrap-datepicker.da.jsbootstrap-datepicker.de.jsbootstrap-datepicker.es.jsbootstrap-datepicker.fi.jsbootstrap-datepicker.fr.jsbootstrap-datepicker.id.jsbootstrap-datepicker.is.jsbootstrap-datepicker.it.jsbootstrap-datepicker.ja.jsbootstrap-datepicker.kr.jsbootstrap-datepicker.lt.jsbootstrap-datepicker.lv.jsbootstrap-datepicker.ms.jsbootstrap-datepicker.nb.jsbootstrap-datepicker.nl.jsbootstrap-datepicker.pl.jsbootstrap-datepicker.pt-BR.jsbootstrap-datepicker.pt.jsbootstrap-datepicker.ru.jsbootstrap-datepicker.sl.jsbootstrap-datepicker.sv.jsbootstrap-datepicker.th.jsbootstrap-datepicker.tr.jsbootstrap-datepicker.zh-CN.jsbootstrap-datepicker.zh-TW.js
test
126
test/loader.js
Normal file
126
test/loader.js
Normal file
@ -0,0 +1,126 @@
|
||||
/**
|
||||
* load requred js and css according to f (form) and c (container) parameters
|
||||
*/
|
||||
|
||||
function getFC() {
|
||||
var url = window.location.href, f, c;
|
||||
if(url.match(/f=jqueryui/i)) {
|
||||
f = 'jqueryui';
|
||||
} else if(url.match(/f=plain/i)) {
|
||||
f = 'plain';
|
||||
} else { //bootstrap
|
||||
f = 'bootstrap';
|
||||
}
|
||||
c = url.match(/c=inline/i) ? 'inline' : 'popup';
|
||||
return {f: f, c: c};
|
||||
}
|
||||
|
||||
function getAssets(f, c, src, libs) {
|
||||
var
|
||||
forms = src+'editable-form/',
|
||||
inputs = src+'inputs/',
|
||||
containers = src+'containers/',
|
||||
element = src+'element/',
|
||||
|
||||
bootstrap = libs+'bootstrap221/',
|
||||
jqueryui = libs+'jquery-ui-1.9.1.custom/',
|
||||
|
||||
js = [
|
||||
forms+'editable-form.js',
|
||||
forms+'editable-form-utils.js',
|
||||
containers+'editable-container.js',
|
||||
element+'editable-element.js',
|
||||
inputs+'abstract.js',
|
||||
inputs+'text.js',
|
||||
inputs+'textarea.js',
|
||||
inputs+'select.js'
|
||||
],
|
||||
|
||||
css = [
|
||||
forms+'editable-form.css',
|
||||
containers+'editable-container.css',
|
||||
element+'editable-element.css'
|
||||
];
|
||||
|
||||
|
||||
//tune js and css
|
||||
if(f==='jqueryui') {
|
||||
//core
|
||||
js.unshift(jqueryui+'js/jquery-ui-1.9.1.custom.js')
|
||||
css.unshift(jqueryui+'css/redmond/jquery-ui-1.9.1.custom.css');
|
||||
|
||||
//editable
|
||||
js.push(forms+'editable-form-jqueryui.js');
|
||||
js.push(getContainer('editable-tooltip.js'));
|
||||
|
||||
//date
|
||||
js.push(inputs+'dateui.js');
|
||||
|
||||
//style
|
||||
css.push('style.css');
|
||||
} else if(f==='plain') {
|
||||
//core
|
||||
js.unshift(libs+'poshytip/jquery.poshytip.js');
|
||||
css.unshift(libs+'poshytip/tip-yellowsimple/tip-yellowsimple.css');
|
||||
|
||||
//editable
|
||||
js.push(getContainer('editable-poshytip.js'));
|
||||
|
||||
//date
|
||||
js.push(inputs+'dateui.js');
|
||||
js.push(libs+'jquery-ui-datepicker/js/jquery-ui-1.9.1.custom.js');
|
||||
css.unshift(jqueryui+'css/redmond/jquery-ui-1.9.1.custom.css');
|
||||
|
||||
//style
|
||||
css.push('style.css');
|
||||
} else { //bootstrap
|
||||
//core
|
||||
js.unshift(bootstrap+'js/bootstrap.js')
|
||||
css.unshift(bootstrap+'css/bootstrap.css');
|
||||
|
||||
//editable
|
||||
js.push(forms+'editable-form-bootstrap.js');
|
||||
js.push(getContainer('editable-popover.js'));
|
||||
|
||||
//date
|
||||
js.push(inputs+'date/bootstrap-datepicker.js');
|
||||
js.push(inputs+'date/date.js');
|
||||
css.push(inputs+'date/datepicker.css');
|
||||
}
|
||||
|
||||
function getContainer(container) {
|
||||
return (c === 'inline') ? containers+'/editable-inline.js' : containers + container;
|
||||
}
|
||||
|
||||
js.push('main.js');
|
||||
|
||||
return {css: css, js: js};
|
||||
}
|
||||
|
||||
|
||||
function loadAssets(css, js) {
|
||||
for(var i = 0; i < css.length; i++) {
|
||||
loadCss(css[i]);
|
||||
}
|
||||
|
||||
for(i = 0; i < js.length; i++) {
|
||||
loadJs(js[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function loadCss(url) {
|
||||
var link = document.createElement("link");
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = url;
|
||||
document.getElementsByTagName("head")[0].appendChild(link);
|
||||
}
|
||||
|
||||
function loadJs(url) {
|
||||
//console.log(url);
|
||||
if(!url) return;
|
||||
var script = document.createElement("script");
|
||||
// script.src = url+'?'+Math.random(); //debug doesnot work with random
|
||||
script.src = url;
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
Reference in New Issue
Block a user