diff --git a/dist/langs/ar.js b/dist/langs/ar.js new file mode 100644 index 000000000..a2f1e6bf9 --- /dev/null +++ b/dist/langs/ar.js @@ -0,0 +1,67 @@ +/* =========================================================== + * ar.js + * Arabic translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Abo Mokh ahmed (abomokhahmed) + * Github : https://github.com/abomokhahmed + * Reviewed by : Abdellah Chadidi (chadidi) + * Github : https://github.com/chadidi + */ + +jQuery.trumbowyg.langs.ar = { + _dir: 'rtl', + + viewHTML: 'إعرض-HTML', + + undo: 'تراجع', + redo: 'إعادة', + + formatting: 'تنسيق', + + p: 'فقرة', + blockquote: 'اقتباس', + code: 'كود', + header: 'رأس', + + bold: 'عريض', + italic: 'مائل', + strikethrough: 'مشطوب', + underline: 'خطّ سفلي', + + strong: 'بارز', + em: 'تغميق', + del: 'حذف', + + superscript: 'الأس', + subscript: 'أس سفلي', + + unorderedList: 'قائمة غير مرتّبة', + orderedList: 'قائمة مرتّبة', + + insertImage: 'إدراج صورة', + insertVideo: 'إدراج فيديو', + link: 'رابط', + createLink: 'انشاء رابط', + unlink: 'حذف رابط', + + justifyLeft: 'تصحيح للشمال', + justifyCenter: 'توسيط', + justifyRight: 'تصحيح لليمين', + justifyFull: 'تصحيح لكلا الإتّجاهين', + + horizontalRule: 'إدراج خطّ أفقي', + + fullscreen: 'ملء الشاشة', + + close: 'إغلاق', + + submit: 'إرسال', + reset: 'إعادة تعيين', + + required: 'إلزامي', + description: 'وصف', + title: 'عنوان', + text: 'نصّ', + target: 'الهدف' +}; diff --git a/dist/langs/ar.min.js b/dist/langs/ar.min.js new file mode 100644 index 000000000..d9a05bda7 --- /dev/null +++ b/dist/langs/ar.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * ar.js + * Arabic translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Abo Mokh ahmed (abomokhahmed) + * Github : https://github.com/abomokhahmed + * Reviewed by : Abdellah Chadidi (chadidi) + * Github : https://github.com/chadidi + */ +jQuery.trumbowyg.langs.ar={_dir:"rtl",viewHTML:"إعرض-HTML",undo:"تراجع",redo:"إعادة",formatting:"تنسيق",p:"فقرة",blockquote:"اقتباس",code:"كود",header:"رأس",bold:"عريض",italic:"مائل",strikethrough:"مشطوب",underline:"خطّ سفلي",strong:"بارز",em:"تغميق",del:"حذف",superscript:"الأس",subscript:"أس سفلي",unorderedList:"قائمة غير مرتّبة",orderedList:"قائمة مرتّبة",insertImage:"إدراج صورة",insertVideo:"إدراج فيديو",link:"رابط",createLink:"انشاء رابط",unlink:"حذف رابط",justifyLeft:"تصحيح للشمال",justifyCenter:"توسيط",justifyRight:"تصحيح لليمين",justifyFull:"تصحيح لكلا الإتّجاهين",horizontalRule:"إدراج خطّ أفقي",fullscreen:"ملء الشاشة",close:"إغلاق",submit:"إرسال",reset:"إعادة تعيين",required:"إلزامي",description:"وصف",title:"عنوان",text:"نصّ",target:"الهدف"}; \ No newline at end of file diff --git a/dist/langs/az.js b/dist/langs/az.js new file mode 100644 index 000000000..82c2e455a --- /dev/null +++ b/dist/langs/az.js @@ -0,0 +1,63 @@ +/* =========================================================== + * az.js + * Azerbaijani translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Qalib Qurbanov + * Github : https://github.com/qalibqurbanov + */ + +jQuery.trumbowyg.langs.az = { + viewHTML: 'HTML Kodu', + + formatting: 'Formatlama', + p: 'Abzas', + blockquote: 'Sitat', + code: 'Kod', + header: 'Başlıq', + + undo: 'Geri al', + redo: 'İrəli al', + + superscript: 'Sözüstü', + subscript: 'Sözaltı', + + bold: 'Qalın', + italic: 'İtalik', + strikethrough: 'Üzeri xəttli', + underline: 'Altı xəttli', + + strong: 'Qalın', + em: 'Vurğulu', + del: 'Üzəri xəttli', + + unorderedList: 'İşarələnmiş siyahı', + orderedList: 'Nömrələnmiş siyahı', + + insertImage: 'Şəkil yerləşdir', + insertVideo: 'Video yerləşdir', + link: 'Link', + createLink: 'Link yerləşdir', + unlink: 'Linki sil', + + justifyLeft: 'Sola nizamla', + justifyCenter: 'Ortaya nizamla', + justifyRight: 'Sağa nizamla', + justifyFull: 'Üfüqi nizamla', + + horizontalRule: 'Üfüqi xətt əlavə et', + + fullscreen: 'Tam ekran', + + close: 'Bağla', + + submit: 'Təsdiq et', + reset: 'Sıfırla', + + required: 'Vacib', + description: 'Açıqlama', + title: 'Başlıq', + text: 'Mətn', + + removeformat: 'Formatlamanı təmizlə' +}; diff --git a/dist/langs/az.min.js b/dist/langs/az.min.js new file mode 100644 index 000000000..b61e07404 --- /dev/null +++ b/dist/langs/az.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * az.js + * Azerbaijani translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Qalib Qurbanov + * Github : https://github.com/qalibqurbanov + */ +jQuery.trumbowyg.langs.az={viewHTML:"HTML Kodu",formatting:"Formatlama",p:"Abzas",blockquote:"Sitat",code:"Kod",header:"Başlıq",undo:"Geri al",redo:"İrəli al",superscript:"Sözüstü",subscript:"Sözaltı",bold:"Qalın",italic:"İtalik",strikethrough:"Üzeri xəttli",underline:"Altı xəttli",strong:"Qalın",em:"Vurğulu",del:"Üzəri xəttli",unorderedList:"İşarələnmiş siyahı",orderedList:"Nömrələnmiş siyahı",insertImage:"Şəkil yerləşdir",insertVideo:"Video yerləşdir",link:"Link",createLink:"Link yerləşdir",unlink:"Linki sil",justifyLeft:"Sola nizamla",justifyCenter:"Ortaya nizamla",justifyRight:"Sağa nizamla",justifyFull:"Üfüqi nizamla",horizontalRule:"Üfüqi xətt əlavə et",fullscreen:"Tam ekran",close:"Bağla",submit:"Təsdiq et",reset:"Sıfırla",required:"Vacib",description:"Açıqlama",title:"Başlıq",text:"Mətn",removeformat:"Formatlamanı təmizlə"}; \ No newline at end of file diff --git a/dist/langs/bg.js b/dist/langs/bg.js new file mode 100644 index 000000000..4e168182e --- /dev/null +++ b/dist/langs/bg.js @@ -0,0 +1,54 @@ +/* =========================================================== + * bg.js + * Bulgarian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Aleksandar Dimitrov + */ + +jQuery.trumbowyg.langs.bg = { + viewHTML: 'Прегледай HTML', + + formatting: 'Форматиране', + p: 'Параграф', + blockquote: 'Цитат', + code: 'Код', + header: 'Заглавие', + + bold: 'Удебелен', + italic: 'Наклонен', + strikethrough: 'Зачеркнат', + underline: 'Подчертан', + + strong: 'Удебелен', + em: 'Наклонен', + del: 'Зачеркнат', + + unorderedList: 'Обикновен списък', + orderedList: 'Номериран списък', + + insertImage: 'Добави изображение', + insertVideo: 'Добави видео', + link: 'Връзка', + createLink: 'Създай връзка', + unlink: 'Премахни връзката', + + justifyLeft: 'Подравни от ляво', + justifyCenter: 'Центрирай', + justifyRight: 'Подравни от дясно', + justifyFull: 'Подравни по ширина', + + horizontalRule: 'Хоризонтална линия', + + fullscreen: 'На цял екран', + + close: 'Затвори', + + submit: 'Впиши', + reset: 'Отмени', + + required: 'Задължително', + description: 'Описание', + title: 'Заглавие', + text: 'Текст' +}; diff --git a/dist/langs/bg.min.js b/dist/langs/bg.min.js new file mode 100644 index 000000000..1614baa5c --- /dev/null +++ b/dist/langs/bg.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * bg.js + * Bulgarian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Aleksandar Dimitrov + */ +jQuery.trumbowyg.langs.bg={viewHTML:"Прегледай HTML",formatting:"Форматиране",p:"Параграф",blockquote:"Цитат",code:"Код",header:"Заглавие",bold:"Удебелен",italic:"Наклонен",strikethrough:"Зачеркнат",underline:"Подчертан",strong:"Удебелен",em:"Наклонен",del:"Зачеркнат",unorderedList:"Обикновен списък",orderedList:"Номериран списък",insertImage:"Добави изображение",insertVideo:"Добави видео",link:"Връзка",createLink:"Създай връзка",unlink:"Премахни връзката",justifyLeft:"Подравни от ляво",justifyCenter:"Центрирай",justifyRight:"Подравни от дясно",justifyFull:"Подравни по ширина",horizontalRule:"Хоризонтална линия",fullscreen:"На цял екран",close:"Затвори",submit:"Впиши",reset:"Отмени",required:"Задължително",description:"Описание",title:"Заглавие",text:"Текст"}; \ No newline at end of file diff --git a/dist/langs/bn.js b/dist/langs/bn.js new file mode 100644 index 000000000..aa2bfb79e --- /dev/null +++ b/dist/langs/bn.js @@ -0,0 +1,62 @@ +/* =========================================================== + * bn.js + * Bangla translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ahammad Naim + * Website : https://github.com/AhammadNaim + */ + +jQuery.trumbowyg.langs.bn = { + viewHTML: 'HTML দেখান', + + undo: 'পূর্বাবস্থায় ফিরুন', + redo: 'পুনরায় করুন', + + formatting: 'বিন্যাস', + p: 'অনুচ্ছেদ', + blockquote: 'উদ্ধৃতি', + code: 'কোড', + header: 'শিরোনাম', + + bold: 'বোল্ড', + italic: 'ইটালিক', + strikethrough: 'স্ট্রাইকথ্রু', + underline: 'আন্ডারলাইন', + + strong: 'বোল্ড', + em: 'ইটালিক', + del: 'স্ট্রাইকথ্রু', + + superscript: 'সুপারস্ক্রিপ্ট', + subscript: 'সাবস্ক্রিপ্ট', + + unorderedList: 'অসংখ্যায়িত তালিকা', + orderedList: 'সাজানো তালিকা', + + insertImage: 'ছবি', + link: 'লিংক', + createLink: 'লিংক তৈরি করুন', + unlink: 'লিংক মুছুন', + + justifyLeft: 'বামে জাস্টিফাইড', + justifyCenter: 'কেন্দ্রীভূত', + justifyRight: 'ডানে জাস্টিফাইড', + justifyFull: 'জাস্টিফাইড', + + horizontalRule: 'আনুভূমিক দাগ', + removeformat: 'বিন্যাস অপসারণ করুন', + + fullscreen: 'সম্পূর্ণ পর্দায় দেখুন', + + close: 'বন্ধ', + + submit: 'প্রেরণ', + reset: 'বাতিল', + + required: 'আবশ্যক', + description: 'বর্ননা', + title: 'শিরোনাম', + text: 'পাঠ্য', + target: 'লক্ষ্য' +}; diff --git a/dist/langs/bn.min.js b/dist/langs/bn.min.js new file mode 100644 index 000000000..1dda1da56 --- /dev/null +++ b/dist/langs/bn.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * bn.js + * Bangla translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ahammad Naim + * Website : https://github.com/AhammadNaim + */ +jQuery.trumbowyg.langs.bn={viewHTML:"HTML দেখান",undo:"পূর্বাবস্থায় ফিরুন",redo:"পুনরায় করুন",formatting:"বিন্যাস",p:"অনুচ্ছেদ",blockquote:"উদ্ধৃতি",code:"কোড",header:"শিরোনাম",bold:"বোল্ড",italic:"ইটালিক",strikethrough:"স্ট্রাইকথ্রু",underline:"আন্ডারলাইন",strong:"বোল্ড",em:"ইটালিক",del:"স্ট্রাইকথ্রু",superscript:"সুপারস্ক্রিপ্ট",subscript:"সাবস্ক্রিপ্ট",unorderedList:"অসংখ্যায়িত তালিকা",orderedList:"সাজানো তালিকা",insertImage:"ছবি",link:"লিংক",createLink:"লিংক তৈরি করুন",unlink:"লিংক মুছুন",justifyLeft:"বামে জাস্টিফাইড",justifyCenter:"কেন্দ্রীভূত",justifyRight:"ডানে জাস্টিফাইড",justifyFull:"জাস্টিফাইড",horizontalRule:"আনুভূমিক দাগ",removeformat:"বিন্যাস অপসারণ করুন",fullscreen:"সম্পূর্ণ পর্দায় দেখুন",close:"বন্ধ",submit:"প্রেরণ",reset:"বাতিল",required:"আবশ্যক",description:"বর্ননা",title:"শিরোনাম",text:"পাঠ্য",target:"লক্ষ্য"}; \ No newline at end of file diff --git a/dist/langs/by.js b/dist/langs/by.js new file mode 100644 index 000000000..8f991e697 --- /dev/null +++ b/dist/langs/by.js @@ -0,0 +1,61 @@ +/* =========================================================== + * by.js + * Belarusian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Yury Karalkou + */ + +jQuery.trumbowyg.langs.by = { + viewHTML: 'Паглядзець HTML', + + undo: 'Скасаваць', + redo: 'Паўтарыць', + + formatting: 'Фарматаванне', + p: 'Звычайны', + blockquote: 'Цытата', + code: 'Код', + header: 'Загаловак', + + bold: 'Паўтлусты', + italic: 'Курсіў', + strikethrough: 'Закрэслены', + underline: 'Падкрэслены', + + strong: 'Паўтлусты', + em: 'Курсіў', + del: 'Закрэслены', + + superscript: 'Верхні індэкс', + subscript: 'Індэкс', + + unorderedList: 'Звычайны спіс', + orderedList: 'Нумараваны спіс', + + insertImage: 'Уставіць выяву', + insertVideo: 'Уставіць відэа', + link: 'Спасылка', + createLink: 'Уставіць спасылку', + unlink: 'Выдаліць спасылку', + + justifyLeft: 'Па леваму боку', + justifyCenter: 'У цэнтры', + justifyRight: 'Па праваму боку', + justifyFull: 'Па шырыні', + + horizontalRule: 'Гарызантальная лінія', + removeformat: 'Ачысціць фарматаванне', + + fullscreen: 'На ўвесь экран', + + close: 'Зачыніць', + + submit: 'Уставіць', + reset: 'Скасаваць', + + required: 'Абавязкова', + description: 'Апісанне', + title: 'Падказка', + text: 'Тэкст' +}; diff --git a/dist/langs/by.min.js b/dist/langs/by.min.js new file mode 100644 index 000000000..fce437b61 --- /dev/null +++ b/dist/langs/by.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * by.js + * Belarusian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Yury Karalkou + */ +jQuery.trumbowyg.langs.by={viewHTML:"Паглядзець HTML",undo:"Скасаваць",redo:"Паўтарыць",formatting:"Фарматаванне",p:"Звычайны",blockquote:"Цытата",code:"Код",header:"Загаловак",bold:"Паўтлусты",italic:"Курсіў",strikethrough:"Закрэслены",underline:"Падкрэслены",strong:"Паўтлусты",em:"Курсіў",del:"Закрэслены",superscript:"Верхні індэкс",subscript:"Індэкс",unorderedList:"Звычайны спіс",orderedList:"Нумараваны спіс",insertImage:"Уставіць выяву",insertVideo:"Уставіць відэа",link:"Спасылка",createLink:"Уставіць спасылку",unlink:"Выдаліць спасылку",justifyLeft:"Па леваму боку",justifyCenter:"У цэнтры",justifyRight:"Па праваму боку",justifyFull:"Па шырыні",horizontalRule:"Гарызантальная лінія",removeformat:"Ачысціць фарматаванне",fullscreen:"На ўвесь экран",close:"Зачыніць",submit:"Уставіць",reset:"Скасаваць",required:"Абавязкова",description:"Апісанне",title:"Падказка",text:"Тэкст"}; \ No newline at end of file diff --git a/dist/langs/ca.js b/dist/langs/ca.js new file mode 100644 index 000000000..e4df51f00 --- /dev/null +++ b/dist/langs/ca.js @@ -0,0 +1,74 @@ +/* =========================================================== + * ca.js + * Catalan translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : Àlfons Sánchez (alsanan) + * Twitter : @alsanan + * Website : about.me/alsanan + * Github : https://github.com/alsanan + * + * Carles Martínez + * Website : calaix.net + */ + +jQuery.trumbowyg.langs.ca = { + viewHTML: 'Veure HTML', + + undo: 'Desfés', + redo: 'Refés', + + formatting: 'Format', + p: 'Paragraf', + blockquote: 'Citació', + code: 'Codi', + header: 'Títol', + + bold: 'Negreta', + italic: 'Cursiva', + strikethrough: 'Ratllat', + underline: 'Subratllat', + + strong: 'Negreta', + em: 'Cursiva', + del: 'Apagar', + + superscript: 'Superíndex', + subscript: 'Subíndex', + + unorderedList: 'Llista desordenada', + orderedList: 'Llista ordenada', + + insertImage: 'Inserir imatge', + insertVideo: 'Inserir vídeo', + link: 'Enllaç', + createLink: 'Crear un enllaç', + unlink: 'Eliminar enllaç', + + target: 'Obertura', + _self: 'Mateixa pestanya', + _blank: 'Nova pestanya', + + justifyLeft: 'Alinear a esquerra', + justifyCenter: 'Centrar', + justifyRight: 'Alinear a dreta', + justifyFull: 'Justificar', + + horizontalRule: 'Inserir separador horitzontal', + + removeformat: 'Eliminar format', + + fullscreen: 'Pantalla completa', + + close: 'Tancar', + + submit: 'Enviar', + reset: 'Cancel·lar', + + required: 'Obligatori', + description: 'Descripció', + title: 'Títol', + text: 'Text', + + width: 'Amplada' +}; diff --git a/dist/langs/ca.min.js b/dist/langs/ca.min.js new file mode 100644 index 000000000..4c5c2bc65 --- /dev/null +++ b/dist/langs/ca.min.js @@ -0,0 +1,14 @@ +/* =========================================================== + * ca.js + * Catalan translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : Àlfons Sánchez (alsanan) + * Twitter : @alsanan + * Website : about.me/alsanan + * Github : https://github.com/alsanan + * + * Carles Martínez + * Website : calaix.net + */ +jQuery.trumbowyg.langs.ca={viewHTML:"Veure HTML",undo:"Desfés",redo:"Refés",formatting:"Format",p:"Paragraf",blockquote:"Citació",code:"Codi",header:"Títol",bold:"Negreta",italic:"Cursiva",strikethrough:"Ratllat",underline:"Subratllat",strong:"Negreta",em:"Cursiva",del:"Apagar",superscript:"Superíndex",subscript:"Subíndex",unorderedList:"Llista desordenada",orderedList:"Llista ordenada",insertImage:"Inserir imatge",insertVideo:"Inserir vídeo",link:"Enllaç",createLink:"Crear un enllaç",unlink:"Eliminar enllaç",target:"Obertura",_self:"Mateixa pestanya",_blank:"Nova pestanya",justifyLeft:"Alinear a esquerra",justifyCenter:"Centrar",justifyRight:"Alinear a dreta",justifyFull:"Justificar",horizontalRule:"Inserir separador horitzontal",removeformat:"Eliminar format",fullscreen:"Pantalla completa",close:"Tancar",submit:"Enviar",reset:"Cancel·lar",required:"Obligatori",description:"Descripció",title:"Títol",text:"Text",width:"Amplada"}; \ No newline at end of file diff --git a/dist/langs/cs.js b/dist/langs/cs.js new file mode 100644 index 000000000..a75ba3347 --- /dev/null +++ b/dist/langs/cs.js @@ -0,0 +1,63 @@ +/* =========================================================== + * cs.js + * Czech translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jan Svoboda (https://github.com/svoboda-jan) + */ + +jQuery.trumbowyg.langs.cs = { + viewHTML: 'Zobrazit HTML', + + redo: 'Vpřed', + undo: 'Zpět', + + formatting: 'Formátování', + p: 'Odstavec', + blockquote: 'Citace', + code: 'Kód', + header: 'Nadpis', + + bold: 'Tučné', + italic: 'Kurzíva', + strikethrough: 'Přeškrtnuté', + underline: 'Podtržené', + + strong: 'Tučné', + em: 'Zvýraznit', + del: 'Přeškrtnuté', + + superscript: 'Horní index', + subscript: 'Dolní index', + + unorderedList: 'Netříděný seznam', + orderedList: 'Tříděný seznam', + + insertImage: 'Vložit obrázek', + insertVideo: 'Vložit video', + link: 'Odkaz', + createLink: 'Vložit odkaz', + unlink: 'Smazat odkaz', + + justifyLeft: 'Zarovnat doleva', + justifyCenter: 'Zarovnat na střed', + justifyRight: 'Zarovnat doprava', + justifyFull: 'Zarovnat do bloku', + + horizontalRule: 'Vložit vodorovnou čáru', + + + removeformat: 'Vymazat formátování', + fullscreen: 'Režim celé obrazovky', + + close: 'Zavřít', + + submit: 'Potvrdit', + reset: 'Zrušit', + + required: 'Povinné', + description: 'Popis', + title: 'Nadpis', + text: 'Text', + target: 'Cíl' +}; diff --git a/dist/langs/cs.min.js b/dist/langs/cs.min.js new file mode 100644 index 000000000..0a4fc476b --- /dev/null +++ b/dist/langs/cs.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * cs.js + * Czech translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jan Svoboda (https://github.com/svoboda-jan) + */ +jQuery.trumbowyg.langs.cs={viewHTML:"Zobrazit HTML",redo:"Vpřed",undo:"Zpět",formatting:"Formátování",p:"Odstavec",blockquote:"Citace",code:"Kód",header:"Nadpis",bold:"Tučné",italic:"Kurzíva",strikethrough:"Přeškrtnuté",underline:"Podtržené",strong:"Tučné",em:"Zvýraznit",del:"Přeškrtnuté",superscript:"Horní index",subscript:"Dolní index",unorderedList:"Netříděný seznam",orderedList:"Tříděný seznam",insertImage:"Vložit obrázek",insertVideo:"Vložit video",link:"Odkaz",createLink:"Vložit odkaz",unlink:"Smazat odkaz",justifyLeft:"Zarovnat doleva",justifyCenter:"Zarovnat na střed",justifyRight:"Zarovnat doprava",justifyFull:"Zarovnat do bloku",horizontalRule:"Vložit vodorovnou čáru",removeformat:"Vymazat formátování",fullscreen:"Režim celé obrazovky",close:"Zavřít",submit:"Potvrdit",reset:"Zrušit",required:"Povinné",description:"Popis",title:"Nadpis",text:"Text",target:"Cíl"}; \ No newline at end of file diff --git a/dist/langs/da.js b/dist/langs/da.js new file mode 100644 index 000000000..5b8df1de5 --- /dev/null +++ b/dist/langs/da.js @@ -0,0 +1,64 @@ +/* =========================================================== + * da.js + * Danish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Christian Pedersen + * Github : https://github.com/chripede + */ + +jQuery.trumbowyg.langs.da = { + viewHTML: 'Vis HTML', + + undo: 'Fortryd', + redo: 'Anuller fortryd', + + formatting: 'Formattering', + p: 'Afsnit', + blockquote: 'Citat', + code: 'Kode', + header: 'Overskrift', + + bold: 'Fed', + italic: 'Kursiv', + strikethrough: 'Gennemstreg', + underline: 'Understreg', + + strong: 'Vigtig', + em: 'Fremhæv', + del: 'Slettet', + + superscript: 'Hævet skrift', + subscript: 'Sænket skrift', + + unorderedList: 'Uordnet liste', + orderedList: 'Ordnet liste', + + insertImage: 'Indsæt billede', + insertVideo: 'Indsæt video', + link: 'Link', + createLink: 'Indsæt link', + unlink: 'Fjern link', + + justifyLeft: 'Venstrestil', + justifyCenter: 'Centrer', + justifyRight: 'Højrestil', + justifyFull: 'Lige margener', + + horizontalRule: 'Horisontal linie', + removeformat: 'Ryd formattering', + + fullscreen: 'Fuld skærm', + + close: 'Luk', + + submit: 'Bekræft', + reset: 'Annuller', + + required: 'Påkrævet', + description: 'Beskrivelse', + title: 'Titel', + text: 'Tekst', + target: 'Mål', + width: 'Bredde' +}; diff --git a/dist/langs/da.min.js b/dist/langs/da.min.js new file mode 100644 index 000000000..ea8083a27 --- /dev/null +++ b/dist/langs/da.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * da.js + * Danish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Christian Pedersen + * Github : https://github.com/chripede + */ +jQuery.trumbowyg.langs.da={viewHTML:"Vis HTML",undo:"Fortryd",redo:"Anuller fortryd",formatting:"Formattering",p:"Afsnit",blockquote:"Citat",code:"Kode",header:"Overskrift",bold:"Fed",italic:"Kursiv",strikethrough:"Gennemstreg",underline:"Understreg",strong:"Vigtig",em:"Fremhæv",del:"Slettet",superscript:"Hævet skrift",subscript:"Sænket skrift",unorderedList:"Uordnet liste",orderedList:"Ordnet liste",insertImage:"Indsæt billede",insertVideo:"Indsæt video",link:"Link",createLink:"Indsæt link",unlink:"Fjern link",justifyLeft:"Venstrestil",justifyCenter:"Centrer",justifyRight:"Højrestil",justifyFull:"Lige margener",horizontalRule:"Horisontal linie",removeformat:"Ryd formattering",fullscreen:"Fuld skærm",close:"Luk",submit:"Bekræft",reset:"Annuller",required:"Påkrævet",description:"Beskrivelse",title:"Titel",text:"Tekst",target:"Mål",width:"Bredde"}; \ No newline at end of file diff --git a/dist/langs/de.js b/dist/langs/de.js new file mode 100644 index 000000000..e664620dc --- /dev/null +++ b/dist/langs/de.js @@ -0,0 +1,66 @@ +/* =========================================================== + * de.js + * German translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Manfred Timm, johangroe + * Github : https://github.com/Manfred62, https://github.com/johangroe + */ + +jQuery.trumbowyg.langs.de = { + viewHTML: 'HTML anzeigen', + + undo: 'Rückgängig', + redo: 'Wiederholen', + + formatting: 'Formatierung', + p: 'Absatz', + blockquote: 'Zitat', + code: 'Code', + header: 'Überschrift', + + bold: 'Fett', + italic: 'Kursiv', + strikethrough: 'Durchgestrichen', + underline: 'Unterstrichen', + + strong: 'Wichtig', + em: 'Betont', + del: 'Gelöscht', + + superscript: 'Hochgestellt', + subscript: 'Tiefgestellt', + + unorderedList: 'Ungeordnete Liste', + orderedList: 'Geordnete Liste', + + image: 'Bild', + insertImage: 'Bild einfügen', + insertVideo: 'Video einfügen', + link: 'Link', + createLink: 'Link einfügen', + unlink: 'Link entfernen', + + _self: 'Gleicher Tab (Standard)', + _blank: 'Neuer Tab', + + justifyLeft: 'Links ausrichten', + justifyCenter: 'Zentrieren', + justifyRight: 'Rechts ausrichten', + justifyFull: 'Blocksatz', + + horizontalRule: 'Horizontale Linie einfügen', + removeformat: 'Formatierung entfernen', + + fullscreen: 'Vollbild', + + close: 'Schließen', + + submit: 'Bestätigen', + reset: 'Abbrechen', + + required: 'Erforderlich', + description: 'Beschreibung', + title: 'Titel', + text: 'Text' +}; diff --git a/dist/langs/de.min.js b/dist/langs/de.min.js new file mode 100644 index 000000000..1c3f8d2fd --- /dev/null +++ b/dist/langs/de.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * de.js + * German translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Manfred Timm, johangroe + * Github : https://github.com/Manfred62, https://github.com/johangroe + */ +jQuery.trumbowyg.langs.de={viewHTML:"HTML anzeigen",undo:"Rückgängig",redo:"Wiederholen",formatting:"Formatierung",p:"Absatz",blockquote:"Zitat",code:"Code",header:"Überschrift",bold:"Fett",italic:"Kursiv",strikethrough:"Durchgestrichen",underline:"Unterstrichen",strong:"Wichtig",em:"Betont",del:"Gelöscht",superscript:"Hochgestellt",subscript:"Tiefgestellt",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",image:"Bild",insertImage:"Bild einfügen",insertVideo:"Video einfügen",link:"Link",createLink:"Link einfügen",unlink:"Link entfernen",_self:"Gleicher Tab (Standard)",_blank:"Neuer Tab",justifyLeft:"Links ausrichten",justifyCenter:"Zentrieren",justifyRight:"Rechts ausrichten",justifyFull:"Blocksatz",horizontalRule:"Horizontale Linie einfügen",removeformat:"Formatierung entfernen",fullscreen:"Vollbild",close:"Schließen",submit:"Bestätigen",reset:"Abbrechen",required:"Erforderlich",description:"Beschreibung",title:"Titel",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/el.js b/dist/langs/el.js new file mode 100644 index 000000000..6ae0e5255 --- /dev/null +++ b/dist/langs/el.js @@ -0,0 +1,59 @@ +/* =========================================================== + * el.js + * Greek translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Merianos Nikos + * Twitter : @_webresources + * Website : http://www.wp-lion.com + * LinkedIn: https://gr.linkedin.com/in/merianosnikos + * Behance: https://www.behance.net/web_design_blog + */ + +jQuery.trumbowyg.langs.el = { + viewHTML: 'Προβολή κώδικα HTML', + + formatting: 'Μορφοποίηση', + p: 'Παράγραφος', + blockquote: 'Παράθεση', + code: 'Κώδικας', + header: 'Επικεφαλίδα', + + bold: 'Έντονα', + italic: 'Πλάγια', + strikethrough: 'Διαγραφή', + underline: 'Υπογράμμιση', + + strong: 'Έντονα', + em: 'Πλάγια', + del: 'Διαγραφή', + + unorderedList: 'Αταξινόμητη λίστα', + orderedList: 'Ταξινομημένη λίστα', + + insertImage: 'Εισαγωγή εικόνας', + insertVideo: 'Εισαγωγή βίντεο', + link: 'Σύνδεσμος', + createLink: 'Δημιουργία συνδέσμου', + unlink: 'Διαγραφή συνδέσμου', + + justifyLeft: 'Στοίχιση αριστερά', + justifyCenter: 'Στοίχιση στο κέντρο', + justifyRight: 'Στοίχιση δεξιά', + justifyFull: 'Πλήρης στοίχιση', + + horizontalRule: 'Οριζόντια γραμμή', + removeformat: 'Καθαρισμός μορφοποίησης', + + fullscreen: 'Πλήρης οθόνη', + + close: 'Κλείσιμο', + + submit: 'Υποβολή', + reset: 'Επαναφορά', + + required: 'Απαραίτητο', + description: 'Περιγραφή', + title: 'Τίτλος', + text: 'Κείμενο' +}; diff --git a/dist/langs/el.min.js b/dist/langs/el.min.js new file mode 100644 index 000000000..ffb9701c0 --- /dev/null +++ b/dist/langs/el.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * el.js + * Greek translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Merianos Nikos + * Twitter : @_webresources + * Website : http://www.wp-lion.com + * LinkedIn: https://gr.linkedin.com/in/merianosnikos + * Behance: https://www.behance.net/web_design_blog + */ +jQuery.trumbowyg.langs.el={viewHTML:"Προβολή κώδικα HTML",formatting:"Μορφοποίηση",p:"Παράγραφος",blockquote:"Παράθεση",code:"Κώδικας",header:"Επικεφαλίδα",bold:"Έντονα",italic:"Πλάγια",strikethrough:"Διαγραφή",underline:"Υπογράμμιση",strong:"Έντονα",em:"Πλάγια",del:"Διαγραφή",unorderedList:"Αταξινόμητη λίστα",orderedList:"Ταξινομημένη λίστα",insertImage:"Εισαγωγή εικόνας",insertVideo:"Εισαγωγή βίντεο",link:"Σύνδεσμος",createLink:"Δημιουργία συνδέσμου",unlink:"Διαγραφή συνδέσμου",justifyLeft:"Στοίχιση αριστερά",justifyCenter:"Στοίχιση στο κέντρο",justifyRight:"Στοίχιση δεξιά",justifyFull:"Πλήρης στοίχιση",horizontalRule:"Οριζόντια γραμμή",removeformat:"Καθαρισμός μορφοποίησης",fullscreen:"Πλήρης οθόνη",close:"Κλείσιμο",submit:"Υποβολή",reset:"Επαναφορά",required:"Απαραίτητο",description:"Περιγραφή",title:"Τίτλος",text:"Κείμενο"}; \ No newline at end of file diff --git a/dist/langs/es.js b/dist/langs/es.js new file mode 100644 index 000000000..fd6db5a01 --- /dev/null +++ b/dist/langs/es.js @@ -0,0 +1,63 @@ +/* =========================================================== + * es.js + * Spanish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Moisés Márquez + * Email : moises.marquez.g@gmail.com + */ + +jQuery.trumbowyg.langs.es = { + viewHTML: 'Ver HTML', + + undo: 'Deshacer', + redo: 'Rehacer', + + formatting: 'Formato', + p: 'Párrafo', + blockquote: 'Cita', + code: 'Código', + header: 'Título', + + bold: 'Negrita', + italic: 'Cursiva', + strikethrough: 'Tachado', + underline: 'Subrayado', + + strong: 'Negrita', + em: 'Énfasis', + del: 'Borrar', + + superscript: 'Sobrescrito', + subscript: 'Subíndice', + + unorderedList: 'Lista Desordenada', + orderedList: 'Lista Ordenada', + + insertImage: 'Insertar una imagen', + insertVideo: 'Insertar un vídeo', + link: 'Enlace', + createLink: 'Insertar un enlace', + unlink: 'Suprimir un enlace', + + justifyLeft: 'Izquierda', + justifyCenter: 'Centrar', + justifyRight: 'Derecha', + justifyFull: 'Justificado', + + horizontalRule: 'Insertar separador horizontal', + removeformat: 'Eliminar formato', + + fullscreen: 'Pantalla completa', + + close: 'Cerrar', + + submit: 'Enviar', + reset: 'Cancelar', + + required: 'Obligatorio', + description: 'Descripción', + title: 'Título', + text: 'Texto', + target: 'Target' +}; diff --git a/dist/langs/es.min.js b/dist/langs/es.min.js new file mode 100644 index 000000000..16cbb04b7 --- /dev/null +++ b/dist/langs/es.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * es.js + * Spanish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Moisés Márquez + * Email : moises.marquez.g@gmail.com + */ +jQuery.trumbowyg.langs.es={viewHTML:"Ver HTML",undo:"Deshacer",redo:"Rehacer",formatting:"Formato",p:"Párrafo",blockquote:"Cita",code:"Código",header:"Título",bold:"Negrita",italic:"Cursiva",strikethrough:"Tachado",underline:"Subrayado",strong:"Negrita",em:"Énfasis",del:"Borrar",superscript:"Sobrescrito",subscript:"Subíndice",unorderedList:"Lista Desordenada",orderedList:"Lista Ordenada",insertImage:"Insertar una imagen",insertVideo:"Insertar un vídeo",link:"Enlace",createLink:"Insertar un enlace",unlink:"Suprimir un enlace",justifyLeft:"Izquierda",justifyCenter:"Centrar",justifyRight:"Derecha",justifyFull:"Justificado",horizontalRule:"Insertar separador horizontal",removeformat:"Eliminar formato",fullscreen:"Pantalla completa",close:"Cerrar",submit:"Enviar",reset:"Cancelar",required:"Obligatorio",description:"Descripción",title:"Título",text:"Texto",target:"Target"}; \ No newline at end of file diff --git a/dist/langs/es_ar.js b/dist/langs/es_ar.js new file mode 100644 index 000000000..74a7f2c04 --- /dev/null +++ b/dist/langs/es_ar.js @@ -0,0 +1,56 @@ +/* =========================================================== + * es_ar.js + * Spanish (Argentina) translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Félix Vera + * Email : felix.vera@gmail.com + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.es_ar = { + viewHTML: 'Ver HTML', + + formatting: 'Formato', + p: 'Párrafo', + blockquote: 'Cita', + code: 'Código', + header: 'Título', + + bold: 'Negrita', + italic: 'Itálica', + strikethrough: 'Tachado', + underline: 'Subrayado', + + strong: 'Fuere', + em: 'Énfasis', + del: 'Borrar', + + unorderedList: 'Lista Desordenada', + orderedList: 'Lista Ordenada', + + insertImage: 'Insertar una imagen', + insertVideo: 'Insertar un video', + link: 'Vínculo', + createLink: 'Insertar un vínculo', + unlink: 'Suprimir un vínculo', + + justifyLeft: 'Alinear a la Izquierda', + justifyCenter: 'Centrar', + justifyRight: 'Alinear a la Derecha', + justifyFull: 'Justificado', + + horizontalRule: 'Insertar separado Horizontal', + + fullscreen: 'Pantalla Completa', + + close: 'Cerrar', + + submit: 'Enviar', + reset: 'Cancelar', + + required: 'Obligatorio', + description: 'Descripción', + title: 'Título', + text: 'Texto' +}; diff --git a/dist/langs/es_ar.min.js b/dist/langs/es_ar.min.js new file mode 100644 index 000000000..0488482c9 --- /dev/null +++ b/dist/langs/es_ar.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * es_ar.js + * Spanish (Argentina) translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Félix Vera + * Email : felix.vera@gmail.com + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.es_ar={viewHTML:"Ver HTML",formatting:"Formato",p:"Párrafo",blockquote:"Cita",code:"Código",header:"Título",bold:"Negrita",italic:"Itálica",strikethrough:"Tachado",underline:"Subrayado",strong:"Fuere",em:"Énfasis",del:"Borrar",unorderedList:"Lista Desordenada",orderedList:"Lista Ordenada",insertImage:"Insertar una imagen",insertVideo:"Insertar un video",link:"Vínculo",createLink:"Insertar un vínculo",unlink:"Suprimir un vínculo",justifyLeft:"Alinear a la Izquierda",justifyCenter:"Centrar",justifyRight:"Alinear a la Derecha",justifyFull:"Justificado",horizontalRule:"Insertar separado Horizontal",fullscreen:"Pantalla Completa",close:"Cerrar",submit:"Enviar",reset:"Cancelar",required:"Obligatorio",description:"Descripción",title:"Título",text:"Texto"}; \ No newline at end of file diff --git a/dist/langs/et.js b/dist/langs/et.js new file mode 100644 index 000000000..d773feee2 --- /dev/null +++ b/dist/langs/et.js @@ -0,0 +1,65 @@ +/* =========================================================== + * et.js + * Estonian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Mart Leib + * Web: https://voogle.ee + */ + +jQuery.trumbowyg.langs.et = { + viewHTML: 'HTML vaade', + + undo: 'Võta tagasi', + redo: 'Tee uuesti', + + formatting: 'Vorming', + p: 'Lõik', + blockquote: 'Plokktsitaat', + code: 'Kood', + header: 'Pealkiri', + + bold: 'Paks', + italic: 'Kaldkiri', + strikethrough: 'Läbikriipsutatud', + underline: 'Allakriipsutatud', + + strong: 'Tugev rõhutus', + em: 'Rõhutus', + del: 'Eemaldatud', + + superscript: 'Ülemine indeks', + subscript: 'Alumine indeks', + + unorderedList: 'Järjestamata loend', + orderedList: 'Järjestatud loend', + + insertImage: 'Lisa pilt', + insertVideo: 'Lisa video', + link: 'Link', + createLink: 'Lisa link', + unlink: 'Eemalda link', + + justifyLeft: 'Joonda vasakule', + justifyCenter: 'Joonda keskele', + justifyRight: 'Joonda paremale', + justifyFull: 'Joonda rööpselt', + + horizontalRule: 'Horisontaaljoon', + removeformat: 'Eemalda vorming', + + fullscreen: 'Täisekraan', + + close: 'Sulge', + + submit: 'Salvesta', + reset: 'Tühista', + + required: 'Kohustuslik', + description: 'Kirjeldus', + title: 'Pealkiri', + text: 'Tekst', + target: 'Sihtmärk', + width: 'Laius' + +}; diff --git a/dist/langs/et.min.js b/dist/langs/et.min.js new file mode 100644 index 000000000..94c459a16 --- /dev/null +++ b/dist/langs/et.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * et.js + * Estonian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Mart Leib + * Web: https://voogle.ee + */ +jQuery.trumbowyg.langs.et={viewHTML:"HTML vaade",undo:"Võta tagasi",redo:"Tee uuesti",formatting:"Vorming",p:"Lõik",blockquote:"Plokktsitaat",code:"Kood",header:"Pealkiri",bold:"Paks",italic:"Kaldkiri",strikethrough:"Läbikriipsutatud",underline:"Allakriipsutatud",strong:"Tugev rõhutus",em:"Rõhutus",del:"Eemaldatud",superscript:"Ülemine indeks",subscript:"Alumine indeks",unorderedList:"Järjestamata loend",orderedList:"Järjestatud loend",insertImage:"Lisa pilt",insertVideo:"Lisa video",link:"Link",createLink:"Lisa link",unlink:"Eemalda link",justifyLeft:"Joonda vasakule",justifyCenter:"Joonda keskele",justifyRight:"Joonda paremale",justifyFull:"Joonda rööpselt",horizontalRule:"Horisontaaljoon",removeformat:"Eemalda vorming",fullscreen:"Täisekraan",close:"Sulge",submit:"Salvesta",reset:"Tühista",required:"Kohustuslik",description:"Kirjeldus",title:"Pealkiri",text:"Tekst",target:"Sihtmärk",width:"Laius"}; \ No newline at end of file diff --git a/dist/langs/fa.js b/dist/langs/fa.js new file mode 100644 index 000000000..2ca8ff829 --- /dev/null +++ b/dist/langs/fa.js @@ -0,0 +1,58 @@ +/* =========================================================== + * fa.js + * Persian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Kiarash Soleimanzadeh + * Github : https://github.com/kiyarash + * Email : kiarash.s@hotmail.com + */ + +jQuery.trumbowyg.langs.fa = { + _dir: 'rtl', + + viewHTML: 'نمایش کد اچ تی ام ال', + + formatting: 'قالب بندی', + p: 'پاراگراف', + blockquote: 'نقل قول', + code: 'کد', + header: 'سر تیتر', + + bold: 'ضخیم', + italic: 'مورب', + strikethrough: 'میان خط دار', + underline: 'زیر خط دار', + + strong: 'برجسته', + em: 'مورب', + del: 'حذف شده', + + unorderedList: 'لیست نامرتب', + orderedList: 'لیست مرتب', + + insertImage: 'درج تصویر', + insertVideo: 'درج ویدئو', + link: 'لینک', + createLink: 'درج لینک', + unlink: 'حذف لینک', + + justifyLeft: 'تراز به چپ', + justifyCenter: 'تراز به وسط', + justifyRight: 'تراز به راست', + justifyFull: 'تراز به چپ و راست', + + horizontalRule: 'درج خط افقی', + + fullscreen: 'تمام صفحه', + + close: 'بستن', + + submit: 'تائید', + reset: 'انصراف', + + required: 'اجباری', + description: 'توضیحات', + title: 'عنوان', + text: 'متن' +}; diff --git a/dist/langs/fa.min.js b/dist/langs/fa.min.js new file mode 100644 index 000000000..eb5aa0786 --- /dev/null +++ b/dist/langs/fa.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * fa.js + * Persian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Kiarash Soleimanzadeh + * Github : https://github.com/kiyarash + * Email : kiarash.s@hotmail.com + */ +jQuery.trumbowyg.langs.fa={_dir:"rtl",viewHTML:"نمایش کد اچ تی ام ال",formatting:"قالب بندی",p:"پاراگراف",blockquote:"نقل قول",code:"کد",header:"سر تیتر",bold:"ضخیم",italic:"مورب",strikethrough:"میان خط دار",underline:"زیر خط دار",strong:"برجسته",em:"مورب",del:"حذف شده",unorderedList:"لیست نامرتب",orderedList:"لیست مرتب",insertImage:"درج تصویر",insertVideo:"درج ویدئو",link:"لینک",createLink:"درج لینک",unlink:"حذف لینک",justifyLeft:"تراز به چپ",justifyCenter:"تراز به وسط",justifyRight:"تراز به راست",justifyFull:"تراز به چپ و راست",horizontalRule:"درج خط افقی",fullscreen:"تمام صفحه",close:"بستن",submit:"تائید",reset:"انصراف",required:"اجباری",description:"توضیحات",title:"عنوان",text:"متن"}; \ No newline at end of file diff --git a/dist/langs/fi.js b/dist/langs/fi.js new file mode 100644 index 000000000..a2b92cd79 --- /dev/null +++ b/dist/langs/fi.js @@ -0,0 +1,58 @@ +/* =========================================================== + * fi.js + * Finnish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Teppo Koivula (teppokoivula) + * Github : https://github.com/teppokoivula + */ + +jQuery.trumbowyg.langs.fi = { + viewHTML: 'Näytä HTML', + + undo: 'Kumoa', + redo: 'Tee uudelleen', + + formatting: 'Muotoilu', + p: 'Kappale', + blockquote: 'Lainaus', + code: 'Koodi', + header: 'Otsikko', + + bold: 'Lihavointi', + italic: 'Kursivointi', + strikethrough: 'Yliviivaus', + underline: 'Allevivaus', + + strong: 'Vahvennus', + em: 'Painotus', + del: 'Poistettu', + + unorderedList: 'Luettelo', + orderedList: 'Numeroitu luettelo', + + insertImage: 'Lisää kuva', + insertVideo: 'Lisää video', + link: 'Linkki', + createLink: 'Luo linkki', + unlink: 'Poista linkki', + + justifyLeft: 'Tasaa vasemmalle', + justifyCenter: 'Keskitä', + justifyRight: 'Tasaa oikealle', + justifyFull: 'Tasaa', + + horizontalRule: 'Vaakaviiva', + + fullscreen: 'Kokoruutu', + + close: 'Sulje', + + submit: 'Lisää', + reset: 'Palauta', + + required: 'Pakollinen', + description: 'Kuvaus', + title: 'Otsikko', + text: 'Teksti' +}; diff --git a/dist/langs/fi.min.js b/dist/langs/fi.min.js new file mode 100644 index 000000000..28ea650e7 --- /dev/null +++ b/dist/langs/fi.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * fi.js + * Finnish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Teppo Koivula (teppokoivula) + * Github : https://github.com/teppokoivula + */ +jQuery.trumbowyg.langs.fi={viewHTML:"Näytä HTML",undo:"Kumoa",redo:"Tee uudelleen",formatting:"Muotoilu",p:"Kappale",blockquote:"Lainaus",code:"Koodi",header:"Otsikko",bold:"Lihavointi",italic:"Kursivointi",strikethrough:"Yliviivaus",underline:"Allevivaus",strong:"Vahvennus",em:"Painotus",del:"Poistettu",unorderedList:"Luettelo",orderedList:"Numeroitu luettelo",insertImage:"Lisää kuva",insertVideo:"Lisää video",link:"Linkki",createLink:"Luo linkki",unlink:"Poista linkki",justifyLeft:"Tasaa vasemmalle",justifyCenter:"Keskitä",justifyRight:"Tasaa oikealle",justifyFull:"Tasaa",horizontalRule:"Vaakaviiva",fullscreen:"Kokoruutu",close:"Sulje",submit:"Lisää",reset:"Palauta",required:"Pakollinen",description:"Kuvaus",title:"Otsikko",text:"Teksti"}; \ No newline at end of file diff --git a/dist/langs/fr.js b/dist/langs/fr.js new file mode 100644 index 000000000..78a434632 --- /dev/null +++ b/dist/langs/fr.js @@ -0,0 +1,69 @@ +/* =========================================================== + * fr.js + * French translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Reviewed by : Abdou Developer (test20091) + * Github : https://github.com/test20091 + */ + +jQuery.trumbowyg.langs.fr = { + viewHTML: 'Voir le HTML', + + undo: 'Annuler', + redo: 'Refaire', + + formatting: 'Format', + p: 'Paragraphe', + blockquote: 'Citation', + code: 'Code', + header: 'Titre', + + bold: 'Gras', + italic: 'Italique', + strikethrough: 'Barré', + underline: 'Souligné', + + strong: 'Fort', + em: 'Emphase', + del: 'Supprimé', + + superscript: 'Exposant', + subscript: 'Indice', + + unorderedList: 'Liste à puces', + orderedList: 'Liste ordonnée', + + insertImage: 'Insérer une image', + insertVideo: 'Insérer une video', + link: 'Lien', + createLink: 'Insérer un lien', + unlink: 'Supprimer le lien', + + _self: 'Même onglet (par défaut)', + _blank: 'Nouvel onglet', + + justifyLeft: 'Aligner à gauche', + justifyCenter: 'Centrer', + justifyRight: 'Aligner à droite', + justifyFull: 'Justifier', + + horizontalRule: 'Insérer un séparateur horizontal', + removeformat: 'Supprimer formatage', + + fullscreen: 'Plein écran', + + close: 'Fermer', + + submit: 'Valider', + reset: 'Annuler', + + required: 'Obligatoire', + description: 'Description', + title: 'Titre', + text: 'Texte', + target: 'Cible' +}; diff --git a/dist/langs/fr.min.js b/dist/langs/fr.min.js new file mode 100644 index 000000000..577fdec74 --- /dev/null +++ b/dist/langs/fr.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * fr.js + * French translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Reviewed by : Abdou Developer (test20091) + * Github : https://github.com/test20091 + */ +jQuery.trumbowyg.langs.fr={viewHTML:"Voir le HTML",undo:"Annuler",redo:"Refaire",formatting:"Format",p:"Paragraphe",blockquote:"Citation",code:"Code",header:"Titre",bold:"Gras",italic:"Italique",strikethrough:"Barré",underline:"Souligné",strong:"Fort",em:"Emphase",del:"Supprimé",superscript:"Exposant",subscript:"Indice",unorderedList:"Liste à puces",orderedList:"Liste ordonnée",insertImage:"Insérer une image",insertVideo:"Insérer une video",link:"Lien",createLink:"Insérer un lien",unlink:"Supprimer le lien",_self:"Même onglet (par défaut)",_blank:"Nouvel onglet",justifyLeft:"Aligner à gauche",justifyCenter:"Centrer",justifyRight:"Aligner à droite",justifyFull:"Justifier",horizontalRule:"Insérer un séparateur horizontal",removeformat:"Supprimer formatage",fullscreen:"Plein écran",close:"Fermer",submit:"Valider",reset:"Annuler",required:"Obligatoire",description:"Description",title:"Titre",text:"Texte",target:"Cible"}; \ No newline at end of file diff --git a/dist/langs/he.js b/dist/langs/he.js new file mode 100644 index 000000000..a17c33709 --- /dev/null +++ b/dist/langs/he.js @@ -0,0 +1,57 @@ +/* =========================================================== + * he.js + * Hebrew translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Udi Doron (udidoron) + * Github : https://github.com/udidoron + */ + +jQuery.trumbowyg.langs.he = { + _dir: 'rtl', + + viewHTML: 'צפה ב-HTML', + + formatting: 'פורמט', + p: 'פסקה', + blockquote: 'ציטוט', + code: 'קוד', + header: 'ראשית', + + bold: 'מודגש', + italic: 'נטוי', + strikethrough: 'קו חוצה', + underline: 'קו תחתון', + + strong: 'בולט', + em: 'הדגשה', + del: 'נמחק', + + unorderedList: 'רשימה ללא סדר', + orderedList: 'רשימה מסודרת', + + insertImage: 'הכנס תמונה', + insertVideo: 'הכנס סרטון', + link: 'קישור', + createLink: 'צור קישור', + unlink: 'הסר קישור', + + justifyLeft: 'ישר לשמאל', + justifyCenter: 'מרכז', + justifyRight: 'ישר לימין', + justifyFull: 'ישר לשני הצדדים', + + horizontalRule: 'הכנס קו אופקי', + + fullscreen: 'מסך מלא', + + close: 'סגור', + + submit: 'שלח', + reset: 'אתחל מחדש', + + required: 'נחוץ', + description: 'תיאור', + title: 'כותרת', + text: 'טקסט' +}; diff --git a/dist/langs/he.min.js b/dist/langs/he.min.js new file mode 100644 index 000000000..9da297514 --- /dev/null +++ b/dist/langs/he.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * he.js + * Hebrew translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Udi Doron (udidoron) + * Github : https://github.com/udidoron + */ +jQuery.trumbowyg.langs.he={_dir:"rtl",viewHTML:"צפה ב-HTML",formatting:"פורמט",p:"פסקה",blockquote:"ציטוט",code:"קוד",header:"ראשית",bold:"מודגש",italic:"נטוי",strikethrough:"קו חוצה",underline:"קו תחתון",strong:"בולט",em:"הדגשה",del:"נמחק",unorderedList:"רשימה ללא סדר",orderedList:"רשימה מסודרת",insertImage:"הכנס תמונה",insertVideo:"הכנס סרטון",link:"קישור",createLink:"צור קישור",unlink:"הסר קישור",justifyLeft:"ישר לשמאל",justifyCenter:"מרכז",justifyRight:"ישר לימין",justifyFull:"ישר לשני הצדדים",horizontalRule:"הכנס קו אופקי",fullscreen:"מסך מלא",close:"סגור",submit:"שלח",reset:"אתחל מחדש",required:"נחוץ",description:"תיאור",title:"כותרת",text:"טקסט"}; \ No newline at end of file diff --git a/dist/langs/hr.js b/dist/langs/hr.js new file mode 100644 index 000000000..44c47a3f5 --- /dev/null +++ b/dist/langs/hr.js @@ -0,0 +1,54 @@ +/* =========================================================== + * hr.js + * Croatian translation for Trumbowyg + * https://www.github.com/Buda9 + * =========================================================== + * Author : Davor Budimir (https://www.github.com/Buda9) + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.hr = { + viewHTML: 'Poglеdaj HTML kód', + + formatting: 'Formatiranjе', + p: 'Odlomak', + blockquote: 'Citat', + code: 'Kód', + header: 'Zaglavlje', + + bold: 'Podеbljano', + italic: 'Nakošeno', + strikethrough: 'Prеcrtano', + underline: 'Podvučеno', + + strong: 'Podеbljano', + em: 'Istaknuto', + del: 'Obrisano', + + unorderedList: 'Neuređen popis', + orderedList: 'Uređen popis', + insertImage: 'Dodaj sliku', + insertVideo: 'Dodaj vidеo', + link: 'Povezica', + createLink: 'Dodaj povezicu', + unlink: 'Ukloni povezicu', + + justifyLeft: 'Lijеvo poravnanjе', + justifyCenter: 'Središnje poravnanjе', + justifyRight: 'Dеsno poravnanjе', + justifyFull: 'Obostrano poravnanjе', + + horizontalRule: 'Horizontalna crta', + + fullscreen: 'Puni zaslon', + + close: 'Zatvori', + + submit: 'Unеsi', + reset: 'Otkaži', + + required: 'Obavеzno poljе', + description: 'Opis', + title: 'Naslov', + text: 'Tеkst' +}; diff --git a/dist/langs/hr.min.js b/dist/langs/hr.min.js new file mode 100644 index 000000000..ddbdd4d80 --- /dev/null +++ b/dist/langs/hr.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * hr.js + * Croatian translation for Trumbowyg + * https://www.github.com/Buda9 + * =========================================================== + * Author : Davor Budimir (https://www.github.com/Buda9) + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.hr={viewHTML:"Poglеdaj HTML kód",formatting:"Formatiranjе",p:"Odlomak",blockquote:"Citat",code:"Kód",header:"Zaglavlje",bold:"Podеbljano",italic:"Nakošeno",strikethrough:"Prеcrtano",underline:"Podvučеno",strong:"Podеbljano",em:"Istaknuto",del:"Obrisano",unorderedList:"Neuređen popis",orderedList:"Uređen popis",insertImage:"Dodaj sliku",insertVideo:"Dodaj vidеo",link:"Povezica",createLink:"Dodaj povezicu",unlink:"Ukloni povezicu",justifyLeft:"Lijеvo poravnanjе",justifyCenter:"Središnje poravnanjе",justifyRight:"Dеsno poravnanjе",justifyFull:"Obostrano poravnanjе",horizontalRule:"Horizontalna crta",fullscreen:"Puni zaslon",close:"Zatvori",submit:"Unеsi",reset:"Otkaži",required:"Obavеzno poljе",description:"Opis",title:"Naslov",text:"Tеkst"}; \ No newline at end of file diff --git a/dist/langs/hu.js b/dist/langs/hu.js new file mode 100644 index 000000000..a671f26b0 --- /dev/null +++ b/dist/langs/hu.js @@ -0,0 +1,61 @@ +/* =========================================================== + * hu.js + * Hungarian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Peter MATO + * Web: http://fixme.hu + * GitHub: https://github.com/matopeter + */ + +jQuery.trumbowyg.langs.hu = { + viewHTML: 'HTML nézet', + + undo: 'Visszavon', + redo: 'Visszállít', + + formatting: 'Stílusok', + + p: 'Bekezdés', + blockquote: 'Idézet', + code: 'Kód', + header: 'Címsor', + + bold: 'Félkövér', + italic: 'Dőlt', + strikethrough: 'Áthúzott', + underline: 'Aláhúzott', + + strong: 'Vastag', + em: 'Kiemelt', + del: 'Törölt', + + unorderedList: 'Felsorolás', + orderedList: 'Számozás', + + insertImage: 'Kép beszúrása', + insertVideo: 'Video beszúrása', + link: 'Link', + createLink: 'Link létrehozása', + unlink: 'Link eltávolítása', + + justifyLeft: 'Balra igazítás', + justifyCenter: 'Középre igazítás', + justifyRight: 'Jobbra igazítás', + justifyFull: 'Sorkizárt', + + horizontalRule: 'Vízszintes vonal', + + fullscreen: 'Teljes képernyő', + close: 'Bezár', + + submit: 'Beküldés', + reset: 'Alaphelyzet', + + required: 'Kötelező', + description: 'Leírás', + title: 'Cím', + text: 'Szöveg', + + removeformat: 'Formázás eltávolítása' +}; diff --git a/dist/langs/hu.min.js b/dist/langs/hu.min.js new file mode 100644 index 000000000..e0a778e9a --- /dev/null +++ b/dist/langs/hu.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * hu.js + * Hungarian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Peter MATO + * Web: http://fixme.hu + * GitHub: https://github.com/matopeter + */ +jQuery.trumbowyg.langs.hu={viewHTML:"HTML nézet",undo:"Visszavon",redo:"Visszállít",formatting:"Stílusok",p:"Bekezdés",blockquote:"Idézet",code:"Kód",header:"Címsor",bold:"Félkövér",italic:"Dőlt",strikethrough:"Áthúzott",underline:"Aláhúzott",strong:"Vastag",em:"Kiemelt",del:"Törölt",unorderedList:"Felsorolás",orderedList:"Számozás",insertImage:"Kép beszúrása",insertVideo:"Video beszúrása",link:"Link",createLink:"Link létrehozása",unlink:"Link eltávolítása",justifyLeft:"Balra igazítás",justifyCenter:"Középre igazítás",justifyRight:"Jobbra igazítás",justifyFull:"Sorkizárt",horizontalRule:"Vízszintes vonal",fullscreen:"Teljes képernyő",close:"Bezár",submit:"Beküldés",reset:"Alaphelyzet",required:"Kötelező",description:"Leírás",title:"Cím",text:"Szöveg",removeformat:"Formázás eltávolítása"}; \ No newline at end of file diff --git a/dist/langs/id.js b/dist/langs/id.js new file mode 100644 index 000000000..0aee9ea7f --- /dev/null +++ b/dist/langs/id.js @@ -0,0 +1,57 @@ +/* =========================================================== + * id.js + * Indonesian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Rezha Julio (kimiamania) + * Twitter : @kimiamania + * Website : http://rezhajulio.web.id + * Github : https://github.com/kimiamania + */ + +jQuery.trumbowyg.langs.id = { + viewHTML: 'Lihat HTML', + + formatting: 'Penyusunan', + p: 'Paragraf', + blockquote: 'Kutipan', + code: 'Kode', + header: 'Kepala', + + bold: 'Tebal', + italic: 'Miring', + strikethrough: 'Coret', + underline: 'Garis bawah', + + strong: 'Tebal', + em: 'Miring', + del: 'Dicoret', + + unorderedList: 'Daftar tak teratur', + orderedList: 'Daftar teratur', + + insertImage: 'Sisipkan gambar', + insertVideo: 'Sisipkan video', + link: 'Tautan', + createLink: 'Sisipkan Tautan', + unlink: 'Singkirkan tautan', + + justifyLeft: 'Rata kiri', + justifyCenter: 'Rata Tengah', + justifyRight: 'Rata kanan', + justifyFull: 'Rata kiri dan kanan', + + horizontalRule: 'Sisipkan garis mendatar', + + fullscreen: 'Layar penuh', + + close: 'Tutup', + + submit: 'Setuju', + reset: 'Batal', + + required: 'Diperlukan', + description: 'Deskripsi', + title: 'Judul', + text: 'Teks' +}; diff --git a/dist/langs/id.min.js b/dist/langs/id.min.js new file mode 100644 index 000000000..418fc885c --- /dev/null +++ b/dist/langs/id.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * id.js + * Indonesian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Rezha Julio (kimiamania) + * Twitter : @kimiamania + * Website : http://rezhajulio.web.id + * Github : https://github.com/kimiamania + */ +jQuery.trumbowyg.langs.id={viewHTML:"Lihat HTML",formatting:"Penyusunan",p:"Paragraf",blockquote:"Kutipan",code:"Kode",header:"Kepala",bold:"Tebal",italic:"Miring",strikethrough:"Coret",underline:"Garis bawah",strong:"Tebal",em:"Miring",del:"Dicoret",unorderedList:"Daftar tak teratur",orderedList:"Daftar teratur",insertImage:"Sisipkan gambar",insertVideo:"Sisipkan video",link:"Tautan",createLink:"Sisipkan Tautan",unlink:"Singkirkan tautan",justifyLeft:"Rata kiri",justifyCenter:"Rata Tengah",justifyRight:"Rata kanan",justifyFull:"Rata kiri dan kanan",horizontalRule:"Sisipkan garis mendatar",fullscreen:"Layar penuh",close:"Tutup",submit:"Setuju",reset:"Batal",required:"Diperlukan",description:"Deskripsi",title:"Judul",text:"Teks"}; \ No newline at end of file diff --git a/dist/langs/it.js b/dist/langs/it.js new file mode 100644 index 000000000..9da5c446f --- /dev/null +++ b/dist/langs/it.js @@ -0,0 +1,62 @@ +/* =========================================================== + * it.js + * Italian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Mirko Buffoni + */ + +jQuery.trumbowyg.langs.it = { + viewHTML: 'Mostra HTML', + + undo: 'Annulla', + redo: 'Ripeti', + + formatting: 'Formattazione', + p: 'Paragrafo', + blockquote: 'Citazione', + code: 'Codice', + header: 'Intestazione', + + bold: 'Grassetto', + italic: 'Italico', + strikethrough: 'Barrato', + underline: 'Sottolineato', + + strong: 'Rafforza', + em: 'Enfatizza', + del: 'Cancella', + + unorderedList: 'Elenco puntato', + orderedList: 'Elenco numerato', + + insertImage: 'Inserisci immagine', + insertVideo: 'Inserisci video', + link: 'Collegamento', + createLink: 'Crea un collegamento', + unlink: 'Elimina collegamento', + + justifyLeft: 'Allinea a sinistra', + justifyCenter: 'Centra', + justifyRight: 'Allinea a destra', + justifyFull: 'Giustifica', + + horizontalRule: 'Inserisci un separatore orizzontale', + + fullscreen: 'Schermo intero', + + close: 'Chiudi', + + submit: 'Invia', + reset: 'Annulla', + + required: 'Obbligatorio', + description: 'Descrizione', + title: 'Titolo', + text: 'Testo', + + removeformat: 'Rimuovi Formattazione', + + superscript: 'Apice', + subscript: 'Pedice' +}; diff --git a/dist/langs/it.min.js b/dist/langs/it.min.js new file mode 100644 index 000000000..17316d6c0 --- /dev/null +++ b/dist/langs/it.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * it.js + * Italian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Mirko Buffoni + */ +jQuery.trumbowyg.langs.it={viewHTML:"Mostra HTML",undo:"Annulla",redo:"Ripeti",formatting:"Formattazione",p:"Paragrafo",blockquote:"Citazione",code:"Codice",header:"Intestazione",bold:"Grassetto",italic:"Italico",strikethrough:"Barrato",underline:"Sottolineato",strong:"Rafforza",em:"Enfatizza",del:"Cancella",unorderedList:"Elenco puntato",orderedList:"Elenco numerato",insertImage:"Inserisci immagine",insertVideo:"Inserisci video",link:"Collegamento",createLink:"Crea un collegamento",unlink:"Elimina collegamento",justifyLeft:"Allinea a sinistra",justifyCenter:"Centra",justifyRight:"Allinea a destra",justifyFull:"Giustifica",horizontalRule:"Inserisci un separatore orizzontale",fullscreen:"Schermo intero",close:"Chiudi",submit:"Invia",reset:"Annulla",required:"Obbligatorio",description:"Descrizione",title:"Titolo",text:"Testo",removeformat:"Rimuovi Formattazione",superscript:"Apice",subscript:"Pedice"}; \ No newline at end of file diff --git a/dist/langs/ja.js b/dist/langs/ja.js new file mode 100644 index 000000000..a92e77f5f --- /dev/null +++ b/dist/langs/ja.js @@ -0,0 +1,63 @@ +/* =========================================================== + * ja.js + * Japanese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Kouta Fukuhara (foo9) + * Twitter : @foo9 + * Website : https://github.com/foo9 + */ + +jQuery.trumbowyg.langs.ja = { + viewHTML: 'HTML表示', + + undo: '元に戻す', + redo: 'やり直す', + + formatting: 'フォーマット', + p: '段落', + blockquote: '引用', + code: 'コード', + header: '見出し', + + bold: '太字', + italic: '斜体', + strikethrough: '取り消し線', + underline: '下線', + + strong: '太字', + em: '斜体', + del: '取り消し線', + + superscript: '上付き文字', + subscript: '下付き文字', + + unorderedList: '順序なしリスト', + orderedList: '順序ありリスト', + + insertImage: '画像の挿入', + link: 'リンク', + createLink: 'リンクの作成', + unlink: 'リンクの削除', + + justifyLeft: '左揃え', + justifyCenter: '中央揃え', + justifyRight: '右揃え', + justifyFull: '両端揃え', + + horizontalRule: '横罫線', + removeformat: 'フォーマットの削除', + + fullscreen: '全画面表示', + + close: '閉じる', + + submit: '送信', + reset: 'キャンセル', + + required: '必須', + description: '説明', + title: 'タイトル', + text: 'テキスト', + target: 'ターゲット' +}; diff --git a/dist/langs/ja.min.js b/dist/langs/ja.min.js new file mode 100644 index 000000000..e974f02b9 --- /dev/null +++ b/dist/langs/ja.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * ja.js + * Japanese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Kouta Fukuhara (foo9) + * Twitter : @foo9 + * Website : https://github.com/foo9 + */ +jQuery.trumbowyg.langs.ja={viewHTML:"HTML表示",undo:"元に戻す",redo:"やり直す",formatting:"フォーマット",p:"段落",blockquote:"引用",code:"コード",header:"見出し",bold:"太字",italic:"斜体",strikethrough:"取り消し線",underline:"下線",strong:"太字",em:"斜体",del:"取り消し線",superscript:"上付き文字",subscript:"下付き文字",unorderedList:"順序なしリスト",orderedList:"順序ありリスト",insertImage:"画像の挿入",link:"リンク",createLink:"リンクの作成",unlink:"リンクの削除",justifyLeft:"左揃え",justifyCenter:"中央揃え",justifyRight:"右揃え",justifyFull:"両端揃え",horizontalRule:"横罫線",removeformat:"フォーマットの削除",fullscreen:"全画面表示",close:"閉じる",submit:"送信",reset:"キャンセル",required:"必須",description:"説明",title:"タイトル",text:"テキスト",target:"ターゲット"}; \ No newline at end of file diff --git a/dist/langs/ko.js b/dist/langs/ko.js new file mode 100644 index 000000000..4fc0282fd --- /dev/null +++ b/dist/langs/ko.js @@ -0,0 +1,66 @@ +/* =========================================================== + * ko.js + * Korean translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : SeungWoo Chae (SDuck4) + * Github : https://github.com/SDuck4 + * Victor Chanil Park (opdev1004) + * Github : https://github.com/opdev1004 + */ + +jQuery.trumbowyg.langs.ko = { + viewHTML: 'HTML 보기', + + undo: '되돌리기', + redo: '다시 실행', + + formatting: '스타일', + p: '본문', + blockquote: '인용문', + code: '코드', + header: '제목', + + bold: '진하게', + italic: '기울임', + strikethrough: '취소선', + underline: '밑줄', + + strong: '중요', + em: '강조', + del: '삭제', + + superscript: '위 첨자', + subscript: '아래 첨자', + + unorderedList: '기호 목록', + orderedList: '번호 목록', + + insertImage: '이미지 넣기', + insertVideo: '비디오 넣기', + link: '링크', + createLink: '링크 넣기', + unlink: '링크 지우기', + + justifyLeft: '왼쪽 정렬', + justifyCenter: '가운데 정렬', + justifyRight: '오른쪽 정렬', + justifyFull: '양쪽 정렬', + + horizontalRule: '구분선 넣기', + removeformat: '글꼴 효과 지우기', + + fullscreen: '전체 화면', + + close: '닫기', + + submit: '확인', + reset: '취소', + + required: '필수 입력', + description: '설명', + title: '툴팁', + text: '내용', + target: '타겟', + width: '너비' +}; diff --git a/dist/langs/ko.min.js b/dist/langs/ko.min.js new file mode 100644 index 000000000..18c257109 --- /dev/null +++ b/dist/langs/ko.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * ko.js + * Korean translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : SeungWoo Chae (SDuck4) + * Github : https://github.com/SDuck4 + * Victor Chanil Park (opdev1004) + * Github : https://github.com/opdev1004 + */ +jQuery.trumbowyg.langs.ko={viewHTML:"HTML 보기",undo:"되돌리기",redo:"다시 실행",formatting:"스타일",p:"본문",blockquote:"인용문",code:"코드",header:"제목",bold:"진하게",italic:"기울임",strikethrough:"취소선",underline:"밑줄",strong:"중요",em:"강조",del:"삭제",superscript:"위 첨자",subscript:"아래 첨자",unorderedList:"기호 목록",orderedList:"번호 목록",insertImage:"이미지 넣기",insertVideo:"비디오 넣기",link:"링크",createLink:"링크 넣기",unlink:"링크 지우기",justifyLeft:"왼쪽 정렬",justifyCenter:"가운데 정렬",justifyRight:"오른쪽 정렬",justifyFull:"양쪽 정렬",horizontalRule:"구분선 넣기",removeformat:"글꼴 효과 지우기",fullscreen:"전체 화면",close:"닫기",submit:"확인",reset:"취소",required:"필수 입력",description:"설명",title:"툴팁",text:"내용",target:"타겟",width:"너비"}; \ No newline at end of file diff --git a/dist/langs/lt.js b/dist/langs/lt.js new file mode 100644 index 000000000..a3e44e427 --- /dev/null +++ b/dist/langs/lt.js @@ -0,0 +1,59 @@ +/* =========================================================== + * lt.js + * Lithuanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Justas Brazauskas + */ + +jQuery.trumbowyg.langs.lt = { + viewHTML: 'Žiūrėti HTML', + + formatting: 'Formatuoti', + p: 'Paragrafas', + blockquote: 'Citata', + code: 'Kodas', + header: 'Antraštė', + + bold: 'Paryškinti', + italic: 'Kursyvuoti', + strikethrough: 'Perbraukti', + underline: 'Pabrėžti', + + strong: 'Paryškinti', + em: 'Pabrėžti', + del: 'Trinti', + + unorderedList: 'Sąrašas', + orderedList: 'Numeruotas sąrašas', + + insertImage: 'Pridėti vaizdą', + insertVideo: 'Pridėti video', + link: 'Nuoroda', + createLink: 'Kurti nuorodą', + unlink: 'Ištrinti nuorodą', + + justifyLeft: 'Lyginti kairėn', + justifyCenter: 'Lygiuoti Centre', + justifyRight: 'Lyginti dešinėn', + justifyFull: 'Centruoti', + + horizontalRule: 'Horizontali linija', + + fullscreen: 'Pilnas ekranas', + + close: 'Uždaryti', + + submit: 'Siųsti', + reset: 'Atšaukti', + + required: 'Privaloma', + description: 'Aprašymas', + title: 'Pavadinimas', + text: 'Tekstas', + + removeformat: 'Pašalinti formatavimą', + + superscript: 'Viršutinis indeksas', + subscript: 'Apatinis indeksas' +}; diff --git a/dist/langs/lt.min.js b/dist/langs/lt.min.js new file mode 100644 index 000000000..53f73bf3f --- /dev/null +++ b/dist/langs/lt.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * lt.js + * Lithuanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Justas Brazauskas + */ +jQuery.trumbowyg.langs.lt={viewHTML:"Žiūrėti HTML",formatting:"Formatuoti",p:"Paragrafas",blockquote:"Citata",code:"Kodas",header:"Antraštė",bold:"Paryškinti",italic:"Kursyvuoti",strikethrough:"Perbraukti",underline:"Pabrėžti",strong:"Paryškinti",em:"Pabrėžti",del:"Trinti",unorderedList:"Sąrašas",orderedList:"Numeruotas sąrašas",insertImage:"Pridėti vaizdą",insertVideo:"Pridėti video",link:"Nuoroda",createLink:"Kurti nuorodą",unlink:"Ištrinti nuorodą",justifyLeft:"Lyginti kairėn",justifyCenter:"Lygiuoti Centre",justifyRight:"Lyginti dešinėn",justifyFull:"Centruoti",horizontalRule:"Horizontali linija",fullscreen:"Pilnas ekranas",close:"Uždaryti",submit:"Siųsti",reset:"Atšaukti",required:"Privaloma",description:"Aprašymas",title:"Pavadinimas",text:"Tekstas",removeformat:"Pašalinti formatavimą",superscript:"Viršutinis indeksas",subscript:"Apatinis indeksas"}; \ No newline at end of file diff --git a/dist/langs/mn.js b/dist/langs/mn.js new file mode 100644 index 000000000..c71eaa28c --- /dev/null +++ b/dist/langs/mn.js @@ -0,0 +1,49 @@ +/* =========================================================== + * mn.js + * Mongolian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ganbayar.B (ganbayar13) + */ + +jQuery.trumbowyg.langs.mn = { + viewHTML: 'HTML харах', + undo: 'Буцаах', + redo: 'Дахих', + formatting: 'Формат', + p: 'Догол мөр', + blockquote: 'Ишлэл', + code: 'Код', + header: 'Гарчиг', + bold: 'Тод', + italic: 'Налуу', + strikethrough: 'Дундуур зураас', + underline: 'Доогуур зураас', + strong: 'Тод', + em: 'Налуу', + del: 'Дундуур зураас', + superscript: 'Дээд индекс', + subscript: 'Доод индекс', + unorderedList: 'Дугаарлаагүй жагсаалт', + orderedList: 'Дугаарласан жагсаалт', + insertImage: 'Зураг оруулах', + insertVideo: 'Видео оруулах', + link: 'Холбоос', + createLink: 'Холбоос үүсгэх', + unlink: 'Холбоос цуцлах', + justifyLeft: 'Зүүн тийш шахах', + justifyCenter: 'Голлуулах', + justifyRight: 'Баруун Баруун тийш шахах', + justifyFull: 'Тэгшитгэх', + horizontalRule: 'Хөндлөн шугам', + removeformat: 'Формат арилгах', + fullscreen: 'Дэлгэц дүүргэх', + close: 'Хаах', + submit: 'Оруулах', + reset: 'Цуцлах', + required: 'Шаардлагатай', + description: 'Тайлбар', + title: 'Гарчиг', + text: 'Текст', + target: 'Бай' +}; diff --git a/dist/langs/mn.min.js b/dist/langs/mn.min.js new file mode 100644 index 000000000..2bf7f7e38 --- /dev/null +++ b/dist/langs/mn.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * mn.js + * Mongolian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ganbayar.B (ganbayar13) + */ +jQuery.trumbowyg.langs.mn={viewHTML:"HTML харах",undo:"Буцаах",redo:"Дахих",formatting:"Формат",p:"Догол мөр",blockquote:"Ишлэл",code:"Код",header:"Гарчиг",bold:"Тод",italic:"Налуу",strikethrough:"Дундуур зураас",underline:"Доогуур зураас",strong:"Тод",em:"Налуу",del:"Дундуур зураас",superscript:"Дээд индекс",subscript:"Доод индекс",unorderedList:"Дугаарлаагүй жагсаалт",orderedList:"Дугаарласан жагсаалт",insertImage:"Зураг оруулах",insertVideo:"Видео оруулах",link:"Холбоос",createLink:"Холбоос үүсгэх",unlink:"Холбоос цуцлах",justifyLeft:"Зүүн тийш шахах",justifyCenter:"Голлуулах",justifyRight:"Баруун Баруун тийш шахах",justifyFull:"Тэгшитгэх",horizontalRule:"Хөндлөн шугам",removeformat:"Формат арилгах",fullscreen:"Дэлгэц дүүргэх",close:"Хаах",submit:"Оруулах",reset:"Цуцлах",required:"Шаардлагатай",description:"Тайлбар",title:"Гарчиг",text:"Текст",target:"Бай"}; \ No newline at end of file diff --git a/dist/langs/my.js b/dist/langs/my.js new file mode 100644 index 000000000..55b4e8da9 --- /dev/null +++ b/dist/langs/my.js @@ -0,0 +1,54 @@ +/* =========================================================== + * my.js + * Malaysian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : JohnPozy + */ + +jQuery.trumbowyg.langs.id = { + viewHTML: 'Lihat HTML', + + formatting: 'Pemformatan', + p: 'Perenggan', + blockquote: 'Blockquote', + code: 'Kod', + header: 'Pengepala', + + bold: 'Tebal', + italic: 'Condong', + strikethrough: 'Garis batal', + underline: 'Garis bawah', + + strong: 'Kuat', + em: 'Condong', + del: 'Hapus', + + unorderedList: 'Senarai tidak tertib', + orderedList: 'Senarai tertib', + + insertImage: 'Masukkan imej', + insertVideo: 'Masukkan video', + link: 'Pautan', + createLink: 'Cipta pautan', + unlink: 'Hapus pautan', + + justifyLeft: 'Mengimbangkan ke kiri', + justifyCenter: 'Mengimbangkan ke tengah', + justifyRight: 'Mengimbangkan ke kanan', + justifyFull: 'Mengimbangkan ke kiri dan kanan', + + horizontalRule: 'Masukkan garis mendatar', + + fullscreen: 'Skrin penuh', + + close: 'Tutup', + + submit: 'Hantar', + reset: 'Batal', + + required: 'Diperlukan', + description: 'Perihal', + title: 'Tajuk', + text: 'Teks' +}; diff --git a/dist/langs/my.min.js b/dist/langs/my.min.js new file mode 100644 index 000000000..8dda59317 --- /dev/null +++ b/dist/langs/my.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * my.js + * Malaysian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : JohnPozy + */ +jQuery.trumbowyg.langs.id={viewHTML:"Lihat HTML",formatting:"Pemformatan",p:"Perenggan",blockquote:"Blockquote",code:"Kod",header:"Pengepala",bold:"Tebal",italic:"Condong",strikethrough:"Garis batal",underline:"Garis bawah",strong:"Kuat",em:"Condong",del:"Hapus",unorderedList:"Senarai tidak tertib",orderedList:"Senarai tertib",insertImage:"Masukkan imej",insertVideo:"Masukkan video",link:"Pautan",createLink:"Cipta pautan",unlink:"Hapus pautan",justifyLeft:"Mengimbangkan ke kiri",justifyCenter:"Mengimbangkan ke tengah",justifyRight:"Mengimbangkan ke kanan",justifyFull:"Mengimbangkan ke kiri dan kanan",horizontalRule:"Masukkan garis mendatar",fullscreen:"Skrin penuh",close:"Tutup",submit:"Hantar",reset:"Batal",required:"Diperlukan",description:"Perihal",title:"Tajuk",text:"Teks"}; \ No newline at end of file diff --git a/dist/langs/nb.js b/dist/langs/nb.js new file mode 100644 index 000000000..5d663ab47 --- /dev/null +++ b/dist/langs/nb.js @@ -0,0 +1,70 @@ +/* =========================================================== + * nb.js + * Norwegian Bokmål translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jon Severin Eivik Jakobsen + * Github : https://github.com/jsejakobsen + * + * Mod by: Gunnar Tjomlid + * Github : https://github.com/civix74 + * Twitter : @civix + * Website : https://about.me/civix + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.nb = { + viewHTML: 'Vis HTML', + + undo: 'Angre', + redo: 'Gjør om', + + formatting: 'Formater', + p: 'Avsnitt', + blockquote: 'Sitat', + code: 'Kode', + header: 'Overskrift', + + bold: 'Fet', + italic: 'Kursiv', + strikethrough: 'Gjennomstreking', + underline: 'Understreking', + + strong: 'Uthevet', + em: 'Kursiv', + del: 'Slettet', + + superscript: 'Hevet', + subscript: 'Senket', + + unorderedList: 'Punktliste', + orderedList: 'Nummerert liste', + + insertImage: 'Sett inn bilde', + insertVideo: 'Sett inn video', + link: 'Lenke', + createLink: 'Sett inn lenke', + unlink: 'Fjern lenke', + + justifyLeft: 'Venstrejuster', + justifyCenter: 'Midtstill', + justifyRight: 'Høyrejuster', + justifyFull: 'Blokkjuster', + + horizontalRule: 'Horisontal linje', + removeformat: 'Fjern formatering', + + fullscreen: 'Fullskjerm', + + close: 'Lukk', + + submit: 'Bekreft', + reset: 'Avbryt', + + required: 'Påkrevd', + description: 'Beskrivelse', + title: 'Tittel', + text: 'Tekst', + target: 'Mål', + width: 'Bredde' +}; diff --git a/dist/langs/nb.min.js b/dist/langs/nb.min.js new file mode 100644 index 000000000..748e5299c --- /dev/null +++ b/dist/langs/nb.min.js @@ -0,0 +1,15 @@ +/* =========================================================== + * nb.js + * Norwegian Bokmål translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jon Severin Eivik Jakobsen + * Github : https://github.com/jsejakobsen + * + * Mod by: Gunnar Tjomlid + * Github : https://github.com/civix74 + * Twitter : @civix + * Website : https://about.me/civix + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.nb={viewHTML:"Vis HTML",undo:"Angre",redo:"Gjør om",formatting:"Formater",p:"Avsnitt",blockquote:"Sitat",code:"Kode",header:"Overskrift",bold:"Fet",italic:"Kursiv",strikethrough:"Gjennomstreking",underline:"Understreking",strong:"Uthevet",em:"Kursiv",del:"Slettet",superscript:"Hevet",subscript:"Senket",unorderedList:"Punktliste",orderedList:"Nummerert liste",insertImage:"Sett inn bilde",insertVideo:"Sett inn video",link:"Lenke",createLink:"Sett inn lenke",unlink:"Fjern lenke",justifyLeft:"Venstrejuster",justifyCenter:"Midtstill",justifyRight:"Høyrejuster",justifyFull:"Blokkjuster",horizontalRule:"Horisontal linje",removeformat:"Fjern formatering",fullscreen:"Fullskjerm",close:"Lukk",submit:"Bekreft",reset:"Avbryt",required:"Påkrevd",description:"Beskrivelse",title:"Tittel",text:"Tekst",target:"Mål",width:"Bredde"}; \ No newline at end of file diff --git a/dist/langs/nl.js b/dist/langs/nl.js new file mode 100644 index 000000000..7f14c950e --- /dev/null +++ b/dist/langs/nl.js @@ -0,0 +1,61 @@ +/* =========================================================== + * nl.js + * Dutch translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Danny Hiemstra + * Github : https://github.com/dhiemstra + */ + +jQuery.trumbowyg.langs.nl = { + viewHTML: 'HTML bekijken', + + undo: 'Ongedaan maken', + redo: 'Opnieuw', + + formatting: 'Opmaak', + p: 'Paragraaf', + blockquote: 'Citaat', + code: 'Code', + header: 'Kop', + + bold: 'Vet', + italic: 'Cursief', + strikethrough: 'Doorhalen', + underline: 'Onderlijnen', + + strong: 'Sterk', + em: 'Nadruk', + del: 'Verwijderd', + + unorderedList: 'Ongenummerde lijst', + orderedList: 'Genummerde lijst', + + insertImage: 'Afbeelding invoegen', + insertVideo: 'Video invoegen', + link: 'Link', + createLink: 'Link maken', + unlink: 'Link verwijderen', + + justifyLeft: 'Links uitlijnen', + justifyCenter: 'Centreren', + justifyRight: 'Rechts uitlijnen', + justifyFull: 'Uitvullen', + + horizontalRule: 'Horizontale lijn', + removeFormat: 'Opmaak verwijderen', + + fullscreen: 'Volledig scherm', + + close: 'Sluiten', + + submit: 'Opslaan', + reset: 'Annuleren', + + required: 'Verplicht', + description: 'Omschrijving', + title: 'Titel', + text: 'Tekst', + target: 'Doel', + width: 'Breedte' +}; diff --git a/dist/langs/nl.min.js b/dist/langs/nl.min.js new file mode 100644 index 000000000..60ee624a5 --- /dev/null +++ b/dist/langs/nl.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * nl.js + * Dutch translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Danny Hiemstra + * Github : https://github.com/dhiemstra + */ +jQuery.trumbowyg.langs.nl={viewHTML:"HTML bekijken",undo:"Ongedaan maken",redo:"Opnieuw",formatting:"Opmaak",p:"Paragraaf",blockquote:"Citaat",code:"Code",header:"Kop",bold:"Vet",italic:"Cursief",strikethrough:"Doorhalen",underline:"Onderlijnen",strong:"Sterk",em:"Nadruk",del:"Verwijderd",unorderedList:"Ongenummerde lijst",orderedList:"Genummerde lijst",insertImage:"Afbeelding invoegen",insertVideo:"Video invoegen",link:"Link",createLink:"Link maken",unlink:"Link verwijderen",justifyLeft:"Links uitlijnen",justifyCenter:"Centreren",justifyRight:"Rechts uitlijnen",justifyFull:"Uitvullen",horizontalRule:"Horizontale lijn",removeFormat:"Opmaak verwijderen",fullscreen:"Volledig scherm",close:"Sluiten",submit:"Opslaan",reset:"Annuleren",required:"Verplicht",description:"Omschrijving",title:"Titel",text:"Tekst",target:"Doel",width:"Breedte"}; \ No newline at end of file diff --git a/dist/langs/ph.js b/dist/langs/ph.js new file mode 100644 index 000000000..5dfa2429f --- /dev/null +++ b/dist/langs/ph.js @@ -0,0 +1,54 @@ +/* =========================================================== + * ph.js + * Filipino translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : @leogono + */ + +jQuery.trumbowyg.langs.ph = { + viewHTML: 'Tumingin sa HTML', + + formatting: 'Formatting', + p: 'Talata', + blockquote: 'Blockquote', + code: 'Kowd', + header: 'Header', + + bold: 'Makapal', + italic: 'Hilig', + strikethrough: 'Strikethrough', + underline: 'Salungguhit', + + strong: 'Malakas', + em: 'Hilig', + del: 'Tinanggal', + + unorderedList: 'Hindi nakahanay na listahan', + orderedList: 'Nakahanay na listahan', + + insertImage: 'Ilagay ang larawan', + insertVideo: 'Ilagay ang video', + link: 'Koneksyon', + createLink: 'Iugnay', + unlink: 'Tanggalin ang koneksyon', + + justifyLeft: 'Ihanay sa kaliwa', + justifyCenter: 'Ihanay sa gitna', + justifyRight: 'Ihanay sa kanan', + justifyFull: 'Ihanay sa kaliwa at kanan', + + horizontalRule: 'Pahalang na linya', + + fullscreen: 'Fullscreen', + + close: 'Isara', + + submit: 'Ipasa', + reset: 'I-reset', + + required: 'Kailangan', + description: 'Paglalarawan', + title: 'Pamagat', + text: 'Teksto' +}; diff --git a/dist/langs/ph.min.js b/dist/langs/ph.min.js new file mode 100644 index 000000000..ae0435836 --- /dev/null +++ b/dist/langs/ph.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * ph.js + * Filipino translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : @leogono + */ +jQuery.trumbowyg.langs.ph={viewHTML:"Tumingin sa HTML",formatting:"Formatting",p:"Talata",blockquote:"Blockquote",code:"Kowd",header:"Header",bold:"Makapal",italic:"Hilig",strikethrough:"Strikethrough",underline:"Salungguhit",strong:"Malakas",em:"Hilig",del:"Tinanggal",unorderedList:"Hindi nakahanay na listahan",orderedList:"Nakahanay na listahan",insertImage:"Ilagay ang larawan",insertVideo:"Ilagay ang video",link:"Koneksyon",createLink:"Iugnay",unlink:"Tanggalin ang koneksyon",justifyLeft:"Ihanay sa kaliwa",justifyCenter:"Ihanay sa gitna",justifyRight:"Ihanay sa kanan",justifyFull:"Ihanay sa kaliwa at kanan",horizontalRule:"Pahalang na linya",fullscreen:"Fullscreen",close:"Isara",submit:"Ipasa",reset:"I-reset",required:"Kailangan",description:"Paglalarawan",title:"Pamagat",text:"Teksto"}; \ No newline at end of file diff --git a/dist/langs/pl.js b/dist/langs/pl.js new file mode 100644 index 000000000..17e3ab621 --- /dev/null +++ b/dist/langs/pl.js @@ -0,0 +1,55 @@ +/* =========================================================== + * pl.js + * Polish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Paweł Abramowicz + * Github : https://github.com/pawelabrams + */ + +jQuery.trumbowyg.langs.pl = { + viewHTML: 'Pokaż HTML', + + formatting: 'Format', + p: 'Akapit', + blockquote: 'Cytat', + code: 'Kod', + header: 'Nagłówek', + + bold: 'Pogrubienie', + italic: 'Pochylenie', + strikethrough: 'Przekreślenie', + underline: 'Podkreślenie', + + strong: 'Wytłuszczenie', + em: 'Uwydatnienie', + del: 'Usunięte', + + unorderedList: 'Lista nieuporządkowana', + orderedList: 'Lista uporządkowana', + + insertImage: 'Wstaw obraz', + insertVideo: 'Wstaw film', + link: 'Link', + createLink: 'Wstaw link', + unlink: 'Usuń link', + + justifyLeft: 'Wyrównaj do lewej', + justifyCenter: 'Wyśrodkuj', + justifyRight: 'Wyrównaj do prawej', + justifyFull: 'Wyjustuj', + + horizontalRule: 'Odkreśl linią', + + fullscreen: 'Pełny ekran', + + close: 'Zamknij', + + submit: 'Zastosuj', + reset: 'Przywróć', + + required: 'Wymagane', + description: 'Opis', + title: 'Tytuł', + text: 'Tekst' +}; diff --git a/dist/langs/pl.min.js b/dist/langs/pl.min.js new file mode 100644 index 000000000..7d7a436aa --- /dev/null +++ b/dist/langs/pl.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * pl.js + * Polish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Paweł Abramowicz + * Github : https://github.com/pawelabrams + */ +jQuery.trumbowyg.langs.pl={viewHTML:"Pokaż HTML",formatting:"Format",p:"Akapit",blockquote:"Cytat",code:"Kod",header:"Nagłówek",bold:"Pogrubienie",italic:"Pochylenie",strikethrough:"Przekreślenie",underline:"Podkreślenie",strong:"Wytłuszczenie",em:"Uwydatnienie",del:"Usunięte",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",insertImage:"Wstaw obraz",insertVideo:"Wstaw film",link:"Link",createLink:"Wstaw link",unlink:"Usuń link",justifyLeft:"Wyrównaj do lewej",justifyCenter:"Wyśrodkuj",justifyRight:"Wyrównaj do prawej",justifyFull:"Wyjustuj",horizontalRule:"Odkreśl linią",fullscreen:"Pełny ekran",close:"Zamknij",submit:"Zastosuj",reset:"Przywróć",required:"Wymagane",description:"Opis",title:"Tytuł",text:"Tekst"}; \ No newline at end of file diff --git a/dist/langs/pt.js b/dist/langs/pt.js new file mode 100644 index 000000000..6a3644ad2 --- /dev/null +++ b/dist/langs/pt.js @@ -0,0 +1,65 @@ +/* =========================================================== + * pt.js + * Portuguese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ramiro Varandas Jr (ramirovjr) + * Twitter : @ramirovjnr + * Website : about.me/ramirovjnr + * Github : https://github.com/ramirovjr + */ + +jQuery.trumbowyg.langs.pt = { + viewHTML: 'Ver HTML', + + undo: 'Desfazer', + redo: 'Refazer', + + formatting: 'Formatar', + p: 'Paragráfo', + blockquote: 'Citação', + code: 'Código', + header: 'Título', + + bold: 'Negrito', + italic: 'Itálico', + strikethrough: 'Suprimir', + underline: 'Sublinhado', + + strong: 'Negrito', + em: 'Ênfase', + del: 'Apagar', + + superscript: 'Sobrescrito', + subscript: 'Subscrito', + + unorderedList: 'Lista não ordenada', + orderedList: 'Lista ordenada', + + insertImage: 'Inserir imagem', + insertVideo: 'Inserir vídeo', + link: 'Link', + createLink: 'Criar um link', + unlink: 'Remover link', + + justifyLeft: 'Alinhar a esquerda', + justifyCenter: 'Centralizar', + justifyRight: 'Alinhar a direita', + justifyFull: 'Justificar', + + horizontalRule: 'Inserir separador horizontal', + removeformat: 'Remover formatação', + + fullscreen: 'Tela cheia', + + close: 'Fechar', + + submit: 'Enviar', + reset: 'Limpar', + + required: 'Obrigatório', + description: 'Descrição', + title: 'Título', + text: 'Texto', + target: 'Target' +}; diff --git a/dist/langs/pt.min.js b/dist/langs/pt.min.js new file mode 100644 index 000000000..63fb23954 --- /dev/null +++ b/dist/langs/pt.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * pt.js + * Portuguese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Ramiro Varandas Jr (ramirovjr) + * Twitter : @ramirovjnr + * Website : about.me/ramirovjnr + * Github : https://github.com/ramirovjr + */ +jQuery.trumbowyg.langs.pt={viewHTML:"Ver HTML",undo:"Desfazer",redo:"Refazer",formatting:"Formatar",p:"Paragráfo",blockquote:"Citação",code:"Código",header:"Título",bold:"Negrito",italic:"Itálico",strikethrough:"Suprimir",underline:"Sublinhado",strong:"Negrito",em:"Ênfase",del:"Apagar",superscript:"Sobrescrito",subscript:"Subscrito",unorderedList:"Lista não ordenada",orderedList:"Lista ordenada",insertImage:"Inserir imagem",insertVideo:"Inserir vídeo",link:"Link",createLink:"Criar um link",unlink:"Remover link",justifyLeft:"Alinhar a esquerda",justifyCenter:"Centralizar",justifyRight:"Alinhar a direita",justifyFull:"Justificar",horizontalRule:"Inserir separador horizontal",removeformat:"Remover formatação",fullscreen:"Tela cheia",close:"Fechar",submit:"Enviar",reset:"Limpar",required:"Obrigatório",description:"Descrição",title:"Título",text:"Texto",target:"Target"}; \ No newline at end of file diff --git a/dist/langs/pt_br.js b/dist/langs/pt_br.js new file mode 100644 index 000000000..9e662fb1f --- /dev/null +++ b/dist/langs/pt_br.js @@ -0,0 +1,65 @@ +/* =========================================================== + * pt_br.js + * Portuguese Brazilian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alex Gotardi (alexgotardi) + * Twitter : @alexgotardi + * Github : https://github.com/alexgotardi + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.pt_br = { + viewHTML: 'Ver HTML', + + undo: 'Desfazer', + redo: 'Refazer', + + formatting: 'Formatar', + p: 'Parágrafo', + blockquote: 'Citação', + code: 'Código', + header: 'Título', + + bold: 'Negrito', + italic: 'Itálico', + strikethrough: 'Tachado', + underline: 'Sublinhado', + + strong: 'Negrito', + em: 'Ênfase', + del: 'Apagar', + + superscript: 'Sobrescrito', + subscript: 'Subscrito', + + unorderedList: 'Lista não ordenada', + orderedList: 'Lista ordenada', + + insertImage: 'Inserir imagem', + insertVideo: 'Inserir vídeo', + link: 'Link', + createLink: 'Criar um link', + unlink: 'Remover link', + + justifyLeft: 'Alinhar a esquerda', + justifyCenter: 'Centralizar', + justifyRight: 'Alinhar a direita', + justifyFull: 'Justificar', + + horizontalRule: 'Inserir separador horizontal', + removeformat: 'Remover formatação', + + fullscreen: 'Tela cheia', + + close: 'Fechar', + + submit: 'Enviar', + reset: 'Limpar', + + required: 'Obrigatório', + description: 'Descrição', + title: 'Título', + text: 'Texto', + target: 'Alvo' +}; diff --git a/dist/langs/pt_br.min.js b/dist/langs/pt_br.min.js new file mode 100644 index 000000000..9e1d4fd19 --- /dev/null +++ b/dist/langs/pt_br.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * pt_br.js + * Portuguese Brazilian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alex Gotardi (alexgotardi) + * Twitter : @alexgotardi + * Github : https://github.com/alexgotardi + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.pt_br={viewHTML:"Ver HTML",undo:"Desfazer",redo:"Refazer",formatting:"Formatar",p:"Parágrafo",blockquote:"Citação",code:"Código",header:"Título",bold:"Negrito",italic:"Itálico",strikethrough:"Tachado",underline:"Sublinhado",strong:"Negrito",em:"Ênfase",del:"Apagar",superscript:"Sobrescrito",subscript:"Subscrito",unorderedList:"Lista não ordenada",orderedList:"Lista ordenada",insertImage:"Inserir imagem",insertVideo:"Inserir vídeo",link:"Link",createLink:"Criar um link",unlink:"Remover link",justifyLeft:"Alinhar a esquerda",justifyCenter:"Centralizar",justifyRight:"Alinhar a direita",justifyFull:"Justificar",horizontalRule:"Inserir separador horizontal",removeformat:"Remover formatação",fullscreen:"Tela cheia",close:"Fechar",submit:"Enviar",reset:"Limpar",required:"Obrigatório",description:"Descrição",title:"Título",text:"Texto",target:"Alvo"}; \ No newline at end of file diff --git a/dist/langs/ro.js b/dist/langs/ro.js new file mode 100644 index 000000000..ad1663f24 --- /dev/null +++ b/dist/langs/ro.js @@ -0,0 +1,58 @@ +/* =========================================================== + * ro.js + * Romanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Vladut Radulescu (pacMakaveli) + * Email: pacMakaveli90@gmail.com + * Twitter : @pacMakaveli90 + * Website : creative-studio51.co.uk + * Github : https://github.com/pacMakaveli + */ + +jQuery.trumbowyg.langs.ro = { + viewHTML: 'Vizualizare HTML', + + formatting: 'Format', + p: 'Paragraf', + blockquote: 'Citație', + code: 'Cod', + header: 'Titlu', + + bold: 'Bold', + italic: 'Italic', + strikethrough: 'Tăiat', + underline: 'Subliniat', + + strong: 'Puternic', + em: 'Accentuat', + del: 'Sterge', + + unorderedList: 'Lista dezordonată', + orderedList: 'Liste ordonată', + + insertImage: 'Adăugare Imagine', + insertVideo: 'Adăugare Video', + link: 'Link', + createLink: 'Crează link', + unlink: 'Remover link', + + justifyLeft: 'Aliniază stânga', + justifyCenter: 'Aliniază centru', + justifyRight: 'Aliniază dreapta', + justifyFull: 'Justificare', + + horizontalRule: 'Linie orizontală', + + fullscreen: 'Tot ecranul', + + close: 'Închide', + + submit: 'Procesează', + reset: 'Resetează', + + required: 'Obligatoriu', + description: 'Descriere', + title: 'Titlu', + text: 'Text' +}; diff --git a/dist/langs/ro.min.js b/dist/langs/ro.min.js new file mode 100644 index 000000000..7f071e893 --- /dev/null +++ b/dist/langs/ro.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * ro.js + * Romanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Vladut Radulescu (pacMakaveli) + * Email: pacMakaveli90@gmail.com + * Twitter : @pacMakaveli90 + * Website : creative-studio51.co.uk + * Github : https://github.com/pacMakaveli + */ +jQuery.trumbowyg.langs.ro={viewHTML:"Vizualizare HTML",formatting:"Format",p:"Paragraf",blockquote:"Citație",code:"Cod",header:"Titlu",bold:"Bold",italic:"Italic",strikethrough:"Tăiat",underline:"Subliniat",strong:"Puternic",em:"Accentuat",del:"Sterge",unorderedList:"Lista dezordonată",orderedList:"Liste ordonată",insertImage:"Adăugare Imagine",insertVideo:"Adăugare Video",link:"Link",createLink:"Crează link",unlink:"Remover link",justifyLeft:"Aliniază stânga",justifyCenter:"Aliniază centru",justifyRight:"Aliniază dreapta",justifyFull:"Justificare",horizontalRule:"Linie orizontală",fullscreen:"Tot ecranul",close:"Închide",submit:"Procesează",reset:"Resetează",required:"Obligatoriu",description:"Descriere",title:"Titlu",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/rs.js b/dist/langs/rs.js new file mode 100644 index 000000000..6431dbac3 --- /dev/null +++ b/dist/langs/rs.js @@ -0,0 +1,53 @@ +/* =========================================================== + * rs.js + * Serbian (Cyrlic) translation for Trumbowyg + * https://www.github.com/johonunu + * =========================================================== + * Author : Nikola Trifunovic (https://www.github.com/johonunu) + */ + +jQuery.trumbowyg.langs.rs = { + viewHTML: 'Погледај HTML кóд', + + formatting: 'Форматирање', + p: 'Параграф', + blockquote: 'Цитат', + code: 'Кóд', + header: 'Наслов', + + bold: 'Подебљано', + italic: 'Курзив', + strikethrough: 'Прецртано', + underline: 'Подвучено', + + strong: 'Подебљано', + em: 'Истакнуто', + del: 'Обрисано', + + unorderedList: 'Ненабројива листа', + orderedList: 'Набројива листа', + insertImage: 'Унеси слику', + insertVideo: 'Унеси видео', + link: 'Линк', + createLink: 'Унеси линк', + unlink: 'Уклони линк', + + justifyLeft: 'Лево равнање', + justifyCenter: 'Централно равнање', + justifyRight: 'Десно равнање', + justifyFull: 'Обострано равнање', + + horizontalRule: 'Хоризонтална линија', + + fullscreen: 'Режим читавог екрана', + + close: 'Затвори', + + submit: 'Унеси', + reset: 'Откажи', + + required: 'Обавезно поље', + description: 'Опис', + title: 'Наслов', + text: 'Текст' +}; diff --git a/dist/langs/rs.min.js b/dist/langs/rs.min.js new file mode 100644 index 000000000..694045018 --- /dev/null +++ b/dist/langs/rs.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * rs.js + * Serbian (Cyrlic) translation for Trumbowyg + * https://www.github.com/johonunu + * =========================================================== + * Author : Nikola Trifunovic (https://www.github.com/johonunu) + */ +jQuery.trumbowyg.langs.rs={viewHTML:"Погледај HTML кóд",formatting:"Форматирање",p:"Параграф",blockquote:"Цитат",code:"Кóд",header:"Наслов",bold:"Подебљано",italic:"Курзив",strikethrough:"Прецртано",underline:"Подвучено",strong:"Подебљано",em:"Истакнуто",del:"Обрисано",unorderedList:"Ненабројива листа",orderedList:"Набројива листа",insertImage:"Унеси слику",insertVideo:"Унеси видео",link:"Линк",createLink:"Унеси линк",unlink:"Уклони линк",justifyLeft:"Лево равнање",justifyCenter:"Централно равнање",justifyRight:"Десно равнање",justifyFull:"Обострано равнање",horizontalRule:"Хоризонтална линија",fullscreen:"Режим читавог екрана",close:"Затвори",submit:"Унеси",reset:"Откажи",required:"Обавезно поље",description:"Опис",title:"Наслов",text:"Текст"}; \ No newline at end of file diff --git a/dist/langs/rs_latin.js b/dist/langs/rs_latin.js new file mode 100644 index 000000000..d7183697a --- /dev/null +++ b/dist/langs/rs_latin.js @@ -0,0 +1,54 @@ +/* =========================================================== + * rs_latin.js + * Serbian (Latin) translation for Trumbowyg + * https://www.github.com/johonunu + * =========================================================== + * Author : Nikola Trifunovic (https://www.github.com/johonunu) + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.rs_latin = { + viewHTML: 'Poglеdaj HTML kód', + + formatting: 'Formatiranjе', + p: 'Paragraf', + blockquote: 'Citat', + code: 'Kód', + header: 'Naslov', + + bold: 'Podеbljano', + italic: 'Kurziv', + strikethrough: 'Prеcrtano', + underline: 'Podvučеno', + + strong: 'Podеbljano', + em: 'Istaknuto', + del: 'Obrisano', + + unorderedList: 'Nеnabrojiva lista', + orderedList: 'Nabrojiva lista', + insertImage: 'Unеsi sliku', + insertVideo: 'Unеsi vidеo', + link: 'Link', + createLink: 'Unеsi link', + unlink: 'Ukloni link', + + justifyLeft: 'Lеvo ravnanjе', + justifyCenter: 'Cеntralno ravnanjе', + justifyRight: 'Dеsno ravnanjе', + justifyFull: 'Obostrano ravnanjе', + + horizontalRule: 'Horizontalna linija', + + fullscreen: 'Rеžim čitavog еkrana', + + close: 'Zatvori', + + submit: 'Unеsi', + reset: 'Otkaži', + + required: 'Obavеzno poljе', + description: 'Opis', + title: 'Naslov', + text: 'Tеkst' +}; diff --git a/dist/langs/rs_latin.min.js b/dist/langs/rs_latin.min.js new file mode 100644 index 000000000..985b3638d --- /dev/null +++ b/dist/langs/rs_latin.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * rs_latin.js + * Serbian (Latin) translation for Trumbowyg + * https://www.github.com/johonunu + * =========================================================== + * Author : Nikola Trifunovic (https://www.github.com/johonunu) + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.rs_latin={viewHTML:"Poglеdaj HTML kód",formatting:"Formatiranjе",p:"Paragraf",blockquote:"Citat",code:"Kód",header:"Naslov",bold:"Podеbljano",italic:"Kurziv",strikethrough:"Prеcrtano",underline:"Podvučеno",strong:"Podеbljano",em:"Istaknuto",del:"Obrisano",unorderedList:"Nеnabrojiva lista",orderedList:"Nabrojiva lista",insertImage:"Unеsi sliku",insertVideo:"Unеsi vidеo",link:"Link",createLink:"Unеsi link",unlink:"Ukloni link",justifyLeft:"Lеvo ravnanjе",justifyCenter:"Cеntralno ravnanjе",justifyRight:"Dеsno ravnanjе",justifyFull:"Obostrano ravnanjе",horizontalRule:"Horizontalna linija",fullscreen:"Rеžim čitavog еkrana",close:"Zatvori",submit:"Unеsi",reset:"Otkaži",required:"Obavеzno poljе",description:"Opis",title:"Naslov",text:"Tеkst"}; \ No newline at end of file diff --git a/dist/langs/ru.js b/dist/langs/ru.js new file mode 100644 index 000000000..8c483ba14 --- /dev/null +++ b/dist/langs/ru.js @@ -0,0 +1,61 @@ +/* =========================================================== + * ru.js + * Russian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Yuri Lya + */ + +jQuery.trumbowyg.langs.ru = { + viewHTML: 'Посмотреть HTML', + + undo: 'Отменить', + redo: 'Повторить', + + formatting: 'Форматирование', + p: 'Обычный', + blockquote: 'Цитата', + code: 'Код', + header: 'Заголовок', + + bold: 'Полужирный', + italic: 'Курсив', + strikethrough: 'Зачеркнутый', + underline: 'Подчеркнутый', + + strong: 'Полужирный', + em: 'Курсив', + del: 'Зачеркнутый', + + superscript: 'Надстрочный', + subscript: 'Подстрочный', + + unorderedList: 'Обычный список', + orderedList: 'Нумерованный список', + + insertImage: 'Вставить изображение', + insertVideo: 'Вставить видео', + link: 'Ссылка', + createLink: 'Вставить ссылку', + unlink: 'Удалить ссылку', + + justifyLeft: 'По левому краю', + justifyCenter: 'По центру', + justifyRight: 'По правому краю', + justifyFull: 'По ширине', + + horizontalRule: 'Горизонтальная линия', + removeformat: 'Очистить форматирование', + + fullscreen: 'Во весь экран', + + close: 'Закрыть', + + submit: 'Вставить', + reset: 'Отменить', + + required: 'Обязательное', + description: 'Описание', + title: 'Подсказка', + text: 'Текст' +}; diff --git a/dist/langs/ru.min.js b/dist/langs/ru.min.js new file mode 100644 index 000000000..d20d8d134 --- /dev/null +++ b/dist/langs/ru.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * ru.js + * Russian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Yuri Lya + */ +jQuery.trumbowyg.langs.ru={viewHTML:"Посмотреть HTML",undo:"Отменить",redo:"Повторить",formatting:"Форматирование",p:"Обычный",blockquote:"Цитата",code:"Код",header:"Заголовок",bold:"Полужирный",italic:"Курсив",strikethrough:"Зачеркнутый",underline:"Подчеркнутый",strong:"Полужирный",em:"Курсив",del:"Зачеркнутый",superscript:"Надстрочный",subscript:"Подстрочный",unorderedList:"Обычный список",orderedList:"Нумерованный список",insertImage:"Вставить изображение",insertVideo:"Вставить видео",link:"Ссылка",createLink:"Вставить ссылку",unlink:"Удалить ссылку",justifyLeft:"По левому краю",justifyCenter:"По центру",justifyRight:"По правому краю",justifyFull:"По ширине",horizontalRule:"Горизонтальная линия",removeformat:"Очистить форматирование",fullscreen:"Во весь экран",close:"Закрыть",submit:"Вставить",reset:"Отменить",required:"Обязательное",description:"Описание",title:"Подсказка",text:"Текст"}; \ No newline at end of file diff --git a/dist/langs/sk.js b/dist/langs/sk.js new file mode 100644 index 000000000..d9b7ff22f --- /dev/null +++ b/dist/langs/sk.js @@ -0,0 +1,54 @@ +/* =========================================================== + * sk.js + * Slovak translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : VeeeneX (https://github.com/VeeeneX) + */ + +jQuery.trumbowyg.langs.sk = { + viewHTML: 'Zobraziť HTML', + + formatting: 'Formátovanie', + p: 'Paragraf', + blockquote: 'Citácia', + code: 'Kód', + header: 'Nadpis', + + bold: 'Tučné', + italic: 'Kurzíva', + strikethrough: 'Preškrtnuté', + underline: 'Podčiarknuté', + + strong: 'Tučné', + em: 'Zvýrazniť', + del: 'Zmazať', + + unorderedList: 'Netriedený zoznam', + orderedList: 'Triedený zoznam', + + insertImage: 'Vložiť obrázok', + insertVideo: 'Vložiť video', + link: 'Odkaz', + createLink: 'Vložiť odkaz', + unlink: 'Zmazať odkaz', + + justifyLeft: 'Zarovnať doľava', + justifyCenter: 'Zarovnať na stred', + justifyRight: 'Zarovnať doprava', + justifyFull: 'Zarovnať do bloku', + + horizontalRule: 'Vložit vodorovnú čiaru', + + fullscreen: 'Režim celej obrazovky', + + close: 'Zavrieť', + + submit: 'Potvrdiť', + reset: 'Zrušiť', + + required: 'Povinné', + description: 'Popis', + title: 'Nadpis', + text: 'Text' +}; diff --git a/dist/langs/sk.min.js b/dist/langs/sk.min.js new file mode 100644 index 000000000..cb74fd2a7 --- /dev/null +++ b/dist/langs/sk.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * sk.js + * Slovak translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : VeeeneX (https://github.com/VeeeneX) + */ +jQuery.trumbowyg.langs.sk={viewHTML:"Zobraziť HTML",formatting:"Formátovanie",p:"Paragraf",blockquote:"Citácia",code:"Kód",header:"Nadpis",bold:"Tučné",italic:"Kurzíva",strikethrough:"Preškrtnuté",underline:"Podčiarknuté",strong:"Tučné",em:"Zvýrazniť",del:"Zmazať",unorderedList:"Netriedený zoznam",orderedList:"Triedený zoznam",insertImage:"Vložiť obrázok",insertVideo:"Vložiť video",link:"Odkaz",createLink:"Vložiť odkaz",unlink:"Zmazať odkaz",justifyLeft:"Zarovnať doľava",justifyCenter:"Zarovnať na stred",justifyRight:"Zarovnať doprava",justifyFull:"Zarovnať do bloku",horizontalRule:"Vložit vodorovnú čiaru",fullscreen:"Režim celej obrazovky",close:"Zavrieť",submit:"Potvrdiť",reset:"Zrušiť",required:"Povinné",description:"Popis",title:"Nadpis",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/sl.js b/dist/langs/sl.js new file mode 100644 index 000000000..0c5a3abf1 --- /dev/null +++ b/dist/langs/sl.js @@ -0,0 +1,60 @@ +/* =========================================================== + * sl.js + * Slovenian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author: Matjaz Zavski (https://github.com/matjaz321) + * Mod: Uros Gaber (uros@powercom.si) + */ + +jQuery.trumbowyg.langs.sl = { + viewHTML: 'Prikaži HTML', + + undo: 'Razveljavi', + redo: 'Ponovno uveljavi', + + formatting: 'Oblika', + p: 'Odstavek', + blockquote: 'Citat', + code: 'Koda', + header: 'Glava', + + bold: 'Krepko', + italic: 'Ležeče', + strikethrough: 'Prečrtano', + underline: 'Podčrtano', + + strong: 'Odebljeno', + em: 'Poudarjeno', + del: 'Izbrisano', + + unorderedList: 'Neoštevilčen seznam', + orderedList: 'Oštevilčen seznam', + + image: 'Slika', + insertImage: 'Vstavi sliko', + insertVideo: 'Vstavi video', + link: 'Povezava', + createLink: 'Vstavi povezavo', + unlink: 'Odstrani povezavo', + + justifyLeft: 'Poravnava levo', + justifyCenter: 'Poravnaj na sredino', + justifyRight: 'Poravnava desno', + justifyFull: 'Obojestranska poravnava', + + horizontalRule: 'Vstavite vodoravno črto', + removeformat: 'Odstrani format', + + fullscreen: 'Celozaslonski način', + + close: 'Zapri', + + submit: 'Potrdi', + reset: 'Prekliči', + + required: 'Zahtevano', + description: 'Opis', + title: 'Naslov', + text: 'Besedilo' +}; diff --git a/dist/langs/sl.min.js b/dist/langs/sl.min.js new file mode 100644 index 000000000..9c23cf125 --- /dev/null +++ b/dist/langs/sl.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * sl.js + * Slovenian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author: Matjaz Zavski (https://github.com/matjaz321) + * Mod: Uros Gaber (uros@powercom.si) + */ +jQuery.trumbowyg.langs.sl={viewHTML:"Prikaži HTML",undo:"Razveljavi",redo:"Ponovno uveljavi",formatting:"Oblika",p:"Odstavek",blockquote:"Citat",code:"Koda",header:"Glava",bold:"Krepko",italic:"Ležeče",strikethrough:"Prečrtano",underline:"Podčrtano",strong:"Odebljeno",em:"Poudarjeno",del:"Izbrisano",unorderedList:"Neoštevilčen seznam",orderedList:"Oštevilčen seznam",image:"Slika",insertImage:"Vstavi sliko",insertVideo:"Vstavi video",link:"Povezava",createLink:"Vstavi povezavo",unlink:"Odstrani povezavo",justifyLeft:"Poravnava levo",justifyCenter:"Poravnaj na sredino",justifyRight:"Poravnava desno",justifyFull:"Obojestranska poravnava",horizontalRule:"Vstavite vodoravno črto",removeformat:"Odstrani format",fullscreen:"Celozaslonski način",close:"Zapri",submit:"Potrdi",reset:"Prekliči",required:"Zahtevano",description:"Opis",title:"Naslov",text:"Besedilo"}; \ No newline at end of file diff --git a/dist/langs/sq.js b/dist/langs/sq.js new file mode 100644 index 000000000..b9921e6c2 --- /dev/null +++ b/dist/langs/sq.js @@ -0,0 +1,65 @@ +/* =========================================================== + * sq.js + * Albanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Adalen Vladi + */ + +jQuery.trumbowyg.langs.sq = { + + viewHTML: 'Shfaq HTML', + + undo: 'Prish', + redo: 'Ribej', + + formatting: 'Formatimi', + p: 'Paragraf', + blockquote: 'Citat', + code: 'Kodi', + header: 'Koka', + + bold: 'Spikatur', + italic: 'Pjerret', + strikethrough: 'Vize ne mes', + underline: 'Nenvizo', + + strong: 'I trashe', + em: 'I theksuar', + del: 'I fshire', + + superscript: 'Indeks i sipërm', + subscript: 'Indeks i poshtem', + + unorderedList: 'Liste e parenditur', + orderedList: 'Liste e renditur', + + + insertImage: 'Fut Foto', + insertVideo: 'Fut Video', + link: 'Link', + createLink: 'Krijo Link', + unlink: 'Hiq Link', + + justifyLeft: 'Drejto Majtas', + justifyCenter: 'Drejto ne Qender', + justifyRight: 'Drejto Djathtas', + justifyFull: 'Drejto Vete', + + horizontalRule: 'Vendos rregulloren horizontale', + removeformat: 'Hiq formatin', + + fullscreen: 'Ekran i plotë', + + close: 'Mbyll', + + submit: 'Konfirmo', + reset: 'Anullo', + + required: 'I detyrueshem', + description: 'Pershkrimi', + title: 'Titulli', + text: 'Tekst', + target: 'Objektivi', + width: 'Gjeresia' +}; diff --git a/dist/langs/sq.min.js b/dist/langs/sq.min.js new file mode 100644 index 000000000..eeae06b27 --- /dev/null +++ b/dist/langs/sq.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * sq.js + * Albanian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Adalen Vladi + */ +jQuery.trumbowyg.langs.sq={viewHTML:"Shfaq HTML",undo:"Prish",redo:"Ribej",formatting:"Formatimi",p:"Paragraf",blockquote:"Citat",code:"Kodi",header:"Koka",bold:"Spikatur",italic:"Pjerret",strikethrough:"Vize ne mes",underline:"Nenvizo",strong:"I trashe",em:"I theksuar",del:"I fshire",superscript:"Indeks i sipërm",subscript:"Indeks i poshtem",unorderedList:"Liste e parenditur",orderedList:"Liste e renditur",insertImage:"Fut Foto",insertVideo:"Fut Video",link:"Link",createLink:"Krijo Link",unlink:"Hiq Link",justifyLeft:"Drejto Majtas",justifyCenter:"Drejto ne Qender",justifyRight:"Drejto Djathtas",justifyFull:"Drejto Vete",horizontalRule:"Vendos rregulloren horizontale",removeformat:"Hiq formatin",fullscreen:"Ekran i plotë",close:"Mbyll",submit:"Konfirmo",reset:"Anullo",required:"I detyrueshem",description:"Pershkrimi",title:"Titulli",text:"Tekst",target:"Objektivi",width:"Gjeresia"}; \ No newline at end of file diff --git a/dist/langs/sv.js b/dist/langs/sv.js new file mode 100644 index 000000000..c410038d4 --- /dev/null +++ b/dist/langs/sv.js @@ -0,0 +1,59 @@ +/* =========================================================== + * sv.js + * Swedish translation for Trumbowyg + * http://www.tim-international.net + * =========================================================== + * Author : T. Almroth + * Github : https://github.com/timint + * + * Review : M Hagberg + * Github : https://github.com/pestbarn + */ + +jQuery.trumbowyg.langs.sv = { + viewHTML: 'Visa HTML', + + formatting: 'Formatering', + p: 'Paragraf', + blockquote: 'Citat', + code: 'Kod', + header: 'Rubrik', + + bold: 'Fet', + italic: 'Kursiv', + strikethrough: 'Genomstruken', + underline: 'Understruken', + + strong: 'Fet', + em: 'Kursiv', + del: 'Rensa formatering', + + unorderedList: 'Punktlista', + orderedList: 'Numrerad lista', + + insertImage: 'Infoga bild', + insertVideo: 'Infoga video', + link: 'Länk', + createLink: 'Infoga länk', + unlink: 'Ta bort länk', + + justifyLeft: 'Vänsterjustera', + justifyCenter: 'Centrera', + justifyRight: 'Högerjustera', + justifyFull: 'Marginaljustera', + + horizontalRule: 'Horisontell linje', + removeformat: 'Ta bort formatering', + + fullscreen: 'Fullskärm', + + close: 'Stäng', + + submit: 'Bekräfta', + reset: 'Återställ', + + required: 'Obligatorisk', + description: 'Beskrivning', + title: 'Titel', + text: 'Text' +}; diff --git a/dist/langs/sv.min.js b/dist/langs/sv.min.js new file mode 100644 index 000000000..b9ede9d96 --- /dev/null +++ b/dist/langs/sv.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * sv.js + * Swedish translation for Trumbowyg + * http://www.tim-international.net + * =========================================================== + * Author : T. Almroth + * Github : https://github.com/timint + * + * Review : M Hagberg + * Github : https://github.com/pestbarn + */ +jQuery.trumbowyg.langs.sv={viewHTML:"Visa HTML",formatting:"Formatering",p:"Paragraf",blockquote:"Citat",code:"Kod",header:"Rubrik",bold:"Fet",italic:"Kursiv",strikethrough:"Genomstruken",underline:"Understruken",strong:"Fet",em:"Kursiv",del:"Rensa formatering",unorderedList:"Punktlista",orderedList:"Numrerad lista",insertImage:"Infoga bild",insertVideo:"Infoga video",link:"Länk",createLink:"Infoga länk",unlink:"Ta bort länk",justifyLeft:"Vänsterjustera",justifyCenter:"Centrera",justifyRight:"Högerjustera",justifyFull:"Marginaljustera",horizontalRule:"Horisontell linje",removeformat:"Ta bort formatering",fullscreen:"Fullskärm",close:"Stäng",submit:"Bekräfta",reset:"Återställ",required:"Obligatorisk",description:"Beskrivning",title:"Titel",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/th.js b/dist/langs/th.js new file mode 100644 index 000000000..f07c6ac09 --- /dev/null +++ b/dist/langs/th.js @@ -0,0 +1,55 @@ +/* =========================================================== + * th.js + * Thai translation for Trumbowyg + * https://github.com/ionsoft/Trumbowyg + * =========================================================== + * Author : Gonatee Klanktong + * Github : https://github.com/gonateek + */ + +jQuery.trumbowyg.langs.th = { + viewHTML: 'ดู HTML', + + formatting: 'จัดรูปแบบ', + p: 'ย่อหน้า', + blockquote: 'อ้างอิง', + code: 'โค๊ด', + header: 'ส่วนหัว', + + bold: 'หนา', + italic: 'เอียง', + strikethrough: 'ขีดทับ', + underline: 'เส้นใต้', + + strong: 'สำคัญ', + em: 'เน้น', + del: 'ลบ', + + unorderedList: 'รายการ', + orderedList: 'รายการ(ตัวเลข)', + + insertImage: 'ใส่รูป', + insertVideo: 'ใส่วิดีโอ', + link: 'ลิงค์', + createLink: 'สร้างลิงค์', + unlink: 'ยกเลิกลิงค์', + + justifyLeft: 'ชิดซ้าย', + justifyCenter: 'กลาง', + justifyRight: 'ชิดขวา', + justifyFull: 'เต็มบรรทัด', + + horizontalRule: 'เส้นแนวนอน', + + fullscreen: 'เต็มหน้าจอ', + + close: 'ปิด', + + submit: 'ตกลง', + reset: 'เริ่มใหม่', + + required: 'จำเป็น', + description: 'คำอธิบาย', + title: 'หัวเรื่อง', + text: 'ข้อความ' +}; diff --git a/dist/langs/th.min.js b/dist/langs/th.min.js new file mode 100644 index 000000000..14bee1266 --- /dev/null +++ b/dist/langs/th.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * th.js + * Thai translation for Trumbowyg + * https://github.com/ionsoft/Trumbowyg + * =========================================================== + * Author : Gonatee Klanktong + * Github : https://github.com/gonateek + */ +jQuery.trumbowyg.langs.th={viewHTML:"ดู HTML",formatting:"จัดรูปแบบ",p:"ย่อหน้า",blockquote:"อ้างอิง",code:"โค๊ด",header:"ส่วนหัว",bold:"หนา",italic:"เอียง",strikethrough:"ขีดทับ",underline:"เส้นใต้",strong:"สำคัญ",em:"เน้น",del:"ลบ",unorderedList:"รายการ",orderedList:"รายการ(ตัวเลข)",insertImage:"ใส่รูป",insertVideo:"ใส่วิดีโอ",link:"ลิงค์",createLink:"สร้างลิงค์",unlink:"ยกเลิกลิงค์",justifyLeft:"ชิดซ้าย",justifyCenter:"กลาง",justifyRight:"ชิดขวา",justifyFull:"เต็มบรรทัด",horizontalRule:"เส้นแนวนอน",fullscreen:"เต็มหน้าจอ",close:"ปิด",submit:"ตกลง",reset:"เริ่มใหม่",required:"จำเป็น",description:"คำอธิบาย",title:"หัวเรื่อง",text:"ข้อความ"}; \ No newline at end of file diff --git a/dist/langs/tr.js b/dist/langs/tr.js new file mode 100644 index 000000000..642a4bf41 --- /dev/null +++ b/dist/langs/tr.js @@ -0,0 +1,63 @@ +/* =========================================================== + * tr.js + * Turkish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Emrah Bilbay (munzur) + * Github : https://github.com/munzur + * + * Özgür Görgülü (ozgurg) + * Github : https://github.com/ozgurg + */ + +jQuery.trumbowyg.langs.tr = { + viewHTML: 'HTML Kodu', + + undo: 'Yinele', + redo: 'Geri al', + + formatting: 'Biçimlendirme', + p: 'Paragraf', + blockquote: 'Alıntı', + code: 'Kod', + header: 'Başlık', + + bold: 'Kalın', + italic: 'İtalik', + strikethrough: 'Üzeri çizgili', + underline: 'Altı çizgili', + + strong: 'Koyu', + em: 'Vurgulu', + del: 'Üzeri çizgili', + + unorderedList: 'Simgeli liste', + orderedList: 'Numaralı liste', + + insertImage: 'Resim yerleştir', + insertVideo: 'Video yerleştir', + link: 'Link', + createLink: 'Link yerleştir', + unlink: 'Linki sil', + + justifyLeft: 'Sola hizala', + justifyCenter: 'Ortaya hizala', + justifyRight: 'Sağa hizala', + justifyFull: 'Yasla', + + horizontalRule: 'Yatay satır ekle', + + fullscreen: 'Tam ekran', + + close: 'Kapat', + + submit: 'Onayla', + reset: 'Sıfırla', + + required: 'Gerekli', + description: 'Açıklama', + title: 'Başlık', + text: 'Metin', + + removeformat: 'Biçimlendirmeyi temizle' +}; diff --git a/dist/langs/tr.min.js b/dist/langs/tr.min.js new file mode 100644 index 000000000..f51478c6d --- /dev/null +++ b/dist/langs/tr.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * tr.js + * Turkish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Emrah Bilbay (munzur) + * Github : https://github.com/munzur + * + * Özgür Görgülü (ozgurg) + * Github : https://github.com/ozgurg + */ +jQuery.trumbowyg.langs.tr={viewHTML:"HTML Kodu",undo:"Yinele",redo:"Geri al",formatting:"Biçimlendirme",p:"Paragraf",blockquote:"Alıntı",code:"Kod",header:"Başlık",bold:"Kalın",italic:"İtalik",strikethrough:"Üzeri çizgili",underline:"Altı çizgili",strong:"Koyu",em:"Vurgulu",del:"Üzeri çizgili",unorderedList:"Simgeli liste",orderedList:"Numaralı liste",insertImage:"Resim yerleştir",insertVideo:"Video yerleştir",link:"Link",createLink:"Link yerleştir",unlink:"Linki sil",justifyLeft:"Sola hizala",justifyCenter:"Ortaya hizala",justifyRight:"Sağa hizala",justifyFull:"Yasla",horizontalRule:"Yatay satır ekle",fullscreen:"Tam ekran",close:"Kapat",submit:"Onayla",reset:"Sıfırla",required:"Gerekli",description:"Açıklama",title:"Başlık",text:"Metin",removeformat:"Biçimlendirmeyi temizle"}; \ No newline at end of file diff --git a/dist/langs/ua.js b/dist/langs/ua.js new file mode 100644 index 000000000..673c6572d --- /dev/null +++ b/dist/langs/ua.js @@ -0,0 +1,54 @@ +/* =========================================================== + * ua.js + * Ukrainian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Igor Buksha + */ + +jQuery.trumbowyg.langs.ua = { + viewHTML: 'Подивитись HTML', + + formatting: 'Форматування', + p: 'Звичайний', + blockquote: 'Витяг', + code: 'Код', + header: 'Заголовок', + + bold: 'Напівжирний', + italic: 'Курсив', + strikethrough: 'Закреслений', + underline: 'Підкреслений', + + strong: 'Напівжирний', + em: 'Курсив', + del: 'Закреслений', + + unorderedList: 'Звичайний список', + orderedList: 'Нумерований список', + + insertImage: 'Вставити зображення', + insertVideo: 'Вставити відео', + link: 'Посилання', + createLink: 'Вставити посилання', + unlink: 'Видалити посилання', + + justifyLeft: 'По лівому краю', + justifyCenter: 'В центрі', + justifyRight: 'По правому краю', + justifyFull: 'По ширині', + + horizontalRule: 'Горизонтальна лінія', + + fullscreen: 'На весь екран', + + close: 'Закрити', + + submit: 'Вставити', + reset: 'Скасувати', + + required: 'Обов\'язкове', + description: 'Опис', + title: 'Підказка', + text: 'Текст' +}; diff --git a/dist/langs/ua.min.js b/dist/langs/ua.min.js new file mode 100644 index 000000000..dab810621 --- /dev/null +++ b/dist/langs/ua.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * ua.js + * Ukrainian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Igor Buksha + */ +jQuery.trumbowyg.langs.ua={viewHTML:"Подивитись HTML",formatting:"Форматування",p:"Звичайний",blockquote:"Витяг",code:"Код",header:"Заголовок",bold:"Напівжирний",italic:"Курсив",strikethrough:"Закреслений",underline:"Підкреслений",strong:"Напівжирний",em:"Курсив",del:"Закреслений",unorderedList:"Звичайний список",orderedList:"Нумерований список",insertImage:"Вставити зображення",insertVideo:"Вставити відео",link:"Посилання",createLink:"Вставити посилання",unlink:"Видалити посилання",justifyLeft:"По лівому краю",justifyCenter:"В центрі",justifyRight:"По правому краю",justifyFull:"По ширині",horizontalRule:"Горизонтальна лінія",fullscreen:"На весь екран",close:"Закрити",submit:"Вставити",reset:"Скасувати",required:"Обов'язкове",description:"Опис",title:"Підказка",text:"Текст"}; \ No newline at end of file diff --git a/dist/langs/vi.js b/dist/langs/vi.js new file mode 100644 index 000000000..ec0e153b2 --- /dev/null +++ b/dist/langs/vi.js @@ -0,0 +1,56 @@ +/* =========================================================== + * vi.js + * Vietnamese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : heocoi + * Github: https://github.com/heocoi + */ + +jQuery.trumbowyg.langs.vi = { + viewHTML: 'Hiển thị HTML', + + formatting: 'Định dạng', + p: 'Đoạn', + blockquote: 'Trích dẫn', + code: 'Code', + header: 'Đầu trang', + + bold: 'In đậm', + italic: 'In nghiêng', + strikethrough: 'Gạch ngang', + underline: 'Gạch chân', + + strong: 'In đậm', + em: 'In nghiêng', + del: 'Gạch ngang', + + unorderedList: 'Danh sách không thứ tự', + orderedList: 'Danh sách có thứ tự', + + insertImage: 'Chèn hình ảnh', + insertVideo: 'Chèn video', + link: 'Đường dẫn', + createLink: 'Tạo đường dẫn', + unlink: 'Hủy đường dẫn', + + justifyLeft: 'Canh lề trái', + justifyCenter: 'Canh giữa', + justifyRight: 'Canh lề phải', + justifyFull: 'Canh đều', + + horizontalRule: 'Thêm đường kẻ ngang', + + fullscreen: 'Toàn màn hình', + + close: 'Đóng', + + submit: 'Đồng ý', + reset: 'Hủy bỏ', + + required: 'Bắt buộc', + description: 'Mô tả', + title: 'Tiêu đề', + text: 'Nội dung', + target: 'Đối tượng' +}; diff --git a/dist/langs/vi.min.js b/dist/langs/vi.min.js new file mode 100644 index 000000000..25b736f78 --- /dev/null +++ b/dist/langs/vi.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * vi.js + * Vietnamese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : heocoi + * Github: https://github.com/heocoi + */ +jQuery.trumbowyg.langs.vi={viewHTML:"Hiển thị HTML",formatting:"Định dạng",p:"Đoạn",blockquote:"Trích dẫn",code:"Code",header:"Đầu trang",bold:"In đậm",italic:"In nghiêng",strikethrough:"Gạch ngang",underline:"Gạch chân",strong:"In đậm",em:"In nghiêng",del:"Gạch ngang",unorderedList:"Danh sách không thứ tự",orderedList:"Danh sách có thứ tự",insertImage:"Chèn hình ảnh",insertVideo:"Chèn video",link:"Đường dẫn",createLink:"Tạo đường dẫn",unlink:"Hủy đường dẫn",justifyLeft:"Canh lề trái",justifyCenter:"Canh giữa",justifyRight:"Canh lề phải",justifyFull:"Canh đều",horizontalRule:"Thêm đường kẻ ngang",fullscreen:"Toàn màn hình",close:"Đóng",submit:"Đồng ý",reset:"Hủy bỏ",required:"Bắt buộc",description:"Mô tả",title:"Tiêu đề",text:"Nội dung",target:"Đối tượng"}; \ No newline at end of file diff --git a/dist/langs/zh_cn.js b/dist/langs/zh_cn.js new file mode 100644 index 000000000..15ea439f7 --- /dev/null +++ b/dist/langs/zh_cn.js @@ -0,0 +1,57 @@ +/* =========================================================== + * zh_cn.js + * Simplified Chinese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Liu Kai (akai) + * Twitter : @akai404 + * Github : https://github.com/akai + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.zh_cn = { + viewHTML: '源代码', + + formatting: '格式', + p: '段落', + blockquote: '引用', + code: '代码', + header: '标题', + + bold: '加粗', + italic: '斜体', + strikethrough: '删除线', + underline: '下划线', + + strong: '加粗', + em: '斜体', + del: '删除线', + + unorderedList: '无序列表', + orderedList: '有序列表', + + insertImage: '插入图片', + insertVideo: '插入视频', + link: '超链接', + createLink: '插入链接', + unlink: '取消链接', + + justifyLeft: '居左对齐', + justifyCenter: '居中对齐', + justifyRight: '居右对齐', + justifyFull: '两端对齐', + + horizontalRule: '插入分隔线', + + fullscreen: '全屏', + + close: '关闭', + + submit: '确定', + reset: '取消', + + required: '必需的', + description: '描述', + title: '标题', + text: '文字' +}; diff --git a/dist/langs/zh_cn.min.js b/dist/langs/zh_cn.min.js new file mode 100644 index 000000000..9a200d9b0 --- /dev/null +++ b/dist/langs/zh_cn.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * zh_cn.js + * Simplified Chinese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Liu Kai (akai) + * Twitter : @akai404 + * Github : https://github.com/akai + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.zh_cn={viewHTML:"源代码",formatting:"格式",p:"段落",blockquote:"引用",code:"代码",header:"标题",bold:"加粗",italic:"斜体",strikethrough:"删除线",underline:"下划线",strong:"加粗",em:"斜体",del:"删除线",unorderedList:"无序列表",orderedList:"有序列表",insertImage:"插入图片",insertVideo:"插入视频",link:"超链接",createLink:"插入链接",unlink:"取消链接",justifyLeft:"居左对齐",justifyCenter:"居中对齐",justifyRight:"居右对齐",justifyFull:"两端对齐",horizontalRule:"插入分隔线",fullscreen:"全屏",close:"关闭",submit:"确定",reset:"取消",required:"必需的",description:"描述",title:"标题",text:"文字"}; \ No newline at end of file diff --git a/dist/langs/zh_tw.js b/dist/langs/zh_tw.js new file mode 100644 index 000000000..87e5a6aa5 --- /dev/null +++ b/dist/langs/zh_tw.js @@ -0,0 +1,66 @@ +/* =========================================================== + * zh_tw.js + * Traditional Chinese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Peter Dave Hello (PeterDaveHello) + * Twitter : @PeterDaveHello + * Github : https://github.com/PeterDaveHello + */ + +// jshint camelcase:false +jQuery.trumbowyg.langs.zh_tw = { + viewHTML: '原始碼', + + undo: '復原', + redo: '重做', + + formatting: '格式', + p: '段落', + blockquote: '引用', + code: '代碼', + header: '標題', + + bold: '加粗', + italic: '斜體', + strikethrough: '刪除線', + underline: '底線', + + strong: '粗體', + em: '斜體', + del: '刪除線', + + superscript: '上標', + subscript: '下標', + + unorderedList: '無序列表', + orderedList: '有序列表', + + insertImage: '插入圖片', + insertVideo: '插入影片', + link: '超連結', + createLink: '插入連結', + unlink: '取消連結', + + justifyLeft: '靠左對齊', + justifyCenter: '置中對齊', + justifyRight: '靠右對齊', + justifyFull: '左右對齊', + + horizontalRule: '插入分隔線', + removeformat: '移除格式', + + fullscreen: '全螢幕', + + close: '關閉', + + submit: '確定', + reset: '取消', + + required: '必需的', + description: '描述', + title: '標題', + text: '文字', + target: '目標', + width: '寬度' +}; diff --git a/dist/langs/zh_tw.min.js b/dist/langs/zh_tw.min.js new file mode 100644 index 000000000..95f632e8d --- /dev/null +++ b/dist/langs/zh_tw.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * zh_tw.js + * Traditional Chinese translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Peter Dave Hello (PeterDaveHello) + * Twitter : @PeterDaveHello + * Github : https://github.com/PeterDaveHello + */ +// jshint camelcase:false +jQuery.trumbowyg.langs.zh_tw={viewHTML:"原始碼",undo:"復原",redo:"重做",formatting:"格式",p:"段落",blockquote:"引用",code:"代碼",header:"標題",bold:"加粗",italic:"斜體",strikethrough:"刪除線",underline:"底線",strong:"粗體",em:"斜體",del:"刪除線",superscript:"上標",subscript:"下標",unorderedList:"無序列表",orderedList:"有序列表",insertImage:"插入圖片",insertVideo:"插入影片",link:"超連結",createLink:"插入連結",unlink:"取消連結",justifyLeft:"靠左對齊",justifyCenter:"置中對齊",justifyRight:"靠右對齊",justifyFull:"左右對齊",horizontalRule:"插入分隔線",removeformat:"移除格式",fullscreen:"全螢幕",close:"關閉",submit:"確定",reset:"取消",required:"必需的",description:"描述",title:"標題",text:"文字",target:"目標",width:"寬度"}; \ No newline at end of file diff --git a/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js b/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js new file mode 100644 index 000000000..227ba89a1 --- /dev/null +++ b/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js @@ -0,0 +1,162 @@ +/* =========================================================== + * trumbowyg.allowTagsFromPaste.js v1.0.2 + * It cleans tags from pasted text, whilst allowing several specified tags + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fathi Anshory (0x00000F5C) + * Twitter : @fscchannl + * Notes: + * - removeformatPasted must be set to FALSE since it was applied prior to pasteHandlers, or else it will be useless + * - It is most advisable to use along with the cleanpaste plugin, or else you'd end up with dirty markup + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + // When empty, all tags are allowed making this plugin useless + // If you want to remove all tags, use removeformatPasted core option instead + allowedTags: [], + // List of tags which can be allowed + removableTags: [ + 'a', + 'abbr', + 'address', + 'b', + 'bdi', + 'bdo', + 'blockquote', + 'br', + 'cite', + 'code', + 'del', + 'dfn', + 'details', + 'em', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'hr', + 'i', + 'ins', + 'kbd', + 'mark', + 'meter', + 'pre', + 'progress', + 'q', + 'rp', + 'rt', + 'ruby', + 's', + 'samp', + 'small', + 'span', + 'strong', + 'sub', + 'summary', + 'sup', + 'time', + 'u', + 'var', + 'wbr', + 'img', + 'map', + 'area', + 'canvas', + 'figcaption', + 'figure', + 'picture', + 'audio', + 'source', + 'track', + 'video', + 'ul', + 'ol', + 'li', + 'dl', + 'dt', + 'dd', + 'table', + 'caption', + 'th', + 'tr', + 'td', + 'thead', + 'tbody', + 'tfoot', + 'col', + 'colgroup', + 'style', + 'div', + 'p', + 'form', + 'input', + 'textarea', + 'button', + 'select', + 'optgroup', + 'option', + 'label', + 'fieldset', + 'legend', + 'datalist', + 'keygen', + 'output', + 'iframe', + 'link', + 'nav', + 'header', + 'hgroup', + 'footer', + 'main', + 'section', + 'article', + 'aside', + 'dialog', + 'script', + 'noscript', + 'embed', + 'object', + 'param' + ] + }; + + $.extend(true, $.trumbowyg, { + plugins: { + allowTagsFromPaste: { + init: function (trumbowyg) { + if (!trumbowyg.o.plugins.allowTagsFromPaste) { + return; + } + + // Force disable remove format pasted + trumbowyg.o.removeformatPasted = false; + + var allowedTags = trumbowyg.o.plugins.allowTagsFromPaste.allowedTags || defaultOptions.allowedTags; + var removableTags = trumbowyg.o.plugins.allowTagsFromPaste.removableTags || defaultOptions.removableTags; + + if (allowedTags.length === 0) { + return; + } + + // Get list of tags to remove + var tagsToRemove = $(removableTags).not(allowedTags).get(); + + trumbowyg.pasteHandlers.push(function () { + setTimeout(function () { + var processNodes = trumbowyg.$ed.html(); + $.each(tagsToRemove, function (iterator, tagName) { + processNodes = processNodes.replace(new RegExp('<\\/?' + tagName + '(\\s[^>]*)?>', 'gi'), ''); + }); + trumbowyg.$ed.html(processNodes); + }, 0); + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js b/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js new file mode 100644 index 000000000..22b18283b --- /dev/null +++ b/dist/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * trumbowyg.allowTagsFromPaste.js v1.0.2 + * It cleans tags from pasted text, whilst allowing several specified tags + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fathi Anshory (0x00000F5C) + * Twitter : @fscchannl + * Notes: + * - removeformatPasted must be set to FALSE since it was applied prior to pasteHandlers, or else it will be useless + * - It is most advisable to use along with the cleanpaste plugin, or else you'd end up with dirty markup + */ +!function(e){"use strict";var a={allowedTags:[],removableTags:["a","abbr","address","b","bdi","bdo","blockquote","br","cite","code","del","dfn","details","em","h1","h2","h3","h4","h5","h6","hr","i","ins","kbd","mark","meter","pre","progress","q","rp","rt","ruby","s","samp","small","span","strong","sub","summary","sup","time","u","var","wbr","img","map","area","canvas","figcaption","figure","picture","audio","source","track","video","ul","ol","li","dl","dt","dd","table","caption","th","tr","td","thead","tbody","tfoot","col","colgroup","style","div","p","form","input","textarea","button","select","optgroup","option","label","fieldset","legend","datalist","keygen","output","iframe","link","nav","header","hgroup","footer","main","section","article","aside","dialog","script","noscript","embed","object","param"]};e.extend(!0,e.trumbowyg,{plugins:{allowTagsFromPaste:{init:function(t){if(t.o.plugins.allowTagsFromPaste){t.o.removeformatPasted=!1;var o=t.o.plugins.allowTagsFromPaste.allowedTags||a.allowedTags,r=t.o.plugins.allowTagsFromPaste.removableTags||a.removableTags;if(0!==o.length){var s=e(r).not(o).get();t.pasteHandlers.push((function(){setTimeout((function(){var a=t.$ed.html();e.each(s,(function(e,t){a=a.replace(new RegExp("<\\/?"+t+"(\\s[^>]*)?>","gi"),"")})),t.$ed.html(a)}),0)}))}}}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/base64/trumbowyg.base64.js b/dist/plugins/base64/trumbowyg.base64.js new file mode 100644 index 000000000..2592aec37 --- /dev/null +++ b/dist/plugins/base64/trumbowyg.base64.js @@ -0,0 +1,192 @@ +/* =========================================================== + * trumbowyg.base64.js v1.0 + * Base64 plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Cyril Biencourt (lizardK) + */ + +(function ($) { + 'use strict'; + + var isSupported = function () { + return typeof FileReader !== 'undefined'; + }; + + var isValidImage = function (type) { + return /^data:image\/[a-z]?/i.test(type); + }; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + base64: 'Image as base64', + file: 'File', + errFileReaderNotSupported: 'FileReader is not supported by your browser.', + errInvalidImage: 'Invalid image file.' + }, + az: { + base64: 'base64 olaraq şəkil', + file: 'Fayl', + errFileReaderNotSupported: 'FileReader brauzeriniz tərəfindən dəstəklənmir.', + errInvalidImage: 'Yanlış şəkil faylı.' + }, + by: { + base64: 'Выява (фармат base64)', + file: 'Файл', + errFileReaderNotSupported: 'FileReader не падтрымліваецца вашым браўзэрам.', + errInvalidImage: 'Несапраўдны файл выявы.' + }, + cs: { + base64: 'Vložit obrázek', + file: 'Soubor' + }, + da: { + base64: 'Billede som base64', + file: 'Fil', + errFileReaderNotSupported: 'FileReader er ikke understøttet af din browser.', + errInvalidImage: 'Ugyldig billedfil.' + }, + de: { + base64: 'Bild als base64', + file: 'Datei', + errFileReaderNotSupported: 'FileReader ist nicht in deinem Browser unterstützt.', + errInvalidImage: 'Ungültige Bilddatei.' + }, + et: { + base64: 'Pilt base64 formaadis', + file: 'Fail', + errFileReaderNotSupported: 'Teie veebilehitseja ei toeta FileReader funktsiooni.', + errInvalidImage: 'Vigane pildifail.' + }, + fr: { + base64: 'Image en base64', + file: 'Fichier', + errFileReaderNotSupported: 'FileReader n\'est pas supporté par votre navigateur.', + errInvalidImage: 'Fichier image invalide.' + }, + hu: { + base64: 'Kép beszúrás inline', + file: 'Fájl', + errFileReaderNotSupported: 'Ez a böngésző nem támogatja a FileReader funkciót.', + errInvalidImage: 'Érvénytelen képfájl.' + }, + ja: { + base64: '画像 (Base64形式)', + file: 'ファイル', + errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません', + errInvalidImage: '画像形式が正しくありません' + }, + ko: { + base64: '그림 넣기(base64)', + file: '파일', + errFileReaderNotSupported: 'FileReader가 현재 브라우저를 지원하지 않습니다.', + errInvalidImage: '유효하지 않은 파일' + }, + nl: { + base64: 'Afbeelding inline', + file: 'Bestand', + errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.', + errInvalidImage: 'De gekozen afbeelding is ongeldig.' + }, + pt_br: { + base64: 'Imagem em base64', + file: 'Arquivo', + errFileReaderNotSupported: 'FileReader não é suportado pelo seu navegador.', + errInvalidImage: 'Arquivo de imagem inválido.' + }, + ru: { + base64: 'Изображение как код в base64', + file: 'Файл', + errFileReaderNotSupported: 'FileReader не поддерживается вашим браузером.', + errInvalidImage: 'Недопустимый файл изображения.' + }, + sl: { + base64: 'Slika kot base64', + file: 'Datoteka', + errFileReaderNotSupported: 'FileReader ni podprt v tem brskalniku.', + errInvalidImage: 'Neveljavna datoteka s sliko.' + }, + tr: { + base64: 'Base64 olarak resim', + file: 'Dosya', + errFileReaderNotSupported: 'FileReader tarayıcınız tarafından desteklenmiyor.', + errInvalidImage: 'Geçersiz resim dosyası.' + }, + zh_cn: { + base64: '图片(Base64编码)', + file: '文件' + }, + zh_tw: { + base64: '圖片(base64編碼)', + file: '檔案', + errFileReaderNotSupported: '你的瀏覽器不支援FileReader', + errInvalidImage: '不正確的檔案格式' + }, + }, + // jshint camelcase:true + + plugins: { + base64: { + shouldInit: isSupported, + init: function (trumbowyg) { + var btnDef = { + isSupported: isSupported, + fn: function () { + trumbowyg.saveRange(); + + var file; + var $modal = trumbowyg.openModalInsert( + // Title + trumbowyg.lang.base64, + + // Fields + { + file: { + type: 'file', + required: true, + attributes: { + accept: 'image/*' + } + }, + alt: { + label: 'description', + value: trumbowyg.getRangeText() + } + }, + + // Callback + function (values) { + var fReader = new FileReader(); + + fReader.onloadend = function (e) { + if (isValidImage(e.target.result)) { + trumbowyg.execCmd('insertImage', fReader.result, false, true); + $(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt); + trumbowyg.syncCode(); + trumbowyg.closeModal(); + } else { + trumbowyg.addErrorOnModalField( + $('input[type=file]', $modal), + trumbowyg.lang.errInvalidImage + ); + } + }; + + fReader.readAsDataURL(file); + } + ); + + $('input[type=file]').on('change', function (e) { + file = e.target.files[0]; + }); + } + }; + + trumbowyg.addBtnDef('base64', btnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/base64/trumbowyg.base64.min.js b/dist/plugins/base64/trumbowyg.base64.min.js new file mode 100644 index 000000000..57bec0444 --- /dev/null +++ b/dist/plugins/base64/trumbowyg.base64.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * trumbowyg.base64.js v1.0 + * Base64 plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Cyril Biencourt (lizardK) + */ +!function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},az:{base64:"base64 olaraq şəkil",file:"Fayl",errFileReaderNotSupported:"FileReader brauzeriniz tərəfindən dəstəklənmir.",errInvalidImage:"Yanlış şəkil faylı."},by:{base64:"Выява (фармат base64)",file:"Файл",errFileReaderNotSupported:"FileReader не падтрымліваецца вашым браўзэрам.",errInvalidImage:"Несапраўдны файл выявы."},cs:{base64:"Vložit obrázek",file:"Soubor"},da:{base64:"Billede som base64",file:"Fil",errFileReaderNotSupported:"FileReader er ikke understøttet af din browser.",errInvalidImage:"Ugyldig billedfil."},de:{base64:"Bild als base64",file:"Datei",errFileReaderNotSupported:"FileReader ist nicht in deinem Browser unterstützt.",errInvalidImage:"Ungültige Bilddatei."},et:{base64:"Pilt base64 formaadis",file:"Fail",errFileReaderNotSupported:"Teie veebilehitseja ei toeta FileReader funktsiooni.",errInvalidImage:"Vigane pildifail."},fr:{base64:"Image en base64",file:"Fichier",errFileReaderNotSupported:"FileReader n'est pas supporté par votre navigateur.",errInvalidImage:"Fichier image invalide."},hu:{base64:"Kép beszúrás inline",file:"Fájl",errFileReaderNotSupported:"Ez a böngésző nem támogatja a FileReader funkciót.",errInvalidImage:"Érvénytelen képfájl."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"},ko:{base64:"그림 넣기(base64)",file:"파일",errFileReaderNotSupported:"FileReader가 현재 브라우저를 지원하지 않습니다.",errInvalidImage:"유효하지 않은 파일"},nl:{base64:"Afbeelding inline",file:"Bestand",errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},pt_br:{base64:"Imagem em base64",file:"Arquivo",errFileReaderNotSupported:"FileReader não é suportado pelo seu navegador.",errInvalidImage:"Arquivo de imagem inválido."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},sl:{base64:"Slika kot base64",file:"Datoteka",errFileReaderNotSupported:"FileReader ni podprt v tem brskalniku.",errInvalidImage:"Neveljavna datoteka s sliko."},tr:{base64:"Base64 olarak resim",file:"Dosya",errFileReaderNotSupported:"FileReader tarayıcınız tarafından desteklenmiyor.",errInvalidImage:"Geçersiz resim dosyası."},zh_cn:{base64:"图片(Base64编码)",file:"文件"},zh_tw:{base64:"圖片(base64編碼)",file:"檔案",errFileReaderNotSupported:"你的瀏覽器不支援FileReader",errInvalidImage:"不正確的檔案格式"}},plugins:{base64:{shouldInit:a,init:function(r){var i={isSupported:a,fn:function(){var a;r.saveRange();var i=r.openModalInsert(r.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:r.getRangeText()}},(function(l){var t=new FileReader;t.onloadend=function(a){var d;d=a.target.result,/^data:image\/[a-z]?/i.test(d)?(r.execCmd("insertImage",t.result,!1,!0),e(['img[src="',t.result,'"]:not([alt])'].join(""),r.$box).attr("alt",l.alt),r.syncCode(),r.closeModal()):r.addErrorOnModalField(e("input[type=file]",i),r.lang.errInvalidImage)},t.readAsDataURL(a)}));e("input[type=file]").on("change",(function(e){a=e.target.files[0]}))}};r.addBtnDef("base64",i)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/cleanpaste/trumbowyg.cleanpaste.js b/dist/plugins/cleanpaste/trumbowyg.cleanpaste.js new file mode 100644 index 000000000..444fd5f9c --- /dev/null +++ b/dist/plugins/cleanpaste/trumbowyg.cleanpaste.js @@ -0,0 +1,147 @@ +/* =========================================================== + * trumbowyg.cleanpaste.js v1.0 + * Font Clean paste plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : Eric Radin + * Todd Graham (slackwalker) + * + * This plugin will perform a "cleaning" on any paste, in particular + * it will clean pasted content of microsoft word document tags and classes. + */ + +(function ($) { + 'use strict'; + + function checkValidTags(snippet) { + var theString = snippet; + + // Replace uppercase element names with lowercase + theString = theString.replace(/<[^> ]*/g, function (match) { + return match.toLowerCase(); + }); + + // Replace uppercase attribute names with lowercase + theString = theString.replace(/<[^>]*>/g, function (match) { + match = match.replace(/ [^=]+=/g, function (match2) { + return match2.toLowerCase(); + }); + return match; + }); + + // Put quotes around unquoted attributes + theString = theString.replace(/<[^>]*>/g, function (match) { + match = match.replace(/( [^=]+=)([^"][^ >]*)/g, '$1\"$2\"'); + return match; + }); + + return theString; + } + + function cleanIt(html) { + // first make sure all tags and attributes are made valid + html = checkValidTags(html); + + // Replace opening bold tags with strong + html = html.replace(/)/g, ')/g, ')/g, ')/g, '\s*/g, ''); + + // strip out   -cgCraft + html = html.replace(/ /gi, ' '); + // strip out extra spaces -cgCraft + html = html.replace(/ <\//gi, ']*>/g, function (match) { + match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) { + if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) { + return match2; + } + return ''; + }); + return match; + }); + + // Final clean out for MS Word crud + html = html.replace(/<\?xml[^>]*>/g, ''); + html = html.replace(/<[^ >]+:[^>]*>/g, ''); + html = html.replace(/<\/[^ >]+:[^>]*>/g, ''); + + // remove unwanted tags + html = html.replace(/<(div|span|style|meta|link).*?>/gi, ''); + + return html; + } + + // clean editor + // this will clean the inserted contents + // it does a compare, before and after paste to determine the + // pasted contents + $.extend(true, $.trumbowyg, { + plugins: { + cleanPaste: { + init: function (trumbowyg) { + trumbowyg.pasteHandlers.push(function (pasteEvent) { + setTimeout(function () { + try { + trumbowyg.saveRange(); + + var clipboardData = (pasteEvent.originalEvent || pasteEvent).clipboardData, + pastedData = clipboardData.getData('Text'), + node = trumbowyg.doc.getSelection().focusNode, + range = trumbowyg.doc.createRange(), + cleanedPaste = cleanIt(pastedData.trim()), + newNode = $(cleanedPaste)[0] || trumbowyg.doc.createTextNode(cleanedPaste); + + if (trumbowyg.$ed.html() === '') { + // simply append if there is no content in editor + trumbowyg.$ed[0].appendChild(newNode); + } else { + // insert pasted content behind last focused node + range.setStartAfter(node); + range.setEndAfter(node); + trumbowyg.doc.getSelection().removeAllRanges(); + trumbowyg.doc.getSelection().addRange(range); + + trumbowyg.range.insertNode(newNode); + } + + // now set cursor right after pasted content + range = trumbowyg.doc.createRange(); + range.setStartAfter(newNode); + range.setEndAfter(newNode); + trumbowyg.doc.getSelection().removeAllRanges(); + trumbowyg.doc.getSelection().addRange(range); + + // prevent defaults + pasteEvent.stopPropagation(); + pasteEvent.preventDefault(); + + // save new node as focused node + trumbowyg.saveRange(); + trumbowyg.syncCode(); + trumbowyg.$c.trigger('tbwchange'); + } catch (c) { + } + }, 0); + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/cleanpaste/trumbowyg.cleanpaste.min.js b/dist/plugins/cleanpaste/trumbowyg.cleanpaste.min.js new file mode 100644 index 000000000..7584d77aa --- /dev/null +++ b/dist/plugins/cleanpaste/trumbowyg.cleanpaste.min.js @@ -0,0 +1,12 @@ +/* =========================================================== + * trumbowyg.cleanpaste.js v1.0 + * Font Clean paste plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : Eric Radin + * Todd Graham (slackwalker) + * + * This plugin will perform a "cleaning" on any paste, in particular + * it will clean pasted content of microsoft word document tags and classes. + */ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{cleanPaste:{init:function(t){t.pasteHandlers.push((function(r){setTimeout((function(){try{t.saveRange();var a=(r.originalEvent||r).clipboardData.getData("Text"),n=t.doc.getSelection().focusNode,c=t.doc.createRange(),g=((l=(l=(l=(l=(l=(l=(l=(l=(l=a.trim()).replace(/<[^> ]*/g,(function(e){return e.toLowerCase()})).replace(/<[^>]*>/g,(function(e){return e.replace(/ [^=]+=/g,(function(e){return e.toLowerCase()}))})).replace(/<[^>]*>/g,(function(e){return e.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')}))).replace(/)/g,")/g,")/g,")/g,"\s*/g,"")).replace(/ /gi," ")).replace(/ <\//gi,"]*>/g,(function(e){return e.replace(/ ([^=]+)="[^"]*"/g,(function(e,t){return-1!==["alt","href","src","title"].indexOf(t)?e:""}))}))).replace(/<\?xml[^>]*>/g,"")).replace(/<[^ >]+:[^>]*>/g,"")).replace(/<\/[^ >]+:[^>]*>/g,"")).replace(/<(div|span|style|meta|link).*?>/gi,"")),o=e(g)[0]||t.doc.createTextNode(g);""===t.$ed.html()?t.$ed[0].appendChild(o):(c.setStartAfter(n),c.setEndAfter(n),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(c),t.range.insertNode(o)),(c=t.doc.createRange()).setStartAfter(o),c.setEndAfter(o),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(c),r.stopPropagation(),r.preventDefault(),t.saveRange(),t.syncCode(),t.$c.trigger("tbwchange")}catch(e){}var l}),0)}))}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/colors/trumbowyg.colors.js b/dist/plugins/colors/trumbowyg.colors.js new file mode 100644 index 000000000..37b270d4d --- /dev/null +++ b/dist/plugins/colors/trumbowyg.colors.js @@ -0,0 +1,301 @@ +/* =========================================================== + * trumbowyg.colors.js v1.2 + * Colors picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + foreColor: 'Text color', + backColor: 'Background color', + foreColorRemove: 'Remove text color', + backColorRemove: 'Remove background color' + }, + az: { + foreColor: 'Yazı rəngi', + backColor: 'Arxa plan rəngi', + foreColorRemove: 'Yazı rəngini sil', + backColorRemove: 'Arxa plan rəngini sil' + }, + by: { + foreColor: 'Колер тэксту', + backColor: 'Колер фону тэксту', + foreColorRemove: 'Выдаліць колер тэксту', + backColorRemove: 'Выдаліць колер фону тэксту' + }, + ca: { + foreColor: 'Color del text', + backColor: 'Color del fons', + foreColorRemove: 'Eliminar color del text', + backColorRemove: 'Eliminar color del fons' + }, + cs: { + foreColor: 'Barva textu', + backColor: 'Barva pozadí' + }, + da: { + foreColor: 'Tekstfarve', + backColor: 'Baggrundsfarve' + }, + de: { + foreColor: 'Textfarbe', + backColor: 'Hintergrundfarbe', + foreColorRemove: 'Textfarbe entfernen', + backColorRemove: 'Hintergundfarbe entfernen' + }, + es: { + foreColor: 'Color del texto', + backColor: 'Color del fondo', + foreColorRemove: 'Eliminar color del texto', + backColorRemove: 'Eliminar color del fondo' + }, + et: { + foreColor: 'Teksti värv', + backColor: 'Taustavärv', + foreColorRemove: 'Eemalda teksti värv', + backColorRemove: 'Eemalda taustavärv' + }, + fr: { + foreColor: 'Couleur du texte', + backColor: 'Couleur de fond', + foreColorRemove: 'Supprimer la couleur du texte', + backColorRemove: 'Supprimer la couleur de fond' + }, + hu: { + foreColor: 'Betű szín', + backColor: 'Háttér szín', + foreColorRemove: 'Betű szín eltávolítása', + backColorRemove: 'Háttér szín eltávolítása' + }, + ja: { + foreColor: '文字色', + backColor: '背景色' + }, + ko: { + foreColor: '글자색', + backColor: '배경색', + foreColorRemove: '글자색 지우기', + backColorRemove: '배경색 지우기' + }, + nl: { + foreColor: 'Tekstkleur', + backColor: 'Achtergrondkleur' + }, + pt_br: { + foreColor: 'Cor de fonte', + backColor: 'Cor de fundo' + }, + ru: { + foreColor: 'Цвет текста', + backColor: 'Цвет выделения текста', + foreColorRemove: 'Очистить цвет текста', + backColorRemove: 'Очистить цвет выделения текста' + }, + sl: { + foreColor: 'Barva teksta', + backColor: 'Barva ozadja', + foreColorRemove: 'Ponastavi barvo teksta', + backColorRemove: 'Ponastavi barvo ozadja', + }, + sk: { + foreColor: 'Farba textu', + backColor: 'Farba pozadia' + }, + tr: { + foreColor: 'Yazı rengi', + backColor: 'Arka plan rengi', + foreColorRemove: 'Yazı rengini kaldır', + backColorRemove: 'Arka plan rengini kaldır' + }, + zh_cn: { + foreColor: '文字颜色', + backColor: '背景颜色' + }, + zh_tw: { + foreColor: '文字顏色', + backColor: '背景顏色' + }, + } + }); + + // jshint camelcase:true + + + function hex(x) { + return ('0' + parseInt(x).toString(16)).slice(-2); + } + + function colorToHex(rgb) { + if (rgb.search('rgb') === -1) { + return rgb.replace('#', ''); + } else if (rgb === 'rgba(0, 0, 0, 0)') { + return 'transparent'; + } else { + rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/); + if (rgb == null) { + return 'transparent'; // No match, return transparent as unkown color + } + return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); + } + } + + function colorTagHandler(element, trumbowyg) { + var tags = []; + + if (!element.style) { + return tags; + } + + // background color + if (element.style.backgroundColor !== '') { + var backColor = colorToHex(element.style.backgroundColor); + if (trumbowyg.o.plugins.colors.colorList.indexOf(backColor) >= 0) { + tags.push('backColor' + backColor); + } else { + tags.push('backColorFree'); + } + } + + // text color + var foreColor; + if (element.style.color !== '') { + foreColor = colorToHex(element.style.color); + } else if (element.hasAttribute('color')) { + foreColor = colorToHex(element.getAttribute('color')); + } + if (foreColor) { + if (trumbowyg.o.plugins.colors.colorList.indexOf(foreColor) >= 0) { + tags.push('foreColor' + foreColor); + } else { + tags.push('foreColorFree'); + } + } + + return tags; + } + + var defaultOptions = { + colorList: [ + 'ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00', + 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca', + 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694', + 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314', + 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100', + '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000' + ], + foreColorList: null, // fallbacks on colorList + backColorList: null, // fallbacks on colorList + allowCustomForeColor: true, + allowCustomBackColor: true, + displayAsList: false, + }; + + // Add all colors in two dropdowns + $.extend(true, $.trumbowyg, { + plugins: { + color: { + init: function (trumbowyg) { + trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions; + var dropdownClass = trumbowyg.o.plugins.colors.displayAsList ? trumbowyg.o.prefix + 'dropdown--color-list' : ''; + + var foreColorBtnDef = { + dropdown: buildDropdown('foreColor', trumbowyg), + dropdownClass: dropdownClass, + }, + backColorBtnDef = { + dropdown: buildDropdown('backColor', trumbowyg), + dropdownClass: dropdownClass, + }; + + trumbowyg.addBtnDef('foreColor', foreColorBtnDef); + trumbowyg.addBtnDef('backColor', backColorBtnDef); + }, + tagHandler: colorTagHandler + } + } + }); + + function buildDropdown(fn, trumbowyg) { + var dropdown = [], + trumbowygColorOptions = trumbowyg.o.plugins.colors, + colorList = trumbowygColorOptions[fn + 'List'] || trumbowygColorOptions.colorList; + + $.each(colorList, function (i, color) { + var btn = fn + color, + btnDef = { + fn: fn, + forceCss: true, + hasIcon: false, + text: trumbowyg.lang['#' + color] || ('#' + color), + param: '#' + color, + style: 'background-color: #' + color + ';' + }; + + if (trumbowygColorOptions.displayAsList && fn === 'foreColor') { + btnDef.style = 'color: #' + color + ' !important;'; + } + + trumbowyg.addBtnDef(btn, btnDef); + dropdown.push(btn); + }); + + // Remove color + var removeColorButtonName = fn + 'Remove', + removeColorBtnDef = { + fn: 'removeFormat', + hasIcon: false, + param: fn, + style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);' + }; + + if (trumbowygColorOptions.displayAsList) { + removeColorBtnDef.style = ''; + } + + trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef); + dropdown.push(removeColorButtonName); + + // Custom color + if (trumbowygColorOptions['allowCustom' + fn.charAt(0).toUpperCase() + fn.substr(1)]) { + // add free color btn + var freeColorButtonName = fn + 'Free', + freeColorBtnDef = { + fn: function () { + trumbowyg.openModalInsert(trumbowyg.lang[fn], + { + color: { + label: fn, + forceCss: true, + type: 'color', + value: '#FFFFFF' + } + }, + // callback + function (values) { + trumbowyg.execCmd(fn, values.color); + return true; + } + ); + }, + hasIcon: false, + text: '#', + // style adjust for displaying the text + style: 'text-indent: 0; line-height: 20px; padding: 0 5px;' + }; + + trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef); + dropdown.push(freeColorButtonName); + } + + return dropdown; + } +})(jQuery); diff --git a/dist/plugins/colors/trumbowyg.colors.min.js b/dist/plugins/colors/trumbowyg.colors.min.js new file mode 100644 index 000000000..a8659dfb8 --- /dev/null +++ b/dist/plugins/colors/trumbowyg.colors.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * trumbowyg.colors.js v1.2 + * Colors picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ +!function(o){"use strict";function r(o){return("0"+parseInt(o).toString(16)).slice(-2)}function e(o){return-1===o.search("rgb")?o.replace("#",""):"rgba(0, 0, 0, 0)"===o||null==(o=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/))?"transparent":r(o[1])+r(o[2])+r(o[3])}o.extend(!0,o.trumbowyg,{langs:{en:{foreColor:"Text color",backColor:"Background color",foreColorRemove:"Remove text color",backColorRemove:"Remove background color"},az:{foreColor:"Yazı rəngi",backColor:"Arxa plan rəngi",foreColorRemove:"Yazı rəngini sil",backColorRemove:"Arxa plan rəngini sil"},by:{foreColor:"Колер тэксту",backColor:"Колер фону тэксту",foreColorRemove:"Выдаліць колер тэксту",backColorRemove:"Выдаліць колер фону тэксту"},ca:{foreColor:"Color del text",backColor:"Color del fons",foreColorRemove:"Eliminar color del text",backColorRemove:"Eliminar color del fons"},cs:{foreColor:"Barva textu",backColor:"Barva pozadí"},da:{foreColor:"Tekstfarve",backColor:"Baggrundsfarve"},de:{foreColor:"Textfarbe",backColor:"Hintergrundfarbe",foreColorRemove:"Textfarbe entfernen",backColorRemove:"Hintergundfarbe entfernen"},es:{foreColor:"Color del texto",backColor:"Color del fondo",foreColorRemove:"Eliminar color del texto",backColorRemove:"Eliminar color del fondo"},et:{foreColor:"Teksti värv",backColor:"Taustavärv",foreColorRemove:"Eemalda teksti värv",backColorRemove:"Eemalda taustavärv"},fr:{foreColor:"Couleur du texte",backColor:"Couleur de fond",foreColorRemove:"Supprimer la couleur du texte",backColorRemove:"Supprimer la couleur de fond"},hu:{foreColor:"Betű szín",backColor:"Háttér szín",foreColorRemove:"Betű szín eltávolítása",backColorRemove:"Háttér szín eltávolítása"},ja:{foreColor:"文字色",backColor:"背景色"},ko:{foreColor:"글자색",backColor:"배경색",foreColorRemove:"글자색 지우기",backColorRemove:"배경색 지우기"},nl:{foreColor:"Tekstkleur",backColor:"Achtergrondkleur"},pt_br:{foreColor:"Cor de fonte",backColor:"Cor de fundo"},ru:{foreColor:"Цвет текста",backColor:"Цвет выделения текста",foreColorRemove:"Очистить цвет текста",backColorRemove:"Очистить цвет выделения текста"},sl:{foreColor:"Barva teksta",backColor:"Barva ozadja",foreColorRemove:"Ponastavi barvo teksta",backColorRemove:"Ponastavi barvo ozadja"},sk:{foreColor:"Farba textu",backColor:"Farba pozadia"},tr:{foreColor:"Yazı rengi",backColor:"Arka plan rengi",foreColorRemove:"Yazı rengini kaldır",backColorRemove:"Arka plan rengini kaldır"},zh_cn:{foreColor:"文字颜色",backColor:"背景颜色"},zh_tw:{foreColor:"文字顏色",backColor:"背景顏色"}}});var l={colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"],foreColorList:null,backColorList:null,allowCustomForeColor:!0,allowCustomBackColor:!0,displayAsList:!1};function a(r,e){var l=[],a=e.o.plugins.colors,t=a[r+"List"]||a.colorList;o.each(t,(function(o,t){var c=r+t,f={fn:r,forceCss:!0,hasIcon:!1,text:e.lang["#"+t]||"#"+t,param:"#"+t,style:"background-color: #"+t+";"};a.displayAsList&&"foreColor"===r&&(f.style="color: #"+t+" !important;"),e.addBtnDef(c,f),l.push(c)}));var c=r+"Remove",f={fn:"removeFormat",hasIcon:!1,param:r,style:"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);"};if(a.displayAsList&&(f.style=""),e.addBtnDef(c,f),l.push(c),a["allowCustom"+r.charAt(0).toUpperCase()+r.substr(1)]){var n=r+"Free",d={fn:function(){e.openModalInsert(e.lang[r],{color:{label:r,forceCss:!0,type:"color",value:"#FFFFFF"}},(function(o){return e.execCmd(r,o.color),!0}))},hasIcon:!1,text:"#",style:"text-indent: 0; line-height: 20px; padding: 0 5px;"};e.addBtnDef(n,d),l.push(n)}return l}o.extend(!0,o.trumbowyg,{plugins:{color:{init:function(o){o.o.plugins.colors=o.o.plugins.colors||l;var r=o.o.plugins.colors.displayAsList?o.o.prefix+"dropdown--color-list":"",e={dropdown:a("foreColor",o),dropdownClass:r},t={dropdown:a("backColor",o),dropdownClass:r};o.addBtnDef("foreColor",e),o.addBtnDef("backColor",t)},tagHandler:function(o,r){var l,a=[];if(!o.style)return a;if(""!==o.style.backgroundColor){var t=e(o.style.backgroundColor);r.o.plugins.colors.colorList.indexOf(t)>=0?a.push("backColor"+t):a.push("backColorFree")}return""!==o.style.color?l=e(o.style.color):o.hasAttribute("color")&&(l=e(o.getAttribute("color"))),l&&(r.o.plugins.colors.colorList.indexOf(l)>=0?a.push("foreColor"+l):a.push("foreColorFree")),a}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss new file mode 100644 index 000000000..f265eb42f --- /dev/null +++ b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss @@ -0,0 +1,68 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list), +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) { + max-width: 276px; + padding: 7px 5px; + overflow: initial; + + button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; + + &:hover, + &:focus { + &::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + width: 27px; + height: 27px; + background: inherit; + border: 1px solid #fff; + box-shadow: #000 0 0 2px; + z-index: 10; + } + } + } +} + +.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list { + button:not(.trumbowyg-backColorRemove-dropdown-button) { + position: relative; + color: #fff !important; + + &:hover, + &:focus { + &::after { + content: " "; + display: block; + position: absolute; + top: 13px; + left: 0; + width: 0; + height: 0; + border: 5px solid transparent; + border-left-color: #fff; + } + } + } +} diff --git a/dist/plugins/colors/ui/trumbowyg.colors.css b/dist/plugins/colors/ui/trumbowyg.colors.css new file mode 100644 index 000000000..70b023de5 --- /dev/null +++ b/dist/plugins/colors/ui/trumbowyg.colors.css @@ -0,0 +1,61 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list), +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) { + max-width: 276px; + padding: 7px 5px; + overflow: initial; +} +.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button, +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; +} +.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:hover::after, .trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after, +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after, +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:focus::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + width: 27px; + height: 27px; + background: inherit; + border: 1px solid #fff; + -webkit-box-shadow: #000 0 0 2px; + box-shadow: #000 0 0 2px; + z-index: 10; +} + +.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button) { + position: relative; + color: #fff !important; +} +.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after, .trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after { + content: " "; + display: block; + position: absolute; + top: 13px; + left: 0; + width: 0; + height: 0; + border: 5px solid transparent; + border-left-color: #fff; +} \ No newline at end of file diff --git a/dist/plugins/colors/ui/trumbowyg.colors.min.css b/dist/plugins/colors/ui/trumbowyg.colors.min.css new file mode 100644 index 000000000..3169ce912 --- /dev/null +++ b/dist/plugins/colors/ui/trumbowyg.colors.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after,.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff} \ No newline at end of file diff --git a/dist/plugins/emoji/trumbowyg.emoji.js b/dist/plugins/emoji/trumbowyg.emoji.js new file mode 100644 index 000000000..ba927f55d --- /dev/null +++ b/dist/plugins/emoji/trumbowyg.emoji.js @@ -0,0 +1,1488 @@ +/* =========================================================== + * trumbowyg.emoji.js v0.1 + * Emoji picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Nicolas Pion + * Twitter : @nicolas_pion + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + emojiList: [ + '⁉', + '™', + 'ℹ', + '↔', + '↕', + '↖', + '↗', + '↘', + '↙', + '⌨', + '☀', + '☁', + '☂', + '☃', + '☄', + '☑', + '☔', + '☕', + '☘', + '☠', + '☢', + '☣', + '☦', + '☸', + '☹', + '♀', + '♂', + '♈', + '♉', + '♐', + '♑', + '♒', + '♓', + '♠', + '♣', + '♥', + '♦', + '♨', + '⚒', + '⚓', + '⚔', + '⚕', + '⚖', + '⚗', + '⚙', + '✂', + '✅', + '✈', + '✉', + '✒', + '✔', + '✖', + '✡', + '✨', + '✳', + '✴', + '❄', + '❇', + '❓', + '❔', + '❕', + '❗', + '❣', + '❤', + '➕', + '➖', + '➗', + '⤴', + '⤵', + '〰', + '㊗', + '㊙', + '😀', + '😃', + '😄', + '😁', + '😆', + '😅', + '😂', + '🤣', + '☺', + '😊', + '😇', + '🙂', + '🙃', + '😉', + '😌', + '🥲', + '😍', + '🥰', + '😘', + '😗', + '😙', + '😚', + '😋', + '😛', + '😝', + '😜', + '🤪', + '🤨', + '🧐', + '🤓', + '😎', + '🤩', + '🥳', + '😏', + '😒', + '😞', + '😔', + '😟', + '😕', + '🙁', + '😣', + '😖', + '😫', + '😩', + '🥺', + '😢', + '😭', + '😤', + '😮', + '😠', + '😡', + '🤬', + '🤯', + '😳', + '😶', + '🥵', + '🥶', + '😱', + '😨', + '😰', + '😥', + '😓', + '🤗', + '🤔', + '🤭', + '🥱', + '🤫', + '🤥', + '😐', + '😑', + '😬', + '🙄', + '😯', + '😦', + '😧', + '😲', + '😴', + '🤤', + '😪', + '😵', + '🤐', + '🥴', + '🤢', + '🤮', + '🤧', + '😷', + '🤒', + '🤕', + '🤑', + '🤠', + '🥸', + '😈', + '👿', + '👹', + '👺', + '🤡', + '💩', + '👻', + '💀', + '👽', + '👾', + '🤖', + '🎃', + '😺', + '😸', + '😹', + '😻', + '😼', + '😽', + '🙀', + '😿', + '😾', + '🤲', + '👐', + '🙌', + '👏', + '🤝', + '👍', + '👎', + '👊', + '✊', + '🤛', + '🤜', + '🤞', + '✌', + '🤟', + '🤘', + '👌', + '🤏', + '🤌', + '👈', + '👉', + '👆', + '👇', + '☝', + '✋', + '🤚', + '🖐', + '🖖', + '👋', + '🤙', + '💪', + '🦾', + '🖕', + '✍', + '🙏', + '🦶', + '🦵', + '🦿', + '💄', + '💋', + '👄', + '🦷', + '👅', + '👂', + '🦻', + '👃', + '👣', + '👁', + '👀', + '🧠', + '🫀', + '🫁', + '🦴', + '🗣', + '👤', + '👥', + '🫂', + '👶', + '👧', + '🧒', + '👦', + '👩', + '🧑', + '👨', + '👱', + '🧔', + '👵', + '🧓', + '👴', + '👲', + '👳', + '🧕', + '👮', + '👷', + '💂', + '🕵', + '👰', + '🤵', + '👸', + '🤴', + '🦸', + '🦹', + '🥷', + '🤶', + '🎅', + '🧙', + '🧝', + '🧛', + '🧟', + '🧞', + '🧜', + '🧚', + '👼', + '🤰', + '🤱', + '🙇', + '💁', + '🙅', + '🙆', + '🙋', + '🧏', + '🤦', + '🤷', + '🙎', + '🙍', + '💇', + '💆', + '🧖', + '💅', + '🤳', + '💃', + '🕺', + '👯', + '🕴', + '🚶', + '🧎', + '🏃', + '🧍', + '👫', + '👭', + '👬', + '💑', + '💏', + '👪', + '🧶', + '🧵', + '🧥', + '🥼', + '🦺', + '👚', + '👕', + '👖', + '🩲', + '🩳', + '👔', + '👗', + '👙', + '🩱', + '👘', + '🥻', + '🥿', + '👠', + '👡', + '👢', + '👞', + '👟', + '🥾', + '🩴', + '🧦', + '🧤', + '🧣', + '🎩', + '🧢', + '👒', + '🎓', + '⛑', + '🪖', + '👑', + '💍', + '👝', + '👛', + '👜', + '💼', + '🎒', + '🧳', + '👓', + '🕶', + '🥽', + '🌂', + '🦱', + '🦰', + '🦳', + '🦲', + '🐶', + '🐱', + '🐭', + '🐹', + '🐰', + '🦊', + '🐻', + '🐼', + '🐨', + '🐯', + '🦁', + '🐮', + '🐷', + '🐽', + '🐸', + '🐵', + '🙈', + '🙉', + '🙊', + '🐒', + '🐔', + '🐧', + '🐦', + '🐤', + '🐣', + '🐥', + '🦆', + '🦤', + '🦅', + '🦉', + '🦇', + '🐺', + '🐗', + '🐴', + '🦄', + '🐝', + '🐛', + '🦋', + '🐌', + '🪱', + '🐞', + '🐜', + '🪰', + '🦟', + '🪳', + '🪲', + '🦗', + '🕷', + '🕸', + '🦂', + '🐢', + '🐍', + '🦎', + '🦖', + '🦕', + '🐙', + '🦑', + '🦐', + '🦞', + '🦀', + '🐡', + '🐠', + '🐟', + '🦭', + '🐬', + '🐳', + '🐋', + '🦈', + '🐊', + '🐅', + '🐆', + '🦓', + '🦍', + '🦧', + '🐘', + '🦣', + '🦬', + '🦛', + '🦏', + '🐪', + '🐫', + '🦒', + '🦘', + '🐃', + '🐂', + '🐄', + '🐎', + '🐖', + '🐏', + '🐑', + '🦙', + '🐐', + '🦌', + '🐕', + '🐩', + '🦮', + '🐈', + '🐓', + '🦃', + '🦚', + '🦜', + '🦢', + '🦩', + '🕊', + '🐇', + '🦝', + '🦨', + '🦡', + '🦫', + '🦦', + '🦥', + '🐁', + '🐀', + '🐿', + '🦔', + '🐾', + '🐉', + '🐲', + '🌵', + '🎄', + '🌲', + '🌳', + '🌴', + '🌱', + '🌿', + '🍀', + '🎍', + '🎋', + '🍃', + '🍂', + '🍁', + '🪶', + '🍄', + '🐚', + '🪨', + '🪵', + '🌾', + '🪴', + '💐', + '🌷', + '🌹', + '🥀', + '🌺', + '🌸', + '🌼', + '🌻', + '🌞', + '🌝', + '🌛', + '🌜', + '🌚', + '🌕', + '🌖', + '🌗', + '🌘', + '🌑', + '🌒', + '🌓', + '🌔', + '🌙', + '🌎', + '🌍', + '🌏', + '🪐', + '💫', + '⭐', + '🌟', + '⚡', + '💥', + '🔥', + '🌪', + '🌈', + '🌤', + '⛅', + '🌥', + '🌦', + '🌧', + '⛈', + '🌩', + '🌨', + '⛄', + '🌬', + '💨', + '💧', + '💦', + '🌊', + '🌫', + '🍏', + '🍎', + '🍐', + '🍊', + '🍋', + '🍌', + '🍉', + '🍇', + '🫐', + '🍓', + '🍈', + '🍒', + '🍑', + '🥭', + '🍍', + '🥥', + '🥝', + '🍅', + '🍆', + '🥑', + '🫒', + '🥦', + '🥬', + '🫑', + '🥒', + '🌶', + '🌽', + '🥕', + '🧄', + '🧅', + '🥔', + '🍠', + '🥐', + '🥯', + '🍞', + '🥖', + '🫓', + '🥨', + '🧀', + '🥚', + '🍳', + '🧈', + '🥞', + '🧇', + '🥓', + '🥩', + '🍗', + '🍖', + '🌭', + '🍔', + '🍟', + '🍕', + '🥪', + '🥙', + '🧆', + '🌮', + '🌯', + '🫔', + '🥗', + '🥘', + '🫕', + '🥫', + '🍝', + '🍜', + '🍲', + '🍛', + '🍣', + '🍱', + '🥟', + '🦪', + '🍤', + '🍙', + '🍚', + '🍘', + '🍥', + '🥠', + '🥮', + '🍢', + '🍡', + '🍧', + '🍨', + '🍦', + '🥧', + '🧁', + '🍰', + '🎂', + '🍮', + '🍭', + '🍬', + '🍫', + '🍿', + '🍩', + '🍪', + '🌰', + '🥜', + '🍯', + '🥛', + '🍼', + '🍵', + '🫖', + '🧉', + '🧋', + '🧃', + '🥤', + '🍶', + '🍺', + '🍻', + '🥂', + '🍷', + '🥃', + '🍸', + '🍹', + '🍾', + '🧊', + '🥄', + '🍴', + '🍽', + '🥣', + '🥡', + '🥢', + '🧂', + '⚽', + '🏀', + '🏈', + '⚾', + '🥎', + '🎾', + '🏐', + '🏉', + '🥏', + '🪃', + '🎱', + '🪀', + '🏓', + '🏸', + '🏒', + '🏑', + '🥍', + '🏏', + '🥅', + '⛳', + '🪁', + '🏹', + '🎣', + '🤿', + '🥊', + '🥋', + '🎽', + '🛹', + '🛼', + '🛷', + '⛸', + '🥌', + '🎿', + '⛷', + '🏂', + '🪂', + '🏋', + '🤼', + '🤸', + '⛹', + '🤺', + '🤾', + '🏌', + '🏇', + '🧘', + '🏄', + '🏊', + '🤽', + '🚣', + '🧗', + '🚵', + '🚴', + '🏆', + '🥇', + '🥈', + '🥉', + '🏅', + '🎖', + '🏵', + '🎗', + '🎫', + '🎟', + '🎪', + '🤹', + '🎭', + '🩰', + '🎨', + '🎬', + '🎤', + '🎧', + '🎼', + '🎹', + '🥁', + '🪘', + '🎷', + '🎺', + '🎸', + '🪕', + '🎻', + '🪗', + '🎲', + '♟', + '🎯', + '🎳', + '🎮', + '🎰', + '🧩', + '🚗', + '🚕', + '🚙', + '🛻', + '🚌', + '🚎', + '🏎', + '🚓', + '🚑', + '🚒', + '🚐', + '🚚', + '🚛', + '🚜', + '🦯', + '🦽', + '🦼', + '🛴', + '🚲', + '🛵', + '🏍', + '🛺', + '🚨', + '🚔', + '🚍', + '🚘', + '🚖', + '🚡', + '🚠', + '🚟', + '🚃', + '🚋', + '🚞', + '🚝', + '🚄', + '🚅', + '🚈', + '🚂', + '🚆', + '🚇', + '🚊', + '🚉', + '🛫', + '🛬', + '🛩', + '💺', + '🛰', + '🚀', + '🛸', + '🚁', + '🛶', + '⛵', + '🚤', + '🛥', + '🛳', + '⛴', + '🚢', + '⛽', + '🚧', + '🚦', + '🚥', + '🚏', + '🗺', + '🗿', + '🗽', + '🗼', + '🏰', + '🏯', + '🏟', + '🎡', + '🎢', + '🎠', + '⛲', + '⛱', + '🏖', + '🏝', + '🏜', + '🌋', + '⛰', + '🏔', + '🗻', + '🏕', + '⛺', + '🏠', + '🏡', + '🏘', + '🏚', + '🛖', + '🏗', + '🏭', + '🏢', + '🏬', + '🏣', + '🏤', + '🏥', + '🏦', + '🏨', + '🏪', + '🏫', + '🏩', + '💒', + '🏛', + '⛪', + '🕌', + '🕍', + '🛕', + '🕋', + '⛩', + '🛤', + '🛣', + '🗾', + '🎑', + '🏞', + '🌅', + '🌄', + '🌠', + '🎇', + '🎆', + '🌇', + '🌆', + '🏙', + '🌃', + '🌌', + '🌉', + '🌁', + '⌚', + '📱', + '📲', + '💻', + '🖥', + '🖨', + '🖱', + '🖲', + '🕹', + '🗜', + '💽', + '💾', + '💿', + '📀', + '📼', + '📷', + '📸', + '📹', + '🎥', + '📽', + '🎞', + '📞', + '☎', + '📟', + '📠', + '📺', + '📻', + '🎙', + '🎚', + '🎛', + '🧭', + '⏱', + '⏲', + '⏰', + '🕰', + '⌛', + '⏳', + '📡', + '🔋', + '🔌', + '💡', + '🔦', + '🕯', + '🪔', + '🧯', + '🛢', + '💸', + '💵', + '💴', + '💶', + '💷', + '🪙', + '💰', + '💳', + '💎', + '🪜', + '🧰', + '🪛', + '🔧', + '🔨', + '🛠', + '⛏', + '🔩', + '🧱', + '⛓', + '🪝', + '🪢', + '🧲', + '🔫', + '💣', + '🧨', + '🪓', + '🪚', + '🔪', + '🗡', + '🛡', + '🚬', + '⚰', + '🪦', + '⚱', + '🏺', + '🪄', + '🔮', + '📿', + '🧿', + '💈', + '🔭', + '🔬', + '🕳', + '🪟', + '🩹', + '🩺', + '💊', + '💉', + '🩸', + '🧬', + '🦠', + '🧫', + '🧪', + '🌡', + '🪤', + '🧹', + '🧺', + '🪡', + '🧻', + '🚽', + '🪠', + '🪣', + '🚰', + '🚿', + '🛁', + '🛀', + '🪥', + '🧼', + '🪒', + '🧽', + '🧴', + '🛎', + '🔑', + '🗝', + '🚪', + '🪑', + '🪞', + '🛋', + '🛏', + '🛌', + '🧸', + '🖼', + '🛍', + '🛒', + '🎁', + '🎈', + '🎏', + '🎀', + '🎊', + '🎉', + '🪅', + '🪆', + '🎎', + '🏮', + '🎐', + '🧧', + '📩', + '📨', + '📧', + '💌', + '📥', + '📤', + '📦', + '🏷', + '📪', + '📫', + '📬', + '📭', + '📮', + '📯', + '🪧', + '📜', + '📃', + '📄', + '📑', + '🧾', + '📊', + '📈', + '📉', + '🗒', + '🗓', + '📆', + '📅', + '🗑', + '📇', + '🗃', + '🗳', + '🗄', + '📋', + '📁', + '📂', + '🗂', + '🗞', + '📰', + '📓', + '📔', + '📒', + '📕', + '📗', + '📘', + '📙', + '📚', + '📖', + '🔖', + '🧷', + '🔗', + '📎', + '🖇', + '📐', + '📏', + '🧮', + '📌', + '📍', + '🖊', + '🖋', + '🖌', + '🖍', + '📝', + '✏', + '🔍', + '🔎', + '🔏', + '🔐', + '🔒', + '🔓', + '🧡', + '💛', + '💚', + '💙', + '💜', + '🖤', + '🤎', + '🤍', + '💔', + '💕', + '💞', + '💓', + '💗', + '💖', + '💘', + '💝', + '💟', + '☮', + '✝', + '☪', + '🕉', + '🔯', + '🕎', + '☯', + '🛐', + '⛎', + '♊', + '♋', + '♌', + '♍', + '♎', + '♏', + '🆔', + '⚛', + '🉑', + '📴', + '📳', + '🈶', + '🈚', + '🈸', + '🈺', + '🈷', + '🆚', + '💮', + '🉐', + '🈴', + '🈵', + '🈹', + '🈲', + '🅰', + '🅱', + '🆎', + '🆑', + '🅾', + '🆘', + '❌', + '⭕', + '🛑', + '⛔', + '📛', + '🚫', + '💯', + '💢', + '🚷', + '🚯', + '🚳', + '🚱', + '🔞', + '📵', + '🚭', + '‼', + '🔅', + '🔆', + '〽', + '⚠', + '🚸', + '🔱', + '⚜', + '🔰', + '♻', + '🈯', + '💹', + '❎', + '🌐', + '💠', + 'Ⓜ', + '🌀', + '💤', + '🏧', + '🚾', + '♿', + '🅿', + '🈳', + '🈂', + '🛂', + '🛃', + '🛄', + '🛅', + '🛗', + '🚹', + '🚺', + '🚼', + '🚻', + '🚮', + '🎦', + '📶', + '🈁', + '🔣', + '🔤', + '🔡', + '🔠', + '🆖', + '🆗', + '🆙', + '🆒', + '🆕', + '🆓', + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '🔟', + '🔢', + '#', + '*', + '⏏', + '▶', + '⏸', + '⏯', + '⏹', + '⏺', + '⏭', + '⏮', + '⏩', + '⏪', + '⏫', + '⏬', + '◀', + '🔼', + '🔽', + '➡', + '⬅', + '⬆', + '⬇', + '↪', + '↩', + '🔀', + '🔁', + '🔂', + '🔄', + '🔃', + '🎵', + '🎶', + '♾', + '💲', + '💱', + '©', + '®', + '➰', + '➿', + '🔚', + '🔙', + '🔛', + '🔝', + '🔜', + '🔘', + '⚪', + '⚫', + '🔴', + '🔵', + '🟤', + '🟣', + '🟢', + '🟡', + '🟠', + '🔺', + '🔻', + '🔸', + '🔹', + '🔶', + '🔷', + '🔳', + '🔲', + '▪', + '▫', + '◾', + '◽', + '◼', + '◻', + '⬛', + '⬜', + '🟧', + '🟦', + '🟥', + '🟫', + '🟪', + '🟩', + '🟨', + '🔈', + '🔇', + '🔉', + '🔊', + '🔔', + '🔕', + '📣', + '📢', + '🗨', + '💬', + '💭', + '🗯', + '🃏', + '🎴', + '🀄', + '🕐', + '🕑', + '🕒', + '🕓', + '🕔', + '🕕', + '🕖', + '🕗', + '🕘', + '🕙', + '🕚', + '🕛', + '🕜', + '🕝', + '🕞', + '🕟', + '🕠', + '🕡', + '🕢', + '🕣', + '🕤', + '🕥', + '🕦', + '🕧', + '⚧', + '🏳', + '🏴', + '🏁', + '🚩', + '🇦', + '🇩', + '🇧', + '🇮', + '🇻', + '🇰', + '🇨', + '🇹', + '🇭', + '🇪', + '🇸', + '🇬', + '🇫', + '🇵', + '🇯', + '🎌', + '🇽', + '🇱', + '🇲', + '🇾', + '🇳', + '🇴', + '🇶', + '🇷', + '🇼', + '🇿', + '🇺', + '🏻', + '🏼', + '🏽', + '🏾', + '🏿' + ] + }; + + // Add all emoji in a dropdown + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + emoji: 'Add an emoji' + }, + az: { + emoji: 'Emoji yerləşdir' + }, + ca: { + emoji: 'Afegir una emoticona' + }, + da: { + emoji: 'Tilføj et humørikon' + }, + de: { + emoji: 'Emoticon einfügen' + }, + es: { + emoji: 'Añadir un emoticono' + }, + et: { + emoji: 'Lisa emotikon' + }, + fr: { + emoji: 'Ajouter un emoji' + }, + hu: { + emoji: 'Emoji beszúrás' + }, + ja: { + emoji: '絵文字の挿入' + }, + ko: { + emoji: '이모지 넣기' + }, + ru: { + emoji: 'Вставить emoji' + }, + sl: { + emoji: 'Vstavi emotikon' + }, + tr: { + emoji: 'Emoji ekle' + }, + zh_cn: { + emoji: '添加表情' + }, + }, + // jshint camelcase:true + plugins: { + emoji: { + init: function (trumbowyg) { + trumbowyg.o.plugins.emoji = trumbowyg.o.plugins.emoji || defaultOptions; + var emojiBtnDef = { + dropdown: buildDropdown(trumbowyg) + }; + trumbowyg.addBtnDef('emoji', emojiBtnDef); + } + } + } + }); + + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.emoji.emojiList, function (i, emoji) { + if (Array.isArray(emoji)) { // Custom emoji behaviour + var emojiCode = emoji[0], + emojiUrl = emoji[1], + emojiHtml = '' + emojiCode + '', + customEmojiBtnName = 'emoji-' + emojiCode.replace(/:/g, ''), + customEmojiBtnDef = { + hasIcon: false, + text: emojiHtml, + fn: function () { + trumbowyg.execCmd('insertImage', emojiUrl, false, true); + return true; + } + }; + + trumbowyg.addBtnDef(customEmojiBtnName, customEmojiBtnDef); + dropdown.push(customEmojiBtnName); + } else { // Default behaviour + var btn = emoji.replace(/:/g, ''), + defaultEmojiBtnName = 'emoji-' + btn, + defaultEmojiBtnDef = { + text: emoji, + fn: function () { + var encodedEmoji = String.fromCodePoint(emoji.replace('&#', '0')); + trumbowyg.execCmd('insertText', encodedEmoji); + return true; + } + }; + + trumbowyg.addBtnDef(defaultEmojiBtnName, defaultEmojiBtnDef); + dropdown.push(defaultEmojiBtnName); + } + }); + + return dropdown; + } +})(jQuery); diff --git a/dist/plugins/emoji/trumbowyg.emoji.min.js b/dist/plugins/emoji/trumbowyg.emoji.min.js new file mode 100644 index 000000000..834f3dc9a --- /dev/null +++ b/dist/plugins/emoji/trumbowyg.emoji.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * trumbowyg.emoji.js v0.1 + * Emoji picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Nicolas Pion + * Twitter : @nicolas_pion + */ +!function(x){"use strict";var F={emojiList:["⁉","™","ℹ","↔","↕","↖","↗","↘","↙","⌨","☀","☁","☂","☃","☄","☑","☔","☕","☘","☠","☢","☣","☦","☸","☹","♀","♂","♈","♉","♐","♑","♒","♓","♠","♣","♥","♦","♨","⚒","⚓","⚔","⚕","⚖","⚗","⚙","✂","✅","✈","✉","✒","✔","✖","✡","✨","✳","✴","❄","❇","❓","❔","❕","❗","❣","❤","➕","➖","➗","⤴","⤵","〰","㊗","㊙","😀","😃","😄","😁","😆","😅","😂","🤣","☺","😊","😇","🙂","🙃","😉","😌","🥲","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😤","😮","😠","😡","🤬","🤯","😳","😶","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🥱","🤫","🤥","😐","😑","😬","🙄","😯","😦","😧","😲","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","🥸","😈","👿","👹","👺","🤡","💩","👻","💀","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🤲","👐","🙌","👏","🤝","👍","👎","👊","✊","🤛","🤜","🤞","✌","🤟","🤘","👌","🤏","🤌","👈","👉","👆","👇","☝","✋","🤚","🖐","🖖","👋","🤙","💪","🦾","🖕","✍","🙏","🦶","🦵","🦿","💄","💋","👄","🦷","👅","👂","🦻","👃","👣","👁","👀","🧠","🫀","🫁","🦴","🗣","👤","👥","🫂","👶","👧","🧒","👦","👩","🧑","👨","👱","🧔","👵","🧓","👴","👲","👳","🧕","👮","👷","💂","🕵","👰","🤵","👸","🤴","🦸","🦹","🥷","🤶","🎅","🧙","🧝","🧛","🧟","🧞","🧜","🧚","👼","🤰","🤱","🙇","💁","🙅","🙆","🙋","🧏","🤦","🤷","🙎","🙍","💇","💆","🧖","💅","🤳","💃","🕺","👯","🕴","🚶","🧎","🏃","🧍","👫","👭","👬","💑","💏","👪","🧶","🧵","🧥","🥼","🦺","👚","👕","👖","🩲","🩳","👔","👗","👙","🩱","👘","🥻","🥿","👠","👡","👢","👞","👟","🥾","🩴","🧦","🧤","🧣","🎩","🧢","👒","🎓","⛑","🪖","👑","💍","👝","👛","👜","💼","🎒","🧳","👓","🕶","🥽","🌂","🦱","🦰","🦳","🦲","🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐽","🐸","🐵","🙈","🙉","🙊","🐒","🐔","🐧","🐦","🐤","🐣","🐥","🦆","🦤","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🐛","🦋","🐌","🪱","🐞","🐜","🪰","🦟","🪳","🪲","🦗","🕷","🕸","🦂","🐢","🐍","🦎","🦖","🦕","🐙","🦑","🦐","🦞","🦀","🐡","🐠","🐟","🦭","🐬","🐳","🐋","🦈","🐊","🐅","🐆","🦓","🦍","🦧","🐘","🦣","🦬","🦛","🦏","🐪","🐫","🦒","🦘","🐃","🐂","🐄","🐎","🐖","🐏","🐑","🦙","🐐","🦌","🐕","🐩","🦮","🐈","🐓","🦃","🦚","🦜","🦢","🦩","🕊","🐇","🦝","🦨","🦡","🦫","🦦","🦥","🐁","🐀","🐿","🦔","🐾","🐉","🐲","🌵","🎄","🌲","🌳","🌴","🌱","🌿","🍀","🎍","🎋","🍃","🍂","🍁","🪶","🍄","🐚","🪨","🪵","🌾","🪴","💐","🌷","🌹","🥀","🌺","🌸","🌼","🌻","🌞","🌝","🌛","🌜","🌚","🌕","🌖","🌗","🌘","🌑","🌒","🌓","🌔","🌙","🌎","🌍","🌏","🪐","💫","⭐","🌟","⚡","💥","🔥","🌪","🌈","🌤","⛅","🌥","🌦","🌧","⛈","🌩","🌨","⛄","🌬","💨","💧","💦","🌊","🌫","🍏","🍎","🍐","🍊","🍋","🍌","🍉","🍇","🫐","🍓","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫒","🥦","🥬","🫑","🥒","🌶","🌽","🥕","🧄","🧅","🥔","🍠","🥐","🥯","🍞","🥖","🫓","🥨","🧀","🥚","🍳","🧈","🥞","🧇","🥓","🥩","🍗","🍖","🌭","🍔","🍟","🍕","🥪","🥙","🧆","🌮","🌯","🫔","🥗","🥘","🫕","🥫","🍝","🍜","🍲","🍛","🍣","🍱","🥟","🦪","🍤","🍙","🍚","🍘","🍥","🥠","🥮","🍢","🍡","🍧","🍨","🍦","🥧","🧁","🍰","🎂","🍮","🍭","🍬","🍫","🍿","🍩","🍪","🌰","🥜","🍯","🥛","🍼","🍵","🫖","🧉","🧋","🧃","🥤","🍶","🍺","🍻","🥂","🍷","🥃","🍸","🍹","🍾","🧊","🥄","🍴","🍽","🥣","🥡","🥢","🧂","⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🪃","🎱","🪀","🏓","🏸","🏒","🏑","🥍","🏏","🥅","⛳","🪁","🏹","🎣","🤿","🥊","🥋","🎽","🛹","🛼","🛷","⛸","🥌","🎿","⛷","🏂","🪂","🏋","🤼","🤸","⛹","🤺","🤾","🏌","🏇","🧘","🏄","🏊","🤽","🚣","🧗","🚵","🚴","🏆","🥇","🥈","🥉","🏅","🎖","🏵","🎗","🎫","🎟","🎪","🤹","🎭","🩰","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🪘","🎷","🎺","🎸","🪕","🎻","🪗","🎲","♟","🎯","🎳","🎮","🎰","🧩","🚗","🚕","🚙","🛻","🚌","🚎","🏎","🚓","🚑","🚒","🚐","🚚","🚛","🚜","🦯","🦽","🦼","🛴","🚲","🛵","🏍","🛺","🚨","🚔","🚍","🚘","🚖","🚡","🚠","🚟","🚃","🚋","🚞","🚝","🚄","🚅","🚈","🚂","🚆","🚇","🚊","🚉","🛫","🛬","🛩","💺","🛰","🚀","🛸","🚁","🛶","⛵","🚤","🛥","🛳","⛴","🚢","⛽","🚧","🚦","🚥","🚏","🗺","🗿","🗽","🗼","🏰","🏯","🏟","🎡","🎢","🎠","⛲","⛱","🏖","🏝","🏜","🌋","⛰","🏔","🗻","🏕","⛺","🏠","🏡","🏘","🏚","🛖","🏗","🏭","🏢","🏬","🏣","🏤","🏥","🏦","🏨","🏪","🏫","🏩","💒","🏛","⛪","🕌","🕍","🛕","🕋","⛩","🛤","🛣","🗾","🎑","🏞","🌅","🌄","🌠","🎇","🎆","🌇","🌆","🏙","🌃","🌌","🌉","🌁","⌚","📱","📲","💻","🖥","🖨","🖱","🖲","🕹","🗜","💽","💾","💿","📀","📼","📷","📸","📹","🎥","📽","🎞","📞","☎","📟","📠","📺","📻","🎙","🎚","🎛","🧭","⏱","⏲","⏰","🕰","⌛","⏳","📡","🔋","🔌","💡","🔦","🕯","🪔","🧯","🛢","💸","💵","💴","💶","💷","🪙","💰","💳","💎","🪜","🧰","🪛","🔧","🔨","🛠","⛏","🔩","🧱","⛓","🪝","🪢","🧲","🔫","💣","🧨","🪓","🪚","🔪","🗡","🛡","🚬","⚰","🪦","⚱","🏺","🪄","🔮","📿","🧿","💈","🔭","🔬","🕳","🪟","🩹","🩺","💊","💉","🩸","🧬","🦠","🧫","🧪","🌡","🪤","🧹","🧺","🪡","🧻","🚽","🪠","🪣","🚰","🚿","🛁","🛀","🪥","🧼","🪒","🧽","🧴","🛎","🔑","🗝","🚪","🪑","🪞","🛋","🛏","🛌","🧸","🖼","🛍","🛒","🎁","🎈","🎏","🎀","🎊","🎉","🪅","🪆","🎎","🏮","🎐","🧧","📩","📨","📧","💌","📥","📤","📦","🏷","📪","📫","📬","📭","📮","📯","🪧","📜","📃","📄","📑","🧾","📊","📈","📉","🗒","🗓","📆","📅","🗑","📇","🗃","🗳","🗄","📋","📁","📂","🗂","🗞","📰","📓","📔","📒","📕","📗","📘","📙","📚","📖","🔖","🧷","🔗","📎","🖇","📐","📏","🧮","📌","📍","🖊","🖋","🖌","🖍","📝","✏","🔍","🔎","🔏","🔐","🔒","🔓","🧡","💛","💚","💙","💜","🖤","🤎","🤍","💔","💕","💞","💓","💗","💖","💘","💝","💟","☮","✝","☪","🕉","🔯","🕎","☯","🛐","⛎","♊","♋","♌","♍","♎","♏","🆔","⚛","🉑","📴","📳","🈶","🈚","🈸","🈺","🈷","🆚","💮","🉐","🈴","🈵","🈹","🈲","🅰","🅱","🆎","🆑","🅾","🆘","❌","⭕","🛑","⛔","📛","🚫","💯","💢","🚷","🚯","🚳","🚱","🔞","📵","🚭","‼","🔅","🔆","〽","⚠","🚸","🔱","⚜","🔰","♻","🈯","💹","❎","🌐","💠","Ⓜ","🌀","💤","🏧","🚾","♿","🅿","🈳","🈂","🛂","🛃","🛄","🛅","🛗","🚹","🚺","🚼","🚻","🚮","🎦","📶","🈁","🔣","🔤","🔡","🔠","🆖","🆗","🆙","🆒","🆕","🆓","0","1","2","3","4","5","6","7","8","9","🔟","🔢","#","*","⏏","▶","⏸","⏯","⏹","⏺","⏭","⏮","⏩","⏪","⏫","⏬","◀","🔼","🔽","➡","⬅","⬆","⬇","↪","↩","🔀","🔁","🔂","🔄","🔃","🎵","🎶","♾","💲","💱","©","®","➰","➿","🔚","🔙","🔛","🔝","🔜","🔘","⚪","⚫","🔴","🔵","🟤","🟣","🟢","🟡","🟠","🔺","🔻","🔸","🔹","🔶","🔷","🔳","🔲","▪","▫","◾","◽","◼","◻","⬛","⬜","🟧","🟦","🟥","🟫","🟪","🟩","🟨","🔈","🔇","🔉","🔊","🔔","🔕","📣","📢","🗨","💬","💭","🗯","🃏","🎴","🀄","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧","⚧","🏳","🏴","🏁","🚩","🇦","🇩","🇧","🇮","🇻","🇰","🇨","🇹","🇭","🇪","🇸","🇬","🇫","🇵","🇯","🎌","🇽","🇱","🇲","🇾","🇳","🇴","🇶","🇷","🇼","🇿","🇺","🏻","🏼","🏽","🏾","🏿"]};function A(F){var A=[];return x.each(F.o.plugins.emoji.emojiList,(function(x,E){if(Array.isArray(E)){var B=E[0],C=E[1],D=''+B+'',e="emoji-"+B.replace(/:/g,""),i={hasIcon:!1,text:D,fn:function(){return F.execCmd("insertImage",C,!1,!0),!0}};F.addBtnDef(e,i),A.push(e)}else{var o="emoji-"+E.replace(/:/g,""),n={text:E,fn:function(){var x=String.fromCodePoint(E.replace("&#","0"));return F.execCmd("insertText",x),!0}};F.addBtnDef(o,n),A.push(o)}})),A}x.extend(!0,x.trumbowyg,{langs:{en:{emoji:"Add an emoji"},az:{emoji:"Emoji yerləşdir"},ca:{emoji:"Afegir una emoticona"},da:{emoji:"Tilføj et humørikon"},de:{emoji:"Emoticon einfügen"},es:{emoji:"Añadir un emoticono"},et:{emoji:"Lisa emotikon"},fr:{emoji:"Ajouter un emoji"},hu:{emoji:"Emoji beszúrás"},ja:{emoji:"絵文字の挿入"},ko:{emoji:"이모지 넣기"},ru:{emoji:"Вставить emoji"},sl:{emoji:"Vstavi emotikon"},tr:{emoji:"Emoji ekle"},zh_cn:{emoji:"添加表情"}},plugins:{emoji:{init:function(x){x.o.plugins.emoji=x.o.plugins.emoji||F;var E={dropdown:A(x)};x.addBtnDef("emoji",E)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss new file mode 100644 index 000000000..1f06a163a --- /dev/null +++ b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss @@ -0,0 +1,53 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-emoji { + width: 265px; + padding: 7px 0 7px 5px; +} + +.trumbowyg-dropdown-emoji svg { + display: none !important; +} + +.trumbowyg-dropdown-emoji button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; + + &:hover, + &:focus { + &::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; + } + } +} + +.trumbowyg .emoji { + width: 22px; + height: 22px; + display: inline-block; +} diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.css b/dist/plugins/emoji/ui/trumbowyg.emoji.css new file mode 100644 index 000000000..debf20cdb --- /dev/null +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.css @@ -0,0 +1,50 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-emoji { + width: 265px; + padding: 7px 0 7px 5px; +} + +.trumbowyg-dropdown-emoji svg { + display: none !important; +} + +.trumbowyg-dropdown-emoji button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; +} +.trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + -webkit-box-shadow: #000 0 0 2px; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; +} + +.trumbowyg .emoji { + width: 22px; + height: 22px; + display: inline-block; +} \ No newline at end of file diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.min.css b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css new file mode 100644 index 000000000..dbe89d702 --- /dev/null +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-emoji{width:265px;padding:7px 0 7px 5px}.trumbowyg-dropdown-emoji svg{display:none!important}.trumbowyg-dropdown-emoji button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-emoji button:focus::after,.trumbowyg-dropdown-emoji button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .emoji{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/fontfamily/trumbowyg.fontfamily.js b/dist/plugins/fontfamily/trumbowyg.fontfamily.js new file mode 100644 index 000000000..2201b08f3 --- /dev/null +++ b/dist/plugins/fontfamily/trumbowyg.fontfamily.js @@ -0,0 +1,116 @@ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + fontFamily: 'Font' + }, + az: { + fontFamily: 'Şrift' + }, + by: { + fontFamily: 'Шрыфт' + }, + ca: { + fontFamily: 'Font' + }, + da: { + fontFamily: 'Skrifttype' + }, + de: { + fontFamily: 'Schriftart' + }, + es: { + fontFamily: 'Fuente' + }, + et: { + fontFamily: 'Font' + }, + fr: { + fontFamily: 'Police' + }, + hu: { + fontFamily: 'Betűtípus' + }, + ko: { + fontFamily: '글꼴' + }, + nl: { + fontFamily: 'Lettertype' + }, + pt_br: { + fontFamily: 'Fonte' + }, + ru: { + fontFamily: 'Шрифт' + }, + sl: { + fontFamily: 'Pisava' + }, + tr: { + fontFamily: 'Yazı tipi' + }, + zh_tw: { + fontFamily: '字體' + } + } + }); + // jshint camelcase:true + + var defaultOptions = { + fontList: [ + {name: 'Arial', family: 'Arial, Helvetica, sans-serif'}, + {name: 'Arial Black', family: 'Arial Black, Gadget, sans-serif'}, + {name: 'Comic Sans', family: 'Comic Sans MS, Textile, cursive, sans-serif'}, + {name: 'Courier New', family: 'Courier New, Courier, monospace'}, + {name: 'Georgia', family: 'Georgia, serif'}, + {name: 'Impact', family: 'Impact, Charcoal, sans-serif'}, + {name: 'Lucida Console', family: 'Lucida Console, Monaco, monospace'}, + {name: 'Lucida Sans', family: 'Lucida Sans Uncide, Lucida Grande, sans-serif'}, + {name: 'Palatino', family: 'Palatino Linotype, Book Antiqua, Palatino, serif'}, + {name: 'Tahoma', family: 'Tahoma, Geneva, sans-serif'}, + {name: 'Times New Roman', family: 'Times New Roman, Times, serif'}, + {name: 'Trebuchet', family: 'Trebuchet MS, Helvetica, sans-serif'}, + {name: 'Verdana', family: 'Verdana, Geneva, sans-serif'} + ] + }; + + // Add dropdown with web safe fonts + $.extend(true, $.trumbowyg, { + plugins: { + fontfamily: { + init: function (trumbowyg) { + trumbowyg.o.plugins.fontfamily = $.extend({}, + defaultOptions, + trumbowyg.o.plugins.fontfamily || {} + ); + + trumbowyg.addBtnDef('fontfamily', { + dropdown: buildDropdown(trumbowyg), + hasIcon: false, + text: trumbowyg.lang.fontFamily + }); + } + } + } + }); + + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.fontfamily.fontList, function (index, font) { + trumbowyg.addBtnDef('fontfamily_' + index, { + title: '' + font.name + '', + hasIcon: false, + fn: function () { + trumbowyg.execCmd('fontName', font.family, true); + } + }); + dropdown.push('fontfamily_' + index); + }); + + return dropdown; + } +})(jQuery); diff --git a/dist/plugins/fontfamily/trumbowyg.fontfamily.min.js b/dist/plugins/fontfamily/trumbowyg.fontfamily.min.js new file mode 100644 index 000000000..216c67687 --- /dev/null +++ b/dist/plugins/fontfamily/trumbowyg.fontfamily.min.js @@ -0,0 +1 @@ +!function(a){"use strict";a.extend(!0,a.trumbowyg,{langs:{en:{fontFamily:"Font"},az:{fontFamily:"Şrift"},by:{fontFamily:"Шрыфт"},ca:{fontFamily:"Font"},da:{fontFamily:"Skrifttype"},de:{fontFamily:"Schriftart"},es:{fontFamily:"Fuente"},et:{fontFamily:"Font"},fr:{fontFamily:"Police"},hu:{fontFamily:"Betűtípus"},ko:{fontFamily:"글꼴"},nl:{fontFamily:"Lettertype"},pt_br:{fontFamily:"Fonte"},ru:{fontFamily:"Шрифт"},sl:{fontFamily:"Pisava"},tr:{fontFamily:"Yazı tipi"},zh_tw:{fontFamily:"字體"}}});var n={fontList:[{name:"Arial",family:"Arial, Helvetica, sans-serif"},{name:"Arial Black",family:"Arial Black, Gadget, sans-serif"},{name:"Comic Sans",family:"Comic Sans MS, Textile, cursive, sans-serif"},{name:"Courier New",family:"Courier New, Courier, monospace"},{name:"Georgia",family:"Georgia, serif"},{name:"Impact",family:"Impact, Charcoal, sans-serif"},{name:"Lucida Console",family:"Lucida Console, Monaco, monospace"},{name:"Lucida Sans",family:"Lucida Sans Uncide, Lucida Grande, sans-serif"},{name:"Palatino",family:"Palatino Linotype, Book Antiqua, Palatino, serif"},{name:"Tahoma",family:"Tahoma, Geneva, sans-serif"},{name:"Times New Roman",family:"Times New Roman, Times, serif"},{name:"Trebuchet",family:"Trebuchet MS, Helvetica, sans-serif"},{name:"Verdana",family:"Verdana, Geneva, sans-serif"}]};function i(n){var i=[];return a.each(n.o.plugins.fontfamily.fontList,(function(a,e){n.addBtnDef("fontfamily_"+a,{title:''+e.name+"",hasIcon:!1,fn:function(){n.execCmd("fontName",e.family,!0)}}),i.push("fontfamily_"+a)})),i}a.extend(!0,a.trumbowyg,{plugins:{fontfamily:{init:function(e){e.o.plugins.fontfamily=a.extend({},n,e.o.plugins.fontfamily||{}),e.addBtnDef("fontfamily",{dropdown:i(e),hasIcon:!1,text:e.lang.fontFamily})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/fontsize/trumbowyg.fontsize.js b/dist/plugins/fontsize/trumbowyg.fontsize.js new file mode 100644 index 000000000..a2cabf913 --- /dev/null +++ b/dist/plugins/fontsize/trumbowyg.fontsize.js @@ -0,0 +1,393 @@ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + fontsize: 'Font size', + fontsizes: { + 'x-small': 'Extra small', + 'small': 'Small', + 'medium': 'Regular', + 'large': 'Large', + 'x-large': 'Extra large', + 'custom': 'Custom' + }, + fontCustomSize: { + title: 'Custom Font Size', + label: 'Font Size', + value: '48px' + } + }, + az: { + fontsize: 'Şrift həcmi', + fontsizes: { + 'x-small': 'Daha kiçik', + 'small': 'Kiçik', + 'medium': 'Normal', + 'large': 'Böyük', + 'x-large': 'Daha böyük', + 'custom': 'Fərdi həcm' + }, + fontCustomSize: { + title: 'Fərdi şrift həcmi', + label: 'Şrift həcmi', + value: '48px' + } + }, + by: { + fontsize: 'Памер шрыфта', + fontsizes: { + 'x-small': 'Вельмі маленькі', + 'small': 'Маленькі', + 'medium': 'Звычайны', + 'large': 'Вялікі', + 'x-large': 'Вельмі вялікі', + 'custom': 'Карыстальніцкі' + }, + fontCustomSize: { + title: 'Карыстальніцкі Памер Шрыфта', + label: 'Памер Шрыфта', + value: '48px' + } + }, + ca: { + fontsize: 'Mida de la lletra', + fontsizes: { + 'x-small': 'Molt petita', + 'small': 'Petita', + 'medium': 'Normal', + 'large': 'Gran', + 'x-large': 'Molt Gran', + 'custom': 'Personalitzada' + }, + fontCustomSize: { + title: 'Mida de lletra personalitzada', + label: 'Mida de lletra', + value: '48px' + } + }, + da: { + fontsize: 'Skriftstørrelse', + fontsizes: { + 'x-small': 'Ekstra lille', + 'small': 'Lille', + 'medium': 'Normal', + 'large': 'Stor', + 'x-large': 'Ekstra stor', + 'custom': 'Brugerdefineret' + } + }, + de: { + fontsize: 'Schriftgröße', + fontsizes: { + 'x-small': 'Sehr klein', + 'small': 'Klein', + 'medium': 'Normal', + 'large': 'Groß', + 'x-large': 'Sehr groß', + 'custom': 'Benutzerdefiniert' + }, + fontCustomSize: { + title: 'Benutzerdefinierte Schriftgröße', + label: 'Schriftgröße', + value: '48px' + } + }, + es: { + fontsize: 'Tamaño de Fuente', + fontsizes: { + 'x-small': 'Extra pequeña', + 'small': 'Pegueña', + 'medium': 'Regular', + 'large': 'Grande', + 'x-large': 'Extra Grande', + 'custom': 'Customizada' + }, + fontCustomSize: { + title: 'Tamaño de Fuente Customizada', + label: 'Tamaño de Fuente', + value: '48px' + } + }, + et: { + fontsize: 'Teksti suurus', + fontsizes: { + 'x-small': 'Väga väike', + 'small': 'Väike', + 'medium': 'Tavaline', + 'large': 'Suur', + 'x-large': 'Väga suur', + 'custom': 'Määra ise' + }, + fontCustomSize: { + title: 'Kohandatud teksti suurus', + label: 'Teksti suurus', + value: '48px' + } + }, + fr: { + fontsize: 'Taille de la police', + fontsizes: { + 'x-small': 'Très petit', + 'small': 'Petit', + 'medium': 'Normal', + 'large': 'Grand', + 'x-large': 'Très grand', + 'custom': 'Taille personnalisée' + }, + fontCustomSize: { + title: 'Taille de police personnalisée', + label: 'Taille de la police', + value: '48px' + } + }, + hu: { + fontsize: 'Betű méret', + fontsizes: { + 'x-small': 'Extra kicsi', + 'small': 'Kicsi', + 'medium': 'Normális', + 'large': 'Nagy', + 'x-large': 'Extra nagy', + 'custom': 'Egyedi' + }, + fontCustomSize: { + title: 'Egyedi betű méret', + label: 'Betű méret', + value: '48px' + } + }, + it: { + fontsize: 'Dimensioni del testo', + fontsizes: { + 'x-small': 'Molto piccolo', + 'small': 'piccolo', + 'regular': 'normale', + 'large': 'grande', + 'x-large': 'Molto grande', + 'custom': 'Personalizzato' + }, + fontCustomSize: { + title: 'Dimensioni del testo personalizzato', + label: 'Dimensioni del testo', + value: '48px' + } + }, + ko: { + fontsize: '글꼴 크기', + fontsizes: { + 'x-small': '아주 작게', + 'small': '작게', + 'medium': '보통', + 'large': '크게', + 'x-large': '아주 크게', + 'custom': '사용자 지정' + }, + fontCustomSize: { + title: '사용자 지정 글꼴 크기', + label: '글꼴 크기', + value: '48px' + } + }, + nl: { + fontsize: 'Lettergrootte', + fontsizes: { + 'x-small': 'Extra klein', + 'small': 'Klein', + 'medium': 'Normaal', + 'large': 'Groot', + 'x-large': 'Extra groot', + 'custom': 'Handmatig' + }, + fontCustomSize: { + title: 'Handmatige lettergrootte', + label: 'Lettergrootte', + value: '48px' + } + }, + pt_br: { + fontsize: 'Tamanho da fonte', + fontsizes: { + 'x-small': 'Extra pequeno', + 'small': 'Pequeno', + 'regular': 'Médio', + 'large': 'Grande', + 'x-large': 'Extra grande', + 'custom': 'Personalizado' + }, + fontCustomSize: { + title: 'Tamanho de Fonte Personalizado', + label: 'Tamanho de Fonte', + value: '48px' + } + }, + ru: { + fontsize: 'Размер шрифта', + fontsizes: { + 'x-small': 'Очень маленький', + 'small': 'Маленький', + 'medium': 'Обычный', + 'large': 'Большой', + 'x-large': 'Очень большой', + 'custom': 'Пользовательский' + }, + fontCustomSize: { + title: 'Пользовательский Размер Шрифта', + label: 'Размер Шрифта', + value: '48px' + } + }, + sl: { + fontsize: 'Velikost pisave', + fontsizes: { + 'x-small': 'Ekstra majhna', + 'small': 'Majhna', + 'medium': 'Navadno', + 'large': 'Velika', + 'x-large': 'Ekstra velika', + 'custom': 'Poljubna' + }, + fontCustomSize: { + title: 'Poljubna velikost pisave', + label: 'Velikost pisave', + value: '48px' + } + }, + tr: { + fontsize: 'Yazı boyutu', + fontsizes: { + 'x-small': 'Çok küçük', + 'small': 'Küçük', + 'medium': 'Normal', + 'large': 'Büyük', + 'x-large': 'Çok büyük', + 'custom': 'Özel' + }, + fontCustomSize: { + title: 'Özel Yazı Boyutu', + label: 'Yazı Boyutu', + value: '48px' + } + }, + zh_tw: { + fontsize: '字體大小', + fontsizes: { + 'x-small': '最小', + 'small': '小', + 'medium': '中', + 'large': '大', + 'x-large': '最大', + 'custom': '自訂大小' + }, + fontCustomSize: { + title: '自訂義字體大小', + label: '字體大小', + value: '48px' + } + } + } + }); + // jshint camelcase:true + + var defaultOptions = { + sizeList: [ + 'x-small', + 'small', + 'medium', + 'large', + 'x-large' + ], + allowCustomSize: true + }; + + // Add dropdown with font sizes + $.extend(true, $.trumbowyg, { + plugins: { + fontsize: { + init: function (trumbowyg) { + trumbowyg.o.plugins.fontsize = $.extend({}, + defaultOptions, + trumbowyg.o.plugins.fontsize || {} + ); + + trumbowyg.addBtnDef('fontsize', { + dropdown: buildDropdown(trumbowyg) + }); + } + } + } + }); + + function setFontSize(trumbowyg, size) { + trumbowyg.$ed.focus(); + trumbowyg.saveRange(); + + // Temporary size + trumbowyg.execCmd('fontSize', '1'); + + var fontElements = trumbowyg.$ed.find('font[size="1"]'); + + // Remove previous font-size span tags. Needed to prevent Firefox from + // nesting multiple spans on font-size changes. + // (see https://github.com/Alex-D/Trumbowyg/issues/1252) + fontElements.find('span[style*="font-size"]').contents().unwrap(); + + // Find elements that were added and change to with chosen size + fontElements.replaceWith(function () { + return $('', { + css: {'font-size': size}, + html: this.innerHTML + }); + }); + + // Remove and leftover elements + $(trumbowyg.range.startContainer.parentElement).find('span[style=""]').contents().unwrap(); + + trumbowyg.restoreRange(); + trumbowyg.syncCode(); + trumbowyg.$c.trigger('tbwchange'); + } + + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.fontsize.sizeList, function (index, size) { + trumbowyg.addBtnDef('fontsize_' + size, { + text: '' + (trumbowyg.lang.fontsizes[size] || size) + '', + hasIcon: false, + fn: function () { + setFontSize(trumbowyg, size); + } + }); + dropdown.push('fontsize_' + size); + }); + + if (trumbowyg.o.plugins.fontsize.allowCustomSize) { + var customSizeButtonName = 'fontsize_custom'; + var customSizeBtnDef = { + fn: function () { + trumbowyg.openModalInsert(trumbowyg.lang.fontCustomSize.title, + { + size: { + label: trumbowyg.lang.fontCustomSize.label, + value: trumbowyg.lang.fontCustomSize.value + } + }, + function (form) { + setFontSize(trumbowyg, form.size); + return true; + } + ); + }, + text: '' + trumbowyg.lang.fontsizes.custom + '', + hasIcon: false + }; + trumbowyg.addBtnDef(customSizeButtonName, customSizeBtnDef); + dropdown.push(customSizeButtonName); + } + + return dropdown; + } +})(jQuery); diff --git a/dist/plugins/fontsize/trumbowyg.fontsize.min.js b/dist/plugins/fontsize/trumbowyg.fontsize.min.js new file mode 100644 index 000000000..abbb2668e --- /dev/null +++ b/dist/plugins/fontsize/trumbowyg.fontsize.min.js @@ -0,0 +1 @@ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{fontsize:"Font size",fontsizes:{"x-small":"Extra small",small:"Small",medium:"Regular",large:"Large","x-large":"Extra large",custom:"Custom"},fontCustomSize:{title:"Custom Font Size",label:"Font Size",value:"48px"}},az:{fontsize:"Şrift həcmi",fontsizes:{"x-small":"Daha kiçik",small:"Kiçik",medium:"Normal",large:"Böyük","x-large":"Daha böyük",custom:"Fərdi həcm"},fontCustomSize:{title:"Fərdi şrift həcmi",label:"Şrift həcmi",value:"48px"}},by:{fontsize:"Памер шрыфта",fontsizes:{"x-small":"Вельмі маленькі",small:"Маленькі",medium:"Звычайны",large:"Вялікі","x-large":"Вельмі вялікі",custom:"Карыстальніцкі"},fontCustomSize:{title:"Карыстальніцкі Памер Шрыфта",label:"Памер Шрыфта",value:"48px"}},ca:{fontsize:"Mida de la lletra",fontsizes:{"x-small":"Molt petita",small:"Petita",medium:"Normal",large:"Gran","x-large":"Molt Gran",custom:"Personalitzada"},fontCustomSize:{title:"Mida de lletra personalitzada",label:"Mida de lletra",value:"48px"}},da:{fontsize:"Skriftstørrelse",fontsizes:{"x-small":"Ekstra lille",small:"Lille",medium:"Normal",large:"Stor","x-large":"Ekstra stor",custom:"Brugerdefineret"}},de:{fontsize:"Schriftgröße",fontsizes:{"x-small":"Sehr klein",small:"Klein",medium:"Normal",large:"Groß","x-large":"Sehr groß",custom:"Benutzerdefiniert"},fontCustomSize:{title:"Benutzerdefinierte Schriftgröße",label:"Schriftgröße",value:"48px"}},es:{fontsize:"Tamaño de Fuente",fontsizes:{"x-small":"Extra pequeña",small:"Pegueña",medium:"Regular",large:"Grande","x-large":"Extra Grande",custom:"Customizada"},fontCustomSize:{title:"Tamaño de Fuente Customizada",label:"Tamaño de Fuente",value:"48px"}},et:{fontsize:"Teksti suurus",fontsizes:{"x-small":"Väga väike",small:"Väike",medium:"Tavaline",large:"Suur","x-large":"Väga suur",custom:"Määra ise"},fontCustomSize:{title:"Kohandatud teksti suurus",label:"Teksti suurus",value:"48px"}},fr:{fontsize:"Taille de la police",fontsizes:{"x-small":"Très petit",small:"Petit",medium:"Normal",large:"Grand","x-large":"Très grand",custom:"Taille personnalisée"},fontCustomSize:{title:"Taille de police personnalisée",label:"Taille de la police",value:"48px"}},hu:{fontsize:"Betű méret",fontsizes:{"x-small":"Extra kicsi",small:"Kicsi",medium:"Normális",large:"Nagy","x-large":"Extra nagy",custom:"Egyedi"},fontCustomSize:{title:"Egyedi betű méret",label:"Betű méret",value:"48px"}},it:{fontsize:"Dimensioni del testo",fontsizes:{"x-small":"Molto piccolo",small:"piccolo",regular:"normale",large:"grande","x-large":"Molto grande",custom:"Personalizzato"},fontCustomSize:{title:"Dimensioni del testo personalizzato",label:"Dimensioni del testo",value:"48px"}},ko:{fontsize:"글꼴 크기",fontsizes:{"x-small":"아주 작게",small:"작게",medium:"보통",large:"크게","x-large":"아주 크게",custom:"사용자 지정"},fontCustomSize:{title:"사용자 지정 글꼴 크기",label:"글꼴 크기",value:"48px"}},nl:{fontsize:"Lettergrootte",fontsizes:{"x-small":"Extra klein",small:"Klein",medium:"Normaal",large:"Groot","x-large":"Extra groot",custom:"Handmatig"},fontCustomSize:{title:"Handmatige lettergrootte",label:"Lettergrootte",value:"48px"}},pt_br:{fontsize:"Tamanho da fonte",fontsizes:{"x-small":"Extra pequeno",small:"Pequeno",regular:"Médio",large:"Grande","x-large":"Extra grande",custom:"Personalizado"},fontCustomSize:{title:"Tamanho de Fonte Personalizado",label:"Tamanho de Fonte",value:"48px"}},ru:{fontsize:"Размер шрифта",fontsizes:{"x-small":"Очень маленький",small:"Маленький",medium:"Обычный",large:"Большой","x-large":"Очень большой",custom:"Пользовательский"},fontCustomSize:{title:"Пользовательский Размер Шрифта",label:"Размер Шрифта",value:"48px"}},sl:{fontsize:"Velikost pisave",fontsizes:{"x-small":"Ekstra majhna",small:"Majhna",medium:"Navadno",large:"Velika","x-large":"Ekstra velika",custom:"Poljubna"},fontCustomSize:{title:"Poljubna velikost pisave",label:"Velikost pisave",value:"48px"}},tr:{fontsize:"Yazı boyutu",fontsizes:{"x-small":"Çok küçük",small:"Küçük",medium:"Normal",large:"Büyük","x-large":"Çok büyük",custom:"Özel"},fontCustomSize:{title:"Özel Yazı Boyutu",label:"Yazı Boyutu",value:"48px"}},zh_tw:{fontsize:"字體大小",fontsizes:{"x-small":"最小",small:"小",medium:"中",large:"大","x-large":"最大",custom:"自訂大小"},fontCustomSize:{title:"自訂義字體大小",label:"字體大小",value:"48px"}}}});var t={sizeList:["x-small","small","medium","large","x-large"],allowCustomSize:!0};function l(t,l){t.$ed.focus(),t.saveRange(),t.execCmd("fontSize","1");var a=t.$ed.find('font[size="1"]');a.find('span[style*="font-size"]').contents().unwrap(),a.replaceWith((function(){return e("",{css:{"font-size":l},html:this.innerHTML})})),e(t.range.startContainer.parentElement).find('span[style=""]').contents().unwrap(),t.restoreRange(),t.syncCode(),t.$c.trigger("tbwchange")}function a(t){var a=[];if(e.each(t.o.plugins.fontsize.sizeList,(function(e,s){t.addBtnDef("fontsize_"+s,{text:''+(t.lang.fontsizes[s]||s)+"",hasIcon:!1,fn:function(){l(t,s)}}),a.push("fontsize_"+s)})),t.o.plugins.fontsize.allowCustomSize){var s="fontsize_custom",i={fn:function(){t.openModalInsert(t.lang.fontCustomSize.title,{size:{label:t.lang.fontCustomSize.label,value:t.lang.fontCustomSize.value}},(function(e){return l(t,e.size),!0}))},text:''+t.lang.fontsizes.custom+"",hasIcon:!1};t.addBtnDef(s,i),a.push(s)}return a}e.extend(!0,e.trumbowyg,{plugins:{fontsize:{init:function(l){l.o.plugins.fontsize=e.extend({},t,l.o.plugins.fontsize||{}),l.addBtnDef("fontsize",{dropdown:a(l)})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/giphy/trumbowyg.giphy.js b/dist/plugins/giphy/trumbowyg.giphy.js new file mode 100644 index 000000000..3071d90b4 --- /dev/null +++ b/dist/plugins/giphy/trumbowyg.giphy.js @@ -0,0 +1,270 @@ +/* global AbortController: true */ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + giphy: 'Insert GIF' + }, + az: { + giphy: 'GIF yerləşdir' + }, + by: { + giphy: 'Уставіць GIF' + }, + de: { + giphy: 'GIF einfügen' + }, + et: { + giphy: 'Sisesta GIF' + }, + fr: { + giphy: 'Insérer un GIF' + }, + hu: { + giphy: 'GIF beszúrás' + }, + ru: { + giphy: 'Вставить GIF' + }, + sl: { + giphy: 'Vstavi GIF' + }, + tr: { + giphy: 'GIF ekle' + } + // jshint camelcase:true + } + }); + + var giphyLogo = ''; // jshint ignore:line + + var CANCEL_EVENT = 'tbwcancel'; + + // Throttle helper + function trumbowygThrottle(callback, delay) { + var last; + var timer; + + return function () { + var context = this; + var now = new Date().getTime(); + var args = arguments; + + if (last && now < last + delay) { + clearTimeout(timer); + timer = setTimeout(function () { + last = now; + callback.apply(context, args); + }, delay); + } else { + last = now; + callback.apply(context, args); + } + }; + } + + // Fills modal with response gifs + function renderGifs(response, $giphyModal, trumbowyg, mustEmpty) { + var width = ($giphyModal.width() - 20) / 3; + + var html = response.data + .filter(function (gifData) { + var image = gifData.images[GIPHY_OPTIONS.pickerRendition]; + return !!image[GIPHY_OPTIONS.pickerRenditionUrlAttribute]; + }) + .map(function (gifData) { + var image = gifData.images[GIPHY_OPTIONS.pickerRendition]; + var selectionImage = gifData.images[GIPHY_OPTIONS.selectionRendition]; + var imageRatio = image.height / image.width, + altText = gifData.title; + + var url = image[GIPHY_OPTIONS.pickerRenditionUrlAttribute]; + var selectionUrl = selectionImage[GIPHY_OPTIONS.selectionRenditionUrlAttribute]; + var imgHtml = '' + altText + ''; + return '
' + imgHtml + '
'; + }) + .join('') + ; + + if (mustEmpty === true) { + if (html.length === 0) { + if ($('.' + trumbowyg.o.prefix + 'giphy-no-result', $giphyModal).length > 0) { + return; + } + + html = ''; + } + + $giphyModal.empty(); + } + $giphyModal.append(html); + + // Remove gray overlay on image load + // moved here from inline callback definition due to CSP issue + // Note: this is being done post-factum because load event doesn't bubble up and so can't be delegated + var addLoadedClass = function (img) { + img.classList.add('tbw-loaded'); + }; + $('img', $giphyModal).each(function () { + var img = this; + if (img.complete) { // images load instantly when cached and esp. when loaded in previous modal open + addLoadedClass(img); + } else { + img.addEventListener('load', function () { + addLoadedClass(this); + }); + } + }); + + $('img', $giphyModal).on('click', function () { + var src = $(this).data('selection-url'), + alt = $(this).attr('alt'); + trumbowyg.restoreRange(); + trumbowyg.execCmd('insertImage', src, false, true); + + // relay alt tag into inserted image + if (alt) { + var $img = $('img[src="' + src + '"]:not([alt])', trumbowyg.$box); + $img.attr('alt', alt); + // Note: This seems to fire relatively early and could be wrapped in a setTimeout if needed + trumbowyg.syncCode(); + } + $('img', $giphyModal).off(); + trumbowyg.closeModal(); + }); + } + + // see: https://developers.giphy.com/explorer/ + var defaultOptions = { + rating: 'g', + apiKey: null, + throttleDelay: 300, + limit: 50, + noResultGifUrl: 'https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif' + }; + + const GIPHY_OPTIONS = { + bundle: 'low_bandwidth', + pickerRendition: 'fixed_width_small', // see: https://developers.giphy.com/docs/optional-settings/#renditions-on-demand + pickerRenditionUrlAttribute: 'webp', // can be 'url' or 'mp4' or 'webp' + selectionRendition: 'original', + selectionRenditionUrlAttribute: 'url' + }; + + // Add dropdown with font sizes + $.extend(true, $.trumbowyg, { + plugins: { + giphy: { + init: function (trumbowyg) { + trumbowyg.o.plugins.giphy = $.extend({}, + defaultOptions, + trumbowyg.o.plugins.giphy || {} + ); + + trumbowyg.addBtnDef('giphy', { + fn: function () { + if (trumbowyg.o.plugins.giphy.apiKey === null) { + throw new Error('You must set a Giphy API Key'); + } + + var BASE_URL = [ + 'https://api.giphy.com/v1/gifs/search?api_key=', + trumbowyg.o.plugins.giphy.apiKey, + '&rating=', + trumbowyg.o.plugins.giphy.rating, + '&limit=', + trumbowyg.o.plugins.giphy.limit, + '&bundle=', + GIPHY_OPTIONS.bundle, + ].join(''); + const DEFAULT_URL = BASE_URL.replace('/search', '/trending'); + var prefix = trumbowyg.o.prefix; + var abortController = new AbortController(); + + // Create and open the modal + var searchInput = '', + closeButton = '', + poweredByGiphy = '
Powered by' + giphyLogo + '
', + giphyModalHtml = searchInput + closeButton + poweredByGiphy + '
'; + + trumbowyg + .openModal(null, giphyModalHtml, false) + .one(CANCEL_EVENT, function () { + try { + abortController.abort(); + abortController = new AbortController(); + } catch (e) { + } + + trumbowyg.closeModal(); + }); + + var $giphyInput = $('.' + prefix + 'giphy-search'), + $giphyClose = $('.' + prefix + 'giphy-close'), + $giphyModal = $('.' + prefix + 'giphy-modal'); + + var onError = function () { + if (navigator.onLine || $('.' + prefix + 'giphy-offline', $giphyModal).length) { + return; + } + + $giphyModal.empty(); + $giphyModal.append('

You are offline

'); + }; + + // Load trending gifs as default + fetch(DEFAULT_URL, { + method: 'GET', + cache: 'no-cache', + signal: abortController.signal + }).then((response) => { + response.json().then((responseJson) => { + renderGifs(responseJson, $giphyModal, trumbowyg, true); + }); + }).catch(() => { + onError(); + }); + + var searchGifsOnInput = function () { + var query = $giphyInput.val(); + + if (query.length === 0) { + return; + } + + try { + abortController.abort(); + abortController = new AbortController(); + } catch (e) { + } + + fetch(BASE_URL + '&q=' + encodeURIComponent(query), { + method: 'GET', + cache: 'no-cache', + signal: abortController.signal + }).then((response) => { + response.json().then((responseJson) => { + renderGifs(responseJson, $giphyModal, trumbowyg, true); + }); + }).catch(() => { + onError(); + }); + }; + var throttledInputRequest = trumbowygThrottle(searchGifsOnInput, trumbowyg.o.plugins.giphy.throttleDelay); + + $giphyInput.on('input', throttledInputRequest); + $giphyInput.focus(); + + $giphyClose.one('click', function () { + $giphyModal.trigger(CANCEL_EVENT); + }); + } + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/giphy/trumbowyg.giphy.min.js b/dist/plugins/giphy/trumbowyg.giphy.min.js new file mode 100644 index 000000000..6abdeebe9 --- /dev/null +++ b/dist/plugins/giphy/trumbowyg.giphy.min.js @@ -0,0 +1 @@ +!function(i){"use strict";i.extend(!0,i.trumbowyg,{langs:{en:{giphy:"Insert GIF"},az:{giphy:"GIF yerləşdir"},by:{giphy:"Уставіць GIF"},de:{giphy:"GIF einfügen"},et:{giphy:"Sisesta GIF"},fr:{giphy:"Insérer un GIF"},hu:{giphy:"GIF beszúrás"},ru:{giphy:"Вставить GIF"},sl:{giphy:"Vstavi GIF"},tr:{giphy:"GIF ekle"}}});var e="tbwcancel";function t(e,t,n,o){var c=(t.width()-20)/3,a=e.data.filter((function(i){return!!i.images[l.pickerRendition][l.pickerRenditionUrlAttribute]})).map((function(i){var e=i.images[l.pickerRendition],t=i.images[l.selectionRendition],n=e.height/e.width,o=i.title,a=e[l.pickerRenditionUrlAttribute],r=t[l.selectionRenditionUrlAttribute];return'
'+("'+o+'')+"
"})).join("");if(!0===o){if(0===a.length){if(i("."+n.o.prefix+"giphy-no-result",t).length>0)return;a=''}t.empty()}t.append(a);var r=function(i){i.classList.add("tbw-loaded")};i("img",t).each((function(){var i=this;i.complete?r(i):i.addEventListener("load",(function(){r(this)}))})),i("img",t).on("click",(function(){var e=i(this).data("selection-url"),l=i(this).attr("alt");(n.restoreRange(),n.execCmd("insertImage",e,!1,!0),l)&&(i('img[src="'+e+'"]:not([alt])',n.$box).attr("alt",l),n.syncCode());i("img",t).off(),n.closeModal()}))}var n={rating:"g",apiKey:null,throttleDelay:300,limit:50,noResultGifUrl:"https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif"};const l={bundle:"low_bandwidth",pickerRendition:"fixed_width_small",pickerRenditionUrlAttribute:"webp",selectionRendition:"original",selectionRenditionUrlAttribute:"url"};i.extend(!0,i.trumbowyg,{plugins:{giphy:{init:function(o){o.o.plugins.giphy=i.extend({},n,o.o.plugins.giphy||{}),o.addBtnDef("giphy",{fn:function(){if(null===o.o.plugins.giphy.apiKey)throw new Error("You must set a Giphy API Key");var n=["https://api.giphy.com/v1/gifs/search?api_key=",o.o.plugins.giphy.apiKey,"&rating=",o.o.plugins.giphy.rating,"&limit=",o.o.plugins.giphy.limit,"&bundle=",l.bundle].join("");const c=n.replace("/search","/trending");var a=o.o.prefix,r=new AbortController,s=''+('')+('
Powered by
')+'
';o.openModal(null,s,!1).one(e,(function(){try{r.abort(),r=new AbortController}catch(i){}o.closeModal()}));var g=i("."+a+"giphy-search"),h=i("."+a+"giphy-close"),p=i("."+a+"giphy-modal"),u=function(){navigator.onLine||i("."+a+"giphy-offline",p).length||(p.empty(),p.append('

You are offline

'))};fetch(c,{method:"GET",cache:"no-cache",signal:r.signal}).then((i=>{i.json().then((i=>{t(i,p,o,!0)}))})).catch((()=>{u()}));var d,y,f,m,v=(d=function(){var i=g.val();if(0!==i.length){try{r.abort(),r=new AbortController}catch(i){}fetch(n+"&q="+encodeURIComponent(i),{method:"GET",cache:"no-cache",signal:r.signal}).then((i=>{i.json().then((i=>{t(i,p,o,!0)}))})).catch((()=>{u()}))}},y=o.o.plugins.giphy.throttleDelay,function(){var i=this,e=(new Date).getTime(),t=arguments;f&&e', + '' + Prism.highlight(text, Prism.languages[language]) + '', + '' + ].join(''); + } + + function escapeHtml(html) { + return $('
').text(html).html(); + } + + function buildHighlightOptions(trumbowyg) { + var languageNames = trumbowyg.o.plugins.highlight.languageNames; + var languageNameKeys = Object.keys(languageNames); + var prismLanguageKeys = Object.keys(Prism.languages); + + var options = prismLanguageKeys.filter(function (languageKey) { + return languageNameKeys.indexOf(languageKey) >= 0; + }).map(function (languageKey) { + return { + id: languageKey, + name: languageNames[languageKey] + }; + }).sort(function (a, b) { + // Sort languages by name + return a.name.localeCompare(b.name); + }).map(function (language) { + // Generate a list of options + return ''; + }).join(''); + + return options; + } + + function buildLineHighlightFieldIfEnabled(trumbowyg) { + if (trumbowyg.o.plugins.highlight.enableLineHighlight === false) { + return ''; + } + + return '
' + + ' ' + + '
'; + } + + // If my plugin is a button + function buildButtonDef(trumbowyg) { + return { + fn: function () { + var $modal = trumbowyg.openModal('Code', [ + '
', + ' ', + '
', + '
', + ' ', + '
', + buildLineHighlightFieldIfEnabled(trumbowyg), + ].join('\n')), + $language = $modal.find('.language'), + $code = $modal.find('.code'), + $lineHighlight = $modal.find('.trumbowyg-line-highlight'); + + // Listen clicks on modal box buttons + $modal.on('tbwconfirm', function () { + trumbowyg.restoreRange(); + trumbowyg.execCmd('insertHTML', highlightIt($code.val(), $language.val(), $lineHighlight.val())); + trumbowyg.execCmd('insertHTML', '


'); + + trumbowyg.closeModal(); + }); + + $modal.on('tbwcancel', function () { + trumbowyg.closeModal(); + }); + } + }; + } + + $.extend(true, $.trumbowyg, { + // Add some translations + langs: { + // jshint camelcase:false + en: { + highlight: 'Code syntax highlight', + highlightLine: 'Highlight lines, e.g.: 1,3-5' + }, + az: { + highlight: 'Kod birləşməsini vurğulamaq', + highlightLine: 'Sətirləri vurğulamaq, məsələn: 1,3-5' + }, + by: { + highlight: 'Падсветка сінтаксісу кода', + highlightLine: 'Падсвятліць радкі, напр.: 1,3-5' + }, + es: { + highlight: 'Resaltado de sintaxis de código', + highlightLine: 'Resaltar lineas, ej: 1,3-5' + }, + et: { + highlight: 'Koodi esiletoomine', + highlightLine: 'Koodiread, näiteks: 1,3-5' + }, + hu: { + highlight: 'Kód kiemelés' + }, + ko: { + highlight: '코드 문법 하이라이트' + }, + pt_br: { + highlight: 'Realçar sintaxe de código' + }, + ru: { + highlight: 'Подсветка синтаксиса кода', + highlightLine: 'Подсветить строки, напр.: 1,3-5' + }, + sl: { + highlight: 'Označi sintakso kode', + highlightLine: 'Označi številko vrstice, npr.: 1,3-5' + }, + tr: { + highlight: 'Kod sözdizimini vurgula', + highlightLine: 'Vurgu çizgileri, örneğin: 1,3-5' + } + // jshint camelcase:true + }, + // Add our plugin to Trumbowyg registered plugins + plugins: { + highlight: { + init: function (trumbowyg) { + // Fill current Trumbowyg instance with my plugin default options + trumbowyg.o.plugins.highlight = $.extend(true, {}, + defaultOptions, + trumbowyg.o.plugins.highlight || {} + ); + + // If my plugin is a button + trumbowyg.addBtnDef('highlight', buildButtonDef(trumbowyg)); + } + } + } + }); +})(jQuery, Prism); diff --git a/dist/plugins/highlight/trumbowyg.highlight.min.js b/dist/plugins/highlight/trumbowyg.highlight.min.js new file mode 100644 index 000000000..e422004ea --- /dev/null +++ b/dist/plugins/highlight/trumbowyg.highlight.min.js @@ -0,0 +1 @@ +!function(e,i){"use strict";var t={enableLineHighlight:!0,languageNames:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"Augmented Backus–Naur form",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"Backus–Naur form",rbnf:"Routing Backus–Naur form",conc:"Concurnas",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",coffee:"CoffeeScript",cmake:"CMake",csp:"Content-Security-Policy","css-extras":"CSS Extras",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",ebnf:"Extended Backus–Naur form",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",iecst:"Structured Text (IEC 61131-3)",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras","js-templates":"JS Templates",json:"JSON",jsonp:"JSONP",json5:"JSON5",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session",solidity:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",trig:"TriG",ts:"TypeScript","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)","t4-templating":"T4 templating",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML"}};function a(i){return e("
").text(i).html()}function l(e){var t=e.o.plugins.highlight.languageNames,l=Object.keys(t);return Object.keys(i.languages).filter((function(e){return l.indexOf(e)>=0})).map((function(e){return{id:e,name:t[e]}})).sort((function(e,i){return e.name.localeCompare(i.name)})).map((function(e){return'"})).join("")}function o(e){return!1===e.o.plugins.highlight.enableLineHighlight?"":'
'}function s(e){return{fn:function(){var t=e.openModal("Code",['
',' ","
",'
',' ',"
",o(e)].join("\n")),a=t.find(".language"),s=t.find(".code"),n=t.find(".trumbowyg-line-highlight");t.on("tbwconfirm",(function(){var t,l,o;e.restoreRange(),e.execCmd("insertHTML",(t=s.val(),l=a.val(),o=n.val(),['
",''+i.highlight(t,i.languages[l])+"","
"].join(""))),e.execCmd("insertHTML","


"),e.closeModal()})),t.on("tbwcancel",(function(){e.closeModal()}))}}}e.extend(!0,e.trumbowyg,{langs:{en:{highlight:"Code syntax highlight",highlightLine:"Highlight lines, e.g.: 1,3-5"},az:{highlight:"Kod birləşməsini vurğulamaq",highlightLine:"Sətirləri vurğulamaq, məsələn: 1,3-5"},by:{highlight:"Падсветка сінтаксісу кода",highlightLine:"Падсвятліць радкі, напр.: 1,3-5"},es:{highlight:"Resaltado de sintaxis de código",highlightLine:"Resaltar lineas, ej: 1,3-5"},et:{highlight:"Koodi esiletoomine",highlightLine:"Koodiread, näiteks: 1,3-5"},hu:{highlight:"Kód kiemelés"},ko:{highlight:"코드 문법 하이라이트"},pt_br:{highlight:"Realçar sintaxe de código"},ru:{highlight:"Подсветка синтаксиса кода",highlightLine:"Подсветить строки, напр.: 1,3-5"},sl:{highlight:"Označi sintakso kode",highlightLine:"Označi številko vrstice, npr.: 1,3-5"},tr:{highlight:"Kod sözdizimini vurgula",highlightLine:"Vurgu çizgileri, örneğin: 1,3-5"}},plugins:{highlight:{init:function(i){i.o.plugins.highlight=e.extend(!0,{},t,i.o.plugins.highlight||{}),i.addBtnDef("highlight",s(i))}}}})}(jQuery,Prism); \ No newline at end of file diff --git a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss new file mode 100644 index 000000000..200396365 --- /dev/null +++ b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss @@ -0,0 +1,25 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-highlight-form-group { + margin: 15px 10px; + + .trumbowyg-highlight-form-control { + width: 100%; + border: 1px solid #DEDEDE; + font-size: 14px; + padding: 7px; + + &.code { + height: 200px; + } + } +} diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.css b/dist/plugins/highlight/ui/trumbowyg.highlight.css new file mode 100644 index 000000000..8604e131c --- /dev/null +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.css @@ -0,0 +1,23 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-highlight-form-group { + margin: 15px 10px; +} +.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control { + width: 100%; + border: 1px solid #DEDEDE; + font-size: 14px; + padding: 7px; +} +.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code { + height: 200px; +} \ No newline at end of file diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.min.css b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css new file mode 100644 index 000000000..a8d789a1f --- /dev/null +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #dedede;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px} \ No newline at end of file diff --git a/dist/plugins/history/trumbowyg.history.js b/dist/plugins/history/trumbowyg.history.js new file mode 100644 index 000000000..406447ae9 --- /dev/null +++ b/dist/plugins/history/trumbowyg.history.js @@ -0,0 +1,173 @@ +/*/* =========================================================== + * trumbowyg.history.js v1.0 + * history plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Sven Dunemann [dunemann@forelabs.eu] + */ + +(function ($) { + 'use strict'; + $.extend(true, $.trumbowyg, { + plugins: { + history: { + destroy: function (t) { + t.$c.off('tbwinit.history tbwchange.history'); + }, + init: function (t) { + t.o.plugins.history = $.extend(true, { + _stack: [], + _index: -1, + _focusEl: undefined + }, t.o.plugins.history || {}); + + var btnBuildDefRedo = { + title: t.lang.redo, + ico: 'redo', + key: 'Y', + fn: function () { + if (t.o.plugins.history._index < t.o.plugins.history._stack.length - 1) { + t.o.plugins.history._index += 1; + var index = t.o.plugins.history._index; + var newState = t.o.plugins.history._stack[index]; + + t.execCmd('html', newState); + // because of some semantic optimisations we have to save the state back + // to history + t.o.plugins.history._stack[index] = t.$ed.html(); + + carretToEnd(); + toggleButtonStates(); + } + } + }; + + var btnBuildDefUndo = { + title: t.lang.undo, + ico: 'undo', + key: 'Z', + fn: function () { + if (t.o.plugins.history._index > 0) { + t.o.plugins.history._index -= 1; + var index = t.o.plugins.history._index, + newState = t.o.plugins.history._stack[index]; + + t.execCmd('html', newState); + // because of some semantic optimisations we have to save the state back + // to history + t.o.plugins.history._stack[index] = t.$ed.html(); + + carretToEnd(); + toggleButtonStates(); + } + } + }; + + var pushToHistory = function () { + var index = t.o.plugins.history._index, + stack = t.o.plugins.history._stack, + latestState = stack.slice(-1)[0] || '

', + prevState = stack[index], + newState = t.$ed.html(), + focusEl = t.doc.getSelection().focusNode, + focusElText = '', + latestStateTagsList, + newStateTagsList, + prevFocusEl = t.o.plugins.history._focusEl; + + latestStateTagsList = $('
' + latestState + '
').find('*').map(function () { + return this.localName; + }); + newStateTagsList = $('
' + newState + '
').find('*').map(function () { + return this.localName; + }); + if (focusEl) { + t.o.plugins.history._focusEl = focusEl; + focusElText = focusEl.outerHTML || focusEl.textContent; + } + + if (newState !== prevState) { + // a new stack entry is defined when current insert ends on a whitespace character + // or count of node elements has been changed + // or focused element differs from previous one + if (focusElText.slice(-1).match(/\s/) || + !arraysAreIdentical(latestStateTagsList, newStateTagsList) || + t.o.plugins.history._index <= 0 || focusEl !== prevFocusEl) + { + t.o.plugins.history._index += 1; + // remove newer entries in history when something new was added + // because timeline was changes with interaction + t.o.plugins.history._stack = stack.slice( + 0, t.o.plugins.history._index + ); + // now add new state to modified history + t.o.plugins.history._stack.push(newState); + } else { + // modify last stack entry + t.o.plugins.history._stack[index] = newState; + } + + toggleButtonStates(); + } + }; + + var toggleButtonStates = function () { + var index = t.o.plugins.history._index, + stackSize = t.o.plugins.history._stack.length, + undoState = (index > 0), + redoState = (stackSize !== 0 && index !== stackSize - 1); + + toggleButtonState('historyUndo', undoState); + toggleButtonState('historyRedo', redoState); + }; + + var toggleButtonState = function (btn, enable) { + var button = t.$box.find('.trumbowyg-' + btn + '-button'); + + if (enable) { + button.removeClass('trumbowyg-disable'); + } else if (!button.hasClass('trumbowyg-disable')) { + button.addClass('trumbowyg-disable'); + } + }; + + var arraysAreIdentical = function (a, b) { + if (a === b) { + return true; + } + if (a == null || b == null) { + return false; + } + if (a.length !== b.length) { + return false; + } + + for (var i = 0; i < a.length; i += 1) { + if (a[i] !== b[i]) { + return false; + } + } + return true; + }; + + var carretToEnd = function () { + var node = t.doc.getSelection().focusNode, + range = t.doc.createRange(); + + if (node.childNodes.length > 0) { + range.setStartAfter(node.childNodes[node.childNodes.length - 1]); + range.setEndAfter(node.childNodes[node.childNodes.length - 1]); + t.doc.getSelection().removeAllRanges(); + t.doc.getSelection().addRange(range); + } + }; + + t.$c.on('tbwinit.history tbwchange.history', pushToHistory); + + t.addBtnDef('historyRedo', btnBuildDefRedo); + t.addBtnDef('historyUndo', btnBuildDefUndo); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/history/trumbowyg.history.min.js b/dist/plugins/history/trumbowyg.history.min.js new file mode 100644 index 000000000..334190edb --- /dev/null +++ b/dist/plugins/history/trumbowyg.history.min.js @@ -0,0 +1,8 @@ +/*/* =========================================================== + * trumbowyg.history.js v1.0 + * history plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Sven Dunemann [dunemann@forelabs.eu] + */ +!function(i){"use strict";i.extend(!0,i.trumbowyg,{plugins:{history:{destroy:function(i){i.$c.off("tbwinit.history tbwchange.history")},init:function(t){t.o.plugins.history=i.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},t.o.plugins.history||{});var o={title:t.lang.redo,ico:"redo",key:"Y",fn:function(){if(t.o.plugins.history._index0){t.o.plugins.history._index-=1;var i=t.o.plugins.history._index,o=t.o.plugins.history._stack[i];t.execCmd("html",o),t.o.plugins.history._stack[i]=t.$ed.html(),r(),s()}}},s=function(){var i=t.o.plugins.history._index,o=t.o.plugins.history._stack.length,n=0!==o&&i!==o-1;e("historyUndo",i>0),e("historyRedo",n)},e=function(i,o){var n=t.$box.find(".trumbowyg-"+i+"-button");o?n.removeClass("trumbowyg-disable"):n.hasClass("trumbowyg-disable")||n.addClass("trumbowyg-disable")},l=function(i,t){if(i===t)return!0;if(null==i||null==t)return!1;if(i.length!==t.length)return!1;for(var o=0;o0&&(o.setStartAfter(i.childNodes[i.childNodes.length-1]),o.setEndAfter(i.childNodes[i.childNodes.length-1]),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(o))};t.$c.on("tbwinit.history tbwchange.history",(function(){var o,n,e=t.o.plugins.history._index,r=t.o.plugins.history._stack,d=r.slice(-1)[0]||"

",u=r[e],h=t.$ed.html(),c=t.doc.getSelection().focusNode,g="",a=t.o.plugins.history._focusEl;o=i("
"+d+"
").find("*").map((function(){return this.localName})),n=i("
"+h+"
").find("*").map((function(){return this.localName})),c&&(t.o.plugins.history._focusEl=c,g=c.outerHTML||c.textContent),h!==u&&(g.slice(-1).match(/\s/)||!l(o,n)||t.o.plugins.history._index<=0||c!==a?(t.o.plugins.history._index+=1,t.o.plugins.history._stack=r.slice(0,t.o.plugins.history._index),t.o.plugins.history._stack.push(h)):t.o.plugins.history._stack[e]=h,s())})),t.addBtnDef("historyRedo",o),t.addBtnDef("historyUndo",n)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/indent/trumbowyg.indent.js b/dist/plugins/indent/trumbowyg.indent.js new file mode 100644 index 000000000..c98aaa456 --- /dev/null +++ b/dist/plugins/indent/trumbowyg.indent.js @@ -0,0 +1,89 @@ +/* =========================================================== + * trumbowyg.indent.js v1.0 + * Indent or Outdent plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fabacks + * Website : https://github.com/Fabacks + */ + +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + indent: 'Indent', + outdent: 'Outdent' + }, + az: { + indent: 'Girinti', + outdent: 'Çıxıntı' + }, + by: { + indent: 'Водступ', + outdent: 'Выступ' + }, + de: { + indent: 'Einzug vergrößern', + outdent: 'Einzug verkleinern' + }, + et: { + indent: 'Taande suurendamine', + outdent: 'Taande vähendamine' + }, + fr: { + indent: 'Augmenter le retrait', + outdent: 'Diminuer le retrait' + }, + pt_br: { + indent: 'Aumentar Recuo', + outdent: 'Diminuir Recuo' + }, + ru: { + indent: 'Отступ', + outdent: 'Выступ' + }, + sl: { + indent: 'Povečaj zamik', + outdent: 'Zmanjšaj zamik' + }, + tr: { + indent: 'Girinti', + outdent: 'Çıkıntı' + } + // jshint camelcase:true + } + }); + + // Adds the extra button definition + $.extend(true, $.trumbowyg, { + plugins: { + paragraph: { + init: function (trumbowyg) { + var indentBtnDef = { + fn: 'indent', + title: trumbowyg.lang.indent, + isSupported: function () { + return !!document.queryCommandSupported && !!document.queryCommandSupported('indent'); + }, + ico: 'indent' + }; + + var outdentBtnDef = { + fn: 'outdent', + title: trumbowyg.lang.outdent, + isSupported: function () { + return !!document.queryCommandSupported && !!document.queryCommandSupported('outdent'); + }, + ico: 'outdent' + }; + + trumbowyg.addBtnDef('indent', indentBtnDef); + trumbowyg.addBtnDef('outdent', outdentBtnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/indent/trumbowyg.indent.min.js b/dist/plugins/indent/trumbowyg.indent.min.js new file mode 100644 index 000000000..1db4b248f --- /dev/null +++ b/dist/plugins/indent/trumbowyg.indent.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * trumbowyg.indent.js v1.0 + * Indent or Outdent plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fabacks + * Website : https://github.com/Fabacks + */ +!function(n){"use strict";n.extend(!0,n.trumbowyg,{langs:{en:{indent:"Indent",outdent:"Outdent"},az:{indent:"Girinti",outdent:"Çıxıntı"},by:{indent:"Водступ",outdent:"Выступ"},de:{indent:"Einzug vergrößern",outdent:"Einzug verkleinern"},et:{indent:"Taande suurendamine",outdent:"Taande vähendamine"},fr:{indent:"Augmenter le retrait",outdent:"Diminuer le retrait"},pt_br:{indent:"Aumentar Recuo",outdent:"Diminuir Recuo"},ru:{indent:"Отступ",outdent:"Выступ"},sl:{indent:"Povečaj zamik",outdent:"Zmanjšaj zamik"},tr:{indent:"Girinti",outdent:"Çıkıntı"}}}),n.extend(!0,n.trumbowyg,{plugins:{paragraph:{init:function(n){var t={fn:"indent",title:n.lang.indent,isSupported:function(){return!!document.queryCommandSupported&&!!document.queryCommandSupported("indent")},ico:"indent"},e={fn:"outdent",title:n.lang.outdent,isSupported:function(){return!!document.queryCommandSupported&&!!document.queryCommandSupported("outdent")},ico:"outdent"};n.addBtnDef("indent",t),n.addBtnDef("outdent",e)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/insertaudio/trumbowyg.insertaudio.js b/dist/plugins/insertaudio/trumbowyg.insertaudio.js new file mode 100644 index 000000000..7bf429671 --- /dev/null +++ b/dist/plugins/insertaudio/trumbowyg.insertaudio.js @@ -0,0 +1,124 @@ +/*/* =========================================================== + * trumbowyg.insertaudio.js v1.0 + * InsertAudio plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Adam Hess (AdamHess) + */ + +(function ($) { + 'use strict'; + + var insertAudioOptions = { + src: { + label: 'URL', + required: true + }, + autoplay: { + label: 'AutoPlay', + required: false, + type: 'checkbox' + }, + muted: { + label: 'Muted', + required: false, + type: 'checkbox' + }, + preload: { + label: 'preload options', + required: false + } + }; + + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + insertAudio: 'Insert Audio' + }, + az: { + insertAudio: 'Səs yerləşdir' + }, + by: { + insertAudio: 'Уставіць аўдыё' + }, + ca: { + insertAudio: 'Inserir Audio' + }, + da: { + insertAudio: 'Indsæt lyd' + }, + de: { + insertAudio: 'Audio einfügen' + }, + es: { + insertAudio: 'Insertar Audio' + }, + et: { + insertAudio: 'Lisa helifail' + }, + fr: { + insertAudio: 'Insérer un son' + }, + hu: { + insertAudio: 'Audio beszúrás' + }, + ja: { + insertAudio: '音声の挿入' + }, + ko: { + insertAudio: '소리 넣기' + }, + pt_br: { + insertAudio: 'Inserir áudio' + }, + ru: { + insertAudio: 'Вставить аудио' + }, + sl: { + insertAudio: 'Vstavi zvočno datoteko' + }, + tr: { + insertAudio: 'Ses Ekle' + }, + // jshint camelcase:true + }, + plugins: { + insertAudio: { + init: function (trumbowyg) { + var btnDef = { + fn: function () { + var insertAudioCallback = function (v) { + // controls should always be show otherwise the audio will + // be invisible defeating the point of a wysiwyg + var html = '")[0];return r.range.deleteContents(),r.range.insertNode(o),!0}))}};r.addBtnDef("insertAudio",n)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/lineheight/trumbowyg.lineheight.js b/dist/plugins/lineheight/trumbowyg.lineheight.js new file mode 100644 index 000000000..a648079f3 --- /dev/null +++ b/dist/plugins/lineheight/trumbowyg.lineheight.js @@ -0,0 +1,225 @@ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + lineheight: 'Line height', + lineheights: { + '0.9': 'Small', + 'normal': 'Regular', + '1.5': 'Large', + '2.0': 'Extra large' + } + }, + az: { + lineheight: 'Sətir yüksəkliyi', + lineheights: { + '0.9': 'Kiçik', + 'normal': 'Normal', + '1.5': 'Böyük', + '2.0': 'Daha böyük' + } + }, + by: { + lineheight: 'Міжрадковы інтэрвал', + lineheights: { + '0.9': 'Маленькі', + 'normal': 'Звычайны', + '1.5': 'Вялікі', + '2.0': 'Вельмі вялікі' + } + }, + da: { + lineheight: 'Linjehøjde', + lineheights: { + '0.9': 'Lille', + 'normal': 'Normal', + '1.5': 'Stor', + '2.0': 'Ekstra stor' + } + }, + de: { + lineheight: 'Zeilenhöhe', + lineheights: { + '0.9': 'Klein', + 'normal': 'Normal', + '1.5': 'Groß', + '2.0': 'Sehr groß' + } + }, + et: { + lineheight: 'Reavahe', + lineheights: { + '0.9': 'Väike', + 'normal': 'Tavaline', + '1.5': 'Suur', + '2.0': 'Väga suur' + } + }, + fr: { + lineheight: 'Hauteur de ligne', + lineheights: { + '0.9': 'Petite', + 'normal': 'Normale', + '1.5': 'Grande', + '2.0': 'Très grande' + } + }, + hu: { + lineheight: 'Line height', + lineheights: { + '0.9': 'Small', + 'normal': 'Regular', + '1.5': 'Large', + '2.0': 'Extra large' + } + }, + it: { + lineheight: 'Altezza linea', + lineheights: { + '0.9': 'Bassa', + 'normal': 'Normale', + '1.5': 'Alta', + '2.0': 'Molto alta' + } + }, + ko: { + lineheight: '줄 간격', + lineheights: { + '0.9': '좁게', + 'normal': '보통', + '1.5': '넓게', + '2.0': '아주 넓게' + } + }, + nl: { + lineheight: 'Regelhoogte', + lineheights: { + '0.9': 'Klein', + 'normal': 'Normaal', + '1.5': 'Groot', + '2.0': 'Extra groot' + } + }, + pt_br: { + lineheight: 'Altura de linha', + lineheights: { + '0.9': 'Pequena', + 'normal': 'Regular', + '1.5': 'Grande', + '2.0': 'Extra grande' + } + }, + ru: { + lineheight: 'Межстрочный интервал', + lineheights: { + '0.9': 'Маленький', + 'normal': 'Обычный', + '1.5': 'Большой', + '2.0': 'Очень большой' + } + }, + sl: { + lineheight: 'Višina vrstice', + lineheights: { + '0.9': 'Majhna', + 'normal': 'Navadna', + '1.5': 'Velika', + '2.0': 'Ekstra velika' + } + }, + tr: { + lineheight: 'Satır yüksekliği', + lineheights: { + '0.9': 'Küçük', + 'normal': 'Normal', + '1.5': 'Büyük', + '2.0': 'Çok Büyük' + } + }, + zh_tw: { + lineheight: '文字間距', + lineheights: { + '0.9': '小', + 'normal': '正常', + '1.5': '大', + '2.0': '特大' + } + } + } + }); + // jshint camelcase:true + + var defaultOptions = { + sizeList: [ + '0.9', + 'normal', + '1.5', + '2.0' + ] + }; + + // Add dropdown with font sizes + $.extend(true, $.trumbowyg, { + plugins: { + lineheight: { + init: function (trumbowyg) { + trumbowyg.o.plugins.lineheight = $.extend({}, + defaultOptions, + trumbowyg.o.plugins.lineheight || {} + ); + + trumbowyg.addBtnDef('lineheight', { + dropdown: buildDropdown(trumbowyg) + }); + } + } + } + }); + + // Build the dropdown + function buildDropdown(trumbowyg) { + var dropdown = []; + + $.each(trumbowyg.o.plugins.lineheight.sizeList, function (index, size) { + trumbowyg.addBtnDef('lineheight_' + size, { + text: trumbowyg.lang.lineheights[size] || size, + hasIcon: false, + fn: function () { + trumbowyg.saveRange(); + var text = trumbowyg.getRangeText(); + if (text.replace(/\s/g, '') !== '') { + try { + var parent = getSelectionParentElement(); + $(parent).css('lineHeight', size); + } catch (e) { + } + } + } + }); + dropdown.push('lineheight_' + size); + }); + + return dropdown; + } + + // Get the selection's parent + function getSelectionParentElement() { + var parentEl = null, + selection; + if (window.getSelection) { + selection = window.getSelection(); + if (selection.rangeCount) { + parentEl = selection.getRangeAt(0).commonAncestorContainer; + if (parentEl.nodeType !== 1) { + parentEl = parentEl.parentNode; + } + } + } else if ((selection = document.selection) && selection.type !== 'Control') { + parentEl = selection.createRange().parentElement(); + } + return parentEl; + } +})(jQuery); diff --git a/dist/plugins/lineheight/trumbowyg.lineheight.min.js b/dist/plugins/lineheight/trumbowyg.lineheight.min.js new file mode 100644 index 000000000..272091e93 --- /dev/null +++ b/dist/plugins/lineheight/trumbowyg.lineheight.min.js @@ -0,0 +1 @@ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},az:{lineheight:"Sətir yüksəkliyi",lineheights:{.9:"Kiçik",normal:"Normal",1.5:"Böyük","2.0":"Daha böyük"}},by:{lineheight:"Міжрадковы інтэрвал",lineheights:{.9:"Маленькі",normal:"Звычайны",1.5:"Вялікі","2.0":"Вельмі вялікі"}},da:{lineheight:"Linjehøjde",lineheights:{.9:"Lille",normal:"Normal",1.5:"Stor","2.0":"Ekstra stor"}},de:{lineheight:"Zeilenhöhe",lineheights:{.9:"Klein",normal:"Normal",1.5:"Groß","2.0":"Sehr groß"}},et:{lineheight:"Reavahe",lineheights:{.9:"Väike",normal:"Tavaline",1.5:"Suur","2.0":"Väga suur"}},fr:{lineheight:"Hauteur de ligne",lineheights:{.9:"Petite",normal:"Normale",1.5:"Grande","2.0":"Très grande"}},hu:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},it:{lineheight:"Altezza linea",lineheights:{.9:"Bassa",normal:"Normale",1.5:"Alta","2.0":"Molto alta"}},ko:{lineheight:"줄 간격",lineheights:{.9:"좁게",normal:"보통",1.5:"넓게","2.0":"아주 넓게"}},nl:{lineheight:"Regelhoogte",lineheights:{.9:"Klein",normal:"Normaal",1.5:"Groot","2.0":"Extra groot"}},pt_br:{lineheight:"Altura de linha",lineheights:{.9:"Pequena",normal:"Regular",1.5:"Grande","2.0":"Extra grande"}},ru:{lineheight:"Межстрочный интервал",lineheights:{.9:"Маленький",normal:"Обычный",1.5:"Большой","2.0":"Очень большой"}},sl:{lineheight:"Višina vrstice",lineheights:{.9:"Majhna",normal:"Navadna",1.5:"Velika","2.0":"Ekstra velika"}},tr:{lineheight:"Satır yüksekliği",lineheights:{.9:"Küçük",normal:"Normal",1.5:"Büyük","2.0":"Çok Büyük"}},zh_tw:{lineheight:"文字間距",lineheights:{.9:"小",normal:"正常",1.5:"大","2.0":"特大"}}}});var i={sizeList:["0.9","normal","1.5","2.0"]};function n(i){var n=[];return e.each(i.o.plugins.lineheight.sizeList,(function(t,l){i.addBtnDef("lineheight_"+l,{text:i.lang.lineheights[l]||l,hasIcon:!1,fn:function(){if(i.saveRange(),""!==i.getRangeText().replace(/\s/g,""))try{var n=function(){var e,i=null;window.getSelection?(e=window.getSelection()).rangeCount&&1!==(i=e.getRangeAt(0).commonAncestorContainer).nodeType&&(i=i.parentNode):(e=document.selection)&&"Control"!==e.type&&(i=e.createRange().parentElement());return i}();e(n).css("lineHeight",l)}catch(e){}}}),n.push("lineheight_"+l)})),n}e.extend(!0,e.trumbowyg,{plugins:{lineheight:{init:function(t){t.o.plugins.lineheight=e.extend({},i,t.o.plugins.lineheight||{}),t.addBtnDef("lineheight",{dropdown:n(t)})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/mathml/trumbowyg.mathml.js b/dist/plugins/mathml/trumbowyg.mathml.js new file mode 100644 index 000000000..ac552cd8d --- /dev/null +++ b/dist/plugins/mathml/trumbowyg.mathml.js @@ -0,0 +1,174 @@ +/* =========================================================== + * trumbowyg.mathMl.js v1.0 + * MathML plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : loclamor + */ + +/* globals MathJax */ +(function ($) { + 'use strict'; + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + mathml: 'Insert Formulas', + formulas: 'Formulas', + inline: 'Inline' + }, + az: { + mathml: 'Düstur əlavə et', + formulas: 'Düsturlar', + inline: 'Sətir içi' + }, + by: { + mathml: 'Уставіць формулу', + formulas: 'Формула', + inline: 'Inline-элемент' + }, + ca: { + mathml: 'Inserir Fórmula', + formulas: 'Fórmula', + inline: 'En línia' + }, + da: { + mathml: 'Indsæt formler', + formulas: 'Formler', + inline: 'Inline' + }, + de: { + mathml: 'Formel einfügen', + formulas: 'Formel', + inline: 'Innerhalb der Zeile' + }, + es: { + mathml: 'Insertar Fórmula', + formulas: 'Fórmula', + inline: 'En línea' + }, + et: { + mathml: 'Sisesta valem', + formulas: 'Valemid', + inline: 'Teksti sees' + }, + fr: { + mathml: 'Inserer une formule', + formulas: 'Formule', + inline: 'En ligne' + }, + hu: { + mathml: 'Formulák beszúrás', + formulas: 'Formulák', + inline: 'Inline' + }, + ko: { + mathml: '수식 넣기', + formulas: '수식', + inline: '글 안에 넣기' + }, + pt_br: { + mathml: 'Inserir fórmulas', + formulas: 'Fórmulas', + inline: 'Em linha' + }, + ru: { + mathml: 'Вставить формулу', + formulas: 'Формула', + inline: 'Строчный элемент' + }, + sl: { + mathml: 'Vstavi matematični izraz', + formulas: 'Formula', + inline: 'V vrstici' + }, + tr: { + mathml: 'Formül Ekle', + formulas: 'Formüller', + inline: 'Satır içi' + }, + zh_tw: { + mathml: '插入方程式', + formulas: '方程式', + inline: '內嵌' + }, + }, + // jshint camelcase:true + + plugins: { + mathml: { + init: function (trumbowyg) { + var mathMlOptions = { + formulas: { + label: trumbowyg.lang.formulas, + required: true, + value: '' + }, + inline: { + label: trumbowyg.lang.inline, + attributes: { + checked: true + }, + type: 'checkbox', + required: false, + } + }; + + var mathmlCallback = function (v) { + var delimiter = v.inline ? '$' : '$$'; + if (trumbowyg.currentMathNode) { + $(trumbowyg.currentMathNode) + .html(delimiter + ' ' + v.formulas + ' ' + delimiter) + .attr('formulas', v.formulas) + .attr('inline', (v.inline ? 'true' : 'false')); + } else { + var html = '' + delimiter + ' ' + v.formulas + ' ' + delimiter + ''; + var node = $(html)[0]; + node.onclick = openModal; + + trumbowyg.range.deleteContents(); + trumbowyg.range.insertNode(node); + } + + trumbowyg.currentMathNode = false; + MathJax.Hub.Queue(['Typeset', MathJax.Hub]); + return true; + }; + + var openModal = function () { + trumbowyg.currentMathNode = this; + mathMlOptions.formulas.value = $(this).attr('formulas'); + + if ($(this).attr('inline') === 'true') { + mathMlOptions.inline.attributes.checked = true; + } else { + delete mathMlOptions.inline.attributes.checked; + } + + trumbowyg.openModalInsert(trumbowyg.lang.mathml, mathMlOptions, mathmlCallback); + }; + + var btnDef = { + fn: function () { + trumbowyg.saveRange(); + + mathMlOptions.formulas.value = trumbowyg.getRangeText(); + mathMlOptions.inline.attributes.checked = true; + trumbowyg.openModalInsert(trumbowyg.lang.mathml, mathMlOptions, mathmlCallback); + } + }; + + trumbowyg.$ta.on('tbwinit', function () { + var nodes = trumbowyg.$ed.find('[formulas]'); + + nodes.each(function (i, elem) { + elem.onclick = openModal; + }); + }); + + trumbowyg.addBtnDef('mathml', btnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/mathml/trumbowyg.mathml.min.js b/dist/plugins/mathml/trumbowyg.mathml.min.js new file mode 100644 index 000000000..58816925d --- /dev/null +++ b/dist/plugins/mathml/trumbowyg.mathml.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * trumbowyg.mathMl.js v1.0 + * MathML plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : loclamor + */ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},az:{mathml:"Düstur əlavə et",formulas:"Düsturlar",inline:"Sətir içi"},by:{mathml:"Уставіць формулу",formulas:"Формула",inline:"Inline-элемент"},ca:{mathml:"Inserir Fórmula",formulas:"Fórmula",inline:"En línia"},da:{mathml:"Indsæt formler",formulas:"Formler",inline:"Inline"},de:{mathml:"Formel einfügen",formulas:"Formel",inline:"Innerhalb der Zeile"},es:{mathml:"Insertar Fórmula",formulas:"Fórmula",inline:"En línea"},et:{mathml:"Sisesta valem",formulas:"Valemid",inline:"Teksti sees"},fr:{mathml:"Inserer une formule",formulas:"Formule",inline:"En ligne"},hu:{mathml:"Formulák beszúrás",formulas:"Formulák",inline:"Inline"},ko:{mathml:"수식 넣기",formulas:"수식",inline:"글 안에 넣기"},pt_br:{mathml:"Inserir fórmulas",formulas:"Fórmulas",inline:"Em linha"},ru:{mathml:"Вставить формулу",formulas:"Формула",inline:"Строчный элемент"},sl:{mathml:"Vstavi matematični izraz",formulas:"Formula",inline:"V vrstici"},tr:{mathml:"Formül Ekle",formulas:"Formüller",inline:"Satır içi"},zh_tw:{mathml:"插入方程式",formulas:"方程式",inline:"內嵌"}},plugins:{mathml:{init:function(l){var n={formulas:{label:l.lang.formulas,required:!0,value:""},inline:{label:l.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(n){var a=n.inline?"$":"$$";if(l.currentMathNode)e(l.currentMathNode).html(a+" "+n.formulas+" "+a).attr("formulas",n.formulas).attr("inline",n.inline?"true":"false");else{var i=''+a+" "+n.formulas+" "+a+"",t=e(i)[0];t.onclick=r,l.range.deleteContents(),l.range.insertNode(t)}return l.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0},r=function(){l.currentMathNode=this,n.formulas.value=e(this).attr("formulas"),"true"===e(this).attr("inline")?n.inline.attributes.checked=!0:delete n.inline.attributes.checked,l.openModalInsert(l.lang.mathml,n,a)},i={fn:function(){l.saveRange(),n.formulas.value=l.getRangeText(),n.inline.attributes.checked=!0,l.openModalInsert(l.lang.mathml,n,a)}};l.$ta.on("tbwinit",(function(){l.$ed.find("[formulas]").each((function(e,l){l.onclick=r}))})),l.addBtnDef("mathml",i)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss new file mode 100644 index 000000000..bc15a6418 --- /dev/null +++ b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss @@ -0,0 +1,41 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +[formulas] { + position: relative; + display: inline-block; + pointer-events: none; + + &[inline="false"] { + display: block; + width: 100%; + } + + &::after { + content: '\270E'; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0; + background-color: rgba(255, 255, 255, 0.83); + box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83); + cursor: pointer; + pointer-events: auto; + } + + &:hover { + &::after { + opacity: 1; + } + } +} diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.css b/dist/plugins/mathml/ui/trumbowyg.mathml.css new file mode 100644 index 000000000..1f6139482 --- /dev/null +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.css @@ -0,0 +1,38 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +@charset "UTF-8"; +[formulas] { + position: relative; + display: inline-block; + pointer-events: none; +} +[formulas][inline=false] { + display: block; + width: 100%; +} +[formulas]::after { + content: "✎"; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0; + background-color: rgba(255, 255, 255, 0.83); + -webkit-box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83); + box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.83); + cursor: pointer; + pointer-events: auto; +} +[formulas]:hover::after { + opacity: 1; +} \ No newline at end of file diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.min.css b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css new file mode 100644 index 000000000..bbd9fe191 --- /dev/null +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +@charset "UTF-8";[formulas]{position:relative;display:inline-block;pointer-events:none}[formulas][inline=false]{display:block;width:100%}[formulas]::after{content:"✎";position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;background-color:rgba(255,255,255,.83);-webkit-box-shadow:0 0 5px 5px rgba(255,255,255,.83);box-shadow:0 0 5px 5px rgba(255,255,255,.83);cursor:pointer;pointer-events:auto}[formulas]:hover::after{opacity:1} \ No newline at end of file diff --git a/dist/plugins/mention/trumbowyg.mention.js b/dist/plugins/mention/trumbowyg.mention.js new file mode 100644 index 000000000..d94fd6151 --- /dev/null +++ b/dist/plugins/mention/trumbowyg.mention.js @@ -0,0 +1,134 @@ +/* =========================================================== + * trumbowyg.mention.js v0.1 + * Mention plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Viper + * Github: https://github.com/Globulopolis + * Website: http://киноархив.com + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + source: [], + formatDropdownItem: formatDropdownItem, + formatResult: formatResult + }; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + mention: 'Mention' + }, + az: { + mention: 'Bildirmək' + }, + by: { + mention: 'Згадаць' + }, + da: { + mention: 'Nævn' + }, + de: { + mention: 'Erwähnung' + }, + et: { + mention: 'Maini' + }, + fr: { + mention: 'Mentionner' + }, + hu: { + mention: 'Említ' + }, + ko: { + mention: '언급' + }, + pt_br: { + mention: 'Menção' + }, + ru: { + mention: 'Упомянуть' + }, + sl: { + mention: 'Omeni' + }, + tr: { + mention: 'Bahset' + }, + zh_tw: { + mention: '標記' + }, + // jshint camelcase:true + }, + + plugins: { + mention: { + init: function (trumbowyg) { + trumbowyg.o.plugins.mention = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.mention || {}); + + var btnDef = { + dropdown: buildDropdown(trumbowyg.o.plugins.mention.source, trumbowyg) + }; + + trumbowyg.addBtnDef('mention', btnDef); + } + } + } + }); + + /** + * Build dropdown list + * + * @param {Array} items Items + * @param {object} trumbowyg Editor + * + * @return {Array} + */ + function buildDropdown(items, trumbowyg) { + var dropdown = []; + + $.each(items, function (i, item) { + var btn = 'mention-' + i, + btnDef = { + hasIcon: false, + text: trumbowyg.o.plugins.mention.formatDropdownItem(item), + fn: function () { + trumbowyg.execCmd('insertHTML', trumbowyg.o.plugins.mention.formatResult(item)); + + return true; + } + }; + + trumbowyg.addBtnDef(btn, btnDef); + dropdown.push(btn); + }); + + return dropdown; + } + + /** + * Format item in dropdown. + * + * @param {object} item Item object. + * + * @return {string} + */ + function formatDropdownItem(item) { + return item.login; + } + + /** + * Format result pasted in editor. + * + * @param {object} item Item object. + * + * @return {string} + */ + function formatResult(item) { + return '@' + item.login + ' '; + } +})(jQuery); diff --git a/dist/plugins/mention/trumbowyg.mention.min.js b/dist/plugins/mention/trumbowyg.mention.min.js new file mode 100644 index 000000000..f31741929 --- /dev/null +++ b/dist/plugins/mention/trumbowyg.mention.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * trumbowyg.mention.js v0.1 + * Mention plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Viper + * Github: https://github.com/Globulopolis + * Website: http://киноархив.com + */ +!function(n){"use strict";var t={source:[],formatDropdownItem:function(n){return n.login},formatResult:function(n){return"@"+n.login+" "}};function e(t,e){var o=[];return n.each(t,(function(n,t){var i="mention-"+n,m={hasIcon:!1,text:e.o.plugins.mention.formatDropdownItem(t),fn:function(){return e.execCmd("insertHTML",e.o.plugins.mention.formatResult(t)),!0}};e.addBtnDef(i,m),o.push(i)})),o}n.extend(!0,n.trumbowyg,{langs:{en:{mention:"Mention"},az:{mention:"Bildirmək"},by:{mention:"Згадаць"},da:{mention:"Nævn"},de:{mention:"Erwähnung"},et:{mention:"Maini"},fr:{mention:"Mentionner"},hu:{mention:"Említ"},ko:{mention:"언급"},pt_br:{mention:"Menção"},ru:{mention:"Упомянуть"},sl:{mention:"Omeni"},tr:{mention:"Bahset"},zh_tw:{mention:"標記"}},plugins:{mention:{init:function(o){o.o.plugins.mention=n.extend(!0,{},t,o.o.plugins.mention||{});var i={dropdown:e(o.o.plugins.mention.source,o)};o.addBtnDef("mention",i)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/mention/ui/sass/trumbowyg.mention.scss b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss new file mode 100644 index 000000000..404624b3a --- /dev/null +++ b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss @@ -0,0 +1,29 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-mention { + button { + position: relative; + white-space: nowrap; + + &:after { + content: ""; + position: absolute; + top: 0; + right: 0; + width: 15%; + height: 100%; + background-size: 100%; + background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%); + pointer-events: none; + } + } +} diff --git a/dist/plugins/mention/ui/trumbowyg.mention.css b/dist/plugins/mention/ui/trumbowyg.mention.css new file mode 100644 index 000000000..e227b2873 --- /dev/null +++ b/dist/plugins/mention/ui/trumbowyg.mention.css @@ -0,0 +1,27 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-mention button { + position: relative; + white-space: nowrap; +} +.trumbowyg-dropdown-mention button:after { + content: ""; + position: absolute; + top: 0; + right: 0; + width: 15%; + height: 100%; + background-size: 100%; + background-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(80%, #ffffff), to(#ffffff)); + background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%); + pointer-events: none; +} \ No newline at end of file diff --git a/dist/plugins/mention/ui/trumbowyg.mention.min.css b/dist/plugins/mention/ui/trumbowyg.mention.min.css new file mode 100644 index 000000000..a2698af35 --- /dev/null +++ b/dist/plugins/mention/ui/trumbowyg.mention.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-mention button{position:relative;white-space:nowrap}.trumbowyg-dropdown-mention button:after{content:"";position:absolute;top:0;right:0;width:15%;height:100%;background-size:100%;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),color-stop(80%,#fff),to(#fff));background-image:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);pointer-events:none} \ No newline at end of file diff --git a/dist/plugins/noembed/trumbowyg.noembed.js b/dist/plugins/noembed/trumbowyg.noembed.js new file mode 100644 index 000000000..8f5e3585f --- /dev/null +++ b/dist/plugins/noembed/trumbowyg.noembed.js @@ -0,0 +1,160 @@ +/* =========================================================== + * trumbowyg.noembed.js v1.0 + * noEmbed plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jake Johns (jakejohns) + */ + +/* global AbortSignal:true */ +(function ($) { + 'use strict'; + + var defaultOptions = { + proxy: 'https://noembed.com/embed?nowrap=on', + urlFiled: 'url', + data: [], + success: undefined, + error: undefined + }; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + noembed: 'Noembed', + noembedError: 'Error' + }, + az: { + noembed: 'Noembed', + noembedError: 'Xəta' + }, + by: { + noembedError: 'Памылка' + }, + cs: { + noembedError: 'Chyba' + }, + da: { + noembedError: 'Fejl' + }, + de: { + noembed: 'Noembed', + noembedError: 'Fehler' + }, + et: { + noembed: 'Noembed', + noembedError: 'Viga' + }, + fr: { + noembedError: 'Erreur' + }, + hu: { + noembed: 'Noembed', + noembedError: 'Hiba' + }, + ja: { + noembedError: 'エラー' + }, + ko: { + noembed: 'oEmbed 넣기', + noembedError: '에러' + }, + pt_br: { + noembed: 'Incorporar', + noembedError: 'Erro' + }, + ru: { + noembedError: 'Ошибка' + }, + sl: { + noembed: 'Noembed', + noembedError: 'Napaka' + }, + sk: { + noembedError: 'Chyba' + }, + tr: { + noembedError: 'Hata' + }, + zh_tw: { + noembed: '插入影片', + noembedError: '錯誤' + }, + // jshint camelcase:true + }, + + plugins: { + noembed: { + init: function (trumbowyg) { + trumbowyg.o.plugins.noembed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.noembed || {}); + + var btnDef = { + fn: function () { + var $modal = trumbowyg.openModalInsert( + // Title + trumbowyg.lang.noembed, + + // Fields + { + url: { + label: 'URL', + required: true + } + }, + + // Callback + function (data) { + // Build request URL + var requestUrl = new URL(trumbowyg.o.plugins.noembed.proxy); + Object.keys(data).forEach((key) => { + requestUrl.searchParams.append(key, data[key].trim()); + }); + + // Launch async request + fetch(requestUrl, { + method: 'GET', + cache: 'no-cache', + signal: AbortSignal.timeout(2000) + }).then((response) => { + if (trumbowyg.o.plugins.noembed.success) { + trumbowyg.o.plugins.noembed.success(data, trumbowyg, $modal); + return; + } + + return response.json().then((json) => { + if (!json.html) { + trumbowyg.addErrorOnModalField( + $('input[type=text]', $modal), + json.error + ); + return; + } + + trumbowyg.execCmd('insertHTML', json.html); + setTimeout(function () { + trumbowyg.closeModal(); + }, 250); + }); + }).catch((...args) => { + if (trumbowyg.o.plugins.noembed.error) { + trumbowyg.o.plugins.noembed.error(...args); + return; + } + + trumbowyg.addErrorOnModalField( + $('input[type=text]', $modal), + trumbowyg.lang.noembedError + ); + }); + } + ); + } + }; + + trumbowyg.addBtnDef('noembed', btnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/noembed/trumbowyg.noembed.min.js b/dist/plugins/noembed/trumbowyg.noembed.min.js new file mode 100644 index 000000000..14708818d --- /dev/null +++ b/dist/plugins/noembed/trumbowyg.noembed.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * trumbowyg.noembed.js v1.0 + * noEmbed plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Jake Johns (jakejohns) + */ +!function(e){"use strict";var r={proxy:"https://noembed.com/embed?nowrap=on",urlFiled:"url",data:[],success:void 0,error:void 0};e.extend(!0,e.trumbowyg,{langs:{en:{noembed:"Noembed",noembedError:"Error"},az:{noembed:"Noembed",noembedError:"Xəta"},by:{noembedError:"Памылка"},cs:{noembedError:"Chyba"},da:{noembedError:"Fejl"},de:{noembed:"Noembed",noembedError:"Fehler"},et:{noembed:"Noembed",noembedError:"Viga"},fr:{noembedError:"Erreur"},hu:{noembed:"Noembed",noembedError:"Hiba"},ja:{noembedError:"エラー"},ko:{noembed:"oEmbed 넣기",noembedError:"에러"},pt_br:{noembed:"Incorporar",noembedError:"Erro"},ru:{noembedError:"Ошибка"},sl:{noembed:"Noembed",noembedError:"Napaka"},sk:{noembedError:"Chyba"},tr:{noembedError:"Hata"},zh_tw:{noembed:"插入影片",noembedError:"錯誤"}},plugins:{noembed:{init:function(o){o.o.plugins.noembed=e.extend(!0,{},r,o.o.plugins.noembed||{});var n={fn:function(){var r=o.openModalInsert(o.lang.noembed,{url:{label:"URL",required:!0}},(function(n){var d=new URL(o.o.plugins.noembed.proxy);Object.keys(n).forEach((e=>{d.searchParams.append(e,n[e].trim())})),fetch(d,{method:"GET",cache:"no-cache",signal:AbortSignal.timeout(2e3)}).then((d=>{if(!o.o.plugins.noembed.success)return d.json().then((n=>{n.html?(o.execCmd("insertHTML",n.html),setTimeout((function(){o.closeModal()}),250)):o.addErrorOnModalField(e("input[type=text]",r),n.error)}));o.o.plugins.noembed.success(n,o,r)})).catch(((...n)=>{o.o.plugins.noembed.error?o.o.plugins.noembed.error(...n):o.addErrorOnModalField(e("input[type=text]",r),o.lang.noembedError)}))}))}};o.addBtnDef("noembed",n)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/pasteembed/trumbowyg.pasteembed.js b/dist/plugins/pasteembed/trumbowyg.pasteembed.js new file mode 100644 index 000000000..5d7410445 --- /dev/null +++ b/dist/plugins/pasteembed/trumbowyg.pasteembed.js @@ -0,0 +1,79 @@ +/* =========================================================== + * trumbowyg.pasteembed.js v1.0 + * Url paste to iframe with noembed. Plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Max Seelig + * Facebook : https://facebook.com/maxse + * Website : https://www.maxmade.nl/ + */ + +/* global AbortSignal:true */ +(function($) { + 'use strict'; + + var defaultOptions = { + enabled: true, + endpoint: 'https://noembed.com/embed?nowrap=on' + }; + + $.extend(true, $.trumbowyg, { + plugins: { + pasteEmbed: { + init: function(trumbowyg) { + trumbowyg.o.plugins.pasteEmbed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.pasteEmbed || {}); + + // Compatibility layer with older 'endpoints' array options + if (Array.isArray(trumbowyg.o.plugins.pasteEmbed.endpoints)) { + trumbowyg.o.plugins.pasteEmbed.endpoint = trumbowyg.o.plugins.pasteEmbed.endpoints[0]; + } + + if (!trumbowyg.o.plugins.pasteEmbed.enabled) { + return; + } + + trumbowyg.pasteHandlers.push(function(pasteEvent) { + try { + var clipboardData = (pasteEvent.originalEvent || pasteEvent).clipboardData, + pastedData = clipboardData.getData('Text'), + endpoint = trumbowyg.o.plugins.pasteEmbed.endpoint; + + if (!pastedData.startsWith('http')) { + return; + } + + pasteEvent.stopPropagation(); + pasteEvent.preventDefault(); + + // Build request URL + var requestUrl = new URL(endpoint); + requestUrl.searchParams.append('url', pastedData.trim()); + + // Launch async request + fetch(requestUrl, { + method: 'GET', + cache: 'no-cache', + signal: AbortSignal.timeout(2000) + }).then((response) => { + return response.json().then((json) => { + return json.html; + }); + }).catch(() => { + return undefined; + }).then((content) => { + if (content === undefined) { + content = $('', { + href: pastedData, + text: pastedData + })[0].outerHTML; + } + + trumbowyg.execCmd('insertHTML', content); + }); + } catch (c) {} + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/pasteembed/trumbowyg.pasteembed.min.js b/dist/plugins/pasteembed/trumbowyg.pasteembed.min.js new file mode 100644 index 000000000..4950fc538 --- /dev/null +++ b/dist/plugins/pasteembed/trumbowyg.pasteembed.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * trumbowyg.pasteembed.js v1.0 + * Url paste to iframe with noembed. Plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Max Seelig + * Facebook : https://facebook.com/maxse + * Website : https://www.maxmade.nl/ + */ +!function(e){"use strict";var t={enabled:!0,endpoint:"https://noembed.com/embed?nowrap=on"};e.extend(!0,e.trumbowyg,{plugins:{pasteEmbed:{init:function(n){n.o.plugins.pasteEmbed=e.extend(!0,{},t,n.o.plugins.pasteEmbed||{}),Array.isArray(n.o.plugins.pasteEmbed.endpoints)&&(n.o.plugins.pasteEmbed.endpoint=n.o.plugins.pasteEmbed.endpoints[0]),n.o.plugins.pasteEmbed.enabled&&n.pasteHandlers.push((function(t){try{var a=(t.originalEvent||t).clipboardData.getData("Text"),s=n.o.plugins.pasteEmbed.endpoint;if(!a.startsWith("http"))return;t.stopPropagation(),t.preventDefault();var i=new URL(s);i.searchParams.append("url",a.trim()),fetch(i,{method:"GET",cache:"no-cache",signal:AbortSignal.timeout(2e3)}).then((e=>e.json().then((e=>e.html)))).catch((()=>{})).then((t=>{void 0===t&&(t=e("",{href:a,text:a})[0].outerHTML),n.execCmd("insertHTML",t)}))}catch(e){}}))}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/pasteimage/trumbowyg.pasteimage.js b/dist/plugins/pasteimage/trumbowyg.pasteimage.js new file mode 100644 index 000000000..1969888bc --- /dev/null +++ b/dist/plugins/pasteimage/trumbowyg.pasteimage.js @@ -0,0 +1,49 @@ +/* =========================================================== + * trumbowyg.pasteimage.js v1.0 + * Basic base64 paste plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + plugins: { + pasteImage: { + init: function (trumbowyg) { + trumbowyg.pasteHandlers.push(function (pasteEvent) { + try { + var items = (pasteEvent.originalEvent || pasteEvent).clipboardData.items, + mustPreventDefault = false, + reader; + + for (var i = items.length - 1; i >= 0; i -= 1) { + if (items[i].type.match(/^image\//)) { + reader = new FileReader(); + /* jshint -W083 */ + reader.onloadend = function (event) { + trumbowyg.execCmd('insertImage', event.target.result, false, true); + }; + /* jshint +W083 */ + reader.readAsDataURL(items[i].getAsFile()); + + mustPreventDefault = true; + } + } + + if (mustPreventDefault) { + pasteEvent.stopPropagation(); + pasteEvent.preventDefault(); + } + } catch (c) { + } + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/pasteimage/trumbowyg.pasteimage.min.js b/dist/plugins/pasteimage/trumbowyg.pasteimage.min.js new file mode 100644 index 000000000..01744f9d1 --- /dev/null +++ b/dist/plugins/pasteimage/trumbowyg.pasteimage.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * trumbowyg.pasteimage.js v1.0 + * Basic base64 paste plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push((function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=!1,r=n.length-1;r>=0;r-=1)n[r].type.match(/^image\//)&&((a=new FileReader).onloadend=function(t){e.execCmd("insertImage",t.target.result,!1,!0)},a.readAsDataURL(n[r].getAsFile()),i=!0);i&&(t.stopPropagation(),t.preventDefault())}catch(e){}}))}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/preformatted/trumbowyg.preformatted.js b/dist/plugins/preformatted/trumbowyg.preformatted.js new file mode 100644 index 000000000..76db3bef6 --- /dev/null +++ b/dist/plugins/preformatted/trumbowyg.preformatted.js @@ -0,0 +1,160 @@ +/* =========================================================== + * trumbowyg.preformatted.js v1.0 + * Preformatted plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Casella Edoardo (Civile) + */ + + +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + preformatted: 'Code sample
'
+            },
+            az: {
+                preformatted: 'Kod nümunəsi 
'
+            },
+            by: {
+                preformatted: 'Прыклад кода 
'
+            },
+            da: {
+                preformatted: 'Præformateret 
'
+            },
+            de: {
+                preformatted: 'Code-Beispiel 
'
+            },
+            et: {
+                preformatted: 'Eelvormindatud tekst 
'
+            },
+            fr: {
+                preformatted: 'Exemple de code 
'
+            },
+            hu: {
+                preformatted: 'Kód minta 
'
+            },
+            it: {
+                preformatted: 'Codice 
'
+            },
+            ja: {
+                preformatted: 'コードサンプル 
'
+            },
+            ko: {
+                preformatted: '코드 예제 
'
+            },
+            pt_br: {
+                preformatted: 'Exemple de código 
'
+            },
+            ru: {
+                preformatted: 'Пример кода 
'
+            },
+            sl: {
+                preformatted: 'Vstavi neformatiran tekst 
'
+            },
+            tr: {
+                preformatted: 'Kod örneği 
'
+            },
+            zh_cn: {
+                preformatted: '代码示例 
'
+            },
+            zh_tw: {
+                preformatted: '代碼範例 
'
+            },
+        },
+        // jshint camelcase:true
+
+        plugins: {
+            preformatted: {
+                init: function (trumbowyg) {
+                    var btnDef = {
+                        fn: function () {
+                            trumbowyg.saveRange();
+                            var text = trumbowyg.getRangeText();
+                            if (text.replace(/\s/g, '') !== '') {
+                                try {
+                                    var curtag = getSelectionParentElement().tagName.toLowerCase();
+                                    if (curtag === 'code' || curtag === 'pre') {
+                                        return unwrapCode();
+                                    }
+                                    else {
+                                        trumbowyg.execCmd('insertHTML', '
' + strip(text) + '
'); + } + } catch (e) { + } + } + }, + tag: 'pre' + }; + + trumbowyg.addBtnDef('preformatted', btnDef); + } + } + } + }); + + /* + * GetSelectionParentElement + */ + function getSelectionParentElement() { + var parentEl = null, + selection; + + if (window.getSelection) { + selection = window.getSelection(); + if (selection.rangeCount) { + parentEl = selection.getRangeAt(0).commonAncestorContainer; + if (parentEl.nodeType !== 1) { + parentEl = parentEl.parentNode; + } + } + } else if ((selection = document.selection) && selection.type !== 'Control') { + parentEl = selection.createRange().parentElement(); + } + + return parentEl; + } + + /* + * Strip + * returns a text without HTML tags + */ + function strip(html) { + var tmp = document.createElement('DIV'); + tmp.innerHTML = html; + return tmp.textContent || tmp.innerText || ''; + } + + /* + * UnwrapCode + * ADD/FIX: to improve, works but can be better + * "paranoic" solution + */ + function unwrapCode() { + var container = null; + + if (document.selection) { //for IE + container = document.selection.createRange().parentElement(); + } else { + var select = window.getSelection(); + if (select.rangeCount > 0) { + container = select.getRangeAt(0).startContainer.parentNode; + } + } + + //'paranoic' unwrap + var ispre = $(container).contents().closest('pre').length; + var iscode = $(container).contents().closest('code').length; + + if (ispre && iscode) { + $(container).contents().unwrap('code').unwrap('pre'); + } else if (ispre) { + $(container).contents().unwrap('pre'); + } else if (iscode) { + $(container).contents().unwrap('code'); + } + } +})(jQuery); diff --git a/dist/plugins/preformatted/trumbowyg.preformatted.min.js b/dist/plugins/preformatted/trumbowyg.preformatted.min.js new file mode 100644 index 000000000..822ed3c01 --- /dev/null +++ b/dist/plugins/preformatted/trumbowyg.preformatted.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * trumbowyg.preformatted.js v1.0 + * Preformatted plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Casella Edoardo (Civile) + */ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample
"},az:{preformatted:"Kod nümunəsi 
"},by:{preformatted:"Прыклад кода 
"},da:{preformatted:"Præformateret 
"},de:{preformatted:"Code-Beispiel 
"},et:{preformatted:"Eelvormindatud tekst 
"},fr:{preformatted:"Exemple de code 
"},hu:{preformatted:"Kód minta 
"},it:{preformatted:"Codice 
"},ja:{preformatted:"コードサンプル 
"},ko:{preformatted:"코드 예제 
"},pt_br:{preformatted:"Exemple de código 
"},ru:{preformatted:"Пример кода 
"},sl:{preformatted:"Vstavi neformatiran tekst 
"},tr:{preformatted:"Kod örneği 
"},zh_cn:{preformatted:"代码示例 
"},zh_tw:{preformatted:"代碼範例 
"}},plugins:{preformatted:{init:function(t){var r={fn:function(){t.saveRange();var r,n,o=t.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=function(){var e,t=null;window.getSelection?(e=window.getSelection()).rangeCount&&1!==(t=e.getRangeAt(0).commonAncestorContainer).nodeType&&(t=t.parentNode):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement());return t}().tagName.toLowerCase();if("code"===a||"pre"===a)return function(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}();t.execCmd("insertHTML","
"+(r=o,(n=document.createElement("DIV")).innerHTML=r,(n.textContent||n.innerText||"")+"
"))}catch(e){}},tag:"pre"};t.addBtnDef("preformatted",r)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/resizimg/trumbowyg.resizimg.js b/dist/plugins/resizimg/trumbowyg.resizimg.js new file mode 100644 index 000000000..7870e9f26 --- /dev/null +++ b/dist/plugins/resizimg/trumbowyg.resizimg.js @@ -0,0 +1,311 @@ +; (function ($) { + 'use strict'; + + var defaultOptions = { + minSize: 32, + step: 4 + }; + + function preventDefault(e) { + e.stopPropagation(); + e.preventDefault(); + } + + var ResizeWithCanvas = function (trumbowyg) { + // variable to create canvas and save img in resize mode + this.resizeCanvas = document.createElement('canvas'); + // to allow canvas to get focus + this.resizeCanvas.setAttribute('tabindex', '0'); + this.resizeCanvas.id = 'trumbowyg-resizimg-' + (+new Date()); + this.ctx = null; + this.resizeImg = null; + + this.pressEscape = function (obj) { + obj.reset(); + }; + this.pressBackspaceOrDelete = function (obj) { + $(obj.resizeCanvas).remove(); + obj.resizeImg = null; + if (trumbowyg !== null){ + trumbowyg.syncCode(); + // notify changes + trumbowyg.$c.trigger('tbwchange'); + } + }; + + // PRIVATE FUNCTION + var focusedNow = false; + var isCursorSeResize = false; + + // calculate offset to change mouse over square in the canvas + var offsetX, offsetY; + var reOffset = function (canvas) { + var BB = canvas.getBoundingClientRect(); + offsetX = BB.left; + offsetY = BB.top; + }; + + var updateCanvas = function (canvas, ctx, img, canvasWidth, canvasHeight) { + ctx.translate(0.5, 0.5); + ctx.lineWidth = 1; + + // image + ctx.drawImage(img, 5, 5, canvasWidth - 10, canvasHeight - 10); + + // border + ctx.beginPath(); + ctx.rect(5, 5, canvasWidth - 10, canvasHeight - 10); + ctx.stroke(); + + // square in the angle + ctx.beginPath(); + ctx.fillStyle = 'rgb(255, 255, 255)'; + ctx.rect(canvasWidth - 10, canvasHeight - 10, 9, 9); + ctx.fill(); + ctx.stroke(); + + // get the offset to change the mouse cursor + reOffset(canvas); + + return ctx; + }; + + // PUBLIC FUNCTION + // necessary to correctly print cursor over square. Called once for instance. Useless with trumbowyg. + this.init = function () { + var _this = this; + $(window).on('scroll resize', function () { + _this.reCalcOffset(); + }); + }; + + this.reCalcOffset = function () { + reOffset(this.resizeCanvas); + }; + + this.canvasId = function () { + return this.resizeCanvas.id; + }; + + this.isActive = function () { + return this.resizeImg !== null; + }; + + this.isFocusedNow = function () { + return focusedNow; + }; + + this.blurNow = function () { + focusedNow = false; + }; + + // restore image in the HTML of the editor + this.reset = function () { + if (this.resizeImg === null) { + return; + } + + // set style of image to avoid issue on resize because this attribute have priority over width and height attribute + this.resizeImg.setAttribute('style', 'width: 100%; max-width: ' + (this.resizeCanvas.clientWidth - 10) + 'px; height: auto; max-height: ' + (this.resizeCanvas.clientHeight - 10) + 'px;'); + + $(this.resizeCanvas).replaceWith($(this.resizeImg)); + + // reset canvas style + this.resizeCanvas.removeAttribute('style'); + this.resizeImg = null; + }; + + // setup canvas with points and border to allow the resizing operation + this.setup = function (img, resizableOptions) { + this.resizeImg = img; + + if (!this.resizeCanvas.getContext) { + return false; + } + + focusedNow = true; + + // draw canvas + this.resizeCanvas.width = $(this.resizeImg).width() + 10; + this.resizeCanvas.height = $(this.resizeImg).height() + 10; + this.resizeCanvas.style.margin = '-5px'; + this.ctx = this.resizeCanvas.getContext('2d'); + + // replace image with canvas + $(this.resizeImg).replaceWith($(this.resizeCanvas)); + + updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height); + + // enable resize + $(this.resizeCanvas).resizableSafe(resizableOptions) + .on('mousedown', preventDefault); + + var _this = this; + $(this.resizeCanvas) + .on('mousemove', function (e) { + var mouseX = Math.round(e.clientX - offsetX); + var mouseY = Math.round(e.clientY - offsetY); + + var wasCursorSeResize = isCursorSeResize; + + _this.ctx.rect(_this.resizeCanvas.width - 10, _this.resizeCanvas.height - 10, 9, 9); + isCursorSeResize = _this.ctx.isPointInPath(mouseX, mouseY); + if (wasCursorSeResize !== isCursorSeResize) { + this.style.cursor = isCursorSeResize ? 'se-resize' : 'default'; + } + }) + .on('keydown', function (e) { + if (!_this.isActive()) { + return; + } + + var x = e.keyCode; + if (x === 27) { // ESC + _this.pressEscape(_this); + } else if (x === 8 || x === 46) { // BACKSPACE or DELETE + _this.pressBackspaceOrDelete(_this); + } + }) + .on('focus', preventDefault) + .on('blur', function () { + _this.reset(); + // save changes + if (trumbowyg !== null){ + trumbowyg.syncCode(); + // notify changes + trumbowyg.$c.trigger('tbwchange'); + } + }); + + this.resizeCanvas.focus(); + + return true; + }; + + // update the canvas after the resizing + this.refresh = function () { + if (!this.resizeCanvas.getContext) { + return; + } + + this.resizeCanvas.width = this.resizeCanvas.clientWidth; + this.resizeCanvas.height = this.resizeCanvas.clientHeight; + updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height); + }; + }; + + $.extend(true, $.trumbowyg, { + plugins: { + resizimg: { + destroyResizable: function () {}, + init: function (trumbowyg) { + var destroyResizable = this.destroyResizable; + + // object to interact with canvas + var resizeWithCanvas = new ResizeWithCanvas(trumbowyg); + + this.destroyResizable = function () { + // clean html code + trumbowyg.$ed.find('canvas.resizable') + .resizableSafe('destroy') + .off('mousedown', preventDefault) + .removeClass('resizable'); + + resizeWithCanvas.reset(); + + trumbowyg.syncCode(); + }; + + trumbowyg.o.plugins.resizimg = $.extend(true, {}, + defaultOptions, + trumbowyg.o.plugins.resizimg || {}, + { + resizable: { + resizeWidth: false, + onDragStart: function (ev, $el) { + var opt = trumbowyg.o.plugins.resizimg; + var x = ev.pageX - $el.offset().left; + var y = ev.pageY - $el.offset().top; + if (x < $el.width() - opt.minSize || y < $el.height() - opt.minSize) { + return false; + } + }, + onDrag: function (ev, $el, newWidth, newHeight) { + var opt = trumbowyg.o.plugins.resizimg; + if (newHeight < opt.minSize) { + newHeight = opt.minSize; + } + newHeight -= newHeight % opt.step; + $el.height(newHeight); + return false; + }, + onDragEnd: function () { + // resize update canvas information + resizeWithCanvas.refresh(); + trumbowyg.syncCode(); + } + } + } + ); + + function initResizable() { + trumbowyg.$ed.find('img') + .off('click') + .on('click', function (e) { + // if I'm already do a resize, reset it + if (resizeWithCanvas.isActive()) { + resizeWithCanvas.reset(); + } + // initialize resize of image + resizeWithCanvas.setup(this, trumbowyg.o.plugins.resizimg.resizable); + + preventDefault(e); + }); + } + + trumbowyg.$c.on('tbwinit', function () { + initResizable(); + + // disable resize when click on other items + trumbowyg.$ed.on('click', function (e) { + // check if I've clicked out of canvas or image to reset it + if ($(e.target).is('img') || e.target.id === resizeWithCanvas.canvasId()) { + return; + } + + preventDefault(e); + resizeWithCanvas.reset(); + //sync + trumbowyg.syncCode(); + // notify changes + trumbowyg.$c.trigger('tbwchange'); + }); + + trumbowyg.$ed.on('scroll', function () { + resizeWithCanvas.reCalcOffset(); + }); + }); + + trumbowyg.$c.on('tbwfocus tbwchange', initResizable); + trumbowyg.$c.on('tbwresize', function () { + resizeWithCanvas.reCalcOffset(); + }); + + // Destroy + trumbowyg.$c.on('tbwblur', function () { + // when canvas is created the tbwblur is called + // this code avoid to destroy the canvas that allow the image resizing + if (resizeWithCanvas.isFocusedNow()) { + resizeWithCanvas.blurNow(); + } else { + destroyResizable(); + } + }); + }, + destroy: function () { + this.destroyResizable(); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/resizimg/trumbowyg.resizimg.min.js b/dist/plugins/resizimg/trumbowyg.resizimg.min.js new file mode 100644 index 000000000..0345d2189 --- /dev/null +++ b/dist/plugins/resizimg/trumbowyg.resizimg.min.js @@ -0,0 +1,3 @@ +!function(e){"use strict";var i={minSize:32,step:4};function t(e){e.stopPropagation(),e.preventDefault()}var s=function(i){this.resizeCanvas=document.createElement("canvas"),this.resizeCanvas.setAttribute("tabindex","0"),this.resizeCanvas.id="trumbowyg-resizimg-"+ +new Date,this.ctx=null,this.resizeImg=null,this.pressEscape=function(e){e.reset()},this.pressBackspaceOrDelete=function(t){e(t.resizeCanvas).remove(),t.resizeImg=null,null!==i&&(i.syncCode(),i.$c.trigger("tbwchange"))};var s,n,r=!1,a=!1,o=function(e){var i=e.getBoundingClientRect();s=i.left,n=i.top},h=function(e,i,t,s,n){return i.translate(.5,.5),i.lineWidth=1,i.drawImage(t,5,5,s-10,n-10),i.beginPath(),i.rect(5,5,s-10,n-10),i.stroke(),i.beginPath(),i.fillStyle="rgb(255, 255, 255)",i.rect(s-10,n-10,9,9),i.fill(),i.stroke(),o(e),i}; +// necessary to correctly print cursor over square. Called once for instance. Useless with trumbowyg. +this.init=function(){var i=this;e(window).on("scroll resize",(function(){i.reCalcOffset()}))},this.reCalcOffset=function(){o(this.resizeCanvas)},this.canvasId=function(){return this.resizeCanvas.id},this.isActive=function(){return null!==this.resizeImg},this.isFocusedNow=function(){return r},this.blurNow=function(){r=!1},this.reset=function(){null!==this.resizeImg&&(this.resizeImg.setAttribute("style","width: 100%; max-width: "+(this.resizeCanvas.clientWidth-10)+"px; height: auto; max-height: "+(this.resizeCanvas.clientHeight-10)+"px;"),e(this.resizeCanvas).replaceWith(e(this.resizeImg)),this.resizeCanvas.removeAttribute("style"),this.resizeImg=null)},this.setup=function(o,c){if(this.resizeImg=o,!this.resizeCanvas.getContext)return!1;r=!0,this.resizeCanvas.width=e(this.resizeImg).width()+10,this.resizeCanvas.height=e(this.resizeImg).height()+10,this.resizeCanvas.style.margin="-5px",this.ctx=this.resizeCanvas.getContext("2d"),e(this.resizeImg).replaceWith(e(this.resizeCanvas)),h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height),e(this.resizeCanvas).resizableSafe(c).on("mousedown",t);var u=this;return e(this.resizeCanvas).on("mousemove",(function(e){var i=Math.round(e.clientX-s),t=Math.round(e.clientY-n),r=a;u.ctx.rect(u.resizeCanvas.width-10,u.resizeCanvas.height-10,9,9),r!==(a=u.ctx.isPointInPath(i,t))&&(this.style.cursor=a?"se-resize":"default")})).on("keydown",(function(e){if(u.isActive()){var i=e.keyCode;27===i?u.pressEscape(u):8!==i&&46!==i||u.pressBackspaceOrDelete(u)}})).on("focus",t).on("blur",(function(){u.reset(),null!==i&&(i.syncCode(),i.$c.trigger("tbwchange"))})),this.resizeCanvas.focus(),!0},this.refresh=function(){this.resizeCanvas.getContext&&(this.resizeCanvas.width=this.resizeCanvas.clientWidth,this.resizeCanvas.height=this.resizeCanvas.clientHeight,h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height))}};e.extend(!0,e.trumbowyg,{plugins:{resizimg:{destroyResizable:function(){},init:function(n){var r=this.destroyResizable,a=new s(n);function o(){n.$ed.find("img").off("click").on("click",(function(e){a.isActive()&&a.reset(),a.setup(this,n.o.plugins.resizimg.resizable),t(e)}))}this.destroyResizable=function(){n.$ed.find("canvas.resizable").resizableSafe("destroy").off("mousedown",t).removeClass("resizable"),a.reset(),n.syncCode()},n.o.plugins.resizimg=e.extend(!0,{},i,n.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var t=n.o.plugins.resizimg,s=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(s' + v.modal + ' (' + v.rubyText + ')')[0]; + trumbowyg.range.deleteContents(); + trumbowyg.range.insertNode(node); + trumbowyg.syncCode(); + trumbowyg.$c.trigger('tbwchange'); + return true; + } + ); + } + }; + trumbowyg.addBtnDef('ruby', btnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/ruby/trumbowyg.ruby.min.js b/dist/plugins/ruby/trumbowyg.ruby.min.js new file mode 100644 index 000000000..239d3aa09 --- /dev/null +++ b/dist/plugins/ruby/trumbowyg.ruby.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * trumbowyg.ruby.js v1.0 + * Ruby text plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Fathi Anshory (0x00000F5C) + * Twitter : @fscchannl + * Comment : Since I use trumbowyg in my project and required it to insert ruby text, so I thought I can contribute a little. :D + */ +!function(u){"use strict";u.extend(!0,u.trumbowyg,{langs:{en:{ruby:"Add ruby text",rubyModal:"Ruby modal",rubyText:"Ruby text"},az:{ruby:"Ruby mətni əlavə et",rubyModal:"Ruby modal",rubyText:"Ruby mətni"},by:{ruby:"Уставіць ruby тэкст",rubyModal:"Ruby анатацыя",rubyText:"Ruby тэкст"},da:{ruby:"Tilføj ruby tekst",rubyModal:"Ruby modal",rubyText:"Ruby tekst"},de:{ruby:"Ruby-Text einfügen",rubyModal:"Ruby-Modal",rubyText:"Ruby-Text"},et:{ruby:"Lisa ruby tekst",rubyModal:"Ruby modaal",rubyText:"Ruby tekst"},fr:{ruby:"Ajouter du texte ruby",rubyModal:"Modale ruby",rubyText:"Texte ruby"},hu:{ruby:"Ruby szöveg hozzáadás",rubyModal:"Ruby modal",rubyText:"Ruby szöveg"},id:{ruby:"Sisipkan teks ruby",rubyModal:"Modal teks ruby",rubyText:"Teks ruby"},ko:{ruby:"루비 문자 넣기",rubyModal:"대상 문자",rubyText:"루비 문자"},pt_br:{ruby:"Adicionar texto ruby",rubyModal:"Modal ruby",rubyText:"Texto ruby"},ru:{ruby:"Вставить ruby текст",rubyModal:"Ruby аннотация",rubyText:"Ruby текст"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"},zh_tw:{ruby:"加入 ruby 文字",rubyModal:"Ruby 彈跳視窗",rubyText:"Ruby 文字"}},plugins:{ruby:{init:function(b){var r={fn:function(){b.saveRange(),b.openModalInsert(b.lang.ruby,{rubyText:{label:b.lang.rubyText,required:!1},modal:{label:b.lang.rubyModal,value:b.getRangeText(),required:!0}},(function(r){var y=u(''+r.modal+" ("+r.rubyText+")")[0];return b.range.deleteContents(),b.range.insertNode(y),b.syncCode(),b.$c.trigger("tbwchange"),!0}))}};b.addBtnDef("ruby",r)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/specialchars/trumbowyg.specialchars.js b/dist/plugins/specialchars/trumbowyg.specialchars.js new file mode 100644 index 000000000..c0ed63876 --- /dev/null +++ b/dist/plugins/specialchars/trumbowyg.specialchars.js @@ -0,0 +1,103 @@ +/* =========================================================== + * trumbowyg.specialchars.js v0.99 + * Unicode characters picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Renaud Hoyoux (geektortoise) +*/ + +(function ($) { + 'use strict'; + + var defaultOptions = { + symbolList: [ + // currencies + '0024', '20AC', '00A3', '00A2', '00A5', '00A4', '2030', null, + // legal signs + '00A9', '00AE', '2122', null, + // textual sign + '00A7', '00B6', '00C6', '00E6', '0152', '0153', null, + '2022', '25CF', '2023', '25B6', '2B29', '25C6', null, + //maths + '00B1', '00D7', '00F7', '21D2', '21D4', '220F', '2211', '2243', '2264', '2265' + ] + }; + + $.extend(true, $.trumbowyg, { + langs: { + en: { + specialChars: 'Special characters' + }, + az: { + specialChars: 'Xüsusi simvollar' + }, + by: { + specialChars: 'Спецыяльныя сімвалы' + }, + de: { + specialChars: 'Spezialzeichen' + }, + et: { + specialChars: 'Erimärgid' + }, + fr: { + specialChars: 'Caractères spéciaux' + }, + hu: { + specialChars: 'Speciális karakterek' + }, + ko: { + specialChars: '특수문자' + }, + ru: { + specialChars: 'Специальные символы' + }, + sl: { + specialChars: 'Posebni znaki' + }, + tr: { + specialChars: 'Özel karakterler' + }, + }, + plugins: { + specialchars: { + init: function (trumbowyg) { + trumbowyg.o.plugins.specialchars = trumbowyg.o.plugins.specialchars || defaultOptions; + var specialCharsBtnDef = { + dropdown: buildDropdown(trumbowyg) + }; + + trumbowyg.addBtnDef('specialChars', specialCharsBtnDef); + } + } + } + }); + + function buildDropdown(trumbowyg) { + var dropdown = []; + $.each(trumbowyg.o.plugins.specialchars.symbolList, function (i, symbol) { + if (symbol === null) { + symbol = ' '; + } else { + symbol = '&#x' + symbol; + } + + var btn = symbol.replace(/:/g, ''), + defaultSymbolBtnName = 'symbol-' + btn, + defaultSymbolBtnDef = { + text: symbol, + hasIcon: false, + fn: function () { + var encodedSymbol = String.fromCodePoint(parseInt(symbol.replace('&#', '0'))); + trumbowyg.execCmd('insertText', encodedSymbol); + return true; + } + }; + + trumbowyg.addBtnDef(defaultSymbolBtnName, defaultSymbolBtnDef); + dropdown.push(defaultSymbolBtnName); + }); + + return dropdown; + } +})(jQuery); diff --git a/dist/plugins/specialchars/trumbowyg.specialchars.min.js b/dist/plugins/specialchars/trumbowyg.specialchars.min.js new file mode 100644 index 000000000..a1c0a0c80 --- /dev/null +++ b/dist/plugins/specialchars/trumbowyg.specialchars.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * trumbowyg.specialchars.js v0.99 + * Unicode characters picker plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Renaud Hoyoux (geektortoise) +*/ +!function(a){"use strict";var s={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};function e(s){var e=[];return a.each(s.o.plugins.specialchars.symbolList,(function(a,r){var i="symbol-"+(r=null===r?" ":"&#x"+r).replace(/:/g,""),l={text:r,hasIcon:!1,fn:function(){var a=String.fromCodePoint(parseInt(r.replace("&#","0")));return s.execCmd("insertText",a),!0}};s.addBtnDef(i,l),e.push(i)})),e}a.extend(!0,a.trumbowyg,{langs:{en:{specialChars:"Special characters"},az:{specialChars:"Xüsusi simvollar"},by:{specialChars:"Спецыяльныя сімвалы"},de:{specialChars:"Spezialzeichen"},et:{specialChars:"Erimärgid"},fr:{specialChars:"Caractères spéciaux"},hu:{specialChars:"Speciális karakterek"},ko:{specialChars:"특수문자"},ru:{specialChars:"Специальные символы"},sl:{specialChars:"Posebni znaki"},tr:{specialChars:"Özel karakterler"}},plugins:{specialchars:{init:function(a){a.o.plugins.specialchars=a.o.plugins.specialchars||s;var r={dropdown:e(a)};a.addBtnDef("specialChars",r)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss new file mode 100644 index 000000000..b6eddc802 --- /dev/null +++ b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss @@ -0,0 +1,56 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-symbol-\ -dropdown-button { + display: none !important; +} +.trumbowyg-symbol-\ -dropdown-button + button { + clear: both; +} + +.trumbowyg-dropdown-specialChars { + width: 248px; + padding: 5px 3px 3px; +} + +.trumbowyg-dropdown-specialChars button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; + + &:hover, + &:focus { + &::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; + } + } +} + +.trumbowyg .specialChars { + width: 22px; + height: 22px; + display: inline-block; +} diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css new file mode 100644 index 000000000..4ea4dd46b --- /dev/null +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css @@ -0,0 +1,54 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-symbol-\ -dropdown-button { + display: none !important; +} + +.trumbowyg-symbol-\ -dropdown-button + button { + clear: both; +} + +.trumbowyg-dropdown-specialChars { + width: 248px; + padding: 5px 3px 3px; +} + +.trumbowyg-dropdown-specialChars button { + display: block; + position: relative; + float: left; + height: 26px; + width: 26px; + padding: 0; + margin: 2px; + line-height: 24px; + text-align: center; +} +.trumbowyg-dropdown-specialChars button:hover::after, .trumbowyg-dropdown-specialChars button:focus::after { + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 27px; + width: 27px; + background: inherit; + -webkit-box-shadow: #000 0 0 2px; + box-shadow: #000 0 0 2px; + z-index: 10; + background-color: transparent; +} + +.trumbowyg .specialChars { + width: 22px; + height: 22px; + display: inline-block; +} \ No newline at end of file diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css new file mode 100644 index 000000000..8d74d8a25 --- /dev/null +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-symbol-\ -dropdown-button{display:none!important}.trumbowyg-symbol-\ -dropdown-button+button{clear:both}.trumbowyg-dropdown-specialChars{width:248px;padding:5px 3px 3px}.trumbowyg-dropdown-specialChars button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-specialChars button:focus::after,.trumbowyg-dropdown-specialChars button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .specialChars{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/speechrecognition/trumbowyg.speechrecognition.js b/dist/plugins/speechrecognition/trumbowyg.speechrecognition.js new file mode 100644 index 000000000..143635b5f --- /dev/null +++ b/dist/plugins/speechrecognition/trumbowyg.speechrecognition.js @@ -0,0 +1,198 @@ +/* =========================================================== + * trumbowyg.speechrecognition.js v1.0 + * Speech recognition plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : + * - Tobias Rohde + * - Alexandre Demode (Alex-D) + * Website : tobiasrohde.de + */ +(function ($) { + 'use strict'; + + const defaultOptions = { + lang: 'en-US' + }; + + const SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition; + + function buildButtonDef(trumbowyg) { + let btnElement = null; + let isRecognizing = false; + let $resultTextParagraph = null; + + const recognition = new SpeechRecognition(); + + recognition.continuous = true; + recognition.interimResults = true; + recognition.maxAlternatives = 1; // We only read the first + + recognition.onstart = function () { + isRecognizing = true; + btnElement.style.color = '#e71d36'; + }; + + recognition.onerror = function () { + isRecognizing = false; + btnElement.style.removeProperty('color'); + }; + + recognition.onend = function () { + isRecognizing = false; + btnElement.style.removeProperty('color'); + }; + + recognition.onresult = function (event) { + const resultText = [...event.results].map((result) => { + return result[0].transcript + (result.isFinal ? '
' : ''); + }).join(''); + $resultTextParagraph.html(resultText); + trumbowyg.range.setEndAfter($resultTextParagraph[0]); + trumbowyg.range.collapse(); + trumbowyg.syncCode(); + }; + + return { + isSupported, + fn: function () { + if (isRecognizing) { + recognition.stop(); + return; + } + + // Get the actual button to allow to switch his color + btnElement = trumbowyg.$btnPane.find('.' + trumbowyg.o.prefix + 'speechrecognition-button svg')[0]; + + // Create a container if needed in which we will put the recognized text + trumbowyg.$ed.focus(); + setTimeout(() => { + trumbowyg.saveRange(); + if ( + trumbowyg.range.startContainer === trumbowyg.range.endContainer && + trumbowyg.range.startContainer.nodeName === 'P' && + trumbowyg.range.startContainer.innerText.trim() === '' + ) { + $resultTextParagraph = $(trumbowyg.range.startContainer); + } else { + $resultTextParagraph = $('

'); + trumbowyg.range.deleteContents(); + trumbowyg.range.insertNode($resultTextParagraph[0]); + } + + // Set up the recognition + recognition.lang = trumbowyg.o.plugins.speechRecognition.lang; + recognition.start(); + }); + } + }; + } + + function isSupported() { + return SpeechRecognition !== undefined; + } + + + $.extend(true, $.trumbowyg, { + langs: { + az: { + speechRecognition: 'Nitqin tanınması' + }, + bg: { + speechRecognition: 'Разпознаване на реч' + }, + by: { + speechRecognition: 'Распазнаванне маўлення' + }, + ca: { + speechRecognition: 'Reconeixement de veu' + }, + cs: { + speechRecognition: 'Rozpoznávání řeči' + }, + da: { + speechRecognition: 'Talegenkendelse' + }, + de: { + speechRecognition: 'Spracherkennung' + }, + el: { + speechRecognition: 'Αναγνώριση ομιλίας' + }, + en: { + speechRecognition: 'Speech recognition' + }, + es: { + speechRecognition: 'Reconocimiento de voz' + }, + et: { + speechRecognition: 'Kõnetuvastus' + }, + fi: { + speechRecognition: 'Puheentunnistus' + }, + fr: { + speechRecognition: 'Reconnaissance vocale' + }, + hr: { + speechRecognition: 'Prepoznavanje govora' + }, + hu: { + speechRecognition: 'Beszédfelismerés' + }, + it: { + speechRecognition: 'Riconoscimento vocale' + }, + lt: { + speechRecognition: 'Kalbos atpažinimas' + }, + nb: { + speechRecognition: 'Talegjenkjenning' + }, + nl: { + speechRecognition: 'Spraakherkenning' + }, + pl: { + speechRecognition: 'Rozpoznawanie mowy' + }, + pt: { + speechRecognition: 'Reconhecimento de voz' + }, + ro: { + speechRecognition: 'Recunoașterea vorbirii' + }, + rs: { + speechRecognition: 'Препознавање говора' + }, + ru: { + speechRecognition: 'Распознавание речи' + }, + sk: { + speechRecognition: 'Rozpoznávanie reči' + }, + sq: { + speechRecognition: 'Njohja e të folurit' + }, + sv: { + speechRecognition: 'Taligenkänning' + }, + ua: { + speechRecognition: 'Розпізнавання мови' + } + }, + + plugins: { + speechRecognition: { + shouldInit: isSupported, + init: function (trumbowyg) { + trumbowyg.o.plugins.speechRecognition = $.extend(true, {}, + defaultOptions, + trumbowyg.o.plugins.speechRecognition || {} + ); + + trumbowyg.addBtnDef('speechrecognition', buildButtonDef(trumbowyg)); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/speechrecognition/trumbowyg.speechrecognition.min.js b/dist/plugins/speechrecognition/trumbowyg.speechrecognition.min.js new file mode 100644 index 000000000..1e639a1c9 --- /dev/null +++ b/dist/plugins/speechrecognition/trumbowyg.speechrecognition.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * trumbowyg.speechrecognition.js v1.0 + * Speech recognition plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Authors : + * - Tobias Rohde + * - Alexandre Demode (Alex-D) + * Website : tobiasrohde.de + */ +!function(e){"use strict";const n={lang:"en-US"},o=window.webkitSpeechRecognition||window.SpeechRecognition;function i(){return void 0!==o}e.extend(!0,e.trumbowyg,{langs:{az:{speechRecognition:"Nitqin tanınması"},bg:{speechRecognition:"Разпознаване на реч"},by:{speechRecognition:"Распазнаванне маўлення"},ca:{speechRecognition:"Reconeixement de veu"},cs:{speechRecognition:"Rozpoznávání řeči"},da:{speechRecognition:"Talegenkendelse"},de:{speechRecognition:"Spracherkennung"},el:{speechRecognition:"Αναγνώριση ομιλίας"},en:{speechRecognition:"Speech recognition"},es:{speechRecognition:"Reconocimiento de voz"},et:{speechRecognition:"Kõnetuvastus"},fi:{speechRecognition:"Puheentunnistus"},fr:{speechRecognition:"Reconnaissance vocale"},hr:{speechRecognition:"Prepoznavanje govora"},hu:{speechRecognition:"Beszédfelismerés"},it:{speechRecognition:"Riconoscimento vocale"},lt:{speechRecognition:"Kalbos atpažinimas"},nb:{speechRecognition:"Talegjenkjenning"},nl:{speechRecognition:"Spraakherkenning"},pl:{speechRecognition:"Rozpoznawanie mowy"},pt:{speechRecognition:"Reconhecimento de voz"},ro:{speechRecognition:"Recunoașterea vorbirii"},rs:{speechRecognition:"Препознавање говора"},ru:{speechRecognition:"Распознавание речи"},sk:{speechRecognition:"Rozpoznávanie reči"},sq:{speechRecognition:"Njohja e të folurit"},sv:{speechRecognition:"Taligenkänning"},ua:{speechRecognition:"Розпізнавання мови"}},plugins:{speechRecognition:{shouldInit:i,init:function(t){t.o.plugins.speechRecognition=e.extend(!0,{},n,t.o.plugins.speechRecognition||{}),t.addBtnDef("speechrecognition",function(n){let t=null,c=!1,s=null;const r=new o;return r.continuous=!0,r.interimResults=!0,r.maxAlternatives=1,r.onstart=function(){c=!0,t.style.color="#e71d36"},r.onerror=function(){c=!1,t.style.removeProperty("color")},r.onend=function(){c=!1,t.style.removeProperty("color")},r.onresult=function(e){const o=[...e.results].map((e=>e[0].transcript+(e.isFinal?"
":""))).join("");s.html(o),n.range.setEndAfter(s[0]),n.range.collapse(),n.syncCode()},{isSupported:i,fn:function(){c?r.stop():(t=n.$btnPane.find("."+n.o.prefix+"speechrecognition-button svg")[0],n.$ed.focus(),setTimeout((()=>{n.saveRange(),n.range.startContainer===n.range.endContainer&&"P"===n.range.startContainer.nodeName&&""===n.range.startContainer.innerText.trim()?s=e(n.range.startContainer):(s=e("

"),n.range.deleteContents(),n.range.insertNode(s[0])),r.lang=n.o.plugins.speechRecognition.lang,r.start()})))}}}(t))}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/table/trumbowyg.table.js b/dist/plugins/table/trumbowyg.table.js new file mode 100644 index 000000000..d96fc4c8c --- /dev/null +++ b/dist/plugins/table/trumbowyg.table.js @@ -0,0 +1,1732 @@ +/* =========================================================== + * trumbowyg.table.js v3.0 + * Table plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Original Author : Sven Dunemann [dunemann@forelabs.eu] + */ + +(function ($) { + 'use strict'; + + // Throttle helper + function trumbowygThrottle(callback, delay) { + var last; + var timer; + + return function () { + var context = this; + var now = new Date().getTime(); + var args = arguments; + + if (last && now < last + delay) { + clearTimeout(timer); + timer = setTimeout(function () { + last = now; + callback.apply(context, args); + }, delay); + return; + } + + last = now; + callback.apply(context, args); + }; + } + + var defaultOptions = { + rows: 8, + columns: 8, + allowHorizontalResize: true, + colorList: [ + 'ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00', + 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca', + 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694', + 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314', + 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100', + '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000' + ], + backgroundColorList: null, // fallbacks on colorList + allowCustomBackgroundColor: true, + displayBackgroundColorsAsList: false, + borderColorList: null, // fallbacks on colorList + allowCustomBorderColor: true, + displayBorderColorsAsList: false, + dropdown: [ + { + title: 'tableRows', + buttons: [ + 'tableAddHeaderRow', + 'tableAddRowAbove', + 'tableAddRow', + 'tableDeleteRow', + ], + }, + { + title: 'tableColumns', + buttons: [ + 'tableAddColumnLeft', + 'tableAddColumn', + 'tableDeleteColumn', + ], + }, + { + title: 'tableVerticalAlign', + buttons: [ + 'tableVerticalAlignTop', + 'tableVerticalAlignMiddle', + 'tableVerticalAlignBottom', + ], + }, + { + title: 'tableOthers', + buttons: [ + // Cell merge/split + 'tableMergeCells', + 'tableUnmergeCells', + 'tableDestroy', + ] + } + ], + }; + + function ucFirst(value) { + return value[0].toUpperCase() + value.slice(1); + } + + function hex(x) { + return ('0' + parseInt(x).toString(16)).slice(-2); + } + + function colorToHex(rgb) { + if (rgb.search('rgb') === -1) { + return rgb.replace('#', ''); + } else if (rgb === 'rgba(0, 0, 0, 0)') { + return 'transparent'; + } else { + rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/); + if (rgb == null) { + return 'transparent'; // No match, return transparent as unkown color + } + return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); + } + } + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + table: 'Insert table', + tableRows: 'Rows', + tableColumns: 'Columns', + tableVerticalAlign: 'Vertical align', + tableOthers: 'Others', + tableAddHeaderRow: 'Insert head row', + tableAddRowAbove: 'Insert row above', + tableAddRow: 'Insert row below', + tableAddColumnLeft: 'Insert column to the left', + tableAddColumn: 'Insert column to the right', + tableDeleteRow: 'Delete row', + tableDeleteColumn: 'Delete column', + tableDestroy: 'Delete table', + tableMergeCells: 'Merge cells', + tableUnmergeCells: 'Unmerge cells', + tableVerticalAlignTop: 'Align text to top', + tableVerticalAlignMiddle: 'Center text vertically', + tableVerticalAlignBottom: 'Align text to bottom', + tableCellBackgroundColor: 'Cell background color', + tableBorderColor: 'Table border color' + }, + az: { + table: 'Cədvəl yerləşdir', + tableAddRow: 'Sətir əlavə et', + tableAddRowAbove: 'Yuxarı sətir əlavə et', + tableAddColumnLeft: 'Sola sütun əlavə et', + tableAddColumn: 'Sağa sütun əlavə et', + tableDeleteRow: 'Sətri sil', + tableDeleteColumn: 'Sütunu sil', + tableDestroy: 'Cədvəli sil', + }, + ca: { + table: 'Inserir taula', + tableAddRow: 'Afegir fila', + tableAddRowAbove: 'Afegir fila a dalt', + tableAddColumnLeft: 'Afegir columna a l\'esquerra', + tableAddColumn: 'Afegir columna a la dreta', + tableDeleteRow: 'Esborrar fila', + tableDeleteColumn: 'Esborrar columna', + tableDestroy: 'Esborrar taula', + error: 'Error' + }, + cs: { + table: 'Vytvořit příkaz Table', + tableAddRow: 'Přidat řádek', + tableAddRowAbove: 'Přidat řádek', + tableAddColumnLeft: 'Přidat sloupec', + tableAddColumn: 'Přidat sloupec', + }, + da: { + table: 'Indsæt tabel', + tableAddRow: 'Tilføj række', + tableAddRowAbove: 'Tilføj række', + tableAddColumnLeft: 'Tilføj kolonne', + tableAddColumn: 'Tilføj kolonne', + tableDeleteRow: 'Slet række', + tableDeleteColumn: 'Slet kolonne', + tableDestroy: 'Slet tabel', + }, + de: { + table: 'Tabelle einfügen', + tableRows: 'Zeilen', + tableColumns: 'Spalten', + tableVerticalAlign: 'Vertikal ausrichten', + tableOthers: 'Andere', + tableAddHeaderRow: 'Kopfzeile einfügen', + tableAddRowAbove: 'Zeile oberhalb einfügen', + tableAddRow: 'Zeile unterhalb einfügen', + tableAddColumnLeft: 'Spalte links einfügen', + tableAddColumn: 'Spalte rechts einfügen', + tableDeleteRow: 'Zeile löschen', + tableDeleteColumn: 'Spalte löschen', + tableDestroy: 'Tabelle löschen', + tableMergeCells: 'Zellen zusammenführen', + tableUnmergeCells: 'Zellen trennen', + tableVerticalAlignTop: 'Text nach oben ausrichten', + tableVerticalAlignMiddle: 'Text vertikal zentrieren', + tableVerticalAlignBottom: 'Text nach unten ausrichten', + tableCellBackgroundColor: 'Hintergrundfarbe der Zelle', + tableBorderColor: 'Farbe des Tabellenrahmens' + }, + et: { + table: 'Sisesta tabel', + tableAddRow: 'Lisa rida', + tableAddRowAbove: 'Lisa rida üles', + tableAddColumnLeft: 'Lisa tulp vasakule', + tableAddColumn: 'Lisa tulp paremale', + tableDeleteRow: 'Kustuta rida', + tableDeleteColumn: 'Kustuta tulp', + tableDestroy: 'Kustuta tabel', + }, + fr: { + table: 'Insérer un tableau', + tableRows: 'Lignes', + tableColumns: 'Colonnes', + tableVerticalAlign: 'Alignement vertical', + tableOthers: 'Autres', + tableAddHeaderRow: 'Insérer une line d\'en-tête', + tableAddRowAbove: 'Insérer une ligne au dessus', + tableAddRow: 'Insérer une ligne en dessous', + tableAddColumnLeft: 'Insérer une colonne à gauche', + tableAddColumn: 'Insérer une colonne à droite', + tableDeleteRow: 'Supprimer la ligne', + tableDeleteColumn: 'Supprimer la colonne', + tableDestroy: 'Supprimer le tableau', + tableMergeCells: 'Fusionner les cellules', + tableUnmergeCells: 'Dissocier les cellules', + tableVerticalAlignTop: 'Aligner en haut', + tableVerticalAlignMiddle: 'Aligner au milieu', + tableVerticalAlignBottom: 'Aligner en bas', + tableCellBackgroundColor: 'Couleur de fond des cellules', + tableBorderColor: 'Couleur de la bordure du tableau' + }, + hu: { + table: 'Táblázat beszúrás', + tableAddRow: 'Sor hozzáadás', + tableAddRowAbove: 'Sor beszúrás fönt', + tableAddColumnLeft: 'Sor beszúrás balra', + tableAddColumn: 'Sor beszúrás jobbra', + tableDeleteRow: 'Sor törlés', + tableDeleteColumn: 'Oszlop törlés', + tableDestroy: 'Táblázat törlés', + }, + id: { + table: 'Sisipkan tabel', + tableAddRow: 'Sisipkan baris', + tableAddRowAbove: 'Sisipkan baris', + tableAddColumnLeft: 'Sisipkan kolom', + tableAddColumn: 'Sisipkan kolom', + tableDeleteRow: 'Hapus baris', + tableDeleteColumn: 'Hapus kolom', + tableDestroy: 'Hapus tabel', + }, + ja: { + table: '表の挿入', + tableAddRow: '行の追加', + tableAddRowAbove: '行の追加', + tableAddColumnLeft: '列の追加', + tableAddColumn: '列の追加', + }, + ko: { + table: '표 넣기', + tableAddRow: '줄 추가', + tableAddRowAbove: '줄 추가', + tableAddColumnLeft: '칸 추가', + tableAddColumn: '칸 추가', + tableDeleteRow: '줄 삭제', + tableDeleteColumn: '칸 삭제', + tableDestroy: '표 지우기', + }, + pt_br: { + table: 'Inserir tabela', + tableRows: 'Linhas', + tableColumns: 'Colunas', + tableVerticalAlign: 'Alinhamento', + tableOthers: 'Outros', + tableAddHeaderRow: 'Inserir cabeçalho', + tableAddRowAbove: 'Inserir linha', + tableAddRow: 'Inserir linha', + tableAddColumnLeft: 'Inserir coluna', + tableAddColumn: 'Inserir coluna', + tableDeleteRow: 'Excluir linha', + tableDeleteColumn: 'Excluir coluna', + tableDestroy: 'Excluir tabela', + tableMergeCells: 'Mesclar células', + tableUnmergeCells: 'Dividir células', + tableVerticalAlignTop: 'Alinhar acima', + tableVerticalAlignMiddle: 'Alinhar ao centro', + tableVerticalAlignBottom: 'Alinhar abaixo', + tableCellBackgroundColor: 'Cor da célula', + tableBorderColor: 'Cor da borda da tabela' + }, + ru: { + table: 'Вставить таблицу', + tableAddRow: 'Добавить строку', + tableAddRowAbove: 'Добавить строку', + tableAddColumnLeft: 'Добавить столбец', + tableAddColumn: 'Добавить столбец', + tableDeleteRow: 'Удалить строку', + tableDeleteColumn: 'Удалить столбец', + tableDestroy: 'Удалить таблицу', + }, + sl: { + table: 'Dodaj tabelo', + tableAddRow: 'Dodaj vrstico', + tableAddRowAbove: 'Vrini vrstico', + tableAddColumnLeft: 'Vrini stolpec', + tableAddColumn: 'Dodaj stolpec', + tableDeleteRow: 'Izbriši vrstico', + tableDeleteColumn: 'Izbriši stolpec', + tableDestroy: 'Izbriši tabelo', + }, + sk: { + table: 'Vytvoriť tabuľky', + tableAddRow: 'Pridať riadok', + tableAddRowAbove: 'Pridať riadok', + tableAddColumnLeft: 'Pridať stĺpec', + tableAddColumn: 'Pridať stĺpec', + }, + tr: { + table: 'Tablo ekle', + tableAddRow: 'Satır ekle', + tableAddRowAbove: 'Yukarıya satır ekle', + tableAddColumnLeft: 'Sola sütun ekle', + tableAddColumn: 'Sağa sütun ekle', + tableDeleteRow: 'Satırı sil', + tableDeleteColumn: 'Sütunu sil', + tableDestroy: 'Tabloyu sil', + }, + zh_tw: { + table: '插入表格', + tableAddRow: '加入行', + tableAddRowAbove: '加入行', + tableAddColumnLeft: '加入列', + tableAddColumn: '加入列', + tableDeleteRow: '刪除行', + tableDeleteColumn: '刪除列', + tableDestroy: '刪除表格', + }, + es: { + table: 'Insertar tabla', + tableAddRow: 'Agregar fila', + tableAddRowAbove: 'Agregar fila arriba', + tableAddColumnLeft: 'Agregar columna a la izquierda', + tableAddColumn: 'Agregar columna a la derecha', + tableDeleteRow: 'Borrar fila', + tableDeleteColumn: 'Borrar columna', + tableDestroy: 'Borrar tabla', + }// jshint camelcase:true + }, + + plugins: { + table: { + // jshint maxstatements:false + init: function (t) { + t.o.plugins.table = $.extend(true, {}, defaultOptions, t.o.plugins.table || {}); + + // State + var tableSelectedCells; + + //////////////////////////////////////////////////// + // Dropdown + + var buildButtonDef = { + fn: function () { + t.saveRange(); + + var btnName = 'table'; + + var dropdownPrefix = t.o.prefix + 'dropdown', + dropdownOptions = { // the dropdown + class: dropdownPrefix + '-' + btnName + ' ' + dropdownPrefix + ' ' + t.o.prefix + 'fixed-top' + }; + dropdownOptions['data-' + dropdownPrefix] = btnName; + var $dropdown = $('

', dropdownOptions); + + if (t.$box.find('.' + dropdownPrefix + '-' + btnName).length === 0) { + t.$box.append($dropdown.hide()); + } else { + $dropdown = t.$box.find('.' + dropdownPrefix + '-' + btnName); + } + + // clear dropdown + $dropdown.html(''); + + // when active table show AddRow / AddColumn + if (t.$box.find('.' + t.o.prefix + 'table-button').hasClass(t.o.prefix + 'active-button')) { + var $table = $(t.doc.getSelection().anchorNode).closest('table', t.$ed[0]); + var tableState = getTableState($table); + var hasSelectedCells = tableSelectedCells !== undefined; + $(t.o.plugins.table.dropdown).each(function (_, buttonGroup) { + $dropdown.append($('
', { + html: t.lang[buttonGroup.title] ? t.lang[buttonGroup.title] : buttonGroup.title, + class: t.o.prefix + 'table-dropdown-title' + })).text(); + var $buttonGroup = $('
', { + class: t.o.prefix + 'dropdown-button-group' + }); + + $(buttonGroup.buttons).each(function (_, buttonName) { + // Conditional thead button + if (buttonName === 'tableAddHeaderRow') { + var hasThead = $('thead', $table).length !== 0; + if (hasThead) { + return; + } + } + + // Conditional merge button + if (buttonName === 'tableMergeCells' && !hasSelectedCells) { + return; + } + + // Conditional unmerge button + if (buttonName === 'tableUnmergeCells') { + var hasAtLeastOneMergedCell = false; + foreachSelectedCell(function ($cell) { + var isMergedCell = $cell.is('[colspan]') || $cell.is('[rowspan]'); + hasAtLeastOneMergedCell = hasAtLeastOneMergedCell || isMergedCell; + }, tableState); + if (!hasAtLeastOneMergedCell) { + return; + } + } + + $buttonGroup.append(t.buildSubBtn(buttonName)); + }); + + $dropdown.append($buttonGroup); + }); + } else { + var $tableSelect = $(''); + $('').appendTo($tableSelect); + for (var i = 0; i < t.o.plugins.table.rows; i += 1) { + var row = $('').appendTo($tableSelect); + for (var j = 0; j < t.o.plugins.table.columns; j += 1) { + $('
').appendTo(row); + } + } + $tableSelect.find('td').on('mouseover', toggleActiveDropdownCells); + $tableSelect.find('td').on('mousedown', tableBuild); + + $dropdown.append($tableSelect); + $dropdown.append($('
1x1
')); + } + + t.dropdown(btnName); + }, + class: t.o.prefix + 'open-dropdown' + }; + + var toggleActiveDropdownCells = function (columnEvent) { + var column = $(columnEvent.target), + table = column.closest('table', t.$ed[0]), + colIndex = this.cellIndex, + rowIndex = this.parentNode.rowIndex; + + // reset all columns + table.find('td').removeClass('active'); + + for (var i = 0; i <= rowIndex; i += 1) { + for (var j = 0; j <= colIndex; j += 1) { + table.find('tr:nth-of-type(' + (i + 1) + ')').find('td:nth-of-type(' + (j + 1) + ')').addClass('active'); + } + } + + // set label + table.next('.trumbowyg-table-size').html((colIndex + 1) + 'x' + (rowIndex + 1)); + }; + + var applyTagClassesToElement = function (element) { + var tagClasses = t.o.tagClasses[element.tagName.toLowerCase()]; + if (!tagClasses) { + return; + } + $(element).addClass(tagClasses); + }; + var applyTagClasses = function ($table) { + applyTagClassesToElement($table[0]); + $('*', $table).each(function (_, element) { + applyTagClassesToElement(element); + }); + }; + var tableBuild = function () { + t.saveRange(); + + var $newTable = $(''); + + // Build thead + var $thead = $(''); + var $theadTr = $(''); + $theadTr.appendTo($thead); + for (var th = 0; th <= this.cellIndex; th += 1) { + $(''); + + var colIndex = this.cellIndex, + rowIndex = this.parentNode.rowIndex; + + for (var i = 0; i <= rowIndex; i += 1) { + var row = $('').appendTo($tbody); + for (var j = 0; j <= colIndex; j += 1) { + $(''); + + // Shift one row before if insert before + var focusedRowIndex = $rows.index($focusedRow); + if (isBefore) { + focusedRowIndex = Math.max(0, focusedRowIndex - 1); + $focusedRow = $($rows[focusedRowIndex]); + } else { + var rawCellRowspan = $(node).closest('td, th', t.$ed[0]).attr('rowspan'); + var cellRowspan = parseInt(rawCellRowspan ? rawCellRowspan : 1, 10); + focusedRowIndex += cellRowspan - 1; + $focusedRow = $($rows[focusedRowIndex]); + } + + // Cannot add line to thead, so move to first tbody row + var $tbodyRows = $('tbody tr', $table); + var isFocusInHead = $focusedRow.closest('thead').length !== 0; + if (isFocusInHead) { + $focusedRow = $tbodyRows.first(); + } + + // add columns according to current columns count + var focusedRowState = tableState[focusedRowIndex]; + var nextRowState = tableState[focusedRowIndex + 1]; + var columnCount = tableState[0].length; + for (var columnIndex = 0; columnIndex < columnCount; columnIndex += 1) { + if (nextRowState !== undefined) { + var originCellState = focusedRowState[columnIndex]; + var originCellMergedInState = getCellState(tableState, originCellState.mergedIn); + var nextCellState = nextRowState[columnIndex]; + var nextCellMergedInState = getCellState(tableState, nextCellState.mergedIn); + + var realOriginCellState = originCellState.element ? originCellState : originCellMergedInState; + var originCellElement = realOriginCellState.element; + var nextCellElement = nextCellState.element ? nextCellState.element : nextCellMergedInState.element; + + if (originCellElement === nextCellElement) { + originCellElement.setAttribute('rowspan', realOriginCellState.rowspan + 1); + + continue; + } + } + + $(''); + var $theadRow = $('').appendTo($thead); + + // add columns according to current columns count + for (var columnIndex = 0; columnIndex < columnCount; columnIndex += 1) { + $('').prependTo($table); + } + + var columnCount = tableState[0].length; + var currentColCount = $('col', $colgroup).length; + for (; currentColCount < columnCount; currentColCount += 1) { + $('').appendTo($colgroup); + } + }; + + var findFirstCellAtIndex = function (tableState, cellIndex) { + var cellState; + var rowIndex = 0; + do { + cellState = tableState[rowIndex][cellIndex]; + rowIndex += 1; + } while (cellState.element === undefined || cellState.colspan !== 1); + + return cellState; + }; + + var setColWidths = function ($table, tableState, isUnitPercent = false) { + var $colgroup = $('colgroup', $table); + var $cols = $('col', $colgroup); + var tableWidth = Math.ceil($table[0].getBoundingClientRect().width); + $table.css({ + maxWidth: tableWidth, + }); + + var columnCount = tableState[0].length; + var colWidths = []; + for (var columnIndex = 0; columnIndex < columnCount; columnIndex += 1) { + var cellElement = findFirstCellAtIndex(tableState, columnIndex).element; + var cellWidth = cellElement.getBoundingClientRect().width; + + if (isUnitPercent) { + cellWidth = ((cellWidth / tableWidth) * 100) + '%'; + } + + colWidths[columnIndex] = cellWidth; + } + + for (var colIndex = 0; colIndex < columnCount; colIndex += 1) { + $($cols[colIndex]).css({ + width: colWidths[colIndex], + }); + } + }; + + var setColWidthInPixels = function ($table, tableState) { + setColWidths($table, tableState, false); + }; + + var setColWidthInPercents = function ($table, tableState) { + setColWidths($table, tableState, true); + }; + + var redrawResizeLayers = trumbowygThrottle(function () { + var $resizeLayers = $('.' + t.o.prefix + 'table-resize-layers', t.$edBox); + + var resizeLayersBoundingClientRect = $resizeLayers[0].getBoundingClientRect(); + var resizeLayersTop = resizeLayersBoundingClientRect.top; + var resizeLayersLeft = resizeLayersBoundingClientRect.left; + + $('.' + t.o.prefix + 'table-resize-vertical-handle', $resizeLayers).each(function (_, cellHandle) { + var $cellHandle = $(cellHandle); + var cell = $cellHandle.prop(TRUMBOWYG_TABLE_HANDLE_FOR); + var cellBoundingClientRect = cell.getBoundingClientRect(); + $cellHandle.css({ + top: cellBoundingClientRect.top - resizeLayersTop, + left: cellBoundingClientRect.left - resizeLayersLeft + cellBoundingClientRect.width, + height: cellBoundingClientRect.height, + }); + }); + }, 20); + + + ////// Vertical alignment + + var tableVerticalAlign = function (alignPosition) { + return tableButtonAction(function ($table, $focusedRow, node, tableState) { + foreachSelectedCell(function ($cell) { + $cell.css({ + verticalAlign: alignPosition, + }); + }, tableState); + }); + }; + + var verticalAlignTop = { + title: t.lang.tableVerticalAlignTop, + text: t.lang.tableVerticalAlignTop, + ico: 'align-top', + + fn: tableVerticalAlign('top'), + }; + + var verticalAlignMiddle = { + title: t.lang.tableVerticalAlignMiddle, + text: t.lang.tableVerticalAlignMiddle, + ico: 'align-middle', + + fn: tableVerticalAlign('middle'), + }; + + var verticalAlignBottom = { + title: t.lang.tableVerticalAlignBottom, + text: t.lang.tableVerticalAlignBottom, + ico: 'align-bottom', + + fn: tableVerticalAlign('bottom'), + }; + + + ////// Cell Background color + + var getColorDropdownClass = function (mustDisplayAsList) { + return mustDisplayAsList ? t.o.prefix + 'dropdown--color-list' : ''; + }; + + var buildColorDropdown = function (name, colorList, mustDisplayAsList, allowCustomColor, callback) { + var dropdown = []; + var trumbowygTableOptions = t.o.plugins.table; + + $.each(colorList, function (i, color) { + var btn = name + color; + var btnDef = { + fn: callback('#' + color), + hasIcon: false, + text: t.lang['#' + color] || ('#' + color), + style: 'background-color: #' + color + ';' + }; + + t.addBtnDef(btn, btnDef); + dropdown.push(btn); + }); + + // Remove color + var removeColorButtonName = 'remove' + ucFirst(name), + removeColorBtnDef = { + fn: callback(''), + hasIcon: false, + style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);' + }; + + if (mustDisplayAsList) { + removeColorBtnDef.style = ''; + } + + t.addBtnDef(removeColorButtonName, removeColorBtnDef); + dropdown.push(removeColorButtonName); + + // Custom color + if (trumbowygTableOptions.allowCustomBackgroundColor) { + var freeColorBtnDef = { + fn: function () { + t.openModalInsert(t.lang.backgroundColor, + { + color: { + label: 'backgroundColor', + forceCss: true, + type: 'color', + value: '#FFFFFF' + } + }, + // callback + function (values) { + callback(values.color)(); + return true; + } + ); + }, + hasIcon: false, + text: '#', + // style adjust for displaying the text + style: 'text-indent: 0; line-height: 20px; padding: 0 5px;' + }; + + var freeColorButtonName = 'free' + ucFirst(name); + t.addBtnDef(freeColorButtonName, freeColorBtnDef); + dropdown.push(freeColorButtonName); + } + + return dropdown; + }; + var applyBackgroundColorToSelectedCells = function (color) { + return function () { + var $table = $(t.doc.getSelection().anchorNode).closest('table', t.$ed[0]); + + if ($table.length === 0) { + return; + } + + var tableState = getTableState($table); + foreachSelectedCell(function ($cell) { + $cell.css({ + backgroundColor: color, + }); + }, tableState); + + simplifyCells($table); + }; + }; + var cellBackgroundColorBtnDef = { + dropdown: buildColorDropdown( + 'tableCellBackgroundColor', + t.o.plugins.table.backgroundColorList || t.o.plugins.table.colorList, + t.o.plugins.table.displayBackgroundColorsAsList, + t.o.plugins.table.allowCustomBackgroundColor, + applyBackgroundColorToSelectedCells + ), + dropdownClass: getColorDropdownClass(t.o.plugins.table.displayBackgroundColorsAsList), + }; + + + ////// Table border color + + var applyBorderColor = function (color) { + return function () { + var $table = $(t.doc.getSelection().anchorNode).closest('table', t.$ed[0]); + + if ($table.length === 0) { + return; + } + + var border = { + borderColor: color, + }; + if (parseInt($table.css('border-width'), 10) === 0) { + border.borderWidth = '2px'; + border.borderStyle = 'solid'; + } + + if (color === '') { + border.borderWidth = ''; + border.borderStyle = ''; + } + + $table.css(border); + }; + }; + var tableBorderColorBtnDef = { + dropdown: buildColorDropdown( + 'tableBorderColor', + t.o.plugins.table.borderColorList || t.o.plugins.table.colorList, + t.o.plugins.table.displayBorderColorsAsList, + t.o.plugins.table.allowCustomBorderColor, + applyBorderColor + ), + dropdownClass: getColorDropdownClass(t.o.plugins.table.displayBorderColorsAsList), + }; + + + + ////// Register buttons + + t.addBtnDef('table', buildButtonDef); + + t.addBtnDef('tableAddHeaderRow', addHeaderRow); + + t.addBtnDef('tableAddRowAbove', addRowAbove); + t.addBtnDef('tableAddRow', addRowBelow); + + t.addBtnDef('tableAddColumnLeft', addColumnLeft); + t.addBtnDef('tableAddColumn', addColumnRight); + + t.addBtnDef('tableMergeCells', mergeCells); + t.addBtnDef('tableUnmergeCells', unmergeCells); + + t.addBtnDef('tableVerticalAlignTop', verticalAlignTop); + t.addBtnDef('tableVerticalAlignMiddle', verticalAlignMiddle); + t.addBtnDef('tableVerticalAlignBottom', verticalAlignBottom); + + t.addBtnDef('tableCellBackgroundColor', cellBackgroundColorBtnDef); + t.addBtnDef('tableBorderColor', tableBorderColorBtnDef); + + t.addBtnDef('tableDeleteRow', deleteRow); + t.addBtnDef('tableDeleteColumn', deleteColumn); + t.addBtnDef('tableDestroy', destroy); + }, + destroy: function (t) { + $(window) + .off('resize.tbwTable'); + + $(t.doc) + .off('selectionchange.tbwTable') + .off('mousemove.tbwTable') + .off('mouseup.tbwTable'); + + t.$c + .off('tbwchange.tbwTable'); + + $('table', t.$ed) + .off('mousedown.tbwTable'); + }, + tagHandler: function (element, t) { + var tags = []; + + if (element.tagName === 'TABLE') { + tags.push('table'); + + var elementBorderColor = element.style.borderColor; + if (elementBorderColor !== '') { + var borderColor = colorToHex(elementBorderColor); + if (t.o.plugins.table.colorList.indexOf(borderColor) >= 0) { + tags.push('tableBorderColor' + borderColor); + } else { + tags.push('freeTableBorderColor'); + } + } + } + + if (!element.style) { + return tags; + } + + var elementVerticalAlign = element.style.verticalAlign; + if (elementVerticalAlign !== '') { + tags.push('tableVerticalAlign' + ucFirst(elementVerticalAlign)); + } + + var elementBackgroundColor = element.style.backgroundColor; + if ((element.tagName === 'TH' || element.tagName === 'TD') && elementBackgroundColor !== '') { + var backgroundColor = colorToHex(elementBackgroundColor); + if (t.o.plugins.table.colorList.indexOf(backgroundColor) >= 0) { + tags.push('tableCellBackgroundColor' + backgroundColor); + } else { + tags.push('freeTableCellBackgroundColor'); + } + } + + return tags; + }, + } + } + }); +})(jQuery); diff --git a/dist/plugins/table/trumbowyg.table.min.js b/dist/plugins/table/trumbowyg.table.min.js new file mode 100644 index 000000000..229e1cc86 --- /dev/null +++ b/dist/plugins/table/trumbowyg.table.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * trumbowyg.table.js v3.0 + * Table plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Original Author : Sven Dunemann [dunemann@forelabs.eu] + */ +!function(e){"use strict";function t(e,t){var l,a;return function(){var o=this,n=(new Date).getTime(),r=arguments;if(l&&n",a);if(0===o.$box.find("."+l+"-"+t).length?o.$box.append(r.hide()):r=o.$box.find("."+l+"-"+t),r.html(""),o.$box.find("."+o.o.prefix+"table-button").hasClass(o.o.prefix+"active-button")){var i=e(o.doc.getSelection().anchorNode).closest("table",o.$ed[0]),s=c(i),u=void 0!==n;e(o.o.plugins.table.dropdown).each((function(t,l){r.append(e("
",{html:o.lang[l.title]?o.lang[l.title]:l.title,class:o.o.prefix+"table-dropdown-title"})).text();var a=e("
",{class:o.o.prefix+"dropdown-button-group"});e(l.buttons).each((function(t,l){if("tableAddHeaderRow"===l&&0!==e("thead",i).length)return;if("tableMergeCells"!==l||u){if("tableUnmergeCells"===l){var n=!1;if(z((function(e){var t=e.is("[colspan]")||e.is("[rowspan]");n=n||t}),s),!n)return}a.append(o.buildSubBtn(l))}})),r.append(a)}))}else{var f=e("
', {scope: 'col'}).appendTo($theadTr); + } + $thead.appendTo($newTable); + + // Build tbody + var $tbody = $('
').appendTo(row); + } + } + + $tbody.appendTo($newTable); + + // Apply tag classes + applyTagClasses($newTable); + + // Find first parent element + var rangeNode = t.range.endContainer; + while (rangeNode.nodeType !== Node.ELEMENT_NODE) { + rangeNode = rangeNode.parentNode; + } + + // Put range after the parent of the selected element + if (rangeNode !== t.$ed[0]) { + t.range.setEndAfter(rangeNode); + } + + // Insert table after the range + t.range.collapse(); + t.range.insertNode($newTable[0]); + + // Remove empty paragraph + if (rangeNode.nodeName === 'P' && rangeNode.textContent.trim().length === 0) { + rangeNode.remove(); + } + + t.syncCode(); + + rebuildResizeLayers(); + }; + + var getTableState = function ($table) { + var $tableRows = $('tr', $table); + var tableState = []; + for (var i = 0; i < $tableRows.length; i += 1) { + tableState.push([]); + } + + $tableRows.each(function (rowIndex, row) { + var columnIndex = 0; + $('td, th', $(row)).each(function (cellIndex, cell) { + var $cell = $(cell); + var colspanAttr = $cell.attr('colspan'); + var rowspanAttr = $cell.attr('rowspan'); + + var colspan = parseInt(colspanAttr > 0 ? colspanAttr : 1, 10); + var rowspan = parseInt(rowspanAttr > 0 ? rowspanAttr : 1, 10); + + while (tableState[rowIndex][columnIndex] !== undefined) { + columnIndex += 1; + } + + tableState[rowIndex][columnIndex] = { + tag: cell.tagName, + element: cell, + colspan: colspan, + rowspan: rowspan, + }; + + for (var cols = 1; cols < colspan; cols += 1) { + tableState[rowIndex][columnIndex + cols] = { + mergedIn: [rowIndex, columnIndex] + }; + } + + for (var rows = 1; rows < rowspan; rows += 1) { + tableState[rowIndex + rows][columnIndex] = { + mergedIn: [rowIndex, columnIndex] + }; + + for (var colsInRow = 1; colsInRow < colspan; colsInRow += 1) { + tableState[rowIndex + rows][columnIndex + colsInRow] = { + mergedIn: [rowIndex, columnIndex] + }; + } + } + + columnIndex += colspan; + }); + }); + + return tableState; + }; + + + //////////////////////////////////////////////////// + // Buttons + + var tableButtonAction = function (callback) { + return function () { + t.saveRange(); + + var node = t.doc.getSelection().anchorNode; + var $table = $(node).closest('table', t.$ed[0]); + + if ($table.length === 0) { + return; + } + + if (node.tagName === 'TR') { + node = $('td, th', node)[0]; + } + var $focusedRow = $(node).closest('tr', t.$ed[0]); + + var tableState = getTableState($table); + + callback($table, $focusedRow, node, tableState); + + t.syncCode(); + }; + }; + + + ////// Rows + + var addRowButtonAction = function (isBefore = false) { + return tableButtonAction(function ($table, $focusedRow, node, tableState) { + var $rows = $('tr', $table); + var $newRow = $('
').appendTo($newRow); + } + + // add row to table + if (focusedRowIndex === 0 && (isBefore || isFocusInHead)) { + $focusedRow.before($newRow); + } else { + $focusedRow.after($newRow); + } + + applyTagClasses($table); + rebuildResizeLayers(); + }); + }; + + var addRowAbove = { + title: t.lang.tableAddRowAbove, + text: t.lang.tableAddRowAbove, + ico: 'row-above', + + fn: addRowButtonAction(true), + }; + + var addRowBelow = { + title: t.lang.tableAddRow, + text: t.lang.tableAddRow, + ico: 'row-below', + + fn: addRowButtonAction(false), + }; + + var addHeaderRow = { + title: t.lang.tableAddHeaderRow, + text: t.lang.tableAddHeaderRow, + ico: 'header-row', + + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + var hasThead = $('thead', $table).length !== 0; + if (hasThead) { + return false; + } + + var columnCount = tableState[0].length; + + var $thead = $('
').appendTo($theadRow); + } + + // add thead to table + $table.prepend($thead); + + applyTagClasses($table); + rebuildResizeLayers(); + }), + }; + + + ////// Columns + + var addColumnButtonAction = function (isBefore = false) { + return tableButtonAction(function ($table, $focusedRow, node, tableState) { + var $rows = $('tr', $table); + var focusedRowIndex = $rows.index($focusedRow); + var focusedRowState = tableState[focusedRowIndex]; + var $focusedCell = $(node).closest('td, th'); + + // Shift one column before if insert before + var cellIndex = getCellIndex($focusedCell[0], focusedRowState); + if (isBefore) { + cellIndex = Math.max(0, cellIndex - 1); + } else { + var rawCellColspan = $focusedCell.attr('colspan'); + var cellColspan = parseInt(rawCellColspan ? rawCellColspan : 1, 10); + cellIndex += cellColspan - 1; + } + + // add a cell to each row + var rowCount = tableState.length; + var mustInsertBefore = isBefore && cellIndex === 0; + for (var rowIndex = 0; rowIndex < rowCount; rowIndex += 1) { + var rowState = tableState[rowIndex]; + var nextCellState = mustInsertBefore ? undefined : rowState[cellIndex + 1]; + if (nextCellState !== undefined) { + var originCellState = rowState[cellIndex]; + var originCellMergedInState = getCellState(tableState, originCellState.mergedIn); + var nextCellMergedInState = getCellState(tableState, nextCellState.mergedIn); + + var realOriginCellState = originCellState.element ? originCellState : originCellMergedInState; + var originCellElement = realOriginCellState.element; + var nextCellElement = nextCellState.element ? nextCellState.element : nextCellMergedInState.element; + + if (originCellElement === nextCellElement) { + originCellElement.setAttribute('colspan', realOriginCellState.colspan + 1); + + continue; + } + } + + // Get previous real cell state + var previousRealCellState; + var previousColumnShift = 0; + do { + var newIndex = cellIndex - previousColumnShift; + if (newIndex < 0) { + break; + } + + previousRealCellState = rowState[newIndex]; + previousColumnShift += 1; + } while (previousRealCellState.mergedIn !== undefined); + + // Create and append the cell next to the previous + var $previousCell = previousRealCellState.element; + var newCellElement = t.doc.createElement($previousCell.tagName); + if (cellIndex === 0 && isBefore) { + $previousCell.before(newCellElement); + } else { + $previousCell.after(newCellElement); + } + } + + applyTagClasses($table); + rebuildResizeLayers(); + }); + }; + + var addColumnLeft = { + title: t.lang.tableAddColumnLeft, + text: t.lang.tableAddColumnLeft, + ico: 'col-left', + + fn: addColumnButtonAction(true) + }; + + var addColumnRight = { + title: t.lang.tableAddColumn, + text: t.lang.tableAddColumn, + ico: 'col-right', + + fn: addColumnButtonAction(false) + }; + + + ////// Delete + + var destroy = { + title: t.lang.tableDestroy, + text: t.lang.tableDestroy, + ico: 'table-delete', + + fn: tableButtonAction(function ($table) { + $table.remove(); + }) + }; + + var deleteRow = { + title: t.lang.tableDeleteRow, + text: t.lang.tableDeleteRow, + ico: 'row-delete', + + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + // Only one row is remaining in the table, remove the table + if ($('tbody tr', $table).length === 1) { + $table.remove(); + return; + } + + // Pick element to remove + var $elementToRemove = $focusedRow; + var $focusedRowParent = $focusedRow.parent(); + if ($focusedRowParent.is('thead')) { + $elementToRemove = $focusedRowParent; + } + + // Manage merged cells + var $rows = $('tr', $table); + var rowIndex = $rows.index($(node).closest('tr')); + for (var y = 0; y < tableState[0].length; y += 1) { + var cellState = getCellState(tableState, [rowIndex, y], false); + + if (cellState.rowspan === 1) { + continue; + } + + var originCellState = getCellState(tableState, [rowIndex, y]); + originCellState.element.setAttribute('rowspan', originCellState.rowspan - 1); + + // If origin cell is not in this row, continue + if (cellState.mergedIn !== undefined) { + continue; + } + + // If origin cell is in this row, move it to the next row + var originCellIndex = getCellIndex(cellState.element, tableState[rowIndex]); + if (originCellIndex === 0) { + $($rows[rowIndex + 1]).prepend(originCellState.element); + continue; + } + var nextRowPreviousColumnCellState = getCellState(tableState, [ + rowIndex + 1, + originCellIndex - 1 + ]); + $(nextRowPreviousColumnCellState.element).after(originCellState.element); + } + + $elementToRemove.remove(); + simplifyCells($table); + redrawResizeLayers(); + }), + }; + + var deleteColumn = { + title: t.lang.tableDeleteColumn, + text: t.lang.tableDeleteColumn, + ico: 'col-delete', + + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + var $rows = $('tr', $table); + var rowIndex = $rows.index($(node).closest('tr')); + var columnIndex = getCellIndex($(node).closest('td, th')[0], tableState[rowIndex]); + + for (var x = 0; x < tableState.length; x += 1) { + var cellState = getCellState(tableState, [x, columnIndex], false); + + // Reduce cell colspan by 1 + if (cellState.colspan > 1) { + var originCellState = getCellState(tableState, [x, columnIndex]); + originCellState.element.setAttribute('colspan', originCellState.colspan - 1); + continue; + } + + // Delete cell if not merged + cellState.element.remove(); + } + + simplifyCells(); + redrawResizeLayers(); + }) + }; + + + ////// Cell merging + + var getCellState = function (tableState, cellCoordinates, mustGetDeep = true) { + if (cellCoordinates === undefined) { + return undefined; + } + + var cellState = tableState[cellCoordinates[0]][cellCoordinates[1]]; + + if (mustGetDeep && cellState.mergedIn !== undefined) { + cellState = tableState[cellState.mergedIn[0]][cellState.mergedIn[1]]; + } + + return cellState; + }; + + var canMergeSelectedCells = function (tableState) { + if (tableSelectedCells.length === 0) { + return false; + } + + // Check that all tags are the same + var firstCellStateCoordinates = tableSelectedCells[0]; + var firstSelectedCellTag = getCellState(tableState, firstCellStateCoordinates).tag; + var allTagsAreTheSame = tableSelectedCells.every(function (cellCoordinates) { + var cellState = getCellState(tableState, cellCoordinates); + + return cellState.tag === firstSelectedCellTag; + }); + + if (!allTagsAreTheSame) { + return false; + } + + // Check that all selected cells make a rectangle + var minByRow = []; + var maxByRow = []; + $(tableSelectedCells).each(function (_, tableSelectedCell) { + var y = tableSelectedCell[0]; + var x = tableSelectedCell[1]; + var cellState = tableState[y][x]; + + var cellRowspan = cellState.rowspan; + var maxRow = y + cellRowspan; + + for (; y < maxRow; y += 1) { + if (minByRow[y] === undefined) { + minByRow[y] = tableState[0].length; + } + + if (maxByRow[y] === undefined) { + maxByRow[y] = 0; + } + + minByRow[y] = Math.min(minByRow[y], x); + maxByRow[y] = Math.max(maxByRow[y], x + cellState.colspan); + } + }); + + if (minByRow.length === 0 || maxByRow.length === 0) { + return false; + } + + var allMinAreTheSame = minByRow.every(function (value) { + return value === minByRow[minByRow.length - 1]; + }); + + var allMaxAreTheSame = maxByRow.every(function (value) { + return value === maxByRow[maxByRow.length - 1]; + }); + + return allMinAreTheSame && allMaxAreTheSame; + }; + + var findTopLeftCellInSelection = function () { + var MAX_VALUE = 999999; + var topLeftY = MAX_VALUE; + var topLeftX = MAX_VALUE; + + $(tableSelectedCells).each(function (_, cell) { + topLeftY = Math.min(cell[0], topLeftY); + topLeftX = Math.min(cell[1], topLeftX); + }); + + if (topLeftX === MAX_VALUE || topLeftY === MAX_VALUE) { + return undefined; + } + + return [topLeftY, topLeftX]; + }; + + var simplifyCells = function ($table) { + var tableState = getTableState($table); + + // Remove rowspan if a row is empty + var $rows = $('tr', $table); + $(tableState).each(function (rowIndex, rowState) { + var isRowEmpty = rowState.every(function (cellState) { + return cellState.mergedIn !== undefined; + }); + + if (!isRowEmpty) { + return; + } + + // Reduce by 1 the rowspan on each cell in previous row + $(tableState[rowIndex - 1]).each(function (_, cellState) { + if (cellState.mergedIn !== undefined) { + cellState = getCellState(tableState, cellState.mergedIn); + } + cellState.rowspan -= 1; + + if (cellState.rowspan <= 1) { + cellState.element.removeAttribute('rowspan'); + return; + } + + cellState.element.setAttribute('rowspan', cellState.rowspan); + }); + + // Remove empty tr + $rows[rowIndex].remove(); + }); + + // Remove empty attributes + $('[class=""]', $table).removeAttr('class'); + $('[style=""]', $table).removeAttr('style'); + }; + + var mergeCells = { + title: t.lang.tableMergeCells, + text: t.lang.tableMergeCells, + ico: 'table-merge', + + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + if (!canMergeSelectedCells(tableState)) { + return; + } + + var topLeftCellCoordinates = findTopLeftCellInSelection(); + if (topLeftCellCoordinates === undefined) { + return; + } + + var topLeftCellState = getCellState(tableState, topLeftCellCoordinates); + var $topLeftCell = $(topLeftCellState.element); + var minY = 999999; + var maxY = 0; + var minX = 999999; + var maxX = 0; + $(tableSelectedCells).each(function (_, selectedCell) { + var y = selectedCell[0]; + var x = selectedCell[1]; + var cellState = tableState[y][x]; + + minY = Math.min(minY, y); + maxY = Math.max(maxY, y + cellState.rowspan - 1); + minX = Math.min(minX, x); + maxX = Math.max(maxX, x + cellState.colspan - 1); + + if (cellState.element === $topLeftCell[0]) { + return; + } + + cellState.element.remove(); + }); + + var cellHeight = maxY - minY + 1; + var cellWidth = maxX - minX + 1; + + if (cellHeight > 1) { + $topLeftCell.attr('rowspan', cellHeight); + } + if (cellWidth > 1) { + $topLeftCell.attr('colspan', cellWidth); + } + + simplifyCells($table); + + rebuildResizeLayers(); + }), + }; + + var unmergeCells = { + title: t.lang.tableUnmergeCells, + text: t.lang.tableUnmergeCells, + ico: 'table-unmerge', + + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + foreachSelectedCell(function ($cell) { + $cell.removeAttr('colspan').removeAttr('rowspan'); + var $rows = $('tr', $table); + + var cellRowIndex = $rows.index($cell.closest('tr')); + var cellColumnIndex = getCellIndex($cell[0], tableState[cellRowIndex]); + var cellState = tableState[cellRowIndex][cellColumnIndex]; + + for (var rowIndex = 0; rowIndex < cellState.rowspan; rowIndex += 1) { + var colIndex = (rowIndex === 0) ? 1 : 0; + var previousCellState = getCellState(tableState, [ + cellRowIndex + rowIndex, + cellColumnIndex + colIndex - 1 + ]); + var previousCellElement = previousCellState.element; + for (; colIndex < cellState.colspan; colIndex += 1) { + var newCellElement = t.doc.createElement(previousCellElement.tagName); + $(previousCellElement).after(newCellElement); + } + } + }, tableState); + + applyTagClasses($table); + rebuildResizeLayers(); + }), + }; + + + ////// Cell selection + + var getCellIndex = function (cellElement, rowState) { + return rowState.findIndex(function (rowStateCell) { + if (rowStateCell.element === undefined) { + return false; + } + + return rowStateCell.element === cellElement; + }); + }; + + var resetTableMouseHacks = function () { + $('table', t.$ed).off('mousedown.tbwTable'); + $('table', t.$ed).on('mousedown.tbwTable', function (e) { + // Cells drag and drop while changing cell selection + t.doc.getSelection().removeAllRanges(); + + // Prevent Ctrl+Click on Firefox + if (!e.ctrlKey) { + return; + } + + e.preventDefault(); + }); + }; + + var tableCellSelectionModeClass = t.o.prefix + 'table-cell-selection-mode'; + var tableCellSelectedClass = t.o.prefix + 'table-cell-selected'; + setTimeout(function () { // Wait for init + resetTableMouseHacks(); + t.$c.on('tbwchange.tbwTable', function () { + resetTableMouseHacks(); + rebuildResizeLayers(); + }); + + rebuildResizeLayers(); + + $(t.doc).on('selectionchange.tbwTable', function () { + tableSelectedCells = undefined; + + var selection = t.doc.getSelection(); + var rangeCount = selection.rangeCount; + + var anchorNode = selection.anchorNode; + var focusNode = selection.focusNode; + + // Firefox create one range by cell + if (rangeCount > 1) { + var firstRange = selection.getRangeAt(0); + var lastRange = selection.getRangeAt(rangeCount - 1); + + anchorNode = firstRange.startContainer.childNodes[firstRange.startOffset]; + focusNode = lastRange.startContainer.childNodes[lastRange.startOffset]; + } + + var $anchorSelectedCell = $(anchorNode).closest('td, th'); + var $focusSelectedCell = $(focusNode).closest('td, th'); + + var $tableAnchor = $anchorSelectedCell.closest('table'); + var $tableFocus = $focusSelectedCell.closest('table'); + + $('[class="' + tableCellSelectedClass + '"]', t.$ed).removeAttr('class'); + $('.' + tableCellSelectedClass, t.$ed).removeClass(tableCellSelectedClass); + + if (($tableAnchor.length === 0 && $tableFocus.length === 0) || + $tableAnchor[0] !== $tableFocus[0] || + $anchorSelectedCell[0] === $focusSelectedCell[0] + ) { + $('.' + tableCellSelectionModeClass, t.$ed).removeClass(tableCellSelectionModeClass); + return; + } + + // Toggle table to selection mode + $tableAnchor.addClass(tableCellSelectionModeClass); + + // Get table state + var tableState = getTableState($tableAnchor); + + // Find cells to set as selected + var $allRows = $('tr', $tableAnchor); + + var $anchorSelectedRow = $anchorSelectedCell.closest('tr'); + var anchorSelectedRowIndex = $allRows.index($anchorSelectedRow); + var $focusSelectedRow = $focusSelectedCell.closest('tr'); + var focusSelectedRowIndex = $allRows.index($focusSelectedRow); + + var anchorSelectedCellIndex = getCellIndex($anchorSelectedCell[0], tableState[anchorSelectedRowIndex]); + var focusSelectedCellIndex = getCellIndex($focusSelectedCell[0], tableState[focusSelectedRowIndex]); + + var firstSelectedRowIndex = Math.min(anchorSelectedRowIndex, focusSelectedRowIndex); + var lastSelectedRowIndex = Math.max(anchorSelectedRowIndex, focusSelectedRowIndex); + var firstSelectedCellIndex = Math.min(anchorSelectedCellIndex, focusSelectedCellIndex); + var lastSelectedCellIndex = Math.max(anchorSelectedCellIndex, focusSelectedCellIndex); + + // Set cells as selected + var selectedCellsCoordinates = []; + $allRows.each(function (rowIndex, rowElement) { + if (rowIndex < firstSelectedRowIndex || rowIndex > lastSelectedRowIndex) { + return; + } + + $('td, th', rowElement).each(function (_, cellElement) { + var cellIndex = getCellIndex(cellElement, tableState[rowIndex]); + if (cellIndex < firstSelectedCellIndex || cellIndex > lastSelectedCellIndex) { + return; + } + + selectedCellsCoordinates.push([rowIndex, cellIndex]); + $(cellElement).addClass(tableCellSelectedClass); + }); + }); + + tableSelectedCells = selectedCellsCoordinates; + }); + }); + + var foreachSelectedCell = function (callback, tableState) { + if (tableSelectedCells === undefined) { + var $cell = $(t.doc.getSelection().anchorNode).closest('td, th'); + if ($cell.length === 0) { + return; + } + + callback($cell); + return; + } + + $(tableSelectedCells).each(function (_, cellCoordinates) { + var cellState = getCellState(tableState, cellCoordinates, false); + if (cellState.mergedIn !== undefined) { + return; + } + + callback($(cellState.element)); + }); + }; + + + ////// Cell resize + + var TRUMBOWYG_TABLE_HANDLE_FOR = 'trumbowyg-table-handle-for'; + var $targetTable; + var targetTableState; + var targetColumnIndex; + var rebuildResizeLayers = trumbowygThrottle(function () { + if (!t.o.plugins.table.allowHorizontalResize) { + return; + } + + var $resizeLayers = $('.' + t.o.prefix + 'table-resize-layers', t.$edBox); + var hasResizeLayers = $resizeLayers.length > 0; + if (!hasResizeLayers) { + $resizeLayers = $('
', { + class: t.o.prefix + 'table-resize-layers', + }).appendTo(t.$edBox); + } + + // Reset and remove old handles + $('.' + t.o.prefix + 'table-resize-vertical-handle', $resizeLayers).each(function (_, handle) { + $(handle) + .off() + .remove(); + }); + + $('td, th', t.$ed).each(function (_cellIndex, cell) { + // Vertical handles + $('
', { + class: t.o.prefix + 'table-resize-vertical-handle', + }) + .prop(TRUMBOWYG_TABLE_HANDLE_FOR, cell) + .on('mousedown.tbwTable', function (e) { + e.preventDefault(); + e.stopPropagation(); + var targetCell = $(e.target).prop(TRUMBOWYG_TABLE_HANDLE_FOR); + $targetTable = $(targetCell).closest('table'); + targetTableState = getTableState($targetTable); + var $allRows = $('tr', $targetTable); + var $row = $(targetCell).closest('tr'); + var rowIndex = $allRows.index($row); + var rowState = targetTableState[rowIndex]; + var columnIndex = getCellIndex(targetCell, rowState); + var targetCellState = targetTableState[rowIndex][columnIndex]; + if (targetCellState.mergedIn !== undefined) { + targetCellState = targetTableState[targetCellState.mergedIn[0]][targetCellState.mergedIn[1]]; + } + + targetColumnIndex = columnIndex + targetCellState.colspan - 1; + + ensureColgroupExists($targetTable, targetTableState); + setColWidthInPixels($targetTable, targetTableState); + redrawResizeLayers(); + + $targetTable.css({ + maxWidth: '', + }); + }) + .appendTo($resizeLayers); + }); + redrawResizeLayers(); + + // If resize layer was here + // We do not need to add following events + if (hasResizeLayers) { + return; + } + + $(t.doc) + .on('mousemove.tbwTable', function (e) { + if (targetColumnIndex === undefined) { + return; + } + e.preventDefault(); + e.stopPropagation(); + + var tableRect = $targetTable[0].getBoundingClientRect(); + var tableLeftInPixels = e.pageX - tableRect.left; + + var cellState = findFirstCellAtIndex(targetTableState, targetColumnIndex); + + var cellElement = cellState.element; + var cellRect = cellElement.getBoundingClientRect(); + var cellLeftInPixels = cellRect.left - tableRect.left; + + var cellWidthInPixels = tableLeftInPixels - cellLeftInPixels; + + var colElement = $('col', $targetTable)[targetColumnIndex]; + $(colElement).css({ + width: cellWidthInPixels, + }); + + redrawResizeLayers(); + }) + .on('mouseup.tbwTable', function (e) { + if (targetColumnIndex === undefined) { + return; + } + e.preventDefault(); + e.stopPropagation(); + + // Fix width + ensureColgroupExists($targetTable, targetTableState); + setColWidthInPercents($targetTable, targetTableState); + + // Reset resize state + $targetTable = undefined; + targetTableState = undefined; + targetColumnIndex = undefined; + + // Update HTML + t.syncCode(); + redrawResizeLayers(); + }); + + $(window) + .on('resize.tbwTable', function () { + redrawResizeLayers(); + }); + }, 100); + + var ensureColgroupExists = function ($table, tableState) { + var $colgroup = $('colgroup', $table); + if ($colgroup.length === 0) { + $colgroup = $('
");e("").appendTo(f);for(var g=0;g").appendTo(f),p=0;p").appendTo(m);f.find("td").on("mouseover",d),f.find("td").on("mousedown",b),r.append(f),r.append(e('
1x1
'))}o.dropdown(t)},class:o.o.prefix+"open-dropdown"},d=function(t){var l=e(t.target).closest("table",o.$ed[0]),a=this.cellIndex,n=this.parentNode.rowIndex;l.find("td").removeClass("active");for(var r=0;r<=n;r+=1)for(var d=0;d<=a;d+=1)l.find("tr:nth-of-type("+(r+1)+")").find("td:nth-of-type("+(d+1)+")").addClass("active");l.next(".trumbowyg-table-size").html(a+1+"x"+(n+1))},i=function(t){var l=o.o.tagClasses[t.tagName.toLowerCase()];l&&e(t).addClass(l)},s=function(t){i(t[0]),e("*",t).each((function(e,t){i(t)}))},b=function(){o.saveRange();var t=e("
"),l=e(""),a=e("");a.appendTo(l);for(var n=0;n<=this.cellIndex;n+=1)e(""),d=this.cellIndex,i=this.parentNode.rowIndex,b=0;b<=i;b+=1)for(var c=e("").appendTo(r),u=0;u<=d;u+=1)e(""),d=e("").appendTo(r),i=0;i").appendTo(d);t.prepend(r),s(t),$()}))},A=function(t=!1){return u((function(l,a,n,r){var d=r[e("tr",l).index(a)],i=e(n).closest("td, th"),b=T(i[0],d);if(t)b=Math.max(0,b-1);else{var c=i.attr("colspan");b+=parseInt(c||1,10)-1}for(var u=r.length,f=t&&0===b,g=0;g1){var s=D(o,[d,r]);s.element.setAttribute("colspan",s.colspan-1)}else i.element.remove()}x(),j()}))},D=function(e,t,l=!0){if(void 0!==t){var a=e[t[0]][t[1]];return l&&void 0!==a.mergedIn&&(a=e[a.mergedIn[0]][a.mergedIn[1]]),a}},x=function(t){var l=c(t),a=e("tr",t);e(l).each((function(t,o){o.every((function(e){return void 0!==e.mergedIn}))&&(e(l[t-1]).each((function(e,t){void 0!==t.mergedIn&&(t=D(l,t.mergedIn)),t.rowspan-=1,t.rowspan<=1?t.element.removeAttribute("rowspan"):t.element.setAttribute("rowspan",t.rowspan)})),a[t].remove())})),e('[class=""]',t).removeAttr("class"),e('[style=""]',t).removeAttr("style")},y={title:o.lang.tableMergeCells,text:o.lang.tableMergeCells,ico:"table-merge",fn:u((function(t,l,a,o){if(function(t){if(0===n.length)return!1;var l=n[0],a=D(t,l).tag;if(!n.every((function(e){return D(t,e).tag===a})))return!1;var o=[],r=[];if(e(n).each((function(e,l){for(var a=l[0],n=l[1],d=t[a][n],i=a+d.rowspan;a1&&i.attr("rowspan",f),g>1&&i.attr("colspan",g),x(t),$()}}}))},B={title:o.lang.tableUnmergeCells,text:o.lang.tableUnmergeCells,ico:"table-unmerge",fn:u((function(t,l,a,n){z((function(l){l.removeAttr("colspan").removeAttr("rowspan");for(var a=e("tr",t).index(l.closest("tr")),r=T(l[0],n[a]),d=n[a][r],i=0;i1){var d=t.getRangeAt(0),i=t.getRangeAt(l-1);a=d.startContainer.childNodes[d.startOffset],r=i.startContainer.childNodes[i.startOffset]}var s=e(a).closest("td, th"),b=e(r).closest("td, th"),u=s.closest("table"),f=b.closest("table");if(e('[class="'+L+'"]',o.$ed).removeAttr("class"),e("."+L,o.$ed).removeClass(L),0===u.length&&0===f.length||u[0]!==f[0]||s[0]===b[0])e("."+I,o.$ed).removeClass(I);else{u.addClass(I);var g=c(u),m=e("tr",u),p=s.closest("tr"),A=m.index(p),v=b.closest("tr"),h=m.index(v),C=T(s[0],g[A]),w=T(b[0],g[h]),R=Math.min(A,h),D=Math.max(A,h),x=Math.min(C,w),y=Math.max(C,w),B=[];m.each((function(t,l){tD||e("td, th",l).each((function(l,a){var o=T(a,g[t]);oy||(B.push([t,o]),e(a).addClass(L))}))})),n=B}}))}));var S,M,V,z=function(t,l){if(void 0!==n)e(n).each((function(a,o){var n=D(l,o,!1);void 0===n.mergedIn&&t(e(n.element))}));else{var a=e(o.doc.getSelection().anchorNode).closest("td, th");if(0===a.length)return;t(a)}},N="trumbowyg-table-handle-for",$=t((function(){if(o.o.plugins.table.allowHorizontalResize){var t=e("."+o.o.prefix+"table-resize-layers",o.$edBox),l=t.length>0;l||(t=e("
",{class:o.o.prefix+"table-resize-layers"}).appendTo(o.$edBox)),e("."+o.o.prefix+"table-resize-vertical-handle",t).each((function(t,l){e(l).off().remove()})),e("td, th",o.$ed).each((function(l,a){e("
",{class:o.o.prefix+"table-resize-vertical-handle"}).prop(N,a).on("mousedown.tbwTable",(function(t){t.preventDefault(),t.stopPropagation();var l=e(t.target).prop(N);S=e(l).closest("table"),M=c(S);var a=e("tr",S),o=e(l).closest("tr"),n=a.index(o),r=M[n],d=T(l,r),i=M[n][d];void 0!==i.mergedIn&&(i=M[i.mergedIn[0]][i.mergedIn[1]]),V=d+i.colspan-1,E(S,M),U(S,M),j(),S.css({maxWidth:""})})).appendTo(t)})),j(),l||(e(o.doc).on("mousemove.tbwTable",(function(t){if(void 0!==V){t.preventDefault(),t.stopPropagation();var l=S[0].getBoundingClientRect(),a=t.pageX-l.left-(H(M,V).element.getBoundingClientRect().left-l.left),o=e("col",S)[V];e(o).css({width:a}),j()}})).on("mouseup.tbwTable",(function(e){void 0!==V&&(e.preventDefault(),e.stopPropagation(),E(S,M),P(S,M),S=void 0,M=void 0,V=void 0,o.syncCode(),j())})),e(window).on("resize.tbwTable",(function(){j()})))}}),100),E=function(t,l){var a=e("colgroup",t);0===a.length&&(a=e("
").prependTo(t));for(var o=l[0].length,n=e("col",a).length;n").appendTo(a)},H=function(e,t){var l,a=0;do{l=e[a][t],a+=1}while(void 0===l.element||1!==l.colspan);return l},O=function(t,l,a=!1){var o=e("colgroup",t),n=e("col",o),r=Math.ceil(t[0].getBoundingClientRect().width);t.css({maxWidth:r});for(var d=l[0].length,i=[],s=0;s=0?l.push("tableBorderColor"+r):l.push("freeTableBorderColor")}}if(!e.style)return l;var d=e.style.verticalAlign;""!==d&&l.push("tableVerticalAlign"+a(d));var i=e.style.backgroundColor;if(("TH"===e.tagName||"TD"===e.tagName)&&""!==i){var s=n(i);t.o.plugins.table.colorList.indexOf(s)>=0?l.push("tableCellBackgroundColor"+s):l.push("freeTableCellBackgroundColor")}return l}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/table/ui/sass/trumbowyg.table.scss b/dist/plugins/table/ui/sass/trumbowyg.table.scss new file mode 100644 index 000000000..51cdd951d --- /dev/null +++ b/dist/plugins/table/ui/sass/trumbowyg.table.scss @@ -0,0 +1,171 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-table { + max-height: unset; + + table { + all: unset; + display: inline-block; + margin: 10px; + border-collapse: collapse; + } + + table td { + all: unset; + position: relative; + display: table-cell; + height: 20px; + width: 20px; + cursor: pointer; + background: #fff; + + &::after { + content: ''; + display: block; + position: absolute; + $padding: 1px; + top: $padding; + right: $padding; + bottom: $padding; + left: $padding; + border: 1px solid #cecece; + pointer-events: none; + } + + &.active::after { + background-color: #000; + border-color: #000; + } + } + + .trumbowyg-table-size { + text-align: center; + } +} + +.trumbowyg-table-dropdown-title { + padding: 8px 10px; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 2px; + font-weight: bold; +} + +.trumbowyg-dropdown-button-group + .trumbowyg-table-dropdown-title { + margin-top: 24px; +} + +.trumbowyg-table-cell-selection-mode ::selection { + color: inherit; + background-color: transparent; +} + +.trumbowyg-table-cell-selected { + background-color: #b4d3fe !important; +} + + +// Resize + +.trumbowyg-table-resize-layers { + position: absolute; + top: 0; + left: 0; + width: 0; + height: 0; +} + +.trumbowyg-table-resize-vertical-handle { + position: absolute; + width: 5px; + margin-left: -3px; + cursor: col-resize; +} + +.trumbowyg-table-resize-vertical-handle::after { + content: ''; + position: absolute; + top: 0; + left: 1px; + width: 3px; + height: 100%; + background: #0073ff; + border-radius: 3px; + pointer-events: none; + opacity: 0; +} +.trumbowyg-table-resize-vertical-handle:hover::after { + opacity: 1; +} + + +// Background/Border color + +.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list), +.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) { + max-width: 276px; + padding: 7px 5px; + overflow: initial; + + button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; + + &:hover, + &:focus { + &::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + width: 27px; + height: 27px; + background: inherit; + border: 1px solid #fff; + box-shadow: #000 0 0 2px; + z-index: 10; + } + } + } +} + +.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list, +.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list { + button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button) { + position: relative; + color: #fff !important; + + &:hover, + &:focus { + &::after { + content: " "; + display: block; + position: absolute; + top: 13px; + left: 0; + width: 0; + height: 0; + border: 5px solid transparent; + border-left-color: #fff; + } + } + } +} + diff --git a/dist/plugins/table/ui/trumbowyg.table.css b/dist/plugins/table/ui/trumbowyg.table.css new file mode 100644 index 000000000..13ece07db --- /dev/null +++ b/dist/plugins/table/ui/trumbowyg.table.css @@ -0,0 +1,159 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-dropdown-table { + max-height: unset; +} +.trumbowyg-dropdown-table table { + all: unset; + display: inline-block; + margin: 10px; + border-collapse: collapse; +} +.trumbowyg-dropdown-table table td { + all: unset; + position: relative; + display: table-cell; + height: 20px; + width: 20px; + cursor: pointer; + background: #fff; +} +.trumbowyg-dropdown-table table td::after { + content: ""; + display: block; + position: absolute; + top: 1px; + right: 1px; + bottom: 1px; + left: 1px; + border: 1px solid #cecece; + pointer-events: none; +} +.trumbowyg-dropdown-table table td.active::after { + background-color: #000; + border-color: #000; +} +.trumbowyg-dropdown-table .trumbowyg-table-size { + text-align: center; +} + +.trumbowyg-table-dropdown-title { + padding: 8px 10px; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 2px; + font-weight: bold; +} + +.trumbowyg-dropdown-button-group + .trumbowyg-table-dropdown-title { + margin-top: 24px; +} + +.trumbowyg-table-cell-selection-mode ::-moz-selection { + color: inherit; + background-color: transparent; +} + +.trumbowyg-table-cell-selection-mode ::selection { + color: inherit; + background-color: transparent; +} + +.trumbowyg-table-cell-selected { + background-color: #b4d3fe !important; +} + +.trumbowyg-table-resize-layers { + position: absolute; + top: 0; + left: 0; + width: 0; + height: 0; +} + +.trumbowyg-table-resize-vertical-handle { + position: absolute; + width: 5px; + margin-left: -3px; + cursor: col-resize; +} + +.trumbowyg-table-resize-vertical-handle::after { + content: ""; + position: absolute; + top: 0; + left: 1px; + width: 3px; + height: 100%; + background: #0073ff; + border-radius: 3px; + pointer-events: none; + opacity: 0; +} + +.trumbowyg-table-resize-vertical-handle:hover::after { + opacity: 1; +} + +.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list), +.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) { + max-width: 276px; + padding: 7px 5px; + overflow: initial; +} +.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button, +.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; +} +.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:hover::after, .trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:focus::after, +.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:hover::after, +.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:focus::after { + content: " "; + display: block; + position: absolute; + top: -5px; + left: -5px; + width: 27px; + height: 27px; + background: inherit; + border: 1px solid #fff; + -webkit-box-shadow: #000 0 0 2px; + box-shadow: #000 0 0 2px; + z-index: 10; +} + +.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button), +.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button) { + position: relative; + color: #fff !important; +} +.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after, .trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after, +.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after, +.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after { + content: " "; + display: block; + position: absolute; + top: 13px; + left: 0; + width: 0; + height: 0; + border: 5px solid transparent; + border-left-color: #fff; +} \ No newline at end of file diff --git a/dist/plugins/table/ui/trumbowyg.table.min.css b/dist/plugins/table/ui/trumbowyg.table.min.css new file mode 100644 index 000000000..7f021dba9 --- /dev/null +++ b/dist/plugins/table/ui/trumbowyg.table.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-dropdown-table{max-height:unset}.trumbowyg-dropdown-table table{all:unset;display:inline-block;margin:10px;border-collapse:collapse}.trumbowyg-dropdown-table table td{all:unset;position:relative;display:table-cell;height:20px;width:20px;cursor:pointer;background:#fff}.trumbowyg-dropdown-table table td::after{content:"";display:block;position:absolute;top:1px;right:1px;bottom:1px;left:1px;border:1px solid #cecece;pointer-events:none}.trumbowyg-dropdown-table table td.active::after{background-color:#000;border-color:#000}.trumbowyg-dropdown-table .trumbowyg-table-size{text-align:center}.trumbowyg-table-dropdown-title{padding:8px 10px;font-size:12px;text-transform:uppercase;letter-spacing:2px;font-weight:700}.trumbowyg-dropdown-button-group+.trumbowyg-table-dropdown-title{margin-top:24px}.trumbowyg-table-cell-selection-mode ::-moz-selection{color:inherit;background-color:transparent}.trumbowyg-table-cell-selection-mode ::selection{color:inherit;background-color:transparent}.trumbowyg-table-cell-selected{background-color:#b4d3fe!important}.trumbowyg-table-resize-layers{position:absolute;top:0;left:0;width:0;height:0}.trumbowyg-table-resize-vertical-handle{position:absolute;width:5px;margin-left:-3px;cursor:col-resize}.trumbowyg-table-resize-vertical-handle::after{content:"";position:absolute;top:0;left:1px;width:3px;height:100%;background:#0073ff;border-radius:3px;pointer-events:none;opacity:0}.trumbowyg-table-resize-vertical-handle:hover::after{opacity:1}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button),.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after,.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after,.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after,.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff} \ No newline at end of file diff --git a/dist/plugins/template/trumbowyg.template.js b/dist/plugins/template/trumbowyg.template.js new file mode 100644 index 000000000..10703554e --- /dev/null +++ b/dist/plugins/template/trumbowyg.template.js @@ -0,0 +1,96 @@ +(function ($) { + 'use strict'; + + // Adds the language variables + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + template: 'Template' + }, + az: { + template: 'Şablon' + }, + by: { + template: 'Шаблон' + }, + da: { + template: 'Skabelon' + }, + de: { + template: 'Vorlage' + }, + et: { + template: 'Mall' + }, + fr: { + template: 'Patron' + }, + hu: { + template: 'Sablon' + }, + ja: { + template: 'テンプレート' + }, + ko: { + template: '서식' + }, + nl: { + template: 'Sjabloon' + }, + pt_br: { + template: 'Modelo' + }, + ru: { + template: 'Шаблон' + }, + sl: { + template: 'Predloga' + }, + tr: { + template: 'Şablon' + }, + zh_tw: { + template: '模板', + }, + // jshint camelcase:true + } + }); + + // Adds the extra button definition + $.extend(true, $.trumbowyg, { + plugins: { + template: { + shouldInit: function (trumbowyg) { + return trumbowyg.o.plugins.hasOwnProperty('templates'); + }, + init: function (trumbowyg) { + trumbowyg.addBtnDef('template', { + dropdown: templateSelector(trumbowyg), + hasIcon: false, + text: trumbowyg.lang.template + }); + } + } + } + }); + + // Creates the template-selector dropdown. + function templateSelector(trumbowyg) { + var available = trumbowyg.o.plugins.templates; + var templates = []; + + $.each(available, function (index, template) { + trumbowyg.addBtnDef('template_' + index, { + fn: function () { + trumbowyg.html(template.html); + }, + hasIcon: false, + title: template.name + }); + templates.push('template_' + index); + }); + + return templates; + } +})(jQuery); diff --git a/dist/plugins/template/trumbowyg.template.min.js b/dist/plugins/template/trumbowyg.template.min.js new file mode 100644 index 000000000..96b6161f6 --- /dev/null +++ b/dist/plugins/template/trumbowyg.template.min.js @@ -0,0 +1 @@ +!function(t){"use strict";function e(e){var a=e.o.plugins.templates,l=[];return t.each(a,(function(t,a){e.addBtnDef("template_"+t,{fn:function(){e.html(a.html)},hasIcon:!1,title:a.name}),l.push("template_"+t)})),l}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},az:{template:"Şablon"},by:{template:"Шаблон"},da:{template:"Skabelon"},de:{template:"Vorlage"},et:{template:"Mall"},fr:{template:"Patron"},hu:{template:"Sablon"},ja:{template:"テンプレート"},ko:{template:"서식"},nl:{template:"Sjabloon"},pt_br:{template:"Modelo"},ru:{template:"Шаблон"},sl:{template:"Predloga"},tr:{template:"Şablon"},zh_tw:{template:"模板"}}}),t.extend(!0,t.trumbowyg,{plugins:{template:{shouldInit:function(t){return t.o.plugins.hasOwnProperty("templates")},init:function(t){t.addBtnDef("template",{dropdown:e(t),hasIcon:!1,text:t.lang.template})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/tenor/trumbowyg.tenor.js b/dist/plugins/tenor/trumbowyg.tenor.js new file mode 100644 index 000000000..20ad79f5e --- /dev/null +++ b/dist/plugins/tenor/trumbowyg.tenor.js @@ -0,0 +1,319 @@ +// adapted from giphy plugin +/* global AbortController: true */ +(function ($) { + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + tenor: 'Insert GIF' + }, + az: { + tenor: 'GIF yerləşdir' + }, + by: { + tenor: 'Уставіць GIF' + }, + de: { + tenor: 'GIF einfügen' + }, + et: { + tenor: 'Sisesta GIF' + }, + fr: { + tenor: 'Insérer un GIF' + }, + hu: { + tenor: 'GIF beszúrás' + }, + ru: { + tenor: 'Вставить GIF' + }, + sl: { + tenor: 'Vstavi GIF' + }, + tr: { + tenor: 'GIF ekle' + } + // jshint camelcase:true + } + }); + + var tenorLogo = ''; // jshint ignore:line + + var CANCEL_EVENT = 'tbwcancel'; + var nextCursor = null; + + // Throttle helper + function trumbowygThrottle(callback, delay) { + var last; + var timer; + + return function () { + var context = this; + var now = new Date().getTime(); + var args = arguments; + + if (last && now < last + delay) { + clearTimeout(timer); + timer = setTimeout(function () { + last = now; + callback.apply(context, args); + }, delay); + } else { + last = now; + callback.apply(context, args); + } + }; + } + + function registerGifClickEventInModal(trumbowyg, $tenorModal) { + $tenorModal.on('click', 'img', function () { + var src = $(this).attr('data-full'), + alt = $(this).attr('alt'); + trumbowyg.restoreRange(); + trumbowyg.execCmd('insertImage', src, false, true); + + // relay alt tag into inserted image + if (alt) { + var $img = $('img[src="' + src + '"]:not([alt])', trumbowyg.$box); + $img.attr('alt', alt); + // Note: This seems to fire relatively early and could be wrapped in a setTimeout if needed + trumbowyg.syncCode(); + } + $tenorModal.off('click', 'img'); + trumbowyg.closeModal(); + }); + } + + // Fills modal with response gifs + function renderGifs(response, $tenorModal, trumbowyg, mustEmpty) { + var $tenorLoading = $tenorModal.siblings('.' + trumbowyg.o.prefix + 'tenor-loading'); + var modalWidth = $tenorModal.width(); + var gapBetweenImages = 10; + var imagesPerRow = 3; + var imageWidth = (modalWidth - (gapBetweenImages * (imagesPerRow + 1))) / imagesPerRow; + + nextCursor = response.next; + var columnHeights = Array(imagesPerRow).fill(gapBetweenImages); + + if (!mustEmpty) { + columnHeights = $tenorModal.data('columnHeights') || columnHeights; + } + + var html = response.results + .map(function (gifData) { + // jshint camelcase:false + var image = gifData.media_formats.tinygif, + imageRatio = image.dims[1] / image.dims[0], + altText = gifData.content_description; + + var full_size = gifData.media_formats.gif.url; + + var imgHtml = '' + altText + ''; + + var minHeight = Math.min(...columnHeights); + var columnIndex = columnHeights.indexOf(minHeight); + var top = columnHeights[columnIndex]; + var left = gapBetweenImages + (columnIndex * (imageWidth + gapBetweenImages)); + + columnHeights[columnIndex] += imageRatio * imageWidth + gapBetweenImages; + + var divHtml = '
' + imgHtml + '
'; + return divHtml; + }) + .join(''); + + if (mustEmpty === true) { + if (html.length === 0) { + if ($('.' + trumbowyg.o.prefix + 'tenor-no-result', $tenorModal).length > 0) { + return; + } + + html = ''; + } + + $tenorModal.empty(); + } + $tenorModal.append(html); + + if (!nextCursor || nextCursor.length === 0) { + $tenorLoading.hide(); + } else { + $tenorLoading.show(); + } + + // Remove gray overlay on image load + // moved here from inline callback definition due to CSP issue + // Note: this is being done post-factum because load event doesn't bubble up and so can't be delegated + var addLoadedClass = function (img) { + img.classList.add('tbw-loaded'); + }; + $('img', $tenorModal).each(function () { + var img = this; + if (img.complete) { // images load instantly when cached and esp. when loaded in previous modal open + addLoadedClass(img); + return; + } + + img.addEventListener('load', function () { + addLoadedClass(this); + }); + }); + + $tenorModal.data('columnHeights', columnHeights); + + var maxHeight = Math.max(...columnHeights); + $tenorModal.css({ + position: 'relative', + height: maxHeight, + }); + } + + var defaultOptions = { + apiKey: null, + locale: 'en_US', + contentFilter: 'off', + throttleDelay: 300, + noResultGifUrl: 'https://media1.tenor.com/m/KOZLvzU0o4kAAAAC/no-results.gif' + }; + + // Add dropdown with font sizes + $.extend(true, $.trumbowyg, { + plugins: { + tenor: { + init: function (trumbowyg) { + trumbowyg.o.plugins.tenor = $.extend({}, + defaultOptions, + trumbowyg.o.plugins.tenor || {} + ); + + trumbowyg.addBtnDef('tenor', { + fn: function () { + if (trumbowyg.o.plugins.tenor.apiKey === null) { + throw new Error('You must set a Tenor API Key'); + } + + var BASE_URL = 'https://g.tenor.com/v2/search?ar_range=all&media_filter=gif,tinygif&limit=10&key=' + + trumbowyg.o.plugins.tenor.apiKey + + '&locale=' + trumbowyg.o.plugins.tenor.locale + + '&contentfilter=' + trumbowyg.o.plugins.tenor.contentFilter; + + var DEFAULT_URL = BASE_URL.replace('/search', '/featured'); + var prefix = trumbowyg.o.prefix; + var abortController = new AbortController(); + + // Create and open the modal + var searchInput = '', + closeButton = '', + poweredByTenor = '
Powered by' + tenorLogo + '
', + tenorModalHtml = searchInput + closeButton + poweredByTenor + '

Loading more gifs...

'; + + trumbowyg + .openModal(null, tenorModalHtml, false) + .one(CANCEL_EVENT, function () { + try { + abortController.abort(); + abortController = new AbortController(); + } catch (e) { + } + + trumbowyg.closeModal(); + }); + + var $tenorInput = $('.' + prefix + 'tenor-search'), + $tenorClose = $('.' + prefix + 'tenor-close'), + $tenorModal = $('.' + prefix + 'tenor-modal'), + $tenorModalScroll = $('.' + prefix + 'tenor-modal-scroll'); + + var onError = function () { + if (navigator.onLine || $('.' + prefix + 'tenor-offline', $tenorModal).length) { + return; + } + + $tenorModal.empty(); + $tenorModal.append('

You are offline

'); + }; + + registerGifClickEventInModal(trumbowyg, $tenorModal); + + // Load trending gifs as default + fetch(DEFAULT_URL, { + method: 'GET', + cache: 'no-cache', + signal: abortController.signal + }).then((response) => { + response.json().then((responseJson) => { + renderGifs(responseJson, $tenorModal, trumbowyg, true); + }); + }).catch(() => { + onError(); + }); + + var searchGifsOnInput = function () { + var query = $tenorInput.val(); + + if (query.length === 0) { + return; + } + + try { + abortController.abort(); + abortController = new AbortController(); + } catch (e) { + } + + $tenorModalScroll.scrollTop(0); + fetch(BASE_URL + '&q=' + encodeURIComponent(query), { + method: 'GET', + cache: 'no-cache', + signal: abortController.signal + }).then((response) => { + response.json().then((responseJson) => { + renderGifs(responseJson, $tenorModal, trumbowyg, true); + }); + }).catch(() => { + onError(); + }); + }; + var throttledInputRequest = trumbowygThrottle(searchGifsOnInput, trumbowyg.o.plugins.tenor.throttleDelay); + + $tenorInput.on('input', throttledInputRequest); + $tenorInput.focus(); + + $tenorClose.one('click', function () { + $tenorModal.trigger(CANCEL_EVENT); + }); + + var throttledQuery = trumbowygThrottle(function () { + if ($tenorModalScroll.scrollTop() + $tenorModalScroll.innerHeight() >= $tenorModalScroll[0].scrollHeight - 100) { + if (nextCursor) { + var query = $tenorInput.val(); + var url = query.length === 0 ? DEFAULT_URL : BASE_URL + '&q=' + encodeURIComponent(query); + url += '&pos=' + nextCursor; + + fetch(url, { + method: 'GET', + cache: 'no-cache', + signal: abortController.signal + }).then((response) => { + response.json().then((responseJson) => { + renderGifs(responseJson, $tenorModal, trumbowyg, false); + }); + }).catch(() => { + onError(); + }); + } + } + }, 500); + + // Infinite scrolling + $tenorModalScroll.on('scroll', throttledQuery); + } + }); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/tenor/trumbowyg.tenor.min.js b/dist/plugins/tenor/trumbowyg.tenor.min.js new file mode 100644 index 000000000..f9fb92042 --- /dev/null +++ b/dist/plugins/tenor/trumbowyg.tenor.min.js @@ -0,0 +1 @@ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{tenor:"Insert GIF"},az:{tenor:"GIF yerləşdir"},by:{tenor:"Уставіць GIF"},de:{tenor:"GIF einfügen"},et:{tenor:"Sisesta GIF"},fr:{tenor:"Insérer un GIF"},hu:{tenor:"GIF beszúrás"},ru:{tenor:"Вставить GIF"},sl:{tenor:"Vstavi GIF"},tr:{tenor:"GIF ekle"}}});var t="tbwcancel",n=null;function o(e,t){var n,o;return function(){var r=this,i=(new Date).getTime(),l=arguments;n&&i',l=Math.min(...c),a=c.indexOf(l),u=c[a],g=10+a*(s+10);return c[a]+=n*s+10,'
'+i+"
"})).join("");if(!0===i){if(0===u.length){if(e("."+r.o.prefix+"tenor-no-result",o).length>0)return;u=''}o.empty()}o.append(u),n&&0!==n.length?l.show():l.hide();var g=function(e){e.classList.add("tbw-loaded")};e("img",o).each((function(){var e=this;e.complete?g(e):e.addEventListener("load",(function(){g(this)}))})),o.data("columnHeights",c);var f=Math.max(...c);o.css({position:"relative",height:f})}var i={apiKey:null,locale:"en_US",contentFilter:"off",throttleDelay:300,noResultGifUrl:"https://media1.tenor.com/m/KOZLvzU0o4kAAAAC/no-results.gif"};e.extend(!0,e.trumbowyg,{plugins:{tenor:{init:function(l){l.o.plugins.tenor=e.extend({},i,l.o.plugins.tenor||{}),l.addBtnDef("tenor",{fn:function(){if(null===l.o.plugins.tenor.apiKey)throw new Error("You must set a Tenor API Key");var i="https://g.tenor.com/v2/search?ar_range=all&media_filter=gif,tinygif&limit=10&key="+l.o.plugins.tenor.apiKey+"&locale="+l.o.plugins.tenor.locale+"&contentfilter="+l.o.plugins.tenor.contentFilter,a=i.replace("/search","/featured"),s=l.o.prefix,c=new AbortController,u=''+('')+('
Powered by
')+'

Loading more gifs...

';l.openModal(null,u,!1).one(t,(function(){try{c.abort(),c=new AbortController}catch(e){}l.closeModal()}));var g=e("."+s+"tenor-search"),f=e("."+s+"tenor-close"),h=e("."+s+"tenor-modal"),d=e("."+s+"tenor-modal-scroll"),p=function(){navigator.onLine||e("."+s+"tenor-offline",h).length||(h.empty(),h.append('

You are offline

'))};!function(t,n){n.on("click","img",(function(){var o=e(this).attr("data-full"),r=e(this).attr("alt");t.restoreRange(),t.execCmd("insertImage",o,!1,!0),r&&(e('img[src="'+o+'"]:not([alt])',t.$box).attr("alt",r),t.syncCode()),n.off("click","img"),t.closeModal()}))}(l,h),fetch(a,{method:"GET",cache:"no-cache",signal:c.signal}).then((e=>{e.json().then((e=>{r(e,h,l,!0)}))})).catch((()=>{p()}));var m=o((function(){var e=g.val();if(0!==e.length){try{c.abort(),c=new AbortController}catch(e){}d.scrollTop(0),fetch(i+"&q="+encodeURIComponent(e),{method:"GET",cache:"no-cache",signal:c.signal}).then((e=>{e.json().then((e=>{r(e,h,l,!0)}))})).catch((()=>{p()}))}}),l.o.plugins.tenor.throttleDelay);g.on("input",m),g.focus(),f.one("click",(function(){h.trigger(t)}));var v=o((function(){if(d.scrollTop()+d.innerHeight()>=d[0].scrollHeight-100&&n){var e=g.val(),t=0===e.length?a:i+"&q="+encodeURIComponent(e);fetch(t+="&pos="+n,{method:"GET",cache:"no-cache",signal:c.signal}).then((e=>{e.json().then((e=>{r(e,h,l,!1)}))})).catch((()=>{p()}))}}),500);d.on("scroll",v)}})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/tenor/ui/sass/trumbowyg.tenor.scss b/dist/plugins/tenor/ui/sass/trumbowyg.tenor.scss new file mode 100644 index 000000000..fb6fab808 --- /dev/null +++ b/dist/plugins/tenor/ui/sass/trumbowyg.tenor.scss @@ -0,0 +1,124 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +// Adapted from giphy plugin + +.trumbowyg-tenor-button svg { + transform: scale(1.22); +} + +.trumbowyg-tenor-search { + display: block; + width: 80%; + margin: 5%; + padding-left: 10px; + padding-right: 150px; +} + +.trumbowyg-tenor-close { + position: absolute; + top: calc(5% + 8px); + right: calc(5% - 2px); + width: 30px; + height: 30px; + background: none; + border: 1px solid transparent; + + &:hover, + &:focus { + outline: none; + background: #ecf0f1; + } + + &:focus { + border-color: rgba(0, 0, 0, 0.3); + } +} + +.trumbowyg-powered-by-tenor { + position: absolute; + top: calc(5% + 11px); + right: calc(15% + 5px); + pointer-events: none; + user-select: none; + + span { + text-transform: uppercase; + font-weight: bold; + font-size: 10px; + opacity: 0.6; + } + + svg { + width: 66px; + height: 15px; + vertical-align: middle; + margin-left: 6px; + opacity: 0.45; + } +} + +.trumbowyg-tenor-modal-scroll { + overflow: auto; + overflow-x: hidden; + height: 240px; + + .trumbowyg-tenor-loading { + display: none; + padding: 20px; + + img { + height: 25px; + } + } +} + +.trumbowyg-tenor-modal { + display: flex; + flex-wrap: wrap; + justify-content: center; + margin: 0 3%; + + .trumbowyg-tenor-no-result { + width: 100%; + margin: 0 3%; + } + + .trumbowyg-tenor-offline { + font-size: 18px; + width: 305%; + height: 600px; + margin-top: 95px; + text-align: center; + } +} + +.trumbowyg-tenor-modal .img-container { + margin-bottom: 10px; + background-color: #ecf0f1; + + img { + width: 100%; + cursor: pointer; + opacity: 0; + transition: opacity 150ms; + display: block; + + &:hover, + &:focus { + border: #2ecc71 solid 3px; + } + } + + img.tbw-loaded { + opacity: 1; + } +} diff --git a/dist/plugins/tenor/ui/trumbowyg.tenor.css b/dist/plugins/tenor/ui/trumbowyg.tenor.css new file mode 100644 index 000000000..1593f2564 --- /dev/null +++ b/dist/plugins/tenor/ui/trumbowyg.tenor.css @@ -0,0 +1,119 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg plugin stylesheet + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.trumbowyg-tenor-button svg { + -webkit-transform: scale(1.22); + transform: scale(1.22); +} + +.trumbowyg-tenor-search { + display: block; + width: 80%; + margin: 5%; + padding-left: 10px; + padding-right: 150px; +} + +.trumbowyg-tenor-close { + position: absolute; + top: calc(5% + 8px); + right: calc(5% - 2px); + width: 30px; + height: 30px; + background: none; + border: 1px solid transparent; +} +.trumbowyg-tenor-close:hover, .trumbowyg-tenor-close:focus { + outline: none; + background: #ecf0f1; +} +.trumbowyg-tenor-close:focus { + border-color: rgba(0, 0, 0, 0.3); +} + +.trumbowyg-powered-by-tenor { + position: absolute; + top: calc(5% + 11px); + right: calc(15% + 5px); + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.trumbowyg-powered-by-tenor span { + text-transform: uppercase; + font-weight: bold; + font-size: 10px; + opacity: 0.6; +} +.trumbowyg-powered-by-tenor svg { + width: 66px; + height: 15px; + vertical-align: middle; + margin-left: 6px; + opacity: 0.45; +} + +.trumbowyg-tenor-modal-scroll { + overflow: auto; + overflow-x: hidden; + height: 240px; +} +.trumbowyg-tenor-modal-scroll .trumbowyg-tenor-loading { + display: none; + padding: 20px; +} +.trumbowyg-tenor-modal-scroll .trumbowyg-tenor-loading img { + height: 25px; +} + +.trumbowyg-tenor-modal { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + margin: 0 3%; +} +.trumbowyg-tenor-modal .trumbowyg-tenor-no-result { + width: 100%; + margin: 0 3%; +} +.trumbowyg-tenor-modal .trumbowyg-tenor-offline { + font-size: 18px; + width: 305%; + height: 600px; + margin-top: 95px; + text-align: center; +} + +.trumbowyg-tenor-modal .img-container { + margin-bottom: 10px; + background-color: #ecf0f1; +} +.trumbowyg-tenor-modal .img-container img { + width: 100%; + cursor: pointer; + opacity: 0; + -webkit-transition: opacity 150ms; + transition: opacity 150ms; + display: block; +} +.trumbowyg-tenor-modal .img-container img:hover, .trumbowyg-tenor-modal .img-container img:focus { + border: #2ecc71 solid 3px; +} +.trumbowyg-tenor-modal .img-container img.tbw-loaded { + opacity: 1; +} \ No newline at end of file diff --git a/dist/plugins/tenor/ui/trumbowyg.tenor.min.css b/dist/plugins/tenor/ui/trumbowyg.tenor.min.css new file mode 100644 index 000000000..ca2cf8a32 --- /dev/null +++ b/dist/plugins/tenor/ui/trumbowyg.tenor.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v2.31.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.trumbowyg-tenor-button svg{-webkit-transform:scale(1.22);transform:scale(1.22)}.trumbowyg-tenor-search{display:block;width:80%;margin:5%;padding-left:10px;padding-right:150px}.trumbowyg-tenor-close{position:absolute;top:calc(5% + 8px);right:calc(5% - 2px);width:30px;height:30px;background:0 0;border:1px solid transparent}.trumbowyg-tenor-close:focus,.trumbowyg-tenor-close:hover{outline:0;background:#ecf0f1}.trumbowyg-tenor-close:focus{border-color:rgba(0,0,0,.3)}.trumbowyg-powered-by-tenor{position:absolute;top:calc(5% + 11px);right:calc(15% + 5px);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-powered-by-tenor span{text-transform:uppercase;font-weight:700;font-size:10px;opacity:.6}.trumbowyg-powered-by-tenor svg{width:66px;height:15px;vertical-align:middle;margin-left:6px;opacity:.45}.trumbowyg-tenor-modal-scroll{overflow:auto;overflow-x:hidden;height:240px}.trumbowyg-tenor-modal-scroll .trumbowyg-tenor-loading{display:none;padding:20px}.trumbowyg-tenor-modal-scroll .trumbowyg-tenor-loading img{height:25px}.trumbowyg-tenor-modal{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:0 3%}.trumbowyg-tenor-modal .trumbowyg-tenor-no-result{width:100%;margin:0 3%}.trumbowyg-tenor-modal .trumbowyg-tenor-offline{font-size:18px;width:305%;height:600px;margin-top:95px;text-align:center}.trumbowyg-tenor-modal .img-container{margin-bottom:10px;background-color:#ecf0f1}.trumbowyg-tenor-modal .img-container img{width:100%;cursor:pointer;opacity:0;-webkit-transition:opacity 150ms;transition:opacity 150ms;display:block}.trumbowyg-tenor-modal .img-container img:focus,.trumbowyg-tenor-modal .img-container img:hover{border:#2ecc71 solid 3px}.trumbowyg-tenor-modal .img-container img.tbw-loaded{opacity:1} \ No newline at end of file diff --git a/dist/plugins/upload/trumbowyg.upload.js b/dist/plugins/upload/trumbowyg.upload.js new file mode 100644 index 000000000..313d1613b --- /dev/null +++ b/dist/plugins/upload/trumbowyg.upload.js @@ -0,0 +1,342 @@ +/* =========================================================== + * trumbowyg.upload.js v1.2 + * Upload plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Mod by : Aleksandr-ru + * Twitter : @Aleksandr_ru + * Website : aleksandr.ru + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + serverPath: '', + fileFieldName: 'fileToUpload', + data: [], // Additional data for ajax [{name: 'key', value: 'value'}] + headers: {}, // Additional headers + xhrFields: {}, // Additional fields + urlPropertyName: 'file', // How to get url from the json response (for instance 'url' for {url: ....}) + statusPropertyName: 'success', // How to get status from the json response + success: undefined, // Success callback: function (data, trumbowyg, $modal, values) {} + error: undefined, // Error callback: function () {} + imageWidthModalEdit: false // Add ability to edit image width + }; + + function getDeep(object, propertyParts) { + var mainProperty = propertyParts.shift(), + otherProperties = propertyParts; + + if (object !== null) { + if (otherProperties.length === 0) { + return object[mainProperty]; + } + + if (typeof object === 'object') { + return getDeep(object[mainProperty], otherProperties); + } + } + return object; + } + + function runXhrRequest(url, data, options) { + var xhrRequest = new XMLHttpRequest(); + xhrRequest.open( + 'POST', + url, + true + ); + + // Set Headers + Object.keys(options.headers).forEach((headerKey) => { + xhrRequest.setRequestHeader(headerKey, options.headers[headerKey]); + }); + + // Set XHR fields + Object.keys(options.xhrFields).forEach((xhrFieldKey) => { + xhrRequest[xhrFieldKey] = options.headers[xhrFieldKey]; + }); + + // Progress + xhrRequest.upload.addEventListener('progress', function (e) { + options.progress(e); + }, false); + + // Success + xhrRequest.onreadystatechange = function() { + if (xhrRequest.readyState !== 4) { + return; + } + + if ((xhrRequest.status < 200 || xhrRequest.status >= 300) && xhrRequest.status !== 304) { + options.error(); + xhrRequest = null; + return; + } + + var jsonResponse = JSON.parse(xhrRequest.responseText); + options.success(jsonResponse); + + xhrRequest = null; + }; + + xhrRequest.send(data); + } + + $.extend(true, $.trumbowyg, { + langs: { + // jshint camelcase:false + en: { + upload: 'Upload', + file: 'File', + uploadError: 'Error' + }, + az: { + upload: 'Yüklə', + file: 'Fayl', + uploadError: 'Xəta' + }, + by: { + upload: 'Загрузка', + file: 'Файл', + uploadError: 'Памылка' + }, + ca: { + upload: 'Pujar fitxer', + file: 'Fitxer', + uploadError: 'Error' + }, + cs: { + upload: 'Nahrát obrázek', + file: 'Soubor', + uploadError: 'Chyba' + }, + da: { + upload: 'Upload', + file: 'Fil', + uploadError: 'Fejl' + }, + de: { + upload: 'Hochladen', + file: 'Datei', + uploadError: 'Fehler' + }, + es: { + upload: 'Subir archivo', + file: 'Archivo', + uploadError: 'Error' + }, + et: { + upload: 'Lae üles', + file: 'Fail', + uploadError: 'Viga' + }, + fr: { + upload: 'Envoi', + file: 'Fichier', + uploadError: 'Erreur' + }, + hu: { + upload: 'Feltöltés', + file: 'Fájl', + uploadError: 'Hiba' + }, + ja: { + upload: 'アップロード', + file: 'ファイル', + uploadError: 'エラー' + }, + ko: { + upload: '그림 올리기', + file: '파일', + uploadError: '에러' + }, + pt_br: { + upload: 'Enviar do local', + file: 'Arquivo', + uploadError: 'Erro' + }, + ru: { + upload: 'Загрузка', + file: 'Файл', + uploadError: 'Ошибка' + }, + sl: { + upload: 'Naloži datoteko', + file: 'Datoteka', + uploadError: 'Napaka' + }, + sk: { + upload: 'Nahrať', + file: 'Súbor', + uploadError: 'Chyba' + }, + tr: { + upload: 'Yükle', + file: 'Dosya', + uploadError: 'Hata' + }, + zh_cn: { + upload: '上传', + file: '文件', + uploadError: '错误' + }, + zh_tw: { + upload: '上傳', + file: '文件', + uploadError: '錯誤' + }, + }, + // jshint camelcase:true + + plugins: { + upload: { + init: function (trumbowyg) { + trumbowyg.o.plugins.upload = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.upload || {}); + var btnDef = { + fn: function () { + trumbowyg.saveRange(); + + var file, + prefix = trumbowyg.o.prefix; + + var fields = { + file: { + type: 'file', + required: true, + attributes: { + accept: 'image/*' + } + }, + alt: { + label: 'description', + value: trumbowyg.getRangeText() + } + }; + + if (trumbowyg.o.plugins.upload.imageWidthModalEdit) { + fields.width = { + value: '' + }; + } + + // Prevent multiple submissions while uploading + var isUploading = false; + + var $modal = trumbowyg.openModalInsert( + // Title + trumbowyg.lang.upload, + + // Fields + fields, + + // Callback + function (values) { + const uploadPluginOptions = trumbowyg.o.plugins.upload; + + if (isUploading) { + return; + } + isUploading = true; + + var data = new FormData(); + data.append(uploadPluginOptions.fileFieldName, file); + + uploadPluginOptions.data.map(function (cur) { + data.append(cur.name, cur.value); + }); + + $.map(values, function (curr, key) { + if (key !== 'file') { + data.append(key, curr); + } + }); + + if ($('.' + prefix + 'progress', $modal).length === 0) { + $('.' + prefix + 'modal-title', $modal) + .after( + $('
', { + 'class': prefix + 'progress' + }).append( + $('
', { + 'class': prefix + 'progress-bar' + }) + ) + ); + } + + runXhrRequest( + uploadPluginOptions.serverPath, + data, + { + headers: uploadPluginOptions.headers, + xhrFields: uploadPluginOptions.xhrFields, + + progress: function (e) { + $('.' + prefix + 'progress-bar').css('width', Math.round(e.loaded * 100 / e.total) + '%'); + }, + + success: function (data) { + isUploading = false; + + if (uploadPluginOptions.success) { + uploadPluginOptions.success(data, trumbowyg, $modal, values); + return; + } + + if (!getDeep(data, uploadPluginOptions.statusPropertyName.split('.'))) { + trumbowyg.addErrorOnModalField( + $('input[type=file]', $modal), + trumbowyg.lang[data.message] + ); + trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg, data]); + return; + } + + var url = getDeep(data, uploadPluginOptions.urlPropertyName.split('.')); + trumbowyg.execCmd('insertImage', url, false, true); + var $img = $('img[src="' + url + '"]:not([alt])', trumbowyg.$box); + $img.attr('alt', values.alt); + if (uploadPluginOptions.imageWidthModalEdit && parseInt(values.width) > 0) { + $img.attr({ + width: values.width + }); + } + trumbowyg.syncCode(); + setTimeout(function () { + trumbowyg.closeModal(); + }, 250); + trumbowyg.$c.trigger('tbwuploadsuccess', [trumbowyg, data, url]); + }, + + error: uploadPluginOptions.error || function () { + trumbowyg.addErrorOnModalField( + $('input[type=file]', $modal), + trumbowyg.lang.uploadError + ); + trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg]); + + isUploading = false; + } + } + ); + } + ); + + $('input[type=file]').on('change', function (e) { + // We just get the first. + file = e.target.files[0]; + }); + } + }; + + trumbowyg.addBtnDef('upload', btnDef); + } + } + } + }); +})(jQuery); diff --git a/dist/plugins/upload/trumbowyg.upload.min.js b/dist/plugins/upload/trumbowyg.upload.min.js new file mode 100644 index 000000000..26d0a4335 --- /dev/null +++ b/dist/plugins/upload/trumbowyg.upload.min.js @@ -0,0 +1,13 @@ +/* =========================================================== + * trumbowyg.upload.js v1.2 + * Upload plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + * Mod by : Aleksandr-ru + * Twitter : @Aleksandr_ru + * Website : aleksandr.ru + */ +!function(r){"use strict";var e={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};function a(r,e){var o=e.shift(),l=e;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return a(r[o],l)}return r}r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},az:{upload:"Yüklə",file:"Fayl",uploadError:"Xəta"},by:{upload:"Загрузка",file:"Файл",uploadError:"Памылка"},ca:{upload:"Pujar fitxer",file:"Fitxer",uploadError:"Error"},cs:{upload:"Nahrát obrázek",file:"Soubor",uploadError:"Chyba"},da:{upload:"Upload",file:"Fil",uploadError:"Fejl"},de:{upload:"Hochladen",file:"Datei",uploadError:"Fehler"},es:{upload:"Subir archivo",file:"Archivo",uploadError:"Error"},et:{upload:"Lae üles",file:"Fail",uploadError:"Viga"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"},hu:{upload:"Feltöltés",file:"Fájl",uploadError:"Hiba"},ja:{upload:"アップロード",file:"ファイル",uploadError:"エラー"},ko:{upload:"그림 올리기",file:"파일",uploadError:"에러"},pt_br:{upload:"Enviar do local",file:"Arquivo",uploadError:"Erro"},ru:{upload:"Загрузка",file:"Файл",uploadError:"Ошибка"},sl:{upload:"Naloži datoteko",file:"Datoteka",uploadError:"Napaka"},sk:{upload:"Nahrať",file:"Súbor",uploadError:"Chyba"},tr:{upload:"Yükle",file:"Dosya",uploadError:"Hata"},zh_cn:{upload:"上传",file:"文件",uploadError:"错误"},zh_tw:{upload:"上傳",file:"文件",uploadError:"錯誤"}},plugins:{upload:{init:function(o){o.o.plugins.upload=r.extend(!0,{},e,o.o.plugins.upload||{});var l={fn:function(){o.saveRange();var e,l=o.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:o.getRangeText()}};o.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var i=!1,d=o.openModalInsert(o.lang.upload,t,(function(t){const u=o.o.plugins.upload;if(!i){i=!0;var s=new FormData;s.append(u.fileFieldName,e),u.data.map((function(r){s.append(r.name,r.value)})),r.map(t,(function(r,e){"file"!==e&&s.append(e,r)})),0===r("."+l+"progress",d).length&&r("."+l+"modal-title",d).after(r("
",{class:l+"progress"}).append(r("
",{class:l+"progress-bar"}))),function(r,e,a){var o=new XMLHttpRequest;o.open("POST",r,!0),Object.keys(a.headers).forEach((r=>{o.setRequestHeader(r,a.headers[r])})),Object.keys(a.xhrFields).forEach((r=>{o[r]=a.headers[r]})),o.upload.addEventListener("progress",(function(r){a.progress(r)}),!1),o.onreadystatechange=function(){if(4===o.readyState){if((o.status<200||o.status>=300)&&304!==o.status)return a.error(),void(o=null);var r=JSON.parse(o.responseText);a.success(r),o=null}},o.send(e)}(u.serverPath,s,{headers:u.headers,xhrFields:u.xhrFields,progress:function(e){r("."+l+"progress-bar").css("width",Math.round(100*e.loaded/e.total)+"%")},success:function(e){if(i=!1,u.success)u.success(e,o,d,t);else{if(!a(e,u.statusPropertyName.split(".")))return o.addErrorOnModalField(r("input[type=file]",d),o.lang[e.message]),void o.$c.trigger("tbwuploaderror",[o,e]);var l=a(e,u.urlPropertyName.split("."));o.execCmd("insertImage",l,!1,!0);var s=r('img[src="'+l+'"]:not([alt])',o.$box);s.attr("alt",t.alt),u.imageWidthModalEdit&&parseInt(t.width)>0&&s.attr({width:t.width}),o.syncCode(),setTimeout((function(){o.closeModal()}),250),o.$c.trigger("tbwuploadsuccess",[o,e,l])}},error:u.error||function(){o.addErrorOnModalField(r("input[type=file]",d),o.lang.uploadError),o.$c.trigger("tbwuploaderror",[o]),i=!1}})}}));r("input[type=file]").on("change",(function(r){e=r.target.files[0]}))}};o.addBtnDef("upload",l)}}}})}(jQuery); \ No newline at end of file diff --git a/dist/trumbowyg.js b/dist/trumbowyg.js new file mode 100644 index 000000000..5c27f8b0f --- /dev/null +++ b/dist/trumbowyg.js @@ -0,0 +1,2058 @@ +/** + * Trumbowyg v2.31.0 - A lightweight WYSIWYG editor + * Trumbowyg core file + * ------------------------ + * @link https://alex-d.github.io/Trumbowyg/ + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +jQuery.trumbowyg = { + langs: { + en: { + viewHTML: 'View HTML', + + undo: 'Undo', + redo: 'Redo', + + formatting: 'Formatting', + p: 'Paragraph', + blockquote: 'Quote', + code: 'Code', + header: 'Header', + + bold: 'Bold', + italic: 'Italic', + strikethrough: 'Strikethrough', + underline: 'Underline', + + strong: 'Strong', + em: 'Emphasis', + del: 'Deleted', + + superscript: 'Superscript', + subscript: 'Subscript', + + unorderedList: 'Unordered list', + orderedList: 'Ordered list', + + insertImage: 'Insert Image', + link: 'Link', + createLink: 'Insert link', + unlink: 'Remove link', + + _self: 'Same tab (default)', + _blank: 'New tab', + + justifyLeft: 'Align Left', + justifyCenter: 'Align Center', + justifyRight: 'Align Right', + justifyFull: 'Align Justify', + + horizontalRule: 'Insert horizontal rule', + removeformat: 'Remove format', + + fullscreen: 'Fullscreen', + + close: 'Close', + + submit: 'Confirm', + reset: 'Cancel', + + required: 'Required', + description: 'Description', + title: 'Title', + text: 'Text', + target: 'Target', + width: 'Width' + } + }, + + // Plugins + plugins: {}, + + // SVG Path globally + svgPath: null, + svgAbsoluteUseHref: false, + + hideButtonTexts: null +}; + +// Makes default options read-only +Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { + value: { + lang: 'en', + + fixedBtnPane: false, + fixedFullWidth: false, + autogrow: false, + autogrowOnEnter: false, + imageWidthModalEdit: false, + hideButtonTexts: null, + + prefix: 'trumbowyg-', + tagClasses: {}, + semantic: true, + semanticKeepAttributes: false, + resetCss: false, + removeformatPasted: false, + tabToIndent: false, + tagsToRemove: [], + tagsToKeep: ['hr', 'img', 'embed', 'iframe', 'input'], + btns: [ + ['viewHTML'], + ['undo', 'redo'], // Only supported in Blink browsers + ['formatting'], + ['strong', 'em', 'del'], + ['superscript', 'subscript'], + ['link'], + ['insertImage'], + ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], + ['unorderedList', 'orderedList'], + ['horizontalRule'], + ['removeformat'], + ['fullscreen'] + ], + // For custom button definitions + btnsDef: {}, + changeActiveDropdownIcon: false, + + inlineElementsSelector: 'a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u', + + pasteHandlers: [], + + // imgDblClickHandler: default is defined in constructor + + plugins: {}, + + urlProtocol: false, + minimalLinks: false, + linkTargets: ['_self', '_blank'], + + svgPath: null + }, + writable: false, + enumerable: true, + configurable: false +}); + +(function (navigator, window, document, $) { + 'use strict'; + + var CONFIRM_EVENT = 'tbwconfirm', + CANCEL_EVENT = 'tbwcancel'; + + $.fn.trumbowyg = function (options, params) { + var trumbowygDataName = 'trumbowyg'; + if (options === Object(options) || !options) { + return this.each(function () { + if (!$(this).data(trumbowygDataName)) { + $(this).data(trumbowygDataName, new Trumbowyg(this, options)); + } + }); + } + if (this.length === 1) { + try { + var t = $(this).data(trumbowygDataName); + switch (options) { + // Exec command + case 'execCmd': + return t.execCmd(params.cmd, params.param, params.forceCss, params.skipTrumbowyg); + + // Modal box + case 'openModal': + return t.openModal(params.title, params.content); + case 'closeModal': + return t.closeModal(); + case 'openModalInsert': + return t.openModalInsert(params.title, params.fields, params.callback); + + // Range + case 'saveRange': + return t.saveRange(); + case 'getRange': + return t.range; + case 'getRangeText': + return t.getRangeText(); + case 'restoreRange': + return t.restoreRange(); + + // Enable/disable + case 'enable': + return t.setDisabled(false); + case 'disable': + return t.setDisabled(true); + + // Toggle + case 'toggle': + return t.toggle(); + + // Destroy + case 'destroy': + return t.destroy(); + + // Empty + case 'empty': + return t.empty(); + + // HTML + case 'html': + return t.html(params); + } + } catch (c) { + } + } + + return false; + }; + + // @param: editorElem is the DOM element + var Trumbowyg = function (editorElem, options) { // jshint ignore:line + var t = this, + trumbowygIconsId = 'trumbowyg-icons', + $trumbowyg = $.trumbowyg; + + // Get the document of the element. It use to makes the plugin + // compatible on iframes. + t.doc = editorElem.ownerDocument || document; + + // jQuery object of the editor + t.$ta = $(editorElem); // $ta : Textarea + t.$c = $(editorElem); // $c : creator + + options = options || {}; + + // Localization management + if (options.lang != null || $trumbowyg.langs[options.lang] != null) { + t.lang = $.extend(true, {}, $trumbowyg.langs.en, $trumbowyg.langs[options.lang]); + } else { + t.lang = $trumbowyg.langs.en; + } + + t.hideButtonTexts = $trumbowyg.hideButtonTexts != null ? $trumbowyg.hideButtonTexts : options.hideButtonTexts; + + // SVG path + var svgPathOption = $trumbowyg.svgPath != null ? $trumbowyg.svgPath : options.svgPath; + t.hasSvg = svgPathOption !== false; + + if (svgPathOption !== false && ($trumbowyg.svgAbsoluteUseHref || $('#' + trumbowygIconsId, t.doc).length === 0)) { + if (svgPathOption == null) { + // Hack to get svgPathOption based on trumbowyg.js path + var $scriptElements = $('script[src]'); + $scriptElements.each(function (i, scriptElement) { + var source = scriptElement.src; + var matches = source.match('trumbowyg(\.min)?\.js'); + if (matches != null) { + svgPathOption = source.substring(0, source.indexOf(matches[0])) + 'ui/icons.svg'; + } + }); + } + + // Do not merge with previous if block: svgPathOption can be redefined in it. + // Here we are checking that we find a match + if (svgPathOption == null) { + console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line + } else if (!$trumbowyg.svgAbsoluteUseHref) { + var div = t.doc.createElement('div'); + div.style.width = '0'; + div.style.height = '0'; + div.style.overflow = 'hidden'; + div.style.visibility = 'hidden'; + div.id = trumbowygIconsId; + t.doc.body.insertBefore(div, t.doc.body.childNodes[0]); + fetch(svgPathOption, { + method: 'GET', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } + }).then((response) => { + response.text() + .then((svg) => { + div.innerHTML = svg; + }); + }); + } + } + + var baseHref = !!t.doc.querySelector('base') ? window.location.href.replace(window.location.hash, '') : ''; + t.svgPath = $trumbowyg.svgAbsoluteUseHref ? svgPathOption : baseHref; + + + /** + * When the button is associated to a empty object + * fn and title attributes are defined from the button key value + * + * For example + * foo: {} + * is equivalent to : + * foo: { + * fn: 'foo', + * title: this.lang.foo + * } + */ + var h = t.lang.header, // Header translation + isBlinkFunction = function () { + return (window.chrome || (window.Intl && Intl.v8BreakIterator)) && 'CSS' in window; + }; + t.btnsDef = { + viewHTML: { + fn: 'toggle', + class: 'trumbowyg-not-disable' + }, + + undo: { + isSupported: isBlinkFunction, + key: 'Z' + }, + redo: { + isSupported: isBlinkFunction, + key: 'Y' + }, + + p: { + fn: 'formatBlock' + }, + blockquote: { + fn: 'formatBlock' + }, + h1: { + fn: 'formatBlock', + title: h + ' 1' + }, + h2: { + fn: 'formatBlock', + title: h + ' 2' + }, + h3: { + fn: 'formatBlock', + title: h + ' 3' + }, + h4: { + fn: 'formatBlock', + title: h + ' 4' + }, + h5: { + fn: 'formatBlock', + title: h + ' 5' + }, + h6: { + fn: 'formatBlock', + title: h + ' 6' + }, + subscript: { + tag: 'sub' + }, + superscript: { + tag: 'sup' + }, + + bold: { + key: 'B', + tag: 'b' + }, + italic: { + key: 'I', + tag: 'i' + }, + underline: { + tag: 'u' + }, + strikethrough: { + tag: 'strike' + }, + + strong: { + fn: 'bold', + key: 'B' + }, + em: { + fn: 'italic', + key: 'I' + }, + del: { + fn: 'strikethrough' + }, + + createLink: { + key: 'K', + tag: 'a' + }, + unlink: {}, + + insertImage: {}, + + justifyLeft: { + tag: 'left', + forceCss: true + }, + justifyCenter: { + tag: 'center', + forceCss: true + }, + justifyRight: { + tag: 'right', + forceCss: true + }, + justifyFull: { + tag: 'justify', + forceCss: true + }, + + unorderedList: { + fn: 'insertUnorderedList', + tag: 'ul' + }, + orderedList: { + fn: 'insertOrderedList', + tag: 'ol' + }, + + horizontalRule: { + fn: 'insertHorizontalRule' + }, + + removeformat: {}, + + fullscreen: { + class: 'trumbowyg-not-disable' + }, + close: { + fn: 'destroy', + class: 'trumbowyg-not-disable' + }, + + // Dropdowns + formatting: { + dropdown: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4'], + ico: 'p' + }, + link: { + dropdown: ['createLink', 'unlink'] + } + }; + + // Default Options + t.o = $.extend(true, {}, $trumbowyg.defaultOptions, options); + if (!t.o.hasOwnProperty('imgDblClickHandler')) { + t.o.imgDblClickHandler = t.getDefaultImgDblClickHandler(); + } + + t.urlPrefix = t.setupUrlPrefix(); + + t.disabled = t.o.disabled || (editorElem.nodeName === 'TEXTAREA' && editorElem.disabled); + + if (options.btns) { + t.o.btns = options.btns; + } else if (!t.o.semantic) { + t.o.btns[3] = ['bold', 'italic', 'underline', 'strikethrough']; + } + + $.each(t.o.btnsDef, function (btnName, btnDef) { + t.addBtnDef(btnName, btnDef); + }); + + // put this here in the event it would be merged in with options + t.eventNamespace = 'trumbowyg-event'; + + // Keyboard shortcuts are load in this array + t.keys = []; + + // Tag to button dynamically hydrated + t.tagToButton = {}; + t.tagHandlers = []; + + // Admit multiple paste handlers + t.pasteHandlers = [].concat(t.o.pasteHandlers); + + // Check if browser is IE + t.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') !== -1; + + // Check if we are on macOs + t.isMac = navigator.platform.toUpperCase().indexOf('MAC') !== -1; + + t.init(); + }; + + Trumbowyg.prototype = { + DEFAULT_SEMANTIC_MAP: { + 'b': 'strong', + 'i': 'em', + 's': 'del', + 'strike': 'del', + 'div': 'p' + }, + + init: function () { + var t = this; + t.height = t.$ta.outerHeight() - 39; // Remove button pane height + + t.initPlugins(); + + try { + // Disable image resize, try-catch for old IE + t.doc.execCommand('enableObjectResizing', false, false); + t.doc.execCommand('defaultParagraphSeparator', false, 'p'); + } catch (e) { + } + + t.buildEditor(); + t.buildBtnPane(); + + t.fixedBtnPaneEvents(); + + t.buildOverlay(); + + setTimeout(function () { + if (t.disabled) { + t.setDisabled(true); + } + t.$c.trigger('tbwinit'); + }); + }, + + addBtnDef: function (btnName, btnDef) { + this.btnsDef[btnName] = $.extend(btnDef, this.btnsDef[btnName] || {}); + }, + + setupUrlPrefix: function () { + var protocol = this.o.urlProtocol; + if (!protocol) { + return; + } + + if (typeof (protocol) !== 'string') { + return 'https://'; + } + return protocol.replace('://', '') + '://'; + }, + + buildEditor: function () { + var t = this, + prefix = t.o.prefix, + html = ''; + + t.$box = $('
', { + class: prefix + 'box ' + prefix + 'editor-visible ' + prefix + t.o.lang + ' trumbowyg' + }); + + t.$edBox = $('
', { + class: prefix + 'editor-box' + }); + + // $ta = Textarea + // $ed = Editor + t.isTextarea = t.$ta.is('textarea'); + if (t.isTextarea) { + html = t.$ta.val(); + t.$ed = $('
') + .appendTo(t.$edBox); + t.$box + .insertAfter(t.$ta) + .append(t.$edBox, t.$ta); + } else { + t.$ed = t.$ta; + html = t.$ed.html(); + + t.$ta = $('
",{scope:"col"}).appendTo(a);l.appendTo(t);for(var r=e("
").appendTo(c);r.appendTo(t),s(t);for(var f=o.range.endContainer;f.nodeType!==Node.ELEMENT_NODE;)f=f.parentNode;f!==o.$ed[0]&&o.range.setEndAfter(f),o.range.collapse(),o.range.insertNode(t[0]),"P"===f.nodeName&&0===f.textContent.trim().length&&f.remove(),o.syncCode(),$()},c=function(t){for(var l=e("tr",t),a=[],o=0;o0?d:1,10),b=parseInt(i>0?i:1,10);void 0!==a[t][o];)o+=1;a[t][o]={tag:n.tagName,element:n,colspan:s,rowspan:b};for(var c=1;c"),b=d.index(a);if(t)b=Math.max(0,b-1),a=e(d[b]);else{var c=e(n).closest("td, th",o.$ed[0]).attr("rowspan"),u=parseInt(c||1,10);a=e(d[b+=u-1])}var f=e("tbody tr",l),g=0!==a.closest("thead").length;g&&(a=f.first());for(var m=r[b],p=r[b+1],A=r[0].length,v=0;v").appendTo(i)}0===b&&(t||g)?a.before(i):a.after(i),s(l),$()}))},g={title:o.lang.tableAddRowAbove,text:o.lang.tableAddRowAbove,ico:"row-above",fn:f(!0)},m={title:o.lang.tableAddRow,text:o.lang.tableAddRow,ico:"row-below",fn:f(!1)},p={title:o.lang.tableAddHeaderRow,text:o.lang.tableAddHeaderRow,ico:"header-row",fn:u((function(t,l,a,o){if(0!==e("thead",t).length)return!1;for(var n=o[0].length,r=e("