card 1.15.7 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/card.gemspec +3 -2
  4. data/config/initializers/inflections.rb +1 -1
  5. data/db/migrate_core_cards/20150528084659_add_session_cardtype.rb +0 -1
  6. data/db/migrate_core_cards/20150601133433_add_recent_setting_session_card.rb +12 -0
  7. data/db/migrate_core_cards/20150610171702_add_debugger_session_card.rb +11 -0
  8. data/db/migrate_core_cards/20150611203506_rails_inflection_updates.rb +82 -0
  9. data/db/migrate_core_cards/20150627205133_fix_script_bootstrap_card_type.rb +7 -0
  10. data/db/migrate_core_cards/20150702130543_remove_edit_toolbar_pinned.rb +9 -0
  11. data/db/schema.rb +81 -81
  12. data/db/seed/new/card_actions.yml +12581 -1647
  13. data/db/seed/new/card_acts.yml +1 -1
  14. data/db/seed/new/card_changes.yml +39326 -7569
  15. data/db/seed/new/card_references.yml +518 -455
  16. data/db/seed/new/cards.yml +1547 -1291
  17. data/db/seed/test/fixtures/card_actions.yml +13700 -2717
  18. data/db/seed/test/fixtures/card_acts.yml +314 -272
  19. data/db/seed/test/fixtures/card_changes.yml +45409 -13573
  20. data/db/seed/test/fixtures/card_references.yml +1223 -1125
  21. data/db/seed/test/fixtures/cards.yml +2694 -2433
  22. data/db/seed/test/fixtures/file1.txt +1 -0
  23. data/db/seed/test/fixtures/file2.txt +1 -0
  24. data/db/version_core_cards.txt +1 -1
  25. data/lib/card.rb +23 -13
  26. data/lib/card/auth.rb +6 -6
  27. data/lib/card/cache.rb +24 -5
  28. data/lib/card/env.rb +10 -10
  29. data/lib/card/format.rb +29 -12
  30. data/lib/card/log.rb +5 -3
  31. data/lib/card/migration.rb +17 -41
  32. data/lib/card/name.rb +12 -0
  33. data/lib/card/reference.rb +11 -12
  34. data/lib/card/set.rb +59 -6
  35. data/lib/card/simplecov_helper.rb +6 -1
  36. data/lib/card/spec_helper.rb +3 -2
  37. data/lib/card/view_cache.rb +77 -0
  38. data/lib/cardio.rb +30 -22
  39. data/mod/01_core/format/html_format.rb +17 -9
  40. data/mod/01_core/layout/blank.html +1 -1
  41. data/mod/01_core/layout/default.html +6 -16
  42. data/mod/01_core/layout/modal.html +9 -0
  43. data/mod/01_core/layout/noside.html +5 -12
  44. data/mod/01_core/layout/simple.html +1 -1
  45. data/mod/01_core/set/all/collection.rb +57 -5
  46. data/mod/01_core/set/all/content.rb +5 -7
  47. data/mod/01_core/set/all/name.rb +8 -10
  48. data/mod/01_core/set/all/permissions.rb +1 -2
  49. data/mod/01_core/set/all/phases.rb +5 -13
  50. data/mod/01_core/set/all/references.rb +10 -10
  51. data/mod/01_core/set/all/rules.rb +2 -2
  52. data/mod/01_core/set/all/tracked_attributes.rb +5 -3
  53. data/mod/01_core/set/all/utils.rb +79 -9
  54. data/mod/01_core/set/all/view_cache.rb +9 -0
  55. data/mod/01_core/spec/format/html_format_spec.rb +2 -2
  56. data/mod/01_core/spec/set/all/collection_spec.rb +1 -1
  57. data/mod/01_history/lib/card/act.rb +3 -1
  58. data/mod/01_history/lib/card/action.rb +20 -12
  59. data/mod/01_history/lib/card/change.rb +12 -8
  60. data/mod/01_history/set/all/actions.rb +2 -2
  61. data/mod/01_history/set/all/content_history.rb +3 -2
  62. data/mod/01_history/set/all/history.rb +57 -19
  63. data/mod/02_basic_types/set/all/rss.rb +5 -6
  64. data/mod/{05_standard → 02_basic_types}/set/type/html.rb +4 -3
  65. data/mod/02_basic_types/set/type/plain_text.rb +1 -1
  66. data/mod/02_basic_types/set/type/pointer.rb +7 -4
  67. data/mod/02_basic_types/spec/set/type/pointer_spec.rb +21 -17
  68. data/mod/03_machines/lib/card/machine.rb +33 -31
  69. data/mod/03_machines/lib/javascript/script_card_menu.js.coffee +2 -10
  70. data/mod/03_machines/lib/javascript/wagn.js.coffee +10 -10
  71. data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +87 -40
  72. data/mod/03_machines/lib/stylesheets/style_cards.scss +26 -28
  73. data/mod/03_machines/set/right/machine_output.rb +3 -3
  74. data/mod/03_machines/set/type/coffee_script.rb +6 -6
  75. data/mod/03_machines/set/type/css.rb +1 -1
  76. data/mod/03_machines/set/type/java_script.rb +5 -6
  77. data/mod/03_machines/spec/lib/shared_machine_examples.rb +3 -1
  78. data/mod/03_machines/spec/set/type/scss_spec.rb +9 -10
  79. data/mod/04_settings/lib/card/setting.rb +16 -14
  80. data/mod/04_settings/set/right/structure.rb +6 -0
  81. data/mod/04_settings/set/self/add_help.rb +1 -1
  82. data/mod/04_settings/set/self/autoname.rb +1 -1
  83. data/mod/04_settings/set/self/captcha.rb +1 -1
  84. data/mod/04_settings/set/self/default.rb +1 -1
  85. data/mod/04_settings/set/self/help.rb +1 -1
  86. data/mod/04_settings/set/self/input.rb +1 -1
  87. data/mod/04_settings/set/self/layout.rb +1 -1
  88. data/mod/04_settings/set/self/on_create.rb +1 -1
  89. data/mod/04_settings/set/self/on_delete.rb +1 -1
  90. data/mod/04_settings/set/self/on_update.rb +1 -1
  91. data/mod/04_settings/set/self/options.rb +1 -1
  92. data/mod/04_settings/set/self/options_label.rb +1 -1
  93. data/mod/04_settings/set/self/script.rb +1 -1
  94. data/mod/04_settings/set/self/structure.rb +1 -1
  95. data/mod/04_settings/set/self/style.rb +1 -1
  96. data/mod/04_settings/set/self/table_of_contents.rb +1 -1
  97. data/mod/04_settings/set/self/thanks.rb +1 -1
  98. data/mod/05_email/set/all/follow.rb +3 -21
  99. data/mod/05_email/set/all/notify.rb +20 -4
  100. data/mod/05_email/set/right/follow.rb +16 -18
  101. data/mod/05_email/set/self/follow.rb +1 -1
  102. data/mod/05_email/spec/set/all/follow_spec.rb +6 -13
  103. data/mod/05_standard/set/all/attach.rb +23 -9
  104. data/mod/05_standard/set/all/error.rb +5 -7
  105. data/mod/05_standard/set/all/event_viz.rb +10 -6
  106. data/mod/05_standard/set/all/links.rb +37 -13
  107. data/mod/05_standard/set/all/rich_html/content.rb +46 -18
  108. data/mod/05_standard/set/all/rich_html/editing.rb +29 -25
  109. data/mod/05_standard/set/all/rich_html/form.rb +17 -10
  110. data/mod/05_standard/set/all/rich_html/header.rb +26 -4
  111. data/mod/05_standard/set/all/rich_html/menu.rb +17 -34
  112. data/mod/05_standard/set/all/rich_html/modal.rb +50 -12
  113. data/mod/05_standard/set/all/rich_html/toolbar.rb +178 -186
  114. data/mod/05_standard/set/all/rich_html/wrapper.rb +44 -21
  115. data/mod/05_standard/set/rstar/rules.rb +43 -53
  116. data/mod/05_standard/set/self/all.rb +2 -1
  117. data/mod/05_standard/set/self/head.rb +2 -2
  118. data/mod/05_standard/set/self/signin.rb +18 -18
  119. data/mod/05_standard/set/self/stats.rb +14 -2
  120. data/mod/05_standard/set/type/search_type.rb +9 -4
  121. data/mod/05_standard/set/type/session.rb +12 -7
  122. data/mod/05_standard/set/type/set.rb +135 -18
  123. data/mod/05_standard/spec/chunk/include_spec.rb +15 -16
  124. data/mod/05_standard/spec/set/all/account_spec.rb +21 -21
  125. data/mod/05_standard/spec/set/all/event_viz_spec.rb +7 -7
  126. data/mod/05_standard/spec/set/all/history_spec.rb +54 -24
  127. data/mod/05_standard/spec/set/all/rich_html/editing_spec.rb +42 -40
  128. data/mod/05_standard/spec/set/rstar/rules_spec.rb +1 -1
  129. data/mod/05_standard/spec/set/type/search_type_spec.rb +9 -1
  130. data/mod/05_standard/spec/set/type/signup_spec.rb +42 -42
  131. data/mod/06_bootstrap/lib/stylesheets/bootstrap_cards.scss +6 -0
  132. data/mod/06_bootstrap/set/all/bootstrap/form.rb +4 -5
  133. data/mod/06_bootstrap/set/all/bootstrap/helper.rb +145 -0
  134. data/mod/06_bootstrap/set/all/rich_bootstrap.rb +0 -59
  135. data/spec/lib/card/action_spec.rb +1 -1
  136. data/spec/lib/card/log_spec.rb +7 -7
  137. data/spec/models/card/cardtype_spec.rb +1 -1
  138. data/spec/spec_helper.rb +1 -1
  139. metadata +31 -6
  140. data/mod/04_settings/set/self/comment.rb +0 -2
