spiderfw 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. data/CHANGELOG +5 -0
  2. data/VERSION +1 -1
  3. data/apps/core/auth/lib/rbac.rb +15 -0
  4. data/apps/core/auth/models/mixins/rbac_provider.rb +28 -10
  5. data/apps/core/auth/po/it/spider_auth.po +3 -2
  6. data/apps/core/auth/po/spider_auth.pot +3 -2
  7. data/apps/core/auth/views/login.shtml +1 -1
  8. data/apps/core/components/po/it/spider_components.po +11 -12
  9. data/apps/core/components/po/spider_components.pot +11 -10
  10. data/apps/core/components/public/css/crud.css +4 -0
  11. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/css/Aristo/jquery-ui.custom.css +1 -0
  12. data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +1 -0
  13. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +11 -11
  14. data/apps/core/components/public/js/jquery/plugins/jquery.form.js +325 -154
  15. data/apps/core/components/public/js/spider.js +6 -0
  16. data/apps/core/components/widgets/admin/admin.rb +44 -1
  17. data/apps/core/components/widgets/crud/crud.rb +48 -27
  18. data/apps/core/components/widgets/crud/crud.shtml +5 -3
  19. data/apps/core/components/widgets/table/table.rb +3 -3
  20. data/apps/core/forms/po/it/spider_forms.po +4 -4
  21. data/apps/core/forms/po/spider_forms.pot +4 -3
  22. data/apps/core/forms/public/ckeditor/CHANGES.html +1295 -0
  23. data/apps/core/forms/public/ckeditor/INSTALL.html +92 -0
  24. data/apps/core/forms/public/ckeditor/LICENSE.html +1334 -0
  25. data/apps/core/forms/public/ckeditor/adapters/jquery.js +2 -2
  26. data/apps/core/forms/public/ckeditor/ckeditor.js +141 -133
  27. data/apps/core/forms/public/ckeditor/ckeditor_basic.js +8 -0
  28. data/apps/core/forms/public/ckeditor/ckeditor_basic_source.js +20 -0
  29. data/apps/core/forms/public/ckeditor/ckeditor_source.js +25 -0
  30. data/apps/core/forms/public/ckeditor/config.js +11 -0
  31. data/apps/core/forms/public/ckeditor/contents.css +23 -0
  32. data/apps/core/forms/public/ckeditor/lang/_languages.js +2 -2
  33. data/apps/core/forms/public/ckeditor/lang/_translationstatus.txt +58 -57
  34. data/apps/core/forms/public/ckeditor/lang/af.js +2 -2
  35. data/apps/core/forms/public/ckeditor/lang/ar.js +2 -2
  36. data/apps/core/forms/public/ckeditor/lang/bg.js +2 -2
  37. data/apps/core/forms/public/ckeditor/lang/bn.js +2 -2
  38. data/apps/core/forms/public/ckeditor/lang/bs.js +2 -2
  39. data/apps/core/forms/public/ckeditor/lang/ca.js +2 -2
  40. data/apps/core/forms/public/ckeditor/lang/cs.js +2 -2
  41. data/apps/core/forms/public/ckeditor/lang/cy.js +2 -2
  42. data/apps/core/forms/public/ckeditor/lang/da.js +2 -2
  43. data/apps/core/forms/public/ckeditor/lang/de.js +2 -2
  44. data/apps/core/forms/public/ckeditor/lang/el.js +2 -2
  45. data/apps/core/forms/public/ckeditor/lang/en-au.js +2 -2
  46. data/apps/core/forms/public/ckeditor/lang/en-ca.js +2 -2
  47. data/apps/core/forms/public/ckeditor/lang/en-gb.js +2 -2
  48. data/apps/core/forms/public/ckeditor/lang/en.js +2 -2
  49. data/apps/core/forms/public/ckeditor/lang/eo.js +2 -2
  50. data/apps/core/forms/public/ckeditor/lang/es.js +2 -2
  51. data/apps/core/forms/public/ckeditor/lang/et.js +2 -2
  52. data/apps/core/forms/public/ckeditor/lang/eu.js +2 -2
  53. data/apps/core/forms/public/ckeditor/lang/fa.js +2 -2
  54. data/apps/core/forms/public/ckeditor/lang/fi.js +2 -2
  55. data/apps/core/forms/public/ckeditor/lang/fo.js +2 -2
  56. data/apps/core/forms/public/ckeditor/lang/fr-ca.js +2 -2
  57. data/apps/core/forms/public/ckeditor/lang/fr.js +2 -2
  58. data/apps/core/forms/public/ckeditor/lang/gl.js +2 -2
  59. data/apps/core/forms/public/ckeditor/lang/gu.js +2 -2
  60. data/apps/core/forms/public/ckeditor/lang/he.js +2 -2
  61. data/apps/core/forms/public/ckeditor/lang/hi.js +2 -2
  62. data/apps/core/forms/public/ckeditor/lang/hr.js +2 -2
  63. data/apps/core/forms/public/ckeditor/lang/hu.js +2 -2
  64. data/apps/core/forms/public/ckeditor/lang/is.js +2 -2
  65. data/apps/core/forms/public/ckeditor/lang/it.js +2 -2
  66. data/apps/core/forms/public/ckeditor/lang/ja.js +2 -2
  67. data/apps/core/forms/public/ckeditor/lang/ka.js +6 -0
  68. data/apps/core/forms/public/ckeditor/lang/km.js +2 -2
  69. data/apps/core/forms/public/ckeditor/lang/ko.js +2 -2
  70. data/apps/core/forms/public/ckeditor/lang/lt.js +2 -2
  71. data/apps/core/forms/public/ckeditor/lang/lv.js +2 -2
  72. data/apps/core/forms/public/ckeditor/lang/mn.js +2 -2
  73. data/apps/core/forms/public/ckeditor/lang/ms.js +2 -2
  74. data/apps/core/forms/public/ckeditor/lang/nb.js +2 -2
  75. data/apps/core/forms/public/ckeditor/lang/nl.js +2 -2
  76. data/apps/core/forms/public/ckeditor/lang/no.js +2 -2
  77. data/apps/core/forms/public/ckeditor/lang/pl.js +2 -2
  78. data/apps/core/forms/public/ckeditor/lang/pt-br.js +2 -2
  79. data/apps/core/forms/public/ckeditor/lang/pt.js +2 -2
  80. data/apps/core/forms/public/ckeditor/lang/ro.js +2 -2
  81. data/apps/core/forms/public/ckeditor/lang/ru.js +2 -2
  82. data/apps/core/forms/public/ckeditor/lang/sk.js +2 -2
  83. data/apps/core/forms/public/ckeditor/lang/sl.js +2 -2
  84. data/apps/core/forms/public/ckeditor/lang/sr-latn.js +2 -2
  85. data/apps/core/forms/public/ckeditor/lang/sr.js +2 -2
  86. data/apps/core/forms/public/ckeditor/lang/sv.js +2 -2
  87. data/apps/core/forms/public/ckeditor/lang/th.js +2 -2
  88. data/apps/core/forms/public/ckeditor/lang/tr.js +2 -2
  89. data/apps/core/forms/public/ckeditor/lang/uk.js +2 -2
  90. data/apps/core/forms/public/ckeditor/lang/vi.js +2 -2
  91. data/apps/core/forms/public/ckeditor/lang/zh-cn.js +2 -2
  92. data/apps/core/forms/public/ckeditor/lang/zh.js +2 -2
  93. data/apps/core/forms/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +2 -2
  94. data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
  95. data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/he.js +1 -1
  96. data/apps/core/forms/public/ckeditor/plugins/about/dialogs/about.js +2 -2
  97. data/apps/core/forms/public/ckeditor/plugins/adobeair/plugin.js +6 -0
  98. data/apps/core/forms/public/ckeditor/plugins/ajax/plugin.js +6 -0
  99. data/apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js +2 -2
  100. data/apps/core/forms/public/ckeditor/plugins/bbcode/plugin.js +9 -0
  101. data/apps/core/forms/public/ckeditor/plugins/clipboard/dialogs/paste.js +3 -3
  102. data/apps/core/forms/public/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
  103. data/apps/core/forms/public/ckeditor/plugins/devtools/lang/en.js +6 -0
  104. data/apps/core/forms/public/ckeditor/plugins/devtools/plugin.js +6 -0
  105. data/apps/core/forms/public/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  106. data/apps/core/forms/public/ckeditor/plugins/div/dialogs/div.js +1 -1
  107. data/apps/core/forms/public/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
  108. data/apps/core/forms/public/ckeditor/plugins/docprops/plugin.js +6 -0
  109. data/apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js +4 -4
  110. data/apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js +4 -4
  111. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/button.js +2 -2
  112. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
  113. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/form.js +2 -2
  114. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
  115. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/radio.js +2 -2
  116. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/select.js +4 -4
  117. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js +2 -2
  118. data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textfield.js +2 -3
  119. data/apps/core/forms/public/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
  120. data/apps/core/forms/public/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  121. data/apps/core/forms/public/ckeditor/plugins/iframedialog/plugin.js +2 -2
  122. data/apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js +8 -8
  123. data/apps/core/forms/public/ckeditor/plugins/link/dialogs/anchor.js +2 -2
  124. data/apps/core/forms/public/ckeditor/plugins/link/dialogs/link.js +7 -7
  125. data/apps/core/forms/public/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
  126. data/apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js +7 -6
  127. data/apps/core/forms/public/ckeditor/plugins/pastetext/dialogs/pastetext.js +2 -2
  128. data/apps/core/forms/public/ckeditor/plugins/placeholder/dialogs/placeholder.js +6 -0
  129. data/apps/core/forms/public/ckeditor/plugins/placeholder/lang/en.js +6 -0
  130. data/apps/core/forms/public/ckeditor/plugins/placeholder/lang/he.js +6 -0
  131. data/apps/core/forms/public/ckeditor/plugins/placeholder/placeholder.gif +0 -0
  132. data/apps/core/forms/public/ckeditor/plugins/placeholder/plugin.js +6 -0
  133. data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/options.js +4 -4
  134. data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
  135. data/apps/core/forms/public/ckeditor/plugins/smiley/dialogs/smiley.js +3 -3
  136. data/apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +3 -3
  137. data/apps/core/forms/public/ckeditor/plugins/specialchar/lang/en.js +6 -0
  138. data/apps/core/forms/public/ckeditor/plugins/styles/styles/default.js +1 -1
  139. data/apps/core/forms/public/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
  140. data/apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js +3 -3
  141. data/apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js +2 -2
  142. data/apps/core/forms/public/ckeditor/plugins/tabletools/dialogs/tableCell.js +4 -4
  143. data/apps/core/forms/public/ckeditor/plugins/templates/dialogs/templates.js +2 -2
  144. data/apps/core/forms/public/ckeditor/plugins/templates/templates/default.js +1 -1
  145. data/apps/core/forms/public/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
  146. data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/en.js +1 -1
  147. data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/he.js +1 -1
  148. data/apps/core/forms/public/ckeditor/plugins/uicolor/plugin.js +1 -1
  149. data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
  150. data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/yui.js +1 -1
  151. data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
  152. data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
  153. data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
  154. data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js +3 -3
  155. data/apps/core/forms/public/ckeditor/plugins/xml/plugin.js +6 -0
  156. data/apps/core/forms/public/ckeditor/skins/kama/dialog.css +5 -5
  157. data/apps/core/forms/public/ckeditor/skins/kama/editor.css +9 -8
  158. data/apps/core/forms/public/ckeditor/skins/kama/icons.png +0 -0
  159. data/apps/core/forms/public/ckeditor/skins/kama/icons_rtl.png +0 -0
  160. data/apps/core/forms/public/ckeditor/skins/kama/skin.js +3 -3
  161. data/apps/core/forms/public/ckeditor/skins/kama/templates.css +1 -1
  162. data/apps/core/forms/public/ckeditor/themes/default/theme.js +4 -4
  163. data/apps/core/forms/public/css/form.css +1 -0
  164. data/apps/core/forms/public/css/html_area.css +3 -0
  165. data/apps/core/forms/public/html_area.js +4 -4
  166. data/apps/core/forms/public/search_select.js +2 -2
  167. data/apps/core/forms/public/select.js +5 -5
  168. data/apps/core/forms/tags/element_label.erb +5 -2
  169. data/apps/core/forms/tags/element_row.erb +7 -6
  170. data/apps/core/forms/tags/row.erb +6 -4
  171. data/apps/core/forms/widgets/form/form.rb +5 -4
  172. data/apps/core/forms/widgets/inputs/html_area/html_area.rb +10 -4
  173. data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +1 -0
  174. data/apps/core/forms/widgets/inputs/select/select.rb +18 -5
  175. data/apps/core/forms/widgets/inputs/select/select.shtml +3 -0
  176. data/apps/master/po/master.pot +408 -0
  177. data/apps/messenger/po/it/spider_messenger.po +6 -10
  178. data/apps/messenger/po/spider_messenger.pot +2 -1
  179. data/blueprints/home/{Gemfile → Gemfile.disabled} +0 -0
  180. data/lib/spiderfw/config/configuration.rb +5 -0
  181. data/lib/spiderfw/config/options/spider.rb +2 -2
  182. data/lib/spiderfw/controller/controller.rb +4 -1
  183. data/lib/spiderfw/controller/mixins/http_mixin.rb +2 -0
  184. data/lib/spiderfw/create.rb +9 -5
  185. data/lib/spiderfw/model/base_model.rb +32 -9
  186. data/lib/spiderfw/model/condition.rb +7 -0
  187. data/lib/spiderfw/model/datatypes/text.rb +3 -1
  188. data/lib/spiderfw/model/mappers/db_mapper.rb +19 -5
  189. data/lib/spiderfw/model/mappers/mapper.rb +1 -1
  190. data/lib/spiderfw/model/mixins/tree.rb +2 -1
  191. data/lib/spiderfw/model/query_set.rb +14 -13
  192. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +7 -2
  193. data/lib/spiderfw/model/storage/db/db_schema.rb +4 -2
  194. data/lib/spiderfw/model/storage/db/db_storage.rb +4 -4
  195. data/lib/spiderfw/model/unit_of_work.rb +3 -1
  196. data/lib/spiderfw/templates/blocks/html.rb +2 -2
  197. data/lib/spiderfw/templates/blocks/lambda.rb +25 -0
  198. data/lib/spiderfw/templates/blocks/recurse.rb +41 -0
  199. data/lib/spiderfw/templates/blocks/widget.rb +2 -3
  200. data/lib/spiderfw/templates/layout.rb +20 -3
  201. data/lib/spiderfw/templates/template.rb +35 -29
  202. data/lib/spiderfw/templates/template_blocks.rb +6 -0
  203. data/lib/spiderfw/widget/widget.rb +2 -1
  204. 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 (tag) # that is, if there is a ns
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 (@@registered[name])
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 (tag && @@namespaces[ns])
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
- res = Spider.find_resource(type.to_sym, src, @path, [owner_class, @definer_class])
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 (res && res.definer)
401
+ if res && res.definer
396
402
  controller = res.definer.controller
