polyblock 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/polyblock/polyblock.js.coffee +17 -7
- data/lib/polyblock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc493c480918f3bf39bfa91106dbacd7716c32c2
|
4
|
+
data.tar.gz: 29c4405b765ca837e7c290df192e32bfa3383d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa72c1af9cbfb75b49e498574a71836a7a4d58f9d83e26abf6e197bebbf2f00912da1e2c87e941f0c15a122734d49f19a6afd937bf98c4fd5303612c7fceb24d
|
7
|
+
data.tar.gz: 39c2e15125ce75e7f47df26bad9848ad80dfd6d98fd3629e0a07a9440692b330fb3d3ca863c790da51fec72ae4e4de7772b7d12715a28c3cc7aca46b2995cff2
|
@@ -8,21 +8,31 @@ $ ->
|
|
8
8
|
blocks = $(".polyblock[contenteditable='true']")
|
9
9
|
return unless blocks.length
|
10
10
|
|
11
|
+
# Find switches
|
12
|
+
pb_switch = $('.polyblock-switch')
|
13
|
+
has_switch = pb_switch.is('*')
|
14
|
+
|
11
15
|
# Clone each block and instanciate CKeditor on the original
|
12
16
|
blockclones = {}
|
17
|
+
instanciateCKEditor = (id)->
|
18
|
+
CKEDITOR.inline id,
|
19
|
+
on:
|
20
|
+
focus:(e)->
|
21
|
+
editorModeOn()
|
22
|
+
startListening(id)
|
23
|
+
blur:(e)-> stopListening()
|
13
24
|
blocks.each ->
|
14
25
|
id = $(@).attr('id')
|
15
26
|
blockclones[id] = $(@).clone()
|
16
27
|
unless _.contains(_.keys(CKEDITOR.instances),id)
|
17
|
-
|
18
|
-
on
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
blur:(e)-> stopListening()
|
28
|
+
if has_switch
|
29
|
+
pb_switch.on "change", ->
|
30
|
+
if $(@).hasClass("active") then instanciateCKEditor(id)
|
31
|
+
else window.location.reload()
|
32
|
+
else instanciateCKEditor(id)
|
23
33
|
|
24
34
|
# Wait for changes
|
25
|
-
verbose =
|
35
|
+
verbose = false
|
26
36
|
changeChecker = null
|
27
37
|
indicator = $('.pb-change-indicator')
|
28
38
|
changeText = $('.pb-change-text')
|
data/lib/polyblock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MacKinley Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|