simplec 0.9.0 → 0.9.1
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 +5 -5
- data/app/assets/javascripts/simplec/summernote-config.js +53 -47
- data/lib/simplec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6c5c2b1f64ae1b643867b467dcf837eda87b347e10c5c993843a21c7f3fc70cf
|
4
|
+
data.tar.gz: 9c2d2e28104710ec36ca402b1c58c1f96c27d534ec5fd5b8a20efaf40e81f608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc7d27d0fcfe823dba6b7be4d87fa635077f0ebdba3781ffbab53ce4c05f458a28bd837e9e3d39b3d27785057ac9338aab27e295e09b4f13ef2b135db4ac99b
|
7
|
+
data.tar.gz: c0e7ac175f44165692551c6210bca7046dde03c9a07a97a9d16e6ed8aabbab06550ab8910d70bab498a1ff0ae214c2681adee9c7b10537fd889830358c6e04b9
|
@@ -25,59 +25,65 @@ $.summernote.options.toolbar = [
|
|
25
25
|
if (!window.simplec) window.simplec = {};
|
26
26
|
|
27
27
|
window.simplec.initSummernote = function() {
|
28
|
-
|
28
|
+
$('.editor-field').each(function(idx, el) {
|
29
|
+
var $el = $(el);
|
29
30
|
|
30
|
-
|
31
|
+
if ($el.data('simplec') !== 'initialized') {
|
32
|
+
console.log('adding summernote', el);
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
$el.on('summernote.init', function(event) {
|
35
|
+
// Material Kit Hack
|
36
|
+
//$('.note-toolbar .btn-default').
|
37
|
+
// removeClass('btn-default').addClass('btn-simple');
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
39
|
+
//$('.note-popover').css({'display': 'none'}); // BS4 HACK
|
40
|
+
var $editor = $(event.target),
|
41
|
+
$input = $($editor.data('input'));
|
42
|
+
if ($input.val().length > 0) $editor.summernote('code', $input.val());
|
43
|
+
}).on('summernote.change', function(event, contents, $editable) {
|
44
|
+
var $editor = $(event.target),
|
45
|
+
$input = $($editor.data('input'));
|
46
|
+
$input.val(contents);
|
47
|
+
}.bind(window)).on('summernote.image.upload', function(event, files) {
|
48
|
+
console.log('upload event');
|
49
|
+
for (var i = 0; i < files.length; i++) {
|
50
|
+
var file = files[i],
|
51
|
+
reader = new FileReader();
|
52
|
+
reader.onloadend = function() {
|
53
|
+
$.ajax({
|
54
|
+
method: 'POST',
|
55
|
+
url: '/embedded-images',
|
56
|
+
dataType: 'json',
|
57
|
+
contentType: 'application/json',
|
58
|
+
headers: { 'X-Engine': 'simplec' },
|
59
|
+
data: JSON.stringify({
|
60
|
+
asset_url: reader.result,
|
61
|
+
asset_name: file.name
|
62
|
+
})
|
63
|
+
}).fail(function(data, textStatus, jqXHR){
|
64
|
+
console.log('IMAGE UPLOAD FAIL', textStatus);
|
65
|
+
}).done(function(data, textStatus, jqXHR){
|
66
|
+
$(event.target).summernote(
|
67
|
+
'insertImage',
|
68
|
+
jqXHR.responseJSON.asset_url, jqXHR.responseJSON.asset_name
|
69
|
+
);
|
70
|
+
});
|
71
|
+
};
|
72
|
+
reader.readAsDataURL(file);
|
73
|
+
}
|
74
|
+
});
|
72
75
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
$el.summernote({
|
77
|
+
height: 500,
|
78
|
+
minHeight: 100,
|
79
|
+
maxHeight: 1200
|
80
|
+
});
|
78
81
|
|
82
|
+
$el.attr('data-simplec', 'initialized');
|
83
|
+
}
|
84
|
+
});
|
79
85
|
};
|
80
86
|
|
81
87
|
$(document).on('ready turbolinks:load', function() {
|
82
|
-
|
88
|
+
window.simplec.initSummernote();
|
83
89
|
});
|
data/lib/simplec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.6
|
188
|
+
rubygems_version: 2.7.6
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Developer oriented CMS.
|