diff --git a/examples/jqueryselect2/README b/examples/jqueryselect2/README
new file mode 100644
index 000000000..f00e7fb65
--- /dev/null
+++ b/examples/jqueryselect2/README
@@ -0,0 +1,15 @@
+== Description ==
+
+This is an example of how to integrate a complex jQuery component with pyjs.
+
+Here we integrate Select2 to implement a tagging component.
+Not all functionality of Select2 is implemented. Only:
+
+- set / get values
+- receive change notifications
+
+== Issues ==
+
+pyjd is not supported (doesn't do javascript)
+
+The CSS is not right
diff --git a/examples/jqueryselect2/Select2TaggingComponent.py b/examples/jqueryselect2/Select2TaggingComponent.py
new file mode 100644
index 000000000..be78e6b7f
--- /dev/null
+++ b/examples/jqueryselect2/Select2TaggingComponent.py
@@ -0,0 +1,75 @@
+from pyjamas.ui.HTML import HTML
+from pyjamas import logging
+from __pyjamas__ import JS
+from __pyjamas__ import wnd
+
+log = logging.getConsoleLogger()
+
+class Select2TaggingComponent(HTML):
+
+ def __init__(self, tags = None, width = 300, selected = None, myid = 'select2example'):
+ #log.info("tags='%s' width='%s' selected='%s'", tags, width, selected)
+ self.myid = myid
+ self.tags = tags
+ # This markup is used by select2 to configure the component
+ html = '
' % (myid, width)
+ html += '' % (myid)
+ self.selected = selected
+ log.info("html = '%s'", html)
+ HTML.__init__(self, html)
+
+ def get_val(self):
+ # This uses select2 to get the value of the element
+ myjs = 'parent.jQuery("#%s").select2("val");' % (self.myid)
+ return JS(""" eval(@{{myjs}}) """)
+
+ def change(self):
+ # This will be fired whenever the select2 component changes
+ pass
+
+ def update(self, values):
+ values_js = []
+ for value in values:
+ values_js.append('{id:"%s", text:"%s"}' % (value['id'], value['text']))
+ values_js = ','.join(values_js)
+ myjs = 'parent.jQuery("#%s").select2("val", [%s]);' % (self.myid, values_js)
+ log.info("Now calling JS: %s", myjs)
+ JS(""" eval(@{{myjs}}) """)
+
+ def bind_js_show(self):
+ # This is a pure javascript function, which can be triggered by binding with jQuery
+ # the "change" event to it
+ show = '''
+ function show() {
+ var e=parent.jQuery("
change fired
");
+ parent.jQuery("#%s-show").append(e);
+ e.animate({opacity:0}, 1000, 'linear', function() { e.remove(); });
+ };''' % (self.myid)
+ myjs = '%s parent.jQuery("#%s").bind("change", show);' % (show, self.myid)
+ log.info("Now calling JS: %s", myjs)
+ JS(""" eval(@{{myjs}}) """)
+
+ def bind_pyjs_change(self):
+ # Here we bind the change event to the self.change pyjs method
+ # Since we are binding a global function to the self.change method, we want
+ # that global function to be unique (or at least to have the myid suffix)
+ global_unique_change = "change_%s" % (self.myid)
+ setattr(wnd(),global_unique_change,self.change)
+ # Now bind the change event to the wnd().global_unique_change function, which is actually self.change
+ myjs = 'parent.jQuery("#%s").bind("change", function() { parent.%s() });' % (self.myid, global_unique_change)
+ log.info("Now calling JS: %s", myjs)
+ JS(""" eval(@{{myjs}}) """)
+
+ def final_setup(self):
+ # Since select2 acts on the DOM, this can only be called once the component has been added to the DOM.
+ if self.tags:
+ tags = ','.join(['"%s"' % (tag) for tag in self.tags])
+ else:
+ tags = ''
+ myjs = 'parent.jQuery("#%s").select2({tags:[%s]});' % (self.myid, tags)
+ # TODO: what about self.selected?
+ log.info("Now calling JS: %s", myjs)
+ JS(""" eval(@{{myjs}}) """)
+ self.bind_js_show() # Bind a jQuery function
+ self.bind_pyjs_change() # Bind a pyjs method
+
diff --git a/examples/jqueryselect2/__main__.py b/examples/jqueryselect2/__main__.py
new file mode 100644
index 000000000..41f045fbf
--- /dev/null
+++ b/examples/jqueryselect2/__main__.py
@@ -0,0 +1,73 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os
+
+head = os.path.dirname(__file__)
+
+TARGETS = {
+ 'jQuerySelect2.py': dict(
+ downloads=[
+ dict(
+ url=
+ "http://code.jquery.com/"+\
+ "jquery-1.7.2.min.js",
+ dst=os.path.join(head, 'public', 'jquery.min.js'),
+ unzip=False,
+ ),
+ dict(
+ url=
+ "https://github.com/downloads/ivaynberg/"+\
+ "select2/select2-2.1.zip",
+ dst=os.path.join(head, 'public', 'select2'),
+ unzip=True,
+ ),
+ ],
+ )
+}
+
+
+PACKAGE = {
+ 'title': 'jQuery and Select2',
+ 'desc': 'Integration of jQuery, Select2 and Pyjs Example',
+}
+
+
+def setup(targets):
+ '''Setup example for translation, MUST call util.setup(targets).'''
+ util.setup(targets)
+
+
+def translate():
+ '''Translate example, MUST call util.translate().'''
+ util.translate()
+
+
+def install(package):
+ '''Install and cleanup example module. MUST call util.install(package)'''
+ util.install(package)
+
+
+##---------------------------------------##
+# --------- (-: DO NOT EDIT :-) --------- #
+##---------------------------------------##
+
+
+import sys
+import os
+
+
+examples = head = os.path.abspath(os.path.dirname(__file__))
+while os.path.split(examples)[1].lower() != 'examples':
+ examples = os.path.split(examples)[0]
+ if not examples:
+ raise ValueError("Cannot determine examples directory")
+sys.path.insert(0, os.path.join(examples))
+from _examples import util
+sys.path.pop(0)
+
+util.init(head)
+
+setup(TARGETS)
+translate()
+install(PACKAGE)
diff --git a/examples/jqueryselect2/jQuerySelect2.py b/examples/jqueryselect2/jQuerySelect2.py
new file mode 100644
index 000000000..bd1e6d680
--- /dev/null
+++ b/examples/jqueryselect2/jQuerySelect2.py
@@ -0,0 +1,75 @@
+import pyjd # this is dummy in pyjs
+
+from pyjamas.ui.VerticalPanel import VerticalPanel
+from pyjamas.ui.RootPanel import RootPanel
+from pyjamas.ui.Button import Button
+from pyjamas.ui.DialogBox import DialogBox
+from pyjamas import logging
+from pyjamas import Window
+
+from Select2TaggingComponent import Select2TaggingComponent
+
+log = logging.getConsoleLogger()
+
+class MyTagger(VerticalPanel):
+
+ def __init__ (self, tags = None, width = 300, selected = None, myid = None):
+ VerticalPanel.__init__(self)
+ self.s2 = Select2TaggingComponent(tags, width, selected, myid)
+ self.reset_button = Button("Reset", self)
+ self.show_values_button = Button("Show", self)
+ self.add(self.s2)
+ self.add(self.reset_button)
+ self.add(self.show_values_button)
+ self.s2.change = self.change
+
+ def change(self):
+ txt = "Object with id=%s has value '%s'" % (self.s2.myid, self.s2.get_val())
+ log.info(txt)
+ self.create_popup(txt)
+
+ def create_popup(self, txt):
+ popup = DialogBox(False, False)
+ popup.onClick = lambda w: popup.hide()
+ popup.setHTML('%s' % (txt))
+ popup.setWidget(Button('Close', popup))
+ popup.show()
+
+ def onClick(self, sender):
+ if sender == self.reset_button:
+ log.info('Updating')
+ values = [ { 'id' : 'id1', 'text': 'text1'}, { 'id' : 'id2', 'text': 'text2'}]
+ self.s2.update(values)
+ elif sender == self.show_values_button:
+ txt = "Object with id=%s has value '%s'" % (self.s2.myid, self.s2.get_val())
+ log.info(txt)
+ self.create_popup(txt)
+
+class MainWindow:
+
+ def onModuleLoad(self):
+
+ # TODO: the change event does not work properly when there are
+ # several Select2TaggingComponent.
+ tagger1 = MyTagger(myid = 'example1')
+ tagger2 = MyTagger(myid = 'example2')
+
+ # Get rid of scrollbars, and clear out the window's built-in margin,
+ # because we want to take advantage of the entire client area.
+ Window.enableScrolling(False)
+ Window.setMargin("0px")
+
+ # Add the component to the DOM
+ RootPanel().add(tagger1)
+ RootPanel().add(tagger2)
+
+ # Now that it is in the DOM, select2 can perform the final setup
+ # TODO: is it possible that the component automatically detects this?
+ tagger1.s2.final_setup()
+ tagger2.s2.final_setup()
+
+if __name__ == '__main__':
+ pyjd.setup("./public/jQuerySelect2.html")
+ w = MainWindow()
+ w.onModuleLoad()
+ pyjd.run()
diff --git a/examples/jqueryselect2/public/jQuerySelect2.css b/examples/jqueryselect2/public/jQuerySelect2.css
new file mode 100644
index 000000000..9975e9b96
--- /dev/null
+++ b/examples/jqueryselect2/public/jQuerySelect2.css
@@ -0,0 +1,186 @@
+body, html {
+ height: 100%;
+}
+
+body {
+ background: #fff;
+ color: black;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: small;
+ margin: 8px;
+ margin-top: 3px;
+}
+
+a {
+ color: #000;
+}
+
+a:visited {
+ color: #000;
+}
+
+.gwt-DialogBox {
+ background-color: white;
+}
+
+.gwt-DialogBox .Caption {
+ background: url(gradient.gif) repeat-x 0px -1px;
+ font-weight: bold;
+ cursor: default;
+ padding: 5px 10px;
+ border: 1px solid #666;
+ text-align: left;
+}
+
+.gwt-DialogBox .dialogContent {
+ border: 1px solid #666;
+ border-top: 0;
+}
+
+.gwt-DialogBox td {
+ text-align: right;
+}
+
+.gwt-DialogBox .gwt-Button {
+ margin: 10px;
+}
+
+.gwt-MenuBar {
+ background: #c3d9ff;
+ cursor: default;
+}
+
+.gwt-MenuItem {
+ font-size: 80%;
+ margin: 1px;
+ cursor: default;
+}
+
+.gwt-MenuItem-selected {
+ background: #e8eef7;
+}
+
+.gwt-Tree {
+}
+
+.gwt-Tree .gwt-TreeItem {
+ font-size: 80%;
+ padding: 1px 3px 0 3px;
+ cursor: hand;
+ cursor: pointer;
+ display: block !important;
+}
+
+.gwt-Tree .gwt-TreeItem-selected {
+ background: #ccc;
+}
+
+.gwt-DecoratedStackPanel {
+ width: 15em;
+ border-bottom: 1px solid #666;
+}
+.gwt-DecoratedStackPanel .lcaption {
+ width: 32px;
+ padding: 0 0 4px 5px;
+}
+.gwt-DecoratedStackPanel .rcaption {
+ padding: 0 0 4px 5px;
+}
+.gwt-DecoratedStackPanel .gwt-StackPanelContent {
+ border: 1px solid #666;
+ border-bottom: 0px;
+ background: white;
+ padding: 2px 2px 10px 5px;
+}
+.gwt-DecoratedStackPanel .gwt-StackPanelItem {
+ cursor: pointer;
+ cursor: hand;
+}
+.gwt-DecoratedStackPanel .stackItemTopLeft,
+.gwt-DecoratedStackPanel .stackItemTopRight {
+ width: 4px;
+ height: 4px;
+ zoom: 1;
+}
+html>body .gwt-DecoratedStackPanel .stackItemTopLeft {
+ background: #c1eec8 url(leftCorner.gif) no-repeat;
+ border-left: 1px solid #666;
+}
+html>body .gwt-DecoratedStackPanel .stackItemTopRight {
+ background: #c1eec8 url(rightCorner.gif) no-repeat;
+ border-right: 1px solid #666;
+}
+.gwt-DecoratedStackPanel .stackItemTopLeftInner,
+.gwt-DecoratedStackPanel .stackItemTopRightInner {
+ width: 4px;
+ height: 4px;
+}
+* html .gwt-DecoratedStackPanel .stackItemTopLeftInner {
+ overflow: hidden;
+ border-left: 1px solid #666;
+ background-color: #d3def6;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='leftCorner.gif',sizingMethod='crop');
+}
+* html .gwt-DecoratedStackPanel .stackItemTopRightInner {
+ overflow: hidden;
+ border-right: 1px solid #666;
+ background-color: #d3def6;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='rightCorner.gif',sizingMethod='crop');
+}
+.gwt-DecoratedStackPanel .stackItemTopCenter {
+ background: #ddefde url(gradient.gif) repeat-x 0px 0px;
+}
+.gwt-DecoratedStackPanel .stackItemMiddleLeft {
+ background: #d3def6 url(gradient.gif) repeat-x 0px -1px;
+ border-left: 1px solid #666;
+}
+.gwt-DecoratedStackPanel .stackItemMiddleLeftInner,
+.gwt-DecoratedStackPanel .stackItemMiddleRightInner {
+ width: 1px;
+ height: 1px;
+}
+.gwt-DecoratedStackPanel .stackItemMiddleRight {
+ background: #d3def6 url(gradient.gif) repeat-x 0px -1px;
+ border-right: 1px solid #666;
+}
+.gwt-DecoratedStackPanel .stackItemMiddleCenter {
+ font-weight: bold;
+ font-size: 1.3em;
+ background: #d3def6 url(gradient.gif) repeat-x 0px -1px;
+}
+html>body .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopRight,
+html>body .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopLeft {
+ border: 0px;
+ background-color: white;
+}
+html>body .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopLeft,
+html>body .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopRight {
+ background-color: white;
+}
+* html .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopLeftInner,
+* html .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopRightInner {
+ border: 0px;
+ background-color: white;
+}
+* html .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopLeftInner {
+ padding-left: 1px;
+}
+* html .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopLeftInner,
+* html .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopRightInner {
+ background-color: white;
+}
+
+.gwt-StackPanel {
+ width: 15em;
+ border: 1px solid #666;
+
+}
+
+.gwt-StackPanel .gwt-StackPanelItem {
+ background: #d3def6 url(gradient.gif) repeat-x 0px -1px;
+ border: 1px solid #666;
+ cursor: pointer;
+ cursor: hand;
+
+}
+
diff --git a/examples/jqueryselect2/public/jQuerySelect2.html b/examples/jqueryselect2/public/jQuerySelect2.html
new file mode 100644
index 000000000..fe366fd30
--- /dev/null
+++ b/examples/jqueryselect2/public/jQuerySelect2.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ jQuerySelect2 Example App
+
+
+
+
+
+
+
diff --git a/examples/jqueryselect2/public/jquery.min.js b/examples/jqueryselect2/public/jquery.min.js
new file mode 100644
index 000000000..16ad06c5a
--- /dev/null
+++ b/examples/jqueryselect2/public/jquery.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.2 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="