Permalink
Browse files

Add wrapper for mootools Slick CSS selector. Usage:

    $ git submodule init vendor/slick/repository
    $ git submodule update vendor/slick/repository
    $ rake dist SELECTOR_ENGINE=slick

Run tests:

    $ rake test TESTS=selector SELECTOR_ENGINE=slick
  • Loading branch information...
tobie committed May 2, 2010
1 parent eb26357 commit 443e1e1feca21b9b9e2d325e335fb814923b0255
Showing with 30 additions and 0 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 vendor/slick/repository
  3. +26 −0 vendor/slick/selector_engine.js
View
@@ -18,3 +18,6 @@
[submodule "vendor/sizzle/repository"]
path = vendor/sizzle/repository
url = git://github.com/jeresig/sizzle.git
+[submodule "vendor/slick/repository"]
+ path = vendor/slick/repository
+ url = http://github.com/mootools/slick.git

This comment has been minimized.

Show comment
Hide comment
@TooTallNate

TooTallNate May 4, 2010

Why aren't you using git://github.com/mootools/slick.git gere? It's faster, no?

@TooTallNate

TooTallNate May 4, 2010

Why aren't you using git://github.com/mootools/slick.git gere? It's faster, no?

This comment has been minimized.

Show comment
Hide comment
@arthurschreiber

arthurschreiber May 4, 2010

Contributor

I wouldn't mind switching all submodules to http, as this would make it easier for those that sit behind a firewall.

@arthurschreiber

arthurschreiber May 4, 2010

Contributor

I wouldn't mind switching all submodules to http, as this would make it easier for those that sit behind a firewall.

This comment has been minimized.

Show comment
Hide comment
@TooTallNate

TooTallNate May 4, 2010

Aaahhh, I hadn't considered that. Well I have no objections. It's a one time thing, so I don't really care how fast it is, I'm more interested in it being consistent I guess (not that it really matters in the end).

@TooTallNate

TooTallNate May 4, 2010

Aaahhh, I hadn't considered that. Well I have no objections. It's a one time thing, so I don't really care how fast it is, I'm more interested in it being consistent I guess (not that it really matters in the end).

This comment has been minimized.

Show comment
Hide comment
@tobie

tobie May 5, 2010

Collaborator

Fixed in f372474.

That was a typo due to Github changing its default to HTTP when copy-pasting urls.

I'm all for consistency so if we want to move this to HTTP we'll want to change all repos at the same. I'm personally not too much in favor of that change, but please feel free to open a ticket.

Thanks.

@tobie

tobie May 5, 2010

Collaborator

Fixed in f372474.

That was a typo due to Github changing its default to HTTP when copy-pasting urls.

I'm all for consistency so if we want to move this to HTTP we'll want to change all repos at the same. I'm personally not too much in favor of that change, but please feel free to open a ticket.

Thanks.

Submodule repository added at b7d3a3
@@ -0,0 +1,26 @@
+Prototype._original_property = window.Slick;
+//= require "repository/Source/Slick.Parser.js"
+//= require "repository/Source/Slick.Finder.js"
+
+Prototype.Selector = (function(engine) {
+ function extend(elements) {
+ for (var i = 0, length = elements.length; i < length; i++) {
+ Element.extend(elements[i]);
+ }
+ return elements;
+ }
+
+ function select(selector, scope) {
+ return extend(engine.search(scope || document, selector));
+ }
+
+ return {
+ engine: engine,
+ select: select,
+ match: engine.match
+ };
+})(Slick);
+
+// Restore globals.
+window.Slick = Prototype._original_property;
+delete Prototype._original_property;

1 comment on commit 443e1e1

@TooTallNate

This comment has been minimized.

Show comment
Hide comment
@TooTallNate

TooTallNate May 2, 2010

Swweeetttt

Swweeetttt

Please sign in to comment.