glebtv-ckeditor 4.0.2.7 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +5 -195
  3. data/{vendor → app}/assets/javascripts/ckeditor/CHANGES.md +56 -0
  4. data/{vendor → app}/assets/javascripts/ckeditor/LICENSE.md +0 -0
  5. data/{vendor → app}/assets/javascripts/ckeditor/README.md +0 -0
  6. data/{vendor → app}/assets/javascripts/ckeditor/build-config.js +0 -0
  7. data/app/assets/javascripts/ckeditor/ckeditor.js +881 -0
  8. data/{vendor → app}/assets/javascripts/ckeditor/config.js.erb +0 -0
  9. data/app/assets/javascripts/ckeditor/contents.css +103 -0
  10. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
  11. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
  12. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
  13. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
  14. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
  15. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif +0 -0
  16. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
  17. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif +0 -0
  18. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif +0 -0
  19. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif +0 -0
  20. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif +0 -0
  21. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif +0 -0
  22. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif +0 -0
  23. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
  24. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif +0 -0
  25. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
  26. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif +0 -0
  27. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
  28. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
  29. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif +0 -0
  30. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif +0 -0
  31. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif +0 -0
  32. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif +0 -0
  33. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
  34. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif +0 -0
  35. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif +0 -0
  36. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/application.js +0 -0
  37. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
  38. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.min.js +0 -0
  39. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
  40. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
  41. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css +118 -0
  42. data/app/assets/javascripts/ckeditor/{init.js → init.js.erb} +1 -1
  43. data/{vendor → app}/assets/javascripts/ckeditor/lang/en.js +1 -1
  44. data/{vendor → app}/assets/javascripts/ckeditor/lang/ru.js +1 -1
  45. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/ckcss.png +0 -0
  46. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +0 -0
  47. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +0 -0
  48. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/en.js +0 -0
  49. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/ru.js +0 -0
  50. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +0 -0
  51. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon.png +0 -0
  52. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon1.png +0 -0
  53. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/plugin.js +0 -0
  54. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -0
  55. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +0 -0
  56. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +0 -0
  57. data/{vendor → app}/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -0
  58. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +38 -0
  59. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +246 -245
  60. data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
  61. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoComplete.png +0 -0
  62. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
  63. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
  64. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/SearchCode.png +0 -0
  65. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
  66. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +81 -76
  67. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +52 -0
  68. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +1 -2
  69. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +44 -0
  70. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +25 -0
  71. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -0
  72. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +31 -0
  73. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +32 -0
  74. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +64 -0
  75. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -0
  76. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -0
  77. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -0
  78. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +131 -131
  79. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +8 -9
  80. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -0
  81. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +264 -132
  82. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -0
  83. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +1 -0
  84. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +1 -0
  85. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/css.js +337 -235
  86. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/htmlmixed.js +0 -0
  87. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/javascript.js +17 -6
  88. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/xml.js +9 -5
  89. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +4 -2
  90. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +0 -0
  91. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +146 -34
  92. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +0 -1
  93. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +0 -1
  94. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +0 -0
  95. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +0 -0
  96. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
  97. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +0 -0
  98. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +5 -5
  99. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +0 -0
  100. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +0 -0
  101. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +0 -0
  102. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +0 -0
  103. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +0 -0
  104. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -0
  105. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +0 -0
  106. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +0 -0
  107. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +0 -0
  108. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
  109. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/bgcolor.png +0 -0
  110. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/textcolor.png +0 -0
  111. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/en.js +0 -0
  112. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/ru.js +0 -0
  113. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/plugin.js +6 -2
  114. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -0
  115. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/en.js +0 -0
  116. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/ru.js +0 -0
  117. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/plugin.js +1 -1
  118. data/{vendor → app}/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -0
  119. data/{vendor → app}/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
  120. data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +10 -9
  121. data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
  122. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/en.js +0 -0
  123. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/ru.js +0 -0
  124. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/plugin.js +5 -2
  125. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/dialogs/hs.js +0 -0
  126. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/icon.png +0 -0
  127. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/en.js +0 -0
  128. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/ru.js +0 -0
  129. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/plugin.js +0 -0
  130. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/readme.txt +0 -0
  131. data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  132. data/{vendor → app}/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -0
  133. data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
  134. data/{vendor → app}/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  135. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -0
  136. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +15 -15
  137. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  138. data/{vendor → app}/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  139. data/{vendor → app}/assets/javascripts/ckeditor/plugins/mediaembed/images/icon.png +0 -0
  140. data/{vendor → app}/assets/javascripts/ckeditor/plugins/oembed/images/icon.png +0 -0
  141. data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +68 -0
  142. data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +68 -0
  143. data/{vendor → app}/assets/javascripts/ckeditor/plugins/panelbutton/plugin.js +0 -0
  144. data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
  145. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +0 -0
  146. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/README.md +0 -0
  147. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -0
  148. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
  149. data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +0 -0
  150. data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -0
  151. data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
  152. data/{vendor → app}/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -0
  153. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
  154. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
  155. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
  156. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
  157. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
  158. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -0
  159. data/app/assets/javascripts/ckeditor/samples/ajax.html +82 -0
  160. data/app/assets/javascripts/ckeditor/samples/api.html +207 -0
  161. data/app/assets/javascripts/ckeditor/samples/appendto.html +57 -0
  162. data/app/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
  163. data/app/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +204 -0
  164. data/app/assets/javascripts/ckeditor/samples/assets/posteddata.php +59 -0
  165. data/app/assets/javascripts/ckeditor/samples/assets/sample.css +3 -0
  166. data/app/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
  167. data/app/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +7 -0
  168. data/app/assets/javascripts/ckeditor/samples/datafiltering.html +401 -0
  169. data/app/assets/javascripts/ckeditor/samples/divreplace.html +141 -0
  170. data/app/assets/javascripts/ckeditor/samples/index.html +125 -0
  171. data/app/assets/javascripts/ckeditor/samples/inlineall.html +311 -0
  172. data/app/assets/javascripts/ckeditor/samples/inlinebycode.html +122 -0
  173. data/app/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +48 -0
  174. data/app/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +187 -0
  175. data/app/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +103 -0
  176. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  177. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  178. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +18 -0
  179. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +280 -0
  180. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +221 -0
  181. data/app/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +207 -0
  182. data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/assets/sample.css +70 -70
  183. data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/stylesheetparser.html +82 -82
  184. data/app/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +232 -0
  185. data/app/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +77 -0
  186. data/app/assets/javascripts/ckeditor/samples/readonly.html +73 -0
  187. data/app/assets/javascripts/ckeditor/samples/replacebyclass.html +57 -0
  188. data/app/assets/javascripts/ckeditor/samples/replacebycode.html +56 -0
  189. data/app/assets/javascripts/ckeditor/samples/sample.css +339 -0
  190. data/app/assets/javascripts/ckeditor/samples/sample.js +33 -0
  191. data/app/assets/javascripts/ckeditor/samples/sample_posteddata.php +16 -0
  192. data/app/assets/javascripts/ckeditor/samples/tabindex.html +75 -0
  193. data/app/assets/javascripts/ckeditor/samples/uicolor.html +69 -0
  194. data/app/assets/javascripts/ckeditor/samples/uilanguages.html +119 -0
  195. data/app/assets/javascripts/ckeditor/samples/xhtmlstyle.html +231 -0
  196. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog.css +0 -0
  197. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +0 -0
  198. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +0 -0
  199. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +0 -0
  200. data/app/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  201. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +0 -0
  202. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
  203. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css → app/assets/javascripts/ckeditor/skins/moono/editor_gecko.css} +1 -1
  204. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css → app/assets/javascripts/ckeditor/skins/moono/editor_ie.css} +1 -1
  205. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
  206. data/app/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
  207. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css → app/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css} +1 -1
  208. data/app/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  209. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
  210. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  211. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/mini.png +0 -0
  212. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/readme.md +0 -0
  213. data/{vendor → app}/assets/javascripts/ckeditor/styles.js +1 -2
  214. data/app/controllers/ckeditor/application_controller.rb +6 -12
  215. data/app/controllers/ckeditor/attachment_files_controller.rb +6 -2
  216. data/app/controllers/ckeditor/pictures_controller.rb +6 -2
  217. data/app/views/ckeditor/shared/_asset.html.erb +4 -4
  218. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +1 -1
  219. data/lib/ckeditor.rb +91 -19
  220. data/lib/ckeditor/engine.rb +5 -8
  221. data/lib/ckeditor/helpers/controllers.rb +7 -3
  222. data/lib/ckeditor/helpers/form_builder.rb +1 -1
  223. data/lib/ckeditor/helpers/form_helper.rb +12 -15
  224. data/lib/ckeditor/helpers/view_helper.rb +1 -1
  225. data/lib/ckeditor/hooks/cancan.rb +46 -0
  226. data/lib/ckeditor/hooks/simple_form.rb +11 -0
  227. data/lib/ckeditor/orm/active_record.rb +1 -3
  228. data/lib/ckeditor/orm/base.rb +4 -0
  229. data/lib/ckeditor/orm/mongoid.rb +1 -3
  230. data/lib/ckeditor/utils.rb +25 -8
  231. data/lib/ckeditor/version.rb +2 -2
  232. data/lib/generators/ckeditor/install_generator.rb +2 -2
  233. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
  234. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +4 -4
  235. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +4 -4
  236. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
  237. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +4 -4
  238. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +8 -8
  239. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +6 -6
  240. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +1 -7
  241. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +1 -7
  242. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +3 -3
  243. data/lib/generators/ckeditor/templates/ckeditor.rb +3 -0
  244. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
  245. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +4 -4
  246. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +4 -4
  247. data/test/dummy/app/views/posts/_form.html.erb +3 -3
  248. data/test/dummy/script/rails +0 -0
  249. data/test/functional/posts_controller_test.rb +3 -3
  250. metadata +346 -321
  251. data/vendor/assets/javascripts/ckeditor/ckeditor.js +0 -830
  252. data/vendor/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.sass +0 -102
  253. data/vendor/assets/javascripts/ckeditor/plugins/code/code/code.js +0 -48
  254. data/vendor/assets/javascripts/ckeditor/plugins/code/images/code.png +0 -0
  255. data/vendor/assets/javascripts/ckeditor/plugins/code/plugin.js +0 -17
  256. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +0 -1
  257. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -29
  258. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -28
  259. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/foldcode/foldcode.js +0 -183
  260. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +0 -1
  261. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +0 -1
  262. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +0 -1
  263. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +0 -1
  264. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  265. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -41
  266. data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -67
  267. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/de.js +0 -12
  268. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/en.js +0 -12
  269. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/fr.js +0 -14
  270. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/nl.js +0 -12
  271. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/ru.js +0 -12
  272. data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +0 -912
  273. data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +0 -1
  274. data/vendor/assets/javascripts/ckeditor/plugins/oembed/plugin.js +0 -102
  275. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -31
  276. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +0 -13
  277. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -138
  278. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -20
  279. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +0 -689
  280. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +0 -1245
  281. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
