diff --git a/dist/langs/ca.min.js b/dist/langs/ca.min.js new file mode 100644 index 000000000..94717ac68 --- /dev/null +++ b/dist/langs/ca.min.js @@ -0,0 +1,11 @@ +/* =========================================================== + * ca.js + * Catalan translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Àlfons Sánchez (alsanan) + * Twitter : @alsanan + * Website : about.me/alsanan + * Github : https://github.com/alsanan + */ +jQuery.trumbowyg.langs.ca={viewHTML:"Veure HTML",formatting:"Formatar",p:"Paragraf",blockquote:"Citació",code:"Codi",header:"Títol",bold:"Negreta",italic:"Itàlica",strikethrough:"Suprimir",underline:"Subratllat",strong:"Forta",em:"Èmfasi",del:"Apagar",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",insertImage:"Inserir imatge",insertVideo:"Inserir vídeo",link:"Enllaç",createLink:"Crear un enllaç",unlink:"Eliminar enllaç",justifyLeft:"Alinear a esquerra",justifyCenter:"Centrar",justifyRight:"Alinear a dreta",justifyFull:"Justificar",horizontalRule:"Inserir separador horitzontal",fullscreen:"Pantalla completa",close:"Tancar",submit:"Enviar",reset:"Reiniciar",invalidUrl:"URL invàlida",required:"Obligatori",description:"Descripció",title:"Títol",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/da.min.js b/dist/langs/da.min.js new file mode 100644 index 000000000..f9106e579 --- /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",formatting:"Formatter",p:"Afsnit",blockquote:"Citat",code:"Kode",header:"Overskrift",bold:"Fed",italic:"Kursiv",strikethrough:"Gennemstreg",underline:"Understreg",strong:"Vigtig",em:"Fremhæv",del:"Slettet",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",fullscreen:"Fuld skærm",close:"Luk",submit:"Bekræft",reset:"Annuller",invalidUrl:"Ugyldig URL",required:"Påkrævet",description:"Beskrivelse",title:"Titel",text:"Tekst"}; \ No newline at end of file diff --git a/dist/langs/de.min.js b/dist/langs/de.min.js new file mode 100644 index 000000000..1b9e936ae --- /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 + * Github : https://github.com/Manfred62 + */ +jQuery.trumbowyg.langs.de={viewHTML:"HTML anzeigen",formatting:"Formatieren",p:"Absatz",blockquote:"Zitat",code:"Code",header:"Überschrift",bold:"Fett",italic:"Kursiv",strikethrough:"Durchgestrichen",underline:"Unterstrichen",strong:"Wichtig",em:"Betont",del:"Gelöscht",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",insertImage:"Bild einfügen",insertVideo:"Video einfügen",link:"Link",createLink:"Link einfügen",unlink:"Link entfernen",justifyLeft:"Links ausrichten",justifyCenter:"Zentrieren",justifyRight:"Rechts ausrichten",justifyFull:"Blocksatz",horizontalRule:"Horizontale Linie einfügen",fullscreen:"Vollbild",close:"Schliessen",submit:"Bestätigen",reset:"Rücksetzen",invalidUrl:"Ungültige URL",required:"Erforderlich",description:"Beschreibung",title:"Titel",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/es.min.js b/dist/langs/es.min.js new file mode 100644 index 000000000..b4bcae9f5 --- /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",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",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",fullscreen:"Pantalla completa",close:"Cerrar",submit:"Enviar",reset:"Cancelar",invalidUrl:"URL no válida",required:"Obligatorio",description:"Descripción",title:"Título",text:"Texto"}; \ No newline at end of file diff --git a/dist/langs/es_ar.min.js b/dist/langs/es_ar.min.js new file mode 100644 index 000000000..826c108be --- /dev/null +++ b/dist/langs/es_ar.min.js @@ -0,0 +1,9 @@ +/* =========================================================== + * es_ar.js + * Spanish (Argentina) translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Félix Vera + * Email : felix.vera@gmail.com + */ +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",invalidUrl:"URL inválida",required:"Obligatorio",description:"Descripción",title:"Título",text:"Texto"}; \ No newline at end of file diff --git a/dist/langs/fa.min.js b/dist/langs/fa.min.js new file mode 100644 index 000000000..efdede4d5 --- /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={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:"انصراف",invalidUrl:"لینک نامعتبر",required:"اجباری",description:"توضیحات",title:"عنوان",text:"متن"}; \ No newline at end of file diff --git a/dist/langs/fi.min.js b/dist/langs/fi.min.js new file mode 100644 index 000000000..439e23625 --- /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",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:"Numeroimaton lista",orderedList:"Numeroitu lista",insertImage:"Lisää kuva",insertVideo:"Lisää video",link:"Linkki",createLink:"Luo linkki",unlink:"Poista linkki",justifyLeft:"Asemoi vasemmalle",justifyCenter:"Keskitä",justifyRight:"Asemoi oikealle",justifyFull:"Tasaa",horizontalRule:"Vaakaviiva",fullscreen:"Kokoruutu",close:"Sulje",submit:"Lähetä",reset:"Palauta",invalidUrl:"Viallinen URL-osoite",required:"Pakollinen",description:"Kuvaus",title:"Otsikko",text:"Teksti"}; \ No newline at end of file diff --git a/dist/langs/fr.min.js b/dist/langs/fr.min.js new file mode 100644 index 000000000..7f871017f --- /dev/null +++ b/dist/langs/fr.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * fr.js + * French translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ +jQuery.trumbowyg.langs.fr={viewHTML:"Voir le HTML",formatting:"Format",p:"Paragraphe",blockquote:"Citation",code:"Code",header:"Titre",bold:"Gras",italic:"Italique",strikethrough:"Rayé",underline:"Souligné",strong:"Fort",em:"Emphase",del:"Supprimé",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",justifyLeft:"Aligner à gauche",justifyCenter:"Centrer",justifyRight:"Aligner à droite",justifyFull:"Justifier",horizontalRule:"Insérer un séparateur horizontal",fullscreen:"Plein écran",close:"Fermer",submit:"Valider",reset:"Annuler",invalidUrl:"URL invalide",required:"Obligatoire",description:"Description",title:"Titre",text:"Texte"}; \ No newline at end of file diff --git a/dist/langs/he.min.js b/dist/langs/he.min.js new file mode 100644 index 000000000..156ea559c --- /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:"אתחל מחדש",invalidUrl:"כתובת אתר לא תקינה",required:"נחוץ",description:"תיאור",title:"כותרת",text:"טקסט"}; \ No newline at end of file diff --git a/dist/langs/id.min.js b/dist/langs/id.min.js new file mode 100644 index 000000000..6561511f3 --- /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",invalidUrl:"Tautan salah",required:"Diperlukan",description:"Deskripsi",title:"Judul",text:"Teks"}; \ No newline at end of file diff --git a/dist/langs/it.min.js b/dist/langs/it.min.js new file mode 100644 index 000000000..9f5467bee --- /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",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",invalidUrl:"URL invalido",required:"Obbligatorio",description:"Descrizione",title:"Titolo",text:"Testo"}; \ No newline at end of file diff --git a/dist/langs/ko.min.js b/dist/langs/ko.min.js new file mode 100644 index 000000000..e2afba92b --- /dev/null +++ b/dist/langs/ko.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * ko.js + * Korean translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : JoongSeob Vito Kim (dorajistyle) + * Blog : http://dorajistyle.pe.kr + * Github : https://github.com/dorajistyle + */ +jQuery.trumbowyg.langs.ko={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:"초기화",invalidUrl:"올바르지 않은 URL입니다.",required:"꼭 입력해야 합니다.",description:"설명",title:"제목",text:"본문 내용"}; \ No newline at end of file diff --git a/dist/langs/pl.min.js b/dist/langs/pl.min.js new file mode 100644 index 000000000..c9fbf4c60 --- /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óć",invalidUrl:"Nieprawidłowy URL",required:"Wymagane",description:"Opis",title:"Tytuł",text:"Tekst"}; \ No newline at end of file diff --git a/dist/langs/pt.min.js b/dist/langs/pt.min.js new file mode 100644 index 000000000..9ba374218 --- /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",formatting:"Formatar",p:"Paragráfo",blockquote:"Citação",code:"Código",header:"Título",bold:"Negrito",italic:"Itálico",strikethrough:"Suprimir",underline:"Sublinhado",strong:"Forte",em:"Ênfase",del:"Apagar",unorderedList:"Lista não ordenada",orderedList:"Liste 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",fullscreen:"Tela cheia",close:"Fechar",submit:"Enviar",reset:"Limpar",invalidUrl:"URL inválida",required:"Obrigatório",description:"Descrição",title:"Título",text:"Texto"}; \ No newline at end of file diff --git a/dist/langs/ro.min.js b/dist/langs/ro.min.js new file mode 100644 index 000000000..6141f2e59 --- /dev/null +++ b/dist/langs/ro.min.js @@ -0,0 +1,13 @@ +/* =========================================================== + * 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.pt={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ă",invalidUrl:"URL invalid",required:"Obligatoriu",description:"Descriere",title:"Titlu",text:"Text"}; \ No newline at end of file diff --git a/dist/langs/ru.min.js b/dist/langs/ru.min.js new file mode 100644 index 000000000..a3505ac5d --- /dev/null +++ b/dist/langs/ru.min.js @@ -0,0 +1,8 @@ +/* =========================================================== + * ru.js + * Russion translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Yuri Lya + */ +jQuery.trumbowyg.langs.ru={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:"Отменить",invalidUrl:"Неверный URL",required:"Обязательное",description:"Описание",title:"Подсказка",text:"Текст"}; \ No newline at end of file diff --git a/dist/langs/tr.min.js b/dist/langs/tr.min.js new file mode 100644 index 000000000..902de506c --- /dev/null +++ b/dist/langs/tr.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * tr.js + * Turkish translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Emrah Bilbay (munzur) + * Github : https://github.com/munzur + * Website: http://kafe.in/ + */ +jQuery.trumbowyg.langs.tr={viewHTML:"HTML Kodu",formatting:"Biçimlendirme",p:"Paragraf",blockquote:"Alıntı",code:"Kod",header:"Başlık",bold:"Kalın",italic:"İtalik",strikethrough:"Orta çizgi",underline:"Alt çigzi",strong:"Koyu",em:"Vurgulu",del:"Üstü çizilmiş",unorderedList:"Numarasız 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 çizgi ekle",fullscreen:"Tam ekran",close:"Kapat",submit:"Onayla",reset:"Sıfırla",invalidUrl:"Hatalı URL",required:"Gerekli",description:"Açıklama",title:"Başlık",text:"Metin"}; \ No newline at end of file diff --git a/dist/langs/zh_cn.min.js b/dist/langs/zh_cn.min.js new file mode 100644 index 000000000..62674fae6 --- /dev/null +++ b/dist/langs/zh_cn.min.js @@ -0,0 +1,10 @@ +/* =========================================================== + * 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 + */ +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:"取消",invalidUrl:"无效的 URL",required:"必需的",description:"描述",title:"标题",text:"文字"}; \ 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..2a3cc4f03 --- /dev/null +++ b/dist/plugins/base64/trumbowyg.base64.js @@ -0,0 +1,74 @@ +/* =========================================================== + * trumbowyg.base64.js v1.0 + * Base64 plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Cyril Biencourt (lizardK) + */ + +(function($){ + 'use strict'; + + $.extend(true, $.trumbowyg, { + langs: { + en: { + base64: "Image as base64", + file: "File", + errFileReaderNotSupported: "FileReader is not supported by your browser." + }, + fr: { + base64: "Image en base64", + file: "Fichier" + } + }, + + opts: { + btnsDef: { + base64: { + isSupported: function(){ + if(typeof FileReader === "undefined"){ + console.err('[Trumbowyg - Plugin base64] FileReader is not supported by your browser.'); + return false; + } + return true; + }, + func: function(params, tbw){ + var file; + tbw.openModalInsert( + // Title + tbw.lang.base64, + + // Fields + { + file: { + type: 'file', + required: true + }, + alt: { + label: 'description' + } + }, + + // Callback + function(values){ + var fReader = new FileReader(); + + fReader.onloadend = function(){ + tbw.execCmd('insertImage', fReader.result); + $(['img[src="', fReader.result, '"]:not([alt])'].join(''), tbw.$box).attr('alt', values.alt); + tbw.closeModal(); + }; + + fReader.readAsDataURL(file); + } + ); + + $('input[type=file]').on('change', function(e){ + file = e.target.files[0]; + }); + } + } + } + } + }); +})(jQuery); \ No newline at end of file diff --git a/dist/plugins/base64/trumbowyg.base64.min.js b/dist/plugins/base64/trumbowyg.base64.min.js new file mode 100644 index 000000000..645f499b2 --- /dev/null +++ b/dist/plugins/base64/trumbowyg.base64.min.js @@ -0,0 +1 @@ +!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser."},fr:{base64:"Image en base64",file:"Fichier"}},opts:{btnsDef:{base64:{isSupported:function(){return"undefined"==typeof FileReader?(console.err("[Trumbowyg - Plugin base64] FileReader is not supported by your browser."),!1):!0},func:function(r,t){var n;t.openModalInsert(t.lang.base64,{file:{type:"file",required:!0},alt:{label:"description"}},function(r){var a=new FileReader;a.onloadend=function(){t.execCmd("insertImage",a.result),e(['img[src="',a.result,'"]:not([alt])'].join(""),t.$box).attr("alt",r.alt),t.closeModal()},a.readAsDataURL(n)}),e("input[type=file]").on("change",function(e){n=e.target.files[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..aaa1b90d1 --- /dev/null +++ b/dist/plugins/colors/trumbowyg.colors.js @@ -0,0 +1,60 @@ +/* =========================================================== + * trumbowyg.colors.js v1.0 + * 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: { + en: { + foreColor: "Text color", + backColor: "Background color" + }, + fr: { + foreColor: "Couleur du text", + backColor: "Couleur de fond" + } + } + }); + + if(!$.trumbowyg.opts.colors) + $.trumbowyg.opts.colors = ['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']; + + $.extend(true, $.trumbowyg, { + opts: { + btnsDef: { + foreColor: { + dropdown: buildDropdown('foreColor') + }, + backColor: { + dropdown: buildDropdown('backColor') + } + } + } + }); + + + + function buildDropdown(func){ + var dropdown = []; + + $.each($.trumbowyg.opts.colors, function(i, color){ + var btn = '_' + func + color; + $.trumbowyg.opts.btnsDef[btn] = { + func: func, + param: '#' + color, + style: 'background-color: #' + color + ';' + }; + dropdown.push(btn); + }); + + return dropdown; + } +})(jQuery); \ No newline at end of file diff --git a/dist/plugins/colors/trumbowyg.colors.min.js b/dist/plugins/colors/trumbowyg.colors.min.js new file mode 100644 index 000000000..a760572dc --- /dev/null +++ b/dist/plugins/colors/trumbowyg.colors.min.js @@ -0,0 +1 @@ +!function(f){"use strict";function o(o){var d=[];return f.each(f.trumbowyg.opts.colors,function(c,e){var b="_"+o+e;f.trumbowyg.opts.btnsDef[b]={func:o,param:"#"+e,style:"background-color: #"+e+";"},d.push(b)}),d}f.extend(!0,f.trumbowyg,{langs:{en:{foreColor:"Text color",backColor:"Background color"},fr:{foreColor:"Couleur du text",backColor:"Couleur de fond"}}}),f.trumbowyg.opts.colors||(f.trumbowyg.opts.colors=["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"]),f.extend(!0,f.trumbowyg,{opts:{btnsDef:{foreColor:{dropdown:o("foreColor")},backColor:{dropdown:o("backColor")}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/colors/ui/images/icons-2x.png b/dist/plugins/colors/ui/images/icons-2x.png new file mode 100644 index 000000000..590d59598 Binary files /dev/null and b/dist/plugins/colors/ui/images/icons-2x.png differ diff --git a/dist/plugins/colors/ui/images/icons.png b/dist/plugins/colors/ui/images/icons.png new file mode 100644 index 000000000..71e10834d Binary files /dev/null and b/dist/plugins/colors/ui/images/icons.png differ diff --git a/dist/plugins/colors/ui/trumbowyg.colors.css b/dist/plugins/colors/ui/trumbowyg.colors.css new file mode 100644 index 000000000..6fbfbee84 --- /dev/null +++ b/dist/plugins/colors/ui/trumbowyg.colors.css @@ -0,0 +1,55 @@ +/** + * Trumbowyg v1.1.6 - A lightweight WYSIWYG editor + * Colors plugin stylesheet for Trumbowyg editor + * ------------------------ + * @link http://alex-d.github.io/Trumbowyg + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +.foreColor-trumbowyg-dropdown, .backColor-trumbowyg-dropdown { + width: 264px; + padding: 7px 5px; } + .foreColor-trumbowyg-dropdown button, .backColor-trumbowyg-dropdown button { + display: block; + position: relative; + float: left; + text-indent: -9999px; + height: 20px; + width: 20px; + border: 1px solid #333; + padding: 0; + margin: 2px; } + .foreColor-trumbowyg-dropdown button:hover::after, .foreColor-trumbowyg-dropdown button:focus::after, .backColor-trumbowyg-dropdown button:hover::after, .backColor-trumbowyg-dropdown button:focus::after { + content: " "; + display: block; + height: 27px; + width: 27px; + background: inherit; + position: absolute; + top: -5px; + left: -5px; + border: 1px solid #FFF; + -webkit-box-shadow: #000 0 0 2px; + box-shadow: #000 0 0 2px; + z-index: 10; } + +/* + * Buttons icons + */ +.trumbowyg-button-pane li button.trumbowyg-foreColor-button, .trumbowyg-button-pane li button.trumbowyg-backColor-button { + background-image: url("./images/icons.png"); } +.trumbowyg-button-pane li button.trumbowyg-foreColor-button { + background-position: 5px -20px; } +.trumbowyg-button-pane li button.trumbowyg-backColor-button { + background-position: 5px 5px; } + +@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 4/3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { + .trumbowyg-button-pane li button.trumbowyg-foreColor-button, .trumbowyg-button-pane li button.trumbowyg-backColor-button { + background-image: url("./images/icons-2x.png") !important; } + .trumbowyg-button-pane li button.trumbowyg-foreColor-button { + background-position: 5px -20px; } + .trumbowyg-button-pane li button.trumbowyg-backColor-button { + background-position: 5px 5px; } } 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..195a59f43 --- /dev/null +++ b/dist/plugins/colors/ui/trumbowyg.colors.min.css @@ -0,0 +1,2 @@ +/** Trumbowyg v1.1.6 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +.backColor-trumbowyg-dropdown,.foreColor-trumbowyg-dropdown{width:264px;padding:7px 5px}.backColor-trumbowyg-dropdown button,.foreColor-trumbowyg-dropdown button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.backColor-trumbowyg-dropdown button:focus::after,.backColor-trumbowyg-dropdown button:hover::after,.foreColor-trumbowyg-dropdown button:focus::after,.foreColor-trumbowyg-dropdown button:hover::after{content:" ";display:block;height:27px;width:27px;background:inherit;position:absolute;top:-5px;left:-5px;border:1px solid #FFF;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-button-pane li button.trumbowyg-backColor-button,.trumbowyg-button-pane li button.trumbowyg-foreColor-button{background-image:url(./images/icons.png)}.trumbowyg-button-pane li button.trumbowyg-foreColor-button{background-position:5px -20px}.trumbowyg-button-pane li button.trumbowyg-backColor-button{background-position:5px 5px}@media only screen and (-webkit-min-device-pixel-ratio:1.3),only screen and (min--moz-device-pixel-ratio:1.3),only screen and (-o-min-device-pixel-ratio:4/3),only screen and (min-device-pixel-ratio:1.3),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.trumbowyg-button-pane li button.trumbowyg-backColor-button,.trumbowyg-button-pane li button.trumbowyg-foreColor-button{background-image:url(./images/icons-2x.png)!important}.trumbowyg-button-pane li button.trumbowyg-foreColor-button{background-position:5px -20px}.trumbowyg-button-pane li button.trumbowyg-backColor-button{background-position:5px 5px}} \ 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..1b95d3760 --- /dev/null +++ b/dist/plugins/upload/trumbowyg.upload.js @@ -0,0 +1,140 @@ +/* =========================================================== + * trumbowyg.upload.js v1.0 + * Upload plugin for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author : Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +(function($){ + 'use strict'; + + addXhrProgressEvent(); + + $.extend(true, $.trumbowyg, { + langs: { + en: { + upload: "Upload", + file: "File", + uploadError: "Error" + }, + fr: { + upload: "Envoi", + file: "Fichier", + uploadError: "Erreur" + } + }, + + upload: { + serverPath: './src/plugins/upload/trumbowyg.upload.php' + }, + + opts: { + btnsDef: { + upload: { + func: function(params, tbw){ + var file, + pfx = tbw.o.prefix; + + var $modal = tbw.openModalInsert( + // Title + tbw.lang.upload, + + // Fields + { + file: { + type: 'file', + required: true + }, + alt: { + label: 'description' + } + }, + + // Callback + function(){ + var data = new FormData(); + data.append('fileToUpload', file); + + if($('.' + pfx +'progress', $modal).length === 0) + $('.' + pfx + 'modal-title', $modal) + .after( + $('
', { + 'class': pfx +'progress' + }) + .append( + $('
', { + 'class': pfx +'progress-bar' + }) + ) + ); + + $.ajax({ + url: $.trumbowyg.upload.serverPath, + type: 'POST', + data: data, + cache: false, + dataType: 'json', + processData: false, + contentType: false, + + progressUpload: function(e){ + $('.' + pfx + 'progress-bar').stop().animate({ + width: Math.round(e.loaded * 100 / e.total) + '%' + }, 200); + }, + + success: function(data){ + if(data.message == "uploadSuccess") { + tbw.execCmd('insertImage', data.file); + setTimeout(function(){ + tbw.closeModal(); + }, 250); + } else { + tbw.addErrorOnModalField( + $('input[type=file]', $modal), + tbw.lang[data.message] + ); + } + }, + error: function(){ + tbw.addErrorOnModalField( + $('input[type=file]', $modal), + tbw.lang.uploadError + ); + } + }); + } + ); + + $('input[type=file]').on('change', function(e){ + file = e.target.files[0]; + }); + } + } + } + } + }); + + + function addXhrProgressEvent(){ + if (!$.trumbowyg && !$.trumbowyg.addedXhrProgressEvent) { // Avoid adding progress event multiple times + var originalXhr = $.ajaxSettings.xhr; + $.ajaxSetup({ + xhr: function() { + var req = originalXhr(), + that = this; + if(req && typeof req.upload == "object" && that.progressUpload !== undefined) + req.upload.addEventListener("progress", function(e){ + that.progressUpload(e); + }, false); + + return req; + } + }); + $.trumbowyg.addedXhrProgressEvent = true; + } + } +})(jQuery); \ No newline at end of file diff --git a/dist/plugins/upload/trumbowyg.upload.min.js b/dist/plugins/upload/trumbowyg.upload.min.js new file mode 100644 index 000000000..d4fb1eac1 --- /dev/null +++ b/dist/plugins/upload/trumbowyg.upload.min.js @@ -0,0 +1 @@ +!function(e){"use strict";function r(){if(!e.trumbowyg&&!e.trumbowyg.addedXhrProgressEvent){var r=e.ajaxSettings.xhr;e.ajaxSetup({xhr:function(){var e=r(),o=this;return e&&"object"==typeof e.upload&&void 0!==o.progressUpload&&e.upload.addEventListener("progress",function(e){o.progressUpload(e)},!1),e}}),e.trumbowyg.addedXhrProgressEvent=!0}}r(),e.extend(!0,e.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"}},upload:{serverPath:"./src/plugins/upload/trumbowyg.upload.php"},opts:{btnsDef:{upload:{func:function(r,o){var a,t=o.o.prefix,n=o.openModalInsert(o.lang.upload,{file:{type:"file",required:!0},alt:{label:"description"}},function(){var r=new FormData;r.append("fileToUpload",a),0===e("."+t+"progress",n).length&&e("."+t+"modal-title",n).after(e("
",{"class":t+"progress"}).append(e("
",{"class":t+"progress-bar"}))),e.ajax({url:e.trumbowyg.upload.serverPath,type:"POST",data:r,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(r){e("."+t+"progress-bar").stop().animate({width:Math.round(100*r.loaded/r.total)+"%"},200)},success:function(r){"uploadSuccess"==r.message?(o.execCmd("insertImage",r.file),setTimeout(function(){o.closeModal()},250)):o.addErrorOnModalField(e("input[type=file]",n),o.lang[r.message])},error:function(){o.addErrorOnModalField(e("input[type=file]",n),o.lang.uploadError)}})});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}}}}})}(jQuery); \ No newline at end of file diff --git a/dist/trumbowyg.js b/dist/trumbowyg.js new file mode 100644 index 000000000..05ce465e3 --- /dev/null +++ b/dist/trumbowyg.js @@ -0,0 +1,1124 @@ +/** + * Trumbowyg v1.1.5 - A lightweight WYSIWYG editor + * Trumbowyg core file + * ------------------------ + * @link http://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", + + formatting: "Formatting", + p: "Paragraph", + blockquote: "Quote", + code: "Code", + header: "Header", + + bold: "Bold", + italic: "Italic", + strikethrough: "Stroke", + underline: "Underline", + + strong: "Strong", + em: "Emphasis", + del: "Deleted", + + unorderedList: "Unordered list", + orderedList: "Ordered list", + + insertImage: "Insert Image", + insertVideo: "Insert Video", + link: "Link", + createLink: "Insert link", + unlink: "Remove link", + + justifyLeft: "Align Left", + justifyCenter: "Align Center", + justifyRight: "Align Right", + justifyFull: "Align Justify", + + horizontalRule: "Insert horizontal rule", + + fullscreen: "fullscreen", + + close: "Close", + + submit: "Confirm", + reset: "Cancel", + + invalidUrl: "Invalid URL", + required: "Required", + description: "Description", + title: "Title", + text: "Text" + } + }, + + // User default options + opts: {}, + + btnsGrps: { + design: ['bold', 'italic', 'underline', 'strikethrough'], + semantic: ['strong', 'em', 'del'], + justify: ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], + lists: ['unorderedList', 'orderedList'] + } +}; + + + +(function(window, document, $, undefined){ + 'use strict'; + + // @param : o are options + // @param : p are params + $.fn.trumbowyg = function(o, p){ + if(o === Object(o) || !o){ + return this.each(function(){ + if(!$(this).data('trumbowyg')) + $(this).data('trumbowyg', new Trumbowyg(this, o)); + }); + } else if(this.length === 1){ + try { + var t = $(this).data('trumbowyg'); + switch(o){ + // Modal box + case 'openModal': + return t.openModal(p.title, p.content); + case 'closeModal': + return t.closeModal(); + case 'openModalInsert': + return t.openModalInsert(p.title, p.fields, p.callback); + + // Selection + case 'saveSelection': + return t.saveSelection(); + case 'getSelection': + return t.selection; + case 'getSelectedText': + return t.selection+''; + case 'restoreSelection': + return t.restoreSelection(); + + // Destroy + case 'destroy': + return t.destroy(); + + // Empty + case 'empty': + return t.empty(); + + // Public options + case 'lang': + return t.lang; + case 'duration': + return t.o.duration; + + // HTML + case 'html': + return t.html(p); + } + } catch(e){} + } + + return false; + }; + + var Trumbowyg = function(editorElem, opts){ + var t = this; + // 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.$e = $(editorElem); + t.$creator = $(editorElem); + + // Extend with options + opts = $.extend(true, {}, opts, $.trumbowyg.opts); + + // Localization management + if(typeof opts.lang === 'undefined' || typeof $.trumbowyg.langs[opts.lang] === 'undefined') + t.lang = $.trumbowyg.langs.en; + else + t.lang = $.extend(true, {}, $.trumbowyg.langs.en, $.trumbowyg.langs[opts.lang]); + + // Defaults Options + t.o = $.extend(true, {}, { + lang: 'en', + dir: 'ltr', + duration: 200, // Duration of modal box animations + + mobile: false, + tablet: true, + closable: false, + fullscreenable: true, + fixedBtnPane: false, + fixedFullWidth: false, + autogrow: false, + + prefix: 'trumbowyg-', + + // WYSIWYG only + convertLink: true, // TODO + semantic: false, + resetCss: false, + + btns: [ + 'viewHTML', + '|', 'formatting', + '|', $.trumbowyg.btnsGrps.design, + '|', 'link', + '|', 'insertImage', + '|', $.trumbowyg.btnsGrps.justify, + '|', $.trumbowyg.btnsGrps.lists, + '|', 'horizontalRule' + ], + btnsAdd: [], + + /** + * When the button is associated to a empty object + * func and title attributs are defined from the button key value + * + * For example + * foo: {} + * is equivalent to : + * foo: { + * func: 'foo', + * title: this.lang.foo + * } + */ + btnsDef: { + viewHTML: { + func: 'toggle' + }, + + p: { + func: 'formatBlock' + }, + blockquote: { + func: 'formatBlock' + }, + h1: { + func: 'formatBlock', + title: t.lang.header + ' 1' + }, + h2: { + func: 'formatBlock', + title: t.lang.header + ' 2' + }, + h3: { + func: 'formatBlock', + title: t.lang.header + ' 3' + }, + h4: { + func: 'formatBlock', + title: t.lang.header + ' 4' + }, + + bold: {}, + italic: {}, + underline: {}, + strikethrough: {}, + + strong: { + func: 'bold' + }, + em: { + func: 'italic' + }, + del: { + func: 'strikethrough' + }, + + createLink: {}, + unlink: {}, + + insertImage: {}, + + justifyLeft: {}, + justifyCenter: {}, + justifyRight: {}, + justifyFull: {}, + + unorderedList: { + func: 'insertUnorderedList' + }, + orderedList: { + func: 'insertOrderedList' + }, + + horizontalRule: { + func: 'insertHorizontalRule' + }, + + // Dropdowns + formatting: { + dropdown: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4'] + }, + link: { + dropdown: ['createLink', 'unlink'] + } + } + }, opts); + + if(t.o.semantic && !opts.btns) + t.o.btns = [ + 'viewHTML', + '|', 'formatting', + '|', $.trumbowyg.btnsGrps.semantic, + '|', 'link', + '|', 'insertImage', + '|', $.trumbowyg.btnsGrps.justify, + '|', $.trumbowyg.btnsGrps.lists, + '|', 'horizontalRule' + ]; + else if(opts && opts.btns) + t.o.btns = opts.btns; + + t.init(); + }; + + Trumbowyg.prototype = { + init: function(){ + var t = this; + t.height = t.$e.css('height'); + + if(t.isEnabled()){ + t.buildEditor(true); + return; + } + + t.buildEditor(); + t.buildBtnPane(); + + t.fixedBtnPaneEvents(); + + t.buildOverlay(); + }, + + buildEditor: function(disable){ + var t = this, + pfx = t.o.prefix, + html = ''; + + + if(disable === true){ + if(!t.$e.is('textarea')){ + var textarea = t.buildTextarea().val(t.$e.val()); + t.$e.hide().after(textarea); + } + return; + } + + + t.$box = $('
', { + class: pfx + 'box ' + pfx + t.o.lang + ' trumbowyg' + }); + + t.isTextarea = true; + if(t.$e.is('textarea')) + t.$editor = $('
'); + else { + t.$editor = t.$e; + t.$e = t.buildTextarea().val(t.$e.val()); + t.isTextarea = false; + } + + if(t.$creator.is('[placeholder]')) + t.$editor.attr('placeholder', t.$creator.attr('placeholder')); + + t.$e.hide() + .addClass(pfx + 'textarea'); + + + if(t.isTextarea){ + html = t.$e.val(); + t.$box.insertAfter(t.$e) + .append(t.$editor) + .append(t.$e); + } else { + html = t.$editor.html(); + t.$box.insertAfter(t.$editor) + .append(t.$e) + .append(t.$editor); + t.syncCode(); + } + + t.$editor.addClass(pfx + 'editor') + .attr('contenteditable', true) + .attr('dir', t.lang._dir || t.o.dir) + .html(html); + + if(t.o.resetCss) + t.$editor.addClass(pfx + 'reset-css'); + + if(!t.o.autogrow){ + $.each([t.$editor, t.$e], function(i, $el){ + $el.css({ + height: t.height, + overflow: 'auto' + }); + }); + } + + if(t.o.semantic){ + t.$editor.html( + t.$editor.html() + .replace('
', '

') + .replace(' ', '') + ); + t.semanticCode(); + } + + + + t.$editor + .on('dblclick', 'img', function(e){ + var $img = $(this); + t.openModalInsert(t.lang.insertImage, { + url: { + label: 'URL', + value: $img.attr('src'), + required: true + }, + alt: { + label: 'description', + value: $img.attr('alt') + } + }, function(v){ + $img.attr({ + src: v.url, + alt: v.alt + }); + }); + e.stopPropagation(); + }) + .on('keyup', function(e){ + t.semanticCode(false, e.which === 13); + }) + .on('focus', function(){ + t.$creator.trigger('tbwfocus'); + }) + .on('blur', function(){ + t.syncCode(); + t.$creator.trigger('tbwblur'); + }); + }, + + + // Build the Textarea which contain HTML generated code + buildTextarea: function(){ + return $('