dante-editor 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +16 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -0
  5. data/TODO.md +2 -6
  6. data/{source → app}/assets/fonts/fontello.eot +0 -0
  7. data/{source → app}/assets/fonts/fontello.svg +0 -0
  8. data/{source → app}/assets/fonts/fontello.ttf +0 -0
  9. data/{source → app}/assets/fonts/fontello.woff +0 -0
  10. data/{source/assets/images → app/assets/images/dante}/media-loading-placeholder.png +0 -0
  11. data/{source → app}/assets/javascripts/dante.js +0 -0
  12. data/{source → app}/assets/javascripts/dante/dante.js.coffee.erb +2 -0
  13. data/{source → app}/assets/javascripts/dante/editor.js.coffee +6 -5
  14. data/{source → app}/assets/javascripts/dante/menu.js.coffee +4 -4
  15. data/{source → app}/assets/javascripts/dante/tooltip.js.coffee +0 -0
  16. data/{source → app}/assets/javascripts/dante/utils.js.coffee +0 -0
  17. data/{source → app}/assets/javascripts/dante/view.js.coffee +0 -0
  18. data/{source → app}/assets/stylesheets/dante.css.scss +0 -0
  19. data/{source → app}/assets/stylesheets/dante/base.css.scss +0 -0
  20. data/{source → app}/assets/stylesheets/dante/editor.css.scss +0 -0
  21. data/{source → app}/assets/stylesheets/dante/fonts.css.scss +0 -0
  22. data/dante-editor.gemspec +1 -1
  23. data/lib/dante-editor.rb +2 -0
  24. data/lib/dante-editor/rails.rb +4 -0
  25. data/lib/dante-editor/version.rb +1 -1
  26. data/source/assets/javascripts/editor.js +1 -0
  27. data/source/assets/stylesheets/editor.css.scss +1 -0
  28. data/source/layouts/layout.erb +2 -2
  29. metadata +21 -21
  30. data/source/assets/images/background.png +0 -0
  31. data/source/assets/images/icon.png +0 -0
  32. data/source/assets/images/middleman.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6de1fa4fbcebb4bfdea9ffec73648fe6a129e692
4
- data.tar.gz: e15d6a670d5871b86148d52d6a4dfed42855baa1
3
+ metadata.gz: a52e2126d77969614fd8f182ae9f639362a0a9ce
4
+ data.tar.gz: b32b6c838894dba0f3ea145431e1f38593efcdfd
5
5
  SHA512:
6
- metadata.gz: 50e79a22fdee6e1c8641815d65810851bc535ada073b3d6c629c0c4f739c9b5a94cf9890258b7ccc2524161ad694d71e3a47aa1a460e4435f4628ab9567c8e7c
7
- data.tar.gz: 6971b66fec35c57e7909c2074c5b14063449714a47bfcdbdc94b3e190ceec1111727fd1bb15bacf7484b8d7d0d73cbecc098fbdb358e9ce3d7b55ccaa5bc7c3d
6
+ metadata.gz: 96f21f5f46e07dff4980e97be6a9475301c9def7a4114bc8575c13c41f30e5145021e6df6fdeff1324321567a0f952a1f9f2ca3799a892f083367378644480b1
7
+ data.tar.gz: f1f6924ff1d986e52ae25eb334945310461a7ecc26cb6f1d509c072e597bba74f950eaf7188e90f2c2138b19d829501199b62cfbb04348a755e423dc684e7bd8
data/.gitignore CHANGED
@@ -20,3 +20,19 @@
20
20
  /node_modules
21
21
 
22
22
  /tmp/images/**/*
