jwysiwyg_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +98 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/app/assets/images/ajax-loader.gif +0 -0
- data/app/assets/images/jquery.wysiwyg.bg.png +0 -0
- data/app/assets/images/jquery.wysiwyg.gif +0 -0
- data/app/assets/images/jquery.wysiwyg.jpg +0 -0
- data/app/assets/images/jquery.wysiwyg.no-alpha.gif +0 -0
- data/app/assets/images/plugins/fileManager/icon.png +0 -0
- data/app/assets/images/plugins/fileManager/images/application.png +0 -0
- data/app/assets/images/plugins/fileManager/images/code.png +0 -0
- data/app/assets/images/plugins/fileManager/images/css.png +0 -0
- data/app/assets/images/plugins/fileManager/images/db.png +0 -0
- data/app/assets/images/plugins/fileManager/images/directory.png +0 -0
- data/app/assets/images/plugins/fileManager/images/doc.png +0 -0
- data/app/assets/images/plugins/fileManager/images/file.png +0 -0
- data/app/assets/images/plugins/fileManager/images/film.png +0 -0
- data/app/assets/images/plugins/fileManager/images/flash.png +0 -0
- data/app/assets/images/plugins/fileManager/images/folder_open.png +0 -0
- data/app/assets/images/plugins/fileManager/images/html.png +0 -0
- data/app/assets/images/plugins/fileManager/images/java.png +0 -0
- data/app/assets/images/plugins/fileManager/images/linux.png +0 -0
- data/app/assets/images/plugins/fileManager/images/mkdir.png +0 -0
- data/app/assets/images/plugins/fileManager/images/music.png +0 -0
- data/app/assets/images/plugins/fileManager/images/pdf.png +0 -0
- data/app/assets/images/plugins/fileManager/images/php.png +0 -0
- data/app/assets/images/plugins/fileManager/images/picture.png +0 -0
- data/app/assets/images/plugins/fileManager/images/ppt.png +0 -0
- data/app/assets/images/plugins/fileManager/images/prev-directory.png +0 -0
- data/app/assets/images/plugins/fileManager/images/psd.png +0 -0
- data/app/assets/images/plugins/fileManager/images/remove.png +0 -0
- data/app/assets/images/plugins/fileManager/images/rename.png +0 -0
- data/app/assets/images/plugins/fileManager/images/ruby.png +0 -0
- data/app/assets/images/plugins/fileManager/images/script.png +0 -0
- data/app/assets/images/plugins/fileManager/images/txt.png +0 -0
- data/app/assets/images/plugins/fileManager/images/upload.png +0 -0
- data/app/assets/images/plugins/fileManager/images/xls.png +0 -0
- data/app/assets/images/plugins/fileManager/images/zip.png +0 -0
- data/app/assets/javascripts/controls/wysiwyg.colorpicker.js +250 -0
- data/app/assets/javascripts/controls/wysiwyg.cssWrap.js +134 -0
- data/app/assets/javascripts/controls/wysiwyg.image.js +285 -0
- data/app/assets/javascripts/controls/wysiwyg.link.js +249 -0
- data/app/assets/javascripts/controls/wysiwyg.table.js +129 -0
- data/app/assets/javascripts/i18n/lang.cs.js +116 -0
- data/app/assets/javascripts/i18n/lang.de.js +94 -0
- data/app/assets/javascripts/i18n/lang.en.js +117 -0
- data/app/assets/javascripts/i18n/lang.es.js +94 -0
- data/app/assets/javascripts/i18n/lang.fr.js +94 -0
- data/app/assets/javascripts/i18n/lang.he.js +94 -0
- data/app/assets/javascripts/i18n/lang.hr.js +98 -0
- data/app/assets/javascripts/i18n/lang.it.js +94 -0
- data/app/assets/javascripts/i18n/lang.ja.js +95 -0
- data/app/assets/javascripts/i18n/lang.nl.js +94 -0
- data/app/assets/javascripts/i18n/lang.pl.js +94 -0
- data/app/assets/javascripts/i18n/lang.pt_br.js +94 -0
- data/app/assets/javascripts/i18n/lang.ru.js +117 -0
- data/app/assets/javascripts/i18n/lang.se.js +94 -0
- data/app/assets/javascripts/i18n/lang.sl.js +94 -0
- data/app/assets/javascripts/i18n/lang.zh-cn.js +93 -0
- data/app/assets/javascripts/plugins/wysiwyg.autoload.js +61 -0
- data/app/assets/javascripts/plugins/wysiwyg.fileManager.js +572 -0
- data/app/assets/javascripts/plugins/wysiwyg.fullscreen.js +141 -0
- data/app/assets/javascripts/plugins/wysiwyg.i18n.js +99 -0
- data/app/assets/javascripts/plugins/wysiwyg.rmFormat.js +357 -0
- data/app/assets/stylesheets/jquery.wysiwyg.css +95 -0
- data/app/assets/stylesheets/jquery.wysiwyg.modal.css +62 -0
- data/app/assets/stylesheets/jquery.wysiwyg.old-school.css +63 -0
- data/app/assets/stylesheets/jwysiwyg.css +1 -0
- data/app/assets/stylesheets/plugins/fileManager/wysiwyg.fileManager.css +113 -0
- data/jwysiwyg_rails.gemspec +129 -0
- data/lib/engine.rb +8 -0
- data/lib/jwysiwyg_rails.rb +14 -0
- data/test/helper.rb +18 -0
- data/test/test_jwysiwyg_rails.rb +7 -0
- metadata +219 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
/**
|
2
|
+
* Internationalization plugin
|
3
|
+
*
|
4
|
+
* Depends on jWYSIWYG
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
if (undefined === $.wysiwyg) {
|
8
|
+
throw "wysiwyg.i18n.js depends on $.wysiwyg";
|
9
|
+
}
|
10
|
+
|
11
|
+
/*
|
12
|
+
* Wysiwyg namespace: public properties and methods
|
13
|
+
*/
|
14
|
+
var i18n = {
|
15
|
+
name: "i18n",
|
16
|
+
version: "",
|
17
|
+
defaults: {
|
18
|
+
lang: "en", // change to your language by passing lang option
|
19
|
+
wysiwygLang: "en" // default WYSIWYG language
|
20
|
+
},
|
21
|
+
lang: {},
|
22
|
+
options: {},
|
23
|
+
|
24
|
+
init: function (Wysiwyg, lang) {
|
25
|
+
if (!Wysiwyg.options.plugins[this.name]) {
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
|
29
|
+
this.options = $.extend(true, this.defaults, Wysiwyg.options.plugins[this.name]);
|
30
|
+
|
31
|
+
if (lang) {
|
32
|
+
this.options.lang = lang;
|
33
|
+
} else {
|
34
|
+
lang = this.options.lang;
|
35
|
+
}
|
36
|
+
|
37
|
+
if ((lang !== this.options.wysiwygLang) && (undefined === $.wysiwyg.i18n.lang[lang])) {
|
38
|
+
if ($.wysiwyg.autoload) {
|
39
|
+
$.wysiwyg.autoload.lang("lang." + lang + ".js", function () {
|
40
|
+
$.wysiwyg.i18n.init(Wysiwyg, lang);
|
41
|
+
});
|
42
|
+
} else {
|
43
|
+
throw 'Language "' + lang + '" not found in $.wysiwyg.i18n. You need to include this language file';
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
this.translateControls(Wysiwyg, lang);
|
48
|
+
},
|
49
|
+
|
50
|
+
translateControls: function (Wysiwyg, lang) {
|
51
|
+
Wysiwyg.ui.toolbar.find("li").each(function () {
|
52
|
+
if (Wysiwyg.options.controls[$(this).attr("class")] && Wysiwyg.options.controls[$(this).attr("class")].visible) {
|
53
|
+
$(this).attr("title", $.wysiwyg.i18n.t(Wysiwyg.options.controls[$(this).attr("class")].tooltip, "controls", lang));
|
54
|
+
}
|
55
|
+
});
|
56
|
+
},
|
57
|
+
|
58
|
+
run: function (object, lang) {
|
59
|
+
return object.each(function () {
|
60
|
+
var oWysiwyg = $(this).data("wysiwyg");
|
61
|
+
|
62
|
+
if (!oWysiwyg) {
|
63
|
+
return this;
|
64
|
+
}
|
65
|
+
|
66
|
+
$.wysiwyg.i18n.init(oWysiwyg, lang);
|
67
|
+
});
|
68
|
+
},
|
69
|
+
|
70
|
+
t: function (phrase, section, lang) {
|
71
|
+
var i, section_array, transObject;
|
72
|
+
|
73
|
+
if (!lang) {
|
74
|
+
lang = this.options.lang;
|
75
|
+
}
|
76
|
+
|
77
|
+
if ((lang === this.options.wysiwygLang) || (!this.lang[lang])) {
|
78
|
+
return phrase;
|
79
|
+
}
|
80
|
+
|
81
|
+
transObject = this.lang[lang];
|
82
|
+
section_array = section.split(".");
|
83
|
+
for (i = 0; i < section_array.length; i += 1) {
|
84
|
+
if (transObject[section_array[i]]) {
|
85
|
+
transObject = transObject[section_array[i]];
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
if (transObject[phrase]) {
|
90
|
+
return transObject[phrase];
|
91
|
+
}
|
92
|
+
|
93
|
+
return phrase;
|
94
|
+
}
|
95
|
+
};
|
96
|
+
|
97
|
+
$.wysiwyg.plugin.register(i18n);
|
98
|
+
$.wysiwyg.plugin.listen("initFrame", "i18n.init");
|
99
|
+
})(jQuery);
|
@@ -0,0 +1,357 @@
|
|
1
|
+
/**
|
2
|
+
* rmFormat plugin
|
3
|
+
*
|
4
|
+
* Depends on jWYSIWYG
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
if (undefined === $.wysiwyg) {
|
8
|
+
throw "wysiwyg.rmFormat.js depends on $.wysiwyg";
|
9
|
+
}
|
10
|
+
|
11
|
+
/*
|
12
|
+
* Wysiwyg namespace: public properties and methods
|
13
|
+
*/
|
14
|
+
var rmFormat = {
|
15
|
+
name: "rmFormat",
|
16
|
+
version: "",
|
17
|
+
defaults: {
|
18
|
+
rules: {
|
19
|
+
heading: false,
|
20
|
+
table: false,
|
21
|
+
inlineCSS: false,
|
22
|
+
/*
|
23
|
+
* rmAttr - { "all" | object with names } remove all
|
24
|
+
* attributes or attributes with following names
|
25
|
+
*
|
26
|
+
* rmWhenEmpty - if element contains no text or { \s, \n, <br>, <br/> }
|
27
|
+
* then it will be removed
|
28
|
+
*
|
29
|
+
* rmWhenNoAttr - if element contains no attributes (i.e. <span>Some Text</span>)
|
30
|
+
* then it will be removed
|
31
|
+
*/
|
32
|
+
msWordMarkup: {
|
33
|
+
enabled: false,
|
34
|
+
tags: {
|
35
|
+
"a": {
|
36
|
+
rmWhenEmpty: true
|
37
|
+
},
|
38
|
+
|
39
|
+
"b": {
|
40
|
+
rmWhenEmpty: true
|
41
|
+
},
|
42
|
+
|
43
|
+
"div": {
|
44
|
+
rmWhenEmpty: true,
|
45
|
+
rmWhenNoAttr: true
|
46
|
+
},
|
47
|
+
|
48
|
+
"em": {
|
49
|
+
rmWhenEmpty: true
|
50
|
+
},
|
51
|
+
|
52
|
+
"font": {
|
53
|
+
rmAttr: {
|
54
|
+
"face": "",
|
55
|
+
"size": ""
|
56
|
+
},
|
57
|
+
rmWhenEmpty: true,
|
58
|
+
rmWhenNoAttr: true
|
59
|
+
},
|
60
|
+
|
61
|
+
"h1": {
|
62
|
+
rmAttr: "all",
|
63
|
+
rmWhenEmpty: true
|
64
|
+
},
|
65
|
+
"h2": {
|
66
|
+
rmAttr: "all",
|
67
|
+
rmWhenEmpty: true
|
68
|
+
},
|
69
|
+
"h3": {
|
70
|
+
rmAttr: "all",
|
71
|
+
rmWhenEmpty: true
|
72
|
+
},
|
73
|
+
"h4": {
|
74
|
+
rmAttr: "all",
|
75
|
+
rmWhenEmpty: true
|
76
|
+
},
|
77
|
+
"h5": {
|
78
|
+
rmAttr: "all",
|
79
|
+
rmWhenEmpty: true
|
80
|
+
},
|
81
|
+
"h6": {
|
82
|
+
rmAttr: "all",
|
83
|
+
rmWhenEmpty: true
|
84
|
+
},
|
85
|
+
|
86
|
+
"i": {
|
87
|
+
rmWhenEmpty: true
|
88
|
+
},
|
89
|
+
|
90
|
+
"p": {
|
91
|
+
rmAttr: "all",
|
92
|
+
rmWhenEmpty: true
|
93
|
+
},
|
94
|
+
|
95
|
+
"span": {
|
96
|
+
rmAttr: {
|
97
|
+
lang: ""
|
98
|
+
},
|
99
|
+
rmWhenEmpty: true,
|
100
|
+
rmWhenNoAttr: true
|
101
|
+
},
|
102
|
+
|
103
|
+
"strong": {
|
104
|
+
rmWhenEmpty: true
|
105
|
+
},
|
106
|
+
|
107
|
+
"u": {
|
108
|
+
rmWhenEmpty: true
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
},
|
114
|
+
options: {},
|
115
|
+
enabled: false,
|
116
|
+
debug: false,
|
117
|
+
|
118
|
+
domRemove: function (node) {
|
119
|
+
// replace h1-h6 with p
|
120
|
+
if (this.options.rules.heading) {
|
121
|
+
if (node.nodeName.toLowerCase().match(/^h[1-6]$/)) {
|
122
|
+
// in chromium change this to
|
123
|
+
// $(node).replaceWith($('<p/>').html(node.innerHTML));
|
124
|
+
// to except DOM error: also try in other browsers
|
125
|
+
$(node).replaceWith($('<p/>').html($(node).contents()));
|
126
|
+
|
127
|
+
return true;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
// remove tables not smart enough )
|
132
|
+
if (this.options.rules.table) {
|
133
|
+
if (node.nodeName.toLowerCase().match(/^(table|t[dhr]|t(body|foot|head))$/)) {
|
134
|
+
$(node).replaceWith($(node).contents());
|
135
|
+
|
136
|
+
return true;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
return false;
|
141
|
+
},
|
142
|
+
|
143
|
+
removeStyle: function(node) {
|
144
|
+
if (this.options.rules.inlineCSS) {
|
145
|
+
$(node).removeAttr('style');
|
146
|
+
}
|
147
|
+
},
|
148
|
+
|
149
|
+
domTraversing: function (el, start, end, canRemove, cnt) {
|
150
|
+
if (null === canRemove) {
|
151
|
+
canRemove = false;
|
152
|
+
}
|
153
|
+
|
154
|
+
var isDomRemoved, p;
|
155
|
+
|
156
|
+
while (el) {
|
157
|
+
if (this.debug) { console.log(cnt, "canRemove=", canRemove); }
|
158
|
+
|
159
|
+
this.removeStyle(el);
|
160
|
+
|
161
|
+
if (el.firstElementChild) {
|
162
|
+
|
163
|
+
if (this.debug) { console.log(cnt, "domTraversing", el.firstElementChild); }
|
164
|
+
|
165
|
+
return this.domTraversing(el.firstElementChild, start, end, canRemove, cnt + 1);
|
166
|
+
} else {
|
167
|
+
|
168
|
+
if (this.debug) { console.log(cnt, "routine", el); }
|
169
|
+
|
170
|
+
isDomRemoved = false;
|
171
|
+
|
172
|
+
if (start === el) {
|
173
|
+
canRemove = true;
|
174
|
+
}
|
175
|
+
|
176
|
+
if (canRemove) {
|
177
|
+
if (el.previousElementSibling) {
|
178
|
+
p = el.previousElementSibling;
|
179
|
+
} else {
|
180
|
+
p = el.parentNode;
|
181
|
+
}
|
182
|
+
|
183
|
+
if (this.debug) { console.log(cnt, el.nodeName, el.previousElementSibling, el.parentNode, p); }
|
184
|
+
|
185
|
+
isDomRemoved = this.domRemove(el);
|
186
|
+
if (this.domRemove(el)) {
|
187
|
+
|
188
|
+
if (this.debug) { console.log("p", p); }
|
189
|
+
|
190
|
+
// step back to parent or previousElement to traverse again then element is removed
|
191
|
+
el = p;
|
192
|
+
}
|
193
|
+
|
194
|
+
if (start !== end && end === el) {
|
195
|
+
return true;
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
if (false === isDomRemoved) {
|
200
|
+
el = el.nextElementSibling;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
return false;
|
206
|
+
},
|
207
|
+
|
208
|
+
msWordMarkup: function (text) {
|
209
|
+
var tagName, attrName, rules, reg, regAttr, found, attrs;
|
210
|
+
|
211
|
+
// @link https://github.com/akzhan/jwysiwyg/issues/165
|
212
|
+
text = text.replace(/</g, "<").replace(/>/g, ">");
|
213
|
+
|
214
|
+
text = text.replace(/<meta\s[^>]+>/g, "");
|
215
|
+
text = text.replace(/<link\s[^>]+>/g, "");
|
216
|
+
text = text.replace(/<title>[\s\S]*?<\/title>/g, "");
|
217
|
+
text = text.replace(/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gm, "");
|
218
|
+
text = text.replace(/<w:([^\s>]+)(?:\s[^\/]+)?\/>/g, "");
|
219
|
+
text = text.replace(/<w:([^\s>]+)(?:\s[^>]+)?>[\s\S]*?<\/w:\1>/gm, "");
|
220
|
+
text = text.replace(/<m:([^\s>]+)(?:\s[^\/]+)?\/>/g, "");
|
221
|
+
text = text.replace(/<m:([^\s>]+)(?:\s[^>]+)?>[\s\S]*?<\/m:\1>/gm, "");
|
222
|
+
|
223
|
+
// after running the above.. it still needed these
|
224
|
+
text = text.replace(/<xml>[\s\S]*?<\/xml>/g, "");
|
225
|
+
text = text.replace(/<object(?:\s[^>]*)?>[\s\S]*?<\/object>/g, "");
|
226
|
+
text = text.replace(/<o:([^\s>]+)(?:\s[^\/]+)?\/>/g, "");
|
227
|
+
text = text.replace(/<o:([^\s>]+)(?:\s[^>]+)?>[\s\S]*?<\/o:\1>/gm, "");
|
228
|
+
text = text.replace(/<st1:([^\s>]+)(?:\s[^\/]+)?\/>/g, "");
|
229
|
+
text = text.replace(/<st1:([^\s>]+)(?:\s[^>]+)?>[\s\S]*?<\/st1:\1>/gm, "");
|
230
|
+
// ----
|
231
|
+
text = text.replace(/<!--[^>]+>\s*<[^>]+>/gm, ""); // firefox needed this 1
|
232
|
+
|
233
|
+
|
234
|
+
text = text.replace(/^[\s\n]+/gm, "");
|
235
|
+
|
236
|
+
if (this.options.rules.msWordMarkup.tags) {
|
237
|
+
for (tagName in this.options.rules.msWordMarkup.tags) {
|
238
|
+
rules = this.options.rules.msWordMarkup.tags[tagName];
|
239
|
+
|
240
|
+
if ("string" === typeof (rules)) {
|
241
|
+
if ("" === rules) {
|
242
|
+
reg = new RegExp("<" + tagName + "(?:\\s[^>]+)?/?>", "gmi");
|
243
|
+
text = text.replace(reg, "<" + tagName + ">");
|
244
|
+
}
|
245
|
+
} else if ("object" === typeof (rules)) {
|
246
|
+
reg = new RegExp("<" + tagName + "(\\s[^>]+)?/?>", "gmi");
|
247
|
+
found = reg.exec(text);
|
248
|
+
attrs = "";
|
249
|
+
|
250
|
+
if (found && found[1]) {
|
251
|
+
attrs = found[1];
|
252
|
+
}
|
253
|
+
|
254
|
+
if (rules.rmAttr) {
|
255
|
+
if ("all" === rules.rmAttr) {
|
256
|
+
attrs = "";
|
257
|
+
} else if ("object" === typeof (rules.rmAttr) && attrs) {
|
258
|
+
for (attrName in rules.rmAttr) {
|
259
|
+
regAttr = new RegExp(attrName + '="[^"]*"', "mi");
|
260
|
+
attrs = attrs.replace(regAttr, "");
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
if (attrs) {
|
266
|
+
attrs = attrs.replace(/[\s\n]+/gm, " ");
|
267
|
+
|
268
|
+
if (" " === attrs) {
|
269
|
+
attrs = "";
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
text = text.replace(reg, "<" + tagName + attrs + ">");
|
274
|
+
}
|
275
|
+
}
|
276
|
+
|
277
|
+
for (tagName in this.options.rules.msWordMarkup.tags) {
|
278
|
+
rules = this.options.rules.msWordMarkup.tags[tagName];
|
279
|
+
|
280
|
+
if ("string" === typeof (rules)) {
|
281
|
+
//
|
282
|
+
} else if ("object" === typeof (rules)) {
|
283
|
+
if (rules.rmWhenEmpty) {
|
284
|
+
reg = new RegExp("<" + tagName + "(\\s[^>]+)?>(?:[\\s\\n]|<br/?>)*?</" + tagName + ">", "gmi");
|
285
|
+
text = text.replace(reg, "");
|
286
|
+
}
|
287
|
+
|
288
|
+
if (rules.rmWhenNoAttr) {
|
289
|
+
reg = new RegExp("<" + tagName + ">(?!<" + tagName + ">)([\\s\\S]*?)</" + tagName + ">", "mi");
|
290
|
+
found = reg.exec(text);
|
291
|
+
while (found) {
|
292
|
+
text = text.replace(reg, found[1]);
|
293
|
+
|
294
|
+
found = reg.exec(text);
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}
|
300
|
+
|
301
|
+
return text;
|
302
|
+
},
|
303
|
+
|
304
|
+
run: function (Wysiwyg, options) {
|
305
|
+
options = options || {};
|
306
|
+
this.options = $.extend(true, this.defaults, options);
|
307
|
+
|
308
|
+
if (this.options.rules.heading || this.options.rules.table) {
|
309
|
+
var r = Wysiwyg.getInternalRange(),
|
310
|
+
start,
|
311
|
+
end,
|
312
|
+
node,
|
313
|
+
traversing;
|
314
|
+
|
315
|
+
start = r.startContainer;
|
316
|
+
if (start.nodeType === 3) {
|
317
|
+
start = start.parentNode;
|
318
|
+
}
|
319
|
+
|
320
|
+
end = r.endContainer;
|
321
|
+
if (end.nodeType === 3) {
|
322
|
+
end = end.parentNode;
|
323
|
+
}
|
324
|
+
|
325
|
+
if (this.debug) {
|
326
|
+
console.log("start", start, start.nodeType, start.nodeName, start.parentNode);
|
327
|
+
console.log("end", end, end.nodeType, end.nodeName, end.parentNode);
|
328
|
+
}
|
329
|
+
|
330
|
+
node = r.commonAncestorContainer;
|
331
|
+
if (node.nodeType === 3) {
|
332
|
+
node = node.parentNode;
|
333
|
+
}
|
334
|
+
|
335
|
+
if (this.debug) {
|
336
|
+
console.log("node", node, node.nodeType, node.nodeName.toLowerCase(), node.parentNode, node.firstElementChild);
|
337
|
+
console.log(start === end);
|
338
|
+
}
|
339
|
+
|
340
|
+
traversing = null;
|
341
|
+
if (start === end) {
|
342
|
+
traversing = this.domTraversing(node, start, end, true, 1);
|
343
|
+
} else {
|
344
|
+
traversing = this.domTraversing(node.firstElementChild, start, end, null, 1);
|
345
|
+
}
|
346
|
+
|
347
|
+
if (this.debug) { console.log("DomTraversing=", traversing); }
|
348
|
+
}
|
349
|
+
|
350
|
+
if (this.options.rules.msWordMarkup.enabled) {
|
351
|
+
Wysiwyg.setContent(this.msWordMarkup(Wysiwyg.getContent()));
|
352
|
+
}
|
353
|
+
}
|
354
|
+
};
|
355
|
+
|
356
|
+
$.wysiwyg.plugin.register(rmFormat);
|
357
|
+
})(jQuery);
|
@@ -0,0 +1,95 @@
|
|
1
|
+
|
2
|
+
div.wysiwyg { border: 1px solid #999; padding: 5px; background: #fff url("jquery.wysiwyg.bg.png") repeat-x top; }
|
3
|
+
div.wysiwyg * { margin: 0; padding: 0; }
|
4
|
+
|
5
|
+
div.wysiwyg ul.toolbar li.jwysiwyg-custom-command { overflow: hidden; }
|
6
|
+
|
7
|
+
div.wysiwyg ul.toolbar { border-bottom: 1px solid #ccc; float: left; width: 100%; padding: 0; }
|
8
|
+
div.wysiwyg ul.toolbar li { list-style: none; float: left; margin: 1px 2px 3px 0; background: rgb(240, 240, 240); -moz-user-select: none; -webkit-user-select: none; user-select: none; clear: none; padding: 0 }
|
9
|
+
div.wysiwyg ul.toolbar li.separator { width: 1px; height: 16px; margin: 0 4px; border-left: 1px solid #ccc; }
|
10
|
+
div.wysiwyg ul.toolbar li { text-indent: -5000px; opacity: 0.85; filter: alpha(opacity=85); display: block; width: 16px; height: 16px; background: url('jquery.wysiwyg.gif') no-repeat -64px -80px; border: 1px dotted rgb(240, 240, 240); cursor: pointer; margin: 0px; }
|
11
|
+
div.wysiwyg ul.toolbar li.wysiwyg-button-hover, div.wysiwyg ul.toolbar li.active { opacity: 1.00; filter:alpha(opacity=100); border: 1px outset rgb(224, 224, 224); }
|
12
|
+
div.wysiwyg ul.toolbar li.active { background-color: rgb(255, 255, 64); border: 1px solid rgb(208, 208, 208); border-left-color: #aaa; border-top-color: #aaa; margin: 0; }
|
13
|
+
|
14
|
+
div.wysiwyg ul.toolbar li.disabled, div.wysiwyg ul.toolbar li.wysiwyg-button-hover.disabled, div.wysiwyg ul.toolbar li.active.disabled { opacity: 0.5; filter:alpha(opacity=50); border: 0px none transparent; padding: 1px; cursor: auto; }
|
15
|
+
|
16
|
+
|
17
|
+
div.wysiwyg ul.toolbar li.bold { background-position: 0 -16px; }
|
18
|
+
div.wysiwyg ul.toolbar li.italic { background-position: -16px -16px; }
|
19
|
+
div.wysiwyg ul.toolbar li.strikeThrough { background-position: -32px -16px; }
|
20
|
+
div.wysiwyg ul.toolbar li.underline { background-position: -48px -16px; }
|
21
|
+
div.wysiwyg ul.toolbar li.highlight { background-position: -48px -96px; }
|
22
|
+
|
23
|
+
div.wysiwyg ul.toolbar li.justifyLeft { background-position: 0 0; }
|
24
|
+
div.wysiwyg ul.toolbar li.justifyCenter { background-position: -16px 0; }
|
25
|
+
div.wysiwyg ul.toolbar li.justifyRight { background-position: -32px 0; }
|
26
|
+
div.wysiwyg ul.toolbar li.justifyFull { background-position: -48px 0; }
|
27
|
+
|
28
|
+
div.wysiwyg ul.toolbar li.indent { background-position: -64px 0; }
|
29
|
+
div.wysiwyg ul.toolbar li.outdent { background-position: -80px 0; }
|
30
|
+
|
31
|
+
div.wysiwyg ul.toolbar li.subscript { background-position: -64px -16px; }
|
32
|
+
div.wysiwyg ul.toolbar li.superscript { background-position: -80px -16px; }
|
33
|
+
|
34
|
+
div.wysiwyg ul.toolbar li.undo { background-position: 0 -64px; }
|
35
|
+
div.wysiwyg ul.toolbar li.redo { background-position: -16px -64px; }
|
36
|
+
|
37
|
+
div.wysiwyg ul.toolbar li.insertOrderedList { background-position: -32px -48px; }
|
38
|
+
div.wysiwyg ul.toolbar li.insertUnorderedList { background-position: -16px -48px; }
|
39
|
+
div.wysiwyg ul.toolbar li.insertHorizontalRule { background-position: 0 -48px; }
|
40
|
+
|
41
|
+
div.wysiwyg ul.toolbar li.h1 { background-position: 0 -32px; }
|
42
|
+
div.wysiwyg ul.toolbar li.h2 { background-position: -16px -32px; }
|
43
|
+
div.wysiwyg ul.toolbar li.h3 { background-position: -32px -32px; }
|
44
|
+
div.wysiwyg ul.toolbar li.h4 { background-position: -48px -32px; }
|
45
|
+
div.wysiwyg ul.toolbar li.h5 { background-position: -64px -32px; }
|
46
|
+
div.wysiwyg ul.toolbar li.h6 { background-position: -80px -32px; }
|
47
|
+
|
48
|
+
div.wysiwyg ul.toolbar li.paragraph { background-position: 0px -96px; }
|
49
|
+
div.wysiwyg ul.toolbar li.colorpicker { background-position: -16px -96px; }
|
50
|
+
div.wysiwyg ul.toolbar li.fullscreen { background-position: -32px -96px; }
|
51
|
+
|
52
|
+
div.wysiwyg ul.toolbar li.cut { background-position: -32px -64px; }
|
53
|
+
div.wysiwyg ul.toolbar li.copy { background-position: -48px -64px; }
|
54
|
+
div.wysiwyg ul.toolbar li.paste { background-position: -64px -64px; }
|
55
|
+
div.wysiwyg ul.toolbar li.insertTable { background-position: -64px -48px; }
|
56
|
+
|
57
|
+
div.wysiwyg ul.toolbar li.increaseFontSize { background-position: -16px -80px; }
|
58
|
+
div.wysiwyg ul.toolbar li.decreaseFontSize { background-position: -32px -80px; }
|
59
|
+
|
60
|
+
div.wysiwyg ul.toolbar li.createLink { background-position: -80px -48px; }
|
61
|
+
div.wysiwyg ul.toolbar li.insertImage { background-position: -80px -80px; }
|
62
|
+
|
63
|
+
div.wysiwyg ul.toolbar li.html { background-position: -48px -48px; }
|
64
|
+
div.wysiwyg ul.toolbar li.removeFormat { background-position: -80px -64px; }
|
65
|
+
|
66
|
+
div.wysiwyg ul.toolbar li.empty { background-position: -64px -80px; }
|
67
|
+
|
68
|
+
div.wysiwyg ul.toolbar li.code { background-position: -64px -96px; }
|
69
|
+
div.wysiwyg ul.toolbar li.cssWrap { background-position: -80px -96px; }
|
70
|
+
|
71
|
+
div.wysiwyg-dialogRow { float:left; width:100%; font-size: 16px; }
|
72
|
+
|
73
|
+
div.wysiwyg iframe { border: 1px solid #999; clear: left;
|
74
|
+
-moz-box-shadow :inset 0 0 10px rgba(0, 0, 0, 0.4);
|
75
|
+
-webkit-box-shadow :inset 0 0 10px rgba(0, 0, 0, 0.4);
|
76
|
+
box-shadow :inset 0 0 10px rgba(0, 0, 0, 0.4);
|
77
|
+
background-color:white; padding:0px; margin:0; display:block; width: 100%; }
|
78
|
+
|
79
|
+
/* dialog */
|
80
|
+
.wysiwyg-dialog { position:fixed; top:50px; left:50px; width:450px; height:300px; background:transparent; font:14px "Helvetic Neue", Helvetica,Arial,sans-serif; }
|
81
|
+
.wysiwyg-dialog .wysiwyg-dialog-topbar { background:#333; border:1px #111 solid; color:white; padding:10px; position:relative; }
|
82
|
+
.wysiwyg-dialog .wysiwyg-dialog-topbar .wysiwyg-dialog-close-wrapper .wysiwyg-dialog-close-button { color:white; text-decoration:none; display:block; padding:6px 10px; position:absolute; right:12px; top:50%; height:14px; margin-top:-12px; }
|
83
|
+
.wysiwyg-dialog .wysiwyg-dialog-topbar .wysiwyg-dialog-close-wrapper a.wysiwyg-dialog-close-button:hover { background:#666; }
|
84
|
+
.wysiwyg-dialog .wysiwyg-dialog-topbar .wysiwyg-dialog-title { font-size:20px; font-weight:bold; padding:5px; }
|
85
|
+
.wysiwyg-dialog .wysiwyg-dialog-content { border:1px #ccc solid; border-top:0; padding:15px; background:white; }
|
86
|
+
.wysiwyg-dialog-modal-div { position:absolute; top:0px; left:0px; width:100%; height:100%; background-color:rgb(255,255,255); background-color:rgba(0,0,0,0.5); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); -ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";}
|
87
|
+
.wysiwyg-dialog-content form.wysiwyg fieldset { border:1px #ccc solid; }
|
88
|
+
.wysiwyg-dialog-content form.wysiwyg legend { padding:7px; }
|
89
|
+
.wysiwyg-dialog-content form.wysiwyg .form-row { clear:both; padding:4px 0; }
|
90
|
+
.wysiwyg-dialog-content form.wysiwyg .form-row label, .wysiwyg-dialog form.wysiwyg .form-row .form-row-key { display:block; float:left; width:35%; text-align:right; padding:4px 5px; }
|
91
|
+
.wysiwyg-dialog-content form.wysiwyg .form-row .form-row-value { display:block; float:left; width:55%; }
|
92
|
+
.wysiwyg-dialog-content form.wysiwyg .form-row input.width-auto { width:auto; }
|
93
|
+
.wysiwyg-dialog-content form.wysiwyg input.width-small { width:50px; min-width:50px; max-width:50px; }
|
94
|
+
.wysiwyg-dialog-content form.wysiwyg input, .wysiwyg-dialog form.wysiwyg select { padding:2px; width:100%; margin:2px; }
|
95
|
+
.wysiwyg-dialog-content form.wysiwyg input[type=submit], .wysiwyg-dialog form.wysiwyg input[type=reset] { padding:2px 7px; width:auto; }
|
@@ -0,0 +1,62 @@
|
|
1
|
+
form.wysiwyg {
|
2
|
+
background:#fff;
|
3
|
+
padding:1em;
|
4
|
+
border:1px solid #eee;
|
5
|
+
margin:2px;
|
6
|
+
width:25em;
|
7
|
+
}
|
8
|
+
|
9
|
+
form.wysiwyg fieldset div {
|
10
|
+
margin:0.3em 0;
|
11
|
+
clear:both;
|
12
|
+
margin-bottom:5px;
|
13
|
+
}
|
14
|
+
|
15
|
+
form.wysiwyg label {
|
16
|
+
display: block;
|
17
|
+
text-align:right;
|
18
|
+
margin-right:1em;
|
19
|
+
}
|
20
|
+
|
21
|
+
form.wysiwyg legend {
|
22
|
+
color:#0b77b7;
|
23
|
+
font-size:1.2em;
|
24
|
+
}
|
25
|
+
|
26
|
+
form.wysiwyg legend span {
|
27
|
+
width:10em;
|
28
|
+
text-align:right;
|
29
|
+
}
|
30
|
+
|
31
|
+
form.wysiwyg input {
|
32
|
+
padding:0.15em;
|
33
|
+
width:10em;
|
34
|
+
border:1px solid #ddd;
|
35
|
+
background:#fafafa;
|
36
|
+
font:bold 0.95em arial, sans-serif;
|
37
|
+
margin-bottom:5px;
|
38
|
+
-moz-border-radius:0.4em;
|
39
|
+
-khtml-border-radius:0.4em;
|
40
|
+
}
|
41
|
+
|
42
|
+
form.wysiwyg input.width, form.wysiwyg input.height {
|
43
|
+
width: 4em;
|
44
|
+
}
|
45
|
+
|
46
|
+
form.wysiwyg input:hover, form.wysiwyg input:focus {
|
47
|
+
border-color:#c5c5c5;
|
48
|
+
background:#f6f6f6;
|
49
|
+
}
|
50
|
+
|
51
|
+
form.wysiwyg .button{
|
52
|
+
margin-top:8px;
|
53
|
+
}
|
54
|
+
|
55
|
+
form.wysiwyg fieldset {
|
56
|
+
border:1px solid #ddd;
|
57
|
+
padding:0 0.5em 0.5em;
|
58
|
+
}
|
59
|
+
|
60
|
+
form.wysiwyg input.default {
|
61
|
+
color:#bbb;
|
62
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
div.wysiwyg { border: 1px solid #ccc; padding: 5px; background-color: #fff; }
|
3
|
+
div.wysiwyg * { margin: 0; padding: 0; }
|
4
|
+
|
5
|
+
div.wysiwyg ul.toolbar li.jwysiwyg-custom-command { overflow: hidden; }
|
6
|
+
|
7
|
+
div.wysiwyg ul.toolbar { border-bottom: 1px solid #ccc; float: left; width: 100%; padding: 0; }
|
8
|
+
div.wysiwyg ul.toolbar li { list-style: none; float: left; margin: 1px 2px 3px 0; background: rgb(240, 240, 240); -moz-user-select: none; -webkit-user-select: none; user-select: none; clear: none; padding: 0 }
|
9
|
+
div.wysiwyg ul.toolbar li.separator { width: 1px; height: 16px; margin: 0 4px; border-left: 1px solid #ccc; }
|
10
|
+
div.wysiwyg ul.toolbar li { text-indent: -5000px; opacity: 0.85; filter: alpha(opacity=85); display: block; width: 16px; height: 16px; background: url('jquery.wysiwyg.gif') no-repeat -64px -80px; border: 1px dotted rgb(240, 240, 240); cursor: pointer; margin: 0px; }
|
11
|
+
div.wysiwyg ul.toolbar li.wysiwyg-button-hover, div.wysiwyg ul.toolbar li.active { opacity: 1.00; filter:alpha(opacity=100); border: 1px outset rgb(224, 224, 224); }
|
12
|
+
div.wysiwyg ul.toolbar li.active { background-color: rgb(255, 255, 64); border: 1px solid rgb(208, 208, 208); border-left-color: #aaa; border-top-color: #aaa; margin: 0; }
|
13
|
+
|
14
|
+
div.wysiwyg ul.toolbar li.disabled, div.wysiwyg ul.toolbar li.wysiwyg-button-hover.disabled, div.wysiwyg ul.toolbar li.active.disabled { opacity: 0.5; filter:alpha(opacity=50); border: 0px none transparent; padding: 1px; pointer: auto; }
|
15
|
+
|
16
|
+
div.wysiwyg ul.toolbar li.bold { background-position: 0 -16px; }
|
17
|
+
div.wysiwyg ul.toolbar li.italic { background-position: -16px -16px; }
|
18
|
+
div.wysiwyg ul.toolbar li.strikeThrough { background-position: -32px -16px; }
|
19
|
+
div.wysiwyg ul.toolbar li.underline { background-position: -48px -16px; }
|
20
|
+
|
21
|
+
div.wysiwyg ul.toolbar li.justifyLeft { background-position: 0 0; }
|
22
|
+
div.wysiwyg ul.toolbar li.justifyCenter { background-position: -16px 0; }
|
23
|
+
div.wysiwyg ul.toolbar li.justifyRight { background-position: -32px 0; }
|
24
|
+
div.wysiwyg ul.toolbar li.justifyFull { background-position: -48px 0; }
|
25
|
+
|
26
|
+
div.wysiwyg ul.toolbar li.indent { background-position: -64px 0; }
|
27
|
+
div.wysiwyg ul.toolbar li.outdent { background-position: -80px 0; }
|
28
|
+
|
29
|
+
div.wysiwyg ul.toolbar li.subscript { background-position: -64px -16px; }
|
30
|
+
div.wysiwyg ul.toolbar li.superscript { background-position: -80px -16px; }
|
31
|
+
|
32
|
+
div.wysiwyg ul.toolbar li.undo { background-position: 0 -64px; }
|
33
|
+
div.wysiwyg ul.toolbar li.redo { background-position: -16px -64px; }
|
34
|
+
|
35
|
+
div.wysiwyg ul.toolbar li.insertOrderedList { background-position: -32px -48px; }
|
36
|
+
div.wysiwyg ul.toolbar li.insertUnorderedList { background-position: -16px -48px; }
|
37
|
+
div.wysiwyg ul.toolbar li.insertHorizontalRule { background-position: 0 -48px; }
|
38
|
+
|
39
|
+
div.wysiwyg ul.toolbar li.h1 { background-position: 0 -32px; }
|
40
|
+
div.wysiwyg ul.toolbar li.h2 { background-position: -16px -32px; }
|
41
|
+
div.wysiwyg ul.toolbar li.h3 { background-position: -32px -32px; }
|
42
|
+
div.wysiwyg ul.toolbar li.h4 { background-position: -48px -32px; }
|
43
|
+
div.wysiwyg ul.toolbar li.h5 { background-position: -64px -32px; }
|
44
|
+
div.wysiwyg ul.toolbar li.h6 { background-position: -80px -32px; }
|
45
|
+
|
46
|
+
div.wysiwyg ul.toolbar li.cut { background-position: -32px -64px; }
|
47
|
+
div.wysiwyg ul.toolbar li.copy { background-position: -48px -64px; }
|
48
|
+
div.wysiwyg ul.toolbar li.paste { background-position: -64px -64px; }
|
49
|
+
div.wysiwyg ul.toolbar li.insertTable { background-position: -64px -48px; }
|
50
|
+
|
51
|
+
div.wysiwyg ul.toolbar li.increaseFontSize { background-position: -16px -80px; }
|
52
|
+
div.wysiwyg ul.toolbar li.decreaseFontSize { background-position: -32px -80px; }
|
53
|
+
|
54
|
+
div.wysiwyg ul.toolbar li.createLink { background-position: -80px -48px; }
|
55
|
+
div.wysiwyg ul.toolbar li.insertImage { background-position: -80px -80px; }
|
56
|
+
|
57
|
+
div.wysiwyg ul.toolbar li.html { background-position: -48px -48px; }
|
58
|
+
div.wysiwyg ul.toolbar li.removeFormat { background-position: -80px -64px; }
|
59
|
+
|
60
|
+
div.wysiwyg ul.toolbar li.empty { background-position: -64px -80px; }
|
61
|
+
|
62
|
+
div.wysiwyg iframe { border: 0; clear: left; margin: 4px 0 0 1px; }
|
63
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
/* hello !!!*/
|