Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

get headless phantom finally working

  • Loading branch information...
commit e0b349d4a61065482f5ef101afba7899648055a2 1 parent f7b7ce6
Dustin Diaz authored November 26, 2012
7  Makefile
... ...
@@ -1,9 +1,6 @@
1 1
 boosh:
2  
-	smoosh make ./config/smoosh.json
  2
+	node_modules/smoosh/bin/smoosh make ./config/smoosh.json
3 3
 	cp src/ender.js mobile/ender.js
4 4
 
5  
-install:
6  
-	npm install smoosh -g
7  
-
8 5
 test:
9  
-	serve . && phantomjs tests/phantom.js
  6
+	node tests/test-env.js
1  config/smoosh.json
@@ -26,7 +26,6 @@
26 26
     , "sub": true
27 27
     , "white": false
28 28
     , "indent": 2
29  
-    , "whitespace": true
30 29
     , "asi": true
31 30
     , "laxbreak": true
32 31
     , "eqeqeq": false
0  hey there
No changes.
5  mobile/qwery-mobile.js
... ...
@@ -1,7 +1,7 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7 7
 
@@ -35,7 +35,8 @@
35 35
 
36 36
   function uniq(ar) {
37 37
     var a = [], i, j
38  
-    label: for (i = 0; i < ar.length; i++) {
  38
+    label:
  39
+    for (i = 0; i < ar.length; i++) {
39 40
       for (j = 0; j < a.length; j++) {
40 41
         if (a[j] == ar[i]) {
41 42
           continue label
4  mobile/qwery-mobile.min.js
... ...
@@ -1,7 +1,7 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7  
-(function(a,b,c){typeof module!="undefined"&&module.exports?module.exports=b():typeof c["define"]=="function"&&c.define.amd?define(a,b):c[a]=b()})("qwery",function(){function f(a){return[].slice.call(a,0)}function g(a){var b;return a&&typeof a=="object"&&(b=a.nodeType)&&(b==1||b==9)}function h(a){var b=[],c,d;a:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b}function i(c,d){var h,j=typeof d=="string"?i(d)[0]:d||b;return j=isFinite(j.length)&&j[0]&&!j.nodeName?j[0]:j,!j||!c?[]:b.getElementsByClassName&&c=="string"&&(h=c.match(a))?f(j.getElementsByClassName(h[1])):c&&(c.document||c.nodeType&&c.nodeType==9)?d?[]:[c]:g(c)?!d||e(c,j)?[c]:[]:f(j.querySelectorAll(c))}var a=/^\.([\w\-]+)$/,b=document,c=window,d=b.documentElement,e="compareDocumentPosition"in d?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:function(a,c){return c=c==b||c==window?d:c,c!==a&&c.contains(a)};return i.uniq=h,i},this)
  7
+(function(e,t,n){typeof module!="undefined"&&module.exports?module.exports=t():typeof n["define"]=="function"&&n.define.amd?define(e,t):n[e]=t()})("qwery",function(){function s(e){return[].slice.call(e,0)}function o(e){var t;return e&&typeof e=="object"&&(t=e.nodeType)&&(t==1||t==9)}function u(e){var t=[],n,r;e:for(n=0;n<e.length;n++){for(r=0;r<t.length;r++)if(t[r]==e[n])continue e;t[t.length]=e[n]}return t}function a(n,r){var u,f=typeof r=="string"?a(r)[0]:r||t;return f=isFinite(f.length)&&f[0]&&!f.nodeName?f[0]:f,!f||!n?[]:t.getElementsByClassName&&n=="string"&&(u=n.match(e))?s(f.getElementsByClassName(u[1])):n&&(n.document||n.nodeType&&n.nodeType==9)?r?[]:[n]:o(n)?!r||i(n,f)?[n]:[]:s(f.querySelectorAll(n))}var e=/^\.([\w\-]+)$/,t=document,n=window,r=t.documentElement,i="compareDocumentPosition"in r?function(e,t){return(t.compareDocumentPosition(e)&16)==16}:function(e,n){return n=n==t||n==window?r:n,n!==e&&n.contains(e)};return a.uniq=u,a},this)
3  mobile/src/mobile.js
@@ -28,7 +28,8 @@
28 28
 
29 29
   function uniq(ar) {
30 30
     var a = [], i, j
31  
-    label: for (i = 0; i < ar.length; i++) {
  31
+    label:
  32
+    for (i = 0; i < ar.length; i++) {
32 33
       for (j = 0; j < a.length; j++) {
33 34
         if (a[j] == ar[i]) {
34 35
           continue label
7  package.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
     "name": "qwery"
3 3
   , "description": "blazing fast CSS3 query selector engine"
4  
-  , "version": "3.3.11"
  4
+  , "version": "3.4.0"
5 5
   , "homepage": "https://github.com/ded/qwery"
6 6
   , "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
7 7
   , "contributors": [
@@ -19,8 +19,7 @@
19 19
   , "devDependencies": {
20 20
         "sink-test": ">= 1.0.1"
21 21
       , "serve": "*"
22  
-    }
23  
-  , "scripts": {
24  
-      "test": "phantomjs tests/phantom.js"
  22
+      , "smoosh": "0.4.0"
  23
+      , "phantomjs": "0.2.3"
25 24
     }
26 25
 }
10  pseudos/qwery-pseudos.js
... ...
@@ -1,7 +1,7 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7 7
 
@@ -27,8 +27,8 @@
27 27
   }
28 28
 
29 29
   function checkNthExpr(el, nodes, a, b) {
30  
-    if (!a) return (nodes[b-1] == el)
31  
-    for (i = b, l = nodes.length; ((a > 0) ? (i <= l) : (i >= 1)); i += a) if (el == nodes[i-1]) return true
  30
+    if (!a) return (nodes[b - 1] == el)
  31
+    for (i = b, l = nodes.length; ((a > 0) ? (i <= l) : (i >= 1)); i += a) if (el == nodes[i - 1]) return true
32 32
     return false
33 33
   }
34 34
 
@@ -54,9 +54,9 @@
54 54
   }
55 55
 
56 56
   // *was* going to be in CSS3, didn't quite make it
57  
-  pseudos.contains = function(el, val) { return text(el).indexOf(val) != -1 }
  57
+  pseudos.contains = function (el, val) { return text(el).indexOf(val) != -1 }
58 58
 
59  
-  pseudos.not = function(el, val) { return !q.is(el, val) }
  59
+  pseudos.not = function (el, val) { return !q.is(el, val) }
60 60
 
61 61
   pseudos['nth-child'] = function (el, val) {
62 62
     if (!val || !(p = el.parentNode)) return false
4  pseudos/qwery-pseudos.min.js
... ...
@@ -1,7 +1,7 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7  
-!function(){function j(a,b){var e=[];g=a.childNodes;for(c=0,d=g.length;c<d;c++)g[c].nodeType==1&&(!b||g[c].nodeName==b)&&e.push(g[c]);return e}function k(a,b,e,f){if(!e)return b[f-1]==a;for(c=f,d=b.length;e>0?c<=d:c>=1;c+=e)if(a==b[c-1])return!0;return!1}function l(a,b,c){return isFinite(c)?b[c-1]==a:c=="odd"?k(a,b,2,1):c=="even"?k(a,b,2,0):(h=i.exec(c))?k(a,b,h[2]?parseInt(h[1],10):parseInt(h[1]+"1",10),h[3]?parseInt(h[3].replace(/\s*/,""),10):0):!1}function m(a,b){if(a.nodeType===3||a.nodeType===4)return a.nodeValue;if(a.nodeType!==1&&a.nodeType!==9)return"";for(b="",a=a.firstChild;a;a=a.nextSibling)a.nodeType!==8&&(b+=a.textContent||a.innerText||m(a));return b}var a,b,c,d,e,f,g,h,i=/\s*((?:\+|\-)?(\d*))n\s*((?:\+|\-)\s*\d+)?\s*/;if(typeof module!="undefined"&&!0)a=require("qwery");else{if(typeof qwery=="undefined")return;a=qwery}b=a.pseudos,b.contains=function(a,b){return m(a).indexOf(b)!=-1},b.not=function(b,c){return!a.is(b,c)},b["nth-child"]=function(a,b){return!b||!(e=a.parentNode)?!1:l(a,j(e),b)},b["nth-last-child"]=function(a,b){return!b||!(e=a.parentNode)?!1:l(a,j(e).reverse(),b)},b["nth-of-type"]=function(a,b){return!b||!(e=a.parentNode)?!1:l(a,j(e,a.nodeName),b)},b["nth-last-of-type"]=function(a,b){return!b||!(e=a.parentNode)?!1:l(a,j(e,a.nodeName).reverse(),b)},b["first-child"]=function(a){return b["nth-child"](a,1)},b["last-child"]=function(a){return b["nth-last-child"](a,1)},b["first-of-type"]=function(a){return b["nth-of-type"](a,1)},b["last-of-type"]=function(a){return b["nth-last-of-type"](a,1)},b["only-child"]=function(a){return(e=a.parentNode)&&(g=j(e))&&g.length==1&&a==g[0]},b["only-of-type"]=function(a){return(e=a.parentNode)&&(g=j(e,a.nodeName))&&g.length==1&&a==g[0]},b.target=function(a){return a.getAttribute("id")==location.hash.substr(1)},b.checked=function(a){return a.checked},b.enabled=function(a){return!a.disabled},b.disabled=function(a){return a.disabled},b.empty=function(a){return!a.childNodes.length}}()
  7
+!function(){function f(e,t){var i=[];o=e.childNodes;for(n=0,r=o.length;n<r;n++)o[n].nodeType==1&&(!t||o[n].nodeName==t)&&i.push(o[n]);return i}function l(e,t,i,s){if(!i)return t[s-1]==e;for(n=s,r=t.length;i>0?n<=r:n>=1;n+=i)if(e==t[n-1])return!0;return!1}function c(e,t,n){return isFinite(n)?t[n-1]==e:n=="odd"?l(e,t,2,1):n=="even"?l(e,t,2,0):(u=a.exec(n))?l(e,t,u[2]?parseInt(u[1],10):parseInt(u[1]+"1",10),u[3]?parseInt(u[3].replace(/\s*/,""),10):0):!1}function h(e,t){if(e.nodeType===3||e.nodeType===4)return e.nodeValue;if(e.nodeType!==1&&e.nodeType!==9)return"";for(t="",e=e.firstChild;e;e=e.nextSibling)e.nodeType!==8&&(t+=e.textContent||e.innerText||h(e));return t}var e,t,n,r,i,s,o,u,a=/\s*((?:\+|\-)?(\d*))n\s*((?:\+|\-)\s*\d+)?\s*/;if(typeof module!="undefined"&&!0)e=require("qwery");else{if(typeof qwery=="undefined")return;e=qwery}t=e.pseudos,t.contains=function(e,t){return h(e).indexOf(t)!=-1},t.not=function(t,n){return!e.is(t,n)},t["nth-child"]=function(e,t){return!t||!(i=e.parentNode)?!1:c(e,f(i),t)},t["nth-last-child"]=function(e,t){return!t||!(i=e.parentNode)?!1:c(e,f(i).reverse(),t)},t["nth-of-type"]=function(e,t){return!t||!(i=e.parentNode)?!1:c(e,f(i,e.nodeName),t)},t["nth-last-of-type"]=function(e,t){return!t||!(i=e.parentNode)?!1:c(e,f(i,e.nodeName).reverse(),t)},t["first-child"]=function(e){return t["nth-child"](e,1)},t["last-child"]=function(e){return t["nth-last-child"](e,1)},t["first-of-type"]=function(e){return t["nth-of-type"](e,1)},t["last-of-type"]=function(e){return t["nth-last-of-type"](e,1)},t["only-child"]=function(e){return(i=e.parentNode)&&(o=f(i))&&o.length==1&&e==o[0]},t["only-of-type"]=function(e){return(i=e.parentNode)&&(o=f(i,e.nodeName))&&o.length==1&&e==o[0]},t.target=function(e){return e.getAttribute("id")==location.hash.substr(1)},t.checked=function(e){return e.checked},t.enabled=function(e){return!e.disabled},t.disabled=function(e){return e.disabled},t.empty=function(e){return!e.childNodes.length}}()
8  pseudos/src/pseudos.js
@@ -20,8 +20,8 @@
20 20
   }
21 21
 
22 22
   function checkNthExpr(el, nodes, a, b) {
23  
-    if (!a) return (nodes[b-1] == el)
24  
-    for (i = b, l = nodes.length; ((a > 0) ? (i <= l) : (i >= 1)); i += a) if (el == nodes[i-1]) return true
  23
+    if (!a) return (nodes[b - 1] == el)
  24
+    for (i = b, l = nodes.length; ((a > 0) ? (i <= l) : (i >= 1)); i += a) if (el == nodes[i - 1]) return true
25 25
     return false
26 26
   }
27 27
 
@@ -47,9 +47,9 @@
47 47
   }
48 48
 
49 49
   // *was* going to be in CSS3, didn't quite make it
50  
-  pseudos.contains = function(el, val) { return text(el).indexOf(val) != -1 }
  50
+  pseudos.contains = function (el, val) { return text(el).indexOf(val) != -1 }
51 51
 
52  
-  pseudos.not = function(el, val) { return !q.is(el, val) }
  52
+  pseudos.not = function (el, val) { return !q.is(el, val) }
53 53
 
54 54
   pseudos['nth-child'] = function (el, val) {
55 55
     if (!val || !(p = el.parentNode)) return false
72  qwery.js
... ...
@@ -1,15 +1,15 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7 7
 
8  
-(function (name, definition, context) {
  8
+(function (name, context, definition) {
9 9
   if (typeof module != 'undefined' && module.exports) module.exports = definition()
10  
-  else if (typeof context['define'] == 'function' && context['define']['amd']) define(name, definition)
  10
+  else if (typeof context['define'] == 'function' && context['define']['amd']) define(definition)
11 11
   else context[name] = definition()
12  
-})('qwery', function () {
  12
+})('qwery', this, function () {
13 13
   var doc = document
14 14
     , html = doc.documentElement
15 15
     , byClass = 'getElementsByClassName'
@@ -38,21 +38,22 @@
38 38
     , dividers = new RegExp('(' + splitters.source + ')' + splittersMore.source, 'g')
39 39
     , tokenizr = new RegExp(splitters.source + splittersMore.source)
40 40
     , chunker = new RegExp(simple.source + '(' + attr.source + ')?' + '(' + pseudo.source + ')?')
41  
-    , walker = {
42  
-        ' ': function (node) {
43  
-          return node && node !== html && node.parentNode
44  
-        }
45  
-      , '>': function (node, contestant) {
46  
-          return node && node.parentNode == contestant.parentNode && node.parentNode
47  
-        }
48  
-      , '~': function (node) {
49  
-          return node && node.previousSibling
50  
-        }
51  
-      , '+': function (node, contestant, p1, p2) {
52  
-          if (!node) return false
53  
-          return (p1 = previous(node)) && (p2 = previous(contestant)) && p1 == p2 && p1
54  
-        }
  41
+
  42
+  var walker = {
  43
+      ' ': function (node) {
  44
+        return node && node !== html && node.parentNode
55 45
       }
  46
+    , '>': function (node, contestant) {
  47
+        return node && node.parentNode == contestant.parentNode && node.parentNode
  48
+      }
  49
+    , '~': function (node) {
  50
+        return node && node.previousSibling
  51
+      }
  52
+    , '+': function (node, contestant, p1, p2) {
  53
+        if (!node) return false
  54
+        return (p1 = previous(node)) && (p2 = previous(contestant)) && p1 == p2 && p1
  55
+      }
  56
+    }
56 57
 
57 58
   function cache() {
58 59
     this.c = {}
@@ -180,7 +181,7 @@
180 181
     if (!tokens.length) return r
181 182
 
182 183
     // filter further according to the rest of the selector (the left side)
183  
-    each(r, function(e) { if (ancestorMatch(e, tokens, dividedTokens)) ret[ret.length] = e })
  184
+    each(r, function (e) { if (ancestorMatch(e, tokens, dividedTokens)) ret[ret.length] = e })
184 185
     return ret
185 186
   }
186 187
 
@@ -222,8 +223,9 @@
222 223
   }
223 224
 
224 225
   function uniq(ar) {
225  
-    var a = [], i, j
226  
-    o: for (i = 0; i < ar.length; ++i) {
  226
+    var a = [], i, j;
  227
+    o:
  228
+    for (i = 0; i < ar.length; ++i) {
227 229
       for (j = 0; j < a.length; ++j) if (a[j] == ar[i]) continue o
228 230
       a[a.length] = ar[i]
229 231
     }
@@ -270,15 +272,15 @@
270 272
   // where the root is not document and a relationship selector is first we have to
271 273
   // do some awkward adjustments to get it to work, even with qSA
272 274
   function collectSelector(root, collector) {
273  
-    return function(s) {
  275
+    return function (s) {
274 276
       var oid, nid
275 277
       if (splittable.test(s)) {
276 278
         if (root[nodeType] !== 9) {
277  
-         // make sure the el has an id, rewrite the query, set root to doc and run it
278  
-         if (!(nid = oid = root.getAttribute('id'))) root.setAttribute('id', nid = '__qwerymeupscotty')
279  
-         s = '[id="' + nid + '"]' + s // avoid byId and allow us to match context element
280  
-         collector(root.parentNode || root, s, true)
281  
-         oid || root.removeAttribute('id')
  279
+          // make sure the el has an id, rewrite the query, set root to doc and run it
  280
+          if (!(nid = oid = root.getAttribute('id'))) root.setAttribute('id', nid = '__qwerymeupscotty')
  281
+          s = '[id="' + nid + '"]' + s // avoid byId and allow us to match context element
  282
+          collector(root.parentNode || root, s, true)
  283
+          oid || root.removeAttribute('id')
282 284
         }
283 285
         return;
284 286
       }
@@ -298,16 +300,16 @@
298 300
       while (element = element.parentNode) if (element === container) return 1
299 301
       return 0
300 302
     }
301  
-  , getAttr = function() {
  303
+  , getAttr = function () {
302 304
       // detect buggy IE src/href getAttribute() call
303 305
       var e = doc.createElement('p')
304 306
       return ((e.innerHTML = '<a href="#x">x</a>') && e.firstChild.getAttribute('href') != '#x') ?
305  
-        function(e, a) {
  307
+        function (e, a) {
306 308
           return a === 'class' ? e.className : (a === 'href' || a === 'src') ?
307 309
             e.getAttribute(a, 2) : e.getAttribute(a)
308 310
         } :
309  
-        function(e, a) { return e.getAttribute(a) }
310  
-   }()
  311
+        function (e, a) { return e.getAttribute(a) }
  312
+    }()
311 313
   , hasByClass = !!doc[byClass]
312 314
     // has native qSA support
313 315
   , hasQSA = doc.querySelector && doc[qSA]
@@ -320,13 +322,13 @@
320 322
           return arrayify(root[qSA](selector))
321 323
         }
322 324
         // special case where we need the services of `collectSelector()`
323  
-        each(ss = selector.split(','), collectSelector(root, function(ctx, s) {
  325
+        each(ss = selector.split(','), collectSelector(root, function (ctx, s) {
324 326
           e = ctx[qSA](s)
325 327
           if (e.length == 1) result[result.length] = e.item(0)
326 328
           else if (e.length) result = result.concat(arrayify(e))
327 329
         }))
328 330
         return ss.length > 1 && result.length > 1 ? uniq(result) : result
329  
-      } catch(ex) { }
  331
+      } catch (ex) { }
330 332
       return selectNonNative(selector, root)
331 333
     }
332 334
     // no native selector support
@@ -342,7 +344,7 @@
342 344
         return result
343 345
       }
344 346
       // more complex selector, get `_qwery()` to do the work for us
345  
-      each(ss = selector.split(','), collectSelector(root, function(ctx, s, rewrite) {
  347
+      each(ss = selector.split(','), collectSelector(root, function (ctx, s, rewrite) {
346 348
         r = _qwery(s, ctx)
347 349
         for (i = 0, l = r.length; i < l; i++) {
348 350
           if (ctx[nodeType] === 9 || rewrite || isAncestor(r[i], root)) result[result.length] = r[i]
@@ -364,4 +366,4 @@
364 366
   qwery.pseudos = {}
365 367
 
366 368
   return qwery
367  
-}, this);
  369
+});
4  qwery.min.js
... ...
@@ -1,7 +1,7 @@
1 1
 /*!
2 2
   * @preserve Qwery - A Blazing Fast query selector engine
3 3
   * https://github.com/ded/qwery
4  
-  * copyright Dustin Diaz & Jacob Thornton 2012
  4
+  * copyright Dustin Diaz 2012
5 5
   * MIT License
6 6
   */
7  
-(function(a,b,c){typeof module!="undefined"&&module.exports?module.exports=b():typeof c["define"]=="function"&&c.define.amd?define(a,b):c[a]=b()})("qwery",function(){function C(){this.c={}}function H(a){return D.g(a)||D.s(a,"(^|\\s+)"+a+"(\\s+|$)",1)}function I(a,b){var c=0,d=a.length;for(;c<d;c++)b(a[c])}function J(a){for(var b=[],c=0,d=a.length;c<d;++c)V(a[c])?b=b.concat(a[c]):b[b.length]=a[c];return b}function K(a){var b=0,c=a.length,d=[];for(;b<c;b++)d[b]=a[b];return d}function L(a){while(a=a.previousSibling)if(a[h]==1)break;return a}function M(a){return a.match(A)}function N(a,b,c,d,e,f,i,l,m,n,o){var p,q,r,s,t;if(this[h]!==1)return!1;if(b&&b!=="*"&&this[g]&&this[g].toLowerCase()!==b)return!1;if(c&&(q=c.match(j))&&q[1]!==this.id)return!1;if(c&&(t=c.match(k)))for(p=t.length;p--;)if(!H(t[p].slice(1)).test(this.className))return!1;if(m&&Y.pseudos[m]&&!Y.pseudos[m](this,o))return!1;if(d&&!i){s=this.attributes;for(r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&(s[r].name||r)==e)return this}return d&&!P(f,_(this,e)||"",i)?!1:this}function O(a){return E.g(a)||E.s(a,a.replace(t,"\\$1"))}function P(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(F.g("^="+c)||F.s("^="+c,"^"+O(c),1));case"$=":return b.match(F.g("$="+c)||F.s("$="+c,O(c)+"$",1));case"*=":return b.match(F.g(c)||F.s(c,O(c),1));case"~=":return b.match(F.g("~="+c)||F.s("~="+c,"(?:^|\\s+)"+O(c)+"(?:\\s+|$)",1));case"|=":return b.match(F.g("|="+c)||F.s("|="+c,"^"+O(c)+"(-|$)",1))}return 0}function Q(a,b){var c=[],e=[],f,i,j,k,m,n,o,p,q=b,r=G.g(a)||G.s(a,a.split(z)),s=a.match(y);if(!r.length)return c;k=(r=r.slice(0)).pop(),r.length&&(j=r[r.length-1].match(l))&&(q=X(b,j[1]));if(!q)return c;o=M(k),n=q!==b&&q[h]!==9&&s&&/^[+~]$/.test(s[s.length-1])?function(a){while(q=q.nextSibling)q[h]==1&&(o[1]?o[1]==q[g].toLowerCase():1)&&(a[a.length]=q);return a}([]):q[d](o[1]||"*");for(f=0,i=n.length;f<i;f++)if(p=N.apply(n[f],o))c[c.length]=p;return r.length?(I(c,function(a){S(a,r,s)&&(e[e.length]=a)}),e):c}function R(a,b,c){if(T(b))return a==b;if(V(b))return!!~J(b).indexOf(a);var d=b.split(","),e,f;while(b=d.pop()){e=G.g(b)||G.s(b,b.split(z)),f=b.match(y),e=e.slice(0);if(N.apply(a,M(e.pop()))&&(!e.length||S(a,e,f,c)))return!0}return!1}function S(a,b,c,d){function f(a,d,g){while(g=B[c[d]](g,a))if(T(g)&&N.apply(g,M(b[d]))){if(!d)return g;if(e=f(g,d-1,g))return e}}var e;return(e=f(a,b.length-1,a))&&(!d||$(e,d))}function T(a,b){return a&&typeof a=="object"&&(b=a[h])&&(b==1||b==9)}function U(a){var b=[],c,d;a:for(c=0;c<a.length;++c){for(d=0;d<b.length;++d)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b}function V(a){return typeof a=="object"&&isFinite(a.length)}function W(b){return b?typeof b=="string"?Y(b)[0]:!b[h]&&V(b)?b[0]:b:a}function X(a,b,c){return a[h]===9?a.getElementById(b):a.ownerDocument&&((c=a.ownerDocument.getElementById(b))&&$(c,a)&&c||!$(a,a.ownerDocument)&&i('[id="'+b+'"]',a)[0])}function Y(a,b){var e,f,g=W(b);if(!g||!a)return[];if(a===window||T(a))return!b||a!==window&&T(g)&&$(a,g)?[a]:[];if(a&&V(a))return J(a);if(e=a.match(x)){if(e[1])return(f=X(g,e[1]))?[f]:[];if(e[2])return K(g[d](e[2]));if(ba&&e[3])return K(g[c](e[3]))}return i(a,g)}function Z(a,b){return function(c){var d,e;if(p.test(c)){a[h]!==9&&((e=d=a.getAttribute("id"))||a.setAttribute("id",e="__qwerymeupscotty"),c='[id="'+e+'"]'+c,b(a.parentNode||a,c,!0),d||a.removeAttribute("id"));return}c.length&&b(a,c,!1)}}var a=document,b=a.documentElement,c="getElementsByClassName",d="getElementsByTagName",e="querySelectorAll",f="useNativeQSA",g="tagName",h="nodeType",i,j=/#([\w\-]+)/,k=/\.[\w\-]+/g,l=/^#([\w\-]+)$/,m=/^\.([\w\-]+)$/,n=/^([\w\-]+)$/,o=/^([\w]+)?\.([\w\-]+)$/,p=/(^|,)\s*[>~+]/,q=/^\s+|\s*([,\s\+\~>]|$)\s*/g,r=/[\s\>\+\~]/,s=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,t=/([.*+?\^=!:${}()|\[\]\/\\])/g,u=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,v=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,w=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,x=new RegExp(l.source+"|"+n.source+"|"+m.source),y=new RegExp("("+r.source+")"+s.source,"g"),z=new RegExp(r.source+s.source),A=new RegExp(u.source+"("+v.source+")?"+"("+w.source+")?"),B={" ":function(a){return a&&a!==b&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){return a?(c=L(a))&&(d=L(b))&&c==d&&c:!1}};C.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b,c){return b=c?new RegExp(b):b,this.c[a]=b}};var D=new C,E=new C,F=new C,G=new C,$="compareDocumentPosition"in b?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in b?function(a,c){return c=c[h]===9||c==window?b:c,c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},_=function(){var b=a.createElement("p");return(b.innerHTML='<a href="#x">x</a>')&&b.firstChild.getAttribute("href")!="#x"?function(a,b){return b==="class"?a.className:b==="href"||b==="src"?a.getAttribute(b,2):a.getAttribute(b)}:function(a,b){return a.getAttribute(b)}}(),ba=!!a[c],bb=a.querySelector&&a[e],bc=function(a,b){var c=[],d,f;try{return b[h]===9||!p.test(a)?K(b[e](a)):(I(d=a.split(","),Z(b,function(a,b){f=a[e](b),f.length==1?c[c.length]=f.item(0):f.length&&(c=c.concat(K(f)))})),d.length>1&&c.length>1?U(c):c)}catch(g){}return bd(a,b)},bd=function(a,b){var c=[],e,f,g,i,j,k;a=a.replace(q,"$1");if(f=a.match(o)){j=H(f[2]),e=b[d](f[1]||"*");for(g=0,i=e.length;g<i;g++)j.test(e[g].className)&&(c[c.length]=e[g]);return c}return I(k=a.split(","),Z(b,function(a,d,e){j=Q(d,a);for(g=0,i=j.length;g<i;g++)if(a[h]===9||e||$(j[g],b))c[c.length]=j[g]})),k.length>1&&c.length>1?U(c):c},be=function(a){typeof a[f]!="undefined"&&(i=a[f]?bb?bc:bd:bd)};return be({useNativeQSA:!0}),Y.configure=be,Y.uniq=U,Y.is=R,Y.pseudos={},Y},this)
  7
+(function(e,t,n){typeof module!="undefined"&&module.exports?module.exports=n():typeof t["define"]=="function"&&t.define.amd?define(n):t[e]=n()})("qwery",this,function(){function L(){this.c={}}function D(e){return A.g(e)||A.s(e,"(^|\\s+)"+e+"(\\s+|$)",1)}function P(e,t){var n=0,r=e.length;for(;n<r;n++)t(e[n])}function H(e){for(var t=[],n=0,r=e.length;n<r;++n)$(e[n])?t=t.concat(e[n]):t[t.length]=e[n];return t}function B(e){var t=0,n=e.length,r=[];for(;t<n;t++)r[t]=e[t];return r}function j(e){while(e=e.previousSibling)if(e[u]==1)break;return e}function F(e){return e.match(C)}function I(e,t,n,r,i,s,a,c,h,p,d){var v,m,g,y,b;if(this[u]!==1)return!1;if(t&&t!=="*"&&this[o]&&this[o].toLowerCase()!==t)return!1;if(n&&(m=n.match(f))&&m[1]!==this.id)return!1;if(n&&(b=n.match(l)))for(v=b.length;v--;)if(!D(b[v].slice(1)).test(this.className))return!1;if(h&&Q.pseudos[h]&&!Q.pseudos[h](this,d))return!1;if(r&&!a){y=this.attributes;for(g in y)if(Object.prototype.hasOwnProperty.call(y,g)&&(y[g].name||g)==i)return this}return r&&!R(s,Z(this,i)||"",a)?!1:this}function q(e){return O.g(e)||O.s(e,e.replace(b,"\\$1"))}function R(e,t,n){switch(e){case"=":return t==n;case"^=":return t.match(M.g("^="+n)||M.s("^="+n,"^"+q(n),1));case"$=":return t.match(M.g("$="+n)||M.s("$="+n,q(n)+"$",1));case"*=":return t.match(M.g(n)||M.s(n,q(n),1));case"~=":return t.match(M.g("~="+n)||M.s("~="+n,"(?:^|\\s+)"+q(n)+"(?:\\s+|$)",1));case"|=":return t.match(M.g("|="+n)||M.s("|="+n,"^"+q(n)+"(-|$)",1))}return 0}function U(e,t){var n=[],i=[],s,a,f,l,h,p,d,v,m=t,g=_.g(e)||_.s(e,e.split(N)),y=e.match(T);if(!g.length)return n;l=(g=g.slice(0)).pop(),g.length&&(f=g[g.length-1].match(c))&&(m=K(t,f[1]));if(!m)return n;d=F(l),p=m!==t&&m[u]!==9&&y&&/^[+~]$/.test(y[y.length-1])?function(e){while(m=m.nextSibling)m[u]==1&&(d[1]?d[1]==m[o].toLowerCase():1)&&(e[e.length]=m);return e}([]):m[r](d[1]||"*");for(s=0,a=p.length;s<a;s++)if(v=I.apply(p[s],d))n[n.length]=v;return g.length?(P(n,function(e){W(e,g,y)&&(i[i.length]=e)}),i):n}function z(e,t,n){if(X(t))return e==t;if($(t))return!!~H(t).indexOf(e);var r=t.split(","),i,s;while(t=r.pop()){i=_.g(t)||_.s(t,t.split(N)),s=t.match(T),i=i.slice(0);if(I.apply(e,F(i.pop()))&&(!i.length||W(e,i,s,n)))return!0}return!1}function W(e,t,n,r){function s(e,r,o){while(o=k[n[r]](o,e))if(X(o)&&I.apply(o,F(t[r]))){if(!r)return o;if(i=s(o,r-1,o))return i}}var i;return(i=s(e,t.length-1,e))&&(!r||Y(i,r))}function X(e,t){return e&&typeof e=="object"&&(t=e[u])&&(t==1||t==9)}function V(e){var t=[],n,r;e:for(n=0;n<e.length;++n){for(r=0;r<t.length;++r)if(t[r]==e[n])continue e;t[t.length]=e[n]}return t}function $(e){return typeof e=="object"&&isFinite(e.length)}function J(t){return t?typeof t=="string"?Q(t)[0]:!t[u]&&$(t)?t[0]:t:e}function K(e,t,n){return e[u]===9?e.getElementById(t):e.ownerDocument&&((n=e.ownerDocument.getElementById(t))&&Y(n,e)&&n||!Y(e,e.ownerDocument)&&a('[id="'+t+'"]',e)[0])}function Q(e,t){var i,s,o=J(t);if(!o||!e)return[];if(e===window||X(e))return!t||e!==window&&X(o)&&Y(e,o)?[e]:[];if(e&&$(e))return H(e);if(i=e.match(x)){if(i[1])return(s=K(o,i[1]))?[s]:[];if(i[2])return B(o[r](i[2]));if(et&&i[3])return B(o[n](i[3]))}return a(e,o)}function G(e,t){return function(n){var r,i;if(v.test(n)){e[u]!==9&&((i=r=e.getAttribute("id"))||e.setAttribute("id",i="__qwerymeupscotty"),n='[id="'+i+'"]'+n,t(e.parentNode||e,n,!0),r||e.removeAttribute("id"));return}n.length&&t(e,n,!1)}}var e=document,t=e.documentElement,n="getElementsByClassName",r="getElementsByTagName",i="querySelectorAll",s="useNativeQSA",o="tagName",u="nodeType",a,f=/#([\w\-]+)/,l=/\.[\w\-]+/g,c=/^#([\w\-]+)$/,h=/^\.([\w\-]+)$/,p=/^([\w\-]+)$/,d=/^([\w]+)?\.([\w\-]+)$/,v=/(^|,)\s*[>~+]/,m=/^\s+|\s*([,\s\+\~>]|$)\s*/g,g=/[\s\>\+\~]/,y=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,b=/([.*+?\^=!:${}()|\[\]\/\\])/g,w=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,E=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,S=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,x=new RegExp(c.source+"|"+p.source+"|"+h.source),T=new RegExp("("+g.source+")"+y.source,"g"),N=new RegExp(g.source+y.source),C=new RegExp(w.source+"("+E.source+")?"+"("+S.source+")?"),k={" ":function(e){return e&&e!==t&&e.parentNode},">":function(e,t){return e&&e.parentNode==t.parentNode&&e.parentNode},"~":function(e){return e&&e.previousSibling},"+":function(e,t,n,r){return e?(n=j(e))&&(r=j(t))&&n==r&&n:!1}};L.prototype={g:function(e){return this.c[e]||undefined},s:function(e,t,n){return t=n?new RegExp(t):t,this.c[e]=t}};var A=new L,O=new L,M=new L,_=new L,Y="compareDocumentPosition"in t?function(e,t){return(t.compareDocumentPosition(e)&16)==16}:"contains"in t?function(e,n){return n=n[u]===9||n==window?t:n,n!==e&&n.contains(e)}:function(e,t){while(e=e.parentNode)if(e===t)return 1;return 0},Z=function(){var t=e.createElement("p");return(t.innerHTML='<a href="#x">x</a>')&&t.firstChild.getAttribute("href")!="#x"?function(e,t){return t==="class"?e.className:t==="href"||t==="src"?e.getAttribute(t,2):e.getAttribute(t)}:function(e,t){return e.getAttribute(t)}}(),et=!!e[n],tt=e.querySelector&&e[i],nt=function(e,t){var n=[],r,s;try{return t[u]===9||!v.test(e)?B(t[i](e)):(P(r=e.split(","),G(t,function(e,t){s=e[i](t),s.length==1?n[n.length]=s.item(0):s.length&&(n=n.concat(B(s)))})),r.length>1&&n.length>1?V(n):n)}catch(o){}return rt(e,t)},rt=function(e,t){var n=[],i,s,o,a,f,l;e=e.replace(m,"$1");if(s=e.match(d)){f=D(s[2]),i=t[r](s[1]||"*");for(o=0,a=i.length;o<a;o++)f.test(i[o].className)&&(n[n.length]=i[o]);return n}return P(l=e.split(","),G(t,function(e,r,i){f=U(r,e);for(o=0,a=f.length;o<a;o++)if(e[u]===9||i||Y(f[o],t))n[n.length]=f[o]})),l.length>1&&n.length>1?V(n):n},it=function(e){typeof e[s]!="undefined"&&(a=e[s]?tt?nt:rt:rt)};return it({useNativeQSA:!0}),Q.configure=it,Q.uniq=V,Q.is=z,Q.pseudos={},Q})
2  src/copyright.js
... ...
@@ -1,6 +1,6 @@
70  src/qwery.js
... ...
@@ -1,8 +1,8 @@
1  
-(function (name, definition, context) {
  1
+(function (name, context, definition) {
2 2
   if (typeof module != 'undefined' && module.exports) module.exports = definition()
3  
-  else if (typeof context['define'] == 'function' && context['define']['amd']) define(name, definition)
  3
+  else if (typeof context['define'] == 'function' && context['define']['amd']) define(definition)
4 4
   else context[name] = definition()
5  
-})('qwery', function () {
  5
+})('qwery', this, function () {
6 6
   var doc = document
7 7
     , html = doc.documentElement
8 8
     , byClass = 'getElementsByClassName'
@@ -31,21 +31,22 @@
31 31
     , dividers = new RegExp('(' + splitters.source + ')' + splittersMore.source, 'g')
32 32
     , tokenizr = new RegExp(splitters.source + splittersMore.source)
33 33
     , chunker = new RegExp(simple.source + '(' + attr.source + ')?' + '(' + pseudo.source + ')?')
34  
-    , walker = {
35  
-        ' ': function (node) {
36  
-          return node && node !== html && node.parentNode
37  
-        }
38  
-      , '>': function (node, contestant) {
39  
-          return node && node.parentNode == contestant.parentNode && node.parentNode
40  
-        }
41  
-      , '~': function (node) {
42  
-          return node && node.previousSibling
43  
-        }
44  
-      , '+': function (node, contestant, p1, p2) {
45  
-          if (!node) return false
46  
-          return (p1 = previous(node)) && (p2 = previous(contestant)) && p1 == p2 && p1
47  
-        }
  34
+
  35
+  var walker = {
  36
+      ' ': function (node) {
  37
+        return node && node !== html && node.parentNode
48 38
       }
  39
+    , '>': function (node, contestant) {
  40
+        return node && node.parentNode == contestant.parentNode && node.parentNode
  41
+      }
  42
+    , '~': function (node) {
  43
+        return node && node.previousSibling
  44
+      }
  45
+    , '+': function (node, contestant, p1, p2) {
  46
+        if (!node) return false
  47
+        return (p1 = previous(node)) && (p2 = previous(contestant)) && p1 == p2 && p1
  48
+      }
  49
+    }
49 50
 
50 51
   function cache() {
51 52
     this.c = {}
@@ -173,7 +174,7 @@
173 174
     if (!tokens.length) return r
174 175
 
175 176
     // filter further according to the rest of the selector (the left side)
176  
-    each(r, function(e) { if (ancestorMatch(e, tokens, dividedTokens)) ret[ret.length] = e })
  177
+    each(r, function (e) { if (ancestorMatch(e, tokens, dividedTokens)) ret[ret.length] = e })
177 178
     return ret
178 179
   }
179 180
 
@@ -215,8 +216,9 @@
215 216
   }
216 217
 
217 218
   function uniq(ar) {
218  
-    var a = [], i, j
219  
-    o: for (i = 0; i < ar.length; ++i) {
  219
+    var a = [], i, j;
  220
+    o:
  221
+    for (i = 0; i < ar.length; ++i) {
220 222
       for (j = 0; j < a.length; ++j) if (a[j] == ar[i]) continue o
221 223
       a[a.length] = ar[i]
222 224
     }
@@ -263,15 +265,15 @@
263 265
   // where the root is not document and a relationship selector is first we have to
264 266
   // do some awkward adjustments to get it to work, even with qSA
265 267
   function collectSelector(root, collector) {
266  
-    return function(s) {
  268
+    return function (s) {
267 269
       var oid, nid
268 270
       if (splittable.test(s)) {
269 271
         if (root[nodeType] !== 9) {
270  
-         // make sure the el has an id, rewrite the query, set root to doc and run it
271  
-         if (!(nid = oid = root.getAttribute('id'))) root.setAttribute('id', nid = '__qwerymeupscotty')
272  
-         s = '[id="' + nid + '"]' + s // avoid byId and allow us to match context element
273  
-         collector(root.parentNode || root, s, true)
274  
-         oid || root.removeAttribute('id')
  272
+          // make sure the el has an id, rewrite the query, set root to doc and run it
  273
+          if (!(nid = oid = root.getAttribute('id'))) root.setAttribute('id', nid = '__qwerymeupscotty')
  274
+          s = '[id="' + nid + '"]' + s // avoid byId and allow us to match context element
  275
+          collector(root.parentNode || root, s, true)
  276
+          oid || root.removeAttribute('id')
275 277
         }
276 278
         return;
277 279
       }
@@ -291,16 +293,16 @@
291 293
       while (element = element.parentNode) if (element === container) return 1
292 294
       return 0
293 295
     }
294  
-  , getAttr = function() {
  296
+  , getAttr = function () {
295 297
       // detect buggy IE src/href getAttribute() call
296 298
       var e = doc.createElement('p')
297 299
       return ((e.innerHTML = '<a href="#x">x</a>') && e.firstChild.getAttribute('href') != '#x') ?
298  
-        function(e, a) {
  300
+        function (e, a) {
299 301
           return a === 'class' ? e.className : (a === 'href' || a === 'src') ?
300 302
             e.getAttribute(a, 2) : e.getAttribute(a)
301 303
         } :
302  
-        function(e, a) { return e.getAttribute(a) }
303  
-   }()
  304
+        function (e, a) { return e.getAttribute(a) }
  305
+    }()
304 306
   , hasByClass = !!doc[byClass]
305 307
     // has native qSA support
306 308
   , hasQSA = doc.querySelector && doc[qSA]
@@ -313,13 +315,13 @@
313 315
           return arrayify(root[qSA](selector))
314 316
         }
315 317
         // special case where we need the services of `collectSelector()`
316  
-        each(ss = selector.split(','), collectSelector(root, function(ctx, s) {
  318
+        each(ss = selector.split(','), collectSelector(root, function (ctx, s) {
317 319
           e = ctx[qSA](s)
318 320
           if (e.length == 1) result[result.length] = e.item(0)
319 321
           else if (e.length) result = result.concat(arrayify(e))
320 322
         }))
321 323
         return ss.length > 1 && result.length > 1 ? uniq(result) : result
322  
-      } catch(ex) { }
  324
+      } catch (ex) { }
323 325
       return selectNonNative(selector, root)
324 326
     }
325 327
     // no native selector support
@@ -335,7 +337,7 @@
335 337
         return result
336 338
       }
337 339
       // more complex selector, get `_qwery()` to do the work for us
338  
-      each(ss = selector.split(','), collectSelector(root, function(ctx, s, rewrite) {
  340
+      each(ss = selector.split(','), collectSelector(root, function (ctx, s, rewrite) {
339 341
         r = _qwery(s, ctx)
340 342
         for (i = 0, l = r.length; i < l; i++) {
341 343
           if (ctx[nodeType] === 9 || rewrite || isAncestor(r[i], root)) result[result.length] = r[i]
@@ -357,4 +359,4 @@
357 359
   qwery.pseudos = {}
358 360
 
359 361
   return qwery
360  
-}, this);
  362
+});
14  tests/phantom.js
... ...
@@ -1,8 +1,11 @@
1 1
 var page = new WebPage()
2 2
   , url = "http://localhost:3000/tests/index.html"
3 3
 
  4
+var fs = require("fs");
  5
+
  6
+
4 7
 function waitFor(testFx, onReady, timeOutMillis) {
5  
-  var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5000
  8
+  var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 10000
6 9
     , start = new Date().getTime()
7 10
     , condition = false
8 11
     , interval = setInterval(function() {
@@ -28,15 +31,14 @@ page.open(url, function (status) {
28 31
     var result = page.evaluate(function () {
29 32
       return document.querySelectorAll('.sink-pass').length
30 33
     })
31  
-      , result2 = page.evaluate(function () {
  34
+    var result2 = page.evaluate(function () {
32 35
         return document.querySelectorAll('.pass').length
33 36
       })
34  
-    console.log('-----------------------------------------')
35  
-    console.log(result2)
36 37
     return !!result
37 38
   }
38 39
 , function() {
39  
-    console.log("qwery is loaded")
40  
-    phantom.exit()
  40
+    fs.write("hey there")
  41
+    console.log("qwery tests have passed")
  42
+    phantom.exit(0)
41 43
   })
42 44
 })
25  tests/test-env.js
... ...
@@ -0,0 +1,25 @@
  1
+// node_modules/serve/bin/serve .
  2
+// node_modules/phantomjs/bin/phantomjs tests/phantom.js
  3
+
  4
+
  5
+var childProcess = require('child_process')
  6
+var phantomjs = require('phantomjs')
  7
+var path = require('path')
  8
+var binPath = phantomjs.path
  9
+
  10
+var childArgs = [
  11
+  path.join(__dirname, 'phantom.js')
  12
+]
  13
+
  14
+var server = childProcess.spawn('node_modules/serve/bin/serve', ['.'])
  15
+
  16
+var phantomServer = childProcess.spawn(binPath, childArgs)
  17
+
  18
+phantomServer.on('exit', function (code) {
  19
+  if (code === 0) {
  20
+    console.log('all tests pass. congratulations')
  21
+  } else {
  22
+    console.log('tests fail')
  23
+  }
  24
+  server.kill()
  25
+})

0 notes on commit e0b349d

Please sign in to comment.
Something went wrong with that request. Please try again.