@@ -1,15 +1,15 @@
1
1
  # What is this?
2
- # The Machine module together with the MachineInput module implements a kind of observer pattern.
3
- # It handles a collection of input cards to generate a output card (default is a file card).
2
+ # The Machine module together with the MachineInput module implements a kind of observer pattern.
3
+ # It handles a collection of input cards to generate a output card (default is a file card).
4
4
  # If one of the input cards is changed the output card will be updated.
5
- # The classic example:
5
+ # The classic example:
6
6
  # A style card observes a collection of css and sccs card to generate a file card with a css file containg the assembled compressed css.
7
7
 
8
8
  # How to use it?
9
9
  # Include the Machine module in the card set that is supposed to produce the output card. If the output card should be autmatically updated when a input card is changed the input card has to be in a set that includes the MachineInput module.
10
10
  # The default machine
11
11
  # - uses its item cards as input cards or the card itself if there are no item cards;
12
- # can be changed by passing a block to collect_input_cards
12
+ # can be changed by passing a block to collect_input_cards
13
13
  # - takes the raw view of the input cards to generate the output;
14
14
  # can be changed by passing a block to machine_input (in the input card set)
15
15
  # - stores the output as a .txt file in the "+machine output" card;
@@ -18,27 +18,27 @@
18
18
 
