Include NWMatcher as a submodule.
This commit is contained in:
parent
17e8064d8a
commit
15c323b9ac
|
@ -14,3 +14,6 @@
|
|||
[submodule "vendor/sizzle/sizzle"]
|
||||
path = vendor/sizzle/sizzle
|
||||
url = git://github.com/jeresig/sizzle.git
|
||||
[submodule "vendor/nwmatcher/nwmatcher"]
|
||||
path = vendor/nwmatcher/nwmatcher
|
||||
url = git://github.com/dperini/nwmatcher.git
|
||||
|
|
7
Rakefile
7
Rakefile
|
@ -40,6 +40,7 @@ module PrototypeHelper
|
|||
def self.sprocketize(path, source, destination = nil, strip_comments = true)
|
||||
require_sprockets
|
||||
require_sizzle
|
||||
require_nwmatcher
|
||||
secretary = Sprockets::Secretary.new(
|
||||
:root => File.join(ROOT_DIR, path),
|
||||
:load_path => self.load_path,
|
||||
|
@ -100,6 +101,12 @@ module PrototypeHelper
|
|||
end
|
||||
end
|
||||
|
||||
def self.require_nwmatcher
|
||||
if !File.exists?(File.join(ROOT_DIR, 'vendor', 'nwmatcher', 'src', 'nwmatcher.js'))
|
||||
exit unless get_submodule("NWMmatcher", "nwmatcher/nwmatcher")
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_submodule(name, path)
|
||||
require_git
|
||||
puts "\nYou seem to be missing #{name}. Obtaining it via git...\n\n"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c9f5d5d4fc4ca294477f803bb8d688a8d45de664
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
Prototype._original_nw = window.NW;
|
||||
//= require <nwmatcher-1.1.1>
|
||||
//= require "nwmatcher/src/nwmatcher"
|
||||
Prototype.NW = window.NW;
|
||||
|
||||
// Restore globals.
|
||||
|
@ -7,14 +7,8 @@ window.NW = Prototype._original_nw;
|
|||
delete Prototype._original_nw;
|
||||
|
||||
Prototype.Selector = (function(NW) {
|
||||
function extend(elements) {
|
||||
for (var i = 0, length = elements.length; i < length; i++)
|
||||
elements[i] = Element.extend(elements[i]);
|
||||
return elements;
|
||||
}
|
||||
|
||||
function select(selector, scope) {
|
||||
return extend(NW.select(selector, scope || document));
|
||||
return NW.select(selector, scope || document, null, Element.extend);
|
||||
}
|
||||
|
||||
function filter(elements, selector) {
|
||||
|
|
Loading…
Reference in New Issue