wysibb 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/lib/wysibb/version.rb +3 -0
- data/lib/wysibb.rb +6 -0
- data/vendor/assets/javascripts/lang/ar.js +74 -0
- data/vendor/assets/javascripts/lang/cn.js +75 -0
- data/vendor/assets/javascripts/lang/de.js +76 -0
- data/vendor/assets/javascripts/lang/fr.js +72 -0
- data/vendor/assets/javascripts/lang/pl.js +68 -0
- data/vendor/assets/javascripts/lang/ru.js +77 -0
- data/vendor/assets/javascripts/lang/tr.js +68 -0
- data/vendor/assets/javascripts/lang/ua.js +75 -0
- data/vendor/assets/javascripts/lang/vn.js +71 -0
- data/vendor/assets/javascripts/preset/phpbb3.js +172 -0
- data/vendor/assets/javascripts/wysibb.jquery.json +32 -0
- data/vendor/assets/javascripts/wysibb.js +3026 -0
- data/vendor/assets/javascripts/wysibb.min.js +5 -0
- data/vendor/assets/stylesheets/wysibb/wbbtheme.css +770 -0
- data/vendor/assets/stylesheets/wysibb/wysibbiconfont-wb.eot +0 -0
- data/vendor/assets/stylesheets/wysibb/wysibbiconfont-wb.ttf +0 -0
- data/vendor/assets/stylesheets/wysibb/wysibbiconfont-wb.woff +0 -0
- data/wysibb.gemspec +23 -0
- metadata +97 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
if (typeof (WBBLANG)=="undefined") {WBBLANG = {};}
|
2
|
+
WBBLANG['ua'] = {
|
3
|
+
bold: "Напівжирний",
|
4
|
+
italic: "Курсив",
|
5
|
+
underline: "Підкреслений",
|
6
|
+
strike: "Закреслений",
|
7
|
+
link: "Посилання",
|
8
|
+
img: "Зображення",
|
9
|
+
sup: "Надрядковий текст",
|
10
|
+
sub: "Підрядковий текст",
|
11
|
+
justifyleft: "Текст по лівому краю",
|
12
|
+
justifycenter: "Текст по центру",
|
13
|
+
justifyright: "Текст по правому краю",
|
14
|
+
table: "Вставити таблицу",
|
15
|
+
bullist: "Звичайний список",
|
16
|
+
numlist: "Нумерований список",
|
17
|
+
quote: "Цитата",
|
18
|
+
offtop: "Оффтоп",
|
19
|
+
code: "Код",
|
20
|
+
spoiler: "Текст, який згортається",
|
21
|
+
fontcolor: "Колір тексту",
|
22
|
+
fontsize: "Розмір тексту",
|
23
|
+
fontfamily: "Шрифт тексту",
|
24
|
+
fs_verysmall: "Дуже маленький",
|
25
|
+
fs_small: "Маленький",
|
26
|
+
fs_normal: "Нормальний",
|
27
|
+
fs_big: "Великий",
|
28
|
+
fs_verybig: "Дуже великий",
|
29
|
+
smilebox: "Вставити смайл",
|
30
|
+
video: "Вставити відео",
|
31
|
+
removeFormat: "Видалити форматування",
|
32
|
+
|
33
|
+
modal_link_title: "Вставити посилання",
|
34
|
+
modal_link_text: "Видимий текст",
|
35
|
+
modal_link_url: "URL посилання",
|
36
|
+
modal_email_text: "Ел. адреса, яка відображатиметься",
|
37
|
+
modal_email_url: "Email",
|
38
|
+
modal_link_tab1: "Вставити URL",
|
39
|
+
|
40
|
+
modal_img_title: "Вставити зображення",
|
41
|
+
modal_img_tab1: "Ввести URL",
|
42
|
+
modal_img_tab2: "Завантажити файл",
|
43
|
+
modal_imgsrc_text: "Введіть адрес зображення",
|
44
|
+
modal_img_btn: "Виберіть файл для завантаження",
|
45
|
+
add_attach: "Додати вкладений файл",
|
46
|
+
|
47
|
+
modal_video_text: "Введіть URL відео",
|
48
|
+
|
49
|
+
close: "Закрити",
|
50
|
+
save: "Зберегти",
|
51
|
+
cancel: "Відміна",
|
52
|
+
remove: "Видалити",
|
53
|
+
|
54
|
+
validation_err: "Введенні дані некоректні",
|
55
|
+
error_onupload: "Помилка під час завантаження файлу або таке розширення файла не підтримується",
|
56
|
+
|
57
|
+
fileupload_text1: "Перетягніть файл сюди",
|
58
|
+
fileupload_text2: "або",
|
59
|
+
|
60
|
+
loading: "Завантаження",
|
61
|
+
auto: "Авто",
|
62
|
+
views: "Переглядів",
|
63
|
+
downloads: "Завантажень",
|
64
|
+
|
65
|
+
//smiles
|
66
|
+
sm1: "Посмішка",
|
67
|
+
sm2: "Сміх",
|
68
|
+
sm3: "Подморгування",
|
69
|
+
sm4: "Дякую, клас",
|
70
|
+
sm5: "Сварю",
|
71
|
+
sm6: "Шок",
|
72
|
+
sm7: "Злий",
|
73
|
+
sm8: "Засмучення",
|
74
|
+
sm9: "Нудить"
|
75
|
+
};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
if (typeof (WBBLANG)=="undefined") {WBBLANG = {};}
|
2
|
+
WBBLANG['vi'] = {
|
3
|
+
bold: "In đậm",
|
4
|
+
italic: "In nghiêng",
|
5
|
+
underline: "Gạch chân",
|
6
|
+
strike: "Gạch ngang",
|
7
|
+
link: "Liên kết",
|
8
|
+
img: "Hình ảnh",
|
9
|
+
sup: "Superscript",
|
10
|
+
sub: "Subscript",
|
11
|
+
justifyleft: "Canh trái",
|
12
|
+
justifycenter: "Canh giữa",
|
13
|
+
justifyright: "Canh phải",
|
14
|
+
table: "Bảng",
|
15
|
+
bullist: "Bullit",
|
16
|
+
numlist: "Numlist",
|
17
|
+
quote: "Quote",
|
18
|
+
offtop: "Offtop",
|
19
|
+
code: "Code",
|
20
|
+
spoiler: "Ẩn hiện văn bản",
|
21
|
+
fontcolor: "Màu chữ",
|
22
|
+
fontsize: "Size chữ",
|
23
|
+
fontfamily: "Font chữ",
|
24
|
+
fs_verysmall: "Rất nhỏ",
|
25
|
+
fs_small: "Nhỏ",
|
26
|
+
fs_normal: "Bình thường",
|
27
|
+
fs_big: "Lớn",
|
28
|
+
fs_verybig: "Rất lớn",
|
29
|
+
smilebox: "Box Smile",
|
30
|
+
video: "Hình ảnh",
|
31
|
+
|
32
|
+
modal_link_title: "Chèn Link vào bài viết",
|
33
|
+
modal_link_text: "Text hiển thị",
|
34
|
+
modal_link_url: "URL trang",
|
35
|
+
modal_email_text: "Chèn Email liên hệ",
|
36
|
+
modal_email_url: "Email",
|
37
|
+
modal_link_tab1: "Insert URL",
|
38
|
+
|
39
|
+
modal_img_title: "Insert IMG",
|
40
|
+
modal_img_tab1: "Nhập URL",
|
41
|
+
modal_img_tab2: "Tải lên",
|
42
|
+
modal_imgsrc_text: "Nhập địa chỉ hình ảnh",
|
43
|
+
modal_img_btn: "Chọn hình ảnh tải lên",
|
44
|
+
|
45
|
+
modal_video_text: "Nhập URL video",
|
46
|
+
|
47
|
+
close: "Đóng",
|
48
|
+
save: "Lưu",
|
49
|
+
cancel: "Hủy",
|
50
|
+
remove: "Xóa",
|
51
|
+
|
52
|
+
validation_err: "Dữ liệu nhập không hợp lệ",
|
53
|
+
error_onupload: "Lỗi Upload tập tin",
|
54
|
+
|
55
|
+
fileupload_text1: "Kéo hình ảnh vào đây",
|
56
|
+
fileupload_text2: "Hoặc",
|
57
|
+
|
58
|
+
loading: "Đang tải...",
|
59
|
+
auto: "Chọn màu",
|
60
|
+
|
61
|
+
//smiles
|
62
|
+
sm1: "Nụ cười",
|
63
|
+
sm2: "Cười",
|
64
|
+
sm3: "Nháy mắt",
|
65
|
+
sm4: "Cảm ơn bạn",
|
66
|
+
sm5: "Thề",
|
67
|
+
sm6: "Sốc",
|
68
|
+
sm7: "Ác",
|
69
|
+
sm8: "Đau buồn",
|
70
|
+
sm9: "Bệnh hoạn"
|
71
|
+
};
|
@@ -0,0 +1,172 @@
|
|
1
|
+
WBBPRESET = {
|
2
|
+
bodyClass: "content content-phpbb3",
|
3
|
+
buttons: 'bold,italic,underline,|,quote,code,bullist,numlist,|,img,link,smilebox,fontsize,fontcolor',
|
4
|
+
traceTextarea: true,
|
5
|
+
allButtons: {
|
6
|
+
quote: {
|
7
|
+
transform: {
|
8
|
+
'<blockquote class="uncited"><div>{SELTEXT}</div></blockquote>':'[quote]{SELTEXT}[/quote]',
|
9
|
+
'<blockquote><div><cite>{AUTHOR} писал(а):</cite>{SELTEXT}</div></blockquote>':'[quote="{AUTHOR}"]{SELTEXT}[/quote]'
|
10
|
+
}
|
11
|
+
},
|
12
|
+
code: {
|
13
|
+
transform: {
|
14
|
+
'<dl class="codebox"><dt>Код: <a href="#">Выделить всё</a></dt><dd><code>{SELTEXT}</code></dd></dl>':'[code]{SELTEXT}[/code]'
|
15
|
+
}
|
16
|
+
},
|
17
|
+
bullist: {
|
18
|
+
transform: {
|
19
|
+
'<ul>{SELTEXT}</ul>':'[list]{SELTEXT}[/list]',
|
20
|
+
'<li>{SELTEXT}</li>':'[*]{SELTEXT[^\[\]\*]}'
|
21
|
+
}
|
22
|
+
},
|
23
|
+
numlist: {
|
24
|
+
transform: {
|
25
|
+
'<ol>{SELTEXT}</ol>':'[list=1]{SELTEXT}[/list]',
|
26
|
+
'<li>{SELTEXT}</li>':'[*]{SELTEXT[^\[\]\*]}'
|
27
|
+
}
|
28
|
+
},
|
29
|
+
attach: {
|
30
|
+
title: CURLANG.add_attach,
|
31
|
+
buttonHTML: '<span class="fonticon ve-tlb-attach1">\uE017</span>',
|
32
|
+
hotkey: 'ctrl+shift+5',
|
33
|
+
modal: {
|
34
|
+
title: CURLANG.add_attach,
|
35
|
+
width: "600px",
|
36
|
+
tabs: [
|
37
|
+
{
|
38
|
+
title: CURLANG.add_attach,
|
39
|
+
html: '<div id="imguploader"> <form id="fupform" class="upload" action="{img_uploadurl}" method="post" enctype="multipart/form-data" target="fupload"><input type="hidden" name="iframe" value="1"/><input type="hidden" name="idarea" value="message" /><div class="fileupload"><input id="fileupl" class="file" type="file" name="img" /><button id="nicebtn" class="wbb-button">'+CURLANG.modal_img_btn+'</button> </div> </form> </div><iframe id="fupload" name="fupload" src="about:blank" frameborder="0" style="width:0px;height:0px;display:none"></iframe></div>'
|
40
|
+
}
|
41
|
+
],
|
42
|
+
onLoad: fileModal
|
43
|
+
},
|
44
|
+
transform: {
|
45
|
+
'<div class="inline-attachment" numimg="{NUM[0-9]}" contenteditable="false"><dl class="file"><dt class="attach-image"><img src="./download/file.php?id={ID[0-9]}"></dt><dd>{ALT} Просмотров: 0</dd></dl></div>':'[attachment={NUM[0-9]}]{ID[0-9]}: {ALT}[/attachment]',
|
46
|
+
'<div class="inline-attachment" num="{NUM[0-9]}" contenteditable="false"><dl class="file"><dt><img src="./styles/prosilver/imageset/icon_topic_attach.gif" width="7" height="10" alt="" title=""><a class="postlink" href="./download/file.php?id={ID[0-9]}">{ALTFILE}</a></dt><dd>Скачиваний: 0</dd></dl></div>':'[attachment={NUM[0-9]}]{ID[0-9]}; {ALTFILE}[/attachment]'
|
47
|
+
|
48
|
+
}
|
49
|
+
}
|
50
|
+
},
|
51
|
+
smilefind: "#smiley-box"
|
52
|
+
}
|
53
|
+
|
54
|
+
//hide smilelist
|
55
|
+
$(document).ready(function() {
|
56
|
+
$("#format-buttons").hide();
|
57
|
+
$("#smiley-box").hide();
|
58
|
+
$("#message-box").css("width","100%");
|
59
|
+
});
|
60
|
+
|
61
|
+
(function($) {
|
62
|
+
//for attachments process
|
63
|
+
$.wysibb.prototype.traceTextareaEvent = function(e) {
|
64
|
+
var data = this.$txtArea.val();
|
65
|
+
if (this.options.bbmode===false && data!="" && $(e.target).closest("div.wysibb").size()==0 && !this.$txtArea.attr("wbbsync")) {
|
66
|
+
if (data.indexOf("[attachment=")!=-1) {
|
67
|
+
var num = data.replace(/\[attachment=(\d+?)\].*/,"$1");
|
68
|
+
var idfile = $("input[name='attachment_data["+num+"][attach_id]']").val();
|
69
|
+
var ext = $("input[name='attachment_data["+num+"][real_filename]']").val().replace(/.*?\.(\w+)$/,"$1");
|
70
|
+
if (ext.match(/(jpg|gif|png|bmp)/)) {
|
71
|
+
data = data.replace(/(\[attachment=\d+\])(.*?)(\[\/attachment\])/,"$1"+idfile+":$2$3");
|
72
|
+
}else{
|
73
|
+
data = data.replace(/(\[attachment=\d+\])(.*?)(\[\/attachment\])/,"$1"+";"+idfile+" $2$3");
|
74
|
+
}
|
75
|
+
}
|
76
|
+
this.insertAtCursor(this.getHTML(data,true));
|
77
|
+
this.$txtArea.val("");
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
$.wysibb.prototype.txtAreaInitContent = function() {
|
82
|
+
var tdata = this.txtArea.value;
|
83
|
+
tdata = tdata.replace(/(\[attachment=(\d+?)\])([^:;]*?)(\[\/attachment\])/g,function(m,left,num,cont,right) {
|
84
|
+
var idfile = $("input[name='attachment_data["+num+"][attach_id]']").val();
|
85
|
+
var ext = $("input[name='attachment_data["+num+"][real_filename]']").val();
|
86
|
+
if (ext) {
|
87
|
+
ext = ext.replace(/.*?\.(\w+)$/,"$1");
|
88
|
+
if (ext.match(/(jpg|gif|png|bmp)/)) {
|
89
|
+
return (left+idfile+":"+cont+right);
|
90
|
+
}else{
|
91
|
+
return (left+cont+";"+idfile+right);
|
92
|
+
}
|
93
|
+
}else{
|
94
|
+
return m;
|
95
|
+
}
|
96
|
+
});
|
97
|
+
this.$body.html(this.getHTML(tdata,true));
|
98
|
+
}
|
99
|
+
|
100
|
+
$.fn.closeModal = function() {
|
101
|
+
this.data("wbb").closeModal();
|
102
|
+
return this.data("wbb");
|
103
|
+
}
|
104
|
+
$.fn.insertAttach = function(id,alt,isimg) {
|
105
|
+
var num=0;
|
106
|
+
while (num<30) {
|
107
|
+
if ($("input[name='attachment_data["+num+"][attach_id]']").size()==0) {
|
108
|
+
break;
|
109
|
+
}
|
110
|
+
num++;
|
111
|
+
}
|
112
|
+
|
113
|
+
this.data("wbb").$txtArea.after('<input type="hidden" name="attachment_data['+num+'][attach_id]" value="'+id+'" /><input type="hidden" name="attachment_data['+num+'][is_orphan]" value="1" /><input type="hidden" name="attachment_data['+num+'][real_filename]" value="'+id+":"+alt+'" /><input type="hidden" name="attachment_data['+num+'][attach_comment]" value="" />');
|
114
|
+
var data = (isimg===true) ? this.data("wbb").getCodeByCommand("attach",{"id":id,"num":num,"alt":alt}):this.data("wbb").getCodeByCommand("attach",{"id":id,"num":num,"altfile":alt});
|
115
|
+
|
116
|
+
this.data("wbb").insertAtCursor(data);
|
117
|
+
return this.data("wbb");
|
118
|
+
}
|
119
|
+
})(jQuery);
|
120
|
+
|
121
|
+
function fileModal() {
|
122
|
+
$.log("fileModal");
|
123
|
+
if (this.options.imgupload===true) {
|
124
|
+
this.$modal.find("#fupform").append('<input type="hidden" name="upload_type" value="1" />');
|
125
|
+
this.$modal.find("#imguploader").dragfileupload({
|
126
|
+
url: this.strf(this.options.img_uploadurl,this.options),
|
127
|
+
themePrefix: this.options.themePrefix,
|
128
|
+
themeName: this.options.themeName,
|
129
|
+
extraParams: {
|
130
|
+
upload_type:this.options.upload_type
|
131
|
+
},
|
132
|
+
success: $.proxy(function(data) {
|
133
|
+
$.log("Success");
|
134
|
+
if (data && data.status==1) {
|
135
|
+
var num=0;
|
136
|
+
while (num<30) {
|
137
|
+
if ($("input[name='attachment_data["+num+"][attach_id]']").size()==0) {
|
138
|
+
break;
|
139
|
+
}
|
140
|
+
num++;
|
141
|
+
}
|
142
|
+
|
143
|
+
this.$txtArea.after('<input type="hidden" name="attachment_data['+num+'][attach_id]" value="'+data.id+'" /><input type="hidden" name="attachment_data['+num+'][is_orphan]" value="1" /><input type="hidden" name="attachment_data['+num+'][real_filename]" value="'+data.id+":"+data.alt+'" /><input type="hidden" name="attachment_data['+num+'][attach_comment]" value="" />');
|
144
|
+
var datastr = (data.isimg===true) ? this.getCodeByCommand("attach",{"id":data.id,"num":num,"alt":data.alt}):this.getCodeByCommand("attach",{"id":data.id,"num":num,"altfile":data.alt});
|
145
|
+
this.insertAtCursor(datastr);
|
146
|
+
}
|
147
|
+
this.closeModal();
|
148
|
+
this.updateUI();
|
149
|
+
},this),
|
150
|
+
validation: ".*$"
|
151
|
+
});
|
152
|
+
|
153
|
+
if ($.browser.msie) {
|
154
|
+
//ie not posting form by security reason, show default file upload
|
155
|
+
$.log("IE not posting form by security reason, show default file upload");
|
156
|
+
this.$modal.find("#nicebtn").hide();
|
157
|
+
this.$modal.find("#fileupl").css("opacity",1);
|
158
|
+
}
|
159
|
+
|
160
|
+
this.$modal.find("#fileupl").bind("change",function() {
|
161
|
+
$("#fupform").submit();
|
162
|
+
});
|
163
|
+
this.$modal.find("#fupform").bind("submit",$.proxy(function(e) {
|
164
|
+
$(e.target).parents("#imguploader").hide().after('<div class="loader"><img src="'+this.options.themePrefix+'/'+this.options.themeName+'/img/loader.gif" /><br/><span>'+CURLANG.loading+'</span></div>').parent().css("text-align","center");
|
165
|
+
},this))
|
166
|
+
|
167
|
+
}else{
|
168
|
+
this.$modal.find(".hastabs").removeClass("hastabs");
|
169
|
+
this.$modal.find("#imguploader").parents(".tab-cont").remove();
|
170
|
+
this.$modal.find(".wbbm-tablist").remove();
|
171
|
+
}
|
172
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"name": "wysibb",
|
3
|
+
"title": "WysiBB - Wysiwyg BBcode editor",
|
4
|
+
"description": "Wysiwyg BBcode editor based on jQuery",
|
5
|
+
"keywords": [
|
6
|
+
"wysibb",
|
7
|
+
"wysiwyg",
|
8
|
+
"bbcode",
|
9
|
+
"editor",
|
10
|
+
"ui"
|
11
|
+
],
|
12
|
+
"version": "1.5.0",
|
13
|
+
"author": {
|
14
|
+
"name": "Vadim Dobroskok",
|
15
|
+
"url": "http://www.wysibb.com"
|
16
|
+
},
|
17
|
+
"maintainers": [],
|
18
|
+
"licenses": [
|
19
|
+
{
|
20
|
+
"type": "MIT",
|
21
|
+
"url": "https://github.com/wbb/WysiBB/blob/master/LICENSE-MIT"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"bugs": "https://github.com/wbb/WysiBB/issues",
|
25
|
+
"homepage": "http://www.wysibb.com",
|
26
|
+
"docs": "http://www.wysibb.com/docs/",
|
27
|
+
"demo": "http://www.wysibb.com/demo/",
|
28
|
+
"download": "http://www.wysibb.com/download/",
|
29
|
+
"dependencies": {
|
30
|
+
"jquery": ">=1.6"
|
31
|
+
}
|
32
|
+
}
|