19
19
  # How does it work?
20
20
  # Machine cards have a +machine input and a +machine output card. The +machine input card is a pointer to all input cards.
21
- # Including the MachineInput module creates an ":on => save" event that runs the machines of all cards that are linked to that card via the +machine input pointer.
21
+ # Including the MachineInput module creates an ":on => save" event that runs the machines of all cards that are linked to that card via the +machine input pointer.
22
22
 
23
23
 
24
24
 
25
25
  class Card
26
- module Machine
26
+ module Machine
27
27
  module ClassMethods
28
- attr_accessor :output_config
29
-
28
+ attr_accessor :output_config
29
+
30
30
  def collect_input_cards &block
31
31
  define_method :engine_input, &block
32
32
  end
33
-
33
+
34
34
  def prepare_machine_input &block
35
35
  define_method :before_engine, &block
36
36
  end
37
-
37
+
38
38
  def machine_engine &block
39
39
  define_method :engine, &block
40
40
  end
41
-
41
+
42
42
  def store_machine_output args={}, &block
43
43
  output_config.merge!(args)
44
44
  if block_given?
@@ -50,16 +50,16 @@ class Card
50
50
  def self.included(host_class)
51
51
  host_class.extend( ClassMethods )
52
52
  host_class.output_config = { :filetype => "txt" }
53
-
54
-
53
+
54
+
55
55
  if Codename[:machine_output] # for compatibility with old migrations
56
56
  host_class.card_accessor :machine_output, :type=>:file
57
57
  host_class.card_accessor :machine_input, :type => :pointer
58
-
58
+
59
59
  # define default machine behaviour
60
- host_class.collect_input_cards do
60
+ host_class.collect_input_cards do
61
61
  # traverse through all levels of pointers and
62
- # collect all item cards as input
62
+ # collect all item cards as input
63
63
  items = [self]
64
64
  new_input = []
