From 2965258e5da192b8a54dc36f84089be90bc0f1f7 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 16 Dec 2014 08:42:13 -0500 Subject: [PATCH] NIFI-27: - Upgrading jQuery and jQuery UI. - Replacing all instances of Deferred.then with Deferred.done/fail due to API change introduced in 1.8. - Restoring line returns between public methods. - Upgrading jquery.form and jquery.minicolors. --- .../webapp/WEB-INF/pages/bulletin-board.jsp | 3 +- .../src/main/webapp/WEB-INF/pages/canvas.jsp | 3 +- .../src/main/webapp/WEB-INF/pages/cluster.jsp | 1 - .../main/webapp/WEB-INF/pages/counters.jsp | 1 - .../src/main/webapp/WEB-INF/pages/history.jsp | 1 - .../main/webapp/WEB-INF/pages/provenance.jsp | 1 - .../src/main/webapp/WEB-INF/pages/summary.jsp | 1 - .../main/webapp/WEB-INF/pages/templates.jsp | 3 +- .../src/main/webapp/WEB-INF/pages/users.jsp | 1 - .../src/main/webapp/js/jquery/jquery.form.js | 1118 -- .../main/webapp/js/jquery/jquery.form.min.js | 11 + .../jquery/minicolors/jquery.minicolors.css | 40 +- .../minicolors/jquery.minicolors.min.js | 421 +- .../jquery/ui-smoothness/jquery-ui-1.10.4.css | 1178 -- .../jquery/ui-smoothness/jquery-ui-1.10.4.js | 15008 ---------------- .../js/nf/bulletin-board/nf-bulletin-board.js | 16 +- .../main/webapp/js/nf/canvas/nf-actions.js | 65 +- .../main/webapp/js/nf/canvas/nf-birdseye.js | 1 + .../webapp/js/nf/canvas/nf-canvas-header.js | 12 +- .../webapp/js/nf/canvas/nf-canvas-toolbar.js | 1 + .../webapp/js/nf/canvas/nf-canvas-toolbox.js | 45 +- .../webapp/js/nf/canvas/nf-canvas-utils.js | 73 +- .../src/main/webapp/js/nf/canvas/nf-canvas.js | 59 +- .../main/webapp/js/nf/canvas/nf-clipboard.js | 4 + .../webapp/js/nf/canvas/nf-connectable.js | 1 + .../nf/canvas/nf-connection-configuration.js | 43 +- .../main/webapp/js/nf/canvas/nf-connection.js | 20 +- .../webapp/js/nf/canvas/nf-context-menu.js | 2 + .../main/webapp/js/nf/canvas/nf-draggable.js | 9 +- .../src/main/webapp/js/nf/canvas/nf-funnel.js | 8 + .../src/main/webapp/js/nf/canvas/nf-go-to.js | 50 +- .../src/main/webapp/js/nf/canvas/nf-graph.js | 6 + .../js/nf/canvas/nf-label-configuration.js | 5 +- .../src/main/webapp/js/nf/canvas/nf-label.js | 14 +- .../js/nf/canvas/nf-port-configuration.js | 5 +- .../webapp/js/nf/canvas/nf-port-details.js | 1 + .../src/main/webapp/js/nf/canvas/nf-port.js | 10 + .../canvas/nf-process-group-configuration.js | 5 +- .../js/nf/canvas/nf-process-group-details.js | 1 + .../webapp/js/nf/canvas/nf-process-group.js | 10 + .../nf/canvas/nf-processor-configuration.js | 13 +- .../nf/canvas/nf-processor-property-table.js | 14 + .../main/webapp/js/nf/canvas/nf-processor.js | 11 + .../webapp/js/nf/canvas/nf-registration.js | 4 +- .../nf-remote-process-group-configuration.js | 5 +- .../canvas/nf-remote-process-group-details.js | 1 + .../canvas/nf-remote-process-group-ports.js | 13 +- .../js/nf/canvas/nf-remote-process-group.js | 10 + .../nf/canvas/nf-secure-port-configuration.js | 5 +- .../js/nf/canvas/nf-secure-port-details.js | 1 + .../main/webapp/js/nf/canvas/nf-selectable.js | 2 + .../main/webapp/js/nf/canvas/nf-settings.js | 13 +- .../main/webapp/js/nf/canvas/nf-snippet.js | 6 + .../main/webapp/js/nf/canvas/nf-storage.js | 3 + .../webapp/js/nf/cluster/nf-cluster-table.js | 31 +- .../main/webapp/js/nf/cluster/nf-cluster.js | 12 +- .../js/nf/counters/nf-counters-table.js | 11 +- .../main/webapp/js/nf/counters/nf-counters.js | 12 +- .../webapp/js/nf/history/nf-history-model.js | 4 +- .../webapp/js/nf/history/nf-history-table.js | 7 +- .../main/webapp/js/nf/history/nf-history.js | 12 +- .../src/main/webapp/js/nf/nf-common.js | 40 + .../webapp/js/nf/nf-connection-details.js | 19 +- .../src/main/webapp/js/nf/nf-dialog.js | 1 + .../main/webapp/js/nf/nf-processor-details.js | 5 +- .../src/main/webapp/js/nf/nf-shell.js | 1 + .../main/webapp/js/nf/nf-status-history.js | 40 +- .../js/nf/provenance/nf-provenance-lineage.js | 17 +- .../js/nf/provenance/nf-provenance-table.js | 37 +- .../webapp/js/nf/provenance/nf-provenance.js | 20 +- .../webapp/js/nf/summary/nf-summary-table.js | 62 +- .../main/webapp/js/nf/summary/nf-summary.js | 20 +- .../js/nf/templates/nf-templates-table.js | 12 +- .../webapp/js/nf/templates/nf-templates.js | 12 +- .../main/webapp/js/nf/users/nf-users-table.js | 46 +- .../src/main/webapp/js/nf/users/nf-users.js | 12 +- 76 files changed, 719 insertions(+), 18072 deletions(-) delete mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.form.js create mode 100644 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.form.min.js delete mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.css delete mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.js diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp index 297a331c93..62569effd9 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp @@ -25,9 +25,8 @@ - + - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp index 5dc2b877e2..8f50c1fa7e 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp @@ -35,8 +35,7 @@ - - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp index 121aebc1d2..867ea3fac2 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp @@ -29,7 +29,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp index 0d0c5277b8..2d3576dd2f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp @@ -29,7 +29,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp index 7d588fe0e9..db064ff24e 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp @@ -29,7 +29,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp index e014b93056..59e8512453 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp @@ -30,7 +30,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp index fca5506f5a..0c57e65826 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp @@ -30,7 +30,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp index e2eb7e16e5..da479d6a09 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp @@ -29,9 +29,8 @@ - - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp index 39b7e151a3..ff2bbf1522 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp @@ -30,7 +30,6 @@ - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.form.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.form.js deleted file mode 100755 index 4604aa9be5..0000000000 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.form.js +++ /dev/null @@ -1,1118 +0,0 @@ -/*! - * jQuery Form Plugin - * version: 3.15 (09-SEP-2012) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Project repository: https://github.com/malsup/form - * Dual licensed under the MIT and GPL licenses: - * http://malsup.github.com/mit-license.txt - * http://malsup.github.com/gpl-license-v2.txt - */ -/*global ActiveXObject alert */ -; -(function ($) { - "use strict"; - - /* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are mutually exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').on('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - You can also use ajaxForm with delegation (requires jQuery v1.7+), so the - form does not have to exist when you invoke ajaxForm: - - $('#myForm').ajaxForm({ - delegation: true, - target: '#output' - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. - */ - - /** - * Feature detection - */ - var feature = {}; - feature.fileapi = $("").get(0).files !== undefined; - feature.formdata = window.FormData !== undefined; - - /** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ - $.fn.ajaxSubmit = function (options) { - /*jshint scripturl:true */ - - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - var method, action, url, $form = this; - - if (typeof options == 'function') { - options = {success: options}; - } - - method = this.attr('method'); - action = this.attr('action'); - url = (typeof action === 'string') ? $.trim(action) : ''; - url = url || window.location.href || ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/) || [])[1]; - } - - options = $.extend(true, { - url: url, - success: $.ajaxSettings.success, - type: method || 'GET', - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var traditional = options.traditional; - if (traditional === undefined) { - traditional = $.ajaxSettings.traditional; - } - - var elements = []; - var qx, a = this.formToArray(options.semantic, elements); - if (options.data) { - options.extraData = options.data; - qx = $.param(options.data, traditional); - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a, traditional); - if (qx) { - q = (q ? (q + '&' + qx) : qx); - } - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var callbacks = []; - if (options.resetForm) { - callbacks.push(function () { - $form.resetForm(); - }); - } - if (options.clearForm) { - callbacks.push(function () { - $form.clearForm(options.includeHidden); - }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function () { - }; - callbacks.push(function (data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function (data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || this; // jQuery 1.4+ supports scope context - for (var i = 0, max = callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113) - var hasFileInputs = fileInputs.length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - var fileAPI = feature.fileapi && feature.formdata; - log("fileAPI :" + fileAPI); - var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (options.iframe || shouldUseFrame)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, function () { - fileUploadIframe(a); - }); - } - else { - fileUploadIframe(a); - } - } - else if ((hasFileInputs || multipart) && fileAPI) { - fileUploadXhr(a); - } - else { - $.ajax(options); - } - - // clear element array - for (var k = 0; k < elements.length; k++) - elements[k] = null; - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - // utility fn for deep serialization - function deepSerialize(extraData) { - var serialized = $.param(extraData).split('&'); - var len = serialized.length; - var result = {}; - var i, part; - for (i = 0; i < len; i++) { - part = serialized[i].split('='); - result[decodeURIComponent(part[0])] = decodeURIComponent(part[1]); - } - return result; - } - - // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) - function fileUploadXhr(a) { - var formdata = new FormData(); - - for (var i = 0; i < a.length; i++) { - formdata.append(a[i].name, a[i].value); - } - - if (options.extraData) { - var serializedData = deepSerialize(options.extraData); - for (var p in serializedData) - if (serializedData.hasOwnProperty(p)) - formdata.append(p, serializedData[p]); - } - - options.data = null; - - var s = $.extend(true, {}, $.ajaxSettings, options, { - contentType: false, - processData: false, - cache: false, - type: 'POST' - }); - - if (options.uploadProgress) { - // workaround because jqXHR does not expose upload property - s.xhr = function () { - var xhr = jQuery.ajaxSettings.xhr(); - if (xhr.upload) { - xhr.upload.onprogress = function (event) { - var percent = 0; - var position = event.loaded || event.position; /*event.position is deprecated*/ - var total = event.total; - if (event.lengthComputable) { - percent = Math.ceil(position / total * 100); - } - options.uploadProgress(event, position, total, percent); - }; - } - return xhr; - }; - } - - s.data = null; - var beforeSend = s.beforeSend; - s.beforeSend = function (xhr, o) { - o.data = formdata; - if (beforeSend) - beforeSend.call(this, xhr, o); - }; - $.ajax(s); - } - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUploadIframe(a) { - var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; - var useProp = !!$.fn.prop; - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - if (a) { - // ensure that every serialized input is still enabled - for (i = 0; i < elements.length; i++) { - el = $(elements[i]); - if (useProp) - el.prop('disabled', false); - else - el.removeAttr('disabled'); - } - } - - s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - id = 'jqFormIO' + (new Date().getTime()); - if (s.iframeTarget) { - $io = $(s.iframeTarget); - n = $io.attr('name'); - if (!n) - $io.attr('name', id); - else - id = n; - } - else { - $io = $('