loader for bs3
This commit is contained in:
parent
5c5a24b86b
commit
0c1ea90005
@ -15,17 +15,19 @@ define(function () {
|
|||||||
loadCss: loadCss,
|
loadCss: loadCss,
|
||||||
getConfig: function (baseUrl) {
|
getConfig: function (baseUrl) {
|
||||||
|
|
||||||
|
var
|
||||||
|
params = this.getParams(),
|
||||||
|
f = params.f,
|
||||||
|
c = params.c;
|
||||||
|
|
||||||
var
|
var
|
||||||
jqueryui_ver = '1.10.3',
|
jqueryui_ver = '1.10.3',
|
||||||
// jqueryui_ver = '1.9.1',
|
// jqueryui_ver = '1.9.1',
|
||||||
bs_ver = '300',
|
bs2_ver = '232',
|
||||||
bs_major_ver = bs_ver.substr(0,1),
|
bs3_ver = '300',
|
||||||
|
//path aliases
|
||||||
paths = {
|
paths = {
|
||||||
// "bootstrap": "../test/libs/bootstrap221",
|
"bootstrap": "../test/libs/bootstrap"+(f === 'bootstrap2' ? bs2_ver : bs3_ver),
|
||||||
// "bootstrap": "../test/libs/bootstrap222",
|
|
||||||
// "bootstrap": "../test/libs/bootstrap231",
|
|
||||||
// "bootstrap": "../test/libs/bootstrap232",
|
|
||||||
"bootstrap": "../test/libs/bootstrap"+bs_ver,
|
|
||||||
|
|
||||||
// "jqueryui": "../test/libs/jquery-ui-"+jqueryui_ver+".custom",
|
// "jqueryui": "../test/libs/jquery-ui-"+jqueryui_ver+".custom",
|
||||||
"jqueryui_js": "../test/libs/jquery-ui-"+jqueryui_ver+".custom/js/jquery-ui-"+jqueryui_ver+".custom",
|
"jqueryui_js": "../test/libs/jquery-ui-"+jqueryui_ver+".custom/js/jquery-ui-"+jqueryui_ver+".custom",
|
||||||
@ -37,9 +39,6 @@ define(function () {
|
|||||||
"test": "../test"
|
"test": "../test"
|
||||||
},
|
},
|
||||||
|
|
||||||
params = this.getParams(),
|
|
||||||
f = params.f,
|
|
||||||
c = params.c,
|
|
||||||
shim = {
|
shim = {
|
||||||
'containers/editable-container': {
|
'containers/editable-container': {
|
||||||
deps: ['require', 'editable-form/editable-form-utils', 'editable-form/editable-form'],
|
deps: ['require', 'editable-form/editable-form-utils', 'editable-form/editable-form'],
|
||||||
@ -94,8 +93,8 @@ define(function () {
|
|||||||
deps: ['require'],
|
deps: ['require'],
|
||||||
init: function(require) {
|
init: function(require) {
|
||||||
loadCss(require.toUrl("../css/bootstrap.css"));
|
loadCss(require.toUrl("../css/bootstrap.css"));
|
||||||
//add responsive css
|
//add responsive css for bs2
|
||||||
if(bs_major_ver < 3) {
|
if(f === 'bootstrap2') {
|
||||||
loadCss(require.toUrl("../css/bootstrap-responsive.css"));
|
loadCss(require.toUrl("../css/bootstrap-responsive.css"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,9 +226,20 @@ define(function () {
|
|||||||
/*
|
/*
|
||||||
modify shim for bootstrap, jqueryui or plain
|
modify shim for bootstrap, jqueryui or plain
|
||||||
*/
|
*/
|
||||||
|
if(f === 'bootstrap3') {
|
||||||
if(f === 'bootstrap') {
|
//bootstrap 3
|
||||||
//bootstrap
|
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
|
||||||
|
[
|
||||||
|
'inputs/date/datefield',
|
||||||
|
'inputs/datetime/datetimefield'
|
||||||
|
//'inputs-ext/wysihtml5/wysihtml5',
|
||||||
|
//'inputs/typeahead'
|
||||||
|
]);
|
||||||
|
|
||||||
|
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap3');
|
||||||
|
shim['element/editable-element'].deps.push('containers/editable-popover3');
|
||||||
|
} else if(f === 'bootstrap2') {
|
||||||
|
//bootstrap 2
|
||||||
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
|
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
|
||||||
[
|
[
|
||||||
'inputs/date/datefield',
|
'inputs/date/datefield',
|
||||||
@ -237,9 +247,8 @@ define(function () {
|
|||||||
'inputs-ext/wysihtml5/wysihtml5',
|
'inputs-ext/wysihtml5/wysihtml5',
|
||||||
'inputs/typeahead'
|
'inputs/typeahead'
|
||||||
]);
|
]);
|
||||||
var suffix = bs_major_ver < 3 ? '' : bs_major_ver;
|
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap');
|
||||||
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap'+suffix);
|
shim['element/editable-element'].deps.push('containers/editable-popover');
|
||||||
shim['element/editable-element'].deps.push('containers/editable-popover'+suffix);
|
|
||||||
} else if(f === 'jqueryui') {
|
} else if(f === 'jqueryui') {
|
||||||
//jqueryui
|
//jqueryui
|
||||||
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateuifield');
|
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateuifield');
|
||||||
@ -270,8 +279,10 @@ define(function () {
|
|||||||
f = 'jqueryui';
|
f = 'jqueryui';
|
||||||
} else if(url.match(/f=plain/i)) {
|
} else if(url.match(/f=plain/i)) {
|
||||||
f = 'plain';
|
f = 'plain';
|
||||||
|
} else if(url.match(/f=bootstrap3/i) || url.match(/f=bs3/i)) {
|
||||||
|
f = 'bootstrap3';
|
||||||
} else {
|
} else {
|
||||||
f = 'bootstrap';
|
f = 'bootstrap2';
|
||||||
}
|
}
|
||||||
c = url.match(/c=inline/i) ? 'inline' : 'popup';
|
c = url.match(/c=inline/i) ? 'inline' : 'popup';
|
||||||
return {f: f, c: c};
|
return {f: f, c: c};
|
||||||
|
13
test/main.js
13
test/main.js
@ -41,7 +41,7 @@ require(["loader", jqurl], function(loader) {
|
|||||||
var custom;
|
var custom;
|
||||||
|
|
||||||
switch(params.f) {
|
switch(params.f) {
|
||||||
case 'bootstrap':
|
case 'bootstrap2':
|
||||||
custom = ['test/unit/datefield',
|
custom = ['test/unit/datefield',
|
||||||
'test/unit/date',
|
'test/unit/date',
|
||||||
'test/unit/datetimefield',
|
'test/unit/datetimefield',
|
||||||
@ -50,6 +50,17 @@ require(["loader", jqurl], function(loader) {
|
|||||||
'test/unit/typeahead'
|
'test/unit/typeahead'
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'bootstrap3':
|
||||||
|
custom = [
|
||||||
|
'test/unit/datefield',
|
||||||
|
'test/unit/date',
|
||||||
|
'test/unit/datetimefield',
|
||||||
|
'test/unit/datetime'
|
||||||
|
//'test/unit/wysihtml5'
|
||||||
|
//'test/unit/typeahead'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
custom = ['test/unit/dateuifield', 'test/unit/dateui'];
|
custom = ['test/unit/dateuifield', 'test/unit/dateui'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user