65
65
  already_extended = {} # avoid loops
@@ -82,9 +82,10 @@ class Card
82
82
 
83
83
  host_class.prepare_machine_input {}
84
84
  host_class.machine_engine { |input| input }
85
- host_class.store_machine_output do |output|
85
+ host_class.store_machine_output do |output|
86
86
  file = Tempfile.new [ id, ".#{host_class.output_config[:filetype]}" ]
87
87
  file.write output
88
+ file.rewind
88
89
  Card::Auth.as_bot do
89
90
  p = machine_output_card
90
91
  p.attach = file
@@ -93,14 +94,15 @@ class Card
93
94
  file.close
94
95
  file.unlink
95
96
  end
96
-
97
+
98
+
97
99
  host_class.format do
98
100
  view :machine_output_url do |args|
99
101
  machine_output_url
100
102
  end
101
103
  end
102
-
103
- host_class.event "reset_machine_output_#{host_class.name.gsub(':','_')}".to_sym, :after => :store_subcards, :on => :save do
104
+
105
+ host_class.event "reset_machine_output_#{host_class.name.gsub(':','_')}".to_sym, :after => :store_subcards, :on => :save do
104
106
  reset_machine_output!
105
107
  end
106
108
  end
@@ -111,7 +113,7 @@ class Card
111
113
  output = input_item_cards.map do |input|
112
114
  unless input.kind_of? Card::Set::Type::Pointer
113
115
  if input.respond_to? :machine_input
114
- engine( input.machine_input )
116
+ engine( input.machine_input )
115
117
  else
116
118
  engine( input.format._render_raw )
117
119
  end
@@ -119,7 +121,7 @@ class Card
119
121
  end.select(&:present?).join( joint )
120
122
  after_engine output
121
123
  end
122
-
124
+
123
125
  def reset_machine_output!
124
126
  Auth.as_bot do
125
127
  moc = machine_output_card and moc.real? and moc.delete!
@@ -127,8 +129,8 @@ class Card
127
129
  update_input_card
128
130
  end
129
131
  end
130
-
131
-
132
+
133
+
132
134
  def update_machine_output
133
135
  if ok? :read and not was_already_locked = locked?
134
136
  Auth.as_bot do
@@ -140,19 +142,19 @@ class Card
140
142
  ensure
141
143
  unlock! unless was_already_locked
142
144
  end
143
-
145
+
144
146
  def lock_cache_key
145
147
  "UPDATE-LOCK:#{key}"
146
148
  end
147
-
149
+
148
150
  def locked?
149
151
  Card.cache.read lock_cache_key
150
152
  end
151
-
153
+
152
154
  def lock!
153
155
  Card.cache.write lock_cache_key, true
154
156
  end
155
-
157
+
156
158
  def unlock!
157
159
  Card.cache.write lock_cache_key, false
158
160
  end
@@ -168,16 +170,16 @@ class Card
168
170
  def machine_output_url
169
171
  ensure_machine_output
170
172
  machine_output_card.attach.url #(:default, :timestamp => false) # to get rid of additional number in url
171
- end
173
+ end
172
174
 
173
175
  def machine_output_path
174
176
  ensure_machine_output
175
177
  machine_output_card.attach.path
176
- end
178
+ end
177
179
 
178
180
  def ensure_machine_output
179
181
  if !output = fetch(:trait => :machine_output) or !output.selected_content_action_id
180
- update_machine_output
182
+ update_machine_output
181
183
  end
182
184
  end
183
185
  end
@@ -7,14 +7,6 @@ $(window).ready ->
7
7
  $('body').on 'click', '.toolbar .nav-pills > li', ->
8
8
  $(this).tab('show')
9
9
 
10
- $(document).on 'tap', '.card-header', (event) ->
11
- link = $(this).find('.card-menu > a')
12
- unless !link[0] or # no gear
13
- event.pageX - $(this).offset().left < $(this).width() / 2 # left half of header
10
+ if wagn.isTouchDevice()
11
+ $('.show-on-hover').removeClass('show-on-hover')
14
12
 