@@ -1,67 +0,0 @@
1
- /*
2
- * Embed Media Dialog based on http://www.fluidbyte.net/embed-youtube-vimeo-etc-into-ckeditor
3
- *
4
- * Plugin name: mediaembed
5
- * Menu button name: MediaEmbed
6
- *
7
- * Youtube Editor Icon
8
- * http://paulrobertlloyd.com/
9
- *
10
- * @author Fabian Vogelsteller [frozeman.de]
11
- * @version 0.4
12
- */
13
- ( function() {
14
- CKEDITOR.plugins.add( 'mediaembed',
15
- {
16
- init: function( editor )
17
- {
18
- var me = this;
19
- CKEDITOR.dialog.add( 'MediaEmbedDialog', function (instance)
20
- {
21
- return {
22
- title : 'Embed Media',
23
- minWidth : 550,
24
- minHeight : 200,
25
- contents :
26
- [
27
- {
28
- id : 'iframe',
29
- expand : true,
30
- elements :[{
31
- id : 'embedArea',
32
- type : 'textarea',
33
- label : 'Paste Embed Code Here',
34
- 'autofocus':'autofocus',
35
- setup: function(element){
36
- },
37
- commit: function(element){
38
- }
39
- }]
40
- }
41
- ],
42
- onOk: function() {
43
- for (var i = 0; i < window.frames.length; i++) {
44
- if (window.frames[i].name == 'iframeMediaEmbed') {
45
- var content = window.frames[i].document.getElementById("embed").value;
46
- }
47
- }
48
- // console.log(this.getContentElement( 'iframe', 'embedArea' ).getValue());
49
- div = instance.document.createElement('div');
50
- div.setHtml(this.getContentElement('iframe', 'embedArea').getValue());
51
- instance.insertElement(div);
52
- }
53
- };
54
- } );
55
-
56
- editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog' ) );
57
-
58
- editor.ui.addButton( 'MediaEmbed',
59
- {
60
- label: 'Embed Media',
61
- command: 'MediaEmbed',
62
- icon: this.path + 'images/icon.png',
63
- toolbar: 'mediaembed'
64
- } );
65
- }
66
- } );
67
- } )();
@@ -1,12 +0,0 @@
1
- CKEDITOR.plugins.setLang('oembed', 'de', {
2
- title : "Medien Inhalt einbinden (Bilder, Video, Inhalt)",
3
- button : "Medien Inhalt von Verschiedenen Seiten einbinden",
4
- pasteUrl : "Fügen Sie eine Url (Gekürzte Urls werden auch erkannt) ein von einer Seite die Unterstützt wird (z.B.: YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.) ...",
5
- width : "Max. Breite:",
6
- height : "Max. Höhe:",
7
- invalidUrl : "Sie müssem eine korrekte URL an!",
8
- noEmbedCode : "Kein embed Code gefunden, oder Seite wird nicht Unterstützt!",
9
- url : "URL:",
10
- widthTitle : "Maximale Breite für den eingebundenen Inhalt",
11
- heightTitle : "Maximale Höhe für den eingebundenen Inhalt"
12
- });
@@ -1,12 +0,0 @@
1
- CKEDITOR.plugins.setLang('oembed', 'en', {
2
- title : "Embed Media Content (Photo, Video, Audio, Rich)",
3
- button : "Embed Media Content from Various Sites",
4
- pasteUrl : "Paste an URL (Also shortened URLs are supported) from one of the Supported Sites (e.g. YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.) here ...",
5
- width : "Max. Width:",
6
- height : "Max. Height:",
7
- invalidUrl : "Please provide an valid URL!",
8
- noEmbedCode : "No embed code found, or site is not supported!",
9
- url : "URL:",
10
- widthTitle : "Maximum Width for the embeded Content",
11
- heightTitle : "Maximum Height for the embeded Content"
12
- });
@@ -1,14 +0,0 @@
1
- // French Translation by https://github.com/wissim
2
-
3
- CKEDITOR.plugins.setLang('oembed', 'fr', {
4
- title : "Intégrer des contenus multimédia externes. (Photo, Video, Audio, ...)",
5
- button : "Insérer des contenus multimédia provenant de nombreux sites.",
6
- pasteUrl : "Coller l'URL de partage que vous voulez publier. De nombreux services sont pris en charge tels que : (YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.). Vous pouvez aussi utiliser les URLs courtes.",
7
- width : "Max. Largeur:",
8
- height : "Max. Hauteur:",
9
- invalidUrl : "Merci de fournir une URL valide !",
10
- noEmbedCode : "Aucun code d'intégration trouvé ou le site n'est pas supporté !",
11
- url : "URL:",
12
- widthTitle : "Maximum Width for the embeded Content",
13
- heightTitle : "Maximum Height for the embeded Content"
14
- });
@@ -1,12 +0,0 @@
1
- CKEDITOR.plugins.setLang('oembed', 'nl', {
2
- title : "Integratie van media-inhoud (foto's, video, content)",
3
- button : "Media-inhoud van externe websites",
4
- pasteUrl : "Geef een URL van een pagina in dat ondersteund wordt (Bijv.: YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.) ...",
5
- width : "Maximale breedte:",
6
- height : "Maximale hoogte:",
7
- invalidUrl : "Please provide an valid URL!",
8
- noEmbedCode : "No embed code found, or site is not supported!",
9
- url : "URL:",
10
- widthTitle : "Maximum Width for the embeded Content",
11
- heightTitle : "Maximum Height for the embeded Content"
12
- });
@@ -1,12 +0,0 @@
1
- CKEDITOR.plugins.setLang('oembed', 'ru', {
2
- title : "Внедрить медиа-контент (Фото, Видео и т.д.)",
3
- button : "Внедрить медиа-контент с различных сайтов",
4
- pasteUrl : "Вставьте ссылку на страницы с медиа-контентом (e.g. YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.)",
5
- width : "Макс. ширина:",
6
- height : "Макс. высота:",
7
- invalidUrl : "Вы ввели некорректный URL",
8
- noEmbedCode : "Не обнаружен код для вставки. Возможно, вы ввели ссылку с неподдерживаемого сайта.",
9
- url : "URL:",
10
- widthTitle : "Maximum Width for the embeded Content",
11
- heightTitle : "Maximum Height for the embeded Content"
12
- });
@@ -1,912 +0,0 @@
1
- /*!
2
- * jquery oembed plugin
3
- *
4
- * Copyright (c) Richard Chamorro
5
- * Licensed under the MIT license
6
- *
7
- * Orignal Author: Richard Chamorro
8
- * Forked by Andrew Mee to Provide a slightly diffent kind of embedding
9
- * experience
10
- */
11
- (function($) {
12
- $.fn.oembed = function(url, options, embedAction) {
13
-
14
- settings = $.extend(true, $.fn.oembed.defaults, options);
15
- var shortURLList = ["0rz.tw","1link.in","1url.com","2.gp","2big.at","2tu.us","3.ly","307.to","4ms.me","4sq.com","4url.cc","6url.com","7.ly","a.gg","a.nf","aa.cx","abcurl.net",
16
- "ad.vu","adf.ly","adjix.com","afx.cc","all.fuseurl.com","alturl.com","amzn.to","ar.gy","arst.ch","atu.ca","azc.cc","b23.ru","b2l.me","bacn.me","bcool.bz","binged.it",
17
- "bit.ly","bizj.us","bloat.me","bravo.ly","bsa.ly","budurl.com","canurl.com","chilp.it","chzb.gr","cl.lk", "cl.ly", "clck.ru", "cli.gs", "cliccami.info",
18
- "clickthru.ca", "clop.in", "conta.cc", "cort.as", "cot.ag", "crks.me", "ctvr.us", "cutt.us", "dai.ly", "decenturl.com", "dfl8.me", "digbig.com",
19
- "http:\/\/digg\.com\/[^\/]+$", "disq.us", "dld.bz", "dlvr.it", "do.my", "doiop.com", "dopen.us", "easyuri.com", "easyurl.net", "eepurl.com", "eweri.com",
20
- "fa.by", "fav.me", "fb.me", "fbshare.me", "ff.im", "fff.to", "fire.to", "firsturl.de", "firsturl.net", "flic.kr", "flq.us", "fly2.ws", "fon.gs", "freak.to",
21
- "fuseurl.com", "fuzzy.to", "fwd4.me", "fwib.net", "g.ro.lt", "gizmo.do", "gl.am", "go.9nl.com", "go.ign.com", "go.usa.gov", "goo.gl", "goshrink.com", "gurl.es",
22
- "hex.io", "hiderefer.com", "hmm.ph", "href.in", "hsblinks.com", "htxt.it", "huff.to", "hulu.com", "hurl.me", "hurl.ws", "icanhaz.com", "idek.net", "ilix.in", "is.gd",
23
- "its.my", "ix.lt", "j.mp", "jijr.com", "kl.am", "klck.me", "korta.nu", "krunchd.com", "l9k.net", "lat.ms", "liip.to", "liltext.com", "linkbee.com", "linkbun.ch",
24
- "liurl.cn", "ln-s.net", "ln-s.ru", "lnk.gd", "lnk.ms", "lnkd.in", "lnkurl.com", "lru.jp", "lt.tl", "lurl.no", "macte.ch", "mash.to", "merky.de", "migre.me", "miniurl.com",
25
- "minurl.fr", "mke.me", "moby.to", "moourl.com", "mrte.ch", "myloc.me", "myurl.in", "n.pr", "nbc.co", "nblo.gs", "nn.nf", "not.my", "notlong.com", "nsfw.in",
26
- "nutshellurl.com", "nxy.in", "nyti.ms", "o-x.fr", "oc1.us", "om.ly", "omf.gd", "omoikane.net", "on.cnn.com", "on.mktw.net", "onforb.es", "orz.se", "ow.ly", "ping.fm",
27
- "pli.gs", "pnt.me", "politi.co", "post.ly", "pp.gg", "profile.to", "ptiturl.com", "pub.vitrue.com", "qlnk.net", "qte.me", "qu.tc", "qy.fi", "r.ebay.com", "r.im", "rb6.me", "read.bi",
28
- "readthis.ca", "reallytinyurl.com", "redir.ec", "redirects.ca", "redirx.com", "retwt.me", "ri.ms", "rickroll.it", "riz.gd", "rt.nu", "ru.ly", "rubyurl.com", "rurl.org",
29
- "rww.tw", "s4c.in", "s7y.us", "safe.mn", "sameurl.com", "sdut.us", "shar.es", "shink.de", "shorl.com", "short.ie", "short.to", "shortlinks.co.uk", "shorturl.com",
30
- "shout.to", "show.my", "shrinkify.com", "shrinkr.com", "shrt.fr", "shrt.st", "shrten.com", "shrunkin.com", "simurl.com", "slate.me", "smallr.com", "smsh.me", "smurl.name",
31
- "sn.im", "snipr.com", "snipurl.com", "snurl.com", "sp2.ro", "spedr.com", "srnk.net", "srs.li", "starturl.com","stks.co", "su.pr", "surl.co.uk", "surl.hu", "t.cn", "t.co", "t.lh.com",
32
- "ta.gd", "tbd.ly", "tcrn.ch", "tgr.me", "tgr.ph", "tighturl.com", "tiniuri.com", "tiny.cc", "tiny.ly", "tiny.pl", "tinylink.in", "tinyuri.ca", "tinyurl.com", "tk.", "tl.gd",
33
- "tmi.me", "tnij.org", "tnw.to", "tny.com", "to.ly", "togoto.us", "totc.us", "toysr.us", "tpm.ly", "tr.im", "tra.kz", "trunc.it", "twhub.com", "twirl.at",
34
- "twitclicks.com", "twitterurl.net", "twitterurl.org", "twiturl.de", "twurl.cc", "twurl.nl", "u.mavrev.com", "u.nu", "u76.org", "ub0.cc", "ulu.lu", "updating.me", "ur1.ca",
35
- "url.az", "url.co.uk", "url.ie", "url360.me", "url4.eu", "urlborg.com", "urlbrief.com", "urlcover.com", "urlcut.com", "urlenco.de", "urli.nl", "urls.im",
36
- "urlshorteningservicefortwitter.com", "urlx.ie", "urlzen.com", "usat.ly", "use.my", "vb.ly", "vevo.ly", "vgn.am", "vl.am", "vm.lc", "w55.de", "wapo.st", "wapurl.co.uk", "wipi.es",
37
- "wp.me", "x.vu", "xr.com", "xrl.in", "xrl.us", "xurl.es", "xurl.jp", "y.ahoo.it", "yatuc.com", "ye.pe", "yep.it", "yfrog.com", "yhoo.it", "yiyd.com", "youtu.be", "yuarel.com",
38
- "z0p.de", "zi.ma", "zi.mu", "zipmyurl.com", "zud.me", "zurl.ws", "zz.gd", "zzang.kr", "›.ws", "✩.ws", "✿.ws", "❥.ws", "➔.ws", "➞.ws", "➡.ws", "➨.ws", "➯.ws", "➹.ws", "➽.ws"];
39
-
40
- if ($('#jqoembeddata').length === 0) $('<span id="jqoembeddata"></span>').appendTo('body');
41
-
42
- return this.each(function() {
43
-
44
- var container = $(this),
45
- resourceURL = (url && (!url.indexOf('http://') || !url.indexOf('https://'))) ? url : container.attr("href"),
46
- provider;
47
-
48
- if (embedAction) {
49
- settings.onEmbed = embedAction;
50
- }
51
- else if (!settings.onEmbed){
52
- settings.onEmbed = function(oembedData) {
53
- $.fn.oembed.insertCode(this, settings.embedMethod, oembedData);
54
- };
55
- }
56
-
57
- if (resourceURL !== null && resourceURL !== undefined) {
58
- //Check if shorten URL
59
- for (var j = 0, l =shortURLList.length; j < l; j++) {
60
- var regExp = new RegExp('://'+shortURLList[j]+'/', "i");
61
- if (resourceURL.match(regExp) !== null) {
62
- //AJAX to http://api.longurl.org/v2/expand?url=http://bit.ly/JATvIs&format=json&callback=hhh
63
- var ajaxopts = $.extend({
64
- url: "http://api.longurl.org/v2/expand",
65
- dataType: 'jsonp',
66
- data: {
67
- url: resourceURL,
68
- format: "json"
69
- //callback: "?"
70
- },
71
- success: function(data) {
72
- //this = $.fn.oembed;
73
- resourceURL = data['long-url'];
74
- provider = $.fn.oembed.getOEmbedProvider(data['long-url']);
75
-
76
- if (provider !== null) {
77
- provider.params = getNormalizedParams(settings[provider.name]) || {};
78
- provider.maxWidth = settings.maxWidth;
79
- provider.maxHeight = settings.maxHeight;
80
- embedCode(container, resourceURL, provider);
81
- } else {
82
- settings.onProviderNotFound.call(container, resourceURL);
83
- }
84
- }
85
- }, settings.ajaxOptions || {});
86
-
87
- $.ajax(ajaxopts);
88
-
89
- return container;
90
- }
91
- }
92
- provider = $.fn.oembed.getOEmbedProvider(resourceURL);
93
-
94
- if (provider !== null) {
95
- provider.params = getNormalizedParams(settings[provider.name]) || {};
96
- provider.maxWidth = settings.maxWidth;
97
- provider.maxHeight = settings.maxHeight;
98
- embedCode(container, resourceURL, provider);
99
- } else {
100
- settings.onProviderNotFound.call(container, resourceURL);
101
- }
102
- }
103
-
104
- return container;
105
- });
106
-
107
-
108
- };
109
-
110
- var settings;
111
-
112
- // Plugin defaults
113
- $.fn.oembed.defaults = {
114
- maxWidth: null,
115
- maxHeight: null,
116
- includeHandle: true,
117
- embedMethod: 'auto',
118
- // "auto", "append", "fill"
119
- onProviderNotFound: function() {},
120
- beforeEmbed: function() {},
121
- afterEmbed: function() {},
122
- onEmbed: false,
123
- onError: function() {},
124
- ajaxOptions: {}
125
- };
126
-
127
- /* Private functions */
128
- function rand(length,current){ //Found on http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
129
- current = current ? current : '';
130
- return length ? rand( --length , "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt( Math.floor( Math.random() * 60 ) ) + current ) : current;
131
- }
132
-
133
- function getRequestUrl(provider, externalUrl) {
134
- var url = provider.apiendpoint,
135
- qs = "",
136
- i;
137
- url += (url.indexOf("?") <= 0) ? "?" : "&";
138
- url = url.replace('#','%23');
139
-
140
- if (provider.maxWidth !== null && (typeof provider.params.maxwidth === 'undefined' || provider.params.maxwidth === null)) {
141
- provider.params.maxwidth = provider.maxWidth;
142
- }
143
-
144
- if (provider.maxHeight !== null && (typeof provider.params.maxheight === 'undefined' || provider.params.maxheight === null)) {
145
- provider.params.maxheight = provider.maxHeight;
146
- }
147
-
148
- for (i in provider.params) {
149
- // We don't want them to jack everything up by changing the callback parameter
150
- if (i == provider.callbackparameter) continue;
151
-
152
- // allows the options to be set to null, don't send null values to the server as parameters
153
- if (provider.params[i] !== null) qs += "&" + escape(i) + "=" + provider.params[i];
154
- }
155
-
156
- url += "format=" + provider.format + "&url=" + escape(externalUrl) + qs;
157
- if(provider.dataType!='json') url += "&" + provider.callbackparameter + "=?";
158
-
159
- return url;
160
- }
161
- function success(oembedData, externalUrl, container) {
162
- $('#jqoembeddata').data(externalUrl, oembedData.code);
163
- settings.beforeEmbed.call(container, oembedData);
164
- settings.onEmbed.call(container, oembedData);
165
- settings.afterEmbed.call(container, oembedData);
166
- }
167
-
168
- function embedCode(container, externalUrl, embedProvider) {
169
- if ($('#jqoembeddata').data(externalUrl)!=undefined && embedProvider.embedtag.tag!='iframe'){
170
- var oembedData = {code: $('#jqoembeddata').data(externalUrl)};
171
- success(oembedData, externalUrl, container);
172
- }else if (embedProvider.yql) {
173
- var from = embedProvider.yql.from || 'htmlstring';
174
- var url = embedProvider.yql.url ? embedProvider.yql.url(externalUrl) : externalUrl;
175
- var query = 'SELECT * FROM '
176
- + from
177
- + ' WHERE url="' + (url) + '"'
178
- + " and " + (/html/.test(from) ? 'xpath' : 'itemPath') + "='" + (embedProvider.yql.xpath || '/')+"'" ;
179
- if(from=='html') query += " and compat='html5'";
180
- var ajaxopts = $.extend({
181
- url: "http://query.yahooapis.com/v1/public/yql",
182
- dataType: 'jsonp',
183
- data: {
184
- q: query,
185
- format: "json",
186
- env: 'store://datatables.org/alltableswithkeys',
187
- callback: "?"
188
- },
189
- success: function(data) {
190
- var result;
191
- if(embedProvider.yql.xpath && embedProvider.yql.xpath=='//meta|//title|//link'){
192
- var meta={};
193
- if (data.query.results == null) {
194
- data.query.results = {"meta": []};
195
- }
196
- for(var i=0, l=data.query.results.meta.length; i<l; i++){
197
- var name = data.query.results.meta[i].name||data.query.results.meta[i].property||null;
198
- if(name==null)continue;
199
- meta[name.toLowerCase()]=data.query.results.meta[i].content;
200
- }
201
- if (!meta.hasOwnProperty("title") || !meta.hasOwnProperty("og:title") ) {
202
- if ( data.query.results.title != null ) {
203
- meta.title = data.query.results.title;
204
- }
205
- }
206
- if (!meta.hasOwnProperty("og:image") && data.query.results.hasOwnProperty("link")) {
207
- for ( var i=0, l=data.query.results.link.length; i<l; i++){
208
- if ( data.query.results.link[i].hasOwnProperty("rel") ) {
209
- if (data.query.results.link[i].rel == "apple-touch-icon") {
210
- if ( data.query.results.link[i].href.charAt(0) == "/" ) {
211
- meta["og:image"] = url.match(/^(([a-z]+:)?(\/\/)?[^\/]+\/).*$/)[1] + data.query.results.link[i].href;
212
- } else {
213
- meta["og:image"] = data.query.results.link[i].href;
214
- }
215
- }
216
- }
217
- }
218
- }
219
- result = embedProvider.yql.datareturn(meta);
220
- }else{
221
- result = embedProvider.yql.datareturn ? embedProvider.yql.datareturn(data.query.results) : data.query.results.result;
222
- }
223
- if(result===false)return;
224
- var oembedData = $.extend({}, result);
225
- oembedData.code = result;
226
- success(oembedData, externalUrl, container);
227
- },
228
- error: settings.onError.call(container, externalUrl, embedProvider)
229
- }, settings.ajaxOptions || {});
230
-
231
- $.ajax(ajaxopts);
232
- }else if (embedProvider.templateRegex) {
233
- if(embedProvider.embedtag.tag!==''){
234
- var flashvars = embedProvider.embedtag.flashvars || '';
235
- var tag = embedProvider.embedtag.tag || 'embed';
236
- var width = embedProvider.embedtag.width || 'auto';
237
- var nocache = embedProvider.embedtag.nocache || 0;
238
- var height = embedProvider.embedtag.height || 'auto';
239
- var src =externalUrl.replace(embedProvider.templateRegex,embedProvider.apiendpoint);
240
- if(!embedProvider.nocache) src += '&jqoemcache='+rand(5);
241
- if (embedProvider.apikey) src = src.replace('_APIKEY_', settings.apikeys[embedProvider.name]);
242
-
243
-
244
- var code = $('<'+tag+'/>')
245
- .attr('src',src)
246
- .attr('width',width)
247
- .attr('height',height)
248
- .attr('allowfullscreen',embedProvider.embedtag.allowfullscreen || 'true')
249
- .attr('allowscriptaccess',embedProvider.embedtag.allowfullscreen || 'always')
250
- .css('max-height', settings.maxHeight || 'auto' )
251
- .css('max-width', settings.maxWidth || 'auto' );
252
- if(tag=='embed')
253
- code
254
- .attr('type',embedProvider.embedtag.type || "application/x-shockwave-flash")
255
- .attr('flashvars',externalUrl.replace(embedProvider.templateRegex,flashvars));
256
- if(tag=='iframe')
257
- code
258
- .attr('scrolling',embedProvider.embedtag.scrolling || "no")
259
- .attr('frameborder',embedProvider.embedtag.frameborder || "0");
260
-
261
-
262
- var oembedData = {code: code};
263
- success(oembedData, externalUrl,container);
264
- }else if (embedProvider.apiendpoint) {
265
- //Add APIkey if true
266
- if (embedProvider.apikey) embedProvider.apiendpoint = embedProvider.apiendpoint.replace('_APIKEY_', settings.apikeys[embedProvider.name]);
267
- ajaxopts = $.extend({
268
- url: externalUrl.replace(embedProvider.templateRegex, embedProvider.apiendpoint),
269
- dataType: 'jsonp',
270
- success: function(data) {
271
- var oembedData = $.extend({}, data);
272
- oembedData.code = embedProvider.templateData(data);
273
- success(oembedData, externalUrl, container);
274
- },
275
- error: settings.onError.call(container, externalUrl, embedProvider)
276
- }, settings.ajaxOptions || {});
277
-
278
- $.ajax( ajaxopts );
279
- }else {
280
- var oembedData = {code: externalUrl.replace(embedProvider.templateRegex,embedProvider.template)};
281
- success(oembedData, externalUrl,container);
282
- }
283
- } else {
284
-
285
- var requestUrl = getRequestUrl(embedProvider, externalUrl),
286
- ajaxopts = $.extend({
287
- url: requestUrl,
288
- dataType: embedProvider.dataType || 'jsonp',
289
- success: function(data) {
290
- var oembedData = $.extend({}, data);
291
- switch (oembedData.type) {
292
- case "file": //Deviant Art has this
293
- case "photo":
294
- oembedData.code = $.fn.oembed.getPhotoCode(externalUrl, oembedData);
295
- break;
296
- case "video":
297
- case "rich":
298
- oembedData.code = $.fn.oembed.getRichCode(externalUrl, oembedData);
299
- break;
300
- default:
301
- oembedData.code = $.fn.oembed.getGenericCode(externalUrl, oembedData);
302
- break;
303
- }
304
- success(oembedData, externalUrl, container);
305
- },
306
- error: settings.onError.call(container, externalUrl, embedProvider)
307
- }, settings.ajaxOptions || {});
308
-
309
- $.ajax(ajaxopts);
310
- }
311
- };
312
-
313
- function getNormalizedParams(params) {
314
- if (params === null) return null;
315
- var key, normalizedParams = {};
316
- for (key in params) {
317
- if (key !== null) normalizedParams[key.toLowerCase()] = params[key];
318
- }
319
- return normalizedParams;
320
- }
321
-
322
- /* Public functions */
323
- $.fn.oembed.insertCode = function(container, embedMethod, oembedData) {
324
- if (oembedData === null) return;
325
- if(embedMethod=='auto' && container.attr("href") !== null) embedMethod='append';
326
- else if(embedMethod=='auto') embedMethod='replace';
327
- switch (embedMethod) {
328
- case "replace":
329
- container.replaceWith(oembedData.code);
330
- break;
331
- case "fill":
332
- container.html(oembedData.code);
333
- break;
334
- case "append":
335
- container.wrap('<div class="oembedall-container"></div>');
336
- var oembedContainer = container.parent();
337
- if (settings.includeHandle) {
338
- $('<span class="oembedall-closehide">&darr;</span>').insertBefore(container).click(function() {
339
- var encodedString = encodeURIComponent($(this).text());
340
- $(this).html((encodedString == '%E2%86%91') ? '&darr;' : '&uarr;');
341
- $(this).parent().children().last().toggle();
342
- });
343
- }
344
- oembedContainer.append('<br/>');
345
- try {
346
- oembedData.code.clone().appendTo(oembedContainer);
347
- } catch(e) {
348
- oembedContainer.append(oembedData.code);
349
- }
350
- /* Make videos semi-responsive
351
- * If parent div width less than embeded iframe video then iframe gets shrunk to fit smaller width
352
- * If parent div width greater thans embed iframe use the max widht
353
- * - works on youtubes and vimeo
354
- */
355
- if(settings.maxWidth){
356
- var post_width = oembedContainer.parent().width();
357
- if(post_width < settings.maxWidth)
358
- {
359
- var iframe_width_orig = $('iframe',oembedContainer).width();
360
- var iframe_height_orig = $('iframe',oembedContainer).height();
361
- var ratio = iframe_width_orig / post_width;
362
- $('iframe',oembedContainer).width(iframe_width_orig / ratio);
363
- $('iframe',oembedContainer).height(iframe_height_orig / ratio);
364
- } else {
365
- if(settings.maxWidth){
366
- $('iframe',oembedContainer).width(settings.maxWidth);
367
- }
368
- if(settings.maxHeight){
369
- $('iframe',oembedContainer).height(settings.maxHeight);
370
- }
371
- }
372
- }
373
- break;
374
- }
375
- };
376
-
377
- $.fn.oembed.getPhotoCode = function(url, oembedData) {
378
- var code, alt = oembedData.title ? oembedData.title : '';
379
- alt += oembedData.author_name ? ' - ' + oembedData.author_name : '';
380
- alt += oembedData.provider_name ? ' - ' + oembedData.provider_name : '';
381
- code = '<div><a href="' + url + '" target=\'_blank\'><img src="' + oembedData.url + '" alt="' + alt + '"/></a></div>';
382
- if (oembedData.html) code += "<div>" + oembedData.html + "</div>";
383
- return code;
384
- };
385
-
386
- $.fn.oembed.getRichCode = function(url, oembedData) {
387
- var code = oembedData.html;
388
- return code;
389
- };
390
-
391
- $.fn.oembed.getGenericCode = function(url, oembedData) {
392
- var title = (oembedData.title !== null) ? oembedData.title : url,
393
- code = '<a href="' + url + '">' + title + '</a>';
394
- if (oembedData.html) code += "<div>" + oembedData.html + "</div>";
395
- return code;
396
- };
397
-
398
- $.fn.oembed.getOEmbedProvider = function(url) {
399
- for (var i = 0; i < $.fn.oembed.providers.length; i++) {
400
- for (var j = 0, l =$.fn.oembed.providers[i].urlschemes.length; j < l; j++) {
401
- var regExp = new RegExp($.fn.oembed.providers[i].urlschemes[j], "i");
402
- if (url.match(regExp) !== null) return $.fn.oembed.providers[i];
403
- }
404
- }
405
- return null;
406
- };
407
-
408
- $.fn.oembed.OEmbedProvider = function(name, type, urlschemesarray, apiendpoint, extraSettings) {
409
- this.name = name;
410
- this.type = type; // "photo", "video", "link", "rich", null
411
- this.urlschemes = urlschemesarray;
412
- this.apiendpoint = apiendpoint;
413
- this.maxWidth = 500;
414
- this.maxHeight = 400;
415
- extraSettings =extraSettings ||{};
416
-
417
- if(extraSettings.useYQL){
418
-
419
- if(extraSettings.useYQL=='xml'){
420
- extraSettings.yql = {xpath:"//oembed/html", from:'xml'
421
- , apiendpoint: this.apiendpoint
422
- , url: function(externalurl){return this.apiendpoint+'?format=xml&url='+externalurl; }
423
- , datareturn:function(results){return results.html.replace(/.*\[CDATA\[(.*)\]\]>$/,'$1') || ''; }
424
- };
425
- }else{
426
- extraSettings.yql = {from:'json'
427
- , apiendpoint: this.apiendpoint
428
- , url: function(externalurl){return this.apiendpoint+'?format=json&url='+externalurl; }
429
- , datareturn:function(results){
430
- if (results.json.type != 'video' && (results.json.url || results.json.thumbnail_url)) {
431
- return '<img src="' + (results.json.url || results.json.thumbnail_url) + '" />';
432
- }
433
- return results.json.html || '';
434
- }
435
- };
436
- }
437
- this.apiendpoint = null;
438
- }
439
-
440
-
441
- for (var property in extraSettings) {
442
- this[property] = extraSettings[property];
443
- }
444
-
445
- this.format = this.format || 'json';
446
- this.callbackparameter = this.callbackparameter || "callback";
447
- this.embedtag = this.embedtag || {tag:""};
448
-
449
-
450
- };
451
-
452
- /* Native & common providers */
453
- $.fn.oembed.providers = [
454
-
455
- //Video
456
- new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+"], 'http://www.youtube.com/oembed', {useYQL:'json'}),
457
- new $.fn.oembed.OEmbedProvider("youtubeiframe", "video", ["youtube.com/embed"], "$1?wmode=transparent",
458
- {templateRegex:/(.*)/,embedtag : {tag: 'iframe', width:'425',height: '349'}}),
459
- new $.fn.oembed.OEmbedProvider("wistia", "video", ["wistia.com/m/.+", "wistia.com/embed/.+","wi.st/m/.+","wi.st/embed/.+"], 'http://fast.wistia.com/oembed', {useYQL:'json'}),
460
- new $.fn.oembed.OEmbedProvider("xtranormal", "video", ["xtranormal\\.com/watch/.+"], "http://www.xtranormal.com/xtraplayr/$1/$2", {
461
- templateRegex: /.*com\/watch\/([\w\-]+)\/([\w\-]+).*/,embedtag: {tag: 'iframe',width: '320',height: '269'}}),
462
- new $.fn.oembed.OEmbedProvider("scivee", "video", ["scivee.tv/node/.+"], "http://www.scivee.tv/flash/embedCast.swf?", {
463
- templateRegex: /.*tv\/node\/(.+)/,embedtag: {width: '480',height: '400',flashvars:"id=$1&type=3"}}),
464
- new $.fn.oembed.OEmbedProvider("veoh", "video", ["veoh.com/watch/.+"], "http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1337&permalinkId=$1&player=videodetailsembedded&videoAutoPlay=0&id=anonymous", {
465
- templateRegex: /.*watch\/([^\?]+).*/,embedtag: {width: '410',height: '341'}}),
466
- new $.fn.oembed.OEmbedProvider("gametrailers", "video", ["gametrailers\\.com/video/.+"], "http://media.mtvnservices.com/mgid:moses:video:gametrailers.com:$2", {
467
- templateRegex: /.*com\/video\/([\w\-]+)\/([\w\-]+).*/,embedtag: {width: '512',height: '288' }}),
468
- new $.fn.oembed.OEmbedProvider("funnyordie", "video", ["funnyordie\\.com/videos/.+"], "http://player.ordienetworks.com/flash/fodplayer.swf?", {
469
- templateRegex: /.*videos\/([^\/]+)\/([^\/]+)?/,embedtag: {width: 512,height: 328,flashvars: "key=$1"}}),
470
- new $.fn.oembed.OEmbedProvider("colledgehumour", "video", ["collegehumor\\.com/video/.+"],"http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=$1&use_node_id=true&fullscreen=1",
471
- {templateRegex:/.*video\/([^\/]+).*/ , embedtag : {width:600,height: 338}}),
472
- new $.fn.oembed.OEmbedProvider("metacafe", "video", ["metacafe\\.com/watch/.+"],"http://www.metacafe.com/fplayer/$1/$2.swf",
473
- {templateRegex:/.*watch\/(\d+)\/(\w+)\/.*/ , embedtag : {width:400,height: 345}}),
474
- new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser\\.com\/channel\/.*\/broadcast\/.*"],"http://static.bambuser.com/r/player.swf?vid=$1",
475
- {templateRegex:/.*bambuser\.com\/channel\/.*\/broadcast\/(\w+).*/ , embedtag : {width:512,height: 339 }}),
476
- new $.fn.oembed.OEmbedProvider("twitvid", "video", ["twitvid\\.com/.+"],"http://www.twitvid.com/embed.php?guid=$1&autoplay=0",
477
- {templateRegex:/.*twitvid\.com\/(\w+).*/ , embedtag : {tag:'iframe',width:480,height: 360 }}),
478
-
479
- new $.fn.oembed.OEmbedProvider("aniboom", "video", ["aniboom\\.com/animation-video/.+"],"http://api.aniboom.com/e/$1",
480
- {templateRegex:/.*animation-video\/(\d+).*/ , embedtag : {width:594,height: 334}}),
481
-
482
- new $.fn.oembed.OEmbedProvider("vzaar", "video", ["vzaar\\.com/videos/.+","vzaar.tv/.+"],"http://view.vzaar.com/$1/player?",
483
- {templateRegex:/.*\/(\d+).*/, embedtag : {tag:'iframe',width:576,height: 324 }}),
484
- new $.fn.oembed.OEmbedProvider("snotr", "video", ["snotr\\.com/video/.+"],"http://www.snotr.com/embed/$1",
485
- {templateRegex:/.*\/(\d+).*/, embedtag : {tag:'iframe',width:400,height: 330, nocache:1 }}),
486
-
487
- new $.fn.oembed.OEmbedProvider("youku", "video", ["v.youku.com/v_show/id_.+"],"http://player.youku.com/player.php/sid/$1/v.swf",
488
- {templateRegex:/.*id_(.+)\.html.*/, embedtag : {width:480,height:400, nocache:1 }}),
489
- new $.fn.oembed.OEmbedProvider("tudou", "video", ["tudou.com/programs/view/.+\/"],"http://www.tudou.com/v/$1/v.swf",
490
- {templateRegex:/.*view\/(.+)\//, embedtag : {width:480,height:400, nocache:1 }}),
491
-
492
- new $.fn.oembed.OEmbedProvider("embedr", "video", ["embedr\\.com/playlist/.+"],"http://embedr.com/swf/slider/$1/425/520/default/false/std?",
493
- {templateRegex:/.*playlist\/([^\/]+).*/, embedtag : {width:425,height: 520}}),
494
- new $.fn.oembed.OEmbedProvider("blip", "video", ["blip\\.tv/.+"], "http://blip.tv/oembed/"),
495
- new $.fn.oembed.OEmbedProvider("minoto-video", "video", ["http://api.minoto-video.com/publishers/.+/videos/.+","http://dashboard.minoto-video.com/main/video/details/.+","http://embed.minoto-video.com/.+"], "http://api.minoto-video.com/services/oembed.json",{useYQL:'json'}),
496
- new $.fn.oembed.OEmbedProvider("animoto", "video", ["animoto.com/play/.+"], "http://animoto.com/services/oembed"),
497
- new $.fn.oembed.OEmbedProvider("hulu", "video", ["hulu\\.com/watch/.*"], "http://www.hulu.com/api/oembed.json"),
498
- new $.fn.oembed.OEmbedProvider("ustream", "video", ["ustream\\.tv/recorded/.*"], "http://www.ustream.tv/oembed",{useYQL:'json'}),
499
- new $.fn.oembed.OEmbedProvider("videojug", "video", ["videojug\\.com/(film|payer|interview).*"], "http://www.videojug.com/oembed.json",{useYQL:'json'}),
500
- new $.fn.oembed.OEmbedProvider("sapo", "video", ["videos\\.sapo\\.pt/.*"], "http://videos.sapo.pt/oembed",{useYQL:'json'}),
501
- new $.fn.oembed.OEmbedProvider("vodpod", "video", ["vodpod.com/watch/.*"], "http://vodpod.com/oembed.js",{useYQL:'json'}),
502
- new $.fn.oembed.OEmbedProvider("vimeo", "video", ["http:\/\/www\.vimeo\.com\/groups\/.*\/videos\/.*", "http:\/\/www\.vimeo\.com\/.*", "http:\/\/vimeo\.com\/groups\/.*\/videos\/.*", "http:\/\/vimeo\.com\/.*"], "http://vimeo.com/api/oembed.json"),
503
- new $.fn.oembed.OEmbedProvider("dailymotion", "video", ["dailymotion\\.com/.+"],'http://www.dailymotion.com/services/oembed'),
504
- new $.fn.oembed.OEmbedProvider("5min", "video", ["www\\.5min\\.com/.+"], 'http://api.5min.com/oembed.xml',{useYQL:'xml'}),
505
- new $.fn.oembed.OEmbedProvider("National Film Board of Canada", "video", ["nfb\\.ca/film/.+"],'http://www.nfb.ca/remote/services/oembed/',{useYQL:'json'}),
506
- new $.fn.oembed.OEmbedProvider("qik", "video", ["qik\\.com/\\w+"], 'http://qik.com/api/oembed.json',{useYQL:'json'}),
507
- new $.fn.oembed.OEmbedProvider("revision3", "video", ["revision3\\.com"], "http://revision3.com/api/oembed/"),
508
- new $.fn.oembed.OEmbedProvider("dotsub", "video", ["dotsub\\.com/view/.+"], "http://dotsub.com/services/oembed",{useYQL:'json'}),
509
- new $.fn.oembed.OEmbedProvider("clikthrough", "video", ["clikthrough\\.com/theater/video/\\d+"], "http://clikthrough.com/services/oembed"),
510
- new $.fn.oembed.OEmbedProvider("Kinomap", "video", ["kinomap\\.com/.+"], "http://www.kinomap.com/oembed"),
511
- new $.fn.oembed.OEmbedProvider("VHX", "video", ["vhx.tv/.+"], "http://vhx.tv/services/oembed.json"),
512
- new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser.com/.+"], "http://api.bambuser.com/oembed/iframe.json"),
513
- new $.fn.oembed.OEmbedProvider("justin.tv", "video", ["justin.tv/.+"], 'http://api.justin.tv/api/embed/from_url.json',{useYQL:'json'}),
514
-
515
-
516
- //Audio
517
- new $.fn.oembed.OEmbedProvider("official.fm", "rich", ["official.fm/.+"], 'http://official.fm/services/oembed',{useYQL:'json'}),
518
- new $.fn.oembed.OEmbedProvider("chirbit", "rich", ["chirb.it/.+"], 'http://chirb.it/oembed.json',{useYQL:'json'}),
519
- new $.fn.oembed.OEmbedProvider("Huffduffer", "rich", ["huffduffer.com/[-.\\w@]+/\\d+"], "http://huffduffer.com/oembed"),
520
- new $.fn.oembed.OEmbedProvider("shoudio", "rich", ["shoudio.com/.+","shoud.io/.+"], "http://shoudio.com/api/oembed"),
521
- new $.fn.oembed.OEmbedProvider("mixcloud", "rich", ["mixcloud.com/.+"],'http://www.mixcloud.com/oembed/',{useYQL:'json'}),
522
- new $.fn.oembed.OEmbedProvider("rdio.com", "rich", ["rd.io/.+","rdio.com"], "http://www.rdio.com/api/oembed/"),
523
- new $.fn.oembed.OEmbedProvider("Soundcloud", "rich", ["soundcloud.com/.+","snd.sc/.+"], "http://soundcloud.com/oembed",{format:'js'}),
524
- new $.fn.oembed.OEmbedProvider("bandcamp", "rich", ["bandcamp\\.com/album/.+"], null,
525
- {yql:{xpath:"//meta[contains(@content, \\'EmbeddedPlayer\\')]", from:'html'
526
- , datareturn:function(results){
527
- return results.meta ?'<iframe width="400" height="100" src="'+results.meta.content+'" allowtransparency="true" frameborder="0"></iframe>':false;
528
- }
529
- }
530
- }),
531
-
532
- //Photo
533
- new $.fn.oembed.OEmbedProvider("deviantart", "photo", ["deviantart.com/.+","fav.me/.+","deviantart.com/.+"], "http://backend.deviantart.com/oembed",{format:'jsonp'}),
534
- new $.fn.oembed.OEmbedProvider("skitch", "photo", ["skitch.com/.+"], null,
535
- {yql:{xpath:"json", from:'json'
536
- , url: function(externalurl){return 'http://skitch.com/oembed/?format=json&url='+externalurl; }
537
- , datareturn:function(data){return $.fn.oembed.getPhotoCode( data.json.url, data.json);}
538
- }
539
- }),
540
- new $.fn.oembed.OEmbedProvider("mobypicture", "photo", ["mobypicture.com/user/.+/view/.+","moby.to/.+"], "http://api.mobypicture.com/oEmbed"),
541
- new $.fn.oembed.OEmbedProvider("flickr", "photo", ["flickr\\.com/photos/.+"], "http://flickr.com/services/oembed",{callbackparameter:'jsoncallback'}),
542
- new $.fn.oembed.OEmbedProvider("photobucket", "photo", ["photobucket\\.com/(albums|groups)/.+"], "http://photobucket.com/oembed/"),
543
- new $.fn.oembed.OEmbedProvider("instagram", "photo", ["instagr\\.?am(\\.com)?/.+"], "http://api.instagram.com/oembed"),
544
- //new $.fn.oembed.OEmbedProvider("yfrog", "photo", ["yfrog\\.(com|ru|com\\.tr|it|fr|co\\.il|co\\.uk|com\\.pl|pl|eu|us)/.+"], "http://www.yfrog.com/api/oembed",{useYQL:"json"}),
545
- new $.fn.oembed.OEmbedProvider("SmugMug", "photo", ["smugmug.com/[-.\\w@]+/.+"], "http://api.smugmug.com/services/oembed/"),
546
-
547
- new $.fn.oembed.OEmbedProvider("dribbble", "photo", ["dribbble.com/shots/.+"], "http://api.dribbble.com/shots/$1?callback=?",
548
- { templateRegex:/.*shots\/([\d]+).*/,
549
- templateData : function(data){if(!data.image_teaser_url)return false;
550
- return '<img src="'+data.image_teaser_url+'"/>';
551
- }
552
- }),
553
- new $.fn.oembed.OEmbedProvider("chart.ly", "photo", ["chart\\.ly/[a-z0-9]{6,8}"],"http://chart.ly/uploads/large_$1.png",
554
- {templateRegex:/.*ly\/([^\/]+).*/ , embedtag : {tag:'img'},nocache:1}),
555
- //new $.fn.oembed.OEmbedProvider("stocktwits.com", "photo", ["stocktwits\\.com/message/.+"], "http://charts.stocktwits.com/production/original_$1.png?",
556
- // { templateRegex: /.*message\/([^\/]+).*/, embedtag: { tag: 'img'},nocache:1 }),
557
- new $.fn.oembed.OEmbedProvider("circuitlab", "photo", ["circuitlab.com/circuit/.+"],"https://www.circuitlab.com/circuit/$1/screenshot/540x405/",
558
- {templateRegex:/.*circuit\/([^\/]+).*/ , embedtag : {tag:'img'},nocache:1}),
559
- new $.fn.oembed.OEmbedProvider("23hq", "photo", ["23hq.com/[-.\\w@]+/photo/.+"],"http://www.23hq.com/23/oembed",{useYQL:"json"}),
560
- new $.fn.oembed.OEmbedProvider("img.ly", "photo", ["img\\.ly/.+"],"http://img.ly/show/thumb/$1",
561
- {templateRegex:/.*ly\/([^\/]+).*/ , embedtag : {tag:'img'},nocache:1
562
- }),
563
- new $.fn.oembed.OEmbedProvider("twitgoo.com", "photo", ["twitgoo\\.com/.+"],"http://twitgoo.com/show/thumb/$1",
564
- {templateRegex:/.*com\/([^\/]+).*/ , embedtag : {tag:'img'},nocache:1}),
565
- new $.fn.oembed.OEmbedProvider("imgur.com", "photo", ["imgur\\.com/gallery/.+"],"http://imgur.com/$1l.jpg",
566
- {templateRegex:/.*gallery\/([^\/]+).*/ , embedtag : {tag:'img'},nocache:1}),
567
- new $.fn.oembed.OEmbedProvider("visual.ly", "rich", ["visual\\.ly/.+"], null,
568
- {yql:{xpath:"//a[@id=\\'gc_article_graphic_image\\']/img", from:'htmlstring'}
569
- }),
570
- new $.fn.oembed.OEmbedProvider("gravtar", "photo", ["mailto:.+"],null,
571
- {templateRegex:/mailto:([^\/]+).*/
572
- , template : function(wm,email){
573
- return '<img src="http://gravatar.com/avatar/'+email.md5()+'.jpg" alt="on Gravtar" class="jqoaImg">';
574
- }
575
- }),
576
-
577
- //Rich
578
- new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"),
579
- new $.fn.oembed.OEmbedProvider("gmep", "rich", ["gmep.imeducate.com/.*","gmep.org/.*"], "http://gmep.org/oembed.json"),
580
- new $.fn.oembed.OEmbedProvider("urtak", "rich", ["urtak.com/(u|clr)/.+"], "http://oembed.urtak.com/1/oembed"),
581
- new $.fn.oembed.OEmbedProvider("cacoo", "rich", ["cacoo.com/.+"], "http://cacoo.com/oembed.json"),
582
- new $.fn.oembed.OEmbedProvider("dailymile", "rich", ["dailymile.com/people/.*/entries/.*"], "http://api.dailymile.com/oembed"),
583
- new $.fn.oembed.OEmbedProvider("dipity", "rich", ["dipity.com/timeline/.+"],'http://www.dipity.com/oembed/timeline/',{useYQL:'json'}),
584
- new $.fn.oembed.OEmbedProvider("sketchfab", "rich", ["sketchfab.com/show/.+"],'http://sketchfab.com/oembed',{useYQL:'json'}),
585
- new $.fn.oembed.OEmbedProvider("speakerdeck", "rich", ["speakerdeck.com/.+"],'http://speakerdeck.com/oembed.json',{useYQL:'json'}),
586
- new $.fn.oembed.OEmbedProvider("popplet", "rich", ["popplet.com/app/.*"],"http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1",
587
- {templateRegex:/.*#\/([^\/]+).*/,embedtag : {width:460,height: 460} }),
588
-
589
- new $.fn.oembed.OEmbedProvider("pearltrees", "rich", ["pearltrees.com/.*"],"http://cdn.pearltrees.com/s/embed/getApp?",
590
- {templateRegex:/.*N-f=1_(\d+).*N-p=(\d+).*/, embedtag : {width:460,height: 460,
591
- flashvars : "lang=en_US&amp;embedId=pt-embed-$1-693&amp;treeId=$1&amp;pearlId=$2&amp;treeTitle=Diagrams%2FVisualization&amp;site=www.pearltrees.com%2FF"}
592
- }),
593
-
594
- new $.fn.oembed.OEmbedProvider("prezi", "rich", ["prezi.com/.*"],"http://prezi.com/bin/preziloader.swf?",
595
- {templateRegex:/.*com\/([^\/]+)\/.*/,embedtag : {width:550,height: 400,
596
- flashvars : "prezi_id=$1&amp;lock_to_path=0&amp;color=ffffff&amp;autoplay=no&amp;autohide_ctrls=0"
597
- }
598
- }),
599
-
600
- new $.fn.oembed.OEmbedProvider("tourwrist", "rich", ["tourwrist.com/tours/.+"], null,
601
- { templateRegex:/.*tours.([\d]+).*/,
602
- template : function(wm,tourid){
603
- setTimeout(function(){if(loadEmbeds)loadEmbeds();},2000);
604
- return "<div id='"+tourid+"' class='tourwrist-tour-embed direct'></div> <script type='text/javascript' src='http://tourwrist.com/tour_embed.js'></script>";
605
- }
606
- }),
607
-
608
- new $.fn.oembed.OEmbedProvider("meetup", "rich", ["meetup\\.(com|ps)/.+"], "http://api.meetup.com/oembed"),
609
- new $.fn.oembed.OEmbedProvider("ebay", "rich", ["ebay\\.*"],"http://togo.ebay.com/togo/togo.swf?2008013100",
610
- {templateRegex:/.*\/([^\/]+)\/(\d{10,13}).*/, embedtag : {width:355,height: 300,
611
- flashvars : "base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1"
612
- }
613
- }),
614
- new $.fn.oembed.OEmbedProvider("wikipedia", "rich", ["wikipedia.org/wiki/.+"], "http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json&section=0&callback=?",{
615
- templateRegex:/.*\/\/([\w]+).*\/wiki\/([^\/]+).*/,
616
- templateData : function(data){if(!data.parse)return false;
617
- var text = data.parse['text']['*'].replace(/href="\/wiki/g,'href="http://en.wikipedia.org/wiki');
618
- return '<div id="content"><h3><a class="nav-link" href="http://en.wikipedia.org/wiki/'+data.parse['displaytitle']+'">'+data.parse['displaytitle']+'</a></h3>'+text+'</div>';
619
- }
620
- }),
621
- new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?",
622
- {templateRegex:/.*\/title\/([^\/]+).*/,
623
- templateData : function(data){if(!data.Title)return false;
624
- return '<div id="content"><h3><a class="nav-link" href="http://imdb.com/title/'+data.ID+'/">'+data.Title+'</a> ('+data.Year+')</h3><p>Starring: '+data.Actors+'</p><div id="photo-wrap" style="margin: auto;width:600px;height:450px;"><img class="photo" id="photo-display" src="'+data.Poster+'" alt="'+data.Title+'"></div> <div id="view-photo-caption">'+data.Plot+'</div></div>';
625
- }
626
- }),
627
- new $.fn.oembed.OEmbedProvider("livejournal", "rich", ["livejournal.com/"], "http://ljpic.seacrow.com/json/$2$4?jsonp=?"
628
- ,{templateRegex:/(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/,
629
- templateData : function(data){if(!data.username)return false;
630
- return '<div><img src="'+data.image+'" align="left" style="margin-right: 1em;" /><span class="oembedall-ljuser"><a href="http://'+data.username+'.livejournal.com/profile"><img src="http://www.livejournal.com/img/userinfo.gif" alt="[info]" width="17" height="17" /></a><a href="http://'+data.username+'.livejournal.com/">'+data.username+'</a></span><br />'+data.name+'</div>';
631
- }
632
- }),
633
- new $.fn.oembed.OEmbedProvider("circuitbee", "rich", ["circuitbee\\.com/circuit/view/.+"],"http://c.circuitbee.com/build/r/schematic-embed.html?id=$1",
634
- {templateRegex:/.*circuit\/view\/(\d+).*/ ,embedtag : {tag: 'iframe', width:'500',height: '350'}
635
- }),
636
-
637
- new $.fn.oembed.OEmbedProvider("googlecalendar", "rich", ["www.google.com/calendar/embed?.+"],"$1",
638
- {templateRegex:/(.*)/ ,embedtag : {tag: 'iframe', width:'800',height: '600' }
639
- }),
640
- new $.fn.oembed.OEmbedProvider("jsfiddle", "rich", ["jsfiddle.net/[^/]+/?"],"http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?",
641
- {templateRegex:/.*net\/([^\/]+).*/ ,embedtag : {tag: 'iframe', width:'100%',height: '300' }
642
- }),
643
- new $.fn.oembed.OEmbedProvider("jsbin", "rich", ["jsbin.com/.+"],"http://jsbin.com/$1/?",
644
- {templateRegex:/.*com\/([^\/]+).*/ ,embedtag : {tag: 'iframe', width:'100%',height: '300' }
645
- }),
646
-
647
- new $.fn.oembed.OEmbedProvider("jotform", "rich", ["form.jotform.co/form/.+"],"$1?",
648
- {templateRegex:/(.*)/ ,embedtag : {tag: 'iframe', width:'100%',height: '507' }
649
- }),
650
- new $.fn.oembed.OEmbedProvider("reelapp", "rich", ["reelapp\\.com/.+"],"http://www.reelapp.com/$1/embed",
651
- {templateRegex:/.*com\/(\S{6}).*/ ,embedtag : {tag: 'iframe', width:'400',height: '338'}
652
- }),
653
- new $.fn.oembed.OEmbedProvider("linkedin", "rich", ["linkedin.com/pub/.+"],"https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true",
654
- {templateRegex:/(.*)/ ,embedtag : {tag: 'iframe', width:'368px',height: 'auto'}
655
- }),
656
-
657
- new $.fn.oembed.OEmbedProvider("timetoast", "rich", ["timetoast.com/timelines/[0-9]+"],"http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1",
658
- {templateRegex:/.*timelines\/([0-9]*)/ ,embedtag : { width:550,height: 400,nocache:1}
659
- }),
660
- new $.fn.oembed.OEmbedProvider("pastebin", "rich", ["pastebin\\.com/[\\S]{8}"],"http://pastebin.com/embed_iframe.php?i=$1",
661
- {templateRegex:/.*\/(\S{8}).*/ ,embedtag : {tag: 'iframe', width:'100%',height: 'auto'}
662
- }),
663
- new $.fn.oembed.OEmbedProvider("pastie", "rich", ["pastie\\.org/pastes/.+"],null,{yql:{xpath:'//pre[@class="textmate-source"]'}}),
664
- new $.fn.oembed.OEmbedProvider("github", "rich", ["gist.github.com/.+"], "https://github.com/api/oembed"),
665
- new $.fn.oembed.OEmbedProvider("github", "rich", ["github.com/[-.\\w@]+/[-.\\w@]+"], "https://api.github.com/repos/$1/$2?callback=?"
666
- ,{templateRegex:/.*\/([^\/]+)\/([^\/]+).*/,
667
- templateData : function(data){ if(!data.data.html_url)return false;
668
- return '<div class="oembedall-githubrepos"><ul class="oembedall-repo-stats"><li>'+data.data.language+'</li><li class="oembedall-watchers"><a title="Watchers" href="'+data.data.html_url+'/watchers">&#x25c9; '+data.data.watchers+'</a></li>'
669
- +'<li class="oembedall-forks"><a title="Forks" href="'+data.data.html_url+'/network">&#x0265; '+data.data.forks+'</a></li></ul><h3><a href="'+data.data.html_url+'">'+data.data.name+'</a></h3><div class="oembedall-body"><p class="oembedall-description">'+data.data.description+'</p>'
670
- +'<p class="oembedall-updated-at">Last updated: '+data.data.pushed_at+'</p></div></div>';
671
- }
672
- }),
673
-
674
- new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?"
675
- ,{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/,
676
- templateData : function(data){ if(!data.id)return false;
677
- var out = '<div class="oembedall-facebook1"><div class="oembedall-facebook2"><a href="http://www.facebook.com/">facebook</a> ';
678
- if(data.from) out += '<a href="http://www.facebook.com/'+data.from.id+'">'+data.from.name+'</a>';
679
- else if(data.link) out += '<a href="'+data.link+'">'+data.name+'</a>';
680
- else if(data.username) out += '<a href="http://www.facebook.com/'+data.username+'">'+data.name+'</a>';
681
- else out += '<a href="http://www.facebook.com/'+data.id+'">'+data.name+'</a>';
682
- out += '</div><div class="oembedall-facebookBody"><div class="contents">';
683
- if(data.picture) out += '<a href="'+data.link+'"><img src="'+data.picture+'"></a>';
684
- else out += '<img src="https://graph.facebook.com/'+data.id+'/picture">';
685
- if(data.from) out += '<a href="'+data.link+'">'+data.name+'</a>';
686
- if(data.founded) out += 'Founded: <strong>'+data.founded+'</strong><br>';
687
- if(data.category) out += 'Category: <strong>'+data.category+'</strong><br>';
688
- if(data.website) out += 'Website: <strong><a href="'+data.website+'">'+data.website+'</a></strong><br>';
689
- if(data.gender) out += 'Gender: <strong>'+data.gender+'</strong><br>';
690
- if(data.description) out += data.description + '<br>';
691
- out += '</div></div>';
692
- return out;
693
- }
694
- }),
695
- new $.fn.oembed.OEmbedProvider("stackoverflow", "rich", ["stackoverflow.com/questions/[\\d]+"], "http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?"
696
- ,{templateRegex:/.*questions\/([\d]+).*/,
697
- templateData : function(data){
698
- if(!data.questions)return false;
699
- var q = data.questions[0];
700
- var body = $(q.body).text();
701
- var out = '<div class="oembedall-stoqembed"><div class="oembedall-statscontainer"><div class="oembedall-statsarrow"></div><div class="oembedall-stats"><div class="oembedall-vote"><div class="oembedall-votes">'
702
- +'<span class="oembedall-vote-count-post"><strong>'+ (q.up_vote_count - q.down_vote_count)+ '</strong></span><div class="oembedall-viewcount">vote(s)</div></div>'
703
- +'</div><div class="oembedall-status"><strong>'+q.answer_count+'</strong>answer</div></div><div class="oembedall-views">'+q.view_count+' view(s)</div></div>'
704
- +'<div class="oembedall-summary"><h3><a class="oembedall-question-hyperlink" href="http://stackoverflow.com/questions/'+q.question_id+'/">'+q.title+'</a></h3>'
705
- +'<div class="oembedall-excerpt">'+ body.substring(0,100)+'...</div><div class="oembedall-tags">';
706
- for(i in q.tags)
707
- out += '<a title="" class="oembedall-post-tag" href="http://stackoverflow.com/questions/tagged/'+q.tags[i]+'">'+q.tags[i]+'</a>';
708
- out += '</div><div class="oembedall-fr"><div class="oembedall-user-info"><div class="oembedall-user-gravatar32"><a href="http://stackoverflow.com/users/'+q.owner.user_id+'/'+q.owner.display_name+'">'
709
- +'<img width="32" height="32" alt="" src="http://www.gravatar.com/avatar/'+q.owner.email_hash+'?s=32&amp;d=identicon&amp;r=PG"></a></div><div class="oembedall-user-details">'
710
- +'<a href="http://stackoverflow.com/users/'+q.owner.user_id+'/'+q.owner.display_name+'">'+q.owner.display_name+'</a><br><span title="reputation score" class="oembedall-reputation-score">'
711
- +q.owner.reputation+'</span></div></div></div></div></div>';
712
- return out;
713
- }
714
- }),
715
- new $.fn.oembed.OEmbedProvider("wordpress", "rich", ["wordpress\\.com/.+","blogs\\.cnn\\.com/.+","techcrunch\\.com/.+","wp\\.me/.+"], "http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"),
716
- new $.fn.oembed.OEmbedProvider("screenr", "rich", ["screenr\.com"], "http://www.screenr.com/embed/$1",
717
- {templateRegex:/.*\/([^\/]+).*/
718
- ,embedtag : {tag: 'iframe', width:'650',height: 396}
719
- }) ,
720
- new $.fn.oembed.OEmbedProvider("gigpans", "rich", ["gigapan\\.org/[-.\\w@]+/\\d+"],"http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html",
721
- {templateRegex:/.*\/(\d+)\/?.*/,
722
- embedtag : {tag: 'iframe', width:'100%',height: 400 }
723
- }),
724
- new $.fn.oembed.OEmbedProvider("scribd", "rich", ["scribd\\.com/.+"],"http://www.scribd.com/embeds/$1/content?start_page=1&view_mode=list",
725
- {templateRegex:/.*doc\/([^\/]+).*/ ,
726
- embedtag : {tag: 'iframe', width:'100%',height: 600}
727
- }),
728
- new $.fn.oembed.OEmbedProvider("kickstarter", "rich", ["kickstarter\\.com/projects/.+"], "$1/widget/card.html",
729
- {templateRegex:/([^\?]+).*/ ,
730
- embedtag : {tag: 'iframe', width:'220',height: 380}
731
- }),
732
-
733
- new $.fn.oembed.OEmbedProvider("amazon", "rich", ["amzn.com/B+","amazon.com.*/(B\\S+)($|\\/.*)"], "http://rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr"
734
- ,{apikey: true,templateRegex:/.*\/(B[0-9A-Z]+)($|\/.*)/,
735
- embedtag : {tag: 'iframe', width:'120px',height: '240px'}
736
- }),
737
-
738
- new $.fn.oembed.OEmbedProvider("slideshare", "rich", ["slideshare\.net"], "http://www.slideshare.net/api/oembed/2",{format:'jsonp'}),
739
- new $.fn.oembed.OEmbedProvider("roomsharejp", "rich", ["roomshare\\.jp/(en/)?post/.*"], "http://roomshare.jp/oembed.json"),
740
-
741
- new $.fn.oembed.OEmbedProvider("lanyard", "rich", ["lanyrd.com/\\d+/.+"], null,
742
- {yql:{xpath:'(//div[@class="primary"])[1]', from: 'htmlstring'
743
- , datareturn:function(results){
744
- if(!results.result) return false;
745
- return '<div class="oembedall-lanyard">'+results.result+'</div>';
746
- }
747
- }
748
- }),
749
- new $.fn.oembed.OEmbedProvider("asciiartfarts", "rich", ["asciiartfarts.com/\\d+.html"], null,
750
- {yql:{xpath:'//pre/font', from: 'htmlstring'
751
- , datareturn:function(results){
752
- if(!results.result) return false;
753
- return '<pre style="background-color:000;">'+results.result+'</div>';
754
- }
755
- }
756
- }),
757
-
758
-
759
-
760
- //Use Open Graph Where applicable
761
- new $.fn.oembed.OEmbedProvider("opengraph", "rich", [".*"], null,
762
- {yql:{xpath:"//meta|//title|//link", from:'html'
763
- , datareturn:function(results){
764
- if(!results['og:title'] && results['title'] &&results['description'])results['og:title']=results['title'];
765
- if(!results['og:title'] && !results['title'])return false;
766
- var code = $('<p/>');
767
- if(results['og:video']) {
768
- var embed = $('<embed src="'+results['og:video']+'"/>');
769
- embed
770
- .attr('type',results['og:video:type'] || "application/x-shockwave-flash")
771
- .css('max-height', settings.maxHeight || 'auto' )
772
- .css('max-width', settings.maxWidth || 'auto' );
773
- if(results['og:video:width']) embed.attr('width',results['og:video:width']);
774
- if(results['og:video:height']) embed.attr('height',results['og:video:height']);
775
- code.append(embed);
776
- }else if(results['og:image']) {
777
- var img = $('<img src="'+results['og:image']+'">');
778
- img.css('max-height', settings.maxHeight || 'auto' ).css('max-width', settings.maxWidth || 'auto' );
779
- if(results['og:image:width']) img.attr('width',results['og:image:width']);
780
- if(results['og:image:height']) img.attr('height',results['og:image:height']);
781
- code.append(img);
782
- }
783
- if(results['og:title']) code.append('<b>'+results['og:title']+'</b><br/>');
784
- if(results['og:description'])
785
- code.append(results['og:description']+'<br/>');
786
- else if(results['description'])
787
- code.append(results['description']+'<br/>');
788
- return code;
789
- }
790
- }
791
- })
792
-
793
- ];
794
- })(jQuery);
795
-
796
- //This is needed for gravatar :(
797
- String.prototype.md5 = function() {
798
- var a = function(a, b) {
799
- var c = (a & 65535) + (b & 65535);
800
- var d = (a >> 16) + (b >> 16) + (c >> 16);
801
- return d << 16 | c & 65535;
802
- };
803
- var b = function(a, b) { return a << b | a >>> 32 - b; };
804
- var c = function(c, d, e, f, g, h) { return a(b(a(a(d, c), a(f, h)), g), e); };
805
- var d = function(a, b, d, e, f, g, h) { return c(b & d | ~b & e, a, b, f, g, h); };
806
- var e = function(a, b, d, e, f, g, h) { return c(b & e | d & ~e, a, b, f, g, h); };
807
- var f = function(a, b, d, e, f, g, h) { return c(b ^ d ^ e, a, b, f, g, h); };
808
- var g = function(a, b, d, e, f, g, h) { return c(d ^ (b | ~e), a, b, f, g, h); };
809
- var h = function(b) {
810
- var c, h, i, j, k, l = b.length;
811
- var m = 1732584193;
812
- var n = -271733879;
813
- var o = -1732584194;
814
- var p = 271733878;
815
- for (k = 0; k < l; k += 16) {
816
- c = m;
817
- h = n;
818
- i = o;
819
- j = p;
820
- m = d(m, n, o, p, b[k + 0], 7, -680876936);
821
- p = d(p, m, n, o, b[k + 1], 12, -389564586);
822
- o = d(o, p, m, n, b[k + 2], 17, 606105819);
823
- n = d(n, o, p, m, b[k + 3], 22, -1044525330);
824
- m = d(m, n, o, p, b[k + 4], 7, -176418897);
825
- p = d(p, m, n, o, b[k + 5], 12, 1200080426);
826
- o = d(o, p, m, n, b[k + 6], 17, -1473231341);
827
- n = d(n, o, p, m, b[k + 7], 22, -45705983);
828
- m = d(m, n, o, p, b[k + 8], 7, 1770035416);
829
- p = d(p, m, n, o, b[k + 9], 12, -1958414417);
830
- o = d(o, p, m, n, b[k + 10], 17, -42063);
831
- n = d(n, o, p, m, b[k + 11], 22, -1990404162);
832
- m = d(m, n, o, p, b[k + 12], 7, 1804603682);
833
- p = d(p, m, n, o, b[k + 13], 12, -40341101);
834
- o = d(o, p, m, n, b[k + 14], 17, -1502002290);
835
- n = d(n, o, p, m, b[k + 15], 22, 1236535329);
836
- m = e(m, n, o, p, b[k + 1], 5, -165796510);
837
- p = e(p, m, n, o, b[k + 6], 9, -1069501632);
838
- o = e(o, p, m, n, b[k + 11], 14, 643717713);
839
- n = e(n, o, p, m, b[k + 0], 20, -373897302);
840
- m = e(m, n, o, p, b[k + 5], 5, -701558691);
841
- p = e(p, m, n, o, b[k + 10], 9, 38016083);
842
- o = e(o, p, m, n, b[k + 15], 14, -660478335);
843
- n = e(n, o, p, m, b[k + 4], 20, -405537848);
844
- m = e(m, n, o, p, b[k + 9], 5, 568446438);
845
- p = e(p, m, n, o, b[k + 14], 9, -1019803690);
846
- o = e(o, p, m, n, b[k + 3], 14, -187363961);
847
- n = e(n, o, p, m, b[k + 8], 20, 1163531501);
848
- m = e(m, n, o, p, b[k + 13], 5, -1444681467);
849
- p = e(p, m, n, o, b[k + 2], 9, -51403784);
850
- o = e(o, p, m, n, b[k + 7], 14, 1735328473);
851
- n = e(n, o, p, m, b[k + 12], 20, -1926607734);
852
- m = f(m, n, o, p, b[k + 5], 4, -378558);
853
- p = f(p, m, n, o, b[k + 8], 11, -2022574463);
854
- o = f(o, p, m, n, b[k + 11], 16, 1839030562);
855
- n = f(n, o, p, m, b[k + 14], 23, -35309556);
856
- m = f(m, n, o, p, b[k + 1], 4, -1530992060);
857
- p = f(p, m, n, o, b[k + 4], 11, 1272893353);
858
- o = f(o, p, m, n, b[k + 7], 16, -155497632);
859
- n = f(n, o, p, m, b[k + 10], 23, -1094730640);
860
- m = f(m, n, o, p, b[k + 13], 4, 681279174);
861
- p = f(p, m, n, o, b[k + 0], 11, -358537222);
862
- o = f(o, p, m, n, b[k + 3], 16, -722521979);
863
- n = f(n, o, p, m, b[k + 6], 23, 76029189);
864
- m = f(m, n, o, p, b[k + 9], 4, -640364487);
865
- p = f(p, m, n, o, b[k + 12], 11, -421815835);
866
- o = f(o, p, m, n, b[k + 15], 16, 530742520);
867
- n = f(n, o, p, m, b[k + 2], 23, -995338651);
868
- m = g(m, n, o, p, b[k + 0], 6, -198630844);
869
- p = g(p, m, n, o, b[k + 7], 10, 1126891415);
870
- o = g(o, p, m, n, b[k + 14], 15, -1416354905);
871
- n = g(n, o, p, m, b[k + 5], 21, -57434055);
872
- m = g(m, n, o, p, b[k + 12], 6, 1700485571);
873
- p = g(p, m, n, o, b[k + 3], 10, -1894986606);
874
- o = g(o, p, m, n, b[k + 10], 15, -1051523);
875
- n = g(n, o, p, m, b[k + 1], 21, -2054922799);
876
- m = g(m, n, o, p, b[k + 8], 6, 1873313359);
877
- p = g(p, m, n, o, b[k + 15], 10, -30611744);
878
- o = g(o, p, m, n, b[k + 6], 15, -1560198380);
879
- n = g(n, o, p, m, b[k + 13], 21, 1309151649);
880
- m = g(m, n, o, p, b[k + 4], 6, -145523070);
881
- p = g(p, m, n, o, b[k + 11], 10, -1120210379);
882
- o = g(o, p, m, n, b[k + 2], 15, 718787259);
883
- n = g(n, o, p, m, b[k + 9], 21, -343485551);
884
- m = a(m, c);
885
- n = a(n, h);
886
- o = a(o, i);
887
- p = a(p, j);
888
- }
889
- return [m, n, o, p];
890
- };
891
- var i = function(a) {
892
- var b = "0123456789abcdef", c = "", d, e = a.length * 4;
893
- for (d = 0; d < e; d++) {
894
- c += b.charAt(a[d >> 2] >> d % 4 * 8 + 4 & 15) + b.charAt(a[d >> 2] >> d % 4 * 8 & 15);
895
- }
896
- return c;
897
- };
898
- var j = function(a) {
899
- var b = (a.length + 8 >> 6) + 1;
900
- var c = [], d, e = b * 16, f, g = a.length;
901
- for (d = 0; d < e; d++) {
902
- c.push(0);
903
- }
904
- for (f = 0; f < g; f++) {
905
- c[f >> 2] |= (a.charCodeAt(f) & 255) << f % 4 * 8;
906
- }
907
- c[f >> 2] |= 128 << f % 4 * 8;
908
- c[b * 16 - 2] = g * 8;
909
- return c;
910
- };
911
- return i(h(j(this)));
912
- };