- Upgrading jQuery and jQuery UI.
- Updating autocomplete as appropriate.
- Restoring line returns between methods.
This commit is contained in:
Matt Gilman 2014-12-16 09:40:56 -05:00
parent 2965258e5d
commit 888d1bafc7
4 changed files with 80 additions and 96 deletions

View File

@ -19,17 +19,29 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../nifi/js/jquery/jquery-1.7.min.js"></script> <link rel="stylesheet" href="../nifi/js/jquery/ui-smoothness/jquery-ui-1.10.4.min.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/modal/jquery.modal.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/combo/jquery.combo.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/qtip2/jquery.qtip.min.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/codemirror/lib/codemirror.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/codemirror/addon/hint/show-hint.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/nfeditor/jquery.nfeditor.css" type="text/css" />
<link rel="stylesheet" href="../nifi/css/reset.css" type="text/css" />
<link rel="stylesheet" href="css/main.css" type="text/css" />
<script type="text/javascript" src="../nifi/js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery.center.js"></script> <script type="text/javascript" src="../nifi/js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery.each.js"></script> <script type="text/javascript" src="../nifi/js/jquery/jquery.each.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery.tab.js"></script> <script type="text/javascript" src="../nifi/js/jquery/jquery.tab.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/modal/jquery.modal.js"></script> <script type="text/javascript" src="../nifi/js/jquery/modal/jquery.modal.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/combo/jquery.combo.js"></script> <script type="text/javascript" src="../nifi/js/jquery/combo/jquery.combo.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery.ellipsis.js"></script> <script type="text/javascript" src="../nifi/js/jquery/jquery.ellipsis.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery-ui-1.8.10.custom.min.js"></script> <script type="text/javascript" src="../nifi/js/jquery/ui-smoothness/jquery-ui-1.10.4.min.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/qtip2/jquery.qtip.min.js"></script> <script type="text/javascript" src="../nifi/js/jquery/qtip2/jquery.qtip.min.js"></script>
<script type="text/javascript" src="../nifi/js/json2.js"></script> <script type="text/javascript" src="../nifi/js/json2.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/jquery.event.drag-2.0.min.js"></script> <script type="text/javascript" src="../nifi/js/jquery/jquery.event.drag-2.2.min.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellrangeselector.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellrangeselector.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js"></script>
@ -39,24 +51,11 @@
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.dataview.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.dataview.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.core.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.core.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.grid.js"></script> <script type="text/javascript" src="../nifi/js/jquery/slickgrid/slick.grid.js"></script>
<script type="text/javascript" src="../nifi/js/codemirror/lib/codemirror.js"></script> <script type="text/javascript" src="../nifi/js/codemirror/lib/codemirror-compressed.js"></script>
<script type="text/javascript" src="../nifi/js/codemirror/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" src="../nifi/js/codemirror/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="../nifi/js/nf/nf-namespace.js"></script> <script type="text/javascript" src="../nifi/js/nf/nf-namespace.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/nfeditor/languages/nfel.js"></script> <script type="text/javascript" src="../nifi/js/jquery/nfeditor/languages/nfel.js"></script>
<script type="text/javascript" src="../nifi/js/jquery/nfeditor/jquery.nfeditor.js"></script> <script type="text/javascript" src="../nifi/js/jquery/nfeditor/jquery.nfeditor.js"></script>
<script type="text/javascript" src="js/application.js"></script> <script type="text/javascript" src="js/application.js"></script>
<link rel="stylesheet" href="../nifi/js/jquery/css/smoothness/jquery-ui-1.8.10.custom.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/modal/jquery.modal.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/combo/jquery.combo.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/qtip2/jquery.qtip.css?" type="text/css" />
<link rel="stylesheet" href="../nifi/js/codemirror/lib/codemirror.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/codemirror/addon/hint/show-hint.css" type="text/css" />
<link rel="stylesheet" href="../nifi/js/jquery/nfeditor/jquery.nfeditor.css" type="text/css" />
<link rel="stylesheet" href="css/reset.css" type="text/css" />
<link rel="stylesheet" href="css/main.css" type="text/css" />
<title>Update Attribute</title> <title>Update Attribute</title>
</head> </head>
<body> <body>

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* /*
document styles document styles
*/ */
@ -59,7 +60,21 @@ div.new-rule {
} }
#new-rule-dialog input { #new-rule-dialog input {
width: 374px; width: 370px;
}
#update-attributes-content .ui-autocomplete {
max-height: 400px;
overflow: auto;
border: 1px solid #aaaaaa;
z-index: 1351;
border-radius: 0;
}
#update-attributes-content .ui-menu .ui-menu-item a.ui-state-focus {
background: #D4E0E5 !important;
border: 1px solid #999999;
border-radius: 0;
} }
input.search { input.search {

View File

@ -1,59 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Browser Reset CSS, Eric Meyer. */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
line-height: 1;
color: black;
background: transparent;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}

View File

@ -23,6 +23,7 @@ var ua = {
searchRules: 'Search rule name', searchRules: 'Search rule name',
newRuleIndex: 0, newRuleIndex: 0,
editable: false, editable: false,
/** /**
* Initializes this web application. * Initializes this web application.
* *
@ -244,6 +245,7 @@ var ua = {
} }
}); });
}, },
/** /**
* Initializes the new rule dialog. * Initializes the new rule dialog.
* *
@ -369,17 +371,10 @@ var ua = {
// initialize the access control auto complete // initialize the access control auto complete
$.widget('nf.copyFromRuleAutocomplete', $.ui.autocomplete, { $.widget('nf.copyFromRuleAutocomplete', $.ui.autocomplete, {
_response: function (content) { _normalize: function(searchResults) {
if (!this.options.disabled && content) { var items = [];
this._suggest(content); items.push(searchResults);
this._trigger('open'); return items;
} else {
this.close();
}
this.pending--;
if (!this.pending) {
this.element.removeClass('ui-autocomplete-loading');
}
}, },
_resizeMenu: function () { _resizeMenu: function () {
var ul = this.menu.element; var ul = this.menu.element;
@ -388,9 +383,12 @@ var ua = {
_renderMenu: function (ul, items) { _renderMenu: function (ul, items) {
var self = this; var self = this;
if ($.isArray(items.rules) && items.rules.length > 0) { // the object that holds the search results is normalized into a single element array
var searchResults = items[0];
if ($.isArray(searchResults.rules) && searchResults.rules.length > 0) {
// go through each matching rule // go through each matching rule
$.each(items.rules, function (i, rule) { $.each(searchResults.rules, function (i, rule) {
// add the user match // add the user match
self._renderRule(ul, rule); self._renderRule(ul, rule);
}); });
@ -403,7 +401,7 @@ var ua = {
}, },
_renderRule: function (ul, ruleMatch) { _renderRule: function (ul, ruleMatch) {
var ruleContent = $('<a></a>').append($('<div></div>').text(ruleMatch.name)); var ruleContent = $('<a></a>').append($('<div></div>').text(ruleMatch.name));
return $('<li style="height: 20px;"></li>').data('item.autocomplete', ruleMatch).append(ruleContent).appendTo(ul); return $('<li style="height: 20px;"></li>').data('ui-autocomplete-item', ruleMatch).append(ruleContent).appendTo(ul);
} }
}); });
@ -448,6 +446,7 @@ var ua = {
} }
}).val(ua.searchRules).addClass('search'); }).val(ua.searchRules).addClass('search');
}, },
/** /**
* Initializes the new condition dialog. * Initializes the new condition dialog.
*/ */
@ -523,6 +522,7 @@ var ua = {
containment: 'parent' containment: 'parent'
}).on('click', '#new-condition-add', add).on('click', '#new-condition-cancel', cancel); }).on('click', '#new-condition-add', add).on('click', '#new-condition-cancel', cancel);
}, },
/** /**
* Initializes the new action dialog. * Initializes the new action dialog.
*/ */
@ -610,6 +610,7 @@ var ua = {
} }
}); });
}, },
/** /**
* Configure the ok dialog. * Configure the ok dialog.
* *
@ -635,6 +636,7 @@ var ua = {
} }
}); });
}, },
/** /**
* Configure the yes no dialog. * Configure the yes no dialog.
* *
@ -645,6 +647,7 @@ var ua = {
overlayBackground: false overlayBackground: false
}); });
}, },
/** /**
* Initializes the conditions grid. * Initializes the conditions grid.
* *
@ -724,6 +727,7 @@ var ua = {
$('#selected-rule-conditions').data('gridInstance', conditionsGrid); $('#selected-rule-conditions').data('gridInstance', conditionsGrid);
return conditionsGrid; return conditionsGrid;
}, },
/** /**
* Initializes the actions grid. * Initializes the actions grid.
*/ */
@ -801,6 +805,7 @@ var ua = {
$('#selected-rule-actions').data('gridInstance', actionsGrid); $('#selected-rule-actions').data('gridInstance', actionsGrid);
return actionsGrid; return actionsGrid;
}, },
/** /**
* Initializes the rule list. * Initializes the rule list.
* *
@ -940,6 +945,7 @@ var ua = {
e.stopPropagation(); e.stopPropagation();
}).children(':first').click(); }).children(':first').click();
}, },
/** /**
* Saves the current rule order * Saves the current rule order
*/ */
@ -975,6 +981,7 @@ var ua = {
$('#ok-dialog').modal('setHeaderText', 'Error').modal('show'); $('#ok-dialog').modal('setHeaderText', 'Error').modal('show');
}); });
}, },
/** /**
* Clears the rule details. * Clears the rule details.
*/ */
@ -1006,6 +1013,7 @@ var ua = {
var actionsData = actionsGrid.getData(); var actionsData = actionsGrid.getData();
actionsData.setItems([]); actionsData.setItems([]);
}, },
/** /**
* Loads the rule list. * Loads the rule list.
* *
@ -1069,6 +1077,7 @@ var ua = {
}); });
}).promise(); }).promise();
}, },
/** /**
* Selects the specified rule and populates its details. * Selects the specified rule and populates its details.
* *
@ -1133,6 +1142,7 @@ var ua = {
actionsGrid.invalidate(); actionsGrid.invalidate();
}).promise(); }).promise();
}, },
/** /**
* Deletes the specified rule. * Deletes the specified rule.
* *
@ -1191,6 +1201,7 @@ var ua = {
}).promise(); }).promise();
}, },
/** /**
* Saves the currently selected rule. * Saves the currently selected rule.
* *
@ -1268,6 +1279,7 @@ var ua = {
$('#ok-dialog').modal('setHeaderText', 'Error').modal('show'); $('#ok-dialog').modal('setHeaderText', 'Error').modal('show');
}); });
}, },
/** /**
* Deletes the specified row from the specified grid. * Deletes the specified row from the specified grid.
* *
@ -1284,6 +1296,7 @@ var ua = {
// mark the rule as modified // mark the rule as modified
$('#rule-list').children('li.selected').addClass('unsaved'); $('#rule-list').children('li.selected').addClass('unsaved');
}, },
/** /**
* Creates a new rule and adds it to the rule list. * Creates a new rule and adds it to the rule list.
* *
@ -1308,6 +1321,7 @@ var ua = {
return ruleItem; return ruleItem;
}, },
/** /**
* Hides the rule list. * Hides the rule list.
* *
@ -1318,6 +1332,7 @@ var ua = {
$('#no-rules').show(); $('#no-rules').show();
$('#rule-filter-controls').hide(); $('#rule-filter-controls').hide();
}, },
/** /**
* Shows the rule list. * Shows the rule list.
* *
@ -1331,9 +1346,8 @@ var ua = {
// apply the filter // apply the filter
ua.applyRuleFilter(); ua.applyRuleFilter();
}, },
/*
* Rule filter functions. // Rule filter functions.
*/
/** /**
* Get the filter text. * Get the filter text.
@ -1348,6 +1362,7 @@ var ua = {
} }
return filter; return filter;
}, },
/** /**
* Get the text for the rule to be filtered. * Get the text for the rule to be filtered.
* *
@ -1376,6 +1391,7 @@ var ua = {
return actions; return actions;
} }
}, },
/** /**
* Apply the rule filter. * Apply the rule filter.
* *
@ -1446,6 +1462,7 @@ var ua = {
$('#displayed-rules').text(matchingRules); $('#displayed-rules').text(matchingRules);
$('#total-rules').text(ruleItems.length); $('#total-rules').text(ruleItems.length);
}, },
/** /**
* Adds a hover effects to the specified selector. * Adds a hover effects to the specified selector.
* *
@ -1454,12 +1471,14 @@ var ua = {
* @param {type} overStyle * @param {type} overStyle
*/ */
addHoverEffect: function (selector, normalStyle, overStyle) { addHoverEffect: function (selector, normalStyle, overStyle) {
return $(selector).addClass(normalStyle).live('mouseenter', function () { $(document).on('mouseenter', selector, function () {
$(this).removeClass(normalStyle).addClass(overStyle); $(this).removeClass(normalStyle).addClass(overStyle);
}).live('mouseleave', function () { }).on('mouseleave', selector, function () {
$(this).removeClass(overStyle).addClass(normalStyle); $(this).removeClass(overStyle).addClass(normalStyle);
}); });
return $(selector).addClass(normalStyle);
}, },
/** /**
* Shows the specified text and clears it after 10 seconds. * Shows the specified text and clears it after 10 seconds.
* *
@ -1472,6 +1491,7 @@ var ua = {
$('#message').text(''); $('#message').text('');
}, 10000); }, 10000);
}, },
/** /**
* Custom validator for required fields. * Custom validator for required fields.
* *
@ -1484,6 +1504,7 @@ var ua = {
return {valid: true, msg: null}; return {valid: true, msg: null};
} }
}, },
/** /**
* Function for prevent cell editing before a rule is selected. * Function for prevent cell editing before a rule is selected.
* *
@ -1501,6 +1522,7 @@ var ua = {
return false; return false;
} }
}, },
/** /**
* Shows the property value for the specified row and cell. * Shows the property value for the specified row and cell.
* *
@ -1593,12 +1615,14 @@ var ua = {
'padding': '0 3px 5px' 'padding': '0 3px 5px'
}).append(ok).append('<div class="clear"></div>').appendTo(wrapper); }).append(ok).append('<div class="clear"></div>').appendTo(wrapper);
}, },
/** /**
* Removes all currently open process property detail dialogs. * Removes all currently open process property detail dialogs.
*/ */
removeAllDetailDialogs: function () { removeAllDetailDialogs: function () {
$('body').children('div.update-attribute-detail').hide().remove(); $('body').children('div.update-attribute-detail').hide().remove();
}, },
/** /**
* Gets a custom editor for editing long values. * Gets a custom editor for editing long values.
* *
@ -1728,6 +1752,7 @@ var ua = {
// initialize the custom long text editor // initialize the custom long text editor
this.init(); this.init();
}, },
/** /**
* Gets a custom editor for editing long values. * Gets a custom editor for editing long values.
* *
@ -1851,6 +1876,7 @@ var ua = {
// initialize the custom long text editor // initialize the custom long text editor
this.init(); this.init();
}, },
/** /**
* Adjust the size of the selected rule name field. * Adjust the size of the selected rule name field.
*/ */
@ -1859,6 +1885,7 @@ var ua = {
var ruleNameField = $('#selected-rule-name'); var ruleNameField = $('#selected-rule-name');
ruleNameField.width(Math.min(500, ruleDetailsPanel.width() - 10)); ruleNameField.width(Math.min(500, ruleDetailsPanel.width() - 10));
}, },
/** /**
* Gets the client id. * Gets the client id.
* *
@ -1867,6 +1894,7 @@ var ua = {
getClientId: function () { getClientId: function () {
return $('#attribute-updater-client-id').text(); return $('#attribute-updater-client-id').text();
}, },
/** /**
* Gets the revision. * Gets the revision.
* *
@ -1875,6 +1903,7 @@ var ua = {
getRevision: function () { getRevision: function () {
return $('#attribute-updater-revision').text(); return $('#attribute-updater-revision').text();
}, },
/** /**
* Gets the processor id. * Gets the processor id.
* *