suvii 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.travis.yml +10 -0
  4. data/.yardopts +1 -0
  5. data/CHANGELOG.md +1 -0
  6. data/CONTRIBUTING.md +47 -0
  7. data/Gemfile +6 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +51 -0
  10. data/Rakefile +7 -0
  11. data/lib/suvii.rb +40 -0
  12. data/lib/suvii/cache.rb +24 -0
  13. data/lib/suvii/extract.rb +58 -0
  14. data/lib/suvii/extract/targz.rb +49 -0
  15. data/lib/suvii/extract/zip.rb +19 -0
  16. data/lib/suvii/http.rb +31 -0
  17. data/suvii.gemspec +23 -0
  18. data/test/acceptance_test.rb +29 -0
  19. data/test/cache_test.rb +42 -0
  20. data/test/extract/targz_test.rb +28 -0
  21. data/test/extract/zip_test.rb +28 -0
  22. data/test/extract_test.rb +26 -0
  23. data/test/fixtures/results/Trumbowyg-1.1.7/.gitattributes +6 -0
  24. data/test/fixtures/results/Trumbowyg-1.1.7/.jshintrc +15 -0
  25. data/test/fixtures/results/Trumbowyg-1.1.7/Gulpfile.js +167 -0
  26. data/test/fixtures/results/Trumbowyg-1.1.7/LICENSE +21 -0
  27. data/test/fixtures/results/Trumbowyg-1.1.7/README.md +29 -0
  28. data/test/fixtures/results/Trumbowyg-1.1.7/bower.json +36 -0
  29. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/ca.min.js +11 -0
  30. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/da.min.js +9 -0
  31. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/de.min.js +9 -0
  32. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/es.min.js +9 -0
  33. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/es_ar.min.js +9 -0
  34. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/fa.min.js +10 -0
  35. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/fi.min.js +9 -0
  36. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/fr.min.js +10 -0
  37. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/he.min.js +9 -0
  38. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/id.min.js +11 -0
  39. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/it.min.js +8 -0
  40. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/ko.min.js +10 -0
  41. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/pl.min.js +9 -0
  42. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/pt.min.js +11 -0
  43. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/ro.min.js +13 -0
  44. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/ru.min.js +8 -0
  45. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/tr.min.js +10 -0
  46. data/test/fixtures/results/Trumbowyg-1.1.7/dist/langs/zh_cn.min.js +10 -0
  47. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/base64/trumbowyg.base64.js +74 -0
  48. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/base64/trumbowyg.base64.min.js +1 -0
  49. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/trumbowyg.colors.js +69 -0
  50. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/trumbowyg.colors.min.js +1 -0
  51. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/ui/images/icons-2x.png +0 -0
  52. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/ui/images/icons.png +0 -0
  53. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/ui/trumbowyg.colors.css +55 -0
  54. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/colors/ui/trumbowyg.colors.min.css +2 -0
  55. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/upload/trumbowyg.upload.js +140 -0
  56. data/test/fixtures/results/Trumbowyg-1.1.7/dist/plugins/upload/trumbowyg.upload.min.js +1 -0
  57. data/test/fixtures/results/Trumbowyg-1.1.7/dist/trumbowyg.js +1124 -0
  58. data/test/fixtures/results/Trumbowyg-1.1.7/dist/trumbowyg.min.js +2 -0
  59. data/test/fixtures/results/Trumbowyg-1.1.7/dist/ui/images/icons-2x.png +0 -0
  60. data/test/fixtures/results/Trumbowyg-1.1.7/dist/ui/images/icons.png +0 -0
  61. data/test/fixtures/results/Trumbowyg-1.1.7/dist/ui/trumbowyg.css +471 -0
  62. data/test/fixtures/results/Trumbowyg-1.1.7/dist/ui/trumbowyg.min.css +2 -0
  63. data/test/fixtures/results/Trumbowyg-1.1.7/examples/css/main.css +14 -0
  64. data/test/fixtures/results/Trumbowyg-1.1.7/examples/index.html +41 -0
  65. data/test/fixtures/results/Trumbowyg-1.1.7/examples/plugins/colors.html +49 -0
  66. data/test/fixtures/results/Trumbowyg-1.1.7/index.html +252 -0
  67. data/test/fixtures/results/Trumbowyg-1.1.7/package.json +48 -0
  68. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/base64/trumbowyg.base64.js +74 -0
  69. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/Gulpfile.js +101 -0
  70. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/trumbowyg.colors.js +69 -0
  71. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/ui/images/icons-2x/backcolor.png +0 -0
  72. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/ui/images/icons-2x/forecolor.png +0 -0
  73. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/ui/images/icons/backcolor.png +0 -0
  74. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/ui/images/icons/forecolor.png +0 -0
  75. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/colors/ui/sass/trumbowyg.colors.scss +65 -0
  76. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/upload/trumbowyg.upload.js +140 -0
  77. data/test/fixtures/results/Trumbowyg-1.1.7/plugins/upload/trumbowyg.upload.php +49 -0
  78. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/ca.js +58 -0
  79. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/da.js +56 -0
  80. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/de.js +56 -0
  81. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/en.js +14 -0
  82. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/es.js +56 -0
  83. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/es_ar.js +56 -0
  84. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/fa.js +57 -0
  85. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/fi.js +56 -0
  86. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/fr.js +57 -0
  87. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/he.js +58 -0
  88. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/id.js +58 -0
  89. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/it.js +55 -0
  90. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/ko.js +57 -0
  91. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/pl.js +56 -0
  92. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/pt.js +58 -0
  93. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/ro.js +60 -0
  94. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/ru.js +55 -0
  95. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/tr.js +57 -0
  96. data/test/fixtures/results/Trumbowyg-1.1.7/src/langs/zh_cn.js +57 -0
  97. data/test/fixtures/results/Trumbowyg-1.1.7/src/trumbowyg.js +1113 -0
  98. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/attachement.png +0 -0
  99. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/barre.png +0 -0
  100. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/bold.png +0 -0
  101. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/center-align.png +0 -0
  102. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/close.png +0 -0
  103. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/formatting.png +0 -0
  104. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/fullscreen-exit.png +0 -0
  105. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/fullscreen.png +0 -0
  106. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/gras.png +0 -0
  107. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/horizontal-rule.png +0 -0
  108. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/image.png +0 -0
  109. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/italic.png +0 -0
  110. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/justify-align.png +0 -0
  111. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/left-align.png +0 -0
  112. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/link.png +0 -0
  113. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/ordered-list.png +0 -0
  114. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/right-align.png +0 -0
  115. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/souligne.png +0 -0
  116. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/strikethrough.png +0 -0
  117. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/underline.png +0 -0
  118. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/unordered-list.png +0 -0
  119. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/video.png +0 -0
  120. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons-2x/view-html.png +0 -0
  121. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/attachement.png +0 -0
  122. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/barre.png +0 -0
  123. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/bold.png +0 -0
  124. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/center-align.png +0 -0
  125. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/close.png +0 -0
  126. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/formatting.png +0 -0
  127. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/fullscreen-exit.png +0 -0
  128. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/fullscreen.png +0 -0
  129. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/gras.png +0 -0
  130. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/horizontal-rule.png +0 -0
  131. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/image.png +0 -0
  132. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/italic.png +0 -0
  133. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/justify-align.png +0 -0
  134. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/left-align.png +0 -0
  135. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/link.png +0 -0
  136. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/ordered-list.png +0 -0
  137. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/right-align.png +0 -0
  138. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/souligne.png +0 -0
  139. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/strikethrough.png +0 -0
  140. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/underline.png +0 -0
  141. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/unordered-list.png +0 -0
  142. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/video.png +0 -0
  143. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/images/icons/view-html.png +0 -0
  144. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/sass/mixins/_sprite-pos.scss +7 -0
  145. data/test/fixtures/results/Trumbowyg-1.1.7/src/ui/sass/trumbowyg.scss +564 -0
  146. data/test/fixtures/trumbowyg.tar.gz +0 -0
  147. data/test/fixtures/trumbowyg.zip +0 -0
  148. data/test/http_test.rb +61 -0
  149. data/test/test_helper.rb +24 -0
  150. metadata +409 -0
