jhtmlarea 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jhtmlarea/version.rb +1 -1
- data/vendor/assets/javascripts/jHtmlArea-0.7.5.js +60 -47
- 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: 4fa0b0afb0d455da7b41e4b45d1fcd6b79d20cfb
|
4
|
+
data.tar.gz: dc7afff03258e0ba959ad1eb7745649501a5ac74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c72c5f4ad0c3fb25721693574b32b61683588fb08afa0dc8850af0887a56f59bff44af1982ab90a7264e5c8c660997ead2ca13a078fc92ad2bf20c27cb1ad49
|
7
|
+
data.tar.gz: 0b972fc53c8d46fb61fc67f22e076f899bfa9fb618e4c8e223209435ab9b766e11af787f332445d1ed07f8738031233336d41f527586863296d07695c30a420b
|
data/lib/jhtmlarea/version.rb
CHANGED
@@ -43,7 +43,9 @@
|
|
43
43
|
priv.initToolBar.call(this, opts);
|
44
44
|
|
45
45
|
var iframe = this.iframe = $("<iframe/>").height(textarea.height());
|
46
|
-
|
46
|
+
// jQuery.browser is deprecated
|
47
|
+
//iframe.width(textarea.width() - ($.browser.msie ? 0 : 4));
|
48
|
+
iframe.width(textarea.width() - 4;
|
47
49
|
var htmlarea = this.htmlarea = $("<div/>").append(iframe);
|
48
50
|
|
49
51
|
container.append(htmlarea).append(textarea.hide());
|
@@ -79,20 +81,24 @@
|
|
79
81
|
return this.queryCommandValue(a);
|
80
82
|
},
|
81
83
|
getSelectedHTML: function () {
|
82
|
-
if ($.browser.msie) {
|
83
|
-
|
84
|
-
} else {
|
85
|
-
|
86
|
-
|
87
|
-
}
|
84
|
+
// if ($.browser.msie) {
|
85
|
+
// return this.getRange().htmlText;
|
86
|
+
// } else {
|
87
|
+
// var elem = this.getRange().cloneContents();
|
88
|
+
// return $("<p/>").append($(elem)).html();
|
89
|
+
// }
|
90
|
+
var elem = this.getRange().cloneContents();
|
91
|
+
return $("<p/>").append($(elem)).html();
|
92
|
+
|
88
93
|
},
|
89
94
|
getSelection: function () {
|
90
|
-
if ($.browser.msie) {
|
91
|
-
|
92
|
-
|
93
|
-
} else {
|
94
|
-
|
95
|
-
}
|
95
|
+
// if ($.browser.msie) {
|
96
|
+
// //return (this.editor.parentWindow.getSelection) ? this.editor.parentWindow.getSelection() : this.editor.selection;
|
97
|
+
// return this.editor.selection;
|
98
|
+
// } else {
|
99
|
+
// return this.iframe[0].contentDocument.defaultView.getSelection();
|
100
|
+
// }
|
101
|
+
return this.iframe[0].contentDocument.defaultView.getSelection();
|
96
102
|
},
|
97
103
|
getRange: function () {
|
98
104
|
var s = this.getSelection();
|
@@ -111,15 +117,17 @@
|
|
111
117
|
pasteHTML: function (html) {
|
112
118
|
this.iframe[0].contentWindow.focus();
|
113
119
|
var r = this.getRange();
|
114
|
-
if ($.browser.msie) {
|
115
|
-
|
116
|
-
} else if ($.browser.mozilla) {
|
117
|
-
|
118
|
-
|
119
|
-
} else { // Safari
|
120
|
-
|
121
|
-
|
122
|
-
}
|
120
|
+
// if ($.browser.msie) {
|
121
|
+
// r.pasteHTML(html);
|
122
|
+
// } else if ($.browser.mozilla) {
|
123
|
+
// r.deleteContents();
|
124
|
+
// r.insertNode($((html.indexOf("<") != 0) ? $("<span/>").append(html) : html)[0]);
|
125
|
+
// } else { // Safari
|
126
|
+
// r.deleteContents();
|
127
|
+
// r.insertNode($(this.iframe[0].contentWindow.document.createElement("span")).append($((html.indexOf("<") != 0) ? "<span>" + html + "</span>" : html))[0]);
|
128
|
+
// }
|
129
|
+
r.deleteContents();
|
130
|
+
r.insertNode($((html.indexOf("<") != 0) ? $("<span/>").append(html) : html)[0]);
|
123
131
|
r.collapse(false);
|
124
132
|
r.select();
|
125
133
|
},
|
@@ -137,22 +145,24 @@
|
|
137
145
|
underline: function () { this.ec("underline"); },
|
138
146
|
strikeThrough: function () { this.ec("strikethrough"); },
|
139
147
|
image: function (url) {
|
140
|
-
if ($.browser.msie && !url) {
|
141
|
-
|
142
|
-
} else {
|
143
|
-
|
144
|
-
}
|
148
|
+
// if ($.browser.msie && !url) {
|
149
|
+
// this.ec("insertImage", true);
|
150
|
+
// } else {
|
151
|
+
// this.ec("insertImage", false, (url || prompt("Image URL:", "http://")));
|
152
|
+
// }
|
153
|
+
this.ec("insertImage", false, (url || prompt("Image URL:", "http://")));
|
145
154
|
},
|
146
155
|
removeFormat: function () {
|
147
156
|
this.ec("removeFormat", false, []);
|
148
157
|
this.unlink();
|
149
158
|
},
|
150
159
|
link: function () {
|
151
|
-
if ($.browser.msie) {
|
152
|
-
|
153
|
-
} else {
|
154
|
-
|
155
|
-
}
|
160
|
+
// if ($.browser.msie) {
|
161
|
+
// this.ec("createLink", true);
|
162
|
+
// } else {
|
163
|
+
// this.ec("createLink", false, prompt("Link URL:", "http://"));
|
164
|
+
// }
|
165
|
+
this.ec("createLink", false, prompt("Link URL:", "http://"));
|
156
166
|
},
|
157
167
|
unlink: function () { this.ec("unlink", false, []); },
|
158
168
|
orderedList: function () { this.ec("insertorderedlist"); },
|
@@ -182,7 +192,8 @@
|
|
182
192
|
this.heading(6);
|
183
193
|
},
|
184
194
|
heading: function (h) {
|
185
|
-
this.formatBlock($.browser.msie ? "Heading " + h : "h" + h);
|
195
|
+
// this.formatBlock($.browser.msie ? "Heading " + h : "h" + h);
|
196
|
+
this.formatBlock("h" + h);
|
186
197
|
},
|
187
198
|
|
188
199
|
indent: function () {
|
@@ -207,22 +218,24 @@
|
|
207
218
|
},
|
208
219
|
|
209
220
|
increaseFontSize: function () {
|
210
|
-
if ($.browser.msie) {
|
211
|
-
|
212
|
-
} else if ($.browser.safari) {
|
213
|
-
|
214
|
-
} else {
|
215
|
-
|
216
|
-
}
|
221
|
+
// if ($.browser.msie) {
|
222
|
+
// this.ec("fontSize", false, this.qc("fontSize") + 1);
|
223
|
+
// } else if ($.browser.safari) {
|
224
|
+
// this.getRange().surroundContents($(this.iframe[0].contentWindow.document.createElement("span")).css("font-size", "larger")[0]);
|
225
|
+
// } else {
|
226
|
+
// this.ec("increaseFontSize", false, "big");
|
227
|
+
// }
|
228
|
+
this.ec("increaseFontSize", false, "big");
|
217
229
|
},
|
218
230
|
decreaseFontSize: function () {
|
219
|
-
if ($.browser.msie) {
|
220
|
-
|
221
|
-
} else if ($.browser.safari) {
|
222
|
-
|
223
|
-
} else {
|
224
|
-
|
225
|
-
}
|
231
|
+
// if ($.browser.msie) {
|
232
|
+
// this.ec("fontSize", false, this.qc("fontSize") - 1);
|
233
|
+
// } else if ($.browser.safari) {
|
234
|
+
// this.getRange().surroundContents($(this.iframe[0].contentWindow.document.createElement("span")).css("font-size", "smaller")[0]);
|
235
|
+
// } else {
|
236
|
+
// this.ec("decreaseFontSize", false, "small");
|
237
|
+
// }
|
238
|
+
this.ec("decreaseFontSize", false, "small");
|
226
239
|
},
|
227
240
|
|
228
241
|
forecolor: function (c) {
|