23
+
24
+
25
+ /.yardoc
26
+ /Gemfile.lock
27
+ /_yardoc/
28
+ /coverage/
29
+ /doc/
30
+ /pkg/
31
+ /spec/reports/
32
+ /tmp/
33
+ *.bundle
34
+ *.so
35
+ *.o
36
+ *.a
37
+ mkmf.log
38
+ log
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dante-editor (0.0.1)
4
+ dante-editor (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -60,6 +60,9 @@ Until now I´ve been able to implement the following features:
60
60
  upload_url: default: /uploads.json
61
61
  oembed_url: default: http://api.embed.ly/1/oembed?url="
62
62
  extract_url: default: http://api.embed.ly/1/extract?url="
63
+ store_url: url to store data with interval , defaults to none
64
+ store_interval: default: 15000 (15 secs)
65
+ default_loading_placeholder: image placeholder to show when uploaded/pasted images are loading , defaults to a grey background
63
66
 
64
67
  ### Rails / AssetPippeline
65
68
 
data/TODO.md CHANGED
@@ -3,22 +3,18 @@
3
3
 
4
4
  + GENERALS
5
5
  + FF in case markup breaks (like linebreak with br or unwraped text when typing) just rewrap from current range.
6
+ + Check double clicks on first p
6
7
 
7
- + SANITIZE PROCESS:
8
- + childs links inside first level elements clean & add classes ie
9
-
10
- a target="_blank" href="#" data-href="#" class="markup--anchor markup--p-anchor" data-tooltip="#" data-tooltip-position="bottom" data-tooltip-type="link">example link</a>
8
+ + SANITIZE PROCESS
11
9
 
12
10
  + MENU
13
11
  + Filter inner tags (except a, b, i ... ) when convert to blockquote
14
12
 
15
13
  + DELETE
16
-
17
14
  + handle remove from PRE tag, it set rare span, just remove it
18
15
  + clean node when remove one
19
16
 
20
17
  + IMAGES:
21
-
22
18
  + upload, show progress, complete
23
19
  + handle enter (linebreak) when selected in caption (build new P)
24
20
  + Fix problem in FF when linebreak or arrow down to new P , is typing backwards!! (could be a range 1 char problem ?)
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -3,5 +3,7 @@ window.Dante = {
3
3
  ToolTip: {}
4
4
  Menu: {}
5
5
  }
6
+ defaults:
7
+ image_placeholder: '<%= image_path("dante/media-loading-placeholder.png") %>'
6
8
  version: "<%= DanteEditor::VERSION %>"
7
9
  }
@@ -3,10 +3,9 @@ selected_menu = false
3
3
  utils = Dante.utils
4
4
 
5
5
  class Dante.Editor extends Dante.View
6
- #el: "#editor"
7
6
 
8
7
  events:
9
- "blur" : "handleBlur"
8
+ #"blur" : "handleBlur"
10
9
  "mouseup" : "handleMouseUp"
11
10
  "keydown" : "handleKeyDown"
12
11
  "keyup" : "handleKeyUp"
@@ -25,8 +24,9 @@ class Dante.Editor extends Dante.View
25
24
  @upload_url = opts.upload_url || "/uploads.json"
26
25
  @oembed_url = opts.oembed_url || "http://api.embed.ly/1/oembed?url="
27
26
  @extract_url = opts.extract_url || "http://api.embed.ly/1/extract?key=86c28a410a104c8bb58848733c82f840&url="
28
- @default_loading_placeholder = opts.default_loading_placeholder || "/images/media-loading-placeholder.png"
27
+ @default_loading_placeholder = opts.default_loading_placeholder || Dante.defaults.image_placeholder
29
28
  @store_url = opts.store_url
29
+ @store_interval = opts.store_interval || 15000
30
30
  if (localStorage.getItem('contenteditable'))
31
31
  $(@el).html localStorage.getItem('contenteditable')
32
32
 
@@ -42,7 +42,7 @@ class Dante.Editor extends Dante.View
42
42
  return unless @store_url
43
43
  setTimeout ()=>
44
44
  @checkforStore()
45
- , 15000
45
+ , @store_interval
46
46
 
47
47
  checkforStore: ()->
48
48
  if @content is @getContent()
@@ -263,7 +263,8 @@ class Dante.Editor extends Dante.View
263
263
  handleBlur: (ev)=>
264
264
  #hide menu only if is not in use
265
265
  setTimeout ()=>
266
- @editor_menu.hide() unless selected_menu
266
+ utils.log "not in use"
267
+ #@editor_menu.hide() unless selected_menu
267
268
  , 200
268
269
  false
269
270
 
@@ -118,6 +118,9 @@ class Dante.Editor.Menu extends Dante.View
118
118
  n = @current_editor.getNode()
119
119
  @current_editor.setupLinks($(n).find("a"))
120
120
  @displayHighlights()
121
+ if $(n).parent().hasClass("section-inner")
122
+ n = @current_editor.addClassesToElement(n)
123
+ @current_editor.setElementName(n)
121
124
  else
122
125
  utils.log "fail" + message, true
123
126
  return
@@ -166,11 +169,8 @@ class Dante.Editor.Menu extends Dante.View
166
169
  tag = node.nodeName.toLowerCase()
167
170
  switch tag
168
171
  when "a"
169
- menu.querySelector("input").value = item.getAttribute("href")
172
+ $(@el).find('input').val $(node).attr("href")
170
173
  tag = "createlink"
171
- when "img"
172
- menu.querySelector("input").value = item.getAttribute("src")
173
- tag = "insertimage"
174
174
  when "i"
175
175
  tag = "italic"
176
176
  when "u"
File without changes
data/dante-editor.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["miguelmichelson@gmail.com"]
11
11
  gem.description = %q{dante-editor yet another Medium editor clone.}
12
12
  gem.summary = %q{dante-editor yet another Medium editor clone.}