15
- link.click()
16
- event.preventDefault()
17
-
18
- $(document).on 'tap', 'body', (event) ->
19
- unless $(event.target).closest('.card-header')[0] or $(event.target).closest('.card-menu-link')[0]
20
- $('.card-menu .dropdown-toggle').dropdown('toggle')
@@ -52,10 +52,10 @@ jQuery.fn.extend {
52
52
  setSlotContent: (val) ->
53
53
  s = @slot()
54
54
  v = $(val)
55
- if v[0]
56
- if slotdata = s.attr 'data-slot'
57
- v.attr 'data-slot', slotdata if slotdata?
58
- else #simple text (not html)
55
+ unless v[0]
56
+ # if slotdata = s.attr 'data-slot'
57
+ # v.attr 'data-slot', slotdata if slotdata?
58
+ # else #simple text (not html)
59
59
  v = val
60
60
  s.replaceWith v
61
61
  v.trigger 'slotReady'
@@ -169,9 +169,9 @@ $(window).ready ->
169
169
  $('body').on 'loaded.bs.modal', null, (event) ->
170
170
  unless event.slotSuccessful
171
171
  wagn.initializeEditors $(event.target)
172
+ $(event.target).find(".card-slot").trigger("slotReady")
172
173
  event.slotSuccessful = true
173
174
 
174
-
175
175
  $('body').on 'ajax:error', '.slotter', (event, xhr) ->
176
176
  $(this).slotError xhr.status, xhr.responseText
177
177
 
@@ -327,11 +327,11 @@ $(window).ready ->
327
327
 
328
328
 
329
329
  # important: this prevents jquery-mobile from taking over everything
330
- $( document ).on "mobileinit", ->
331
- $.extend $.mobile , {
332
- autoInitializePage: false
333
- ajaxEnabled: false
334
- }
330
+ # $( document ).on "mobileinit", ->
331
+ # $.extend $.mobile , {
332
+ # #autoInitializePage: false
333
+ # #ajaxEnabled: false
334
+ # }
335
335
 
336
336
 
337
337
  newCaptcha = (form)->
@@ -4,6 +4,7 @@ window.wagn ||= {} #needed to run w/o *head. eg. jasmine
4
4
 
5
5
  $.extend wagn,
6
6
  editorContentFunctionMap: {
7
+ '.ace-editor-textarea' : -> ace_editor_content this[0]
7
8
  '.tinymce-textarea' : -> tinyMCE.get(@[0].id).getContent()
8
9
  '.pointer-select' : -> pointerContent @val()
9
10
  '.pointer-multiselect' : -> pointerContent @val()
@@ -54,7 +55,6 @@ $.extend wagn,
54
55
  position: "absolute"
55
56
  width: textarea.width()
56
57
  height: textarea.height()
57
- class: textarea.attr("class")
58
58
  ).insertBefore(textarea)
59
59
  textarea.css "visibility", "hidden"
60
60
  textarea.css "height", "0px"
@@ -69,10 +69,6 @@ $.extend wagn,
69
69
  editor.getSession().setUseSoftTabs true
70
70
  editor.setOptions maxLines: 30
71
71
 
72
- textarea.closest("form").submit ->
73
- textarea.val editor.getSession().getValue()
74
- return
75
-
76
72
  return
77
73
 
78
74
 
@@ -126,6 +122,19 @@ $.extend wagn,
126
122
  editor.append '<input type="hidden" value="CHOSEN" class="upload-card-content" name="' + contentFieldName + '">'
127
123
  # we add and remove the contentField to insure that nothing is added / updated when nothing is chosen.
128
124
 
125
+ isTouchDevice: ->
126
+ if 'ontouchstart' of window or window.DocumentTouch and document instanceof DocumentTouch
127
+ return true
128
+ else
129
+ return detectMobileBrowser()
130
+
131
+
132
+ # source for this method: detectmobilebrowsers.com
133
+ detectMobileBrowser = (userAgent) ->
134
+ userAgent = navigator.userAgent or navigator.vendor or window.opera
135
+ /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(userAgent) or /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0, 4))
136
+
137
+
129
138
 
130
139
  $(window).ready ->
131
140
 
@@ -186,7 +195,7 @@ $(window).ready ->
186
195
  type : 'PUT'
187
196
  data : 'card[content]=true'
188
197
 
189
- $('body').on 'click', '.toolbar-pin.active > a', (e) ->
198
+ $('body').on 'click', '.toolbar-pin.active', (e) ->
190
199
  e.preventDefault()
191
200
  $(this).blur()
192
201
  $('.toolbar-pin').removeClass('active').addClass('inactive')
@@ -194,7 +203,7 @@ $(window).ready ->
194
203
  type : 'PUT'
195
204
  data : 'card[content]=false'