397
- elsif (owner_class < Spider::Controller)
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 (ass_info && ass_info[:processor])
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 (root.name == 'tpl:extend')
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 (ext_owner && ext_owner.respond_to?(:template_paths))
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 (assets && !assets.empty?)
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 (block == :Tag)
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 (key[0..1] == 'sp')
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 (attributes) # don't use merge to trigger custom []=(k, v) method
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 (@widget_procs[id.to_sym])
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 (w)
727
+ if w
722
728
  first, rest = w.split('/', 2)
723
- if (rest)
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 (search_string)
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 (override.name == 'tpl:content')
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 (override.name == 'tpl:delete')
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 (override.name == 'tpl:override-content')
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 (override.name == 'tpl:override' || override.name == 'tpl:content')
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 (override.name == 'tpl:override-attr')
797
+ elsif override.name == 'tpl:override-attr'
792
798
  f.set_attribute(override.get_attribute("name"), override.get_attribute("value"))
793
- elsif (override.name == 'tpl:append-attr')
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 (override.name == 'tpl:append')
802
+ elsif override.name == 'tpl:append'
797
803
  f.innerHTML += override.innerHTML
798
- elsif (override.name == 'tpl:prepend')
804
+ elsif override.name == 'tpl:prepend'
799
805
  f.innerHTML = override.innerHTML + f.innerHTML
800
- elsif (override.name == 'tpl:before')
806
+ elsif override.name == 'tpl:before'
801
807
  f.before(override.innerHTML)
802
- elsif (override.name == 'tpl:after')
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 (@widgets[first.to_sym])
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 (wp[:target])
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: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
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-05-02 00:00:00 +02:00
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