active_admin_pro 0.2.0 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe008d05af813ec3a1396ae72c1cb7c7dbb5594
|
4
|
+
data.tar.gz: 730f428bcde2cb93c88c60da1d0c1d04f0d3b2c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aad49035c8e6b6eb59847e602d000b7563e6c2e946a5c8705c49fc50ff9b13804c883c4563ae56b3afb4bff5d46eafaf55f7d49af0833f81c37679920d97ef7
|
7
|
+
data.tar.gz: 3d4bce2803de9c8bba0896c49e43a4b87176ff92781b071b95a2bc76c1bb26d39d4063ff9e046b6c1e3757548c27c0ae0ced856d69b90e73896ec0b04cf4e8e7
|
@@ -21,6 +21,22 @@
|
|
21
21
|
['code', ['codeview', 'fullscreen']]
|
22
22
|
];
|
23
23
|
|
24
|
+
function insertImage(summernoteInput, imageUrl, imageLink) {
|
25
|
+
var link = document.createElement('a');
|
26
|
+
var img = document.createElement('img');
|
27
|
+
var insertedImage;
|
28
|
+
if (imageLink !== '') {
|
29
|
+
link.setAttribute('href', imageLink);
|
30
|
+
img.setAttribute('src', imageUrl);
|
31
|
+
link.appendChild(img);
|
32
|
+
insertedImage = link;
|
33
|
+
} else {
|
34
|
+
img.setAttribute('src', imageUrl);
|
35
|
+
insertedImage = img;
|
36
|
+
}
|
37
|
+
summernoteInput.summernote('insertNode', insertedImage);
|
38
|
+
}
|
39
|
+
|
24
40
|
function activateBehavior() {
|
25
41
|
$('.input.summernote').each(function() {
|
26
42
|
var wrapper = $(this);
|
@@ -72,6 +88,10 @@
|
|
72
88
|
dialogHtml += '<label for="summernote_image_url">Image URL</label>';
|
73
89
|
dialogHtml += '<input id="summernote_image_url" type="text">';
|
74
90
|
dialogHtml += '</div>';
|
91
|
+
dialogHtml += '<div class="input text">';
|
92
|
+
dialogHtml += '<label for="summernote_image_link">Link Image to URL</label>';
|
93
|
+
dialogHtml += '<input id="summernote_image_link" type="text">';
|
94
|
+
dialogHtml += '</div>';
|
75
95
|
dialogHtml += '</div>';
|
76
96
|
$('#wrapper').prepend(dialogHtml);
|
77
97
|
$('#summernote_image_dialog').dialog({
|
@@ -85,6 +105,7 @@
|
|
85
105
|
click: function() {
|
86
106
|
var imageFile = $('#summernote_image_file')[0].files[0];
|
87
107
|
var imageUrl = $('#summernote_image_url').val();
|
108
|
+
var imageLink = $('#summernote_image_link').val();
|
88
109
|
var dialog = $(this);
|
89
110
|
|
90
111
|
if (imageFile !== undefined) {
|
@@ -105,7 +126,7 @@
|
|
105
126
|
|
106
127
|
success: function(url) {
|
107
128
|
dialog.dialog('close').remove();
|
108
|
-
summernoteInput
|
129
|
+
insertImage(summernoteInput, url, imageLink);
|
109
130
|
},
|
110
131
|
|
111
132
|
error: function(err) {
|
@@ -117,7 +138,7 @@
|
|
117
138
|
return;
|
118
139
|
} else if (imageUrl.trim() !== '') {
|
119
140
|
dialog.dialog('close').remove();
|
120
|
-
summernoteInput
|
141
|
+
insertImage(summernoteInput, imageUrl, imageLink);
|
121
142
|
return;
|
122
143
|
}
|
123
144
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_admin_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pattison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|