mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,31 +1,50 @@
|
|||
'use strict';
|
||||
define(['app', 'handlebars'], function (App,Handlebars) {
|
||||
Handlebars.registerHelper('formBuilder', function () {
|
||||
var ret = '';
|
||||
_.each(this.fields, function (field) {
|
||||
ret += NzbDrone.Form.FieldBuilder(field);
|
||||
define(
|
||||
[
|
||||
'handlebars'
|
||||
], function (Handlebars) {
|
||||
|
||||
var formBuilder = function (field) {
|
||||
if (!field.type) {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'password') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/PasswordTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/CheckboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'select') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/SelectTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('formBuilder', function () {
|
||||
var ret = '';
|
||||
_.each(this.fields, function (field) {
|
||||
ret += this.FieldBuilder(field);
|
||||
});
|
||||
|
||||
return new Handlebars.SafeString(ret);
|
||||
});
|
||||
|
||||
return new Handlebars.SafeString(ret);
|
||||
});
|
||||
|
||||
NzbDrone.Form.FieldBuilder = function (field) {
|
||||
if (!field.type) {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'password') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/PasswordTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/CheckboxTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'select') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/SelectTemplate']);
|
||||
}
|
||||
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue