spree_backend 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b0a7a260991ba56dd14948a2c8d7623d9f45c3e
4
- data.tar.gz: b911db9e5fdae8d3276861457b312cdf29080cab
3
+ metadata.gz: c19ca1bd23710f50d9e76d3ee1a03d75b3476c25
4
+ data.tar.gz: 5897df3286d647fc7b70bb035c8a67d137790ed2
5
5
  SHA512:
6
- metadata.gz: 4846679d8beeccf59b32ed06ee6a525decd2c14d9903617ad078b3ccc63495675968dc578e50daeada737192cc04d7894106c2314b24457cbfea4f8819a97483
7
- data.tar.gz: f2beeb95840a5d8ac3ae35f01d20eca9a6ce1d527057571613e747746e53ac182b2a129bcd02fb6039a623bf9e070f93d87a71f70b2caf20303eb6652af1ff86
6
+ metadata.gz: dcf3290e5861d5f004f2a35abed7912bd8a25aebd4f7770b4c94b86bee52e5b4a8f6733d2c9fc6732237a1f1840624bbd0903922314418aaecead76a4170eb56
7
+ data.tar.gz: a7283ddf910bee9b6edf41c58cad2499693310680433bd69ca96a6c854eccc907d95ab62ce802523a39085e12bda26d41717df78940e0b7971c742504b344e12
@@ -21,7 +21,14 @@ $(document).ready(function() {
21
21
  cache: true,
22
22
  data: function(term, page) {
23
23
  return {
24
- q: term,
24
+ q: {
25
+ 'm': 'or',
26
+ 'email_start': term,
27
+ 'ship_address_firstname_start': term,
28
+ 'ship_address_lastname_start': term,
29
+ 'bill_address_firstname_start': term,
30
+ 'bill_address_lastname_start': term
31
+ },
25
32
  token: Spree.api_key
26
33
  }
27
34
  },
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  /*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
16
- /*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
16
+ /*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false, ActiveXObject: false */
17
17
 
18
18
  "use strict";
19
19
 
@@ -114,7 +114,7 @@
114
114
  if(isMethodCall) {
115
115
  if(settings.substring(0, 1) == '_') { return returnValue; }
116
116
  this.each(function() {
117
- var instance = instances[$.data(this, "jstree-instance-id")],
117
+ var instance = instances[$.data(this, "jstree_instance_id")],
118
118
  methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
119
119
  if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
120
120
  });
@@ -122,7 +122,7 @@
122
122
  else {
123
123
  this.each(function() {
124
124
  // extend settings and allow for multiple hashes and $.data
125
- var instance_id = $.data(this, "jstree-instance-id"),
125
+ var instance_id = $.data(this, "jstree_instance_id"),
126
126
  a = [],
127
127
  b = settings ? $.extend({}, true, settings) : {},
128
128
  c = $(this),
@@ -137,7 +137,7 @@
137
137
  // push a new empty object to the instances array
138
138
  instance_id = parseInt(instances.push({}),10) - 1;
139
139
  // store the jstree instance id to the container element
140
- $.data(this, "jstree-instance-id", instance_id);
140
+ $.data(this, "jstree_instance_id", instance_id);
141
141
  // clean up all plugins
142
142
  b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
143
143
  b.plugins.unshift("core");
@@ -159,7 +159,7 @@
159
159
  $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
160
160
  $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
161
161
  // initialize the instance
162
- setTimeout(function() { instances[instance_id].init(); }, 0);
162
+ setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
163
163
  });
164
164
  }
165
165
  // return the jquery selection (or if it was a method call that returned a value - the returned value)
@@ -178,7 +178,7 @@
178
178
  var o = $(needle);
179
179
  if(!o.length && typeof needle === "string") { o = $("#" + needle); }
180
180
  if(!o.length) { return null; }
181
- return instances[o.closest(".jstree").data("jstree-instance-id")] || null;
181
+ return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
182
182
  },
183
183
  _instance : function (index, container, settings) {
184
184
  // for plugins to store data in
@@ -356,7 +356,8 @@
356
356
  this.get_container()
357
357
  .delegate("li > ins", "click.jstree", $.proxy(function (event) {
358
358
  var trgt = $(event.target);
359
- if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
359
+ // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
360
+ this.toggle_node(trgt);
360
361
  }, this))
361
362
  .bind("mousedown.jstree", $.proxy(function () {
362
363
  this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
@@ -433,9 +434,9 @@
433
434
  this.get_container()
434
435
  .unbind(".jstree")
435
436
  .undelegate(".jstree")
436
- .removeData("jstree-instance-id")
437
+ .removeData("jstree_instance_id")
437
438
  .find("[class^='jstree']")
438
- .andSelf()
439
+ .addBack()
439
440
  .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
440
441
  $(document)
441
442
  .unbind(".jstree-" + n)
@@ -678,7 +679,7 @@
678
679
  }
679
680
  else {
680
681
  original_obj = obj;
681
- if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
682
+ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); }
682
683
  else { obj = obj.find("li.jstree-closed"); }
683
684
  }
684
685
  var _this = this;
@@ -694,12 +695,12 @@
694
695
  var _this = this;
695
696
  obj = obj ? this._get_node(obj) : this.get_container();
696
697
  if(!obj || obj === -1) { obj = this.get_container_ul(); }
697
- obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
698
+ obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); });
698
699
  this.__callback({ "obj" : obj });