13
- gem.homepage = ""
13
+ gem.homepage = "http://michelson.github.io/Dante/"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
data/lib/dante-editor.rb CHANGED
@@ -1,3 +1,5 @@
1
1
  require "dante-editor/version"
2
+ require 'dante-editor/rails' if defined?(Rails)
3
+
2
4
  module DanteEditor
3
5
  end
@@ -0,0 +1,4 @@
1
+ module DanteEditor
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -1,5 +1,5 @@
1
1
  require "dante-editor/version"
2
2
 
3
3
  module DanteEditor
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -0,0 +1 @@
1
+ //= require dante
@@ -0,0 +1 @@
1
+ @import "dante";
@@ -6,8 +6,8 @@
6
6
  <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
7
7
  <title><%= current_page.data.title || "The Middleman" %></title>
8
8
  <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" %>
9
- <%= stylesheet_link_tag "normalize", "dante" %>
10
- <%= javascript_include_tag "deps", "dante" %>
9
+ <%= stylesheet_link_tag "normalize", "editor" %>
10
+ <%= javascript_include_tag "deps", "editor" %>
11
11
  </head>
12
12
 
13
13
  <body class="<%= page_classes %>">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dante-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Michelson
@@ -24,41 +24,41 @@ files:
24
24
  - Procfile
25
25
  - README.md
26
26
  - TODO.md
27
+ - app/assets/fonts/fontello.eot
28
+ - app/assets/fonts/fontello.svg
29
+ - app/assets/fonts/fontello.ttf
30
+ - app/assets/fonts/fontello.woff
31
+ - app/assets/images/dante/media-loading-placeholder.png
32
+ - app/assets/javascripts/dante.js
33
+ - app/assets/javascripts/dante/dante.js.coffee.erb
34
+ - app/assets/javascripts/dante/editor.js.coffee
35
+ - app/assets/javascripts/dante/menu.js.coffee
36
+ - app/assets/javascripts/dante/tooltip.js.coffee
37
+ - app/assets/javascripts/dante/utils.js.coffee
38
+ - app/assets/javascripts/dante/view.js.coffee
39
+ - app/assets/stylesheets/dante.css.scss
40
+ - app/assets/stylesheets/dante/base.css.scss
41
+ - app/assets/stylesheets/dante/editor.css.scss
42
+ - app/assets/stylesheets/dante/fonts.css.scss
27
43
  - bower.json
28
44
  - config.rb
29
45
  - config.ru
30
46
  - dante-editor.gemspec
31
47
  - lib/dante-editor.rb
48
+ - lib/dante-editor/rails.rb
32
49
  - lib/dante-editor/version.rb
33
50
  - license.md
34
51
  - rakefile
35
- - source/assets/fonts/fontello.eot
36
- - source/assets/fonts/fontello.svg
37
- - source/assets/fonts/fontello.ttf
38
- - source/assets/fonts/fontello.woff
39
- - source/assets/images/background.png
40
52
  - source/assets/images/icon-logo.png
41
- - source/assets/images/icon.png
42
- - source/assets/images/media-loading-placeholder.png
43
- - source/assets/images/middleman.png
44
53
  - source/assets/javascripts/all.js
45
- - source/assets/javascripts/dante.js
46
- - source/assets/javascripts/dante/dante.js.coffee.erb
47
- - source/assets/javascripts/dante/editor.js.coffee
48
- - source/assets/javascripts/dante/menu.js.coffee
49
- - source/assets/javascripts/dante/tooltip.js.coffee
50
- - source/assets/javascripts/dante/utils.js.coffee
51
- - source/assets/javascripts/dante/view.js.coffee
52
54
  - source/assets/javascripts/deps.js
55
+ - source/assets/javascripts/editor.js
53
56
  - source/assets/javascripts/spec.js
54
57
  - source/assets/javascripts/specs/cleaner.js.coffee
55
58
  - source/assets/javascripts/specs/dante_view.js.coffee
56
59
  - source/assets/javascripts/specs/editor.js.coffee
57
60
  - source/assets/stylesheets/all.css.scss
58
- - source/assets/stylesheets/dante.css.scss
59
- - source/assets/stylesheets/dante/base.css.scss
60
- - source/assets/stylesheets/dante/editor.css.scss
61
- - source/assets/stylesheets/dante/fonts.css.scss
61
+ - source/assets/stylesheets/editor.css.scss
62
62
  - source/assets/stylesheets/normalize.css
63
63
  - source/embeds.html.erb
64
64
  - source/index.html.erb
@@ -73,7 +73,7 @@ files:
73
73
  - source/tests/dante_view.html.erb
74
74
  - source/tests/index.html.erb
75
75
  - tmp/.gitkeep
76
- homepage: ''
76
+ homepage: http://michelson.github.io/Dante/
77
77
  licenses: []
78
78
  metadata: {}
79
79
  post_install_message:
Binary file
Binary file
Binary file