card 1.15.1 → 1.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/card.gemspec +19 -16
  4. data/config/initializers/recaptcha.rb +1 -0
  5. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +13 -14
  6. data/db/migrate_core_cards/20150326205655_bootswatch_themes.rb +30 -0
  7. data/db/migrate_core_cards/20150331135745_new_card_menu.rb +8 -0
  8. data/db/migrate_core_cards/20150508212032_menu_compatibility.rb +27 -0
  9. data/db/migrate_core_cards/20150510031118_fix_skin_images.rb +13 -0
  10. data/db/migrate_core_cards/data/1.12_stylesheets/classic_cards.scss +9 -5
  11. data/db/migrate_core_cards/data/1.12_stylesheets/common.scss +5 -5
  12. data/{test/fixtures/.gitkeep → db/migrate_core_cards/data/themes/bootstrap_default/_bootswatch.scss} +0 -0
  13. data/db/migrate_core_cards/data/themes/bootstrap_default/_variables.scss +866 -0
  14. data/db/migrate_core_cards/data/themes/cerulean/_bootswatch.scss +125 -0
  15. data/db/migrate_core_cards/data/themes/cerulean/_variables.scss +861 -0
  16. data/db/migrate_core_cards/data/themes/cosmo/_bootswatch.scss +237 -0
  17. data/db/migrate_core_cards/data/themes/cosmo/_variables.scss +861 -0
  18. data/db/migrate_core_cards/data/themes/cyborg/_bootswatch.scss +210 -0
  19. data/db/migrate_core_cards/data/themes/cyborg/_variables.scss +861 -0
  20. data/db/migrate_core_cards/data/themes/darkly/_bootswatch.scss +330 -0
  21. data/db/migrate_core_cards/data/themes/darkly/_variables.scss +861 -0
  22. data/db/migrate_core_cards/data/themes/flatly/_bootswatch.scss +313 -0
  23. data/db/migrate_core_cards/data/themes/flatly/_variables.scss +861 -0
  24. data/db/migrate_core_cards/data/themes/journal/_bootswatch.scss +120 -0
  25. data/db/migrate_core_cards/data/themes/journal/_variables.scss +861 -0
  26. data/db/migrate_core_cards/data/themes/lumen/_bootswatch.scss +496 -0
  27. data/db/migrate_core_cards/data/themes/lumen/_variables.scss +861 -0
  28. data/db/migrate_core_cards/data/themes/paper/_bootswatch.scss +607 -0
  29. data/db/migrate_core_cards/data/themes/paper/_variables.scss +861 -0
  30. data/db/migrate_core_cards/data/themes/readable/_bootswatch.scss +174 -0
  31. data/db/migrate_core_cards/data/themes/readable/_variables.scss +861 -0
  32. data/db/migrate_core_cards/data/themes/sandstone/_bootswatch.scss +194 -0
  33. data/db/migrate_core_cards/data/themes/sandstone/_variables.scss +861 -0
  34. data/db/migrate_core_cards/data/themes/simplex/_bootswatch.scss +142 -0
  35. data/db/migrate_core_cards/data/themes/simplex/_variables.scss +861 -0
  36. data/db/migrate_core_cards/data/themes/slate/_bootswatch.scss +417 -0
  37. data/db/migrate_core_cards/data/themes/slate/_variables.scss +861 -0
  38. data/db/migrate_core_cards/data/themes/spacelab/_bootswatch.scss +137 -0
  39. data/db/migrate_core_cards/data/themes/spacelab/_variables.scss +861 -0
  40. data/db/migrate_core_cards/data/themes/superhero/_bootswatch.scss +332 -0
  41. data/db/migrate_core_cards/data/themes/superhero/_variables.scss +861 -0
  42. data/db/migrate_core_cards/data/themes/united/_bootswatch.scss +42 -0
  43. data/db/migrate_core_cards/data/themes/united/_variables.scss +861 -0
  44. data/db/migrate_core_cards/data/themes/yeti/_bootswatch.scss +437 -0
  45. data/db/migrate_core_cards/data/themes/yeti/_variables.scss +861 -0
  46. data/db/seed/README.md +2 -0
  47. data/db/{bootstrap → seed/new}/card_actions.yml +561 -295
  48. data/db/{bootstrap → seed/new}/card_acts.yml +1 -1
  49. data/db/seed/new/card_changes.yml +29331 -0
  50. data/db/{bootstrap → seed/new}/card_references.yml +1544 -1355
  51. data/db/seed/new/cards.yml +28057 -0
  52. data/db/seed/test/fixtures/.gitkeep +0 -0
  53. data/{test → db/seed/test}/fixtures/card_actions.yml +1501 -1235
  54. data/{test → db/seed/test}/fixtures/card_acts.yml +244 -244
  55. data/db/seed/test/fixtures/card_changes.yml +34527 -0
  56. data/{test → db/seed/test}/fixtures/card_references.yml +2215 -2026
  57. data/db/seed/test/fixtures/cards.yml +32708 -0
  58. data/{test → db/seed/test}/fixtures/mao2.jpg +0 -0
  59. data/{test → db/seed/test}/fixtures/rails.gif +0 -0
  60. data/{test → db/seed/test}/seed.rb +0 -0
  61. data/db/version_core_cards.txt +1 -1
  62. data/lib/card/format.rb +56 -56
  63. data/lib/cardio.rb +7 -5
  64. data/mod/01_core/chunk/include.rb +1 -1
  65. data/mod/01_core/set/all/fetch.rb +27 -27
  66. data/mod/01_core/set/all/rules.rb +53 -53
  67. data/mod/01_core/set/all/states.rb +5 -0
  68. data/mod/01_core/spec/format/html_format_spec.rb +6 -6
  69. data/mod/01_core/spec/set/all/rules2_spec.rb +6 -6
  70. data/mod/01_history/set/all/history.rb +4 -4
  71. data/mod/02_basic_types/set/all/rss.rb +10 -9
  72. data/mod/03_machines/lib/javascript/script_card_menu.js.coffee +20 -0
  73. data/mod/03_machines/lib/javascript/wagn.js.coffee +46 -34
  74. data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +36 -148
  75. data/mod/03_machines/lib/stylesheets/style_bootstrap_compatible.css +10 -96
  76. data/mod/03_machines/lib/stylesheets/style_cards.scss +127 -87
  77. data/mod/03_machines/set/self/script_card_menu.rb +10 -2
  78. data/mod/05_email/set/all/follow.rb +38 -22
  79. data/mod/05_email/set/right/follow.rb +79 -1
  80. data/mod/05_email/set/type_plus_right/user/follow.rb +31 -31
  81. data/mod/05_email/spec/set/all/follow_spec.rb +37 -28
  82. data/mod/05_email/spec/set/right/followers_spec.rb +29 -29
  83. data/mod/05_standard/set/all/error.rb +17 -20
  84. data/mod/05_standard/set/all/links.rb +31 -18
  85. data/mod/05_standard/set/all/rich_html/content.rb +41 -18
  86. data/mod/05_standard/set/all/rich_html/editing.rb +21 -17
  87. data/mod/05_standard/set/all/rich_html/header.rb +13 -48
  88. data/mod/05_standard/set/all/rich_html/menu.rb +147 -0
  89. data/mod/05_standard/set/all/rich_html/modal.rb +54 -0
  90. data/mod/05_standard/set/all/rich_html/toolbar.rb +237 -0
  91. data/mod/05_standard/set/all/rich_html/wrapper.rb +43 -25
  92. data/mod/05_standard/set/right/account.rb +8 -7
  93. data/mod/05_standard/set/rstar/rules.rb +111 -84
  94. data/mod/05_standard/set/self/head.rb +15 -15
  95. data/mod/05_standard/set/type/set.rb +65 -34
  96. data/mod/05_standard/spec/set/all/attach_spec.rb +1 -1
  97. data/mod/05_standard/spec/set/all/rich_html/wrapper_spec.rb +13 -9
  98. data/mod/05_standard/spec/set/rstar/rules_spec.rb +1 -1
  99. data/mod/06_bootstrap/lib/javascript/bootstrap.js +108 -97
  100. data/mod/06_bootstrap/lib/javascript/smartmenu.js +94 -0
  101. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_alerts.scss +73 -0
  102. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_badges.scss +68 -0
  103. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  104. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_button-groups.scss +243 -0
  105. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_buttons.scss +160 -0
  106. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_carousel.scss +269 -0
  107. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_close.scss +36 -0
  108. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_code.scss +69 -0
  109. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_component-animations.scss +37 -0
  110. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_dropdowns.scss +214 -0
  111. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_forms.scss +578 -0
  112. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_glyphicons.scss +305 -0
  113. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_grid.scss +84 -0
  114. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_input-groups.scss +166 -0
  115. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_jumbotron.scss +50 -0
  116. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_labels.scss +66 -0
  117. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_list-group.scss +124 -0
  118. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_media.scss +61 -0
  119. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_mixins.scss +39 -0
  120. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_modals.scss +150 -0
  121. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_navbar.scss +662 -0
  122. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_navs.scss +242 -0
  123. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_normalize.scss +427 -0
  124. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_pager.scss +54 -0
  125. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_pagination.scss +88 -0
  126. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_panels.scss +265 -0
  127. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_popovers.scss +135 -0
  128. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_print.scss +107 -0
  129. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_progress-bars.scss +87 -0
  130. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  131. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_responsive-utilities.scss +177 -0
  132. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_scaffolding.scss +162 -0
  133. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_tables.scss +234 -0
  134. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_theme.scss +273 -0
  135. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_thumbnails.scss +38 -0
  136. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_tooltip.scss +102 -0
  137. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_type.scss +298 -0
  138. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_utilities.scss +55 -0
  139. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_variables.scss +866 -0
  140. data/mod/06_bootstrap/lib/stylesheets/bootstrap/_wells.scss +29 -0
  141. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  142. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  143. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  144. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_buttons.scss +52 -0
  145. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  146. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  147. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  148. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  149. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  150. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  151. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  152. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_image.scss +33 -0
  153. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  154. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  155. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  156. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  157. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  158. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  159. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  160. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  161. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  162. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  163. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  164. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_size.scss +10 -0
  165. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  166. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  167. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  168. data/mod/06_bootstrap/lib/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  169. data/mod/06_bootstrap/lib/stylesheets/{bootswatch_mixins.scss → bootstrap/mixins/_vendor-prefixes.scss} +1 -61
  170. data/mod/06_bootstrap/lib/stylesheets/bootstrap_cards.scss +20 -13
  171. data/mod/06_bootstrap/lib/stylesheets/smartmenu.css +433 -0
  172. data/mod/06_bootstrap/set/all/bootstrap/wrapper.rb +2 -2
  173. data/mod/06_bootstrap/set/all/rich_bootstrap.rb +58 -4
  174. data/mod/06_bootstrap/set/self/bootstrap_js.rb +1 -1
  175. data/mod/06_bootstrap/set/self/bootswatch_shared.rb +32 -0
  176. data/mod/06_bootstrap/set/self/smartmenu_css.rb +7 -0
  177. data/mod/06_bootstrap/set/self/smartmenu_js.rb +7 -0
  178. data/spec/spec_helper.rb +16 -16
  179. metadata +133 -93
  180. data/db/bootstrap/card_changes.yml +0 -12765
  181. data/db/bootstrap/cards.yml +0 -11567
  182. data/db/seeds.rb +0 -8
  183. data/mod/03_machines/lib/javascript/script_card_menu.js +0 -72
  184. data/mod/06_bootstrap/lib/stylesheets/bootstrap_css.css +0 -6565
  185. data/mod/06_bootstrap/lib/stylesheets/theme_bootstrap_default.css +0 -476
  186. data/mod/06_bootstrap/lib/stylesheets/theme_cerulean.css +0 -6721
  187. data/mod/06_bootstrap/lib/stylesheets/theme_cosmo.css +0 -5898
  188. data/mod/06_bootstrap/lib/stylesheets/theme_cyborg.css +0 -5876
  189. data/mod/06_bootstrap/lib/stylesheets/theme_darkly.css +0 -5986
  190. data/mod/06_bootstrap/lib/stylesheets/theme_flatly.css +0 -6830
  191. data/mod/06_bootstrap/lib/stylesheets/theme_journal.css +0 -6647
  192. data/mod/06_bootstrap/lib/stylesheets/theme_lumen.css +0 -6097
  193. data/mod/06_bootstrap/lib/stylesheets/theme_paper.css +0 -6647
  194. data/mod/06_bootstrap/lib/stylesheets/theme_readable.css +0 -5896
  195. data/mod/06_bootstrap/lib/stylesheets/theme_sandstone.css +0 -6733
  196. data/mod/06_bootstrap/lib/stylesheets/theme_simplex.css +0 -5886
  197. data/mod/06_bootstrap/lib/stylesheets/theme_slate.css +0 -7057
  198. data/mod/06_bootstrap/lib/stylesheets/theme_spacelab.css +0 -5935
  199. data/mod/06_bootstrap/lib/stylesheets/theme_superhero.css +0 -5964
  200. data/mod/06_bootstrap/lib/stylesheets/theme_united.css +0 -6588
  201. data/mod/06_bootstrap/lib/stylesheets/theme_yeti.css +0 -6088
  202. data/mod/06_bootstrap/set/self/bootstrap_css.rb +0 -9
  203. data/mod/06_bootstrap/set/self/bootswatch_mixins.rb +0 -9
  204. data/mod/06_bootstrap/set/self/theme_bootstrap_default.rb +0 -2
  205. data/mod/06_bootstrap/set/self/theme_cerulean.rb +0 -9
  206. data/mod/06_bootstrap/set/self/theme_cosmo.rb +0 -2
  207. data/mod/06_bootstrap/set/self/theme_cyborg.rb +0 -2
  208. data/mod/06_bootstrap/set/self/theme_darkly.rb +0 -2
  209. data/mod/06_bootstrap/set/self/theme_flatly.rb +0 -2
  210. data/mod/06_bootstrap/set/self/theme_journal.rb +0 -2
  211. data/mod/06_bootstrap/set/self/theme_lumen.rb +0 -2
  212. data/mod/06_bootstrap/set/self/theme_paper.rb +0 -2
  213. data/mod/06_bootstrap/set/self/theme_readable.rb +0 -2
  214. data/mod/06_bootstrap/set/self/theme_sandstone.rb +0 -2
  215. data/mod/06_bootstrap/set/self/theme_simplex.rb +0 -2
  216. data/mod/06_bootstrap/set/self/theme_slate.rb +0 -2
  217. data/mod/06_bootstrap/set/self/theme_spacelab.rb +0 -2
  218. data/mod/06_bootstrap/set/self/theme_superhero.rb +0 -2
  219. data/mod/06_bootstrap/set/self/theme_united.rb +0 -2
  220. data/mod/06_bootstrap/set/self/theme_yeti.rb +0 -2
  221. data/test/fixtures/card_changes.yml +0 -17961
  222. data/test/fixtures/cards.yml +0 -16218
