spiderfw 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/VERSION +1 -1
- data/apps/core/auth/lib/rbac.rb +15 -0
- data/apps/core/auth/models/mixins/rbac_provider.rb +28 -10
- data/apps/core/auth/po/it/spider_auth.po +3 -2
- data/apps/core/auth/po/spider_auth.pot +3 -2
- data/apps/core/auth/views/login.shtml +1 -1
- data/apps/core/components/po/it/spider_components.po +11 -12
- data/apps/core/components/po/spider_components.pot +11 -10
- data/apps/core/components/public/css/crud.css +4 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/css/Aristo/jquery-ui.custom.css +1 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +1 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +11 -11
- data/apps/core/components/public/js/jquery/plugins/jquery.form.js +325 -154
- data/apps/core/components/public/js/spider.js +6 -0
- data/apps/core/components/widgets/admin/admin.rb +44 -1
- data/apps/core/components/widgets/crud/crud.rb +48 -27
- data/apps/core/components/widgets/crud/crud.shtml +5 -3
- data/apps/core/components/widgets/table/table.rb +3 -3
- data/apps/core/forms/po/it/spider_forms.po +4 -4
- data/apps/core/forms/po/spider_forms.pot +4 -3
- data/apps/core/forms/public/ckeditor/CHANGES.html +1295 -0
- data/apps/core/forms/public/ckeditor/INSTALL.html +92 -0
- data/apps/core/forms/public/ckeditor/LICENSE.html +1334 -0
- data/apps/core/forms/public/ckeditor/adapters/jquery.js +2 -2
- data/apps/core/forms/public/ckeditor/ckeditor.js +141 -133
- data/apps/core/forms/public/ckeditor/ckeditor_basic.js +8 -0
- data/apps/core/forms/public/ckeditor/ckeditor_basic_source.js +20 -0
- data/apps/core/forms/public/ckeditor/ckeditor_source.js +25 -0
- data/apps/core/forms/public/ckeditor/config.js +11 -0
- data/apps/core/forms/public/ckeditor/contents.css +23 -0
- data/apps/core/forms/public/ckeditor/lang/_languages.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/_translationstatus.txt +58 -57
- data/apps/core/forms/public/ckeditor/lang/af.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ar.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/bg.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/bn.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/bs.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ca.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/cs.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/cy.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/da.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/de.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/el.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/en-au.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/en-ca.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/en-gb.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/en.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/eo.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/es.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/et.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/eu.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/fa.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/fi.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/fo.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/fr-ca.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/fr.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/gl.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/gu.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/he.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/hi.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/hr.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/hu.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/is.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/it.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ja.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ka.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/km.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ko.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/lt.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/lv.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/mn.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ms.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/nb.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/nl.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/no.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/pl.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/pt-br.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/pt.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ro.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/ru.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/sk.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/sl.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/sr-latn.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/sr.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/sv.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/th.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/tr.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/uk.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/vi.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/zh-cn.js +2 -2
- data/apps/core/forms/public/ckeditor/lang/zh.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/he.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/about/dialogs/about.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/adobeair/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/ajax/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/bbcode/plugin.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/clipboard/dialogs/paste.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/devtools/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/devtools/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/div/dialogs/div.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
- data/apps/core/forms/public/ckeditor/plugins/docprops/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/button.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/form.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/radio.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/select.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textfield.js +2 -3
- data/apps/core/forms/public/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/iframedialog/plugin.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js +8 -8
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/anchor.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/link.js +7 -7
- data/apps/core/forms/public/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js +7 -6
- data/apps/core/forms/public/ckeditor/plugins/pastetext/dialogs/pastetext.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/placeholder/dialogs/placeholder.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/placeholder/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/placeholder/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/placeholder/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/options.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
- data/apps/core/forms/public/ckeditor/plugins/smiley/dialogs/smiley.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/specialchar/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/styles/styles/default.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/tabletools/dialogs/tableCell.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/templates/dialogs/templates.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/default.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/en.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/he.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/plugin.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/yui.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js +3 -3
- data/apps/core/forms/public/ckeditor/plugins/xml/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/skins/kama/dialog.css +5 -5
- data/apps/core/forms/public/ckeditor/skins/kama/editor.css +9 -8
- data/apps/core/forms/public/ckeditor/skins/kama/icons.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/skin.js +3 -3
- data/apps/core/forms/public/ckeditor/skins/kama/templates.css +1 -1
- data/apps/core/forms/public/ckeditor/themes/default/theme.js +4 -4
- data/apps/core/forms/public/css/form.css +1 -0
- data/apps/core/forms/public/css/html_area.css +3 -0
- data/apps/core/forms/public/html_area.js +4 -4
- data/apps/core/forms/public/search_select.js +2 -2
- data/apps/core/forms/public/select.js +5 -5
- data/apps/core/forms/tags/element_label.erb +5 -2
- data/apps/core/forms/tags/element_row.erb +7 -6
- data/apps/core/forms/tags/row.erb +6 -4
- data/apps/core/forms/widgets/form/form.rb +5 -4
- data/apps/core/forms/widgets/inputs/html_area/html_area.rb +10 -4
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +1 -0
- data/apps/core/forms/widgets/inputs/select/select.rb +18 -5
- data/apps/core/forms/widgets/inputs/select/select.shtml +3 -0
- data/apps/master/po/master.pot +408 -0
- data/apps/messenger/po/it/spider_messenger.po +6 -10
- data/apps/messenger/po/spider_messenger.pot +2 -1
- data/blueprints/home/{Gemfile → Gemfile.disabled} +0 -0
- data/lib/spiderfw/config/configuration.rb +5 -0
- data/lib/spiderfw/config/options/spider.rb +2 -2
- data/lib/spiderfw/controller/controller.rb +4 -1
- data/lib/spiderfw/controller/mixins/http_mixin.rb +2 -0
- data/lib/spiderfw/create.rb +9 -5
- data/lib/spiderfw/model/base_model.rb +32 -9
- data/lib/spiderfw/model/condition.rb +7 -0
- data/lib/spiderfw/model/datatypes/text.rb +3 -1
- data/lib/spiderfw/model/mappers/db_mapper.rb +19 -5
- data/lib/spiderfw/model/mappers/mapper.rb +1 -1
- data/lib/spiderfw/model/mixins/tree.rb +2 -1
- data/lib/spiderfw/model/query_set.rb +14 -13
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +7 -2
- data/lib/spiderfw/model/storage/db/db_schema.rb +4 -2
- data/lib/spiderfw/model/storage/db/db_storage.rb +4 -4
- data/lib/spiderfw/model/unit_of_work.rb +3 -1
- data/lib/spiderfw/templates/blocks/html.rb +2 -2
- data/lib/spiderfw/templates/blocks/lambda.rb +25 -0
- data/lib/spiderfw/templates/blocks/recurse.rb +41 -0
- data/lib/spiderfw/templates/blocks/widget.rb +2 -3
- data/lib/spiderfw/templates/layout.rb +20 -3
- data/lib/spiderfw/templates/template.rb +35 -29
- data/lib/spiderfw/templates/template_blocks.rb +6 -0
- data/lib/spiderfw/widget/widget.rb +2 -1
- metadata +35 -5
@@ -85,7 +85,7 @@ module Spider
|
|
85
85
|
def registered?(tag)
|
86
86
|
return true if @@registered[tag]
|
87
87
|
ns, tag = tag.split(':')
|
88
|
-
if
|
88
|
+
if tag # that is, if there is a ns
|
89
89
|
return false unless @@namespaces[ns]
|
90
90
|
return @@namespaces[ns].has_tag?(tag)
|
91
91
|
end
|
@@ -100,11 +100,11 @@ module Spider
|
|
100
100
|
|
101
101
|
# Returns the Class registered for the given tag.
|
102
102
|
def get_registered_class(name)
|
103
|
-
if
|
103
|
+
if @@registered[name]
|
104
104
|
klass = @@registered[name]
|
105
105
|
else
|
106
106
|
ns, tag = name.split(':')
|
107
|
-
klass = @@namespaces[ns].get_tag(tag) if
|
107
|
+
klass = @@namespaces[ns].get_tag(tag) if tag && @@namespaces[ns]
|
108
108
|
end
|
109
109
|
return nil unless klass
|
110
110
|
klass = const_get_full(klass) if klass.is_a?(Symbol)
|
@@ -390,11 +390,17 @@ module Spider
|
|
390
390
|
ass[:app] = owner_class.app
|
391
391
|
# FIXME! @definer_class is not correct for Spider::HomeController
|
392
392
|
raise "Asset type not given for #{src}" unless type
|
393
|
-
|
393
|
+
search_classes = [owner_class, @definer_class]
|
394
|
+
dfnr = @definer_class.superclass if @definer_class && @definer_class.respond_to?(:superclass)
|
395
|
+
while dfnr && dfnr < Spider::Widget
|
396
|
+
search_classes << dfnr
|
397
|
+
dfnr = dfnr.respond_to?(:superclass) ? dfnr.superclass : nil
|
398
|
+
end
|
399
|
+
res = Spider.find_resource(type.to_sym, src, @path, search_classes)
|
394
400
|
controller = nil
|
395
|
-
if
|
401
|
+
if res && res.definer
|
396
402
|
controller = res.definer.controller
|
397
|
-
elsif
|
403
|
+
elsif owner_class < Spider::Controller
|
398
404
|
controller = owner_class
|
399
405
|
end
|
400
406
|
ass[:path] = res.path if res
|
@@ -412,7 +418,7 @@ module Spider
|
|
412
418
|
ass[:rel_path] = src
|
413
419
|
ass[:src] = base_url + src
|
414
420
|
ass_info = self.class.asset_types[type]
|
415
|
-
if
|
421
|
+
if ass_info && ass_info[:processor]
|
416
422
|
processor = TemplateAssets.const_get(ass_info[:processor])
|
417
423
|
ass = processor.process(ass)
|
418
424
|
end
|
@@ -463,7 +469,7 @@ module Spider
|
|
463
469
|
root.search('.to_delete').remove
|
464
470
|
add_overrides overrides
|
465
471
|
@overrides += orig_overrides
|
466
|
-
if
|
472
|
+
if root.name == 'tpl:extend'
|
467
473
|
|
468
474
|
orig_overrides = @overrides
|
469
475
|
@overrides = []
|
@@ -483,7 +489,7 @@ module Spider
|
|
483
489
|
ext_app = ext_owner.app
|
484
490
|
end
|
485
491
|
ext_search_paths = nil
|
486
|
-
if
|
492
|
+
if ext_owner && ext_owner.respond_to?(:template_paths)
|
487
493
|
ext_search_paths = ext_owner.template_paths
|
488
494
|
end
|
489
495
|
ext = self.class.real_path(ext_src, @path, ext_owner, ext_search_paths)
|
@@ -503,7 +509,7 @@ module Spider
|
|
503
509
|
end
|
504
510
|
end
|
505
511
|
@overrides += orig_overrides
|
506
|
-
if
|
512
|
+
if assets && !assets.empty?
|
507
513
|
assets.each do |ass|
|
508
514
|
root.innerHTML += ass.to_html
|
509
515
|
end
|
@@ -543,11 +549,11 @@ module Spider
|
|
543
549
|
def process_tags(el)
|
544
550
|
block = TemplateBlocks.get_block_type(el, true)
|
545
551
|
raise "Bad html in #{@path}, can't parse" if el.is_a?(Hpricot::BogusETag)
|
546
|
-
if
|
552
|
+
if block == :Tag
|
547
553
|
sp_attributes = {}
|
548
554
|
# FIXME: should use blocks instead
|
549
555
|
el.attributes.to_hash.each do |key, value|
|
550
|
-
if
|
556
|
+
if key[0..1] == 'sp'
|
551
557
|
sp_attributes[key] = value
|
552
558
|
el.remove_attribute(key)
|
553
559
|
end
|
@@ -583,14 +589,14 @@ module Spider
|
|
583
589
|
@widgets[id.to_sym] ||= widget
|
584
590
|
widget.id = id
|
585
591
|
widget.id_path = @id_path + [id]
|
586
|
-
if
|
592
|
+
if attributes # don't use merge to trigger custom []=(k, v) method
|
587
593
|
attributes.each{ |k, v| widget.attributes[k] = v }
|
588
594
|
end
|
589
595
|
widget.containing_template = self
|
590
596
|
widget.template = template if template
|
591
597
|
widget.parent = @owner
|
592
598
|
widget.parse_runtime_content_xml(content, @path) if content
|
593
|
-
if
|
599
|
+
if @widget_procs[id.to_sym]
|
594
600
|
@widget_procs[id.to_sym].each do |wp|
|
595
601
|
apply_widget_proc(widget, wp)
|
596
602
|
end
|
@@ -718,9 +724,9 @@ module Spider
|
|
718
724
|
def add_overrides(overrides)
|
719
725
|
overrides.each do |ov|
|
720
726
|
w = ov.get_attribute('widget')
|
721
|
-
if
|
727
|
+
if w
|
722
728
|
first, rest = w.split('/', 2)
|
723
|
-
if
|
729
|
+
if rest
|
724
730
|
ov.set_attribute('widget', rest)
|
725
731
|
else
|
726
732
|
ov.remove_attribute('widget')
|
@@ -744,13 +750,13 @@ module Spider
|
|
744
750
|
end
|
745
751
|
search_string = override.get_attribute('search')
|
746
752
|
override.name = 'tpl:override-content' if override.name == 'tpl:inline-override'
|
747
|
-
if
|
753
|
+
if search_string
|
748
754
|
# # Fix Hpricot bug!
|
749
755
|
# search_string.gsub!(/nth-child\((\d+)\)/) do |match|
|
750
756
|
# "nth-child(#{$1.to_i-2})"
|
751
757
|
# end
|
752
758
|
found = el.parent.search(search_string)
|
753
|
-
elsif
|
759
|
+
elsif override.name == 'tpl:content'
|
754
760
|
found = el.search("tpl:placeholder[@name='#{override.get_attribute('name')}']")
|
755
761
|
else
|
756
762
|
if ['sp:pass', 'tpl:pass', 'sp:template'].include?(el.name)
|
@@ -760,12 +766,12 @@ module Spider
|
|
760
766
|
end
|
761
767
|
end
|
762
768
|
|
763
|
-
if
|
769
|
+
if override.name == 'tpl:delete'
|
764
770
|
found.remove
|
765
771
|
else
|
766
772
|
found.each do |f|
|
767
773
|
o_doc = nil
|
768
|
-
if
|
774
|
+
if override.name == 'tpl:override-content'
|
769
775
|
overridden = f.innerHTML
|
770
776
|
f.innerHTML = override.innerHTML
|
771
777
|
f.search('tpl:overridden').each do |o|
|
@@ -776,7 +782,7 @@ module Spider
|
|
776
782
|
end
|
777
783
|
o.swap(ovr)
|
778
784
|
end
|
779
|
-
elsif
|
785
|
+
elsif override.name == 'tpl:override' || override.name == 'tpl:content'
|
780
786
|
overridden = f.to_html
|
781
787
|
parent = f.parent
|
782
788
|
f.swap(override.innerHTML)
|
@@ -788,18 +794,18 @@ module Spider
|
|
788
794
|
end
|
789
795
|
o.swap(ovr)
|
790
796
|
end
|
791
|
-
elsif
|
797
|
+
elsif override.name == 'tpl:override-attr'
|
792
798
|
f.set_attribute(override.get_attribute("name"), override.get_attribute("value"))
|
793
|
-
elsif
|
799
|
+
elsif override.name == 'tpl:append-attr'
|
794
800
|
f.set_attribute(override.get_attribute("name"), \
|
795
801
|
(f.get_attribute(override.get_attribute("name")) || '')+override.get_attribute("value"))
|
796
|
-
elsif
|
802
|
+
elsif override.name == 'tpl:append'
|
797
803
|
f.innerHTML += override.innerHTML
|
798
|
-
elsif
|
804
|
+
elsif override.name == 'tpl:prepend'
|
799
805
|
f.innerHTML = override.innerHTML + f.innerHTML
|
800
|
-
elsif
|
806
|
+
elsif override.name == 'tpl:before'
|
801
807
|
f.before(override.innerHTML)
|
802
|
-
elsif
|
808
|
+
elsif override.name == 'tpl:after'
|
803
809
|
f.after(override.innerHTML)
|
804
810
|
end
|
805
811
|
end
|
@@ -812,13 +818,13 @@ module Spider
|
|
812
818
|
@widget_procs[first.to_sym] ||= []
|
813
819
|
wp = {:target => rest, :proc => proc }
|
814
820
|
@widget_procs[first.to_sym] << wp
|
815
|
-
if
|
821
|
+
if @widgets[first.to_sym]
|
816
822
|
apply_widget_proc(@widgets[first.to_sym], wp)
|
817
823
|
end
|
818
824
|
end
|
819
825
|
|
820
826
|
def apply_widget_proc(widget, wp)
|
821
|
-
if
|
827
|
+
if wp[:target]
|
822
828
|
widget.with_widget(wp[:target], &wp[:proc])
|
823
829
|
else
|
824
830
|
widget.instance_eval(wp[:proc])
|
@@ -14,6 +14,8 @@ module Spider
|
|
14
14
|
block = :Text
|
15
15
|
elsif el.class == ::Hpricot::Comment
|
16
16
|
block = :Comment
|
17
|
+
elsif !skip_attributes && el.has_attribute?('sp:lambda')
|
18
|
+
block = :Lambda
|
17
19
|
elsif !skip_attributes && (el.has_attribute?('sp:if') || el.has_attribute?('sp:run-if'))
|
18
20
|
block = :If
|
19
21
|
elsif !skip_attributes && el.has_attribute?('sp:tag-if')
|
@@ -39,6 +41,8 @@ module Spider
|
|
39
41
|
block = :Debugger
|
40
42
|
elsif el.name == 'sp:parent-context'
|
41
43
|
block = :ParentContext
|
44
|
+
elsif el.name == 'sp:recurse'
|
45
|
+
block = :Recurse
|
42
46
|
elsif Spider::Template.registered?(el.name)
|
43
47
|
klass = Spider::Template.get_registered_class(el.name)
|
44
48
|
if klass < ::Spider::Widget
|
@@ -208,5 +212,7 @@ require 'spiderfw/templates/blocks/debugger'
|
|
208
212
|
require 'spiderfw/templates/blocks/parent_context'
|
209
213
|
require 'spiderfw/templates/blocks/output'
|
210
214
|
require 'spiderfw/templates/blocks/layout_assets'
|
215
|
+
require 'spiderfw/templates/blocks/lambda'
|
216
|
+
require 'spiderfw/templates/blocks/recurse'
|
211
217
|
|
212
218
|
|
@@ -117,7 +117,7 @@ module Spider
|
|
117
117
|
def template_path
|
118
118
|
return @template_path if @template_path
|
119
119
|
@template_path = @widget_path
|
120
|
-
@template_path += '/templates' if ::File.directory?(@template_path+'/templates')
|
120
|
+
@template_path += '/templates' if @template_path && ::File.directory?(@template_path+'/templates')
|
121
121
|
@template_path
|
122
122
|
end
|
123
123
|
|
@@ -554,6 +554,7 @@ module Spider
|
|
554
554
|
end
|
555
555
|
|
556
556
|
def create_widget(klass, id, *params)
|
557
|
+
klass = Spider::Template.get_registered_class(klass) unless klass.is_a?(Class)
|
557
558
|
params.unshift(@response)
|
558
559
|
params.unshift(@request)
|
559
560
|
obj = klass.new(*params)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spiderfw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ivan Pirlik
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-10 00:00:00 +02:00
|
19
19
|
default_executable: spider
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -593,8 +593,15 @@ files:
|
|
593
593
|
- apps/core/forms/po/it/spider_forms.po
|
594
594
|
- apps/core/forms/po/spider_forms.pot
|
595
595
|
- apps/core/forms/public/ckeditor/adapters/jquery.js
|
596
|
+
- apps/core/forms/public/ckeditor/CHANGES.html
|
596
597
|
- apps/core/forms/public/ckeditor/ckeditor.js
|
598
|
+
- apps/core/forms/public/ckeditor/ckeditor_basic.js
|
599
|
+
- apps/core/forms/public/ckeditor/ckeditor_basic_source.js
|
600
|
+
- apps/core/forms/public/ckeditor/ckeditor_source.js
|
601
|
+
- apps/core/forms/public/ckeditor/config.js
|
602
|
+
- apps/core/forms/public/ckeditor/contents.css
|
597
603
|
- apps/core/forms/public/ckeditor/images/spacer.gif
|
604
|
+
- apps/core/forms/public/ckeditor/INSTALL.html
|
598
605
|
- apps/core/forms/public/ckeditor/lang/_languages.js
|
599
606
|
- apps/core/forms/public/ckeditor/lang/_translationstatus.txt
|
600
607
|
- apps/core/forms/public/ckeditor/lang/af.js
|
@@ -630,6 +637,7 @@ files:
|
|
630
637
|
- apps/core/forms/public/ckeditor/lang/is.js
|
631
638
|
- apps/core/forms/public/ckeditor/lang/it.js
|
632
639
|
- apps/core/forms/public/ckeditor/lang/ja.js
|
640
|
+
- apps/core/forms/public/ckeditor/lang/ka.js
|
633
641
|
- apps/core/forms/public/ckeditor/lang/km.js
|
634
642
|
- apps/core/forms/public/ckeditor/lang/ko.js
|
635
643
|
- apps/core/forms/public/ckeditor/lang/lt.js
|
@@ -655,16 +663,24 @@ files:
|
|
655
663
|
- apps/core/forms/public/ckeditor/lang/vi.js
|
656
664
|
- apps/core/forms/public/ckeditor/lang/zh-cn.js
|
657
665
|
- apps/core/forms/public/ckeditor/lang/zh.js
|
666
|
+
- apps/core/forms/public/ckeditor/LICENSE.html
|
658
667
|
- apps/core/forms/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js
|
659
668
|
- apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/en.js
|
660
669
|
- apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/he.js
|
661
670
|
- apps/core/forms/public/ckeditor/plugins/about/dialogs/about.js
|
662
671
|
- apps/core/forms/public/ckeditor/plugins/about/dialogs/logo_ckeditor.png
|
672
|
+
- apps/core/forms/public/ckeditor/plugins/adobeair/plugin.js
|
673
|
+
- apps/core/forms/public/ckeditor/plugins/ajax/plugin.js
|
663
674
|
- apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js
|
675
|
+
- apps/core/forms/public/ckeditor/plugins/bbcode/plugin.js
|
664
676
|
- apps/core/forms/public/ckeditor/plugins/clipboard/dialogs/paste.js
|
665
677
|
- apps/core/forms/public/ckeditor/plugins/colordialog/dialogs/colordialog.js
|
678
|
+
- apps/core/forms/public/ckeditor/plugins/devtools/lang/en.js
|
679
|
+
- apps/core/forms/public/ckeditor/plugins/devtools/plugin.js
|
666
680
|
- apps/core/forms/public/ckeditor/plugins/dialog/dialogDefinition.js
|
667
681
|
- apps/core/forms/public/ckeditor/plugins/div/dialogs/div.js
|
682
|
+
- apps/core/forms/public/ckeditor/plugins/docprops/dialogs/docprops.js
|
683
|
+
- apps/core/forms/public/ckeditor/plugins/docprops/plugin.js
|
668
684
|
- apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js
|
669
685
|
- apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js
|
670
686
|
- apps/core/forms/public/ckeditor/plugins/flash/images/placeholder.png
|
@@ -677,6 +693,8 @@ files:
|
|
677
693
|
- apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js
|
678
694
|
- apps/core/forms/public/ckeditor/plugins/forms/dialogs/textfield.js
|
679
695
|
- apps/core/forms/public/ckeditor/plugins/forms/images/hiddenfield.gif
|
696
|
+
- apps/core/forms/public/ckeditor/plugins/iframe/dialogs/iframe.js
|
697
|
+
- apps/core/forms/public/ckeditor/plugins/iframe/images/placeholder.png
|
680
698
|
- apps/core/forms/public/ckeditor/plugins/iframedialog/plugin.js
|
681
699
|
- apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js
|
682
700
|
- apps/core/forms/public/ckeditor/plugins/link/dialogs/anchor.js
|
@@ -686,6 +704,11 @@ files:
|
|
686
704
|
- apps/core/forms/public/ckeditor/plugins/pagebreak/images/pagebreak.gif
|
687
705
|
- apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js
|
688
706
|
- apps/core/forms/public/ckeditor/plugins/pastetext/dialogs/pastetext.js
|
707
|
+
- apps/core/forms/public/ckeditor/plugins/placeholder/dialogs/placeholder.js
|
708
|
+
- apps/core/forms/public/ckeditor/plugins/placeholder/lang/en.js
|
709
|
+
- apps/core/forms/public/ckeditor/plugins/placeholder/lang/he.js
|
710
|
+
- apps/core/forms/public/ckeditor/plugins/placeholder/placeholder.gif
|
711
|
+
- apps/core/forms/public/ckeditor/plugins/placeholder/plugin.js
|
689
712
|
- apps/core/forms/public/ckeditor/plugins/scayt/dialogs/options.js
|
690
713
|
- apps/core/forms/public/ckeditor/plugins/scayt/dialogs/toolbar.css
|
691
714
|
- apps/core/forms/public/ckeditor/plugins/showblocks/images/block_address.png
|
@@ -722,7 +745,9 @@ files:
|
|
722
745
|
- apps/core/forms/public/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif
|
723
746
|
- apps/core/forms/public/ckeditor/plugins/smiley/images/wink_smile.gif
|
724
747
|
- apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js
|
748
|
+
- apps/core/forms/public/ckeditor/plugins/specialchar/lang/en.js
|
725
749
|
- apps/core/forms/public/ckeditor/plugins/styles/styles/default.js
|
750
|
+
- apps/core/forms/public/ckeditor/plugins/stylesheetparser/plugin.js
|
726
751
|
- apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js
|
727
752
|
- apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js
|
728
753
|
- apps/core/forms/public/ckeditor/plugins/tabletools/dialogs/tableCell.js
|
@@ -746,6 +771,7 @@ files:
|
|
746
771
|
- apps/core/forms/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html
|
747
772
|
- apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.css
|
748
773
|
- apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js
|
774
|
+
- apps/core/forms/public/ckeditor/plugins/xml/plugin.js
|
749
775
|
- apps/core/forms/public/ckeditor/skins/kama/dialog.css
|
750
776
|
- apps/core/forms/public/ckeditor/skins/kama/editor.css
|
751
777
|
- apps/core/forms/public/ckeditor/skins/kama/icons.png
|
@@ -763,6 +789,7 @@ files:
|
|
763
789
|
- apps/core/forms/public/ckeditor/themes/default/theme.js
|
764
790
|
- apps/core/forms/public/css/file_input.css
|
765
791
|
- apps/core/forms/public/css/form.css
|
792
|
+
- apps/core/forms/public/css/html_area.css
|
766
793
|
- apps/core/forms/public/date_time.js
|
767
794
|
- apps/core/forms/public/file_input.js
|
768
795
|
- apps/core/forms/public/form.js
|
@@ -836,6 +863,7 @@ files:
|
|
836
863
|
- apps/master/plugins/resources/mysql/mysql.rb
|
837
864
|
- apps/master/plugins/site_types/spider/spider.rb
|
838
865
|
- apps/master/po/it/spider_master.po
|
866
|
+
- apps/master/po/master.pot
|
839
867
|
- apps/master/po/spider_master.pot
|
840
868
|
- apps/master/public/css/img/web.png
|
841
869
|
- apps/master/public/css/login.css
|
@@ -941,7 +969,7 @@ files:
|
|
941
969
|
- blueprints/app/views/__APP__.layout.shtml
|
942
970
|
- blueprints/app/views/index.shtml
|
943
971
|
- blueprints/home/config/config.yml
|
944
|
-
- blueprints/home/Gemfile
|
972
|
+
- blueprints/home/Gemfile.disabled
|
945
973
|
- blueprints/home/init.rb
|
946
974
|
- blueprints/home/spider.gemfile
|
947
975
|
- blueprints/install/config.ru
|
@@ -1099,10 +1127,12 @@ files:
|
|
1099
1127
|
- lib/spiderfw/templates/blocks/each.rb
|
1100
1128
|
- lib/spiderfw/templates/blocks/html.rb
|
1101
1129
|
- lib/spiderfw/templates/blocks/if.rb
|
1130
|
+
- lib/spiderfw/templates/blocks/lambda.rb
|
1102
1131
|
- lib/spiderfw/templates/blocks/layout_assets.rb
|
1103
1132
|
- lib/spiderfw/templates/blocks/output.rb
|
1104
1133
|
- lib/spiderfw/templates/blocks/parent_context.rb
|
1105
1134
|
- lib/spiderfw/templates/blocks/pass.rb
|
1135
|
+
- lib/spiderfw/templates/blocks/recurse.rb
|
1106
1136
|
- lib/spiderfw/templates/blocks/render.rb
|
1107
1137
|
- lib/spiderfw/templates/blocks/run.rb
|
1108
1138
|
- lib/spiderfw/templates/blocks/tag.rb
|