196
205
 
197
- $('body').on 'click', '.toolbar-pin.inactive > a', (e) ->
206
+ $('body').on 'click', '.toolbar-pin.inactive', (e) ->
198
207
  e.preventDefault()
199
208
  $('.toolbar-pin').removeClass('inactive').addClass('active')
200
209
  $.ajax '/*toolbar_pinned',
@@ -202,6 +211,7 @@ $(window).ready ->
202
211
  data : 'card[content]=true'
203
212
 
204
213
 
214
+
205
215
  # following mod
206
216
  $('body').on 'click', '.btn-item-delete', ->
207
217
  $(this).find('.glyphicon').addClass("glyphicon-hourglass").removeClass("glyphicon-remove")
@@ -216,41 +226,73 @@ $(window).ready ->
216
226
  $(this).addClass("btn-primary").removeClass("btn-danger")
217
227
 
218
228
 
219
- $('body').on 'click', '.update-follow-link', (event) ->
220
- anchor = $(this)
221
- url = wagn.rootPath + '/' + anchor.data('card_key') + '.json?view=follow_status'
222
- modal = anchor.closest('.modal')
223
- modal.removeData()
224
- $.ajax url, {
225
- type : 'GET'
226
- dataType : 'json'
227
- success : (data) ->
228
- tags = $(modal).parent().find('.follow-link')
229
- tags.find('.follow-verb').html data.verb
230
- tags.attr 'href', data.path
231
- tags.attr 'title', data.title
232
- tags.data 'follow', data
233
- }
229
+ # modal mod
230
+
231
+ $('body').on 'hide.bs.modal', (event) ->
232
+ $(event.target).find('.modal-dialog > .modal-content').empty()
233
+ if $(event.target).attr('id') != 'modal-main-slot'
234
+ slot = $( event.target ).slot()
235
+ menu_slot = slot.find '.menu-slot:first'
236
+ url = wagn.rootPath + '/~' + slot.data('card-id')
237
+ params = { view: 'menu' }
238
+ params['is_main'] = true if slot.isMain()
234
239
 
235
- $('body').on 'click', '.follow-toggle', (event) ->
236
- anchor = $(this)
237
- url = wagn.rootPath + '/update/' + anchor.data('rule_name') + '.json'
238
- $.ajax url, {
239
- type : 'POST'
240
- dataType : 'json'
241
- data : {
242
- 'card[content]' : '[[' + anchor.data('follow').content + ']]'
243
- 'success[view]' : 'follow_status'
244
- 'success[id]' : anchor.data('card_key')
240
+ $.ajax url, {
241
+ type : 'GET'
242
+ data: params
243
+ success : (data) ->
244
+ menu_slot.replaceWith data
245
245
  }
246
- success : (data) ->
247
- tags = anchor.closest('.modal').parent().find('.follow-toggle')
248
- tags.find('.follow-verb').html data.verb
249
- tags.attr 'title', data.title
250
- tags.removeClass( 'follow-toggle-on follow-toggle-off').addClass data.class
251
- tags.data 'follow', data
252
- }
253
- event.preventDefault() # Prevent link from following its href
246
+
247
+ # for slot in $('.card-slot')
248
+ # menu_slot = $(slot).find '.menu-slot:first'
249
+ # if menu_slot.size() > 0
250
+ # url = wagn.rootPath + '/~' + $(slot).data('card-id')
251
+ # params = { view: 'menu' }
252
+ # params['is_main'] = true if $(slot).isMain()
253
+ #
254
+ # $.ajax url, {
255
+ # type: 'GET'
256
+ # data: params
257
+ # success : (data) ->
258
+ # menu_slot.replaceWith data
259
+ # }
260
+
261
+ # $('body').on 'click', '.update-follow-link', (event) ->
262
+ # anchor = $(this)
263
+ # url = wagn.rootPath + '/' + anchor.data('card_key') + '.json?view=follow_status'
264
+ # modal = anchor.closest('.modal')
265
+ # modal.removeData()
266
+ # $.ajax url, {
267
+ # type : 'GET'
268
+ # dataType : 'json'
269
+ # success : (data) ->
270
+ # tags = $(modal).parent().find('.follow-link')
271
+ # tags.find('.follow-verb').html data.verb
272
+ # tags.attr 'href', data.path
273
+ # tags.attr 'title', data.title
274
+ # tags.data 'follow', data
275
+ # }
276
+
277
+ # $('body').on 'click', '.follow-toggle', (event) ->
278
+ # anchor = $(this)
279
+ # url = wagn.rootPath + '/update/' + anchor.data('rule_name') + '.json'
280
+ # $.ajax url, {
281
+ # type : 'POST'
282
+ # dataType : 'json'
283
+ # data : {
284
+ # 'card[content]' : '[[' + anchor.data('follow').content + ']]'
285
+ # 'success[view]' : 'follow_status'
286
+ # 'success[id]' : anchor.data('card_key')
287
+ # }
288
+ # success : (data) ->
289
+ # tags = anchor.closest('.modal').parent().find('.follow-toggle')
290
+ # tags.find('.follow-verb').html data.verb
291
+ # tags.attr 'title', data.title
292
+ # tags.removeClass( 'follow-toggle-on follow-toggle-off').addClass data.class
293
+ # tags.data 'follow', data
294
+ # }
295
+ # event.preventDefault() # Prevent link from following its href
254
296
 
255
297
 
256
298
  # permissions mod
@@ -317,6 +359,11 @@ pointerContent = (vals) ->
317
359
  list = $.map $.makeArray(vals), (v)-> if v then '[[' + v + ']]'
318
360
  $.makeArray(list).join "\n"
319
361
 
362
+ ace_editor_content = (element) ->
363
+ ace_div = $(element).siblings(".ace_editor")
364
+ editor = ace.edit(ace_div[0])
365
+ editor.getSession().getValue()
366
+
320
367
  #navbox mod
321
368
  reqIndex = 0 #prevents race conditions
322
369
 
@@ -54,11 +54,19 @@ Choosing (b) will mean your CSS will not be affected by automated updates.
54
54
  span.header-icon {
55
55
  margin: 0px 5px;
56
56
  }
57
+
57
58
  }
