Merge "Update ESLint devDependencies in package.json"
This commit is contained in:
commit
5b554ce49b
@ -37,6 +37,8 @@ rules:
|
||||
space-in-parens: 1
|
||||
no-use-before-define: 1
|
||||
no-unneeded-ternary: 1
|
||||
consistent-return: 0
|
||||
no-unmodified-loop-condition: 0
|
||||
|
||||
#############################################################################
|
||||
# Angular Plugin Customization
|
||||
|
@ -522,7 +522,7 @@ horizon.d3_line_chart = {
|
||||
new Rickshaw.Graph.HoverDetail({
|
||||
graph: graph,
|
||||
formatter: function(series, x, y) {
|
||||
if(y % 1 === 0) {
|
||||
if (y % 1 === 0) {
|
||||
y = parseInt(y, 10);
|
||||
} else {
|
||||
y = parseFloat(y).toFixed(2);
|
||||
|
@ -25,7 +25,7 @@ horizon.extensible_header = {
|
||||
$('#extensible-header').replaceWith($(data));
|
||||
|
||||
selected = horizon.cookies.get('selected_header');
|
||||
if(selected && $('#header-list #' + selected).length){
|
||||
if (selected && $('#header-list #' + selected).length) {
|
||||
$old_primary = $('#primary-extensible-header > a');
|
||||
$new_primary = $('#header-list #' + selected);
|
||||
|
||||
|
@ -278,7 +278,7 @@ horizon.forms.init_themable_select = function ($elem) {
|
||||
}
|
||||
|
||||
// Set the select if necessary
|
||||
if($select.val() !== value) {
|
||||
if ($select.val() !== value) {
|
||||
$select.val(value).change();
|
||||
}
|
||||
});
|
||||
@ -520,7 +520,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
|
||||
}
|
||||
} else {
|
||||
//If the input is a checkbox no need to replace html for label since it has another structure
|
||||
if($input.attr('type') !== "checkbox"){
|
||||
if ($input.attr('type') !== "checkbox") {
|
||||
$('label[for=' + $input.attr('id') + ']').html(data);
|
||||
}
|
||||
$input.closest('.form-group').show();
|
||||
@ -568,7 +568,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
|
||||
var hide_tab = String($switchable.data('hide-tab')).split(',');
|
||||
for (var i = 0, len = hide_tab.length; i < len; i++) {
|
||||
var tab = $('*[data-target="#'+ hide_tab[i] +'"]').parent();
|
||||
if(checked == hide_on) {
|
||||
if (checked == hide_on) {
|
||||
// If the checkbox is not checked then hide the tab
|
||||
tab.hide();
|
||||
} else if (!tab.is(':visible')) {
|
||||
@ -579,11 +579,11 @@ horizon.addInitFunction(horizon.forms.init = function () {
|
||||
|
||||
// hide/show button-next or button-final
|
||||
var $btnfinal = $('.button-final');
|
||||
if(checked == hide_on) {
|
||||
if (checked == hide_on) {
|
||||
$('.button-next').hide();
|
||||
$btnfinal.show();
|
||||
$btnfinal.data('show-on-tab', $fieldset.prop('id'));
|
||||
} else{
|
||||
} else {
|
||||
$btnfinal.hide();
|
||||
$('.button-next').show();
|
||||
$btnfinal.removeData('show-on-tab');
|
||||
|
@ -157,7 +157,7 @@ function build_node_links(node){
|
||||
//make sure target node exists
|
||||
try {
|
||||
target_idx = findNodeIndex(node.required_by[j]);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
push_link =false;
|
||||
}
|
||||
//check for duplicates
|
||||
@ -180,11 +180,11 @@ function build_node_links(node){
|
||||
|
||||
function build_reverse_links(node){
|
||||
for (var i=0;i<nodes.length;i++){
|
||||
if(nodes[i].required_by){
|
||||
if (nodes[i].required_by) {
|
||||
for (var j=0;j<nodes[i].required_by.length;j++){
|
||||
var dependency = nodes[i].required_by[j];
|
||||
//if new node is required by existing node, push new link
|
||||
if(node.name === dependency){
|
||||
if (node.name === dependency) {
|
||||
links.push({
|
||||
'source':findNodeIndex(nodes[i].name),
|
||||
'target':findNodeIndex(node.name),
|
||||
|
@ -33,8 +33,8 @@ horizon.lists = {
|
||||
});
|
||||
$("#"+type+"ListId ul").html(
|
||||
lists.sort(function (a,b) {
|
||||
if($(a).data("index") < $(b).data("index")) { return -1; }
|
||||
if($(a).data("index") > $(b).data("index")) { return 1; }
|
||||
if ($(a).data("index") < $(b).data("index")) { return -1; }
|
||||
if ($(a).data("index") > $(b).data("index")) { return 1; }
|
||||
return 0;
|
||||
})
|
||||
);
|
||||
@ -60,7 +60,7 @@ horizon.lists = {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if($this.parents("ul#available_"+type).length > 0) {
|
||||
if ($this.parents("ul#available_"+type).length > 0) {
|
||||
$this.parent().appendTo($("#selected_"+type));
|
||||
} else if ($this.parents("ul#selected_"+type).length > 0) {
|
||||
$this.parent().appendTo($("#available_"+type));
|
||||
@ -103,7 +103,7 @@ horizon.lists = {
|
||||
$('pre.logs').text(response_body);
|
||||
},
|
||||
error: function () {
|
||||
if(via_user_submit) {
|
||||
if (via_user_submit) {
|
||||
horizon.clearErrorMessages();
|
||||
horizon.toast.add('error', error_txt);
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ horizon.membership = {
|
||||
generate_html: function(step_slug) {
|
||||
var data_id, data = horizon.membership.data[step_slug];
|
||||
for (data_id in data) {
|
||||
if(data.hasOwnProperty(data_id)){
|
||||
if (data.hasOwnProperty(data_id)) {
|
||||
var display_name = data[data_id];
|
||||
var role_ids = this.get_member_roles(step_slug, data_id);
|
||||
if (role_ids.length > 0) {
|
||||
@ -491,7 +491,7 @@ horizon.membership = {
|
||||
|
||||
// prevent filter inputs from submitting form on 'enter'
|
||||
$form.find('.' + step_slug + '_membership').keydown(function(event){
|
||||
if(event.keyCode === 13) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ horizon.datatables = {
|
||||
var requests = [];
|
||||
|
||||
// do nothing if there are no rows to update.
|
||||
if($rows_to_update.length <= 0) { return; }
|
||||
if ($rows_to_update.length <= 0) { return; }
|
||||
|
||||
// Do not update this row if the action column is expanded
|
||||
if ($rows_to_update.find('.actions_column .btn-group.open').length) {
|
||||
@ -50,7 +50,7 @@ horizon.datatables = {
|
||||
// existing count minus one for the row we're removing
|
||||
row_count = horizon.datatables.update_footer_count($table, -1);
|
||||
|
||||
if(row_count === 0) {
|
||||
if (row_count === 0) {
|
||||
colspan = $table.find('.table_column_header th').length;
|
||||
template = horizon.templates.compiled_templates["#empty_row_template"];
|
||||
params = {
|
||||
@ -104,12 +104,12 @@ horizon.datatables = {
|
||||
}
|
||||
|
||||
// Only replace row if the html content has changed
|
||||
if($new_row.html() !== $row.html()) {
|
||||
if ($new_row.html() !== $row.html()) {
|
||||
|
||||
// Directly accessing the checked property of the element
|
||||
// is MUCH faster than using jQuery's helper method
|
||||
var $checkbox = $row.find('.table-row-multi-select');
|
||||
if($checkbox.length && $checkbox[0].checked) {
|
||||
if ($checkbox.length && $checkbox[0].checked) {
|
||||
// Preserve the checkbox if it's already clicked
|
||||
$new_row.find('.table-row-multi-select').prop('checked', true);
|
||||
}
|
||||
@ -146,7 +146,7 @@ horizon.datatables = {
|
||||
$table.attr('decay_constant', decay_constant);
|
||||
var next_poll = interval * decay_constant;
|
||||
// Limit the interval to 30 secs
|
||||
if(next_poll > 30 * 1000) { next_poll = 30 * 1000; }
|
||||
if (next_poll > 30 * 1000) { next_poll = 30 * 1000; }
|
||||
setTimeout(horizon.datatables.update, next_poll);
|
||||
});
|
||||
},
|
||||
@ -164,7 +164,7 @@ horizon.datatables = {
|
||||
var $new_action = $(data);
|
||||
|
||||
// Only replace row if the html content has changed
|
||||
if($new_action.html() != $action.html()) {
|
||||
if ($new_action.html() != $action.html()) {
|
||||
$action.replaceWith($new_action);
|
||||
}
|
||||
}
|
||||
@ -296,11 +296,11 @@ horizon.datatables.confirm = function(action) {
|
||||
name_string = " \"" + $action.closest("tr").attr("data-display") + "\"";
|
||||
name_array = [name_string];
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
// Probably we are getting the action from a detail view, so we try to get
|
||||
// the data-display from a dd element instead
|
||||
$data_display = $('dd[data-display]');
|
||||
if($data_display.length > 0) {
|
||||
if ($data_display.length > 0) {
|
||||
name_string = ' "' + $('dd[data-display]').attr("data-display") + '"';
|
||||
name_array = [name_string];
|
||||
}
|
||||
@ -475,7 +475,7 @@ $.tablesorter.addParser({
|
||||
// numerically comparable to other strings.
|
||||
s = s.toUpperCase();
|
||||
var value = 0.0;
|
||||
for(var i = 0; i < s.length; i++) {
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
var char_offset = 1.0 / Math.pow(100, i);
|
||||
value = value + (s.charCodeAt(i) * char_offset);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ horizon.tabs.load_tab = function () {
|
||||
.addClass('tab-loading');
|
||||
|
||||
// If query params exist, append tab id.
|
||||
if(window.location.search.length > 0) {
|
||||
if (window.location.search.length > 0) {
|
||||
$tab_pane.load(window.location.search + "&tab=" + tab_id.replace('#', ''), function() {
|
||||
horizon.tabs.initTabLoad($tab_pane);
|
||||
});
|
||||
@ -74,7 +74,7 @@ horizon.addInitFunction(horizon.tabs.init = function () {
|
||||
});
|
||||
// d3 renders incorrectly in a hidden tab, this forces a rerender when the
|
||||
// container size is not 0 from display:none
|
||||
if($content.find(".d3-container").length) {
|
||||
if ($content.find(".d3-container").length) {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ rules:
|
||||
one-var: 0
|
||||
space-infix-ops: 0
|
||||
space-after-keywords: 0
|
||||
keyword-spacing: 0
|
||||
no-console: 0
|
||||
no-multiple-empty-lines: 0
|
||||
no-sync: 0
|
||||
|
@ -6,14 +6,14 @@
|
||||
"repository": "none",
|
||||
"license": "Apache 2.0",
|
||||
"devDependencies": {
|
||||
"eslint": "1.10.3",
|
||||
"eslint-config-openstack": "1.2.4",
|
||||
"eslint-plugin-angular": "1.0.1",
|
||||
"eslint": "3.0.0",
|
||||
"eslint-config-openstack": "4.0.1",
|
||||
"eslint-plugin-angular": "4.0.1",
|
||||
"jasmine-core": "2.4.1",
|
||||
"karma": "1.1.2",
|
||||
"karma-firefox-launcher": "2.1.0",
|
||||
"karma-cli": "1.0.1",
|
||||
"karma-coverage": "1.1.1",
|
||||
"karma-firefox-launcher": "2.1.0",
|
||||
"karma-jasmine": "1.0.2",
|
||||
"karma-ng-html2js-preprocessor": "1.0.0",
|
||||
"karma-threshold-reporter": "0.1.15"
|
||||
|
Loading…
Reference in New Issue
Block a user