ledge 0.2.3 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 808bcb8df03c984251983c66b946699c826119a9
4
- data.tar.gz: 08b37c69af47bce107c851b1b7e00b48dd9a4224
3
+ metadata.gz: 04720f10614faeff48955045c88af1f8e640063b
4
+ data.tar.gz: ac997f4ebbc0d69db31f99041d3c51764d4d5b19
5
5
  SHA512:
6
- metadata.gz: 4edf5db64655627f536e7644dde6879c6e1fa7e36d2e0acd24d54cb0f88d550a6542f54e6e7580713a5e9fbdd41f200b7cb7b3433975dbc2715475f8571a4e7b
7
- data.tar.gz: fa9fce9f45a55deaa89476ec9887edfe4a2621f7dca2ec9f028cb2c0baa1f9f201734e687821201cb8f34e85c8fca88fcc7684bdc8e9250b709fe8bd7f9d4ac2
6
+ metadata.gz: 0f1b649a305f88c88c3261cba996fc258903868a076ba85e58652dd8da279f09da8049938c33ffcf001685d34d4e29cefab8fec5a4fa21025c84156a0f62c3d8
7
+ data.tar.gz: 080494a4f6c5a9e48b47432be992ca73b98e17b1e34b729add9734bc123c742a3d9859255766c9e13bc3d98a3e4ee29f902ece789d104aa6e187ca8af40268c7
@@ -1,49 +1,54 @@
1
1
  # Icons: https://www.iconfinder.com/iconsets/silk2
2
2
 
3
3
  class Text extends Row
4
- type: "text"
5
- name: "Text"
6
- initial_content: "<p>Your text here..</p>"
4
+ type: "text"
5
+ name: "Text"
6
+ initial_content: "<p>Your text here..</p>"
7
7
 
8
- options: ["bold", "italic", "underline", "strikeThrough", "createLink", "unlink", "insertImage", "floatLeft", "floatRight", "insertOrderedList", "insertUnorderedList", "indent", "outdent", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "subscript", "superscript"]
9
- icons:
10
- "bold": "<%= asset_path('text_bold.png') %>"
11
- "italic": "<%= asset_path('text_italic.png') %>"
12
- "underline": "<%= asset_path('text_underline.png') %>"
13
- "strikeThrough": "<%= asset_path('text_strikethrough.png') %>"
14
- "createLink": "<%= asset_path('link_add.png') %>"
15
- "unlink": "<%= asset_path('link_delete.png') %>"
16
- "insertOrderedList": "<%= asset_path('text_list_numbers.png') %>"
17
- "insertUnorderedList": "<%= asset_path('text_list_bullets.png') %>"
18
- "indent": "<%= asset_path('text_indent.png') %>"
19
- "outdent": "<%= asset_path('text_indent_remove.png') %>"
20
- "justifyLeft": "<%= asset_path('text_align_left.png') %>"
21
- "justifyCenter": "<%= asset_path('text_align_center.png') %>"
22
- "justifyRight": "<%= asset_path('text_align_right.png') %>"
23
- "justifyFull": "<%= asset_path('text_align_justify.png') %>"
24
- "subscript": "<%= asset_path('text_subscript.png') %>"
25
- "superscript": "<%= asset_path('text_superscript.png') %>"
26
- "insertImage": "<%= asset_path('image_add.png') %>"
27
- "floatLeft": "<%= asset_path('shape_align_left.png') %>"
28
- "floatRight": "<%= asset_path('shape_align_right.png') %>"
8
+ options: ["bold", "italic", "underline", "strikeThrough", "createLink", "unlink", "insertImage", "floatLeft", "floatRight", "insertOrderedList", "insertUnorderedList", "indent", "outdent", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "subscript", "superscript"]
9
+ icons:
10
+ "bold": "<%= asset_path('text_bold.png') %>"
11
+ "italic": "<%= asset_path('text_italic.png') %>"
12
+ "underline": "<%= asset_path('text_underline.png') %>"
13
+ "strikeThrough": "<%= asset_path('text_strikethrough.png') %>"
14
+ "createLink": "<%= asset_path('link_add.png') %>"
15
+ "unlink": "<%= asset_path('link_delete.png') %>"
16
+ "insertOrderedList": "<%= asset_path('text_list_numbers.png') %>"
17
+ "insertUnorderedList": "<%= asset_path('text_list_bullets.png') %>"
18
+ "indent": "<%= asset_path('text_indent.png') %>"
19
+ "outdent": "<%= asset_path('text_indent_remove.png') %>"
20
+ "justifyLeft": "<%= asset_path('text_align_left.png') %>"
21
+ "justifyCenter": "<%= asset_path('text_align_center.png') %>"
22
+ "justifyRight": "<%= asset_path('text_align_right.png') %>"
23
+ "justifyFull": "<%= asset_path('text_align_justify.png') %>"
24
+ "subscript": "<%= asset_path('text_subscript.png') %>"
25
+ "superscript": "<%= asset_path('text_superscript.png') %>"
26
+ "insertImage": "<%= asset_path('image_add.png') %>"
27
+ "floatLeft": "<%= asset_path('shape_align_left.png') %>"
28
+ "floatRight": "<%= asset_path('shape_align_right.png') %>"
29
29
 
