Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

renamed the project

  • Loading branch information...
commit af96d673641804bec54ba4d10f404259541a87a2 1 parent 2108a2e
@jejacks0n jejacks0n authored
Showing with 1,242 additions and 1,256 deletions.
  1. +1 −1  .rvmrc
  2. +1 −1  Rakefile
  3. 0  app/assets/images/{carmenta → mercury}/clippy.png
  4. 0  app/assets/images/{carmenta → mercury}/loading-dark.gif
  5. 0  app/assets/images/{carmenta → mercury}/loading-light.gif
  6. 0  app/assets/images/{carmenta → mercury}/toolbar/editable/buttons.png
  7. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/_expander.png
  8. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/_pressed.png
  9. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/historypanel.png
  10. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/insertcharacter.png
  11. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/insertlink.png
  12. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/insertmedia.png
  13. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/inserttable.png
  14. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/inspectorpanel.png
  15. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/notespanel.png
  16. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/objectspanel.png
  17. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/preview.png
  18. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/redo.png
  19. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/save.png
  20. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/todospanel.png
  21. 0  app/assets/images/{carmenta → mercury}/toolbar/primary/undo.png
  22. 0  app/assets/images/{carmenta → mercury}/toolbar/snippetable/buttons.png
  23. +1 −1  app/assets/javascripts/application.js
  24. +0 −3  app/assets/javascripts/carmenta/regions/snippetable.snippet.js.coffee
  25. +0 −61 app/assets/javascripts/carmenta/toolbar.js.coffee
  26. +16 −16 app/assets/javascripts/{carmenta → mercury}/config.js.coffee
  27. +5 −5 app/assets/javascripts/{carmenta → mercury}/dialog.js.coffee
  28. +5 −5 app/assets/javascripts/{carmenta → mercury}/dialogs/common_dialogs.js.coffee
  29. +4 −4 app/assets/javascripts/{carmenta → mercury}/history_buffer.js.coffee
  30. +28 −28 app/assets/javascripts/{carmenta/carmenta_editor.js.coffee → mercury/mercury_editor.js.coffee}
  31. +21 −21 app/assets/javascripts/{carmenta → mercury}/modal.js.coffee
  32. +13 −13 app/assets/javascripts/{carmenta → mercury}/modals/common_modals.js.coffee
  33. +3 −3 app/assets/javascripts/{carmenta → mercury}/palette.js.coffee
  34. +13 −13 app/assets/javascripts/{carmenta → mercury}/panel.js.coffee
  35. +31 −31 app/assets/javascripts/{carmenta → mercury}/regions/editable.js.coffee
  36. +4 −4 app/assets/javascripts/{carmenta → mercury}/regions/editable.selection.js.coffee
  37. +31 −31 app/assets/javascripts/{carmenta → mercury}/regions/snippetable.js.coffee
  38. +3 −0  app/assets/javascripts/mercury/regions/snippetable.snippet.js.coffee
  39. +4 −4 app/assets/javascripts/{carmenta → mercury}/regions/snippetable.toolbar.js.coffee
  40. +3 −3 app/assets/javascripts/{carmenta → mercury}/select.js.coffee
  41. +3 −3 app/assets/javascripts/{carmenta → mercury}/statusbar.js.coffee
  42. +1 −1  app/assets/javascripts/{carmenta → mercury}/table.js.coffee
  43. +18 −18 app/assets/javascripts/{carmenta → mercury}/toolbar.button.js.coffee
  44. +5 −5 app/assets/javascripts/{carmenta → mercury}/toolbar.button_group.js.coffee
  45. +7 −7 app/assets/javascripts/{carmenta → mercury}/toolbar.expander.js.coffee
  46. +61 −0 app/assets/javascripts/mercury/toolbar.js.coffee
  47. 0  app/assets/javascripts/{carmenta → mercury}/utility.js.coffee
  48. +1 −1  app/assets/javascripts/{carmenta → mercury}/websocket.js.coffee
  49. +0 −324 app/assets/stylesheets/carmenta/toolbar.scss
  50. 0  app/assets/stylesheets/{carmenta → mercury}/dialog.scss
  51. +1 −1  app/assets/stylesheets/{carmenta/carmenta_editor.scss → mercury/mercury_editor.scss}
  52. +14 −18 app/assets/stylesheets/{carmenta → mercury}/modal.scss
  53. +1 −1  app/assets/stylesheets/{carmenta → mercury}/statusbar.scss
  54. +324 −0 app/assets/stylesheets/mercury/toolbar.scss
  55. +1 −1  app/controllers/{carmenta_controller.rb → mercury_controller.rb}
  56. +0 −6 app/views/carmenta/modals/htmleditor.html.haml
  57. +2 −2 app/views/layouts/toolbar.html.haml
  58. +3 −3 app/views/{carmenta → mercury}/modals/character.html.haml
  59. +6 −0 app/views/mercury/modals/htmleditor.html.haml
  60. +4 −4 app/views/{carmenta → mercury}/modals/link.html.haml
  61. +4 −4 app/views/{carmenta → mercury}/modals/media.html.haml
  62. +1 −1  app/views/{carmenta → mercury}/modals/sanitizer.html.haml
  63. +4 −4 app/views/{carmenta → mercury}/modals/table.html.haml
  64. 0  app/views/{carmenta → mercury}/palettes/backcolor.html.haml
  65. 0  app/views/{carmenta → mercury}/palettes/forecolor.html.haml
  66. 0  app/views/{carmenta → mercury}/panels/history.html.haml
  67. 0  app/views/{carmenta → mercury}/panels/notes.html.haml
  68. 0  app/views/{carmenta → mercury}/panels/snippets.html.haml
  69. 0  app/views/{carmenta → mercury}/panels/todos.html.haml
  70. 0  app/views/{carmenta → mercury}/selects/formatblock.html.haml
  71. 0  app/views/{carmenta → mercury}/selects/style.html.haml
  72. +16 −16 app/views/{carmenta → mercury}/show.html.haml
  73. +1 −1  config.ru
  74. +1 −1  config/application.rb
  75. +3 −3 config/database.yml
  76. +1 −1  config/environment.rb
  77. +1 −1  config/environments/development.rb
  78. +1 −1  config/environments/production.rb
  79. +1 −1  config/environments/test.rb
  80. +1 −1  config/initializers/secret_token.rb
  81. +2 −2 config/initializers/session_store.rb
  82. +6 −6 config/routes.rb
  83. +0 −10 spec/javascripts/carmenta/_table_spec.js.coffee
  84. +0 −50 spec/javascripts/carmenta/palette_spec.js.coffee
  85. +0 −50 spec/javascripts/carmenta/select_spec.js.coffee
  86. +0 −78 spec/javascripts/carmenta/statusbar_spec.js.coffee
  87. +0 −67 spec/javascripts/carmenta/toolbar.button_group_spec.js.coffee
  88. +0 −132 spec/javascripts/carmenta/toolbar_spec.js.coffee
  89. 0  spec/javascripts/{carmenta/regions/snippetable_spec.js.coffee → mercury/_mercury_editor_spec.js.coffee}
  90. 0  spec/javascripts/{carmenta → mercury}/_modal_spec.js.coffee
  91. 0  spec/javascripts/{carmenta/regions/snippetable.snippet_spec.js.coffee → mercury/_table_spec.js.coffee}
  92. +38 −38 spec/javascripts/{carmenta → mercury}/dialog_spec.js.coffee
  93. +6 −6 spec/javascripts/{carmenta → mercury}/history_buffer_spec.js.coffee
  94. +50 −0 spec/javascripts/mercury/palette_spec.js.coffee
  95. +26 −26 spec/javascripts/{carmenta → mercury}/panel_spec.js.coffee
  96. 0  spec/javascripts/{carmenta → mercury}/regions/editable.selection_spec.js.coffee
  97. 0  spec/javascripts/{carmenta → mercury}/regions/editable_spec.js.coffee
  98. 0  ...cripts/{carmenta/_carmenta_editor_spec.js.coffee → mercury/regions/snippetable.snippet_spec.js.coffee}
  99. 0  spec/javascripts/mercury/regions/snippetable_spec.js.coffee
  100. +50 −0 spec/javascripts/mercury/select_spec.js.coffee
  101. +78 −0 spec/javascripts/mercury/statusbar_spec.js.coffee
  102. +67 −0 spec/javascripts/mercury/toolbar.button_group_spec.js.coffee
  103. +61 −61 spec/javascripts/{carmenta → mercury}/toolbar.button_spec.js.coffee
  104. +29 −29 spec/javascripts/{carmenta → mercury}/toolbar.expander_spec.js.coffee
  105. +132 −0 spec/javascripts/mercury/toolbar_spec.js.coffee
  106. +1 −1  spec/javascripts/{carmenta → mercury}/utility_spec.js.coffee
  107. +0 −7 spec/javascripts/templates/carmenta/statusbar.html
  108. +0 −10 spec/javascripts/templates/carmenta/toolbar.html
  109. 0  spec/javascripts/templates/{carmenta → mercury}/dialog.html
  110. +1 −1  spec/javascripts/templates/{carmenta → mercury}/palette.html
  111. +1 −1  spec/javascripts/templates/{carmenta → mercury}/panel.html
  112. +1 −1  spec/javascripts/templates/{carmenta → mercury}/select.html
  113. +7 −0 spec/javascripts/templates/mercury/statusbar.html
  114. 0  spec/javascripts/templates/{carmenta → mercury}/toolbar.button.html
  115. 0  spec/javascripts/templates/{carmenta → mercury}/toolbar.button_group.html
  116. +2 −2 spec/javascripts/templates/{carmenta → mercury}/toolbar.expander.html
  117. +10 −0 spec/javascripts/templates/mercury/toolbar.html
View
2  .rvmrc
@@ -1,4 +1,4 @@
-rvm 1.9.2@carmenta
+rvm 1.9.2@mercury
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
View
2  Rakefile
@@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__)
-Carmenta::Application.load_tasks
+Mercury::Application.load_tasks
View
0  app/assets/images/carmenta/clippy.png → app/assets/images/mercury/clippy.png
File renamed without changes
View
0  app/assets/images/carmenta/loading-dark.gif → app/assets/images/mercury/loading-dark.gif
File renamed without changes
View
0  app/assets/images/carmenta/loading-light.gif → app/assets/images/mercury/loading-light.gif
File renamed without changes
View
0  ...sets/images/carmenta/toolbar/editable/buttons.png → ...ssets/images/mercury/toolbar/editable/buttons.png
File renamed without changes
View
0  ...ets/images/carmenta/toolbar/primary/_expander.png → ...sets/images/mercury/toolbar/primary/_expander.png
File renamed without changes
View
0  ...sets/images/carmenta/toolbar/primary/_pressed.png → ...ssets/images/mercury/toolbar/primary/_pressed.png
File renamed without changes
View
0  .../images/carmenta/toolbar/primary/historypanel.png → ...s/images/mercury/toolbar/primary/historypanel.png
File renamed without changes
View
0  ...ages/carmenta/toolbar/primary/insertcharacter.png → ...mages/mercury/toolbar/primary/insertcharacter.png
File renamed without changes
View
0  ...ts/images/carmenta/toolbar/primary/insertlink.png → ...ets/images/mercury/toolbar/primary/insertlink.png
File renamed without changes
View
0  ...s/images/carmenta/toolbar/primary/insertmedia.png → ...ts/images/mercury/toolbar/primary/insertmedia.png
File renamed without changes
View
0  ...s/images/carmenta/toolbar/primary/inserttable.png → ...ts/images/mercury/toolbar/primary/inserttable.png
File renamed without changes
View
0  ...mages/carmenta/toolbar/primary/inspectorpanel.png → ...images/mercury/toolbar/primary/inspectorpanel.png
File renamed without changes
View
0  ...ts/images/carmenta/toolbar/primary/notespanel.png → ...ets/images/mercury/toolbar/primary/notespanel.png
File renamed without changes
View
0  .../images/carmenta/toolbar/primary/objectspanel.png → ...s/images/mercury/toolbar/primary/objectspanel.png
File renamed without changes
View
0  ...ssets/images/carmenta/toolbar/primary/preview.png → ...assets/images/mercury/toolbar/primary/preview.png
File renamed without changes
View
0  app/assets/images/carmenta/toolbar/primary/redo.png → app/assets/images/mercury/toolbar/primary/redo.png
File renamed without changes
View
0  app/assets/images/carmenta/toolbar/primary/save.png → app/assets/images/mercury/toolbar/primary/save.png
File renamed without changes
View
0  ...ts/images/carmenta/toolbar/primary/todospanel.png → ...ets/images/mercury/toolbar/primary/todospanel.png
File renamed without changes
View
0  app/assets/images/carmenta/toolbar/primary/undo.png → app/assets/images/mercury/toolbar/primary/undo.png
File renamed without changes
View
0  ...s/images/carmenta/toolbar/snippetable/buttons.png → ...ts/images/mercury/toolbar/snippetable/buttons.png
File renamed without changes
View
2  app/assets/javascripts/application.js
@@ -4,6 +4,6 @@
*
*= require_self
*= require vendor
- *= require carmenta/carmenta_editor
+ *= require mercury/mercury_editor
*= require_tree .
*---------------------------------------------------------------------------*/
View
3  app/assets/javascripts/carmenta/regions/snippetable.snippet.js.coffee
@@ -1,3 +0,0 @@
-class Carmenta.Regions.Snippetable.Snippet
-
- constructor: ->
View
61 app/assets/javascripts/carmenta/toolbar.js.coffee
@@ -1,61 +0,0 @@
-class Carmenta.Toolbar
-
- constructor: (@options = {}) ->
- @build()
- @bindEvents()
-
-
- build: ->
- @element = $('<div>', {class: 'carmenta-toolbar-container', style: 'width:10000px'})
- @element.appendTo($(@options.appendTo).get(0) ? 'body')
-
- for toolbarName, buttons of Carmenta.config.toolbars
- continue if buttons._custom
- toolbar = $('<div>', {class: "carmenta-toolbar carmenta-#{toolbarName}-toolbar"}).appendTo(@element)
- container = $('<div>', {class: 'carmenta-toolbar-button-container'}).appendTo(toolbar)
-
- for buttonName, options of buttons
- @buildButton(buttonName, options).appendTo(container)
-
- if container.css('white-space') == 'nowrap'
- expander = new Carmenta.Toolbar.Expander(toolbarName, {appendTo: toolbar, for: container})
- expander.appendTo(@element)
-
- toolbar.addClass('disabled') unless toolbarName == 'primary'
-
- @element.css({width: '100%'})
-
-
- buildButton: (name, options) ->
- return $('<span>') if name == '_custom'
- switch $.type(options)
-
- when 'array' # button
- [title, summary, handled] = options
- new Carmenta.Toolbar.Button(name, title, summary, handled, {appendDialogsTo: @element})
-
- when 'object' # button group
- group = new Carmenta.Toolbar.ButtonGroup(name, options)
- for a, o of options
- @buildButton(a, o).appendTo(group) unless a == '_context'
- group
-
- when 'string' # separator
- $('<hr>', {class: "carmenta-#{if options == '-' then 'line-separator' else 'separator'}"})
-
- else throw "Unknown button structure -- please provide an array, object, or string for #{name}."
-
-
- bindEvents: ->
- Carmenta.bind 'region:focused', (event, options) =>
- @element.find(".carmenta-#{options.region.type}-toolbar").removeClass('disabled')
-
- Carmenta.bind 'region:blurred', (event, options) =>
- @element.find(".carmenta-#{options.region.type}-toolbar").addClass('disabled')
-
- @element.click -> Carmenta.trigger('hide:dialogs')
- @element.mousedown (event) -> event.preventDefault()
-
-
- height: ->
- @element.outerHeight()
View
32 app/assets/javascripts/carmenta/config.js.coffee → app/assets/javascripts/mercury/config.js.coffee
@@ -1,4 +1,4 @@
-Carmenta.config =
+Mercury.config =
# Ignored Links
#
@@ -79,27 +79,27 @@ Carmenta.config =
undo: ['Undo', 'Undo your last action']
redo: ['Redo', 'Redo your last action']
sep: ' '
- insertlink: ['Link', 'Insert Link', {modal: '/carmenta/modals/link', regions: ['editable']}]
- insertmedia: ['Media', 'Insert Media (images and videos)', {modal: '/carmenta/modals/media', regions: ['editable']}]
- inserttable: ['Table', 'Insert Table', {modal: '/carmenta/modals/table', regions: ['editable']}]
- insertcharacter: ['Character', 'Special Characters', {modal: '/carmenta/modals/character', regions: ['editable']}]
- objectspanel: ['Snippet', 'Snippet Panel', {panel: -> "/carmenta/panels/snippets"}]
+ insertlink: ['Link', 'Insert Link', {modal: '/mercury/modals/link', regions: ['editable']}]
+ insertmedia: ['Media', 'Insert Media (images and videos)', {modal: '/mercury/modals/media', regions: ['editable']}]
+ inserttable: ['Table', 'Insert Table', {modal: '/mercury/modals/table', regions: ['editable']}]
+ insertcharacter: ['Character', 'Special Characters', {modal: '/mercury/modals/character', regions: ['editable']}]
+ objectspanel: ['Snippet', 'Snippet Panel', {panel: -> "/mercury/panels/snippets"}]
sep2: ' '
- historypanel: ['History', 'Page Version History', {panel: -> "/carmenta/panels/history"}]
+ historypanel: ['History', 'Page Version History', {panel: -> "/mercury/panels/history"}]
sep3: ' '
- notespanel: ['Notes', 'Page Notes', {panel: '/carmenta/panels/notes'}]
- todospanel: ['Todos', 'Page Todos', {panel: '/carmenta/panels/todos'}]
+ notespanel: ['Notes', 'Page Notes', {panel: '/mercury/panels/notes'}]
+ todospanel: ['Todos', 'Page Todos', {panel: '/mercury/panels/todos'}]
editable:
predefined:
- style: ['Style', null, {select: '/carmenta/selects/style', preload: true}]
+ style: ['Style', null, {select: '/mercury/selects/style', preload: true}]
sep1: ' '
- formatblock: ['Block Format', null, {select: '/carmenta/selects/formatblock', preload: true}]
+ formatblock: ['Block Format', null, {select: '/mercury/selects/formatblock', preload: true}]
sep2: '-'
colors:
- backcolor: ['Background Color', null, {palette: '/carmenta/palettes/backcolor', context: true, preload: true}]
+ backcolor: ['Background Color', null, {palette: '/mercury/palettes/backcolor', context: true, preload: true}]
sep1: ' '
- forecolor: ['Text Color', null, {palette: '/carmenta/palettes/forecolor', context: true, preload: true}]
+ forecolor: ['Text Color', null, {palette: '/mercury/palettes/forecolor', context: true, preload: true}]
sep2: '-'
decoration:
bold: ['Bold', null, {context: true}]
@@ -167,7 +167,7 @@ Carmenta.config =
horizontalrule: (selection) -> selection.replace('<hr/>')
htmleditor: ->
- Carmenta.modal '/carmenta/modals/htmleditor', {
+ Mercury.modal '/mercury/modals/htmleditor', {
title: 'HTML Editor',
fullHeight: true,
handler: 'htmleditor'
@@ -183,7 +183,7 @@ Carmenta.config =
#
# You can see some examples of contexts in:
#
- # Carmenta.Toolbar.Button.contexts
+ # Mercury.Toolbar.Button.contexts
# and
- # Carmenta.Toolbar.ButtonGroup.contexts
+ # Mercury.Toolbar.ButtonGroup.contexts
#
View
10 app/assets/javascripts/carmenta/dialog.js.coffee → app/assets/javascripts/mercury/dialog.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Dialog
+class Mercury.Dialog
constructor: (@url, @name, @options = {}) ->
@button = @options.for
@@ -9,7 +9,7 @@ class Carmenta.Dialog
build: ->
- @element = $('<div>', {class: "carmenta-dialog carmenta-#{@name}-dialog loading", style: 'display:none'})
+ @element = $('<div>', {class: "mercury-dialog mercury-#{@name}-dialog loading", style: 'display:none'})
@element.appendTo($(@options.appendTo).get(0) ? 'body')
@@ -30,7 +30,7 @@ class Carmenta.Dialog
show: ->
- Carmenta.trigger('hide:dialogs', @)
+ Mercury.trigger('hide:dialogs', @)
@visible = true
if @loaded
@element.css({width: 'auto', height: 'auto'})
@@ -60,12 +60,12 @@ class Carmenta.Dialog
$.ajax @url, {
success: (data) =>
@loadContent(data)
- Carmenta.dialogHandlers[@name].call(@) if Carmenta.dialogHandlers[@name]
+ Mercury.dialogHandlers[@name].call(@) if Mercury.dialogHandlers[@name]
callback() if callback
error: =>
@hide()
@button.removeClass('pressed') if @button
- alert("Carmenta was unable to load #{@url} for the #{@name} dialog.")
+ alert("Mercury was unable to load #{@url} for the #{@name} dialog.")
}
View
10 ...scripts/carmenta/dialogs/common_dialogs.js.coffee → ...ascripts/mercury/dialogs/common_dialogs.js.coffee
@@ -1,11 +1,11 @@
-Carmenta.dialogHandlers =
+Mercury.dialogHandlers =
backcolor: ->
@element.find('.picker, .last-picked').click (event) =>
color = $(event.target).css('background-color')
@element.find('.last-picked').css({background: color})
@button.css({backgroundColor: color})
- Carmenta.trigger('action', {action: 'backcolor', value: color})
+ Mercury.trigger('action', {action: 'backcolor', value: color})
forecolor: ->
@@ -13,16 +13,16 @@ Carmenta.dialogHandlers =
color = $(event.target).css('background-color')
@element.find('.last-picked').css({background: color})
@button.css({backgroundColor: color})
- Carmenta.trigger('action', {action: 'forecolor', value: color})
+ Mercury.trigger('action', {action: 'forecolor', value: color})
formatblock: ->
@element.find('[data-tag]').click (event) =>
tag = $(event.target).data('tag')
- Carmenta.trigger('action', {action: 'formatblock', value: tag})
+ Mercury.trigger('action', {action: 'formatblock', value: tag})
style: ->
@element.find('[data-class]').click (event) =>
className = $(event.target).attr('class')
- Carmenta.trigger('action', {action: 'style', value: className})
+ Mercury.trigger('action', {action: 'style', value: className})
View
8 ...ets/javascripts/carmenta/history_buffer.js.coffee → ...sets/javascripts/mercury/history_buffer.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.HistoryBuffer
+class Mercury.HistoryBuffer
constructor: (@maxLength = 200) ->
@index = 0
@@ -6,15 +6,15 @@ class Carmenta.HistoryBuffer
push: (item) ->
- return if @stack[@index] && @stack[@index].replace(/<em class="carmenta-marker"><\/em>/g, '') == item.replace(/<em class="carmenta-marker"><\/em>/g, '') # if it's the same, don't do anything
+ return if @stack[@index] && @stack[@index].replace(/<em class="mercury-marker"><\/em>/g, '') == item.replace(/<em class="mercury-marker"><\/em>/g, '') # if it's the same, don't do anything
@stack = @stack[0...@index + 1]
@stack.push(item)
@stack.shift() if @stack.length > @maxLength
@index = @stack.length - 1
- #Carmenta.log(@stack.length, '------------------------------------------------------------')
- #Carmenta.log(@stack)
+ #Mercury.log(@stack.length, '------------------------------------------------------------')
+ #Mercury.log(@stack)
undo: ->
View
56 ...ts/javascripts/carmenta/carmenta_editor.js.coffee → ...sets/javascripts/mercury/mercury_editor.js.coffee
@@ -17,10 +17,10 @@
#= require_tree ./modals
#= require ./config
-class CarmentaEditor
+class MercuryEditor
constructor: (@options = {}) ->
- throw "CarmentaEditor is unsupported in this client. Supported browsers are chrome 10+, firefix 4+, and safari 5+." unless Carmenta.supported
+ throw "MercuryEditor is unsupported in this client. Supported browsers are chrome 10+, firefix 4+, and safari 5+." unless Mercury.supported
@regions = []
@initializeInterface()
@@ -28,13 +28,13 @@ class CarmentaEditor
initializeInterface: ->
@focusableElement = $('<input>', {type: 'text', style: 'position:absolute;opacity:0'}).appendTo('body')
- @iframe = $('<iframe>', {class: 'carmenta-iframe', seamless: 'true', frameborder: '0', src: 'about:blank'})
+ @iframe = $('<iframe>', {class: 'mercury-iframe', seamless: 'true', frameborder: '0', src: 'about:blank'})
@iframe.load => @initializeFrame()
@iframe.attr('src', @iframeSrc())
@iframe.appendTo('body')
- @toolbar = new Carmenta.Toolbar(@options)
- @statusbar = new Carmenta.Statusbar(@options)
+ @toolbar = new Mercury.Toolbar(@options)
+ @statusbar = new Mercury.Statusbar(@options)
initializeFrame: ->
@@ -49,11 +49,11 @@ class CarmentaEditor
@iframe.css({visibility: 'visible'})
catch error
- alert("CarmentaEditor failed to load: #{error}\n\nPlease try refreshing.")
+ alert("MercuryEditor failed to load: #{error}\n\nPlease try refreshing.")
initializeRegions: ->
- @buildRegion($(region)) for region in $('.carmenta-region', @document)
+ @buildRegion($(region)) for region in $('.mercury-region', @document)
for region in @regions
if region.focus
region.focus()
@@ -63,29 +63,29 @@ class CarmentaEditor
buildRegion: (region) ->
try
type = region.data('type').titleize()
- @regions.push(new Carmenta.Regions[type](region, {window: @iframe.get(0).contentWindow}))
+ @regions.push(new Mercury.Regions[type](region, {window: @iframe.get(0).contentWindow}))
catch error
- alert(error) if Carmenta.debug
+ alert(error) if Mercury.debug
alert("Region type is malformed, no data-type provided, or \"#{type}\" is unknown.")
finalizeInterface: ->
- Carmenta.editor = @
- Carmenta.hijackLinks(@document)
+ Mercury.editor = @
+ Mercury.hijackLinks(@document)
@resize()
bindEvents: ->
- Carmenta.bind 'initialize:frame', => setTimeout(@initializeFrame, 100)
- Carmenta.bind 'focus:frame', => @iframe.focus()
- Carmenta.bind 'focus:window', => setTimeout((=> @focusableElement.focus()), 10)
+ Mercury.bind 'initialize:frame', => setTimeout(@initializeFrame, 100)
+ Mercury.bind 'focus:frame', => @iframe.focus()
+ Mercury.bind 'focus:window', => setTimeout((=> @focusableElement.focus()), 10)
@document.mousedown (event) ->
- Carmenta.trigger('hide:dialogs')
- Carmenta.trigger('unfocus:regions') unless $(event.target).closest('.carmenta-region').get(0) == Carmenta.region.element.get(0)
+ Mercury.trigger('hide:dialogs')
+ Mercury.trigger('unfocus:regions') unless $(event.target).closest('.mercury-region').get(0) == Mercury.region.element.get(0)
$(window).resize => @resize()
- window.onbeforeunload = Carmenta.beforeUnload
+ window.onbeforeunload = Mercury.beforeUnload
resize: ->
@@ -94,7 +94,7 @@ class CarmentaEditor
toolbarHeight = @toolbar.height()
statusbarHeight = @statusbar.height()
- Carmenta.displayRect = {top: toolbarHeight, left: 0, width: width, height: height - statusbarHeight - toolbarHeight}
+ Mercury.displayRect = {top: toolbarHeight, left: 0, width: width, height: height - statusbarHeight - toolbarHeight}
@iframe.css {
top: toolbarHeight,
@@ -102,7 +102,7 @@ class CarmentaEditor
height: height - statusbarHeight - toolbarHeight
}
- Carmenta.trigger('resize')
+ Mercury.trigger('resize')
iframeSrc: ->
@@ -110,8 +110,8 @@ class CarmentaEditor
-# Carmenta static properties and utlity methods
-Carmenta =
+# Mercury static properties and utlity methods
+Mercury =
Regions: {}
version: 1.0
@@ -126,29 +126,29 @@ Carmenta =
beforeUnload: ->
- if Carmenta.changes && !Carmenta.silent
+ if Mercury.changes && !Mercury.silent
return "You have unsaved changes. Are you sure you want to leave without saving them first?"
hijackLinks: (document) ->
for link in $('a', document)
- if (link.target == '' || link.target == '_self') and !$(link).closest('.carmenta-region').length
+ if (link.target == '' || link.target == '_self') and !$(link).closest('.mercury-region').length
$(link).attr('target', '_top')
refresh: ->
- Carmenta.trigger('refresh')
+ Mercury.trigger('refresh')
bind: (eventName, callback) ->
- $(document).bind("carmenta:#{eventName}", callback)
+ $(document).bind("mercury:#{eventName}", callback)
trigger: (eventName, arguments...) ->
- Carmenta.log(eventName, arguments)
- $(document).trigger("carmenta:#{eventName}", arguments)
+ Mercury.log(eventName, arguments)
+ $(document).trigger("mercury:#{eventName}", arguments)
log: ->
- if Carmenta.debug && console
+ if Mercury.debug && console
try console.debug(arguments) catch e
View
42 app/assets/javascripts/carmenta/modal.js.coffee → app/assets/javascripts/mercury/modal.js.coffee
@@ -1,13 +1,13 @@
-Carmenta.modal = (url, options) ->
- Carmenta.modal.show(url, options)
- return Carmenta.modal
+Mercury.modal = (url, options) ->
+ Mercury.modal.show(url, options)
+ return Mercury.modal
-$.extend Carmenta.modal, {
+$.extend Mercury.modal, {
minWidth: 400
show: (@url, @options = {}) ->
- Carmenta.trigger('focus:window')
+ Mercury.trigger('focus:window')
@initialize()
if @visible then @update() else @appear()
@@ -20,14 +20,14 @@ $.extend Carmenta.modal, {
build: ->
- @element = $('<div>', {class: 'carmenta-modal loading'})
- @element.html('<h1 class="carmenta-modal-title"><span></span><a>&times;</a></h1><div class="carmenta-modal-content-container"><div class="carmenta-modal-content"></div></div>')
+ @element = $('<div>', {class: 'mercury-modal loading'})
+ @element.html('<h1 class="mercury-modal-title"><span></span><a>&times;</a></h1><div class="mercury-modal-content-container"><div class="mercury-modal-content"></div></div>')
- @overlay = $('<div>', {class: 'carmenta-modal-overlay'})
+ @overlay = $('<div>', {class: 'mercury-modal-overlay'})
- @titleElement = @element.find('.carmenta-modal-title')
- @contentContainerElement = @element.find('.carmenta-modal-content-container')
- @contentElement = @element.find('.carmenta-modal-content')
+ @titleElement = @element.find('.mercury-modal-title')
+ @contentContainerElement = @element.find('.mercury-modal-content-container')
+ @contentElement = @element.find('.mercury-modal-content')
@element.appendTo($(@options.appendTo).get(0) ? 'body')
@overlay.appendTo($(@options.appendTo).get(0) ? 'body')
@@ -36,8 +36,8 @@ $.extend Carmenta.modal, {
bindEvents: ->
- Carmenta.bind 'refresh', => @resize(true)
- Carmenta.bind 'resize', => @position()
+ Mercury.bind 'refresh', => @resize(true)
+ Mercury.bind 'resize', => @position()
@overlay.click => @hide()
@@ -80,7 +80,7 @@ $.extend Carmenta.modal, {
@contentElement.css({height: height - titleHeight, overflow: 'visible'})
controlHeight = if @contentControl.length then @contentControl.outerHeight() else 0
@contentPane.css({height: height - titleHeight - controlHeight - 40})
- @contentPane.find('.carmenta-modal-pane').css({width: width - 40})
+ @contentPane.find('.mercury-modal-pane').css({width: width - 40})
else
@contentElement.css({height: height - titleHeight, overflow: 'auto'})
@@ -103,7 +103,7 @@ $.extend Carmenta.modal, {
@contentElement.css({height: height - titleHeight, overflow: 'visible'})
controlHeight = if @contentControl.length then @contentControl.outerHeight() else 0
@contentPane.css({height: height - titleHeight - controlHeight - 40})
- @contentPane.find('.carmenta-modal-pane').css({width: width - 40})
+ @contentPane.find('.mercury-modal-pane').css({width: width - 40})
else
@contentElement.css({height: height - titleHeight, overflow: 'auto'})
@@ -129,7 +129,7 @@ $.extend Carmenta.modal, {
success: (data) => @loadContent(data)
error: =>
@hide()
- alert("Carmenta was unable to load #{@url} for the modal.")
+ alert("Mercury was unable to load #{@url} for the modal.")
}
@@ -142,12 +142,12 @@ $.extend Carmenta.modal, {
@contentElement.css({display: 'none', visibility: 'hidden'})
# for complex modal content, we provide panes and controls
- @contentPane = @element.find('.carmenta-modal-pane-container')
- @contentControl = @element.find('.carmenta-modal-controls')
+ @contentPane = @element.find('.mercury-modal-pane-container')
+ @contentControl = @element.find('.mercury-modal-controls')
@options.afterLoad.call(@) if @options.afterLoad
- if @options.handler && Carmenta.modalHandlers[@options.handler]
- Carmenta.modalHandlers[@options.handler].call(@)
+ if @options.handler && Mercury.modalHandlers[@options.handler]
+ Mercury.modalHandlers[@options.handler].call(@)
@resize()
@@ -162,7 +162,7 @@ $.extend Carmenta.modal, {
hide: ->
- Carmenta.trigger('focus:frame')
+ Mercury.trigger('focus:frame')
@element.hide()
@overlay.hide()
@reset()
View
26 ...vascripts/carmenta/modals/common_modals.js.coffee → ...avascripts/mercury/modals/common_modals.js.coffee
@@ -1,14 +1,14 @@
-Carmenta.modalHandlers =
+Mercury.modalHandlers =
htmleditor: ->
# fill the text area with the content
- @element.find('textarea').val(Carmenta.region.html())
+ @element.find('textarea').val(Mercury.region.html())
# replace the contents on form submit
@element.find('form').submit (event) =>
event.preventDefault()
value = @element.find('textarea').val().replace(/\n/g, '')
- Carmenta.trigger('action', {action: 'replaceHTML', value: value})
+ Mercury.trigger('action', {action: 'replaceHTML', value: value})
@hide()
@@ -25,12 +25,12 @@ Carmenta.modalHandlers =
# fill the existing bookmark select
bookmarkSelect = @element.find('#existing_bookmark')
- for link in $('a[name]', Carmenta.editor.document)
+ for link in $('a[name]', Mercury.editor.document)
bookmarkSelect.append($('<option>', {value: $(link).attr('name')}).text($(link).text()))
# get the selection and initialize its information into the form
- if Carmenta.region && Carmenta.region.selection
- selection = Carmenta.region.selection()
+ if Mercury.region && Mercury.region.selection
+ selection = Mercury.region.selection()
# if we're editing a link prefill the information
container = selection.commonAncestor(true)
@@ -91,10 +91,10 @@ Carmenta.modalHandlers =
value = "<a #{attrs.join(' ')}>"
if existingLink
- Carmenta.trigger('action', {action: 'replaceLink', value: value, node: existingLink.get(0)})
+ Mercury.trigger('action', {action: 'replaceLink', value: value, node: existingLink.get(0)})
else
- Carmenta.trigger('action', {action: 'insertLink', value: "#{value}#{content}</a>"})
- Carmenta.modal.hide()
+ Mercury.trigger('action', {action: 'insertLink', value: "#{value}#{content}</a>"})
+ Mercury.modal.hide()
insertmedia: ->
@@ -129,11 +129,11 @@ Carmenta.modalHandlers =
}
value = $('<iframe>', attrs)
- Carmenta.trigger('action', {action: 'insertHTML', value: value})
- Carmenta.modal.hide()
+ Mercury.trigger('action', {action: 'insertHTML', value: value})
+ Mercury.modal.hide()
insertcharacter: ->
@element.find('.character').click ->
- Carmenta.trigger('action', {action: 'insertHTML', value: "&#{$(@).attr('data-entity')};"})
- Carmenta.modal.hide()
+ Mercury.trigger('action', {action: 'insertHTML', value: "&#{$(@).attr('data-entity')};"})
+ Mercury.modal.hide()
View
6 app/assets/javascripts/carmenta/palette.js.coffee → app/assets/javascripts/mercury/palette.js.coffee
@@ -1,16 +1,16 @@
-class Carmenta.Palette extends Carmenta.Dialog
+class Mercury.Palette extends Mercury.Dialog
constructor: (@url, @name, @options = {}) ->
super
build: ->
- @element = $('<div>', {class: "carmenta-palette carmenta-#{@name}-palette loading", style: 'display:none'})
+ @element = $('<div>', {class: "mercury-palette mercury-#{@name}-palette loading", style: 'display:none'})
@element.appendTo($(@options.appendTo).get(0) ? 'body')
bindEvents: ->
- Carmenta.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
+ Mercury.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
super
View
26 app/assets/javascripts/carmenta/panel.js.coffee → app/assets/javascripts/mercury/panel.js.coffee
@@ -1,20 +1,20 @@
-class Carmenta.Panel extends Carmenta.Dialog
+class Mercury.Panel extends Mercury.Dialog
constructor: (@url, @name, @options = {}) ->
super
build: ->
- @element = $('<div>', {class: 'carmenta-panel loading', style: 'display:none;'})
+ @element = $('<div>', {class: 'mercury-panel loading', style: 'display:none;'})
@titleElement = $("<h1>#{@options.title}</h1>").appendTo(@element)
- @paneElement = $('<div>', {class: 'carmenta-panel-pane'}).appendTo(@element)
+ @paneElement = $('<div>', {class: 'mercury-panel-pane'}).appendTo(@element)
@element.appendTo($(@options.appendTo).get(0) ? 'body');
bindEvents: ->
- Carmenta.bind 'resize', => @position(@visible)
- Carmenta.bind 'hide:panels', (event, panel) =>
+ Mercury.bind 'resize', => @position(@visible)
+ Mercury.bind 'hide:panels', (event, panel) =>
unless panel == @
@button.removeClass('pressed')
@hide()
@@ -25,7 +25,7 @@ class Carmenta.Panel extends Carmenta.Dialog
show: ->
- Carmenta.trigger('hide:panels', @)
+ Mercury.trigger('hide:panels', @)
super
@@ -49,19 +49,19 @@ class Carmenta.Panel extends Carmenta.Dialog
@element.css({display: 'block', visibility: 'hidden'})
offset = @element.offset()
elementWidth = @element.width()
- height = Carmenta.displayRect.height - 16
+ height = Mercury.displayRect.height - 16
paneHeight = height - @titleElement.outerHeight()
@paneElement.css({height: paneHeight, overflowY: if paneHeight < 30 then 'hidden' else 'auto'})
- left = Carmenta.displayRect.width - elementWidth - 20 unless @moved
+ left = Mercury.displayRect.width - elementWidth - 20 unless @moved
left = 8 if left <= 8
- if @pinned || elementWidth + offset.left > Carmenta.displayRect.width - 20
- left = Carmenta.displayRect.width - elementWidth - 20
+ if @pinned || elementWidth + offset.left > Mercury.displayRect.width - 20
+ left = Mercury.displayRect.width - elementWidth - 20
@element.css {
- top: Carmenta.displayRect.top + 8,
+ top: Mercury.displayRect.top + 8,
left: left,
height: height,
display: if keepVisible then 'block' else 'none',
@@ -88,10 +88,10 @@ class Carmenta.Panel extends Carmenta.Dialog
scroll: false,
addClasses: false,
iframeFix: true,
- containment: [8, 0, Carmenta.displayRect.width - elementWidth - 20, 0] #[x1, y1, x2, y2]
+ containment: [8, 0, Mercury.displayRect.width - elementWidth - 20, 0] #[x1, y1, x2, y2]
stop: =>
left = @element.offset().left
@moved = true
- @pinned = if left > Carmenta.displayRect.width - elementWidth - 30 then true else false
+ @pinned = if left > Mercury.displayRect.width - elementWidth - 30 then true else false
return true
}
View
62 ...s/javascripts/carmenta/regions/editable.js.coffee → ...ts/javascripts/mercury/regions/editable.js.coffee
@@ -1,23 +1,23 @@
#= require_self
#= require ./editable.selection
-class Carmenta.Regions.Editable
+class Mercury.Regions.Editable
type = 'editable'
constructor: (@element, @options = {}) ->
- Carmenta.log('building editable', @element, @options)
+ Mercury.log('building editable', @element, @options)
@window = @options.window
@document = @window.document
@type = @element.data('type')
- @history = new Carmenta.HistoryBuffer()
+ @history = new Mercury.HistoryBuffer()
@build()
@bindEvents()
@pushHistory()
build: ->
- @element.addClass('carmenta-region')
+ @element.addClass('mercury-region')
# mozilla: set some initial content so everything works correctly
@html('&nbsp;') if $.browser.mozilla && @html() == ''
@@ -33,35 +33,35 @@ class Carmenta.Regions.Editable
@element.get(0).contentEditable = true
# make all snippets not editable
- element.contentEditable = false for element in @element.find('.carmenta-snippet')
+ element.contentEditable = false for element in @element.find('.mercury-snippet')
# add the basic editor settings to the document (only once)
- unless @document.carmentaEditing
+ unless @document.mercuryEditing
@document.execCommand('styleWithCSS', false, false)
@document.execCommand('insertBROnReturn', false, true)
@document.execCommand('enableInlineTableEditing', false, false)
@document.execCommand('enableObjectResizing', false, false)
- @document.carmentaEditing = true
+ @document.mercuryEditing = true
bindEvents: ->
- Carmenta.bind 'mode', (event, options) =>
+ Mercury.bind 'mode', (event, options) =>
@togglePreview() if options.mode == 'preview'
- Carmenta.bind 'focus:frame', =>
+ Mercury.bind 'focus:frame', =>
return if @previewing
- return unless Carmenta.region == @
+ return unless Mercury.region == @
@focus()
- Carmenta.bind 'action', (event, options) =>
+ Mercury.bind 'action', (event, options) =>
return if @previewing
- return unless Carmenta.region == @
+ return unless Mercury.region == @
@execCommand(options.action, options) if options.action
@element.bind 'paste', =>
return if @previewing
- return unless Carmenta.region == @
- Carmenta.changes = true
+ return unless Mercury.region == @
+ Mercury.changes = true
html = @html()
event.preventDefault() if @specialContainer
setTimeout((=> @handlePaste(html)), 1)
@@ -72,12 +72,12 @@ class Carmenta.Regions.Editable
@element.focus =>
return if @previewing
- Carmenta.region = @
- Carmenta.trigger('region:focused', {region: @})
+ Mercury.region = @
+ Mercury.trigger('region:focused', {region: @})
@element.blur =>
return if @previewing
- Carmenta.trigger('region:blurred', {region: @})
+ Mercury.trigger('region:blurred', {region: @})
@element.click (event) =>
$(event.target).closest('a').attr('target', '_top') if @previewing
@@ -85,11 +85,11 @@ class Carmenta.Regions.Editable
@element.mouseup =>
return if @previewing
@pushHistory()
- Carmenta.trigger('region:update', {region: @})
+ Mercury.trigger('region:update', {region: @})
@element.keydown (event) =>
return if @previewing
- Carmenta.changes = true
+ Mercury.changes = true
switch event.keyCode
when 90 # undo / redo
@@ -148,7 +148,7 @@ class Carmenta.Regions.Editable
@element.keyup =>
return if @previewing
- Carmenta.trigger('region:update', {region: @})
+ Mercury.trigger('region:update', {region: @})
html: (value = null, includeMarker = false) ->
@@ -171,28 +171,28 @@ class Carmenta.Regions.Editable
selection: ->
- return new Carmenta.Regions.Editable.Selection(@window.getSelection(), @document)
+ return new Mercury.Regions.Editable.Selection(@window.getSelection(), @document)
togglePreview: ->
if @previewing
@previewing = false
@element.get(0).contentEditable = true
- @element.addClass('carmenta-region').removeClass('carmenta-region-preview')
+ @element.addClass('mercury-region').removeClass('mercury-region-preview')
@element.css({overflow: 'auto'})
- @element.focus() if Carmenta.region == @
+ @element.focus() if Mercury.region == @
else
@previewing = true
@element.get(0).contentEditable = false
- @element.addClass('carmenta-region-preview').removeClass('carmenta-region')
+ @element.addClass('mercury-region-preview').removeClass('mercury-region')
@element.css({overflow: @element.data('originalOverflow')})
@element.blur()
- Carmenta.trigger('region:blurred', {region: @})
+ Mercury.trigger('region:blurred', {region: @})
focus: ->
@element.focus()
- Carmenta.trigger('region:update', {region: @})
+ Mercury.trigger('region:update', {region: @})
path: ->
@@ -214,7 +214,7 @@ class Carmenta.Regions.Editable
prePasteHTML = prePasteHTML.replace(/^\<br\>/, '')
# remove any regions that might have been pasted
- @element.find('.carmenta-region').remove()
+ @element.find('.mercury-region').remove()
# handle pasting from ms office etc
html = @html()
@@ -225,7 +225,7 @@ class Carmenta.Regions.Editable
@execCommand('insertHTML', {value: cleaned})
catch error
@html(prePasteHTML)
- Carmenta.modal '/carmenta/modals/sanitizer', {
+ Mercury.modal '/mercury/modals/sanitizer', {
title: 'HTML Sanitizer (Starring Clippy)',
afterLoad: -> @element.find('textarea').val(cleaned.replace(/<br\/>/g, '\n'))
}
@@ -235,10 +235,10 @@ class Carmenta.Regions.Editable
@element.focus()
@pushHistory() unless action == 'undo' || action == 'redo'
- Carmenta.log('execCommand', action, options.value)
+ Mercury.log('execCommand', action, options.value)
# use a custom handler if there's one, otherwise use execCommand
- if handler = Carmenta.config.behaviors[action] || Carmenta.Regions.Editable.actions[action]
+ if handler = Mercury.config.behaviors[action] || Mercury.Regions.Editable.actions[action]
handler.call(@, @selection(), options)
else
sibling = @element.get(0).previousSibling if action == 'indent'
@@ -275,7 +275,7 @@ class Carmenta.Regions.Editable
# Custom handled actions (eg. things that execCommand doesn't do, or doesn't do well)
-Carmenta.Regions.Editable.actions =
+Mercury.Regions.Editable.actions =
undo: -> @html(@history.undo())
View
8 ...pts/carmenta/regions/editable.selection.js.coffee → ...ipts/mercury/regions/editable.selection.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Regions.Editable.Selection
+class Mercury.Regions.Editable.Selection
constructor: (@selection, @context) ->
return unless @selection.rangeCount >= 1
@@ -29,7 +29,7 @@ class Carmenta.Regions.Editable.Selection
selectMarker: (context) ->
- markers = context.find('em.carmenta-marker')
+ markers = context.find('em.mercury-marker')
return unless markers.length
range = @context.createRange()
@@ -45,8 +45,8 @@ class Carmenta.Regions.Editable.Selection
placeMarker: ->
return unless @range
- @startMarker = $('<em class="carmenta-marker"/>', @context).get(0)
- @endMarker = $('<em class="carmenta-marker"/>', @context).get(0)
+ @startMarker = $('<em class="mercury-marker"/>', @context).get(0)
+ @endMarker = $('<em class="mercury-marker"/>', @context).get(0)
# put a single marker (the end)
rangeEnd = @range.cloneRange()
View
62 ...avascripts/carmenta/regions/snippetable.js.coffee → ...javascripts/mercury/regions/snippetable.js.coffee
@@ -1,17 +1,17 @@
#= require_self
#= require ./snippetable.snippet
-class Carmenta.Regions.Snippetable
+class Mercury.Regions.Snippetable
type = 'snippetable'
constructor: (@element, @options = {}) ->
- Carmenta.log('building snippetable', @element)
+ Mercury.log('building snippetable', @element)
@window = @options.window
@document = @window.document
@type = @element.data('type')
- @history = new Carmenta.HistoryBuffer()
- @toolbar = new Carmenta.Regions.Snippetable.Toolbar(@element, @document)
+ @history = new Mercury.HistoryBuffer()
+ @toolbar = new Mercury.Regions.Snippetable.Toolbar(@element, @document)
@build()
@bindEvents()
@pushHistory()
@@ -23,35 +23,35 @@ class Carmenta.Regions.Snippetable
bindEvents: ->
- Carmenta.bind 'mode', (event, options) =>
+ Mercury.bind 'mode', (event, options) =>
@togglePreview() if options.mode == 'preview'
- Carmenta.bind 'unfocus:regions', (event) =>
- if Carmenta.region == @
+ Mercury.bind 'unfocus:regions', (event) =>
+ if Mercury.region == @
@element.removeClass('focus')
@element.sortable('destroy')
- Carmenta.trigger('region:blurred', {region: @})
+ Mercury.trigger('region:blurred', {region: @})
- Carmenta.bind 'focus:window', (event) =>
- if Carmenta.region == @
+ Mercury.bind 'focus:window', (event) =>
+ if Mercury.region == @
@element.removeClass('focus')
@element.sortable('destroy')
- Carmenta.trigger('region:blurred', {region: @})
+ Mercury.trigger('region:blurred', {region: @})
- Carmenta.bind 'focus:frame', =>
+ Mercury.bind 'focus:frame', =>
return if @previewing
- return unless Carmenta.region == @
+ return unless Mercury.region == @
@focus()
- Carmenta.bind 'action', (event, options) =>
+ Mercury.bind 'action', (event, options) =>
return if @previewing
- return unless Carmenta.region == @
+ return unless Mercury.region == @
@execCommand(options.action, options) if options.action
$(@document).keydown (event) =>
return if @previewing
- return unless Carmenta.region == @
- Carmenta.changes = true
+ return unless Mercury.region == @
+ Mercury.changes = true
switch event.keyCode
when 90 # undo / redo
@@ -67,12 +67,12 @@ class Carmenta.Regions.Snippetable
@element.mouseup =>
return if @previewing
@focus()
- Carmenta.trigger('region:focused', {region: @})
+ Mercury.trigger('region:focused', {region: @})
@element.mousemove (event) =>
return if @previewing
- return unless Carmenta.region == @
- @snippet = $(event.target).closest('.carmenta-snippet')
+ return unless Mercury.region == @
+ @snippet = $(event.target).closest('.mercury-snippet')
if @snippet.length
@snippet.mouseout => @toolbar.hide()
@toolbar.show(@snippet)
@@ -87,11 +87,11 @@ class Carmenta.Regions.Snippetable
#handle: @toolbar.element,
scroll: false, #scrolling is buggy
containment: 'parent',
- items: '.carmenta-snippet',
+ items: '.mercury-snippet',
opacity: .4,
revert: 100,
tolerance: 'pointer',
- connectWith: '.carmenta-region[data-type=snippetable]',
+ connectWith: '.mercury-region[data-type=snippetable]',
beforeStop: =>
@toolbar.hide(true)
return true
@@ -105,14 +105,14 @@ class Carmenta.Regions.Snippetable
if @previewing
@previewing = false
@makeSortable()
- @element.addClass('carmenta-region').removeClass('carmenta-region-preview')
- @element.focus() if Carmenta.region == @
+ @element.addClass('mercury-region').removeClass('mercury-region-preview')
+ @element.focus() if Mercury.region == @
else
@previewing = true
@element.sortable('destroy')
- @element.addClass('carmenta-region-preview').removeClass('carmenta-region')
+ @element.addClass('mercury-region-preview').removeClass('mercury-region')
@element.blur()
- Carmenta.trigger('region:blurred', {region: @})
+ Mercury.trigger('region:blurred', {region: @})
html: (value = null) ->
@@ -128,7 +128,7 @@ class Carmenta.Regions.Snippetable
focus: ->
- Carmenta.region = @
+ Mercury.region = @
@makeSortable()
@element.addClass('focus')
@@ -139,16 +139,16 @@ class Carmenta.Regions.Snippetable
execCommand: (action, options = {}) ->
@focus()
- Carmenta.log('execCommand', action, options.value)
+ Mercury.log('execCommand', action, options.value)
- if handler = Carmenta.Regions.Snippetable.actions[action]
- Carmenta.changes = true
+ if handler = Mercury.Regions.Snippetable.actions[action]
+ Mercury.changes = true
handler.call(@, options)
@pushHistory() unless action == 'undo' || action == 'redo'
-Carmenta.Regions.Snippetable.actions =
+Mercury.Regions.Snippetable.actions =
undo: -> @html(@history.undo())
View
3  app/assets/javascripts/mercury/regions/snippetable.snippet.js.coffee
@@ -0,0 +1,3 @@
+class Mercury.Regions.Snippetable.Snippet
+
+ constructor: ->
View
8 ...ts/carmenta/regions/snippetable.toolbar.js.coffee → ...pts/mercury/regions/snippetable.toolbar.js.coffee
@@ -1,14 +1,14 @@
-class Carmenta.Regions.Snippetable.Toolbar extends Carmenta.Toolbar
+class Mercury.Regions.Snippetable.Toolbar extends Mercury.Toolbar
constructor: (@region, @document, @options = {}) ->
super(@options)
build: ->
- @element = $('<div>', {class: 'carmenta-toolbar carmenta-snippetable-toolbar', style: 'display:none'})
+ @element = $('<div>', {class: 'mercury-toolbar mercury-snippetable-toolbar', style: 'display:none'})
@element.appendTo($(@options.appendTo).get(0) ? 'body')
- for buttonName, options of Carmenta.config.toolbars.snippetable
+ for buttonName, options of Mercury.config.toolbars.snippetable
@buildButton(buttonName, options).appendTo(@element)
@@ -27,7 +27,7 @@ class Carmenta.Regions.Snippetable.Toolbar extends Carmenta.Toolbar
position: ->
offset = @snippet.offset()
- top = offset.top + Carmenta.displayRect.top - $(@document).scrollTop() - @height() + 5
+ top = offset.top + Mercury.displayRect.top - $(@document).scrollTop() - @height() + 5
left = offset.left - $(@document).scrollLeft()
@element.css {
View
6 app/assets/javascripts/carmenta/select.js.coffee → app/assets/javascripts/mercury/select.js.coffee
@@ -1,16 +1,16 @@
-class Carmenta.Select extends Carmenta.Dialog
+class Mercury.Select extends Mercury.Dialog
constructor: (@url, @name, @options = {}) ->
super
build: ->
- @element = $('<div>', {class: "carmenta-select carmenta-#{@name}-select loading", style: 'display:none'})
+ @element = $('<div>', {class: "mercury-select mercury-#{@name}-select loading", style: 'display:none'})
@element.appendTo($(@options.appendTo).get(0) ? 'body')
bindEvents: ->
- Carmenta.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
+ Mercury.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
super
View
6 app/assets/javascripts/carmenta/statusbar.js.coffee → app/assets/javascripts/mercury/statusbar.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Statusbar
+class Mercury.Statusbar
constructor: (@options = {}) ->
@build()
@@ -6,11 +6,11 @@ class Carmenta.Statusbar
build: ->
- @element = $('<div>', {class: 'carmenta-statusbar'}).appendTo($(@options.appendTo).get(0) ? 'body')
+ @element = $('<div>', {class: 'mercury-statusbar'}).appendTo($(@options.appendTo).get(0) ? 'body')
bindEvents: ->
- Carmenta.bind 'region:update', (event, options) =>
+ Mercury.bind 'region:update', (event, options) =>
@setPath(options.region.path()) if options.region && $.type(options.region.path) == 'function'
View
2  app/assets/javascripts/carmenta/table.js.coffee → app/assets/javascripts/mercury/table.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Table
+class Mercury.Table
constructor: (@element) ->
# `labelTest:`
View
36 ...ets/javascripts/carmenta/toolbar.button.js.coffee → ...sets/javascripts/mercury/toolbar.button.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Toolbar.Button
+class Mercury.Toolbar.Button
constructor: (@name, @title, @summary = null, @types = [], @options = {}) ->
@build()
@@ -7,8 +7,8 @@ class Carmenta.Toolbar.Button
build: ->
- @element = $('<div>', {title: @summary ? @title, class: "carmenta-button carmenta-#{@name}-button"}).html("<em>#{@title}</em>")
- @element.data('expander', "<div class=\"carmenta-expander-button\" data-button=\"#{@name}\"><em></em><span>#{@title}</span></div>")
+ @element = $('<div>', {title: @summary ? @title, class: "mercury-button mercury-#{@name}-button"}).html("<em>#{@title}</em>")
+ @element.data('expander', "<div class=\"mercury-expander-button\" data-button=\"#{@name}\"><em></em><span>#{@title}</span></div>")
@handled = []
dialogOptions = {title: @summary || @title, preload: @types.preload, appendTo: @options.appendDialogsTo || 'body', for: @element}
@@ -28,23 +28,23 @@ class Carmenta.Toolbar.Button
@handled[type] = if mixed == true then @name else mixed
when 'context'
- @handled[type] = if $.isFunction(mixed) then mixed else Carmenta.Toolbar.Button.contexts[@name]
+ @handled[type] = if $.isFunction(mixed) then mixed else Mercury.Toolbar.Button.contexts[@name]
when 'palette'
- @element.addClass("carmenta-button-palette")
+ @element.addClass("mercury-button-palette")
url = if $.isFunction(mixed) then mixed.call(@, @name) else mixed
- @handled[type] = new Carmenta.Palette(url, @name, dialogOptions)
+ @handled[type] = new Mercury.Palette(url, @name, dialogOptions)
when 'select'
- @element.addClass("carmenta-button-select").find('em').html(@title)
+ @element.addClass("mercury-button-select").find('em').html(@title)
url = if $.isFunction(mixed) then mixed.call(@, @name) else mixed
- @handled[type] = new Carmenta.Select(url, @name, dialogOptions)
+ @handled[type] = new Mercury.Select(url, @name, dialogOptions)
when 'panel'
- @element.addClass('carmenta-button-panel')
+ @element.addClass('mercury-button-panel')
url = if $.isFunction(mixed) then mixed.call(@, @name) else mixed
@handled['toggle'] = true
- @handled[type] = new Carmenta.Panel(url, @name, dialogOptions)
+ @handled[type] = new Mercury.Panel(url, @name, dialogOptions)
when 'modal'
@handled[type] = if $.isFunction(mixed) then mixed.apply(@, @name) else mixed
@@ -53,7 +53,7 @@ class Carmenta.Toolbar.Button
bindEvents: ->
- Carmenta.bind 'region:update', (event, options) =>
+ Mercury.bind 'region:update', (event, options) =>
if @handled.context && options.region && $.type(options.region.currentElement) == 'function'
element = options.region.currentElement()
if element.length && @handled.context.call(@, element, options.region.element)
@@ -63,14 +63,14 @@ class Carmenta.Toolbar.Button
else
@element.removeClass('active')
- Carmenta.bind 'region:focused', (event, options) =>
+ Mercury.bind 'region:focused', (event, options) =>
if @handled.regions && options.region && options.region.type
if @handled.regions.indexOf(options.region.type) > -1
@element.removeClass('disabled')
else
@element.addClass('disabled')
- Carmenta.bind 'region:blurred', (event, options) =>
+ Mercury.bind 'region:blurred', (event, options) =>
@element.addClass('disabled') if @handled.regions
@element.mousedown (event) =>
@@ -91,18 +91,18 @@ class Carmenta.Toolbar.Button
when 'mode'
handled = true
- Carmenta.trigger('mode', {mode: mixed})
+ Mercury.trigger('mode', {mode: mixed})
when 'modal'
- Carmenta.modal(@handled.modal, {title: @summary || @title, handler: @name})
+ Mercury.modal(@handled.modal, {title: @summary || @title, handler: @name})
when 'palette', 'select', 'panel'
event.stopPropagation()
handled = true
@handled[type].toggle()
- Carmenta.trigger('action', {action: @name}) unless handled
- Carmenta.trigger('focus:frame')
+ Mercury.trigger('action', {action: @name}) unless handled
+ Mercury.trigger('focus:frame')
togglePressed: ->
@@ -111,7 +111,7 @@ class Carmenta.Toolbar.Button
# Button contexts
-Carmenta.Toolbar.Button.contexts =
+Mercury.Toolbar.Button.contexts =
backcolor: (node) -> @element.css('background-color', node.css('background-color'))
View
10 ...vascripts/carmenta/toolbar.button_group.js.coffee → ...avascripts/mercury/toolbar.button_group.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Toolbar.ButtonGroup
+class Mercury.Toolbar.ButtonGroup
constructor: (@name, @options = {}) ->
@build()
@@ -7,14 +7,14 @@ class Carmenta.Toolbar.ButtonGroup
build: ->
- @element = $('<div>', {class: "carmenta-button-group carmenta-#{@name}-group"})
+ @element = $('<div>', {class: "mercury-button-group mercury-#{@name}-group"})
if @options._context
@element.addClass('disabled')
bindEvents: ->
- Carmenta.bind 'region:update', (event, options) =>
- context = Carmenta.Toolbar.ButtonGroup.contexts[@name]
+ Mercury.bind 'region:update', (event, options) =>
+ context = Mercury.Toolbar.ButtonGroup.contexts[@name]
if context
if options.region && $.type(options.region.currentElement) == 'function'
element = options.region.currentElement()
@@ -26,6 +26,6 @@ class Carmenta.Toolbar.ButtonGroup
# ButtonGroup contexts
-Carmenta.Toolbar.ButtonGroup.contexts =
+Mercury.Toolbar.ButtonGroup.contexts =
table: (node, region) -> !!node.closest('table', region).length
View
14 ...s/javascripts/carmenta/toolbar.expander.js.coffee → ...ts/javascripts/mercury/toolbar.expander.js.coffee
@@ -1,4 +1,4 @@
-class Carmenta.Toolbar.Expander extends Carmenta.Palette
+class Mercury.Toolbar.Expander extends Mercury.Palette
constructor: (@name, @options) ->
@container = @options.for
@@ -9,21 +9,21 @@ class Carmenta.Toolbar.Expander extends Carmenta.Palette
build: ->
@container.css({whiteSpace: 'normal'})
- @trigger = $('<div>', {class: 'carmenta-toolbar-expander'}).appendTo($(@options.appendTo).get(0) ? 'body')
- @element = $('<div>', {class: "carmenta-palette carmenta-expander carmenta-#{@name}-expander", style: 'display:none'})
+ @trigger = $('<div>', {class: 'mercury-toolbar-expander'}).appendTo($(@options.appendTo).get(0) ? 'body')
+ @element = $('<div>', {class: "mercury-palette mercury-expander mercury-#{@name}-expander", style: 'display:none'})
@windowResize()
bindEvents: ->
- Carmenta.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
- Carmenta.bind 'resize', => @windowResize()
+ Mercury.bind 'hide:dialogs', (event, dialog) => @hide() unless dialog == @
+ Mercury.bind 'resize', => @windowResize()
super
@trigger.click (event) =>
event.stopPropagation()
hiddenButtons = []
- for button in @container.find('.carmenta-button')
+ for button in @container.find('.mercury-button')
button = $(button)
hiddenButtons.push(button.data('expander')) if button.position().top > 5
@@ -32,7 +32,7 @@ class Carmenta.Toolbar.Expander extends Carmenta.Palette
@element.click (event) =>
buttonName = $(event.target).closest('[data-button]').data('button')
- button = @container.find(".carmenta-#{buttonName}-button")
+ button = @container.find(".mercury-#{buttonName}-button")
button.click()
View
61 app/assets/javascripts/mercury/toolbar.js.coffee
@@ -0,0 +1,61 @@
+class Mercury.Toolbar
+
+ constructor: (@options = {}) ->
+ @build()
+ @bindEvents()
+
+
+ build: ->
+ @element = $('<div>', {class: 'mercury-toolbar-container', style: 'width:10000px'})
+ @element.appendTo($(@options.appendTo).get(0) ? 'body')
+
+ for toolbarName, buttons of Mercury.config.toolbars
+ continue if buttons._custom
+ toolbar = $('<div>', {class: "mercury-toolbar mercury-#{toolbarName}-toolbar"}).appendTo(@element)
+ container = $('<div>', {class: 'mercury-toolbar-button-container'}).appendTo(toolbar)
+
+ for buttonName, options of buttons
+ @buildButton(buttonName, options).appendTo(container)
+
+ if container.css('white-space') == 'nowrap'
+ expander = new Mercury.Toolbar.Expander(toolbarName, {appendTo: toolbar, for: container})
+ expander.appendTo(@element)
+
+ toolbar.addClass('disabled') unless toolbarName == 'primary'
+
+ @element.css({width: '100%'})
+
+
+ buildButton: (name, options) ->
+ return $('<span>') if name == '_custom'
+ switch $.type(options)
+
+ when 'array' # button
+ [title, summary, handled] = options
+ new Mercury.Toolbar.Button(name, title, summary, handled, {appendDialogsTo: @element})
+
+ when 'object' # button group
+ group = new Mercury.Toolbar.ButtonGroup(name, options)
+ for a, o of options
+ @buildButton(a, o).appendTo(group) unless a == '_context'
+ group
+
+ when 'string' # separator
+ $('<hr>', {class: "mercury-#{if options == '-' then 'line-separator' else 'separator'}"})
+
+ else throw "Unknown button structure -- please provide an array, object, or string for #{name}."
+
+
+ bindEvents: ->
+ Mercury.bind 'region:focused', (event, options) =>
+ @element.find(".mercury-#{options.region.type}-toolbar").removeClass('disabled')
+
+ Mercury.bind 'region:blurred', (event, options) =>
+ @element.find(".mercury-#{options.region.type}-toolbar").addClass('disabled')
+
+ @element.click -> Mercury.trigger('hide:dialogs')
+ @element.mousedown (event) -> event.preventDefault()
+
+
+ height: ->
+ @element.outerHeight()
View
0  app/assets/javascripts/carmenta/utility.js.coffee → app/assets/javascripts/mercury/utility.js.coffee
File renamed without changes
View
2  app/assets/javascripts/carmenta/websocket.js.coffee → app/assets/javascripts/mercury/websocket.js.coffee
@@ -1,4 +1,4 @@
-#Carmenta.websocket =
+#Mercury.websocket =
#
# websocket: $.websocket("ws://#{$.uri(window.location.href).host}:8081")
#
View
324 app/assets/stylesheets/carmenta/toolbar.scss
@@ -1,324 +0,0 @@
-/* Toolbar
- *----------------------------------------------------------------------------*/
-.carmenta-toolbar-container {
- user-select: none;
- position: absolute;
- z-index: 10010;
- top: 0;
- width: 100%;
- border-bottom: 1px solid #E2E1E2;
-}
-.carmenta-toolbar {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(198,198,198)), color-stop(1, rgb(226,225,226)));
- background-image: -moz-linear-gradient(center bottom, rgb(198,198,198) 0%, rgb(226,225,226) 100%);
- border-bottom: 1px solid #727272;
- cursor: default;
-}
-.carmenta-toolbar-button-container {
- float: left;
-}
-.carmenta-toolbar-expander {
- position: absolute;
- display: none;
- right: 0;
- border-left: 1px solid #727272;
-}
-.carmenta-button,
-.carmenta-button-group,
-.carmenta-separator,
-.carmenta-line-separator {
- display: block;
- float: left;
-}
-.carmenta-separator,
-.carmenta-line-separator {
- width: 1px;
- border: 0;
- margin: 0;
-}
-.carmenta-line-separator {
- width: 1px;
- background: #727272;
-}
-.carmenta-button em {
- display: block;
- font-style: normal;
-}
-.carmenta-expander {
- padding: 5px 0;
- border-radius: 4px;
- -moz-border-radius: 4px;
- .carmenta-expander-button {
- cursor: default;
- white-space: nowrap;
- padding: 0 20px 0 10px;
- &:hover {
- background: #CCC;
- }
- em {
- display: inline-block;
- float: left;
- width: 20px;
- height: 20px;
- margin-right: 10px;
- -webkit-background-size: 100% 100%;
- -moz-background-size: 100% 100%;
- background-size: 100% 100%;
- }
- span {
- display: inline-block;
- line-height: 20px;
- }
- }
-}
-.disabled .carmenta-button,
-.carmenta-button.disabled {
- opacity: 0.33;
-}
-
-
-/* Toolbar: Primary Toolbar
- *----------------------------------------------------------------------------*/
-.carmenta-primary-toolbar {
- position: relative;
- height: 58px;
- overflow: hidden;
- text-shadow: #EEE 0 1px 0;
- .carmenta-button {
- display: inline-block;
- height: 58px;
- margin-bottom: 20px;
- min-width: 55px;
- text-align: center;
- white-space: nowrap;
- text-decoration: none;
- font-family: Helvetica, Tahoma, Arial, sans-serif;
- &.pressed {
- background: url(/assets/carmenta/toolbar/primary/_pressed.png) no-repeat top center;
- }
- em {
- margin: 0 -5px;
- height: 15px;
- padding-top: 41px;
- background-repeat: no-repeat;
- background-position: 50% 7px;
- font-size: 8.5pt;
- line-height: 15px;
- color: #222;
- }
- }
- .carmenta-separator,
- .carmenta-line-separator {
- display: inline-block;
- width: 1px;
- height: 50px;
- margin: 5px 20px 28px;
- }
- .carmenta-toolbar-button-container {
- white-space: nowrap;
- padding-right: 10px;
- }
- .carmenta-toolbar-expander {
- width: 12px;
- height: 58px;
- background: rgba(0, 0, 0, .2) url(/assets/carmenta/toolbar/primary/_expander.png) no-repeat center 90%;
- }
-}
-/* default buttons */
-.carmenta-primary-toolbar .carmenta-save-button em,
-.carmenta-expander-button[data-button=save] em { background-image: url(/assets/carmenta/toolbar/primary/save.png) }
-.carmenta-primary-toolbar .carmenta-preview-button em,
-.carmenta-expander-button[data-button=preview] em { background-image: url(/assets/carmenta/toolbar/primary/preview.png) }
-.carmenta-primary-toolbar .carmenta-undo-button em,
-.carmenta-expander-button[data-button=undo] em { background-image: url(/assets/carmenta/toolbar/primary/undo.png) }
-.carmenta-primary-toolbar .carmenta-redo-button em,
-.carmenta-expander-button[data-button=redo] em { background-image: url(/assets/carmenta/toolbar/primary/redo.png) }
-.carmenta-primary-toolbar .carmenta-insertlink-button em,
-.carmenta-expander-button[data-button=insertlink] em { background-image: url(/assets/carmenta/toolbar/primary/insertlink.png) }
-.carmenta-primary-toolbar .carmenta-insertmedia-button em,
-.carmenta-expander-button[data-button=insertmedia] em { background-image: url(/assets/carmenta/toolbar/primary/insertmedia.png) }
-.carmenta-primary-toolbar .carmenta-inserttable-button em,
-.carmenta-expander-button[data-button=inserttable] em { background-image: url(/assets/carmenta/toolbar/primary/inserttable.png) }
-.carmenta-primary-toolbar .carmenta-insertcharacter-button em,
-.carmenta-expander-button[data-button=insertcharacter] em { background-image: url(/assets/carmenta/toolbar/primary/insertcharacter.png) }
-.carmenta-primary-toolbar .carmenta-objectspanel-button em,
-.carmenta-expander-button[data-button=objectspanel] em { background-image: url(/assets/carmenta/toolbar/primary/objectspanel.png) }
-.carmenta-primary-toolbar .carmenta-historypanel-button em,
-.carmenta-expander-button[data-button=historypanel] em { background-image: url(/assets/carmenta/toolbar/primary/historypanel.png) }
-.carmenta-primary-toolbar .carmenta-notespanel-button em,
-.carmenta-expander-button[data-button=notespanel] em { background-image: url(/assets/carmenta/toolbar/primary/notespanel.png) }
-.carmenta-primary-toolbar .carmenta-todospanel-button em,
-.carmenta-expander-button[data-button=todospanel] em { background-image: url(/assets/carmenta/toolbar/primary/todospanel.png) }
-.carmenta-primary-toolbar .carmenta-notespanel-button em,
-.carmenta-expander-button[data-button=notespanel] em { background-image: url(/assets/carmenta/toolbar/primary/notespanel.png) }
-.carmenta-primary-toolbar .carmenta-todospanel-button em,
-.carmenta-expander-button[data-button=todospanel] em { background-image: url(/assets/carmenta/toolbar/primary/todospanel.png) }
-
-
-/* Toolbar: Editable Region Toolbar
- *----------------------------------------------------------------------------*/
-.carmenta-editable-toolbar {
- padding: 3px 13px 1px 10px;
- border-top: 1px solid #E2E1E2;
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(198,198,198)), color-stop(1, rgb(210,210,209)));
- background-image: -moz-linear-gradient(center bottom, rgb(198,198,198) 0%, rgb(210,210,209) 100%);
- &:after {
- content: '\00a0';
- display: block;
- visibility: hidden;
- clear: both;
- height: 0;
- }
- .carmenta-separator,
- .carmenta-line-separator {
- height: 18px;
- padding: 0;
- margin: 0 7px 2px;
- }
- .carmenta-separator {
- margin: 0 3px 2px;
- }
- .carmenta-button-group {
- white-space: nowrap;
- .carmenta-button:first-child {
- width: 23px;
- }
- }
- .carmenta-button {
- width: 22px;
- height: 18px;
- margin: 0 0 2px;
- background-image: url(/assets/carmenta/toolbar/editable/buttons.png);
- em {
- background-image: url(/assets/carmenta/toolbar/editable/buttons.png);
- display: none;
- }
- }
- .carmenta-button-palette {
- width: 23px;
- background-position: 0 -36px;
- }
- .carmenta-button-select {
- width: auto !important;
- overflow: hidden;
- padding-left: 6px;
- background-position: -24px -36px;
- em {
- display: block;
- padding-right: 15px;
- background-position: right -36px;
- cursor: pointer;
- white-space: nowrap;
- font-style: normal;
- font-family: Helvetica, Tahoma, Arial, sans-serif;
- font-size: 8.5pt;
- line-height: 19px;
- color: #222;
- }
- }
- /* default buttons */
- .carmenta-bold-button { background-position: -68px 0 }
- .carmenta-bold-button.active { background-position: -68px -18px }
- .carmenta-italic-button { background-position: -91px 0 }
- .carmenta-italic-button.active { background-position: -91px -18px }
- .carmenta-overline-button { background-position: -113px 0 }
- .carmenta-overline-button.active { background-position: -113px -18px }
- .carmenta-strikethrough-button { background-position: -135px 0 }
- .carmenta-strikethrough-button.active { background-position: -135px -18px }
- .carmenta-underline-button { background-position: -157px 0 }
- .carmenta-underline-button.active { background-position: -157px -18px }
- .carmenta-subscript-button { background-position: -180px 0 }
- .carmenta-subscript-button.active { background-position: -180px -18px }
- .carmenta-superscript-button { background-position: -203px 0 }
- .carmenta-superscript-button.active { background-position: -203px -18px }
- .carmenta-justifyleft-button { background-position: -226px 0 }
- .carmenta-justifyleft-button.active { background-position: -226px -18px }
- .carmenta-justifycenter-button { background-position: -249px 0 }
- .carmenta-justifycenter-button.active { background-position: -249px -18px }
- .carmenta-justifyright-button { background-position: -271px 0 }
- .carmenta-justifyright-button.active { background-position: -271px -18px }
- .carmenta-justifyfull-button { background-position: -293px 0 }
- .carmenta-justifyfull-button.active { background-position: -293px -18px }
- .carmenta-insertunorderedlist-button { background-position: -316px 0 }
- .carmenta-insertunorderedlist-button.active { background-position: -316px -18px }
- .carmenta-insertorderedlist-button { background-position: -339px 0 }
- .carmenta-insertorderedlist-button.active { background-position: -339px -18px }
- .carmenta-outdent-button { background-position: -362px 0 }
- .carmenta-outdent-button.active { background-position: -362px -18px }
- .carmenta-indent-button { background-position: -385px 0 }
- .carmenta-indent-button.active { background-position: -385px -18px }
- .carmenta-insertrowbefore-button { background-position: -408px 0 }
- .carmenta-insertrowbefore-button.active { background-position: -408px -18px }