699
700
  },
700
701
  clean_node : function (obj) {
701
702
  obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
702
- obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
703
+ obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li");
703
704
  obj.removeClass("jstree-last")
704
705
  .filter("li:last-child").addClass("jstree-last").end()
705
706
  .filter(":has(li)")
@@ -752,6 +753,7 @@
752
753
  if(m.language) { tmp.addClass(m.language); }
753
754
  }
754
755
  tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
756
+ if(!m.icon && js.icon) { m.icon = js.icon; }
755
757
  if(m.icon) {
756
758
  if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
757
759
  else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
@@ -920,10 +922,12 @@
920
922
  check_move : function () {
921
923
  var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
922
924
  if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
923
- if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
924
- obj.o.each(function () {
925
- if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
926
- });
925
+ if(!obj.cy) {
926
+ if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
927
+ obj.o.each(function () {
928
+ if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
929
+ });
930
+ }
927
931
  return ret;
928
932
  },
929
933
  move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
@@ -941,7 +945,7 @@
941
945
  var o = false;
942
946
  if(is_copy) {
943
947
  o = obj.o.clone(true);
944
- o.find("*[id]").andSelf().each(function () {
948
+ o.find("*[id]").addBack().each(function () {
945
949
  if(this.id) { this.id = "copy_" + this.id; }
946
950
  });
947
951
  }
@@ -1138,7 +1142,7 @@
1138
1142
  switch(!0) {
1139
1143
  case (is_range):
1140
1144
  this.data.ui.last_selected.addClass("jstree-last-selected");
1141
- obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
1145
+ obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack();
1142
1146
  if(s.select_limit == -1 || obj.length < s.select_limit) {
1143
1147
  this.data.ui.last_selected.removeClass("jstree-last-selected");
1144
1148
  this.data.ui.selected.each(function () {
@@ -1242,7 +1246,7 @@
1242
1246
  .bind("move_node.jstree", $.proxy(function (e, data) {
1243
1247
  if(this._get_settings().crrm.move.open_onmove) {
1244
1248
  var t = this;
1245
- data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
1249
+ data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () {
1246
1250
  t.open_node(this, false, true);
1247
1251
  });
1248
1252
  }
@@ -1658,7 +1662,7 @@
1658
1662
  obj = this._get_node(obj);
1659
1663
  var s = this._get_settings().json_data;
1660
1664
  if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
1661
- obj.removeData("jstree-children");
1665
+ obj.removeData("jstree_children");
1662
1666
  }
1663
1667
  return this.__call_old();
1664
1668
  },
@@ -1668,11 +1672,11 @@
1668
1672
  success_func = function () {};
1669
1673
  obj = this._get_node(obj);
1670
1674
 
1671
- if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree-children")) {
1672
- d = this._parse_json(obj.data("jstree-children"), obj);
1675
+ if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
1676
+ d = this._parse_json(obj.data("jstree_children"), obj);
1673
1677
  if(d) {
1674
1678
  obj.append(d);
1675
- if(!s.progressive_unload) { obj.removeData("jstree-children"); }
1679
+ if(!s.progressive_unload) { obj.removeData("jstree_children"); }
1676
1680
  }
1677
1681
  this.clean_node(obj);
1678
1682
  if(s_call) { s_call.call(this); }
@@ -1680,8 +1684,8 @@
1680
1684
  }
1681
1685
 
1682
1686
  if(obj && obj !== -1) {
1683
- if(obj.data("jstree-is-loading")) { return; }
1684
- else { obj.data("jstree-is-loading",true); }
1687
+ if(obj.data("jstree_is_loading")) { return; }
1688
+ else { obj.data("jstree_is_loading",true); }
1685
1689
  }
1686
1690
  switch(!0) {
1687
1691
  case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
@@ -1695,14 +1699,14 @@
1695
1699
  }
1696
1700
  else {
1697
1701
  obj.children("a.jstree-loading").removeClass("jstree-loading");
1698
- obj.removeData("jstree-is-loading");
1702
+ obj.removeData("jstree_is_loading");
1699
1703
  if(s.correct_state) { this.correct_state(obj); }
1700
1704
  }
1701
1705
  if(e_call) { e_call.call(this); }
1702
1706
  }
1703
1707
  else {
1704
1708
  if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
1705
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
1709
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
1706
1710
  this.clean_node(obj);
1707
1711
  if(s_call) { s_call.call(this); }
1708
1712
  }
@@ -1727,7 +1731,7 @@
1727
1731
  if(ef) { ef.call(this, x, t, e); }
1728
1732
  if(obj != -1 && obj.length) {
1729
1733
  obj.children("a.jstree-loading").removeClass("jstree-loading");
1730
- obj.removeData("jstree-is-loading");
1734
+ obj.removeData("jstree_is_loading");
1731
1735
  if(t === "success" && s.correct_state) { this.correct_state(obj); }
1732
1736
  }
1733
1737
  else {
@@ -1744,7 +1748,7 @@
1744
1748
  d = this._parse_json(d, obj);
1745
1749
  if(d) {
1746
1750
  if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
1747
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
1751
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
1748
1752
  this.clean_node(obj);
1749
1753
  if(s_call) { s_call.call(this); }
1750
1754
  }
@@ -1757,7 +1761,7 @@
1757
1761
  }
1758
1762
  else {
1759
1763
  obj.children("a.jstree-loading").removeClass("jstree-loading");
1760
- obj.removeData("jstree-is-loading");
1764
+ obj.removeData("jstree_is_loading");
1761
1765
  if(s.correct_state) {
1762
1766
  this.correct_state(obj);
1763
1767
  if(s_call) { s_call.call(this); }
@@ -1784,14 +1788,16 @@
1784
1788
 
1785
1789
  if(!js) { return d; }
1786
1790
  if(s.progressive_unload && obj && obj !== -1) {
1787
- obj.data("jstree-children", d);
1791
+ obj.data("jstree_children", d);
1788
1792
  }
1789
1793
  if($.isArray(js)) {
1790
1794
  d = $('<ul>');
1791
1795
  if(!js.length) { return false; }
1792
1796
  for(i = 0, j = js.length; i < j; i++) {
1793
1797
  tmp = this._parse_json(js[i], obj, true);
1794
- if(tmp.length) { d = d.append(tmp); }
1798
+ if(tmp.length) {
1799
+ d = d.append(tmp);
1800
+ }
1795
1801
  }
1796
1802
  d = d.children();
1797
1803
  }
@@ -1824,10 +1830,10 @@
1824
1830
  d.prepend("<ins class='jstree-icon'>&#160;</ins>");
1825
1831
  if(js.children) {
1826
1832
  if(s.progressive_render && js.state !== "open") {
1827
- d.addClass("jstree-closed").data("jstree-children", js.children);
1833
+ d.addClass("jstree-closed").data("jstree_children", js.children);
1828
1834
  }
1829
1835
  else {
1830
- if(s.progressive_unload) { d.data("jstree-children", js.children); }
1836
+ if(s.progressive_unload) { d.data("jstree_children", js.children); }
1831
1837
  if($.isArray(js.children) && js.children.length) {
1832
1838
  tmp = this._parse_json(js.children, obj, true);
1833
1839
  if(tmp.length) {
@@ -1928,6 +1934,7 @@
1928
1934
  * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
1929
1935
  */
1930
1936
  (function ($) {
1937
+ var sh = false;
1931
1938
  $.jstree.plugin("languages", {
1932
1939
  __init : function () { this._load_css(); },
1933
1940
  defaults : [],
@@ -1942,9 +1949,9 @@
1942
1949
  else { return false; }
1943
1950
  }
1944
1951
  if(i == this.data.languages.current_language) { return true; }
1945
- st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
1952
+ st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
1946
1953
  if(st !== false) { st.style.display = "none"; }
1947
- st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
1954
+ st = $.vakata.css.get_css(selector + "." + i, false, sh);
1948
1955
  if(st !== false) { st.style.display = ""; }
1949
1956
  this.data.languages.current_language = i;
1950
1957
  this.__callback(i);
@@ -2018,7 +2025,7 @@
2018
2025
  if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
2019
2026
  str += " } ";
2020
2027
  }
2021
- this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
2028
+ sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
2022
2029
  }
2023
2030
  },
2024
2031
  create_node : function (obj, position, js, callback) {
@@ -2686,14 +2693,14 @@
2686
2693
  $(function() {
2687
2694
  var css_string = '' +
2688
2695
  '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
2689
- ' border-radius:4px; -webkit-border-radius:4px; ' +
2696
+ ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
2690
2697
  '} ' +
2691
2698
  '#vakata-dragged .jstree-ok { background:green; } ' +
2692
2699
  '#vakata-dragged .jstree-invalid { background:red; } ' +
2693
2700
  '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
2694
2701
  '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
2695
2702
  ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
2696
- ' border-radius:1px; -webkit-border-radius:1px; ' +
2703
+ ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
2697
2704
  '}' +
2698
2705
  '';
2699
2706
  $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
@@ -2800,7 +2807,7 @@
2800
2807
  obj.each(function () {
2801
2808
  t = $(this);
2802
2809
  c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
2803
- t.find("li").andSelf().each(function () {
2810
+ t.find("li").addBack().each(function () {
2804
2811
  var $t = $(this), nm;
2805
2812
  $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
2806
2813
  if(rc) {
@@ -2811,19 +2818,20 @@
2811
2818
  else {
2812
2819
  $t.children(":checkbox").addClass("jstree-real-checkbox");
2813
2820
  }
2814
- if(c === "jstree-checked") {
2815
- $t.children(":checkbox").attr("checked","checked");
2821
+ }
2822
+ if(!ts) {
2823
+ if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
2824
+ $t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked", true);
2816
2825
  }
2817
2826
  }
2818
- if(c === "jstree-checked" && !ts) {
2819
- $t.find("li").addClass("jstree-checked");
2827
+ else {
2828
+ if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
2829
+ $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
2830
+ }
2820
2831
  }
2821
2832
  });
2822
2833
  });
2823
2834
  if(!ts) {
2824
- if(obj.length === 1 && obj.is("li")) { this._repair_state(obj); }
2825
- if(obj.is("li")) { obj.each(function () { _this._repair_state(this); }); }
2826
- else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }
2827
2835
  obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
2828
2836
  }
2829
2837
  },
@@ -2835,25 +2843,25 @@
2835
2843
  if(this._get_settings().checkbox.two_state) {
2836
2844
  if(state) {
2837
2845
  obj.removeClass("jstree-checked").addClass("jstree-unchecked");
2838
- if(rc) { obj.children(":checkbox").removeAttr("checked"); }
2846
+ if(rc) { obj.children(":checkbox").prop("checked", false); }
2839
2847
  }
2840
2848
  else {
2841
2849
  obj.removeClass("jstree-unchecked").addClass("jstree-checked");
2842
- if(rc) { obj.children(":checkbox").attr("checked","checked"); }
2850
+ if(rc) { obj.children(":checkbox").prop("checked", true); }
2843
2851
  }
2844
2852
  }
2845
2853
  else {
2846
2854
  if(state) {
2847
- coll = obj.find("li").andSelf();
2855
+ coll = obj.find("li").addBack();
2848
2856
  if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
2849
2857
  coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
2850
- if(rc) { coll.children(":checkbox").removeAttr("checked"); }
2858
+ if(rc) { coll.children(":checkbox").prop("checked", false); }
2851
2859
  }
2852
2860
  else {
2853
- coll = obj.find("li").andSelf();
2861
+ coll = obj.find("li").addBack();
2854
2862
  if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
2855
2863
  coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
2856
- if(rc) { coll.children(":checkbox").attr("checked","checked"); }
2864
+ if(rc) { coll.children(":checkbox").prop("checked", true); }
2857
2865
  if(this.data.ui) { this.data.ui.last_selected = obj; }
2858
2866
  this.data.checkbox.last_selected = obj;
2859
2867
  }
@@ -2861,24 +2869,24 @@
2861
2869
  var $this = $(this);
2862
2870
  if(state) {
2863
2871
  if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
2864
- $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2865
- if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
2872
+ $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2873
+ if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
2866
2874
  return false;
2867
2875
  }
2868
2876
  else {
2869
2877
  $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
2870
- if(rc) { $this.children(":checkbox").removeAttr("checked"); }
2878
+ if(rc) { $this.children(":checkbox").prop("checked", false); }
2871
2879
  }
2872
2880
  }
2873
2881
  else {
2874
2882
  if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
2875
- $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2876
- if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
2883
+ $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2884
+ if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
2877
2885
  return false;
2878
2886
  }
2879
2887
  else {
2880
2888
  $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
2881
- if(rc) { $this.children(":checkbox").attr("checked","checked"); }
2889
+ if(rc) { $this.children(":checkbox").prop("checked", true); }
2882
2890
  }
2883
2891
  }
2884
2892
  });
@@ -2936,6 +2944,10 @@
2936
2944
  _repair_state : function (obj) {
2937
2945
  obj = this._get_node(obj);
2938
2946
  if(!obj.length) { return; }
2947
+ if(this._get_settings().checkbox.two_state) {
2948
+ obj.find('li').addBack().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
2949
+ return;
2950
+ }
2939
2951
  var rc = this._get_settings().checkbox.real_checkboxes,
2940
2952
  a = obj.find("> ul > .jstree-checked").length,
2941
2953
  b = obj.find("> ul > .jstree-undetermined").length,
@@ -2944,8 +2956,8 @@
2944
2956
  else if(a === 0 && b === 0) { this.change_state(obj, true); }
2945
2957
  else if(a === c) { this.change_state(obj, false); }
2946
2958
  else {
2947
- obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2948
- if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
2959
+ obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2960
+ if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
2949
2961
  }
2950
2962
  },
2951
2963
  reselect : function () {
@@ -2983,49 +2995,37 @@
2983
2995
  */
2984
2996
  (function ($) {
2985
2997
  $.vakata.xslt = function (xml, xsl, callback) {
2986
- var rs = "", xm, xs, processor, support;
2987
- // TODO: IE9 no XSLTProcessor, no document.recalc
2988
- if(document.recalc) {
2989
- xm = document.createElement('xml');
2990
- xs = document.createElement('xml');
2991
- xm.innerHTML = xml;
2992
- xs.innerHTML = xsl;
2993
- $("body").append(xm).append(xs);
2994
- setTimeout( (function (xm, xs, callback) {
2995
- return function () {
2996
- callback.call(null, xm.transformNode(xs.XMLDocument));
2997
- setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
2998
- };
2999
- })(xm, xs, callback), 100);
3000
- return true;
2998
+ var r = false, p, q, s;
2999
+ // IE9
3000
+ if(r === false && (window.ActiveXObject || "ActiveXObject" in window)) {
3001
+ try {
3002
+ r = new ActiveXObject("Msxml2.XSLTemplate");
3003
+ q = new ActiveXObject("Msxml2.DOMDocument");
3004
+ q.loadXML(xml);
3005
+ s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
3006
+ s.loadXML(xsl);
3007
+ r.stylesheet = s;
3008
+ p = r.createProcessor();
3009
+ p.input = q;
3010
+ p.transform();
3011
+ r = p.output;
3012
+ }
3013
+ catch (e) { }
3001
3014
  }
3002
- if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
3003
- xml = new DOMParser().parseFromString(xml, "text/xml");
3004
- xsl = new DOMParser().parseFromString(xsl, "text/xml");
3005
- // alert(xml.transformNode());
3006
- // callback.call(null, new XMLSerializer().serializeToString(rs));
3007
-
3015
+ xml = $.parseXML(xml);
3016
+ xsl = $.parseXML(xsl);
3017
+ // FF, Chrome
3018
+ if(r === false && typeof (XSLTProcessor) !== "undefined") {
3019
+ p = new XSLTProcessor();
3020
+ p.importStylesheet(xsl);
3021
+ r = p.transformToFragment(xml, document);
3022
+ r = $('<div />').append(r).html();
3008
3023
  }
3009
- if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
3010
- processor = new XSLTProcessor();
3011
- support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
3012
- if(!support) { return false; }
3013
- xml = new DOMParser().parseFromString(xml, "text/xml");
3014
- xsl = new DOMParser().parseFromString(xsl, "text/xml");
3015
- if($.isFunction(processor.transformDocument)) {
3016
- rs = document.implementation.createDocument("", "", null);
3017
- processor.transformDocument(xml, xsl, rs, null);
3018
- callback.call(null, new XMLSerializer().serializeToString(rs));
3019
- return true;
3020
- }
3021
- else {
3022
- processor.importStylesheet(xsl);
3023
- rs = processor.transformToFragment(xml, document);
3024
- callback.call(null, $("<div />").append(rs).html());
3025
- return true;
3026
- }
3024
+ // OLD IE
3025
+ if(r === false && typeof (xml.transformNode) !== "undefined") {
3026
+ r = xml.transformNode(xsl);
3027
3027
  }
3028
- return false;
3028
+ callback.call(null, r);
3029
3029
  };
3030
3030
  var xsl = {
3031
3031
  'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
@@ -3194,8 +3194,8 @@
3194
3194
 
3195
3195
  obj = this._get_node(obj);
3196
3196
  if(obj && obj !== -1) {
3197
- if(obj.data("jstree-is-loading")) { return; }
3198
- else { obj.data("jstree-is-loading",true); }
3197
+ if(obj.data("jstree_is_loading")) { return; }
3198
+ else { obj.data("jstree_is_loading",true); }
3199
3199
  }
3200
3200
  switch(!0) {
3201
3201
  case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
@@ -3207,14 +3207,14 @@
3207
3207
  if(d.length > 10) {
3208
3208
  d = $(d);
3209
3209
  if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
3210
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
3210
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
3211
3211
  if(s.clean_node) { this.clean_node(obj); }
3212
3212
  if(s_call) { s_call.call(this); }
3213
3213
  }
3214
3214
  else {
3215
3215
  if(obj && obj !== -1) {
3216
3216
  obj.children("a.jstree-loading").removeClass("jstree-loading");
3217
- obj.removeData("jstree-is-loading");
3217
+ obj.removeData("jstree_is_loading");
3218
3218
  if(s.correct_state) {
3219
3219
  this.correct_state(obj);
3220
3220
  if(s_call) { s_call.call(this); }
@@ -3258,7 +3258,7 @@
3258
3258
  if(ef) { ef.call(this, x, t, e); }
3259
3259
  if(obj !== -1 && obj.length) {
3260
3260
  obj.children("a.jstree-loading").removeClass("jstree-loading");
3261
- obj.removeData("jstree-is-loading");
3261
+ obj.removeData("jstree_is_loading");
3262
3262
  if(t === "success" && s.correct_state) { this.correct_state(obj); }
3263
3263
  }
3264
3264
  else {
@@ -3279,14 +3279,14 @@
3279
3279
  if(d.length > 10) {
3280
3280
  d = $(d);
3281
3281
  if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
3282
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
3282
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
3283
3283
  if(s.clean_node) { this.clean_node(obj); }
3284
3284
  if(s_call) { s_call.call(this); }
3285
3285
  }
3286
3286
  else {
3287
3287
  if(obj && obj !== -1) {
3288
3288
  obj.children("a.jstree-loading").removeClass("jstree-loading");
3289
- obj.removeData("jstree-is-loading");
3289
+ obj.removeData("jstree_is_loading");
3290
3290
  if(s.correct_state) {
3291
3291
  this.correct_state(obj);
3292
3292
  if(s_call) { s_call.call(this); }
@@ -3401,12 +3401,26 @@
3401
3401
  * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
3402
3402
  */
3403
3403
  (function ($) {
3404
- $.expr[':'].jstree_contains = function(a,i,m){
3405
- return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
3406
- };
3407
- $.expr[':'].jstree_title_contains = function(a,i,m) {
3408
- return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
3409
- };
3404
+ if($().jquery.split('.')[1] >= 8) {
3405
+ $.expr[':'].jstree_contains = $.expr.createPseudo(function(search) {
3406
+ return function(a) {
3407
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
3408
+ };
3409
+ });
3410
+ $.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
3411
+ return function(a) {
3412
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
3413
+ };
3414
+ });
3415
+ }
3416
+ else {
3417
+ $.expr[':'].jstree_contains = function(a,i,m){
3418
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
3419
+ };
3420
+ $.expr[':'].jstree_title_contains = function(a,i,m) {
3421
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
3422
+ };
3423
+ }
3410
3424
  $.jstree.plugin("search", {
3411
3425
  __init : function () {
3412
3426
  this.data.search.str = "";
@@ -3415,7 +3429,7 @@
3415
3429
  this.get_container()
3416
3430
  .bind("search.jstree", function (e, data) {
3417
3431
  $(this).children("ul").find("li").hide().removeClass("jstree-last");
3418
- data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
3432
+ data.rslt.nodes.parentsUntil(".jstree").addBack().show()
3419
3433
  .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
3420
3434
  })
3421
3435
  .bind("clear_search.jstree", function () {
@@ -3686,6 +3700,11 @@
3686
3700
  this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
3687
3701
  }
3688
3702
  }, this))
3703
+ .delegate("a", "click.jstree", $.proxy(function (e) {
3704
+ if(this.data.contextmenu) {
3705
+ $.vakata.context.hide();
3706
+ }
3707
+ }, this))
3689
3708
  .bind("destroy.jstree", $.proxy(function () {
3690
3709
  // TODO: move this to descruct method
3691
3710
  if(this.data.contextmenu) {
@@ -3996,7 +4015,7 @@
3996
4015
  // this used to use html() and clean the whitespace, but this way any attached data was lost
3997
4016
  this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
3998
4017
  // remove white space from LI node - otherwise nodes appear a bit to the right
3999
- this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
4018
+ this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove();
4000
4019
  },
4001
4020
  defaults : {
4002
4021
  data : false,
@@ -4016,8 +4035,8 @@
4016
4035
  success_func = function () {};
4017
4036
  obj = this._get_node(obj);
4018
4037
  if(obj && obj !== -1) {
4019
- if(obj.data("jstree-is-loading")) { return; }
4020
- else { obj.data("jstree-is-loading",true); }
4038
+ if(obj.data("jstree_is_loading")) { return; }
4039
+ else { obj.data("jstree_is_loading",true); }
4021
4040
  }
4022
4041
  switch(!0) {
4023
4042
  case ($.isFunction(s.data)):
@@ -4026,14 +4045,14 @@
4026
4045
  d = $(d);
4027
4046
  if(!d.is("ul")) { d = $("<ul />").append(d); }
4028
4047
  if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
4029
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
4048
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
4030
4049
  this.clean_node(obj);
4031
4050
  if(s_call) { s_call.call(this); }
4032
4051
  }
4033
4052
  else {
4034
4053
  if(obj && obj !== -1) {
4035
4054
  obj.children("a.jstree-loading").removeClass("jstree-loading");
4036
- obj.removeData("jstree-is-loading");
4055
+ obj.removeData("jstree_is_loading");
4037
4056
  if(s.correct_state) {
4038
4057
  this.correct_state(obj);
4039
4058
  if(s_call) { s_call.call(this); }
@@ -4078,7 +4097,7 @@
4078
4097
  if(ef) { ef.call(this, x, t, e); }
4079
4098
  if(obj != -1 && obj.length) {
4080
4099
  obj.children("a.jstree-loading").removeClass("jstree-loading");
4081
- obj.removeData("jstree-is-loading");
4100
+ obj.removeData("jstree_is_loading");
4082
4101
  if(t === "success" && s.correct_state) { this.correct_state(obj); }
4083
4102
  }
4084
4103
  else {
@@ -4096,14 +4115,14 @@
4096
4115
  d = $(d);
4097
4116
  if(!d.is("ul")) { d = $("<ul />").append(d); }
4098
4117
  if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
4099
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
4118
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
4100
4119
  this.clean_node(obj);
4101
4120
  if(s_call) { s_call.call(this); }
4102
4121
  }
4103
4122
  else {
4104
4123
  if(obj && obj !== -1) {
4105
4124
  obj.children("a.jstree-loading").removeClass("jstree-loading");
4106
- obj.removeData("jstree-is-loading");
4125
+ obj.removeData("jstree_is_loading");
4107
4126
  if(s.correct_state) {
4108
4127
  this.correct_state(obj);
4109
4128
  if(s_call) { s_call.call(this); }
@@ -4214,7 +4233,8 @@
4214
4233
  _fn : {
4215
4234
  _themeroller : function (obj) {
4216
4235
  var s = this._get_settings().themeroller;
4217
- obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
4236
+ obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
4237
+ obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
4218
4238
  obj
4219
4239
  .find("li.jstree-closed")
4220
4240
  .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
@@ -4327,15 +4347,19 @@
4327
4347
  },
4328
4348
  _fn : {
4329
4349
  _check_unique : function (nms, p, func) {
4330
- var cnms = [];
4350
+ var cnms = [], ok = true;
4331
4351
  p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
4332
4352
  if(!cnms.length || !nms.length) { return true; }
4333
- cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
4334
- if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
4353
+ $.each(nms, function (i, v) {
4354
+ if($.inArray(v, cnms) !== -1) {
4355
+ ok = false;
4356
+ return false;
4357
+ }
4358
+ });
4359
+ if(!ok) {
4335
4360
  this._get_settings().unique.error_callback.call(null, nms, p, func);
4336
- return false;
4337
4361
  }
4338
- return true;
4362
+ return ok;
4339
4363
  },
4340
4364
  check_move : function () {
4341
4365
  if(!this.__call_old()) { return false; }
@@ -4422,7 +4446,7 @@
4422
4446
  obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
4423
4447
  if(obj === false) { return; } // added for removing root nodes
4424
4448
  obj.each(function () {
4425
- $(this).find("li").andSelf().each(function () {
4449
+ $(this).find("li").addBack().each(function () {
4426
4450
  var $t = $(this);
4427
4451
  if($t.children(".jstree-wholerow-span").length) { return true; }
4428
4452
  $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-18 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.5
19
+ version: 3.2.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.5
26
+ version: 3.2.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.5
33
+ version: 3.2.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.5
40
+ version: 3.2.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap-sass
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -547,7 +547,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
547
547
  requirements:
548
548
  - none
549
549
  rubyforge_project:
550
- rubygems_version: 2.6.13
550
+ rubygems_version: 2.6.10
551
551
  signing_key:
552
552
  specification_version: 4
553
553
  summary: backend e-commerce functionality for the Spree project.