sibu 0.1.29 → 0.1.30
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/sibu/sibu.js.erb +18 -4
- data/lib/sibu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42e04848ddb67867f8254004f396c25e96f3962f
|
4
|
+
data.tar.gz: 4e0781f08438129c1e34cdef43f145e26339a0d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a70fa491883f58d8af8f1389c771da93e46ff0f2860792a63dc7273e781e1444c7799815569627cfd6c8fb5aeaf7b223dfdb1c4d366c7d055169f11380f171f
|
7
|
+
data.tar.gz: 6306180b3ea39f4b603d4f25780298e7fe39dface6509bf62d060135db405782ed668ec4eee747ec4d2b240065531cc59a01a6781761af0600d7811d4a70bdd3
|
@@ -17,6 +17,11 @@ class IconBlot extends Inline {
|
|
17
17
|
static formats(node) {
|
18
18
|
return node.getAttribute('href');
|
19
19
|
}
|
20
|
+
|
21
|
+
format(name, value) {
|
22
|
+
if (name !== this.statics.blotName || !value) return super.format(name, value);
|
23
|
+
this.domNode.setAttribute('href', value);
|
24
|
+
}
|
20
25
|
}
|
21
26
|
IconBlot.blotName = 'icon';
|
22
27
|
IconBlot.tagName = 'a';
|
@@ -39,24 +44,33 @@ function initQuillEditor(container) {
|
|
39
44
|
theme: 'snow'
|
40
45
|
});
|
41
46
|
|
47
|
+
function promptWithInit(promptText) {
|
48
|
+
var range = quill.getSelection(true);
|
49
|
+
if(range && range.length === 0) {
|
50
|
+
quill.insertText(range.index, ' ', Quill.sources.USER);
|
51
|
+
quill.setSelection(range.index, 1, Quill.sources.USER);
|
52
|
+
}
|
53
|
+
return prompt(promptText);
|
54
|
+
}
|
55
|
+
|
42
56
|
var fbButton = document.querySelector('.ql-facebook');
|
43
57
|
fbButton.addEventListener('click', function() {
|
44
|
-
var value =
|
58
|
+
var value = promptWithInit('Adresse de la page Facebook :');
|
45
59
|
quill.format('icon', [value, 'sb-facebook']);
|
46
60
|
});
|
47
61
|
var twButton = document.querySelector('.ql-twitter');
|
48
62
|
twButton.addEventListener('click', function() {
|
49
|
-
var value =
|
63
|
+
var value = promptWithInit('Adresse du compte Twitter :');
|
50
64
|
quill.format('icon', [value, 'sb-twitter']);
|
51
65
|
});
|
52
66
|
var igButton = document.querySelector('.ql-instagram');
|
53
67
|
igButton.addEventListener('click', function() {
|
54
|
-
var value =
|
68
|
+
var value = promptWithInit('Adresse du compte Instagram :');
|
55
69
|
quill.format('icon', [value, 'sb-instagram']);
|
56
70
|
});
|
57
71
|
var piButton = document.querySelector('.ql-pinterest');
|
58
72
|
piButton.addEventListener('click', function() {
|
59
|
-
var value =
|
73
|
+
var value = promptWithInit('Adresse du compte Pinterest :');
|
60
74
|
quill.format('icon', [value, 'sb-pinterest']);
|
61
75
|
});
|
62
76
|
|
data/lib/sibu/version.rb
CHANGED