[DRE-commits] [redmine] 13/39: add missing sources for debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js

Antonio Terceiro terceiro at moszumanska.debian.org
Tue Dec 8 12:56:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository redmine.

commit e48c148e626ced51b889da28d17a08f89f0c9756
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Mon Sep 21 19:43:10 2015 -0300

    add missing sources for debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js
---
 ...1.1.js => jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js} | 42 ++++++++++++++++------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.1.js b/debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js
similarity index 99%
rename from debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.1.js
rename to debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js
index a80c1ce..9b3379d 100644
--- a/debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.1.js
+++ b/debian/missing-sources/jquery-1.11.1-ui-1.11.0-ujs-3.1.3.js
@@ -26455,13 +26455,15 @@ var tooltip = $.widget( "ui.tooltip", {
 
 
 
-}));(function($, undefined) {
+}));
+
+(function($, undefined) {
 
 /**
  * Unobtrusive scripting adapter for jQuery
  * https://github.com/rails/jquery-ujs
  *
- * Requires jQuery 1.7.0 or later.
+ * Requires jQuery 1.8.0 or later.
  *
  * Released under the MIT license
  *
@@ -26482,7 +26484,7 @@ var tooltip = $.widget( "ui.tooltip", {
     linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with], a[data-disable]',
 
     // Button elements bound by jquery-ujs
-    buttonClickSelector: 'button[data-remote], button[data-confirm]',
+    buttonClickSelector: 'button[data-remote]:not(form button), button[data-confirm]:not(form button)',
 
     // Select elements bound by jquery-ujs
     inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
@@ -26491,7 +26493,7 @@ var tooltip = $.widget( "ui.tooltip", {
     formSubmitSelector: 'form',
 
     // Form input elements bound by jquery-ujs
-    formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])',
+    formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',
 
     // Form input elements disabled during form submission
     disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',
@@ -26543,16 +26545,14 @@ var tooltip = $.widget( "ui.tooltip", {
 
     // Default way to get an element's href. May be overridden at $.rails.href.
     href: function(element) {
-      return element.attr('href');
+      return element[0].href;
     },
 
     // Submits "remote" forms and links with ajax
     handleRemote: function(element) {
-      var method, url, data, elCrossDomain, crossDomain, withCredentials, dataType, options;
+      var method, url, data, withCredentials, dataType, options;
 
       if (rails.fire(element, 'ajax:before')) {
-        elCrossDomain = element.data('cross-domain');
-        crossDomain = elCrossDomain === undefined ? null : elCrossDomain;
         withCredentials = element.data('with-credentials') || null;
         dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
 
@@ -26604,7 +26604,7 @@ var tooltip = $.widget( "ui.tooltip", {
           error: function(xhr, status, error) {
             element.trigger('ajax:error', [xhr, status, error]);
           },
-          crossDomain: crossDomain
+          crossDomain: rails.isCrossDomain(url)
         };
 
         // There is no withCredentials for IE6-8 when
@@ -26624,6 +26624,27 @@ var tooltip = $.widget( "ui.tooltip", {
       }
     },
 
+    // Determines if the request is a cross domain request.
+    isCrossDomain: function(url) {
+      var originAnchor = document.createElement("a");
+      originAnchor.href = location.href;
+      var urlAnchor = document.createElement("a");
+
+      try {
+        urlAnchor.href = url;
+        // This is a workaround to a IE bug.
+        urlAnchor.href = urlAnchor.href;
+
+        // Make sure that the browser parses the URL and that the protocols and hosts match.
+        return !urlAnchor.protocol || !urlAnchor.host ||
+          (originAnchor.protocol + "//" + originAnchor.host !==
+            urlAnchor.protocol + "//" + urlAnchor.host);
+      } catch (e) {
+        // If there is an error parsing the URL, assume it is crossDomain.
+        return true;
+      }
+    },
+
     // Handles "data-method" on links such as:
     // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
     handleMethod: function(link) {
@@ -26635,7 +26656,7 @@ var tooltip = $.widget( "ui.tooltip", {
         form = $('<form method="post" action="' + href + '"></form>'),
         metadataInput = '<input name="_method" value="' + method + '" type="hidden" />';
 
-      if (csrfParam !== undefined && csrfToken !== undefined) {
+      if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) {
         metadataInput += '<input name="' + csrfParam + '" value="' + csrfToken + '" type="hidden" />';
       }
 
@@ -26813,6 +26834,7 @@ var tooltip = $.widget( "ui.tooltip", {
 
     $document.delegate(rails.buttonClickSelector, 'click.rails', function(e) {
       var button = $(this);
+
       if (!rails.allowAction(button)) return rails.stopEverything(e);
 
       if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git



More information about the Pkg-ruby-extras-commits mailing list