30
- on_option: (row, option) ->
31
- args = null
32
- switch option
33
- when "createLink"
34
- args = prompt("Where should the link take you? (Link URL)")
35
- when "insertImage"
36
- url = prompt("What is the image URL?")
37
- width = prompt("What is the image width (height will be calculated)?")
38
- args = "<img class='img-thumbnail img-responsive' src='#{url}' width='#{width}'>"
39
- option = "insertHTML"
40
- when "floatRight"
41
- $(window.getSelection().focusNode).addClass("pull-right")
42
- return
43
- when "floatLeft"
44
- $(window.getSelection().focusNode).addClass("pull-left")
45
- return
46
- else
47
- document.execCommand(option, false, args)
30
+ on_option: (row, option) ->
31
+ args = null
32
+ success = true
33
+ switch option
34
+ when "createLink"
35
+ args = prompt("Where should the link take you? (Link URL)")
36
+ when "insertImage"
37
+ url = prompt("What is the image URL?")
38
+ if url
39
+ width = prompt("What is the image width (height will be calculated)?")
40
+ args = "<img class='img-thumbnail img-responsive' src='#{url}' width='#{width}'>"
41
+ option = "insertHTML"
42
+ else
43
+ success = false
44
+ when "floatRight"
45
+ $(window.getSelection().focusNode).addClass("pull-right")
46
+ return
47
+ when "floatLeft"
48
+ $(window.getSelection().focusNode).addClass("pull-left")
49
+ return
50
+ else
51
+ if success
52
+ document.execCommand(option, false, args)
48
53
 
49
54
  window.Text = Text
@@ -1,3 +1,3 @@
1
1
  module Ledge
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Birtles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-23 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -402,7 +402,6 @@ files:
402
402
  - test/dummy/tmp/cache/assets/development/sprockets/f72e72ebd1884d808afb460eaafa915f
403
403
  - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
404
404
  - test/dummy/tmp/cache/assets/development/sprockets/fc52113c89ff2b34f4b2f696dae97d8a
405
- - test/dummy/tmp/pids/server.pid
406
405
  - test/ledge_test.rb
407
406
  - test/test_helper.rb
408
407
  homepage: http://github.com/JamesHBirtles/ledge
@@ -703,6 +702,5 @@ test_files:
703
702
  - test/dummy/tmp/cache/assets/development/sprockets/f72e72ebd1884d808afb460eaafa915f
704
703
  - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
705
704
  - test/dummy/tmp/cache/assets/development/sprockets/fc52113c89ff2b34f4b2f696dae97d8a
706
- - test/dummy/tmp/pids/server.pid
707
705
  - test/ledge_test.rb
708
706
  - test/test_helper.rb
@@ -1 +0,0 @@
1
- 12520