58
59
  .toggler {
59
60
  display: inline-block;
60
61
  position: relative;
61
62
  }
63
+ .type-info {
64
+ margin-right: 10px;
65
+ }
66
+ }
67
+
68
+ .card-subheader {
69
+ width: 100%;
62
70
  }
63
71
 
64
72
  .menu-slot {
@@ -99,7 +107,7 @@ Choosing (b) will mean your CSS will not be affected by automated updates.
99
107
  }
100
108
 
101
109
  .vertical-card-menu .dropdown-menu {
102
- z-index: 2;
110
+ //z-index: 2;
103
111
  }
104
112
 
105
113
  .horizontal-card-menu {
@@ -124,14 +132,25 @@ Choosing (b) will mean your CSS will not be affected by automated updates.
124
132
 
125
133
  .navbar.toolbar {
126
134
  margin-bottom: 0;
135
+ .collapse > .navbar-form.navbar-left {
136
+ //padding-left: 0px;
137
+ }
127
138
  }
128
139
 
129
- .toolbar {
130
- .navbar-text span.glyphicon, span.menu-item-label {
131
- margin-left: 5px;
132
- }
140
+ .navbar-divide {
141
+ margin-left: 30px;
142
+ border-left: 1px solid;
133
143
  }
134
144
 
145
+ .card-subheader {
146
+ height: 30px;
147
+ text-align: left;
148
+ font-size: 13px;
149
+ padding: 6px 15px 3px 15px;
150
+ > .card-title.panel-title {
151
+ font-size: 13px;
152
+ }
153
+ }
135
154
 
136
155
  /*-- closed and labeled views --*/
137
156
 
@@ -265,29 +284,8 @@ in your skin. Choosing (b) will mean your CSS will not be affected by automated
265
284
 
266
285
  /* related view (used by many menu items, such as "referred to by") */
267
286
 
268
- .related-view {
269
- > .card-frame, & {
270
- > .card-body {
271
- background: #bbb;
272
- padding: 35px 5px 5px 5px;
273
- > .ALL {
274
- background: #fff;
275
- > .card-header {
276
- background: #ddd;
277
- padding: 5px;
278
- color: #000;
279
- }
280
- > .card-body {
281
- padding: 8px 2%;
282
- }
283
- }
284
- }
285
- > a.close-related-view {
286
- color: inherit;
287
- margin-right: 5px;
288
- margin-top: 5px;
289
- }
290
- }
287
+ .ALL.related-view > .card-frame > .card-body {
288
+ padding: 0;
291
289
  }
292
290
 
293
291
  /* navboxes */