kolo 0.5.5 → 0.5.6

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: f148ae03af55276937d2bae1af571bc7c7ac8b0c
4
- data.tar.gz: 0c7a02f68dbecdcfcf8f3d2b3c75143e079a9612
3
+ metadata.gz: 88025abfc37b5c04c98c5067214cb2b9c59112ca
4
+ data.tar.gz: b3de50e1df9cd559a2cfc79cdd9907718711f3ff
5
5
  SHA512:
6
- metadata.gz: 4ef8f351c30c9e48cb63b94a7874eb2cdf696a6a3ca564b860305db031cffcd3f7a18d96371ca2cdf9390974308ed104aac9f03b3dc9b79f930e4be00a59aa3d
7
- data.tar.gz: 999d28f195de1f95f90258c118f14748c316795bee4ff3a8f7ab3ad37d730572bf4788be7bdcfad9fbdb9958343a0756675f2922f7e57c88e3c6b53847c3dcc2
6
+ metadata.gz: 396996ba93a24da41018b2a6ddaaab0011d84c0b79074eb32dfe8b26f2ec0805de0fd7a7a17bb263b307d01c791822419316776a9cc2887b100c425ccb6dc0db
7
+ data.tar.gz: f8b1a41aed067b1a48533ae6438dac9fb5a1aeefa18a9132190ea4383295a95901c87c529ccf577c854e9ae17df517525d3f64151f5b3abdaeae8d96f5003ffa
@@ -172,3 +172,24 @@ ko.bindingHandlers.fileupload =
172
172
  xhr.open 'POST', url
173
173
  xhr.send formData
174
174
  return true
175
+
176
+ ko.bindingHandlers.wysiwyg =
177
+ init: (element, valueAccessor, allBindingsAccessor)->
178
+ value = ko.utils.unwrapObservable valueAccessor()
179
+ $(element).wysiwyg()
180
+
181
+ $(element).bind 'blur keyup paste copy cut mouseup', =>
182
+ $(element).attr('data-edit-in-progress', 'true')
183
+ observable = valueAccessor()
184
+ newValue = $(element).html()
185
+ observable newValue
186
+ $(element).attr('data-edit-in-progress', '')
187
+
188
+ ko.utils.domNodeDisposal.addDisposeCallback element, =>
189
+ $(element).wysiwyg('destroy')
190
+
191
+ update: (element, valueAccessor)->
192
+ return if $(element).attr('data-edit-in-progress') == 'true'
193
+ value = ko.utils.unwrapObservable valueAccessor()
194
+ $(element).html value
195
+ ko.bindingHandlers.value.update element, valueAccessor
data/lib/kolo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kolo
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-17 00:00:00.000000000 Z
11
+ date: 2013-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler