sumatra-rails 0.0.3.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Gemfile.lock +32 -32
- data/lib/sumatra/rails/version.rb +1 -1
- data/sumatra-rails.gemspec +1 -1
- data/vendor/assets/javascripts/sumatra.js.coffee +1 -121
- data/vendor/assets/javascripts/sumatra/.env.example +1 -0
- data/vendor/assets/javascripts/sumatra/.gitignore +2 -0
- data/vendor/assets/javascripts/sumatra/Cakefile +27 -0
- data/vendor/assets/javascripts/sumatra/LICENSE.md +20 -0
- data/vendor/assets/javascripts/sumatra/README.md +183 -0
- data/vendor/assets/javascripts/sumatra/component.json +30 -0
- data/vendor/assets/javascripts/sumatra/docs/docco.css +500 -0
- data/vendor/assets/javascripts/sumatra/docs/index.html +177 -0
- data/vendor/assets/javascripts/sumatra/docs/index.md +0 -0
- data/vendor/assets/javascripts/sumatra/docs/plugin.js.html +207 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.eot +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.ttf +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.woff +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.eot +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.ttf +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.woff +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.eot +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.ttf +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.woff +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.eot +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.ttf +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.woff +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/images/gray.png +0 -0
- data/vendor/assets/javascripts/sumatra/docs/public/stylesheets/normalize.css +375 -0
- data/vendor/assets/javascripts/sumatra/docs/runtime.js.html +111 -0
- metadata +29 -4
@@ -0,0 +1,111 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>runtime.js.coffee</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
+
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
+
<link rel="stylesheet" media="all" href="docco.css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="container">
|
12
|
+
<div id="background"></div>
|
13
|
+
|
14
|
+
<ul class="sections">
|
15
|
+
|
16
|
+
<li id="title">
|
17
|
+
<div class="annotation">
|
18
|
+
<h1>runtime.js.coffee</h1>
|
19
|
+
</div>
|
20
|
+
</li>
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
<li id="section-1">
|
25
|
+
<div class="annotation">
|
26
|
+
|
27
|
+
<div class="pilwrap for-h2">
|
28
|
+
<a class="pilcrow" href="#section-1">¶</a>
|
29
|
+
</div>
|
30
|
+
<h2>SumatraRuntime</h2>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
|
34
|
+
</li>
|
35
|
+
|
36
|
+
|
37
|
+
<li id="section-2">
|
38
|
+
<div class="annotation">
|
39
|
+
|
40
|
+
<div class="pilwrap ">
|
41
|
+
<a class="pilcrow" href="#section-2">¶</a>
|
42
|
+
</div>
|
43
|
+
<p>Defines a jQuery plugin using a service object with a nice,
|
44
|
+
consistent, CoffeeScript-style interface. Plugins can extend
|
45
|
+
<code>SumatraPlugin</code>, a prototype that makes defining plugins with
|
46
|
+
Sumatra easier.</p>
|
47
|
+
<p>The runtime function returns the generated jQuery plugin to the
|
48
|
+
global scope so it can be used in your application code.</p>
|
49
|
+
<p>Arguments:</p>
|
50
|
+
<ul>
|
51
|
+
<li><strong>plugin_name:</strong> The jQuery plugin name, called like <code>$('div').myPlugin();</code></li>
|
52
|
+
<li><strong>plugin_code:</strong> A function that will be executed immediately and must return
|
53
|
+
a single object that takes 3 parameters in its constructor. These parameters
|
54
|
+
are the <code>element</code> being targeted by jQuery, the <code>index</code> at which it appears
|
55
|
+
in the query, and the <code>options</code> hash passed during the instantiation of the
|
56
|
+
jQuery plugin.</li>
|
57
|
+
</ul>
|
58
|
+
<p>Example:</p>
|
59
|
+
<pre><code>sumatra 'myPlugin', ->
|
60
|
+
class MyPlugin extends SumatraPlugin
|
61
|
+
action: null
|
62
|
+
initialize:
|
63
|
+
alert 'loaded'</code></pre>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="content"><div class="highlight"><pre><span class="property">@sumatra</span> = (plugin_name, plugin_code) -></pre></div></div>
|
68
|
+
|
69
|
+
</li>
|
70
|
+
|
71
|
+
|
72
|
+
<li id="section-3">
|
73
|
+
<div class="annotation">
|
74
|
+
|
75
|
+
<div class="pilwrap ">
|
76
|
+
<a class="pilcrow" href="#section-3">¶</a>
|
77
|
+
</div>
|
78
|
+
<p>Instantiate a PluginHelper and apply the current scope. This can
|
79
|
+
be any object that responds to 3 parameters in its constructor
|
80
|
+
and will be set to whatever is returned by <code>plugin_code()</code>.</p>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div class="content"><div class="highlight"><pre>PluginHelper = plugin_code.apply <span class="keyword">this</span>
|
85
|
+
|
86
|
+
jQuery.fn[plugin_name] = (options={}) ->
|
87
|
+
<span class="property">@each</span> (index, element) -></pre></div></div>
|
88
|
+
|
89
|
+
</li>
|
90
|
+
|
91
|
+
|
92
|
+
<li id="section-4">
|
93
|
+
<div class="annotation">
|
94
|
+
|
95
|
+
<div class="pilwrap ">
|
96
|
+
<a class="pilcrow" href="#section-4">¶</a>
|
97
|
+
</div>
|
98
|
+
<p>For each element, create a <code>PluginHelper</code> instance
|
99
|
+
of the passed-in <code>plugin_code</code> and apply the jQuery
|
100
|
+
plugin parameters to the constructor. </p>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="content"><div class="highlight"><pre><span class="keyword">new</span> PluginHelper(element, index, options)</pre></div></div>
|
105
|
+
|
106
|
+
</li>
|
107
|
+
|
108
|
+
</ul>
|
109
|
+
</div>
|
110
|
+
</body>
|
111
|
+
</html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sumatra-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2
|
19
|
+
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.2
|
26
|
+
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jquery-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,31 @@ files:
|
|
108
108
|
- test/sumatra_test.rb
|
109
109
|
- test/test_helper.rb
|
110
110
|
- vendor/assets/javascripts/sumatra.js.coffee
|
111
|
+
- vendor/assets/javascripts/sumatra/.env.example
|
112
|
+
- vendor/assets/javascripts/sumatra/.gitignore
|
113
|
+
- vendor/assets/javascripts/sumatra/Cakefile
|
114
|
+
- vendor/assets/javascripts/sumatra/LICENSE.md
|
115
|
+
- vendor/assets/javascripts/sumatra/README.md
|
116
|
+
- vendor/assets/javascripts/sumatra/component.json
|
117
|
+
- vendor/assets/javascripts/sumatra/docs/docco.css
|
118
|
+
- vendor/assets/javascripts/sumatra/docs/index.html
|
119
|
+
- vendor/assets/javascripts/sumatra/docs/index.md
|
120
|
+
- vendor/assets/javascripts/sumatra/docs/plugin.js.html
|
121
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.eot
|
122
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.ttf
|
123
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-bold.woff
|
124
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.eot
|
125
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.ttf
|
126
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/aller-light.woff
|
127
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.eot
|
128
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.ttf
|
129
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/fleurons.woff
|
130
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.eot
|
131
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.ttf
|
132
|
+
- vendor/assets/javascripts/sumatra/docs/public/fonts/novecento-bold.woff
|
133
|
+
- vendor/assets/javascripts/sumatra/docs/public/images/gray.png
|
134
|
+
- vendor/assets/javascripts/sumatra/docs/public/stylesheets/normalize.css
|
135
|
+
- vendor/assets/javascripts/sumatra/docs/runtime.js.html
|
111
136
|
homepage: http://github.com/tubbo/sumatra-rails
|
112
137
|
licenses: []
|
113
138
|
metadata: {}
|