backbone-view-enhanced-events-declaration-rails 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjAyNGFjZDQ1MzQzMzcwNzE2NTQ5NmZmODE2ZGFlNDNlOGJmYjBiZg==
5
+ data.tar.gz: !binary |-
6
+ YWI2NTg5ZDRmMzA3OTdkMjgzMTcxZTM5ZTgxODFjYzRmODQxYjNlMQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YThhNGRmOWI2NzI5MDBhY2M1NjhjYjQzZTIyNTM2MWQxYTlmNmUyMDIyOTY0
10
+ ZmZlOWI2M2Y5NWRlYTdmYWQ1ZjJiMWYyOWRkOGY2ZWRlMjgzZDBiYTk4OWI5
11
+ YTY2NmIyMzBjMTBmYWI5ODAyNjcyN2VjMTZkYTdlMDBjYWRlNzI=
12
+ data.tar.gz: !binary |-
13
+ ZjA1ZTA0MzdjYzY5Mzc2Mzk1ZWFiZDZlZGJmMTM3MGFlY2YyMTRiNDUzNzA1
14
+ NDlhYWQxZTVmNjc4OWE2MWRmNmUwYjAxMDZkNzM2MTc0M2I3NGU4MzI3Y2Mz
15
+ YjU5YjNhYzFkOTdhZDBlODk3MTRhNjI1NGJlYzdmYzZjYjNlNzQ=
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .idea/
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
+ <option name="GEM_APP_TEST_PATH" value="" />
8
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager">
13
+ <content url="file://$MODULE_DIR$" />
14
+ <orderEntry type="inheritedJdk" />
15
+ <orderEntry type="sourceFolder" forTests="false" />
16
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.3.4, RVM: ruby-2.0.0-p0 [fuse_tube]) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.1.0, RVM: ruby-2.0.0-p0 [fuse_tube]) [gem]" level="application" />
18
+ </component>
19
+ </module>
20
+
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
data/.idea/misc.xml ADDED
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.0.0-p0 [fuse_tube]" project-jdk-type="RUBY_SDK" />
4
+ </project>
5
+
data/.idea/modules.xml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/backbone-view-enhanced-events-declaration-rails.iml" filepath="$PROJECT_DIR$/.idea/backbone-view-enhanced-events-declaration-rails.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,5 @@
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
@@ -0,0 +1,196 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="18809f26-fe51-417c-8c57-36e8c0c19410" name="Default" comment="" />
5
+ <ignored path="backbone-view-enhanced-events-declaration-rails.iws" />
6
+ <ignored path=".idea/workspace.xml" />
7
+ <file path="/Dummy.txt" changelist="18809f26-fe51-417c-8c57-36e8c0c19410" time="1371986427687" ignored="false" />
8
+ <file path="/a.dummy" changelist="18809f26-fe51-417c-8c57-36e8c0c19410" time="1371986434443" ignored="false" />
9
+ <file path="$PROJECT_DIR$/../work/fusetube/spec/controllers/api/v1/contents_controller_spec.rb" changelist="18809f26-fe51-417c-8c57-36e8c0c19410" time="1371986653974" ignored="false" />
10
+ <option name="TRACKING_ENABLED" value="true" />
11
+ <option name="SHOW_DIALOG" value="false" />
12
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14
+ <option name="LAST_RESOLUTION" value="IGNORE" />
15
+ </component>
16
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
17
+ <component name="CreatePatchCommitExecutor">
18
+ <option name="PATCH_PATH" value="" />
19
+ </component>
20
+ <component name="DaemonCodeAnalyzer">
21
+ <disable_hints />
22
+ </component>
23
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
24
+ <component name="FileEditorManager">
25
+ <leaf />
26
+ </component>
27
+ <component name="FindManager">
28
+ <FindUsagesManager>
29
+ <setting name="OPEN_NEW_TAB" value="false" />
30
+ </FindUsagesManager>
31
+ </component>
32
+ <component name="Git.Settings">
33
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
34
+ </component>
35
+ <component name="GitLogSettings">
36
+ <option name="myDateState">
37
+ <MyDateState />
38
+ </option>
39
+ </component>
40
+ <component name="IdeDocumentHistory">
41
+ <option name="changedFiles">
42
+ <list>
43
+ <option value="$PROJECT_DIR$/backbone-view-enhanced-events-declaration-rails.gemspec" />
44
+ </list>
45
+ </option>
46
+ </component>
47
+ <component name="ProjectFrameBounds">
48
+ <option name="x" value="65" />
49
+ <option name="y" value="24" />
50
+ <option name="width" value="1301" />
51
+ <option name="height" value="744" />
52
+ </component>
53
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
54
+ <OptionsSetting value="true" id="Add" />
55
+ <OptionsSetting value="true" id="Remove" />
56
+ <OptionsSetting value="true" id="Checkout" />
57
+ <OptionsSetting value="true" id="Update" />
58
+ <OptionsSetting value="true" id="Status" />
59
+ <OptionsSetting value="true" id="Edit" />
60
+ <ConfirmationsSetting value="2" id="Add" />
61
+ <ConfirmationsSetting value="0" id="Remove" />
62
+ </component>
63
+ <component name="ProjectReloadState">
64
+ <option name="STATE" value="0" />
65
+ </component>
66
+ <component name="ProjectView">
67
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
68
+ <flattenPackages />
69
+ <showMembers />
70
+ <showModules />
71
+ <showLibraryContents />
72
+ <hideEmptyPackages />
73
+ <abbreviatePackageNames />
74
+ <autoscrollToSource />
75
+ <autoscrollFromSource />
76
+ <sortByType />
77
+ </navigator>
78
+ <panes>
79
+ <pane id="ProjectPane">
80
+ <subPane>
81
+ <PATH>
82
+ <PATH_ELEMENT>
83
+ <option name="myItemId" value="backbone-view-enhanced-events-declaration-rails" />
84
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
85
+ </PATH_ELEMENT>
86
+ </PATH>
87
+ <PATH>
88
+ <PATH_ELEMENT>
89
+ <option name="myItemId" value="backbone-view-enhanced-events-declaration-rails" />
90
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
91
+ </PATH_ELEMENT>
92
+ <PATH_ELEMENT>
93
+ <option name="myItemId" />
94
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
95
+ </PATH_ELEMENT>
96
+ </PATH>
97
+ </subPane>
98
+ </pane>
99
+ <pane id="Scope" />
100
+ </panes>
101
+ </component>
102
+ <component name="PropertiesComponent">
103
+ <property name="WebServerToolWindowFactoryState" value="false" />
104
+ </component>
105
+ <component name="RunManager">
106
+ <list size="0" />
107
+ </component>
108
+ <component name="ShelveChangesManager" show_recycled="false" />
109
+ <component name="TaskManager">
110
+ <task active="true" id="Default" summary="Default task">
111
+ <changelist id="18809f26-fe51-417c-8c57-36e8c0c19410" name="Default" comment="" />
112
+ <created>1371986426729</created>
113
+ <updated>1371986426729</updated>
114
+ </task>
115
+ <servers />
116
+ </component>
117
+ <component name="ToolWindowManager">
118
+ <frame x="65" y="24" width="1301" height="744" extended-state="6" />
119
+ <editor active="true" />
120
+ <layout>
121
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
122
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
123
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
124
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
125
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
126
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24940048" sideWeight="0.9983871" order="0" side_tool="false" content_ui="combo" />
127
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
128
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
129
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
130
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
131
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
132
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
133
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
134
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
135
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
136
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
137
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
138
+ </layout>
139
+ </component>
140
+ <component name="VcsContentAnnotationSettings">
141
+ <option name="myLimit" value="2678400000" />
142
+ </component>
143
+ <component name="VcsManagerConfiguration">
144
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
145
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
146
+ <option name="CHECK_NEW_TODO" value="true" />
147
+ <option name="myTodoPanelSettings">
148
+ <value>
149
+ <are-packages-shown value="false" />
150
+ <are-modules-shown value="false" />
151
+ <flatten-packages value="false" />
152
+ <is-autoscroll-to-source value="false" />
153
+ </value>
154
+ </option>
155
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
156
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
157
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
158
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
159
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
160
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
161
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
162
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
163
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
164
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
165
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
166
+ <option name="SHORT_DIFF_HORISONTALLY" value="true" />
167
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
168
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
169
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
170
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
171
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
172
+ <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
173
+ <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
174
+ <option name="LIMIT_HISTORY" value="true" />
175
+ <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
176
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
177
+ <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
178
+ <option name="LAST_COMMIT_MESSAGE" />
179
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
180
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
181
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
182
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
183
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
184
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
185
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
186
+ <option name="ACTIVE_VCS_NAME" />
187
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
188
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
189
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
190
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
191
+ </component>
192
+ <component name="XDebuggerManager">
193
+ <breakpoint-manager />
194
+ </component>
195
+ </project>
196
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in backbone-view-enhanced-events-declaration-rails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Alexander Kaupanin
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # Backbone::View::Enhanced::Events::Declaration::Rails
2
+
3
+ A Rails 3 asset pipeline gem for [Backbone.View.EnhancedEventsDeclaration](http://github.com/simsalabim/backbone.view.enhanced_events_declaration) mixin.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'backbone-view-enhanced-events-declaration-rails', '~> 0.0.3'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install backbone-view-enhanced-events-declaration-rails
18
+
19
+ ## Usage
20
+
21
+ Add the mixin script to your `application.coffee` after backbone.js
22
+
23
+ ```coffeescript
24
+ #= require backbone
25
+ #= require backbone/backbone.view.enhanced_events_declaration
26
+ ```
27
+
28
+ There's also a minified version available by `backbone/backbone.view.enhanced_events_declaration.min`
29
+
30
+ That's it! Now you can inherit your classes from `Backbone.View` and use all the convenience of enhanced events declaration.
31
+
32
+ ```coffeescript
33
+ class ContentView extends Backbone.View
34
+
35
+ events:
36
+ 'click .decorate' : 'decorate'
37
+ 'click .reorder' : 'reorder'
38
+ 'click .mix-it' : 'decorate reorder'
39
+ 'click .mix-it-again' : [ 'decorate', 'reorder' ]
40
+ 'click .mix-it-quick' : [ 'decorate', =>( console.log('reordering method') ) ]
41
+
42
+ decorate: (e) ->
43
+ # ...
44
+
45
+ reorder: (e) ->
46
+ # ...
47
+ ```
48
+
49
+
50
+
51
+
52
+ ## Contributing
53
+
54
+ 1. Fork it
55
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
56
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
57
+ 4. Push to the branch (`git push origin my-new-feature`)
58
+ 5. Create new Pull Request
59
+
60
+
61
+ Author: Alexander Kaupanin
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'backbone-view-enhanced-events-declaration-rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "backbone-view-enhanced-events-declaration-rails"
8
+ spec.version = BackboneViewEnhancedEventsDeclarationRails::VERSION
9
+ spec.authors = ["Alexander Kaupanin"]
10
+ spec.email = ["kaupanin@gmail.com"]
11
+ spec.description = %q{A Rails 3 asset pipeline gem for Backbone.View.EnhancedEventsDeclaration mixin}
12
+ spec.summary = %q{A Rails 3 asset pipeline gem for Backbone.View.EnhancedEventsDeclaration mixin}
13
+ spec.homepage = "http://github.com/simsalabim/backbone-view-enhanced-events-declaration-rails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,5 @@
1
+ require "backbone-view-enhanced-events-declaration-rails/version"
2
+ require "backbone-view-enhanced-events-declaration-rails/engine"
3
+
4
+ module BackboneViewEnhancedEventsDeclarationRails
5
+ end
@@ -0,0 +1,7 @@
1
+ module BackboneViewEnhancedEventsDeclarationRails
2
+ class Engine < ::Rails::Engine
3
+ initializer 'backbone-view-enhanced-events-declaration-rails.load_static_assets' do |app|
4
+ app.middleware.use ::ActionDispatch::Static, "#{root}/vendor"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module BackboneViewEnhancedEventsDeclarationRails
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,50 @@
1
+ // Cached regex to split keys for `delegate`.
2
+ var delegateEventSplitter = /^(\S+)\s*(.*)$/;
3
+
4
+ (function() {
5
+
6
+ _.extend(Backbone.View.prototype, {
7
+ delegateEvents: function(events) {
8
+ if (!(events || (events = _.result(this, 'events')))) return this;
9
+ this.undelegateEvents();
10
+ for (var key in events) {
11
+ var method = events[key];
12
+ var match = key.match(delegateEventSplitter);
13
+ var eventName = match[1], selector = match[2];
14
+ eventName += '.delegateEvents' + this.cid;
15
+
16
+ if (_.isFunction(method)) {
17
+ this.bindMethod(method, eventName, selector);
18
+ } else if (_.isArray(method)) {
19
+ method = _.compact(method);
20
+ for (var i in method) {
21
+ if (_.isFunction(method[i])) {
22
+ this.bindMethod(method[i], eventName, selector);
23
+ } else {
24
+ if (!this[method[i]]) continue;
25
+ this.bindMethod(this[method[i]], eventName, selector);
26
+ }
27
+ }
28
+ } else {
29
+ method = _.compact(method.split(/\s/));
30
+ for (var i in method) {
31
+ if (!this[method[i]]) continue;
32
+ this.bindMethod(this[method[i]], eventName, selector);
33
+ }
34
+ }
35
+ }
36
+ return this;
37
+ },
38
+
39
+ // Binds a method to an event in context of selector (if present non-empty string)
40
+ bindMethod: function(method, eventName, selector) {
41
+ method = _.bind(method, this);
42
+ if (selector === '') {
43
+ this.$el.on(eventName, method);
44
+ } else {
45
+ this.$el.on(eventName, selector, method);
46
+ }
47
+ }
48
+ });
49
+
50
+ })();
@@ -0,0 +1 @@
1
+ var delegateEventSplitter=/^(\S+)\s*(.*)$/;(function(){_.extend(Backbone.View.prototype,{delegateEvents:function(a){if(!a&&!(a=_.result(this,"events")))return this;this.undelegateEvents();for(var b in a){var c=a[b],d=b.match(delegateEventSplitter),e=d[1],f=d[2];if(e+=".delegateEvents"+this.cid,_.isFunction(c))this.bindMethod(c,e,f);else if(_.isArray(c)){c=_.compact(c);for(var g in c)if(_.isFunction(c[g]))this.bindMethod(c[g],e,f);else{if(!this[c[g]])continue;this.bindMethod(this[c[g]],e,f)}}else{c=_.compact(c.split(/\s/));for(var g in c)this[c[g]]&&this.bindMethod(this[c[g]],e,f)}}return this},bindMethod:function(a,b,c){a=_.bind(a,this),""===c?this.$el.on(b,a):this.$el.on(b,c,a)}})})();
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: backbone-view-enhanced-events-declaration-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Kaupanin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A Rails 3 asset pipeline gem for Backbone.View.EnhancedEventsDeclaration
42
+ mixin
43
+ email:
44
+ - kaupanin@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - .gitignore
50
+ - .idea/backbone-view-enhanced-events-declaration-rails.iml
51
+ - .idea/encodings.xml
52
+ - .idea/misc.xml
53
+ - .idea/modules.xml
54
+ - .idea/scopes/scope_settings.xml
55
+ - .idea/vcs.xml
56
+ - .idea/workspace.xml
57
+ - Gemfile
58
+ - LICENSE.txt
59
+ - README.md
60
+ - Rakefile
61
+ - backbone-view-enhanced-events-declaration-rails.gemspec
62
+ - lib/backbone-view-enhanced-events-declaration-rails.rb
63
+ - lib/backbone-view-enhanced-events-declaration-rails/engine.rb
64
+ - lib/backbone-view-enhanced-events-declaration-rails/version.rb
65
+ - vendor/assets/javascripts/backbone/backbone.view.enhanced_events_declaration.js
66
+ - vendor/assets/javascripts/backbone/backbone.view.enhanced_events_declaration.min.js
67
+ homepage: http://github.com/simsalabim/backbone-view-enhanced-events-declaration-rails
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.0.3
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: A Rails 3 asset pipeline gem for Backbone.View.EnhancedEventsDeclaration
91
+ mixin
92
+ test_files: []