mirror of
https://github.com/ansible/awx.git
synced 2026-07-28 08:29:55 -02:30
Applying jsHint standards to form-generator.js. Adding unminified jquery to facilitate debugging.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
||||||
|
|
||||||
.factory('GenerateForm', ['$rootScope', '$location', '$cookieStore', '$compile', 'SearchWidget', 'PaginateWidget', 'Attr',
|
.factory('GenerateForm', ['$rootScope', '$location', '$cookieStore', '$compile', 'SearchWidget', 'PaginateWidget', 'Attr',
|
||||||
'Icon', 'Column', 'NavigationLink', 'HelpCollapse', 'Button', 'DropDown', 'Empty', 'SelectIcon',
|
'Icon', 'Column', 'NavigationLink', 'HelpCollapse', 'Button', 'DropDown', 'Empty', 'SelectIcon',
|
||||||
function($rootScope, $location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink,
|
function($rootScope, $location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink,
|
||||||
@@ -30,7 +31,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
scope: null,
|
scope: null,
|
||||||
|
|
||||||
has: function(key) {
|
has: function(key) {
|
||||||
return (this.form[key] && this.form[key] != null && this.form[key] != undefined) ? true : false;
|
return (this.form[key] && this.form[key] !== null && this.form[key] !== undefined) ? true : false;
|
||||||
},
|
},
|
||||||
|
|
||||||
inject: function(form, options) {
|
inject: function(form, options) {
|
||||||
@@ -39,7 +40,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
// Returns scope of form.
|
// Returns scope of form.
|
||||||
//
|
//
|
||||||
|
|
||||||
var element;
|
var element, fld, set, show;
|
||||||
|
|
||||||
if (options.modal) {
|
if (options.modal) {
|
||||||
if (options.modal_body_id) {
|
if (options.modal_body_id) {
|
||||||
element = angular.element(document.getElementById(options.modal_body_id));
|
element = angular.element(document.getElementById(options.modal_body_id));
|
||||||
@@ -80,26 +82,26 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
|
|
||||||
if (!options.html) {
|
if (!options.html) {
|
||||||
// Reset the scope to prevent displaying old data from our last visit to this form
|
// Reset the scope to prevent displaying old data from our last visit to this form
|
||||||
for (var fld in form.fields) {
|
for (fld in form.fields) {
|
||||||
this.scope[fld] = null;
|
this.scope[fld] = null;
|
||||||
}
|
}
|
||||||
for (var set in form.related) {
|
for (set in form.related) {
|
||||||
this.scope[set] = null;
|
this.scope[set] = null;
|
||||||
}
|
}
|
||||||
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
|
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
|
||||||
this.addListeners();
|
this.addListeners();
|
||||||
}
|
}
|
||||||
if (options.mode == 'add') {
|
if (options.mode === 'add') {
|
||||||
this.applyDefaults();
|
this.applyDefaults();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any lingering tooltip and popover <div> elements
|
// Remove any lingering tooltip and popover <div> elements
|
||||||
$('.tooltip').each( function(index) {
|
$('.tooltip').each( function() {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.popover').each(function(index) {
|
$('.popover').each(function() {
|
||||||
// remove lingering popover <div>. Seems to be a bug in TB3 RC1
|
// remove lingering popover <div>. Seems to be a bug in TB3 RC1
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
@@ -108,13 +110,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
|
|
||||||
// Prepend an asterisk to required field label
|
// Prepend an asterisk to required field label
|
||||||
$('.form-control[required], input[type="radio"][required]').each(function() {
|
$('.form-control[required], input[type="radio"][required]').each(function() {
|
||||||
|
var label, span;
|
||||||
if ( Empty($(this).attr('aw-required-when')) ) {
|
if ( Empty($(this).attr('aw-required-when')) ) {
|
||||||
var label = $(this).parent().parent().find('label').first();
|
label = $(this).parent().parent().find('label').first();
|
||||||
if ($(this).attr('type') == 'radio') {
|
if ($(this).attr('type') === 'radio') {
|
||||||
label = $(this).parent().parent().parent().find('label').first();
|
label = $(this).parent().parent().parent().find('label').first();
|
||||||
}
|
}
|
||||||
if (label.length > 0) {
|
if (label.length > 0) {
|
||||||
var span = label.children('span');
|
span = label.children('span');
|
||||||
if (span.length > 0 && !span.first().hasClass('prepend-asterisk')) {
|
if (span.length > 0 && !span.first().hasClass('prepend-asterisk')) {
|
||||||
span.first().addClass('prepend-asterisk');
|
span.first().addClass('prepend-asterisk');
|
||||||
}
|
}
|
||||||
@@ -134,13 +137,13 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
|
|
||||||
if (options.modal) {
|
if (options.modal) {
|
||||||
this.scope.formModalActionDisabled = false;
|
this.scope.formModalActionDisabled = false;
|
||||||
this.scope.formModalInfo = false //Disable info button for default modal
|
this.scope.formModalInfo = false; //Disable info button for default modal
|
||||||
if (form) {
|
if (form) {
|
||||||
if (options.modal_title_id) {
|
if (options.modal_title_id) {
|
||||||
this.scope[options.modal_title_id] = (options.mode == 'add') ? form.addTitle : form.editTitle;
|
this.scope[options.modal_title_id] = (options.mode === 'add') ? form.addTitle : form.editTitle;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.scope.formModalHeader = (options.mode == 'add') ? form.addTitle : form.editTitle; //Default title for default modal
|
this.scope.formModalHeader = (options.mode === 'add') ? form.addTitle : form.editTitle; //Default title for default modal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.modal_selector) {
|
if (options.modal_selector) {
|
||||||
@@ -149,7 +152,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
$(options.modal_select + ' input:first').focus();
|
$(options.modal_select + ' input:first').focus();
|
||||||
});
|
});
|
||||||
$(options.modal_selector).on('hidden.bs.modal', function() {
|
$(options.modal_selector).on('hidden.bs.modal', function() {
|
||||||
$('.tooltip').each( function(index) {
|
$('.tooltip').each( function() {
|
||||||
// Remove any lingering tooltip and popover <div> elements
|
// Remove any lingering tooltip and popover <div> elements
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
@@ -161,7 +164,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var show = (options.show_modal == false) ? false : true;
|
show = (options.show_modal === false) ? false : true;
|
||||||
$('#form-modal').modal({ show: show, backdrop: 'static', keyboard: true });
|
$('#form-modal').modal({ show: show, backdrop: 'static', keyboard: true });
|
||||||
$('#form-modal').on('shown.bs.modal', function() {
|
$('#form-modal').on('shown.bs.modal', function() {
|
||||||
$('#form-modal input:first').focus();
|
$('#form-modal input:first').focus();
|
||||||
@@ -198,8 +201,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
|
|
||||||
applyDefaults: function() {
|
applyDefaults: function() {
|
||||||
for (var fld in this.form.fields) {
|
for (var fld in this.form.fields) {
|
||||||
if (this.form.fields[fld]['default'] || this.form.fields[fld]['default'] == 0) {
|
if (this.form.fields[fld].default || this.form.fields[fld].default === 0) {
|
||||||
if (this.form.fields[fld].type == 'select' && this.scope[fld + '_options']) {
|
if (this.form.fields[fld].type === 'select' && this.scope[fld + '_options']) {
|
||||||
this.scope[fld] = this.scope[fld + '_options'][this.form.fields[fld]['default']];
|
this.scope[fld] = this.scope[fld + '_options'][this.form.fields[fld]['default']];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -213,17 +216,16 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
// The form field values cannot be reset with jQuery. Each field is tied to a model, so to clear the field
|
// The form field values cannot be reset with jQuery. Each field is tied to a model, so to clear the field
|
||||||
// value, you have to clear the model.
|
// value, you have to clear the model.
|
||||||
|
|
||||||
if (this.scope[this.form.name + '_form']) {
|
var fld, scope = this.scope, form = this.form;
|
||||||
this.scope[this.form.name + '_form'].$setPristine();
|
|
||||||
}
|
|
||||||
|
|
||||||
var scope = this.scope;
|
if (scope[form.name + '_form']) {
|
||||||
var form = this.form;
|
scope[form.name + '_form'].$setPristine();
|
||||||
|
}
|
||||||
|
|
||||||
function resetField(f, fld) {
|
function resetField(f, fld) {
|
||||||
// f is the field object, fld is the key
|
// f is the field object, fld is the key
|
||||||
|
|
||||||
if (f.type == 'checkbox_group') {
|
if (f.type === 'checkbox_group') {
|
||||||
for (var i=0; i < f.fields.length; i++) {
|
for (var i=0; i < f.fields.length; i++) {
|
||||||
scope[f.fields[i].name] = '';
|
scope[f.fields[i].name] = '';
|
||||||
scope[f.fields[i].name + '_api_error'] = '';
|
scope[f.fields[i].name + '_api_error'] = '';
|
||||||
@@ -241,7 +243,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setValidity('apiError', true);
|
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setValidity('apiError', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (f.type == 'lookup' && scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField]) {
|
if (f.type === 'lookup' && scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField]) {
|
||||||
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setPristine();
|
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setPristine();
|
||||||
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setValidity('apiError', true);
|
scope[form.name + '_form'][f.sourceModel + '_' + f.sourceField].$setValidity('apiError', true);
|
||||||
}
|
}
|
||||||
@@ -261,15 +263,15 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var fld in form.fields) {
|
for (fld in form.fields) {
|
||||||
resetField(form.fields[fld], fld);
|
resetField(form.fields[fld], fld);
|
||||||
}
|
}
|
||||||
if (form.statusFields) {
|
if (form.statusFields) {
|
||||||
for (var fld in form.statusFields) {
|
for (fld in form.statusFields) {
|
||||||
resetField(form.statusFields[fld], fld);
|
resetField(form.statusFields[fld], fld);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.mode == 'add') {
|
if (this.mode === 'add') {
|
||||||
this.applyDefaults();
|
this.applyDefaults();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -290,27 +292,29 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
$(selector + '-icon').removeClass('fa-minus').addClass('fa-plus');
|
$(selector + '-icon').removeClass('fa-minus').addClass('fa-plus');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(selector + '-icon').removeClass('fa-plus').addClass('fa-minus')
|
$(selector + '-icon').removeClass('fa-plus').addClass('fa-minus');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$('.jqui-accordion').each( function(index) {
|
$('.jqui-accordion').each( function(index) {
|
||||||
|
|
||||||
var active = false;
|
var active = false,
|
||||||
var list = $cookieStore.get('accordions');
|
list = $cookieStore.get('accordions'),
|
||||||
var found = false;
|
found = false,
|
||||||
|
id, base, i;
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
var id = $(this).attr('id');
|
id = $(this).attr('id');
|
||||||
var base = ($location.path().replace(/^\//,'').split('/')[0]);
|
base = ($location.path().replace(/^\//,'').split('/')[0]);
|
||||||
for (var i=0; i < list.length && found == false; i++) {
|
for (i=0; i < list.length && found === false; i++) {
|
||||||
if (list[i].base == base && list[i].id == id) {
|
if (list[i].base === base && list[i].id === id) {
|
||||||
found = true;
|
found = true;
|
||||||
active = list[i].active;
|
active = list[i].active;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found == false && $(this).attr('data-open') == 'true') {
|
if (found === false && $(this).attr('data-open') === 'true') {
|
||||||
active = 0;
|
active = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,21 +324,22 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
active: active,
|
active: active,
|
||||||
activate: function( event, ui ) {
|
activate: function( event, ui ) {
|
||||||
$('.jqui-accordion').each( function(index) {
|
$('.jqui-accordion').each( function(index) {
|
||||||
var active = $(this).accordion('option', 'active');
|
var active = $(this).accordion('option', 'active'),
|
||||||
var id = $(this).attr('id');
|
id = $(this).attr('id'),
|
||||||
var base = ($location.path().replace(/^\//,'').split('/')[0]);
|
base = ($location.path().replace(/^\//,'').split('/')[0]),
|
||||||
var list = $cookieStore.get('accordions');
|
list = $cookieStore.get('accordions'),
|
||||||
if (list == null || list == undefined) {
|
i, found;
|
||||||
|
if (list === null || list === undefined) {
|
||||||
list = [];
|
list = [];
|
||||||
}
|
}
|
||||||
var found = false;
|
found = false;
|
||||||
for (var i=0; i < list.length && found == false; i++) {
|
for (i=0; i < list.length && found === false; i++) {
|
||||||
if ( list[i].base == base && list[i].id == id) {
|
if ( list[i].base === base && list[i].id === id) {
|
||||||
found = true;
|
found = true;
|
||||||
list[i].active = active;
|
list[i].active = active;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found == false) {
|
if (found === false) {
|
||||||
list.push({ base: base, id: id, active: active });
|
list.push({ base: base, id: id, active: active });
|
||||||
}
|
}
|
||||||
$cookieStore.put('accordions',list);
|
$cookieStore.put('accordions',list);
|
||||||
@@ -388,9 +393,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
|
|
||||||
|
|
||||||
buildHelpCollapse: function(collapse_array) {
|
buildHelpCollapse: function(collapse_array) {
|
||||||
var html = '';
|
var html = '',
|
||||||
var params = {};
|
params = {}, i;
|
||||||
for (var i=0; i < collapse_array.length; i++) {
|
for (i=0; i < collapse_array.length; i++) {
|
||||||
params.hdr = collapse_array[i].hdr;
|
params.hdr = collapse_array[i].hdr;
|
||||||
params.content = collapse_array[i].content;
|
params.content = collapse_array[i].content;
|
||||||
params.idx = this.accordion_count++;
|
params.idx = this.accordion_count++;
|
||||||
@@ -453,18 +458,17 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildCheckbox(form, field, fld, idx, includeLabel) {
|
function buildCheckbox(form, field, fld, idx, includeLabel) {
|
||||||
var html = '';
|
var html = '',
|
||||||
var label = (includeLabel !== undefined && includeLabel == false) ? false : true;
|
label = (includeLabel !== undefined && includeLabel === false) ? false : true;
|
||||||
|
|
||||||
if (label) {
|
if (label) {
|
||||||
html += "<label class=\"";
|
html += "<label class=\"";
|
||||||
html += (field.inline == undefined || field.inline == true) ? "checkbox-inline" : "";
|
html += (field.inline === undefined || field.inline === true) ? "checkbox-inline" : "";
|
||||||
html += (field.labelClass) ? " " + field.labelClass : "";
|
html += (field.labelClass) ? " " + field.labelClass : "";
|
||||||
html += "\">";
|
html += "\">";
|
||||||
}
|
}
|
||||||
|
|
||||||
html += "<input type=\"checkbox\" ";
|
html += "<input type=\"checkbox\" ";
|
||||||
//html += (!label) ? "style=\"padding-top:5px;\" " : "";
|
|
||||||
html += Attr(field,'type');
|
html += Attr(field,'type');
|
||||||
html += "ng-model=\"" + fld + '" ';
|
html += "ng-model=\"" + fld + '" ';
|
||||||
html += "name=\"" + fld + '" ';
|
html += "name=\"" + fld + '" ';
|
||||||
@@ -473,7 +477,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
html += (idx !== undefined) ? "_" + idx : "";
|
html += (idx !== undefined) ? "_" + idx : "";
|
||||||
html += "class=\"";
|
html += "class=\"";
|
||||||
html += (field['class']) ? field['class'] + " " : "";
|
html += (field['class']) ? field['class'] + " " : "";
|
||||||
//html += (!label) ? "checkbox-no-label" : "";
|
|
||||||
html += "\"";
|
html += "\"";
|
||||||
html += (field.trueValue !== undefined) ? Attr(field,'trueValue') : "";
|
html += (field.trueValue !== undefined) ? Attr(field,'trueValue') : "";
|
||||||
html += (field.falseValue !== undefined) ? Attr(field,'falseValue') : "";
|
html += (field.falseValue !== undefined) ? Attr(field,'falseValue') : "";
|
||||||
@@ -503,8 +506,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
}
|
}
|
||||||
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
|
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
|
||||||
html += "for=\"" + fld + '">';
|
html += "for=\"" + fld + '">';
|
||||||
//html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
|
html += (field.icon) ? Icon(field.icon) : "";
|
||||||
html += (field.icon) ? this.icon(field.icon) : "";
|
|
||||||
html += "<span class=\"label-text\">" + field.label + "</span>";
|
html += "<span class=\"label-text\">" + field.label + "</span>";
|
||||||
html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
|
html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
|
||||||
html += "</label>\n";
|
html += "</label>\n";
|
||||||
@@ -512,21 +514,21 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
var html = '';
|
var html = '',
|
||||||
var horizontal = (this.form.horizontal) ? true : false;
|
horizontal = (this.form.horizontal) ? true : false;
|
||||||
|
|
||||||
if (field.type == 'alertblock') {
|
if (field.type === 'alertblock') {
|
||||||
html += "<div class=\"row\">\n";
|
html += "<div class=\"row\">\n";
|
||||||
html += "<div class=\"";
|
html += "<div class=\"";
|
||||||
html += (options.modal || options.id) ? "col-lg-12" : "col-lg-8 col-lg-offset-2";
|
html += (options.modal || options.id) ? "col-lg-12" : "col-lg-8 col-lg-offset-2";
|
||||||
html += "\">\n";
|
html += "\">\n";
|
||||||
html += "<div class=\"alert";
|
html += "<div class=\"alert";
|
||||||
html += (field.closeable == undefined || field.closeable == true) ? " alert-dismissable" : "";
|
html += (field.closeable === undefined || field.closeable === true) ? " alert-dismissable" : "";
|
||||||
html += (field['class']) ? " " + field['class'] : "";
|
html += (field['class']) ? " " + field['class'] : "";
|
||||||
html += "\" ";
|
html += "\" ";
|
||||||
html += (field.ngShow) ? this.attr(field, 'ngShow') : "";
|
html += (field.ngShow) ? this.attr(field, 'ngShow') : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
html += (field.closeable == undefined || field.closeable == true) ?
|
html += (field.closeable === undefined || field.closeable === true) ?
|
||||||
"<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n" : "";
|
"<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n" : "";
|
||||||
html += field.alertTxt;
|
html += field.alertTxt;
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
@@ -534,24 +536,22 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.type == 'hidden') {
|
if (field.type === 'hidden') {
|
||||||
if ( (options.mode == 'edit' && field.includeOnEdit) ||
|
if ( (options.mode === 'edit' && field.includeOnEdit) ||
|
||||||
(options.mode == 'add' && field.includeOnAdd) ) {
|
(options.mode === 'add' && field.includeOnAdd) ) {
|
||||||
html += "<input type=\"hidden\" ng-model=\"" + fld + "\" name=\"" + fld + "\" />";
|
html += "<input type=\"hidden\" ng-model=\"" + fld + "\" name=\"" + fld + "\" />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (! field.readonly) || (field.readonly && options.mode == 'edit') ) {
|
if ( (! field.readonly) || (field.readonly && options.mode === 'edit') ) {
|
||||||
html += "<div class=\"form-group\" ";
|
html += "<div class=\"form-group\" ";
|
||||||
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
|
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
|
||||||
html += (field.ngHide) ? this.attr(field,'ngHide') : "";
|
html += (field.ngHide) ? this.attr(field,'ngHide') : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
|
|
||||||
//text fields
|
//text fields
|
||||||
if (field.type == 'text' || field.type == 'password' || field.type == 'email') {
|
if (field.type === 'text' || field.type === 'password' || field.type === 'email') {
|
||||||
|
|
||||||
html += label();
|
html += label();
|
||||||
|
|
||||||
html += "<div ";
|
html += "<div ";
|
||||||
html += (horizontal) ? "class=\"" + getFieldWidth() + "\"" : "";
|
html += (horizontal) ? "class=\"" + getFieldWidth() + "\"" : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
@@ -571,8 +571,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
html += (field['class']) ? " " + this.attr(field, 'class') : "";
|
html += (field['class']) ? " " + this.attr(field, 'class') : "";
|
||||||
html += "\" ";
|
html += "\" ";
|
||||||
html += (field.placeholder) ? this.attr(field,'placeholder') : "";
|
html += (field.placeholder) ? this.attr(field,'placeholder') : "";
|
||||||
html += (options.mode == 'edit' && field.editRequired) ? "required " : "";
|
html += (options.mode === 'edit' && field.editRequired) ? "required " : "";
|
||||||
html += (options.mode == 'add' && field.addRequired) ? "required " : "";
|
html += (options.mode === 'add' && field.addRequired) ? "required " : "";
|
||||||
html += (field.readonly || field.showonly) ? "readonly " : "";
|
html += (field.readonly || field.showonly) ? "readonly " : "";
|
||||||
html += (field.awPassMatch) ? "awpassmatch=\"" + field.associated + "\" " : "";
|
html += (field.awPassMatch) ? "awpassmatch=\"" + field.associated + "\" " : "";
|
||||||
html += (field.capitalize) ? "capitalize " : "";
|
html += (field.capitalize) ? "capitalize " : "";
|
||||||
@@ -854,8 +854,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
|||||||
html += (field.labelBind) ? "ng-bind=\"" + field.labelBind + "\" " : "";
|
html += (field.labelBind) ? "ng-bind=\"" + field.labelBind + "\" " : "";
|
||||||
html += "for=\"" + fld + '">';
|
html += "for=\"" + fld + '">';
|
||||||
html += buildCheckbox(this.form, field, fld, undefined, false);
|
html += buildCheckbox(this.form, field, fld, undefined, false);
|
||||||
html += (field.icon) ? this.icon(field.icon) : "";
|
html += (field.icon) ? Icon(field.icon) : "";
|
||||||
//html += (field.awPopOver && !field.awPopOverRight) ? this.attr(field, 'awPopOver', fld) : "";
|
|
||||||
html += '<span class=\"label-text\">' + field.label + "</span>";
|
html += '<span class=\"label-text\">' + field.label + "</span>";
|
||||||
html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : "";
|
html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : "";
|
||||||
html += "</label>\n";
|
html += "</label>\n";
|
||||||
|
|||||||
9789
awx/ui/static/lib/jquery/jquery-1.10.2.js
vendored
Normal file
9789
awx/ui/static/lib/jquery/jquery-1.10.2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user