omf_web 0.9.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +31 -0
- data/bin/omf_web_server.rb +157 -0
- data/doc/screenshot2.png +0 -0
- data/doc/widget_detail.png +0 -0
- data/example/demo/data_sources/downloads.rb +2 -1
- data/example/simple/README.md +12 -13
- data/example/simple/create_waveform.rb +29 -0
- data/example/simple/introduction.md +17 -0
- data/example/simple/sample.sq3 +0 -0
- data/example/simple/sample.sql +1008 -0
- data/example/simple/simple.yaml +62 -0
- data/example/simple/simple_dynamic.yaml +66 -0
- data/lib/irods4r/file.rb +15 -14
- data/lib/irods4r/icommands.rb +18 -18
- data/lib/irods4r.rb +9 -9
- data/lib/omf-web/config.ru +41 -16
- data/lib/omf-web/content/git_repository.rb +32 -31
- data/lib/omf-web/content/irods_repository.rb +34 -33
- data/lib/omf-web/content/repository.rb +48 -44
- data/lib/omf-web/data_source_proxy.rb +33 -22
- data/lib/omf-web/rack/session_authenticator.rb +48 -12
- data/lib/omf-web/rack/tab_mapper.rb +30 -36
- data/lib/omf-web/rack/websocket_handler.rb +26 -25
- data/lib/omf-web/session_store.rb +16 -13
- data/lib/omf-web/theme/abstract_page.rb +26 -22
- data/lib/omf-web/theme/bright/page.rb +84 -34
- data/lib/omf-web/theme/bright/stacked_renderer.rb +20 -19
- data/lib/omf-web/theme.rb +14 -9
- data/lib/omf-web/thin/runner.rb +38 -36
- data/lib/omf-web/thin/server.rb +255 -0
- data/lib/omf-web/version.rb +1 -1
- data/lib/omf-web/widget/data_widget.rb +6 -6
- data/lib/omf-web/widget/text/maruku/helpers.rb +33 -30
- data/lib/omf-web/widget/text/maruku/input/parse_block.rb +117 -117
- data/lib/omf-web/widget/text/maruku/output/to_html.rb +155 -154
- data/lib/omf-web/widget/text/maruku.rb +17 -16
- data/omf_web.gemspec +6 -2
- data/sample.sq3 +0 -0
- data/share/htdocs/graph/js/gauge.js +524 -0
- data/share/htdocs/vendor/VERSION_MAP.yaml +3 -3
- data/share/htdocs/vendor/backbone-1.0.0/backbone.js +1571 -0
- data/share/htdocs/vendor/d3-3.0/LICENSE.brewer.txt +38 -0
- data/share/htdocs/vendor/d3-3.0/colorbrewer.js +1 -0
- data/share/htdocs/vendor/d3-3.0/d3.js +8810 -0
- data/share/htdocs/vendor/d3-3.0/d3.min.js +5 -0
- data/share/htdocs/vendor/geo_json/Readme.txt +71 -0
- data/share/htdocs/vendor/geo_json/regions.json +41 -0
- data/share/htdocs/vendor/geo_json/switzerland.json +24 -0
- data/share/htdocs/vendor/geo_json/world.json +497 -0
- data/share/htdocs/vendor/nv_d3/js/nv.d3.js +8801 -4447
- data/share/htdocs/vendor/spin/jquery.spin.js +46 -0
- data/share/htdocs/vendor/spin/spin.js +349 -0
- data/share/htdocs/vendor/spin/spin.min.js +1 -0
- data/share/htdocs/vendor/underscore-1.4.4/underscore.js +1227 -0
- metadata +63 -48
- data/example/simple/data_sources/gimi31.sq3 +0 -0
- data/example/simple/data_sources/ping_source.rb +0 -56
- data/example/simple/simple_viz_server.rb +0 -39
- data/example/simple/widgets/charts_tab.yaml +0 -38
- data/share/.DS_Store +0 -0
- data/share/htdocs/.DS_Store +0 -0
- data/share/htdocs/vendor/backbone-0.5.3/backbone.js +0 -1158
- data/share/htdocs/vendor/underscore-1.2.1/underscore.js +0 -958
@@ -2,17 +2,17 @@
|
|
2
2
|
# Copyright (C) 2006 Andrea Censi <andrea (at) rubyforge.org>
|
3
3
|
#
|
4
4
|
# This file is part of Maruku.
|
5
|
-
#
|
5
|
+
#
|
6
6
|
# Maruku is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
8
|
# the Free Software Foundation; either version 2 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# Maruku is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
|
-
#
|
15
|
+
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Maruku; if not, write to the Free Software
|
18
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
|
24
|
-
# A series of helper functions for creating elements: they hide the
|
24
|
+
# A series of helper functions for creating elements: they hide the
|
25
25
|
# particular internal representation.
|
26
26
|
#
|
27
27
|
# Please, always use these instead of creating MDElement.
|
@@ -32,7 +32,7 @@ module Helpers
|
|
32
32
|
|
33
33
|
# if the first is a md_ial, it is used as such
|
34
34
|
def md_el(node_type, children=[], meta={}, al=nil)
|
35
|
-
if (e=children.first).kind_of?(MDElement) and
|
35
|
+
if (e=children.first).kind_of?(MDElement) and
|
36
36
|
e.node_type == :ial then
|
37
37
|
if al
|
38
38
|
al += e.ial
|
@@ -40,7 +40,7 @@ module Helpers
|
|
40
40
|
al = e.ial
|
41
41
|
end
|
42
42
|
children.shift
|
43
|
-
end
|
43
|
+
end
|
44
44
|
e = MDElement.new(node_type, children, meta, al)
|
45
45
|
e.doc = @doc
|
46
46
|
return e
|
@@ -49,7 +49,7 @@ module Helpers
|
|
49
49
|
def md_header(level, children, al=nil, line_no = -1)
|
50
50
|
md_el(:header, children, {:level => level, :line_no => line_no}, al)
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
# Inline code
|
54
54
|
def md_code(code, al=nil)
|
55
55
|
md_el(:inline_code, [], {:raw_code => code}, al)
|
@@ -79,7 +79,7 @@ module Helpers
|
|
79
79
|
def md_abbr(abbr, title)
|
80
80
|
md_el(:abbr, [abbr], {:title=>title})
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
def md_html(raw_html, al=nil)
|
84
84
|
e = md_el(:raw_html, [], {:raw_html=>raw_html})
|
85
85
|
begin
|
@@ -87,7 +87,7 @@ module Helpers
|
|
87
87
|
# end end of string, or else REXML gets confused
|
88
88
|
raw_html = raw_html.gsub(/\A\s*</,'<').
|
89
89
|
gsub(/>[\s\n]*\Z/,'>')
|
90
|
-
|
90
|
+
|
91
91
|
raw_html = "<marukuwrap>#{raw_html}</marukuwrap>"
|
92
92
|
e.instance_variable_set :@parsed_html,
|
93
93
|
REXML::Document.new(raw_html)
|
@@ -99,19 +99,21 @@ module Helpers
|
|
99
99
|
end
|
100
100
|
e
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def md_link(children, ref_id, al=nil)
|
104
|
+
#puts "LINK>>> '#{ref_id}'"
|
104
105
|
md_el(:link, children, {:ref_id=>ref_id.downcase}, al)
|
105
106
|
end
|
106
|
-
|
107
|
+
|
107
108
|
def md_im_link(children, url, title=nil, al=nil)
|
109
|
+
#puts "IM_LINK>>> '#{url}'"
|
108
110
|
md_el(:im_link, children, {:url=>url,:title=>title}, al)
|
109
111
|
end
|
110
|
-
|
112
|
+
|
111
113
|
def md_image(children, ref_id, al=nil)
|
112
114
|
md_el(:image, children, {:ref_id=>ref_id}, al)
|
113
115
|
end
|
114
|
-
|
116
|
+
|
115
117
|
def md_im_image(children, url, title=nil, al=nil)
|
116
118
|
md_el(:im_image, children, {:url=>url,:title=>title},al)
|
117
119
|
end
|
@@ -138,24 +140,25 @@ module Helpers
|
|
138
140
|
|
139
141
|
# <http://www.example.com/>
|
140
142
|
def md_url(url, al=nil)
|
143
|
+
#puts "URL>>> '#{url}'"
|
141
144
|
md_el(:immediate_link, [], {:url=>url}, al)
|
142
145
|
end
|
143
|
-
|
146
|
+
|
144
147
|
# <andrea@rubyforge.org>
|
145
148
|
# <mailto:andrea@rubyforge.org>
|
146
149
|
def md_email(email, al=nil)
|
147
150
|
md_el(:email_address, [], {:email=>email}, al)
|
148
151
|
end
|
149
|
-
|
152
|
+
|
150
153
|
def md_entity(entity_name, al=nil)
|
151
154
|
md_el(:entity, [], {:entity_name=>entity_name}, al)
|
152
155
|
end
|
153
|
-
|
156
|
+
|
154
157
|
# Markdown extra
|
155
158
|
def md_foot_ref(ref_id, al=nil)
|
156
159
|
md_el(:footnote_reference, [], {:footnote_id=>ref_id}, al)
|
157
160
|
end
|
158
|
-
|
161
|
+
|
159
162
|
def md_par(children, al=nil, line_no = -1)
|
160
163
|
#md_el(:paragraph, children, meta={}, al)
|
161
164
|
md_el(:paragraph, children, {:line_no => line_no}, al)
|
@@ -168,10 +171,10 @@ module Helpers
|
|
168
171
|
meta[:title] = title if title
|
169
172
|
md_el(:ref_definition, [], meta, al)
|
170
173
|
end
|
171
|
-
|
174
|
+
|
172
175
|
# inline attribute list
|
173
176
|
def md_ial(al)
|
174
|
-
al = Maruku::AttributeList.new(al) if
|
177
|
+
al = Maruku::AttributeList.new(al) if
|
175
178
|
not al.kind_of?Maruku::AttributeList
|
176
179
|
md_el(:ial, [], {:ial=>al})
|
177
180
|
end
|
@@ -180,7 +183,7 @@ module Helpers
|
|
180
183
|
def md_ald(id, al)
|
181
184
|
md_el(:ald, [], {:ald_id=>id,:ald=>al})
|
182
185
|
end
|
183
|
-
|
186
|
+
|
184
187
|
# Server directive <?target code... ?>
|
185
188
|
def md_xml_instr(target, code)
|
186
189
|
md_el(:xml_instr, [], {:target=>target, :code=>code})
|
@@ -191,10 +194,10 @@ end
|
|
191
194
|
|
192
195
|
module MaRuKu
|
193
196
|
|
194
|
-
class MDElement
|
197
|
+
class MDElement
|
195
198
|
# outputs abbreviated form (this should be eval()uable to get the document)
|
196
|
-
def inspect2
|
197
|
-
s =
|
199
|
+
def inspect2
|
200
|
+
s =
|
198
201
|
case @node_type
|
199
202
|
when :paragraph
|
200
203
|
"md_par(%s)" % children_inspect
|
@@ -208,7 +211,7 @@ class MDElement
|
|
208
211
|
"md_code(%s)" % self.raw_code.inspect
|
209
212
|
when :raw_html
|
210
213
|
"md_html(%s)" % self.raw_html.inspect
|
211
|
-
when :emphasis
|
214
|
+
when :emphasis
|
212
215
|
"md_em(%s)" % children_inspect
|
213
216
|
when :strong
|
214
217
|
"md_strong(%s)" % children_inspect
|
@@ -216,11 +219,11 @@ class MDElement
|
|
216
219
|
"md_url(%s)" % self.url.inspect
|
217
220
|
when :image
|
218
221
|
"md_image(%s, %s)" % [
|
219
|
-
children_inspect,
|
222
|
+
children_inspect,
|
220
223
|
self.ref_id.inspect]
|
221
224
|
when :im_image
|
222
225
|
"md_im_image(%s, %s, %s)" % [
|
223
|
-
children_inspect,
|
226
|
+
children_inspect,
|
224
227
|
self.url.inspect,
|
225
228
|
self.title.inspect]
|
226
229
|
when :link
|
@@ -228,13 +231,13 @@ class MDElement
|
|
228
231
|
children_inspect, self.ref_id.inspect]
|
229
232
|
when :im_link
|
230
233
|
"md_im_link(%s, %s, %s)" % [
|
231
|
-
children_inspect,
|
234
|
+
children_inspect,
|
232
235
|
self.url.inspect,
|
233
236
|
self.title.inspect,
|
234
237
|
]
|
235
238
|
when :ref_definition
|
236
239
|
"md_ref_def(%s, %s, %s)" % [
|
237
|
-
self.ref_id.inspect,
|
240
|
+
self.ref_id.inspect,
|
238
241
|
self.url.inspect,
|
239
242
|
self.title.inspect
|
240
243
|
]
|
@@ -243,12 +246,12 @@ class MDElement
|
|
243
246
|
else
|
244
247
|
return nil
|
245
248
|
end
|
246
|
-
if @al and not @al.empty? then
|
249
|
+
if @al and not @al.empty? then
|
247
250
|
s = s.chop + ", #{@al.inspect})"
|
248
251
|
end
|
249
252
|
s
|
250
253
|
end
|
251
|
-
|
254
|
+
|
252
255
|
end
|
253
256
|
|
254
257
|
end
|