diff --git a/thirdparty/jquery-entwine/LICENSE b/thirdparty/jquery-entwine/LICENSE
old mode 100644
new mode 100755
diff --git a/thirdparty/jquery-entwine/README.textile b/thirdparty/jquery-entwine/README.textile
old mode 100644
new mode 100755
diff --git a/thirdparty/jquery-entwine/build.sh b/thirdparty/jquery-entwine/build.sh
deleted file mode 100644
index 27bb3ca45..000000000
--- a/thirdparty/jquery-entwine/build.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-# Specify the output file's name
-FILE="dist/jquery.entwine-dist.js"
-
-mkdir -p dist
-rm dist/*.js
-
-echo "/* jQuery.Entwine - Copyright 2009-2011 Hamish Friedlander and SilverStripe. Version $VER. */" > $FILE
-
-for x in \
- vendor/jquery.selector/jquery.class.js \
- vendor/jquery.selector/jquery.selector.js \
- vendor/jquery.selector/jquery.selector.specifity.js \
- vendor/jquery.selector/jquery.selector.matches.js \
- src/jquery.selector.affectedby.js \
- src/jquery.focusinout.js \
- src/jquery.entwine.js \
- src/domevents/jquery.entwine.domevents.addrem.js \
- src/domevents/jquery.entwine.domevents.maybechanged.js \
- src/jquery.entwine.events.js \
- src/jquery.entwine.eventcapture.js \
- src/jquery.entwine.ctors.js \
- src/jquery.entwine.addrem.js \
- src/jquery.entwine.properties.js \
- src/jquery.entwine.legacy.js
-do \
- echo >> $FILE
- echo "/* $x */" >> $FILE
- echo >> $FILE
- cat $x >> $FILE
- echo ';' >> $FILE
- echo >> $FILE
-done
-
-cp $FILE "dist/jquery.concrete-dist.js"
-
-# cp LICENSE /tmp/
-# cp $FILE /tmp/
-
-# git checkout dist
-# mv /tmp/$FILE .
-# mv /tmp/LICENSE .
-
-# git add $FILE
-# git add LICENSE
-# git commit -m "Update dist to master version $VER"
-
-# git checkout master
diff --git a/thirdparty/jquery-entwine/dist/jquery.concrete-dist.js b/thirdparty/jquery-entwine/dist/jquery.concrete-dist.js
old mode 100644
new mode 100755
index f0bbb8eb3..ae4347aaf
--- a/thirdparty/jquery-entwine/dist/jquery.concrete-dist.js
+++ b/thirdparty/jquery-entwine/dist/jquery.concrete-dist.js
@@ -753,8 +753,11 @@ Sizzle is good for finding elements for a selector, but not so good for telling
* Add focusin and focusout support to bind and live for browers other than IE. Designed to be usable in a delegated fashion (like $.live)
* Copyright (c) 2007 Jörn Zaefferer
*/
- $.support.focusInOut = !!($.browser.msie);
- if (!$.support.focusInOut) {
+ if ($.support.focusinBubbles === undefined) {
+ $.support.focusinBubbles = !!($.browser.msie);
+ }
+
+ if (!$.support.focusinBubbles && !$.event.special.focusin) {
// Emulate focusin and focusout by binding focus and blur in capturing mode
$.each({focus: 'focusin', blur: 'focusout'}, function(original, fix){
$.event.special[fix] = {
@@ -807,8 +810,30 @@ catch (e) {
window.console = undefined;
}
-(function($) {
-
+(function($) {
+
+ /* Create a subclass of the jQuery object. This was introduced in jQuery 1.5, but removed again in 1.9 */
+ var sub = function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+
+ jQuery.extend( true, jQuerySub, $ );
+ jQuerySub.superclass = $;
+ jQuerySub.fn = jQuerySub.prototype = $();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ };
+
var namespaces = {};
$.entwine = function() {
@@ -928,49 +953,9 @@ catch (e) {
}
else {
// We're in a namespace, so we build a Class that subclasses the jQuery Object Class to inject namespace functions into
-
- // jQuery 1.5 already provides a nice way to subclass, so use it
- if ($.sub) {
- this.$ = $.sub();
- this.injectee = this.$.prototype;
- }
- // For jQuery < 1.5 we have to do it ourselves
- else {
- var subfn = function(){};
- this.injectee = subfn.prototype = new $;
-
- // And then we provide an overriding $ that returns objects of our new Class, and an overriding pushStack to catch further selection building
- var bound$ = this.$ = function(a) {
- // Try the simple way first
- var jq = $.fn.init.apply(new subfn(), arguments);
- if (jq instanceof subfn) return jq;
-
- // That didn't return a bound object, so now we need to copy it
- var rv = new subfn();
- rv.selector = jq.selector; rv.context = jq.context; var i = rv.length = jq.length;
- while (i--) rv[i] = jq[i];
- return rv;
- };
-
- this.injectee.pushStack = function(elems, name, selector){
- var ret = bound$(elems);
+ this.$ = $.sub ? $.sub() : sub();
+ this.injectee = this.$.prototype;
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- if ( name === "find" ) ret.selector = this.selector + (this.selector ? " " : "") + selector;
- else if ( name ) ret.selector = this.selector + "." + name + "(" + selector + ")";
-
- // Return the newly-formed element set
- return ret;
- };
-
- // Copy static functions through from $ to this.$ so e.g. $.ajax still works
- // @bug, @cantfix: Any class functions added to $ after this call won't get mirrored through
- $.extend(this.$, $);
- }
-
// We override entwine to inject the name of this namespace when defining blocks inside this namespace
var entwine_wrapper = this.injectee.entwine = function(spacename) {
var args = arguments;
diff --git a/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js b/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js
old mode 100644
new mode 100755
index f0bbb8eb3..a0b3d1dc4
--- a/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js
+++ b/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js
@@ -753,8 +753,11 @@ Sizzle is good for finding elements for a selector, but not so good for telling
* Add focusin and focusout support to bind and live for browers other than IE. Designed to be usable in a delegated fashion (like $.live)
* Copyright (c) 2007 Jörn Zaefferer
*/
- $.support.focusInOut = !!($.browser.msie);
- if (!$.support.focusInOut) {
+ if ($.support.focusinBubbles === undefined) {
+ $.support.focusinBubbles = !!($.browser.msie);
+ }
+
+ if (!$.support.focusinBubbles && !$.event.special.focusin) {
// Emulate focusin and focusout by binding focus and blur in capturing mode
$.each({focus: 'focusin', blur: 'focusout'}, function(original, fix){
$.event.special[fix] = {
@@ -807,8 +810,30 @@ catch (e) {
window.console = undefined;
}
-(function($) {
-
+(function($) {
+
+ /* Create a subclass of the jQuery object. This was introduced in jQuery 1.5, but removed again in 1.9 */
+ var sub = function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+
+ jQuery.extend( true, jQuerySub, $ );
+ jQuerySub.superclass = $;
+ jQuerySub.fn = jQuerySub.prototype = $();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ };
+
var namespaces = {};
$.entwine = function() {
@@ -928,49 +953,12 @@ catch (e) {
}
else {
// We're in a namespace, so we build a Class that subclasses the jQuery Object Class to inject namespace functions into
-
- // jQuery 1.5 already provides a nice way to subclass, so use it
- if ($.sub) {
- this.$ = $.sub();
- this.injectee = this.$.prototype;
- }
- // For jQuery < 1.5 we have to do it ourselves
- else {
- var subfn = function(){};
- this.injectee = subfn.prototype = new $;
-
- // And then we provide an overriding $ that returns objects of our new Class, and an overriding pushStack to catch further selection building
- var bound$ = this.$ = function(a) {
- // Try the simple way first
- var jq = $.fn.init.apply(new subfn(), arguments);
- if (jq instanceof subfn) return jq;
-
- // That didn't return a bound object, so now we need to copy it
- var rv = new subfn();
- rv.selector = jq.selector; rv.context = jq.context; var i = rv.length = jq.length;
- while (i--) rv[i] = jq[i];
- return rv;
- };
-
- this.injectee.pushStack = function(elems, name, selector){
- var ret = bound$(elems);
+ this.$ = $.sub ? $.sub() : sub();
+ // Work around bug in sub() - subclass must share cache with root or data won't get cleared by cleanData
+ this.$.cache = $.cache;
+
+ this.injectee = this.$.prototype;
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- if ( name === "find" ) ret.selector = this.selector + (this.selector ? " " : "") + selector;
- else if ( name ) ret.selector = this.selector + "." + name + "(" + selector + ")";
-
- // Return the newly-formed element set
- return ret;
- };
-
- // Copy static functions through from $ to this.$ so e.g. $.ajax still works
- // @bug, @cantfix: Any class functions added to $ after this call won't get mirrored through
- $.extend(this.$, $);
- }
-
// We override entwine to inject the name of this namespace when defining blocks inside this namespace
var entwine_wrapper = this.injectee.entwine = function(spacename) {
var args = arguments;
@@ -1205,32 +1193,37 @@ catch (e) {
var dontTrigger = false;
+ var patchDomManipCallback = function(original) {
+ var patched = function(elem){
+ var added = [];
+
+ if (!dontTrigger) {
+ if (elem.nodeType == 1) added[added.length] = elem;
+ getElements(added, elem);
+ }
+
+ var rv = original.apply(this, arguments);
+
+ if (!dontTrigger && added.length) {
+ var event = $.Event('EntwineElementsAdded');
+ event.targets = added;
+ $(document).triggerHandler(event);
+ }
+
+ return rv;
+ }
+ patched.patched = true;
+
+ return patched;
+ }
+
+ var version = $.prototype.jquery.split('.');
+ var callbackIdx = (version[0] > 1 || version[1] >= 10 ? 1 : 2);
+
// Monkey patch $.fn.domManip to catch all regular jQuery add element calls
var _domManip = $.prototype.domManip;
- $.prototype.domManip = function(args, table, callback) {
- if (!callback.patched) {
- var original = callback;
- arguments[2] = function(elem){
- var added = [];
-
- if (!dontTrigger) {
- if (elem.nodeType == 1) added[added.length] = elem;
- getElements(added, elem);
- }
-
- var rv = original.apply(this, arguments);
-
- if (!dontTrigger && added.length) {
- var event = $.Event('EntwineElementsAdded');
- event.targets = added;
- $(document).triggerHandler(event);
- }
-
- return rv;
- }
- arguments[2].patched = true;
- }
-
+ $.prototype.domManip = function() {
+ if (!arguments[callbackIdx].patched) arguments[callbackIdx] = patchDomManipCallback(arguments[callbackIdx]);
return _domManip.apply(this, arguments);
}
@@ -1772,6 +1765,12 @@ catch (e) {
}
};
+ var document_proxy = function(selector, handler, includechildren) {
+ return function(e){
+ if (e.target === document) return handler.apply(this, arguments);
+ }
+ };
+
var window_proxy = function(selector, handler, includechildren) {
return function(e){
if (e.target === window) return handler.apply(this, arguments);
@@ -1805,6 +1804,7 @@ catch (e) {
if (from.match(/[^\w]/)) proxyGen = selector_proxy;
else if (from == 'Window' || from == 'window') proxyGen = window_proxy;
+ else if (from == 'Document' || from == 'document') proxyGen = document_proxy;
else proxyGen = property_proxy;
for (var onevent in v) {
diff --git a/thirdparty/jquery-entwine/spec/SpecRunner.html b/thirdparty/jquery-entwine/spec/SpecRunner.html
deleted file mode 100644
index 2b501aff7..000000000
--- a/thirdparty/jquery-entwine/spec/SpecRunner.html
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
- Jasmine Test Runner
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/thirdparty/jquery-entwine/spec/spec.entwine.addrem.js b/thirdparty/jquery-entwine/spec/spec.entwine.addrem.js
deleted file mode 100644
index bbedf2914..000000000
--- a/thirdparty/jquery-entwine/spec/spec.entwine.addrem.js
+++ /dev/null
@@ -1,113 +0,0 @@
-describe('Entwine', function(){
-
- beforeEach(function(){
- $('body').append('');
- });
-
- afterEach(function(){
- $('#dom_test').remove();
- });
-
- describe('onadd and onremove', function(){
-
- beforeEach(function(){
- $.entwine.synchronous_mode();
- $.entwine.clear_all_rules();
- $('#dom_test').html('');
- });
-
- describe('onremove', function(){
- it('calls onremove on a removed element', function(){
- var called = false;
-
- $('#a').entwine({
- onremove: function(){called = true;}
- });
-
- $('#a').remove();
- expect(called).toBeTruthy();
- });
-
- it('calls onremove only on elements that match selectors, and does so when multiple elements are removed', function(){
- var removed = [];
-
- $('#a').html('');
-
- $('.catchremove').entwine({
- onremove: function(){removed.push(this.attr('id'));}
- });
-
- $('#a').remove();
- expect(removed).toEqual(['d', 'b']);
- });
-
- it('allows access to data in an onremove handler', function(){
- var val = 0;
-
- $('#a').data('Bam', 1);
-
- $('#a').entwine({
- onremove: function(){val = this.data('Bam');}
- });
-
- $('#a').remove();
- expect(val).toEqual(1);
- });
- });
-
- describe('onadd', function(){
- it('calls onadd on an appended', function(){
- var called = false;
-
- $('#b').entwine({
- onadd: function(){called = true;}
- });
-
- $('#a').append('');
- expect(called).toBeTruthy();
- });
-
- it('calls onadd on an child thats nested when appended', function(){
- var called = false;
-
- $('#b').entwine({
- onadd: function(){called = true;}
- });
-
- $('#a').append('');
- expect(called).toBeTruthy();
- });
-
- it('calls onadd on an item added via html', function(){
- var called = false;
-
- $('#b').entwine({
- onadd: function(){called = true;}
- });
-
- $('#a').html('');
- expect(called).toBeTruthy();
- });
-
- it('calls onadd and onremove correctly via replaceWith', function(){
- var added = [], removed = [], sequence = [];
-
- $('#a,#b').entwine({
- onadd: function(){
- added.push(this.attr('id'));
- sequence.push(this.attr('id'));
- },
- onremove: function(){
- removed.push(this.attr('id'));
- sequence.push(this.attr('id'));
- }
- });
-
- $('#a').replaceWith('');
- expect(added).toEqual(['b']);
- expect(removed).toEqual(['a']);
- expect(sequence).toEqual(['a', 'b']);
- });
- });
- });
-});
\ No newline at end of file
diff --git a/thirdparty/jquery-entwine/spec/spec.entwine.basics.js b/thirdparty/jquery-entwine/spec/spec.entwine.basics.js
deleted file mode 100644
index 189e9a236..000000000
--- a/thirdparty/jquery-entwine/spec/spec.entwine.basics.js
+++ /dev/null
@@ -1,103 +0,0 @@
-describe('Entwine', function(){
-
- beforeEach(function(){
- $.entwine.warningLevel = $.entwine.WARN_LEVEL_BESTPRACTISE;
- $('body').append('');
- });
-
- afterEach(function(){
- $('#dom_test').remove();
- });
-
- describe('Basics', function(){
-
- beforeEach(function(){
- $.entwine.clear_all_rules();
- $('#dom_test').html('');
- });
-
- it('can attach and call a base function', function(){
- $('#a').entwine({
- foo: function(){return this.attr('id');}
- });
-
- expect($('.a').foo()).toEqual('a');
- });
-
- it('can attach and call a base function on a selector using a data attribute selection', function(){
- $('[data-fieldtype=foo]').entwine({
- foo: function(){return this.attr('id');}
- });
-
- expect($('.a').foo()).toEqual('a');
- });
-
- it('can attach and call a base function on a selector using a psuedo-selector taken from jquery', function(){
- $('#a:visible').entwine({
- foo: function(){return this.attr('id');}
- });
-
- expect($('.a').foo()).toEqual('a');
- });
-
- it('can attach and call several base functions', function(){
- $('#a').entwine({
- foo: function(){return 'foo_' + this.attr('id');},
- bar: function(){return 'bar_' + this.attr('id');}
- });
-
- expect($('.a').foo()).toEqual('foo_a');
- expect($('.a').bar()).toEqual('bar_a');
- });
-
- it('can attach and call a namespaced function', function(){
- $.entwine('bar', function($){
- $('#a').entwine({
- foo: function(){return this.attr('id');}
- });
- });
-
- expect($('.a').entwine('bar').foo()).toEqual('a');
- });
-
- it('can attach and call a nested namespaced function', function(){
- $.entwine('qux.baz.bar', function($){
- $('#a').entwine({
- foo: function(){return this.attr('id');}
- });
- });
-
- expect($('.a').entwine('qux.baz.bar').foo()).toEqual('a');
- });
-
- it('can call two functions on two elements', function(){
- var res = [];
-
- $('#a').entwine({
- foo: function(){res.push(this.attr('id'));}
- });
- $('#b.c').entwine({
- foo: function(){res.push(this.attr('id'));}
- });
-
- $('#dom_test div').foo();
- expect(res).toEqual(['b', 'a']);
- });
-
- it('can call two namespaced functions on two elements', function(){
- var res = [];
-
- $.entwine('bar', function($){
- $('#a').entwine({
- foo: function(){res.push(this.attr('id'));}
- });
- $('#b.c').entwine({
- foo: function(){res.push(this.attr('id'));}
- });
- });
-
- $('#dom_test div').entwine('bar').foo();
- expect(res).toEqual(['b', 'a']);
- });
- });
-});
\ No newline at end of file
diff --git a/thirdparty/jquery-entwine/spec/spec.entwine.ctors.js b/thirdparty/jquery-entwine/spec/spec.entwine.ctors.js
deleted file mode 100644
index f9df6dc9c..000000000
--- a/thirdparty/jquery-entwine/spec/spec.entwine.ctors.js
+++ /dev/null
@@ -1,147 +0,0 @@
-describe('Entwine', function(){
-
- beforeEach(function(){
- $('body').append('');
- });
-
- afterEach(function(){
- $('#dom_test').remove();
- });
-
- describe('Ctors', function(){
-
- beforeEach(function(){
- $.entwine.synchronous_mode();
- $.entwine.clear_all_rules();
- $('#dom_test').html('');
- });
-
- it('calls onmatch when new element created', function(){
- var a = false;
-
- $('#b').entwine({
- onmatch: function(){a = true;}
- });
-
- expect(a).toBeFalsy();
-
- $('#a').after('');
- expect(a).toBeTruthy();
- });
-
- it('calls onunmatch when new element deleted', function(){
- var a = 0;
-
- $('#b').entwine({
- onmatch: function(){a = 1;},
- onunmatch: function(){a = 2;}
- });
-
- expect(a).toEqual(0);
-
- $('#a').after('');
- expect(a).toEqual(1);
-
- $('#b').remove();
- expect(a).toEqual(2);
- });
-
- it('calls onmatch when ruleset matches after class added', function(){
- var a = 0;
-
- $('#a.foo').entwine({
- onmatch: function(){a = 1;}
- });
-
- expect(a).toEqual(0);
-
- $('#a').addClass('foo');
- expect(a).toEqual(1);
- });
-
- it('calls onmatch in both direct and namespaced onmatch, does not call less specific onmatch', function(){
- var a = 0, b = 0, c = 0, d = 0;
-
- $('.foo').entwine({
- onmatch: function(){a = 1;}
- });
- $('.foo').entwine('bar', function($){return{
- onmatch: function(){b = 1;}
- };});
- $('#a.foo').entwine({
- onmatch: function(){c = 1;}
- });
- $('#a.foo').entwine('bar', function($){return{
- onmatch: function(){d = 1;}
- };});
-
- expect([a, b, c, d]).toEqual([0, 0, 0, 0]);
-
- $('#a').addClass('foo');
- expect([a, b, c, d]).toEqual([0, 0, 1, 1]);
- });
-
- it('calls onmatch in both direct and namespaced onmatch, super works as expected', function(){
- var a = 0, b = 0, c = 0, d = 0;
-
- $('.foo').entwine({
- onmatch: function(){a += 1;}
- });
- $('.foo').entwine('bar', function($){return{
- onmatch: function(){b += 1;}
- };});
- $('#a.foo').entwine({
- onmatch: function(){this._super(); c = 1; this._super();}
- });
- $('#a.foo').entwine('bar', function($){return{
- onmatch: function(){this._super(); d = 1; this._super();}
- };});
-
- expect([a, b, c, d]).toEqual([0, 0, 0, 0]);
-
- $('#a').addClass('foo');
- expect([a, b, c, d]).toEqual([2, 2, 1, 1]);
- });
-
- it('handles onmatch rules being added post document.onready', function(){
- var a = 0, b = 0;
-
- $('#a').entwine({
- onmatch: function(){a += 1;}
- });
- $('#a.a').entwine({
- onmatch: function(){b += 1;}
- });
-
- // Rules are new, and no DOM change, so no triggers yet
- expect([a, b]).toEqual([0, 0]);
-
- // New #a.a rule thinks it matches no nodes, and so removing .a would normally not release it. Check we handle
- $('#a').removeClass('a');
- expect([a, b]).toEqual([1, 0]);
- });
-
- it('calls onmatch in less specific rule when more specific rule no longer matches', function(){
- var a = 0, b = 0, c = 0;
-
- $('#a').entwine({
- onmatch: function(){a += 1;}
- });
- $('#a.a').entwine({
- onmatch: function(){b += 1;}
- });
- $('#a.a.b').entwine({
- onmatch: function(){c += 1;}
- });
-
- $.entwine.triggerMatching();
- expect([a, b, c]).toEqual([0, 0, 1]);
-
- $('#a').removeClass('b');
- expect([a, b, c]).toEqual([0, 1, 1]);
-
- $('#a').removeClass('a');
- expect([a, b, c]).toEqual([1, 1, 1]);
- });
- });
-});
\ No newline at end of file
diff --git a/thirdparty/jquery-entwine/spec/spec.entwine.eventcapture.js b/thirdparty/jquery-entwine/spec/spec.entwine.eventcapture.js
deleted file mode 100644
index 2e8209591..000000000
--- a/thirdparty/jquery-entwine/spec/spec.entwine.eventcapture.js
+++ /dev/null
@@ -1,141 +0,0 @@
-describe('Entwine', function(){
-
- beforeEach(function(){
- $('body').append('');
- });
-
- afterEach(function(){
- $('#dom_test').remove();
- });
-
- describe('Event Capture', function(){
-
- beforeEach(function(){
- $.entwine.synchronous_mode();
- $.entwine.clear_all_rules();
- $('#dom_test').html('');
- });
-
- it('can capture by direct selector', function(){
- var triggers = [];
-
- $('#d').entwine({
- 'from#a': {
- onsynthetic: function(){ triggers.push(this.attr('id')); }
- }
- });
-
- $('#a').trigger('synthetic');
- expect(triggers).toEqual(['d'])
-
- $('#a').trigger('synthetic');
- expect(triggers).toEqual(['d', 'd']);
-
- $('#dom_test').trigger('synthetic');
- expect(triggers).toEqual(['d', 'd']);
- });
-
- it('can capture by indirect selector', function(){
- var triggercount = 0;
-
- $('#d').entwine({
- A: '#a',
- fromA: {
- onsynthetic: function(){ triggercount += 1;}
- }
- });
-
- $('#a').trigger('synthetic');
- expect(triggercount).toEqual(1);
-
- $('#a').trigger('synthetic');
- expect(triggercount).toEqual(2);
-
- $('#dom_test').trigger('synthetic');
- expect(triggercount).toEqual(2);
- });
-
- it('can capture by returning element set', function(){
- var triggercount = 0;
-
- $('#d').entwine({
- getA: function(){ return this.parent(); },
- fromA: {
- onsynthetic: function(){ triggercount += 1;}
- }
- });
-
- $('#a').trigger('synthetic');
- expect(triggercount).toEqual(1);
-
- $('#a').trigger('synthetic');
- expect(triggercount).toEqual(2);
-
- $('#dom_test').trigger('synthetic');
- expect(triggercount).toEqual(2);
- });
-
- it('can capture by selector, more specific rules override correct', function(){
- var triggerlist = [];
-
- $('.d').entwine({
- 'from#a': {
- onsynthetic: function(){ triggerlist.push(1); }
- }
- });
- $('#d').entwine({
- 'from#a': {
- onsynthetic: function(){ triggerlist.push(2); }
- }
- });
-
- $('#a').trigger('synthetic');
- expect(triggerlist).toEqual([2]);
- });
-
- it('gets events and data passed through correctly', function(){
- var a, b;
-
- $('#d').entwine({
- 'from#a': {
- onsynthetic: function(e, data){ a = e.passthrough; b = data; }
- }
- });
-
- var e = $.Event('synthetic'); e.passthrough = 'foo';
- $('#a').trigger(e, ['bam']);
-
- expect(a).toEqual('foo');
- expect(b).toEqual('bam');
- });
-
- it('can handle different from endings', function(){
- var triggercount = 0;
-
- $('#d').entwine({
- 'from#a': {
- onsynthetic: function(){ triggercount += 1;}
- },
- 'from.b': {
- onsynthetic: function(){ triggercount += 1;}
- }
- });
-
- $('#a').trigger('synthetic');
- expect(triggercount).toEqual(2);
- });
-
- it('can capture from window', function(){
- var triggercount = 0;
-
- $('#d').entwine({
- fromWindow: {
- onsynthetic: function(){ triggercount += 1;}
- }
- });
-
- $(window).trigger('synthetic');
- expect(triggercount).toEqual(1);
- });
- });
-});
\ No newline at end of file
diff --git a/thirdparty/jquery-entwine/spec/spec.entwine.events.js b/thirdparty/jquery-entwine/spec/spec.entwine.events.js
deleted file mode 100644
index 58d5b72d4..000000000
--- a/thirdparty/jquery-entwine/spec/spec.entwine.events.js
+++ /dev/null
@@ -1,223 +0,0 @@
-describe('Entwine', function(){
-
- beforeEach(function(){
- $('body').append('');
- });
-
- afterEach(function(){
- $('#dom_test').remove();
- });
-
- describe('Events', function(){
-
- beforeEach(function(){
- $.entwine.synchronous_mode();
- $.entwine.clear_all_rules();
- $('#dom_test').html('');
- });
-
- it('calls onfoo when foo triggered', function(){
- var a = 0;
-
- $('#a').entwine({
- onfoo: function(){a = 1;}
- });
-
- expect(a).toEqual(0);
-
- $('#a').trigger('foo');
- expect(a).toEqual(1);
- });
-
- it('only calls most specific onfoo when foo triggered', function(){
- var a = 0, b = 0;
-
- $('#a.a').entwine({
- onfoo: function(){a = 1;}
- });
- $('#a').entwine({
- onfoo: function(){b = 1;}
- });
-
- expect(a).toEqual(0);
- expect(b).toEqual(0);
-
- $('#a').trigger('foo');
- expect(a).toEqual(1);
- expect(b).toEqual(0);
- });
-
- it('calls namespaced onfoo when foo triggered', function(){
- var a = 0;
-
- $('#a').entwine('bar', function($){return{
- onfoo: function(){a = 1;}
- };});
-
- expect(a).toEqual(0);
-
- $('#a').trigger('foo');
- expect(a).toEqual(1);
- });
-
- it('calls most specific namespaced onfoo and most specific non-namespaced onfoo when foo triggered', function(){
- var a = 0, b = 0, c = 0, d = 0;
-
- $('#a.a').entwine({
- onfoo: function(){a = 1;}
- });
- $('#a').entwine({
- onfoo: function(){b = 1;}
- });
- $('#a.a').entwine('bar', function($){return{
- onfoo: function(){c = 1;}
- };});
- $('#a').entwine('bar', function($){return{
- onfoo: function(){d = 1;}
- };});
-
- expect([a, b, c, d]).toEqual([0, 0, 0, 0]);
-
- $('#a').trigger('foo');
- expect([a, b, c, d]).toEqual([1, 0, 1, 0]);
- });
-
- it('calls up correctly on _super', function(){
- var a = 0, b = 0;
-
- $('#a').entwine({
- onfoo: function(){a += 1;}
- });
- $('#a.a').entwine({
- onfoo: function(){this._super(); b += 1; this._super();}
- });
-
- expect([a, b]).toEqual([0, 0]);
-
- $('#a').trigger('foo')
- expect([a, b]).toEqual([2, 1]);
- });
-
- it('passes event object', function(){
- var event;
-
- $('#a').entwine({
- onfoo: function(e){event = e;}
- });
-
- $('#a').trigger('foo');
- expect(event.type).toBeDefined();
- expect(event.type).toEqual('foo');
- expect(event.target).toHaveAttr('id', 'a');
- });
-
- it('delegates submit events to forms', function(){
- var a = 0;
- $('