@@ -10,7 +10,7 @@ format :html do
10
10
  #{ head_javascript }
11
11
  )
12
12
  end
13
-
13
+
14
14
  view :core do |args|
15
15
  case
16
16
  when focal? ; CGI.escapeHTML _render_raw(args)
@@ -18,14 +18,14 @@ format :html do
18
18
  else ; _render_raw(args)
19
19
  end
20
20
  end
21
-
21
+
22
22
  def head_title
23
23
  title = root.card && root.card.name
24
24
  title = nil if title.blank?
25
25
  title = params[:action] if title=='*placeholder'
26
- %(<title>#{title ? "#{title} - " : ''}#{ Card.setting :title }</title>)
26
+ %(<title>#{title ? "#{title} - " : ''}#{ Card.setting :title }</title>)
27
27
  end
28
-
28
+
29
29
  def head_buttons
30
30
  bits = []
31
31
  [:favicon, :logo].each do |name|
@@ -50,22 +50,22 @@ format :html do
50
50
  end
51
51
  bits.join "\n "
52
52
  end
53
-
53
+
54
54
  def head_stylesheets
55
55
  manual_style = params[:style]
56
56
  style_card = Card[manual_style] if manual_style
57
57
  style_card ||= root.card.rule_card :style
58
58
  @css_path = if params[:debug] == 'style'
59
- page_path( style_card.cardname, :item => :import, :format => :css)
59
+ page_path( style_card.cardname, :item => :import, :format => :css)
60
60
  elsif style_card
61
61
  card_path style_card.machine_output_url
62
- end
63
-
62
+ end
63
+
64
64
  if @css_path
65
65
  %{<link href="#{@css_path}" media="all" rel="stylesheet" type="text/css" />}
66
66
  end
67
67
  end
68
-
68
+
69
69
  def head_javascript
70
70
  varvals = [
71
71
  "window.wagn={rootPath:'#{ Card.config.relative_url_root }'}",
@@ -74,16 +74,16 @@ format :html do
74
74
  card.have_recaptcha_keys? and varvals << "wagn.recaptchaKey='#{Card.config.recaptcha_public_key}'"
75
75
  c=Card[:double_click] and !Card.toggle c.content and varvals << 'wagn.noDoubleClick=true'
76
76
  @css_path and varvals << "wagn.cssPath='#{@css_path}'"
77
-
77
+
78
78
  manual_script = params[:script]
79
79
  script_card = Card[manual_script] if manual_script
80
- script_card ||= root.card.rule_card :script
81
-
80
+ script_card ||= root.card.rule_card :script
81
+
82
82
  @js_tag = if params[:debug] == 'script'
83
83
  script_card.format(:js).render_core :item => :include_tag
84
84
  elsif script_card
85
85
  javascript_include_tag script_card.machine_output_url
86
- end
86
+ end
87
87
 
88
88
  ie9_card = Card[:script_html5shiv_printshiv]
89
89
  %(#{ javascript_tag do varvals * ';' end }
@@ -97,8 +97,8 @@ format :html do
97
97
  })
98
98
  </script>)
99
99
  end
100
-
101
-
100
+
101
+
102
102
  def google_analytics_head_javascript
103
103
  if ga_key = Card.setting("*google analytics key") #fixme. escape this?
104
104
  %{
@@ -2,34 +2,59 @@
2
2
  format :html do
3
3
 
4
4
  view :core do |args|
5
- body = card.setting_codenames_by_group.map do |group, data|
6
- next if group.nil? || data.nil?
7
- group_name = Card::Setting.group_names[group] || group.to_s
8
- content_tag(:tr, :class=>"rule-group") do
9
- (["#{group_name} Rules"]+%w{Content Set}).map do |heading|
10
- content_tag(:th, :class=>'rule-heading') { heading }
11
- end * "\n"
12
- end +
13
- raw( data.map do |setting|
14
- rule_card = card.fetch(:trait=>setting, :new=>{})
15
- nest rule_card, :view=>:closed_rule
16
- end * "\n" )
17
- end.compact * ''
18
- %{
19
- #{
20
- unless args[:unlabeled]
21
- %{ <h2 class="set-label">#{ card.label }</h2> }
22
- end
23
- }
24
- #{ content_tag('table', :class=>'set-rules') { body } }
25
- }
5
+ output [
6
+ _optional_render(:set_label, args, :show),
7
+ (content_tag(:div, :class=>'panel-group', :id=>'accordion', :role=>'tablist','aria-multiselectable'=>'true') do
8
+ Card::Setting.groups.keys.map do |group_key|
9
+ _optional_render(group_key, args, :show)
10
+ end * "\n"
11
+ end)
12
+ ]
13
+ end
14
+
15
+ view :set_label do |args|
16
+ content_tag :h2, card.label, :class=>'set-label'
26
17
  end
27
18
 
19
+ Card::Setting.groups.keys.each do |group_key|
20
+ view group_key.to_sym do |args|
21
+ settings = card.visible_settings group_key
22
+ if settings.present?
23
+ group_name = Card::Setting.group_names[group_key] || group.to_s
24
+ heading_id = "heading-#{group_key}"
25
+ collapse_id = "collpase-#{group_key}"
26
+ output [
27
+ (content_tag :div, :class=>'panel panel-default' do
28
+ content_tag :div, :class=>'panel-heading', :role=>'tab', :id=>heading_id do
29
+ content_tag :h4, :class=>'panel-title' do
30
+ content_tag :a, group_name, 'data-toggle'=>'collapse', 'data-parent'=>'#accordion', :href=>"##{collapse_id}", 'aria-expanded'=>'false', 'aria-controls'=>collapse_id
31
+ end
32
+ end
33
+ end),
34
+ (content_tag :div, :id=>collapse_id, :class=>'panel-collapse collapse', :role=>'tabpanel', 'aria-labelledby'=>heading_id do
35
+ wrap_with :table, :class=>'set-rules table' do
36
+ [
37
+ (content_tag(:tr, :class=>"rule-group") do
38
+ wrap_each_with :th, %w(Setting Content Set), :class=>'rule-heading'
39
+ end),
40
+ (settings.map do |setting|
41
+ if show_view? setting.codename, args
42
+ rule_card = card.fetch(:trait=>setting.codename, :new=>{})
43
+ nest(rule_card, :view=>:closed_rule).html_safe
44
+ end
45
+ end * "\n")
46
+ ]
47
+ end
48
+ end)
49
+ ]
50
+ end
51
+ end
52
+ end
28
53
 
29
54
  view :editor do |args|
30
55
  'Cannot currently edit Sets' #ENGLISH
31
56
  end
32
-
57
+
33
58
  view :template_link do |args|
34
59
  args.delete :style
35
60
  wrap args do
@@ -37,33 +62,33 @@ format :html do
37
62
  "{{#{link}}}"
38
63
  end
39
64
  end
40
-
65
+
41
66
  view :template_closer do |args|
42
67
  view_link '', :template_link, :class=>'slotter glyphicon glyphicon-remove template-editor-close'
43
68
  end
44
-
69
+
45
70
  view :template_editor do |args|
46
71
  wrap args do
47
72
  %{
48
- <div class="template-editor-left">{{</div>
73
+ <div class="template-editor-left">{{</div>
49
74
  <div class="template-editor-main">
50
75
  #{ render_template_editor_frame args }
51
76
  </div>
52
- <div class="template-editor-right">}}</div>
77
+ <div class="template-editor-right">}}</div>
53
78
  }
54
79
  end
55
80
  end
56
-
81
+
57
82
  view :template_editor_frame do |args|
58
83
  frame :no_slot=>true, :title=>card.label, :menu_hack=>:template_closer do
59
- _render_core args.merge(:unlabeled=>true)
84
+ _render_core args.merge(:hide=>'set_label')
60
85
  end
61
86
  end
62
-
87
+
63
88
  view :closed_content do |args|
64
89
  ''
65
90
  end
66
-
91
+
67
92
  end
68
93
 
69
94
 
@@ -150,7 +175,7 @@ end
150
175
 
151
176
  def setting_codenames_by_group
152
177
  result = {}
153
- Card::Setting.groups.each do |group, settings|
178
+ Card::Setting.groups.each do |group, settings|
154
179
  visible_settings = settings.reject { |s| !s or !s.applies_to_cardtype(prototype.type_id) }
155
180
  unless visible_settings.empty?
156
181
  result[group] = visible_settings.map { |s| s.codename }
@@ -159,12 +184,18 @@ def setting_codenames_by_group
159
184
  result
160
185
  end
161
186
 
162
- def all_members_followed?
187
+ def visible_settings group
188
+ Card::Setting.groups[group].reject do |setting|
189
+ !setting or !setting.applies_to_cardtype(prototype.type_id)
190
+ end
191
+ end
192
+
193
+ def all_members_followed?
163
194
  all_members_followed_by? Auth.current_id
164
195
  end
165
196
 
166
197
  def all_members_followed_by? user_id = nil
167
- if !prototype.followed_by? user_id
198
+ if !prototype.followed_by? user_id
168
199
  return false
169
200
  elsif set_followed_by? user_id
170
201
  return true
@@ -183,7 +214,7 @@ def set_followed?
183
214
  end
184
215
 
185
216
  def set_followed_by? user_id = nil
186
- return ( user_id && (user = Card.find(user_id)) && Card.fetch(follow_rule_name(user.name)) ) ||
217
+ return ( user_id && (user = Card.find(user_id)) && Card.fetch(follow_rule_name(user.name)) ) ||
187
218
  Card.fetch(follow_rule_name)
188
219
  end
189
220
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  describe Card::Set::All::Attach do
4
4
  it 'should be triggered by image card creation' do
5
- file = File.new("#{ Cardio.gem_root }/test/fixtures/mao2.jpg")
5
+ file = File.new( File.join FIXTURES_PATH, 'mao2.jpg' )
6
6
  card = Card.create :name => "Bananamaster", :type=>'Image', :attach=>file
7
7
  expect(card.attach.url).to match(/^\/files\/Bananamaster-original-\d+/)
8
8
  end
@@ -1,27 +1,31 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- describe Card::Set::All::RichHtml::Wrapper do
3
+ describe Card::Set::All::RichHtml::Wrapper do
4
4
  context "full wrapping" do
5
5
  before do
6
6
  @ocslot = Card['A'].format
7
7
  end
8
8
 
9
9
  it "has the appropriate attributes on open" do
10
- assert_view_select @ocslot.render(:open), 'div[class="card-slot open-view card-frame panel panel-default ALL TYPE-basic SELF-a"]' do
11
- assert_select 'div[class="card-header panel-heading"]' do
12
- assert_select 'div[class="card-header-title panel-title"]'
10
+ assert_view_select @ocslot.render(:open), 'div[class="card-slot open-view ALL TYPE-basic SELF-a"]' do
11
+ assert_select 'div[class="card-frame panel panel-default"]' do
12
+ assert_select 'div[class="card-header panel-heading"]' do
13
+ assert_select 'div[class="card-header-title panel-title"]'
14
+ end
15
+ assert_select 'div[class~="card-body"]'
13
16
  end
14
- assert_select 'div[class~="card-body"]'
15
17
  end
16
18
  end
17
19
 
18
20
  it "has the appropriate attributes on closed" do
19
21
  v = @ocslot.render(:closed)
20
- assert_view_select v, 'div[class="card-slot closed-view card-frame panel panel-default ALL TYPE-basic SELF-a"]' do
21
- assert_select 'div[class="card-header panel-heading"]' do
22
- assert_select 'div[class="card-header-title panel-title"]'
22
+ assert_view_select v, 'div[class="card-slot closed-view ALL TYPE-basic SELF-a"]' do
23
+ assert_select 'div[class="card-frame panel panel-default"]' do
24
+ assert_select 'div[class="card-header panel-heading"]' do
25
+ assert_select 'div[class="card-header-title panel-title"]'
26
+ end
27
+ assert_select 'div[class~="closed-content card-content"]'
23
28
  end
24
- assert_select 'div[class~="closed-content card-content"]'
25
29
  end
26
30
  end
27
31
  end
@@ -6,7 +6,7 @@ describe Card::Set::Rstar::Rules do
6
6
  expect(r).not_to match(/error/i)
7
7
  expect(r).not_to match('No Card!')
8
8
  #warn "r = #{r}"
9
- assert_view_select r, 'table[class="set-rules"]' do
9
+ assert_view_select r, 'table[class="set-rules table"]' do
10
10
  assert_select 'a[href~="/*read+*right+*input?view=open_rule"]', :text => 'input'
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v3.3.2 (http://getbootstrap.com)
2
+ * Bootstrap v3.3.4 (http://getbootstrap.com)
3
3
  * Copyright 2011-2015 Twitter, Inc.
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
5
  */
@@ -17,7 +17,7 @@ if (typeof jQuery === 'undefined') {
17
17
  }(jQuery);
18
18
 
19
19
  /* ========================================================================
20
- * Bootstrap: transition.js v3.3.2
20
+ * Bootstrap: transition.js v3.3.4
21
21
  * http://getbootstrap.com/javascript/#transitions
22
22
  * ========================================================================
23
23
  * Copyright 2011-2015 Twitter, Inc.
@@ -77,7 +77,7 @@ if (typeof jQuery === 'undefined') {
77
77
  }(jQuery);
78
78
 
79
79
  /* ========================================================================
80
- * Bootstrap: alert.js v3.3.2
80
+ * Bootstrap: alert.js v3.3.4
81
81
  * http://getbootstrap.com/javascript/#alerts
82
82
  * ========================================================================
83
83
  * Copyright 2011-2015 Twitter, Inc.
@@ -96,7 +96,7 @@ if (typeof jQuery === 'undefined') {
96
96
  $(el).on('click', dismiss, this.close)
97
97
  }
98
98
 
99
- Alert.VERSION = '3.3.2'
99
+ Alert.VERSION = '3.3.4'
100
100
 
101
101
  Alert.TRANSITION_DURATION = 150
102
102
 
@@ -172,7 +172,7 @@ if (typeof jQuery === 'undefined') {
172
172
  }(jQuery);
173
173
 
174
174
  /* ========================================================================
175
- * Bootstrap: button.js v3.3.2
175
+ * Bootstrap: button.js v3.3.4
176
176
  * http://getbootstrap.com/javascript/#buttons
177
177
  * ========================================================================
178
178
  * Copyright 2011-2015 Twitter, Inc.
@@ -192,7 +192,7 @@ if (typeof jQuery === 'undefined') {
192
192
  this.isLoading = false
193
193
  }
194
194
 
195
- Button.VERSION = '3.3.2'
195
+ Button.VERSION = '3.3.4'
196
196
 
197
197
  Button.DEFAULTS = {
198
198
  loadingText: 'loading...'
@@ -289,7 +289,7 @@ if (typeof jQuery === 'undefined') {
289
289
  }(jQuery);
290
290
 
291
291
  /* ========================================================================
292
- * Bootstrap: carousel.js v3.3.2
292
+ * Bootstrap: carousel.js v3.3.4
293
293
  * http://getbootstrap.com/javascript/#carousel
294
294
  * ========================================================================
295
295
  * Copyright 2011-2015 Twitter, Inc.
@@ -307,10 +307,10 @@ if (typeof jQuery === 'undefined') {
307
307
  this.$element = $(element)
308
308
  this.$indicators = this.$element.find('.carousel-indicators')
309
309
  this.options = options
310
- this.paused =
311
- this.sliding =
312
- this.interval =
313
- this.$active =
310
+ this.paused = null
311
+ this.sliding = null
312
+ this.interval = null
313
+ this.$active = null
314
314
  this.$items = null
315
315
 
316
316
  this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
@@ -320,7 +320,7 @@ if (typeof jQuery === 'undefined') {
320
320
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
321
321
  }
322
322
 
323
- Carousel.VERSION = '3.3.2'
323
+ Carousel.VERSION = '3.3.4'
324
324
 
325
325
  Carousel.TRANSITION_DURATION = 600
326
326
 
@@ -527,7 +527,7 @@ if (typeof jQuery === 'undefined') {
527
527
  }(jQuery);
528
528
 
529
529
  /* ========================================================================
530
- * Bootstrap: collapse.js v3.3.2
530
+ * Bootstrap: collapse.js v3.3.4
531
531
  * http://getbootstrap.com/javascript/#collapse
532
532
  * ========================================================================
533
533
  * Copyright 2011-2015 Twitter, Inc.
@@ -544,7 +544,8 @@ if (typeof jQuery === 'undefined') {
544
544
  var Collapse = function (element, options) {
545
545
  this.$element = $(element)
546
546
  this.options = $.extend({}, Collapse.DEFAULTS, options)
547
- this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
547
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
548
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
548
549
  this.transitioning = null
549
550
 
550
551
  if (this.options.parent) {
@@ -556,13 +557,12 @@ if (typeof jQuery === 'undefined') {
556
557
  if (this.options.toggle) this.toggle()
557
558
  }
558
559
 
559
- Collapse.VERSION = '3.3.2'
560
+ Collapse.VERSION = '3.3.4'
560
561
 
561
562
  Collapse.TRANSITION_DURATION = 350
562
563
 
563
564
  Collapse.DEFAULTS = {
564
- toggle: true,
565
- trigger: '[data-toggle="collapse"]'
565
+ toggle: true
566
566
  }
567
567
 
568
568
  Collapse.prototype.dimension = function () {
@@ -700,7 +700,7 @@ if (typeof jQuery === 'undefined') {
700
700
  var data = $this.data('bs.collapse')
701
701
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
702
702
 
703
- if (!data && options.toggle && option == 'show') options.toggle = false
703
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
704
704
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
705
705
  if (typeof option == 'string') data[option]()
706
706
  })
@@ -731,7 +731,7 @@ if (typeof jQuery === 'undefined') {
731
731
 
732
732
  var $target = getTargetFromTrigger($this)
733
733
  var data = $target.data('bs.collapse')
734
- var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
734
+ var option = data ? 'toggle' : $this.data()
735
735
 
736
736
  Plugin.call($target, option)
737
737
  })
@@ -739,7 +739,7 @@ if (typeof jQuery === 'undefined') {
739
739
  }(jQuery);
740
740
 
741
741
  /* ========================================================================
742
- * Bootstrap: dropdown.js v3.3.2
742
+ * Bootstrap: dropdown.js v3.3.4
743
743
  * http://getbootstrap.com/javascript/#dropdowns
744
744
  * ========================================================================
745
745
  * Copyright 2011-2015 Twitter, Inc.
@@ -759,7 +759,7 @@ if (typeof jQuery === 'undefined') {
759
759
  $(element).on('click.bs.dropdown', this.toggle)
760
760
  }
761
761
 
762
- Dropdown.VERSION = '3.3.2'
762
+ Dropdown.VERSION = '3.3.4'
763
763
 
764
764
  Dropdown.prototype.toggle = function (e) {
765
765
  var $this = $(this)
@@ -812,7 +812,7 @@ if (typeof jQuery === 'undefined') {
812
812
  return $this.trigger('click')
813
813
  }
814
814
 
815
- var desc = ' li:not(.divider):visible a'
815
+ var desc = ' li:not(.disabled):visible a'
816
816
  var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
817
817
 
818
818
  if (!$items.length) return
@@ -901,7 +901,7 @@ if (typeof jQuery === 'undefined') {
901
901
  }(jQuery);
902
902
 
903
903
  /* ========================================================================
904
- * Bootstrap: modal.js v3.3.2
904
+ * Bootstrap: modal.js v3.3.4
905
905
  * http://getbootstrap.com/javascript/#modals
906
906
  * ========================================================================
907
907
  * Copyright 2011-2015 Twitter, Inc.
@@ -916,12 +916,15 @@ if (typeof jQuery === 'undefined') {
916
916
  // ======================
917
917
 
918
918
  var Modal = function (element, options) {
919
- this.options = options
920
- this.$body = $(document.body)
921
- this.$element = $(element)
922
- this.$backdrop =
923
- this.isShown = null
924
- this.scrollbarWidth = 0
919
+ this.options = options
920
+ this.$body = $(document.body)
921
+ this.$element = $(element)
922
+ this.$dialog = this.$element.find('.modal-dialog')
923
+ this.$backdrop = null
924
+ this.isShown = null
925
+ this.originalBodyPad = null
926
+ this.scrollbarWidth = 0
927
+ this.ignoreBackdropClick = false
925
928
 
926
929
  if (this.options.remote) {
927
930
  this.$element
@@ -932,7 +935,7 @@ if (typeof jQuery === 'undefined') {
932
935
  }
933
936
  }
934
937
 
935
- Modal.VERSION = '3.3.2'
938
+ Modal.VERSION = '3.3.4'
936
939
 
937
940
  Modal.TRANSITION_DURATION = 300
938
941
  Modal.BACKDROP_TRANSITION_DURATION = 150
@@ -966,6 +969,12 @@ if (typeof jQuery === 'undefined') {
966
969
 
967
970
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
968
971
 
972
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
973
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
974
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
975
+ })
976
+ })
977
+
969
978
  this.backdrop(function () {
970
979
  var transition = $.support.transition && that.$element.hasClass('fade')
971
980
 
@@ -977,7 +986,6 @@ if (typeof jQuery === 'undefined') {
977
986
  .show()
978
987
  .scrollTop(0)
979
988
 
980
- if (that.options.backdrop) that.adjustBackdrop()
981
989
  that.adjustDialog()
982
990
 
983
991
  if (transition) {
@@ -993,7 +1001,7 @@ if (typeof jQuery === 'undefined') {
993
1001
  var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
994
1002
 
995
1003
  transition ?
996
- that.$element.find('.modal-dialog') // wait for modal to slide in
1004
+ that.$dialog // wait for modal to slide in
997
1005
  .one('bsTransitionEnd', function () {
998
1006
  that.$element.trigger('focus').trigger(e)
999
1007
  })
@@ -1022,6 +1030,9 @@ if (typeof jQuery === 'undefined') {
1022
1030
  .removeClass('in')
1023
1031
  .attr('aria-hidden', true)
1024
1032
  .off('click.dismiss.bs.modal')
1033
+ .off('mouseup.dismiss.bs.modal')
1034
+
1035
+ this.$dialog.off('mousedown.dismiss.bs.modal')
1025
1036
 
1026
1037
  $.support.transition && this.$element.hasClass('fade') ?
1027
1038
  this.$element
@@ -1082,13 +1093,18 @@ if (typeof jQuery === 'undefined') {
1082
1093
  var doAnimate = $.support.transition && animate
1083
1094
 
1084
1095
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1085
- .prependTo(this.$element)
1086
- .on('click.dismiss.bs.modal', $.proxy(function (e) {
1087
- if (e.target !== e.currentTarget) return
1088
- this.options.backdrop == 'static'
1089
- ? this.$element[0].focus.call(this.$element[0])
1090
- : this.hide.call(this)
1091
- }, this))
1096
+ .appendTo(this.$body)
1097
+
1098
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
1099
+ if (this.ignoreBackdropClick) {
1100
+ this.ignoreBackdropClick = false
1101
+ return
1102
+ }
1103
+ if (e.target !== e.currentTarget) return
1104
+ this.options.backdrop == 'static'
1105
+ ? this.$element[0].focus()
1106
+ : this.hide()
1107
+ }, this))
1092
1108
 
1093
1109
  if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1094
1110
 
@@ -1123,16 +1139,9 @@ if (typeof jQuery === 'undefined') {
1123
1139
  // these following methods are used to handle overflowing modals
1124
1140
 
1125
1141
  Modal.prototype.handleUpdate = function () {
1126
- if (this.options.backdrop) this.adjustBackdrop()
1127
1142
  this.adjustDialog()
1128
1143
  }
1129
1144
 
1130
- Modal.prototype.adjustBackdrop = function () {
1131
- this.$backdrop
1132
- .css('height', 0)
1133
- .css('height', this.$element[0].scrollHeight)
1134
- }
1135
-
1136
1145
  Modal.prototype.adjustDialog = function () {
1137
1146
  var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1138
1147
 
@@ -1150,17 +1159,23 @@ if (typeof jQuery === 'undefined') {
1150
1159
  }
1151
1160
 
1152
1161
  Modal.prototype.checkScrollbar = function () {
1153
- this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
1162
+ var fullWindowWidth = window.innerWidth
1163
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
1164
+ var documentElementRect = document.documentElement.getBoundingClientRect()
1165
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
1166
+ }
1167
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
1154
1168
  this.scrollbarWidth = this.measureScrollbar()
1155
1169
  }
1156
1170
 
1157
1171
  Modal.prototype.setScrollbar = function () {
1158
1172
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1173
+ this.originalBodyPad = document.body.style.paddingRight || ''
1159
1174
  if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1160
1175
  }
1161
1176
 
1162
1177
  Modal.prototype.resetScrollbar = function () {
1163
- this.$body.css('padding-right', '')
1178
+ this.$body.css('padding-right', this.originalBodyPad)
1164
1179
  }
1165
1180
 
1166
1181
  Modal.prototype.measureScrollbar = function () { // thx walsh
@@ -1226,7 +1241,7 @@ if (typeof jQuery === 'undefined') {
1226
1241
  }(jQuery);
1227
1242
 
1228
1243
  /* ========================================================================
1229
- * Bootstrap: tooltip.js v3.3.2
1244
+ * Bootstrap: tooltip.js v3.3.4
1230
1245
  * http://getbootstrap.com/javascript/#tooltip
1231
1246
  * Inspired by the original jQuery.tipsy by Jason Frame
1232
1247
  * ========================================================================
@@ -1242,17 +1257,17 @@ if (typeof jQuery === 'undefined') {
1242
1257
  // ===============================
1243
1258
 
1244
1259
  var Tooltip = function (element, options) {
1245
- this.type =
1246
- this.options =
1247
- this.enabled =
1248
- this.timeout =
1249
- this.hoverState =
1260
+ this.type = null
1261
+ this.options = null
1262
+ this.enabled = null
1263
+ this.timeout = null
1264
+ this.hoverState = null
1250
1265
  this.$element = null
1251
1266
 
1252
1267
  this.init('tooltip', element, options)
1253
1268
  }
1254
1269
 
1255
- Tooltip.VERSION = '3.3.2'
1270
+ Tooltip.VERSION = '3.3.4'
1256
1271
 
1257
1272
  Tooltip.TRANSITION_DURATION = 150
1258
1273
 
@@ -1279,6 +1294,10 @@ if (typeof jQuery === 'undefined') {
1279
1294
  this.options = this.getOptions(options)
1280
1295
  this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
1281
1296
 
1297
+ if (this.$element[0] instanceof document.constructor && !this.options.selector) {
1298
+ throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
1299
+ }
1300
+
1282
1301
  var triggers = this.options.trigger.split(' ')
1283
1302
 
1284
1303
  for (var i = triggers.length; i--;) {
@@ -1499,10 +1518,10 @@ if (typeof jQuery === 'undefined') {
1499
1518
  this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1500
1519
  }
1501
1520
 
1502
- Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
1521
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1503
1522
  this.arrow()
1504
- .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1505
- .css(isHorizontal ? 'top' : 'left', '')
1523
+ .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1524
+ .css(isVertical ? 'top' : 'left', '')
1506
1525
  }
1507
1526
 
1508
1527
  Tooltip.prototype.setContent = function () {
@@ -1515,7 +1534,7 @@ if (typeof jQuery === 'undefined') {
1515
1534
 
1516
1535
  Tooltip.prototype.hide = function (callback) {
1517
1536
  var that = this
1518
- var $tip = this.tip()
1537
+ var $tip = $(this.$tip)
1519
1538
  var e = $.Event('hide.bs.' + this.type)
1520
1539
 
1521
1540
  function complete() {
@@ -1532,7 +1551,7 @@ if (typeof jQuery === 'undefined') {
1532
1551
 
1533
1552
  $tip.removeClass('in')
1534
1553
 
1535
- $.support.transition && this.$tip.hasClass('fade') ?
1554
+ $.support.transition && $tip.hasClass('fade') ?
1536
1555
  $tip
1537
1556
  .one('bsTransitionEnd', complete)
1538
1557
  .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
@@ -1676,7 +1695,7 @@ if (typeof jQuery === 'undefined') {
1676
1695
  var data = $this.data('bs.tooltip')
1677
1696
  var options = typeof option == 'object' && option
1678
1697
 
1679
- if (!data && option == 'destroy') return
1698
+ if (!data && /destroy|hide/.test(option)) return
1680
1699
  if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1681
1700
  if (typeof option == 'string') data[option]()
1682
1701
  })
@@ -1699,7 +1718,7 @@ if (typeof jQuery === 'undefined') {
1699
1718
  }(jQuery);
1700
1719
 
1701
1720
  /* ========================================================================
1702
- * Bootstrap: popover.js v3.3.2
1721
+ * Bootstrap: popover.js v3.3.4
1703
1722
  * http://getbootstrap.com/javascript/#popovers
1704
1723
  * ========================================================================
1705
1724
  * Copyright 2011-2015 Twitter, Inc.
@@ -1719,7 +1738,7 @@ if (typeof jQuery === 'undefined') {
1719
1738
 
1720
1739
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1721
1740
 
1722
- Popover.VERSION = '3.3.2'
1741
+ Popover.VERSION = '3.3.4'
1723
1742
 
1724
1743
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1725
1744
  placement: 'right',
@@ -1775,11 +1794,6 @@ if (typeof jQuery === 'undefined') {
1775
1794
  return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1776
1795
  }
1777
1796
 
1778
- Popover.prototype.tip = function () {
1779
- if (!this.$tip) this.$tip = $(this.options.template)
1780
- return this.$tip
1781
- }
1782
-
1783
1797
 
1784
1798
  // POPOVER PLUGIN DEFINITION
1785
1799
  // =========================
@@ -1790,7 +1804,7 @@ if (typeof jQuery === 'undefined') {
1790
1804
  var data = $this.data('bs.popover')
1791
1805
  var options = typeof option == 'object' && option
1792
1806
 
1793
- if (!data && option == 'destroy') return
1807
+ if (!data && /destroy|hide/.test(option)) return
1794
1808
  if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1795
1809
  if (typeof option == 'string') data[option]()
1796
1810
  })
@@ -1813,7 +1827,7 @@ if (typeof jQuery === 'undefined') {
1813
1827
  }(jQuery);
1814
1828
 
1815
1829
  /* ========================================================================
1816
- * Bootstrap: scrollspy.js v3.3.2
1830
+ * Bootstrap: scrollspy.js v3.3.4
1817
1831
  * http://getbootstrap.com/javascript/#scrollspy
1818
1832
  * ========================================================================
1819
1833
  * Copyright 2011-2015 Twitter, Inc.
@@ -1828,10 +1842,8 @@ if (typeof jQuery === 'undefined') {
1828
1842
  // ==========================
1829
1843
 
1830
1844
  function ScrollSpy(element, options) {
1831
- var process = $.proxy(this.process, this)
1832
-
1833
- this.$body = $('body')
1834
- this.$scrollElement = $(element).is('body') ? $(window) : $(element)
1845
+ this.$body = $(document.body)
1846
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1835
1847
  this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1836
1848
  this.selector = (this.options.target || '') + ' .nav li > a'
1837
1849
  this.offsets = []
@@ -1839,12 +1851,12 @@ if (typeof jQuery === 'undefined') {
1839
1851
  this.activeTarget = null
1840
1852
  this.scrollHeight = 0
1841
1853
 
1842
- this.$scrollElement.on('scroll.bs.scrollspy', process)
1854
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
1843
1855
  this.refresh()
1844
1856
  this.process()
1845
1857
  }
1846
1858
 
1847
- ScrollSpy.VERSION = '3.3.2'
1859
+ ScrollSpy.VERSION = '3.3.4'
1848
1860
 
1849
1861
  ScrollSpy.DEFAULTS = {
1850
1862
  offset: 10
@@ -1855,20 +1867,19 @@ if (typeof jQuery === 'undefined') {
1855
1867
  }
1856
1868
 
1857
1869
  ScrollSpy.prototype.refresh = function () {
1858
- var offsetMethod = 'offset'
1859
- var offsetBase = 0
1870
+ var that = this
1871
+ var offsetMethod = 'offset'
1872
+ var offsetBase = 0
1873
+
1874
+ this.offsets = []
1875
+ this.targets = []
1876
+ this.scrollHeight = this.getScrollHeight()
1860
1877
 
1861
1878
  if (!$.isWindow(this.$scrollElement[0])) {
1862
1879
  offsetMethod = 'position'
1863
1880
  offsetBase = this.$scrollElement.scrollTop()
1864
1881
  }
1865
1882
 
1866
- this.offsets = []
1867
- this.targets = []
1868
- this.scrollHeight = this.getScrollHeight()
1869
-
1870
- var self = this
1871
-
1872
1883
  this.$body
1873
1884
  .find(this.selector)
1874
1885
  .map(function () {
@@ -1883,8 +1894,8 @@ if (typeof jQuery === 'undefined') {
1883
1894
  })
1884
1895
  .sort(function (a, b) { return a[0] - b[0] })
1885
1896
  .each(function () {
1886
- self.offsets.push(this[0])
1887
- self.targets.push(this[1])
1897
+ that.offsets.push(this[0])
1898
+ that.targets.push(this[1])
1888
1899
  })
1889
1900
  }
1890
1901
 
@@ -1913,7 +1924,7 @@ if (typeof jQuery === 'undefined') {
1913
1924
  for (i = offsets.length; i--;) {
1914
1925
  activeTarget != targets[i]
1915
1926
  && scrollTop >= offsets[i]
1916
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1927
+ && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1917
1928
  && this.activate(targets[i])
1918
1929
  }
1919
1930
  }
@@ -1924,8 +1935,8 @@ if (typeof jQuery === 'undefined') {
1924
1935
  this.clear()
1925
1936
 
1926
1937
  var selector = this.selector +
1927
- '[data-target="' + target + '"],' +
1928
- this.selector + '[href="' + target + '"]'
1938
+ '[data-target="' + target + '"],' +
1939
+ this.selector + '[href="' + target + '"]'
1929
1940
 
1930
1941
  var active = $(selector)
1931
1942
  .parents('li')
@@ -1989,7 +2000,7 @@ if (typeof jQuery === 'undefined') {
1989
2000
  }(jQuery);
1990
2001
 
1991
2002
  /* ========================================================================
1992
- * Bootstrap: tab.js v3.3.2
2003
+ * Bootstrap: tab.js v3.3.4
1993
2004
  * http://getbootstrap.com/javascript/#tabs
1994
2005
  * ========================================================================
1995
2006
  * Copyright 2011-2015 Twitter, Inc.
@@ -2007,7 +2018,7 @@ if (typeof jQuery === 'undefined') {
2007
2018
  this.element = $(element)
2008
2019
  }
2009
2020
 
2010
- Tab.VERSION = '3.3.2'
2021
+ Tab.VERSION = '3.3.4'
2011
2022
 
2012
2023
  Tab.TRANSITION_DURATION = 150
2013
2024
 
@@ -2078,7 +2089,7 @@ if (typeof jQuery === 'undefined') {
2078
2089
  element.removeClass('fade')
2079
2090
  }
2080
2091
 
2081
- if (element.parent('.dropdown-menu')) {
2092
+ if (element.parent('.dropdown-menu').length) {
2082
2093
  element
2083
2094
  .closest('li.dropdown')
2084
2095
  .addClass('active')
@@ -2143,7 +2154,7 @@ if (typeof jQuery === 'undefined') {
2143
2154
  }(jQuery);
2144
2155
 
2145
2156
  /* ========================================================================
2146
- * Bootstrap: affix.js v3.3.2
2157
+ * Bootstrap: affix.js v3.3.4
2147
2158
  * http://getbootstrap.com/javascript/#affix
2148
2159
  * ========================================================================
2149
2160
  * Copyright 2011-2015 Twitter, Inc.
@@ -2165,14 +2176,14 @@ if (typeof jQuery === 'undefined') {
2165
2176
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
2166
2177
 
2167
2178
  this.$element = $(element)
2168
- this.affixed =
2169
- this.unpin =
2179
+ this.affixed = null
2180
+ this.unpin = null
2170
2181
  this.pinnedOffset = null
2171
2182
 
2172
2183
  this.checkPosition()
2173
2184
  }
2174
2185
 
2175
- Affix.VERSION = '3.3.2'
2186
+ Affix.VERSION = '3.3.4'
2176
2187
 
2177
2188
  Affix.RESET = 'affix affix-top affix-bottom'
2178
2189
 
@@ -2222,7 +2233,7 @@ if (typeof jQuery === 'undefined') {
2222
2233
  var offset = this.options.offset
2223
2234
  var offsetTop = offset.top
2224
2235
  var offsetBottom = offset.bottom
2225
- var scrollHeight = $('body').height()
2236
+ var scrollHeight = $(document.body).height()
2226
2237
 
2227
2238
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
2228
2239
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)