@@ -0,0 +1,9 @@
1
+ /* ===========================================================
2
+ * es.js
3
+ * Spanish translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Moisés Márquez
7
+ * Email : moises.marquez.g@gmail.com
8
+ */
9
+ 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"};
@@ -0,0 +1,9 @@
1
+ /* ===========================================================
2
+ * es_ar.js
3
+ * Spanish (Argentina) translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Félix Vera
7
+ * Email : felix.vera@gmail.com
8
+ */
9
+ 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"};
@@ -0,0 +1,10 @@
1
+ /* ===========================================================
2
+ * fa.js
3
+ * Persian translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Kiarash Soleimanzadeh
7
+ * Github : https://github.com/kiyarash
8
+ * Email : kiarash.s@hotmail.com
9
+ */
10
+ 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:"متن"};
@@ -0,0 +1,9 @@
1
+ /* ===========================================================
2
+ * fi.js
3
+ * Finnish translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Teppo Koivula (teppokoivula)
7
+ * Github : https://github.com/teppokoivula
8
+ */
9
+ 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"};
@@ -0,0 +1,10 @@
1
+ /* ===========================================================
2
+ * fr.js
3
+ * French translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Alexandre Demode (Alex-D)
7
+ * Twitter : @AlexandreDemode
8
+ * Website : alex-d.fr
9
+ */
10
+ 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"};
@@ -0,0 +1,9 @@
1
+ /* ===========================================================
2
+ * he.js
3
+ * Hebrew translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Udi Doron (udidoron)
7
+ * Github : https://github.com/udidoron
8
+ */
9
+ 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:"טקסט"};
@@ -0,0 +1,11 @@
1
+ /* ===========================================================
2
+ * id.js
3
+ * Indonesian translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Rezha Julio (kimiamania)
7
+ * Twitter : @kimiamania
8
+ * Website : http://rezhajulio.web.id
9
+ * Github : https://github.com/kimiamania
10
+ */
11
+ 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"};
@@ -0,0 +1,8 @@
1
+ /* ===========================================================
2
+ * it.js
3
+ * Italian translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Mirko Buffoni
7
+ */
8
+ 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"};
@@ -0,0 +1,10 @@
1
+ /* ===========================================================
2
+ * ko.js
3
+ * Korean translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : JoongSeob Vito Kim (dorajistyle)
7
+ * Blog : http://dorajistyle.pe.kr
8
+ * Github : https://github.com/dorajistyle
9
+ */
10
+ 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:"본문 내용"};
@@ -0,0 +1,9 @@
1
+ /* ===========================================================
2
+ * pl.js
3
+ * Polish translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Paweł Abramowicz
7
+ * Github : https://github.com/pawelabrams
8
+ */
9
+ 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"};
@@ -0,0 +1,11 @@
1
+ /* ===========================================================
2
+ * pt.js
3
+ * Portuguese translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Ramiro Varandas Jr (ramirovjr)
7
+ * Twitter : @ramirovjnr
8
+ * Website : about.me/ramirovjnr
9
+ * Github : https://github.com/ramirovjr
10
+ */
11
+ 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"};
@@ -0,0 +1,13 @@
1
+ /* ===========================================================
2
+ * ro.js
3
+ * Romanian translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Vladut Radulescu (pacMakaveli)
7
+ *
8
+ * Email: pacMakaveli90@gmail.com
9
+ * Twitter : @pacMakaveli90
10
+ * Website : creative-studio51.co.uk
11
+ * Github : https://github.com/pacMakaveli
12
+ */
13
+ 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"};
@@ -0,0 +1,8 @@
1
+ /* ===========================================================
2
+ * ru.js
3
+ * Russion translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Yuri Lya
7
+ */
8
+ 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:"Текст"};
@@ -0,0 +1,10 @@
1
+ /* ===========================================================
2
+ * tr.js
3
+ * Turkish translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Emrah Bilbay (munzur)
7
+ * Github : https://github.com/munzur
8
+ * Website: http://kafe.in/
9
+ */
10
+ 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"};
@@ -0,0 +1,10 @@
1
+ /* ===========================================================
2
+ * zh_cn.js
3
+ * Simplified Chinese translation for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Liu Kai (akai)
7
+ * Twitter : @akai404
8
+ * Github : https://github.com/akai
9
+ */
10
+ 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:"文字"};
@@ -0,0 +1,74 @@
1
+ /* ===========================================================
2
+ * trumbowyg.base64.js v1.0
3
+ * Base64 plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Cyril Biencourt (lizardK)
7
+ */
8
+
9
+ (function($){
10
+ 'use strict';
11
+
12
+ $.extend(true, $.trumbowyg, {
13
+ langs: {
14
+ en: {
15
+ base64: "Image as base64",
16
+ file: "File",
17
+ errFileReaderNotSupported: "FileReader is not supported by your browser."
18
+ },
19
+ fr: {
20
+ base64: "Image en base64",
21
+ file: "Fichier"
22
+ }
23
+ },
24
+
25
+ opts: {
26
+ btnsDef: {
27
+ base64: {
28
+ isSupported: function(){
29
+ if(typeof FileReader === "undefined"){
30
+ console.err('[Trumbowyg - Plugin base64] FileReader is not supported by your browser.');
31
+ return false;
32
+ }
33
+ return true;
34
+ },
35
+ func: function(params, tbw){
36
+ var file;
37
+ tbw.openModalInsert(
38
+ // Title
39
+ tbw.lang.base64,
40
+
41
+ // Fields
42
+ {
43
+ file: {
44
+ type: 'file',
45
+ required: true
46
+ },
47
+ alt: {
48
+ label: 'description'
49
+ }
50
+ },
51
+
52
+ // Callback
53
+ function(values){
54
+ var fReader = new FileReader();
55
+
56
+ fReader.onloadend = function(){
57
+ tbw.execCmd('insertImage', fReader.result);
58
+ $(['img[src="', fReader.result, '"]:not([alt])'].join(''), tbw.$box).attr('alt', values.alt);
59
+ tbw.closeModal();
60
+ };
61
+
62
+ fReader.readAsDataURL(file);
63
+ }
64
+ );
65
+
66
+ $('input[type=file]').on('change', function(e){
67
+ file = e.target.files[0];
68
+ });
69
+ }
70
+ }
71
+ }
72
+ }
73
+ });
74
+ })(jQuery);
@@ -0,0 +1 @@
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);
@@ -0,0 +1,69 @@
1
+ /* ===========================================================
2
+ * trumbowyg.colors.js v1.0
3
+ * Colors picker plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Alexandre Demode (Alex-D)
7
+ * Twitter : @AlexandreDemode
8
+ * Website : alex-d.fr
9
+ */
10
+
11
+ (function($){
12
+ 'use strict';
13
+
14
+ $.extend(true, $.trumbowyg, {
15
+ langs: {
16
+ en: {
17
+ foreColor: "Text color",
18
+ backColor: "Background color"
19
+ },
20
+ fr: {
21
+ foreColor: "Couleur du text",
22
+ backColor: "Couleur de fond"
23
+ }
24
+ }
25
+ });
26
+
27
+ // Create btnsDef entry
28
+ $.extend(true, $.trumbowyg, {
29
+ opts: {
30
+ btnsDef: {}
31
+ }
32
+ });
33
+
34
+ // Set default colors
35
+ if(!$.trumbowyg.opts.colors)
36
+ $.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'];
37
+
38
+ // Add all colors in two dropdowns
39
+ $.extend(true, $.trumbowyg, {
40
+ opts: {
41
+ btnsDef: {
42
+ foreColor: {
43
+ dropdown: buildDropdown('foreColor')
44
+ },
45
+ backColor: {
46
+ dropdown: buildDropdown('backColor')
47
+ }
48
+ }
49
+ }
50
+ });
51
+
52
+
53
+
54
+ function buildDropdown(func){
55
+ var dropdown = [];
56
+
57
+ $.each($.trumbowyg.opts.colors, function(i, color){
58
+ var btn = '_' + func + color;
59
+ $.trumbowyg.opts.btnsDef[btn] = {
60
+ func: func,
61
+ param: '#' + color,
62
+ style: 'background-color: #' + color + ';'
63
+ };
64
+ dropdown.push(btn);
65
+ });
66
+
67
+ return dropdown;
68
+ }
69
+ })(jQuery);
@@ -0,0 +1 @@
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.extend(!0,f.trumbowyg,{opts:{btnsDef:{}}}),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);
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Trumbowyg v1.1.7 - A lightweight WYSIWYG editor
3
+ * Colors plugin stylesheet for Trumbowyg editor
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .foreColor-trumbowyg-dropdown, .backColor-trumbowyg-dropdown {
13
+ width: 264px;
14
+ padding: 7px 5px; }
15
+ .foreColor-trumbowyg-dropdown button, .backColor-trumbowyg-dropdown button {
16
+ display: block;
17
+ position: relative;
18
+ float: left;
19
+ text-indent: -9999px;
20
+ height: 20px;
21
+ width: 20px;
22
+ border: 1px solid #333;
23
+ padding: 0;
24
+ margin: 2px; }
25
+ .foreColor-trumbowyg-dropdown button:hover::after, .foreColor-trumbowyg-dropdown button:focus::after, .backColor-trumbowyg-dropdown button:hover::after, .backColor-trumbowyg-dropdown button:focus::after {
26
+ content: " ";
27
+ display: block;
28
+ height: 27px;
29
+ width: 27px;
30
+ background: inherit;
31
+ position: absolute;
32
+ top: -5px;
33
+ left: -5px;
34
+ border: 1px solid #FFF;
35
+ -webkit-box-shadow: #000 0 0 2px;
36
+ box-shadow: #000 0 0 2px;
37
+ z-index: 10; }
38
+
39
+ /*
40
+ * Buttons icons
41
+ */
42
+ .trumbowyg-button-pane li button.trumbowyg-foreColor-button, .trumbowyg-button-pane li button.trumbowyg-backColor-button {
43
+ background-image: url("./images/icons.png"); }
44
+ .trumbowyg-button-pane li button.trumbowyg-foreColor-button {
45
+ background-position: 5px -20px; }
46
+ .trumbowyg-button-pane li button.trumbowyg-backColor-button {
47
+ background-position: 5px 5px; }
48
+
49
+ @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) {
50
+ .trumbowyg-button-pane li button.trumbowyg-foreColor-button, .trumbowyg-button-pane li button.trumbowyg-backColor-button {
51
+ background-image: url("./images/icons-2x.png") !important; }
52
+ .trumbowyg-button-pane li button.trumbowyg-foreColor-button {
53
+ background-position: 5px -20px; }
54
+ .trumbowyg-button-pane li button.trumbowyg-backColor-button {
55
+ background-position: 5px 5px; } }
@@ -0,0 +1,2 @@
1
+ /** Trumbowyg v1.1.7 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
2
+ .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}}
@@ -0,0 +1,140 @@
1
+ /* ===========================================================
2
+ * trumbowyg.upload.js v1.0
3
+ * Upload plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Alexandre Demode (Alex-D)
7
+ * Twitter : @AlexandreDemode
8
+ * Website : alex-d.fr
9
+ */
10
+
11
+ (function($){
12
+ 'use strict';
13
+
14
+ addXhrProgressEvent();
15
+
16
+ $.extend(true, $.trumbowyg, {
17
+ langs: {
18
+ en: {
19
+ upload: "Upload",
20
+ file: "File",
21
+ uploadError: "Error"
22
+ },
23
+ fr: {
24
+ upload: "Envoi",
25
+ file: "Fichier",
26
+ uploadError: "Erreur"
27
+ }
28
+ },
29
+
30
+ upload: {
31
+ serverPath: './src/plugins/upload/trumbowyg.upload.php'
32
+ },
33
+
34
+ opts: {
35
+ btnsDef: {
36
+ upload: {
37
+ func: function(params, tbw){
38
+ var file,
39
+ pfx = tbw.o.prefix;
40
+
41
+ var $modal = tbw.openModalInsert(
42
+ // Title
43
+ tbw.lang.upload,
44
+
45
+ // Fields
46
+ {
47
+ file: {
48
+ type: 'file',
49
+ required: true
50
+ },
51
+ alt: {
52
+ label: 'description'
53
+ }
54
+ },
55
+
56
+ // Callback
57
+ function(){
58
+ var data = new FormData();
59
+ data.append('fileToUpload', file);
60
+
61
+ if($('.' + pfx +'progress', $modal).length === 0)
62
+ $('.' + pfx + 'modal-title', $modal)
63
+ .after(
64
+ $('<div/>', {
65
+ 'class': pfx +'progress'
66
+ })
67
+ .append(
68
+ $('<div/>', {
69
+ 'class': pfx +'progress-bar'
70
+ })
71
+ )
72
+ );
73
+
74
+ $.ajax({
75
+ url: $.trumbowyg.upload.serverPath,
76
+ type: 'POST',
77
+ data: data,
78
+ cache: false,
79
+ dataType: 'json',
80
+ processData: false,
81
+ contentType: false,
82
+
83
+ progressUpload: function(e){
84
+ $('.' + pfx + 'progress-bar').stop().animate({
85
+ width: Math.round(e.loaded * 100 / e.total) + '%'
86
+ }, 200);
87
+ },
88
+
89
+ success: function(data){
90
+ if(data.message == "uploadSuccess") {
91
+ tbw.execCmd('insertImage', data.file);
92
+ setTimeout(function(){
93
+ tbw.closeModal();
94
+ }, 250);
95
+ } else {
96
+ tbw.addErrorOnModalField(
97
+ $('input[type=file]', $modal),
98
+ tbw.lang[data.message]
99
+ );
100
+ }
101
+ },
102
+ error: function(){
103
+ tbw.addErrorOnModalField(
104
+ $('input[type=file]', $modal),
105
+ tbw.lang.uploadError
106
+ );
107
+ }
108
+ });
109
+ }
110
+ );
111
+
112
+ $('input[type=file]').on('change', function(e){
113
+ file = e.target.files[0];
114
+ });
115
+ }
116
+ }
117
+ }
118
+ }
119
+ });
120
+
121
+
122
+ function addXhrProgressEvent(){
123
+ if (!$.trumbowyg && !$.trumbowyg.addedXhrProgressEvent) { // Avoid adding progress event multiple times
124
+ var originalXhr = $.ajaxSettings.xhr;
125
+ $.ajaxSetup({
126
+ xhr: function() {
127
+ var req = originalXhr(),
128
+ that = this;
129
+ if(req && typeof req.upload == "object" && that.progressUpload !== undefined)
130
+ req.upload.addEventListener("progress", function(e){
131
+ that.progressUpload(e);
132
+ }, false);
133
+
134
+ return req;
135
+ }
136
+ });
137
+ $.trumbowyg.addedXhrProgressEvent = true;
138
+ }
139
+ }
140
+ })(jQuery);