Version Description
- 08-21-2013
Download this release
Release Info
Developer | josh401 |
Plugin | Ultimate TinyMCE |
Version | 4.9 |
Comparing to | |
See all releases |
Version 4.9
- __dev_notes.txt +4 -0
- _notes/dwsync.xml +11 -0
- addons/acheck/_notes/dwsync.xml +5 -0
- addons/acheck/editor_plugin.js +1 -0
- addons/acheck/editor_plugin_src.js +84 -0
- addons/acheck/img/Thumbs.db +0 -0
- addons/acheck/img/_notes/dwsync.xml +5 -0
- addons/acheck/img/acheck.gif +0 -0
- addons/acheck/img/acheck.png +0 -0
- addons/acheck/js/_notes/dwsync.xml +4 -0
- addons/acheck/js/dialog.js +19 -0
- addons/acheck/langs/_notes/dwsync.xml +5 -0
- addons/acheck/langs/en.js +3 -0
- addons/acheck/langs/en_dlg.js +3 -0
- addons/advhr/_notes/dwsync.xml +6 -0
- addons/advhr/css/_notes/dwsync.xml +4 -0
- addons/advhr/css/advhr.css +5 -0
- addons/advhr/editor_plugin.js +1 -0
- addons/advhr/editor_plugin_src.js +58 -0
- addons/advhr/js/_notes/dwsync.xml +4 -0
- addons/advhr/js/rule.js +43 -0
- addons/advhr/langs/_notes/dwsync.xml +4 -0
- addons/advhr/langs/en_dlg.js +13 -0
- addons/advhr/rule.htm +58 -0
- addons/advimage/_notes/dwsync.xml +6 -0
- addons/advimage/css/_notes/dwsync.xml +4 -0
- addons/advimage/css/advimage.css +13 -0
- addons/advimage/editor_plugin.js +1 -0
- addons/advimage/editor_plugin_src.js +50 -0
- addons/advimage/image.htm +235 -0
- addons/advimage/img/_notes/dwsync.xml +4 -0
- addons/advimage/img/sample.gif +0 -0
- addons/advimage/js/_notes/dwsync.xml +4 -0
- addons/advimage/js/image.js +462 -0
- addons/advimage/langs/_notes/dwsync.xml +4 -0
- addons/advimage/langs/en_dlg.js +1 -0
- addons/advlink/_notes/dwsync.xml +7 -0
- addons/advlink/advlink.png +0 -0
- addons/advlink/css/_notes/dwsync.xml +4 -0
- addons/advlink/css/advlink.css +8 -0
- addons/advlink/editor_plugin.js +1 -0
- addons/advlink/editor_plugin_src.js +63 -0
- addons/advlink/img/Thumbs.db +0 -0
- addons/advlink/img/_notes/dwsync.xml +4 -0
- addons/advlink/img/advlink.png +0 -0
- addons/advlink/js/_notes/dwsync.xml +4 -0
- addons/advlink/js/advlink.js +539 -0
- addons/advlink/langs/_notes/dwsync.xml +4 -0
- addons/advlink/langs/en_dlg.js +1 -0
- addons/advlink/link.htm +338 -0
- addons/advlist/_notes/dwsync.xml +5 -0
- addons/advlist/editor_plugin.js +1 -0
- addons/advlist/editor_plugin_src.js +176 -0
- addons/clear/_notes/dwsync.xml +5 -0
- addons/clear/css/_notes/dwsync.xml +4 -0
- addons/clear/css/clear.css +22 -0
- addons/clear/editor_plugin.dev.js +129 -0
- addons/clear/editor_plugin.js +85 -0
- addons/clear/editor_plugin.js.LCK +1 -0
- addons/clear/images/Thumbs.db +0 -0
- addons/clear/images/_notes/dwsync.xml +10 -0
- addons/clear/images/clearboth.gif +0 -0
- addons/clear/images/clearboth_button.gif +0 -0
- addons/clear/images/clearleft.gif +0 -0
- addons/clear/images/clearleft_button.gif +0 -0
- addons/clear/images/clearright.gif +0 -0
- addons/clear/images/clearright_button.gif +0 -0
- addons/clear/images/trans.gif +0 -0
- addons/clear/langs/_notes/dwsync.xml +5 -0
- addons/clear/langs/en.js +6 -0
- addons/clear/langs/es.js +6 -0
- addons/clker/_notes/dwsync.xml +6 -0
- addons/clker/dialog.htm +33 -0
- addons/clker/editor_plugin.js +83 -0
- addons/clker/img/Thumbs.db +0 -0
- addons/clker/img/_notes/dwsync.xml +9 -0
- addons/clker/img/before.png +0 -0
- addons/clker/img/clker.gif +0 -0
- addons/clker/img/clker.png +0 -0
- addons/clker/img/end.png +0 -0
- addons/clker/img/next.png +0 -0
- addons/clker/img/start.png +0 -0
- addons/clker/js/_notes/dwsync.xml +4 -0
- addons/clker/js/dialog.js +279 -0
- addons/clker/langs/_notes/dwsync.xml +5 -0
- addons/clker/langs/en.js +3 -0
- addons/clker/langs/en_dlg.js +3 -0
- addons/clker/search.php +7 -0
- addons/codemagic/README.md +4 -0
- addons/codemagic/_notes/dwsync.xml +8 -0
- addons/codemagic/codemagic.htm +67 -0
- addons/codemagic/css/_notes/dwsync.xml +6 -0
- addons/codemagic/css/codemirror.css +102 -0
- addons/codemagic/css/default.css +28 -0
- addons/codemagic/css/style.css +59 -0
- addons/codemagic/editor_plugin.js +1 -0
- addons/codemagic/editor_plugin_src.js +54 -0
- addons/codemagic/img/Thumbs.db +0 -0
- addons/codemagic/img/_notes/dwsync.xml +5 -0
- addons/codemagic/img/code.png +0 -0
- addons/codemagic/img/icons/Thumbs.db +0 -0
- addons/codemagic/img/icons/_notes/dwsync.xml +8 -0
- addons/codemagic/img/icons/file.png +0 -0
- addons/codemagic/img/icons/lens.png +0 -0
- addons/codemagic/img/icons/redo.png +0 -0
- addons/codemagic/img/icons/undo.png +0 -0
- addons/codemagic/js/_notes/dwsync.xml +7 -0
- addons/codemagic/js/beautify-html.js +571 -0
- addons/codemagic/js/beautify.js +1147 -0
- addons/codemagic/js/codemagic.js +620 -0
- addons/codemagic/js/codemirror-compressed.js +1 -0
- addons/codemagic/langs/_notes/dwsync.xml +9 -0
- addons/codemagic/langs/cs.js +3 -0
- addons/codemagic/langs/cs_dlg.js +14 -0
- addons/codemagic/langs/en.js +3 -0
- addons/codemagic/langs/en_dlg.js +15 -0
- addons/codemagic/langs/sk.js +3 -0
- addons/codemagic/langs/sk_dlg.js +14 -0
- addons/codemagic/licence.txt +13 -0
- addons/directionality/_notes/dwsync.xml +5 -0
- addons/directionality/editor_plugin.js +1 -0
- addons/directionality/editor_plugin_src.js +85 -0
- addons/emotions/_notes/dwsync.xml +6 -0
- addons/emotions/editor_plugin.js +1 -0
- addons/emotions/editor_plugin_src.js +43 -0
- addons/emotions/emotions.htm +130 -0
- addons/emotions/img/_notes/dwsync.xml +19 -0
- addons/emotions/img/blueicons/Ahhhh.png +0 -0
- addons/emotions/img/blueicons/Alien.png +0 -0
- addons/emotions/img/blueicons/Blush.png +0 -0
- addons/emotions/img/blueicons/Cool1.png +0 -0
- addons/emotions/img/blueicons/Crying.png +0 -0
- addons/emotions/img/blueicons/Devil.png +0 -0
- addons/emotions/img/blueicons/Happy.png +0 -0
- addons/emotions/img/blueicons/Huh.png +0 -0
- addons/emotions/img/blueicons/Love.png +0 -0
- addons/emotions/img/blueicons/Sick.png +0 -0
- addons/emotions/img/blueicons/Sleep.png +0 -0
- addons/emotions/img/blueicons/Smile1.png +0 -0
- addons/emotions/img/blueicons/Tear.png +0 -0
- addons/emotions/img/blueicons/Tounge.png +0 -0
- addons/emotions/img/blueicons/Wink1.png +0 -0
- addons/emotions/img/blueicons/Yikes.png +0 -0
- addons/emotions/img/blueicons/_notes/dwsync.xml +19 -0
- addons/emotions/img/popo/_notes/dwsync.xml +19 -0
- addons/emotions/img/popo/amazing.png +0 -0
- addons/emotions/img/popo/big_smile.png +0 -0
- addons/emotions/img/popo/cry1.png +0 -0
- addons/emotions/img/popo/electric_shock.png +0 -0
- addons/emotions/img/popo/exciting.png +0 -0
- addons/emotions/img/popo/eyes_dropped.png +0 -0
- addons/emotions/img/popo/girl.png +0 -0
- addons/emotions/img/popo/grimace.png +0 -0
- addons/emotions/img/popo/haha.png +0 -0
- addons/emotions/img/popo/scorn.png +0 -0
- addons/emotions/img/popo/secret_smile.png +0 -0
- addons/emotions/img/popo/shame.png +0 -0
- addons/emotions/img/popo/shocked.png +0 -0
- addons/emotions/img/popo/unhappy.png +0 -0
- addons/emotions/img/popo/victory.png +0 -0
- addons/emotions/img/popo/what.png +0 -0
- addons/emotions/img/popobig/_notes/dwsync.xml +35 -0
- addons/emotions/img/popobig/adore.png +0 -0
- addons/emotions/img/popobig/ah.png +0 -0
- addons/emotions/img/popobig/angry.png +0 -0
- addons/emotions/img/popobig/baffle.png +0 -0
- addons/emotions/img/popobig/beat_ball.png +0 -0
- addons/emotions/img/popobig/beat_brick.png +0 -0
- addons/emotions/img/popobig/big_smile.png +0 -0
- addons/emotions/img/popobig/boss.png +0 -0
- addons/emotions/img/popobig/burn_joss_stick.png +0 -0
- addons/emotions/img/popobig/canny.png +0 -0
- addons/emotions/img/popobig/confident.png +0 -0
- addons/emotions/img/popobig/confuse.png +0 -0
- addons/emotions/img/popobig/cry.png +0 -0
- addons/emotions/img/popobig/doubt.png +0 -0
- addons/emotions/img/popobig/dribble.png +0 -0
- addons/emotions/img/popobig/embarrassed.png +0 -0
- addons/emotions/img/popobig/feel_good.png +0 -0
- addons/emotions/img/popobig/furious.png +0 -0
- addons/emotions/img/popobig/haha.png +0 -0
- addons/emotions/img/popobig/hell_boy.png +0 -0
- addons/emotions/img/popobig/look_down.png +0 -0
- addons/emotions/img/popobig/matrix.png +0 -0
- addons/emotions/img/popobig/misdoubt.png +0 -0
- addons/emotions/img/popobig/oh.png +0 -0
- addons/emotions/img/popobig/ops.png +0 -0
- addons/emotions/img/popobig/sad.png +0 -0
- addons/emotions/img/popobig/still_dreaming.png +0 -0
- addons/emotions/img/popobig/surrender.png +0 -0
- addons/emotions/img/popobig/sweet_kiss.png +0 -0
- addons/emotions/img/popobig/tired.png +0 -0
- addons/emotions/img/popobig/too_sad.png +0 -0
- addons/emotions/img/popobig/what.png +0 -0
- addons/emotions/img/smiley-cool.gif +0 -0
- addons/emotions/img/smiley-cry.gif +0 -0
- addons/emotions/img/smiley-embarassed.gif +0 -0
- addons/emotions/img/smiley-foot-in-mouth.gif +0 -0
- addons/emotions/img/smiley-frown.gif +0 -0
- addons/emotions/img/smiley-innocent.gif +0 -0
- addons/emotions/img/smiley-kiss.gif +0 -0
- addons/emotions/img/smiley-laughing.gif +0 -0
- addons/emotions/img/smiley-money-mouth.gif +0 -0
- addons/emotions/img/smiley-sealed.gif +0 -0
- addons/emotions/img/smiley-smile.gif +0 -0
- addons/emotions/img/smiley-surprised.gif +0 -0
- addons/emotions/img/smiley-tongue-out.gif +0 -0
- addons/emotions/img/smiley-undecided.gif +0 -0
- addons/emotions/img/smiley-wink.gif +0 -0
- addons/emotions/img/smiley-yell.gif +0 -0
- addons/emotions/js/_notes/dwsync.xml +4 -0
- addons/emotions/js/emotions.js +43 -0
- addons/emotions/langs/_notes/dwsync.xml +4 -0
- addons/emotions/langs/en_dlg.js +85 -0
- addons/encode/_notes/dwsync.xml +5 -0
- addons/encode/editor_plugin.js +1062 -0
- addons/encode/editor_plugin_src.js +1062 -0
- addons/encode/img/Thumbs.db +0 -0
- addons/encode/img/_notes/dwsync.xml +6 -0
- addons/encode/img/decode.gif +0 -0
- addons/encode/img/encode.gif +0 -0
- addons/encode/img/encode.png +0 -0
- addons/encode/langs/_notes/dwsync.xml +5 -0
- addons/encode/langs/en.js +3 -0
- addons/encode/langs/en_dlg.js +3 -0
- addons/equation/_notes/dwsync.xml +4 -0
- addons/equation/editor_plugin.js +91 -0
- addons/equation/img/Thumbs.db +0 -0
- addons/equation/img/_notes/dwsync.xml +4 -0
- addons/equation/img/equation.gif +0 -0
- addons/ezimage/_notes/dwsync.xml +6 -0
- addons/ezimage/css/_notes/dwsync.xml +4 -0
- addons/ezimage/css/ezimage.css +51 -0
- addons/ezimage/editor_plugin.js +77 -0
- addons/ezimage/editor_plugin_src.js +77 -0
- addons/ezimage/ezimage.htm +89 -0
- addons/ezimage/img/Thumbs.db +0 -0
- addons/ezimage/img/_notes/dwsync.xml +4 -0
- addons/ezimage/img/ezimage.gif +0 -0
- addons/ezimage/js/_notes/dwsync.xml +4 -0
- addons/ezimage/js/ezimage.js +583 -0
- addons/ezimage/langs/_notes/dwsync.xml +7 -0
- addons/ezimage/langs/en.js +5 -0
- addons/ezimage/langs/en_dlg.js +25 -0
- addons/ezimage/langs/fr.js +5 -0
- addons/ezimage/langs/fr_dlg.js +25 -0
- addons/imgmap/_notes/dwsync.xml +6 -0
- addons/imgmap/css/_notes/dwsync.xml +4 -0
- addons/imgmap/css/imgmap.css +160 -0
- addons/imgmap/editor_plugin.js +135 -0
- addons/imgmap/editor_plugin_src.js +135 -0
- addons/imgmap/images/Thumbs.db +0 -0
- addons/imgmap/images/_notes/dwsync.xml +13 -0
- addons/imgmap/images/accept.gif +0 -0
- addons/imgmap/images/add.gif +0 -0
- addons/imgmap/images/bullet_green.gif +0 -0
- addons/imgmap/images/bullet_orange.gif +0 -0
- addons/imgmap/images/clipboard.gif +0 -0
- addons/imgmap/images/delete.gif +0 -0
- addons/imgmap/images/edit.gif +0 -0
- addons/imgmap/images/html.gif +0 -0
- addons/imgmap/images/tinymce_button.gif +0 -0
- addons/imgmap/images/zoom.gif +0 -0
- addons/imgmap/jscripts/_notes/dwsync.xml +13 -0
- addons/imgmap/jscripts/excanvas.js +19 -0
- addons/imgmap/jscripts/functions.js +543 -0
- addons/imgmap/jscripts/imgmap.js +2900 -0
- addons/imgmap/jscripts/imgmap_packed.js +202 -0
- addons/imgmap/jscripts/lang_de.js +37 -0
- addons/imgmap/jscripts/lang_en.js +37 -0
- addons/imgmap/jscripts/lang_es.js +37 -0
- addons/imgmap/jscripts/lang_fr.js +37 -0
- addons/imgmap/jscripts/lang_hu.js +37 -0
- addons/imgmap/jscripts/lang_pt.js +37 -0
- addons/imgmap/langs/_notes/dwsync.xml +4 -0
- addons/imgmap/langs/en.js +7 -0
- addons/imgmap/popup.html +109 -0
- addons/insertdatetime/_notes/dwsync.xml +5 -0
- addons/insertdatetime/editor_plugin.js +1 -0
- addons/insertdatetime/editor_plugin_src.js +83 -0
- addons/jwl_span/_notes/dwsync.xml +5 -0
- addons/jwl_span/jwl_span.js +48 -0
- addons/jwl_span/langs/_notes/dwsync.xml +4 -0
- addons/jwl_span/langs/en.js +3 -0
- addons/jwl_span/span.png +0 -0
- addons/layer/_notes/dwsync.xml +5 -0
- addons/layer/editor_plugin.js +1 -0
- addons/layer/editor_plugin_src.js +262 -0
- addons/linebreak/_notes/dwsync.xml +5 -0
- addons/linebreak/editor_plugin.js +45 -0
- addons/linebreak/langs/_notes/dwsync.xml +4 -0
- addons/linebreak/langs/en.js +3 -0
- addons/linebreak/linebreak.png +0 -0
- addons/loremipsum/_notes/dwsync.xml +6 -0
- addons/loremipsum/editor_plugin.js +1 -0
- addons/loremipsum/editor_plugin_src.js +80 -0
- addons/loremipsum/img/Thumbs.db +0 -0
- addons/loremipsum/img/_notes/dwsync.xml +6 -0
- addons/loremipsum/img/loremipsum.gif +0 -0
- addons/loremipsum/img/loremipsum.png +0 -0
- addons/loremipsum/img/loremipsum_de.gif +0 -0
- addons/loremipsum/js/_notes/dwsync.xml +5 -0
- addons/loremipsum/js/loremipsum.js +1 -0
- addons/loremipsum/js/loremipsum_src.js +118 -0
- addons/loremipsum/langs/_notes/dwsync.xml +13 -0
- addons/loremipsum/langs/ca.js +14 -0
- addons/loremipsum/langs/ca_dlg.js +20 -0
- addons/loremipsum/langs/cs.js +14 -0
- addons/loremipsum/langs/cs_dlg.js +20 -0
- addons/loremipsum/langs/de.js +14 -0
- addons/loremipsum/langs/de_dlg.js +20 -0
- addons/loremipsum/langs/en.js +14 -0
- addons/loremipsum/langs/en_dlg.js +20 -0
- addons/loremipsum/langs/es.js +14 -0
- addons/loremipsum/langs/es_dlg.js +20 -0
- addons/loremipsum/loremipsum.html +54 -0
- addons/mailto/_notes/dwsync.xml +5 -0
- addons/mailto/editor_plugin.js +48 -0
- addons/mailto/editor_plugin_src.js +49 -0
- addons/mailto/images/Thumbs.db +0 -0
- addons/mailto/images/_notes/dwsync.xml +4 -0
- addons/mailto/images/mailto.gif +0 -0
- addons/mailto/langs/_notes/dwsync.xml +5 -0
- addons/mailto/langs/en.js +4 -0
- addons/mailto/langs/es.js +6 -0
- addons/media/_notes/dwsync.xml +7 -0
- addons/media/css/_notes/dwsync.xml +4 -0
- addons/media/css/media.css +17 -0
- addons/media/editor_plugin.js +1 -0
- addons/media/editor_plugin_src.js +890 -0
- addons/media/js/_notes/dwsync.xml +5 -0
- addons/media/js/embed.js +73 -0
- addons/media/js/media.js +466 -0
- addons/media/langs/_notes/dwsync.xml +4 -0
- addons/media/langs/en_dlg.js +1 -0
- addons/media/media.htm +922 -0
- addons/media/moxieplayer.swf +0 -0
- addons/nonbreaking/_notes/dwsync.xml +5 -0
- addons/nonbreaking/editor_plugin.js +1 -0
- addons/nonbreaking/editor_plugin_src.js +54 -0
- addons/preview/_notes/dwsync.xml +7 -0
- addons/preview/editor_plugin.js +1 -0
- addons/preview/editor_plugin_src.js +53 -0
- addons/preview/example.html +28 -0
- addons/preview/jscripts/_notes/dwsync.xml +4 -0
- addons/preview/jscripts/embed.js +73 -0
- addons/preview/preview.html +17 -0
- addons/print/_notes/dwsync.xml +5 -0
- addons/print/editor_plugin.js +1 -0
- addons/print/editor_plugin_src.js +34 -0
- addons/ptags/_notes/dwsync.xml +6 -0
- addons/ptags/editor_plugin.js +55 -0
- addons/ptags/js/_notes/dwsync.xml +4 -0
- addons/ptags/js/dialog.js +14 -0
- addons/ptags/langs/_notes/dwsync.xml +5 -0
- addons/ptags/langs/en.js +4 -0
- addons/ptags/langs/en_dlg.js +10 -0
- addons/ptags/ptags.htm +50 -0
- addons/ptags/ptags.png +0 -0
- addons/searchreplace/_notes/dwsync.xml +6 -0
- addons/searchreplace/css/_notes/dwsync.xml +4 -0
- addons/searchreplace/css/searchreplace.css +6 -0
- addons/searchreplace/editor_plugin.js +1 -0
- addons/searchreplace/editor_plugin_src.js +61 -0
- addons/searchreplace/js/_notes/dwsync.xml +4 -0
- addons/searchreplace/js/searchreplace.js +142 -0
- addons/searchreplace/langs/_notes/dwsync.xml +4 -0
- addons/searchreplace/langs/en_dlg.js +1 -0
- addons/searchreplace/searchreplace.htm +100 -0
- addons/shortcodes/_notes/dwsync.xml +5 -0
- addons/shortcodes/css/_notes/dwsync.xml +4 -0
- addons/shortcodes/css/shortcodes.css +26 -0
- addons/shortcodes/editor_plugin_src.js +47 -0
- addons/shortcodes/img/Thumbs.db +0 -0
- addons/shortcodes/img/_notes/dwsync.xml +5 -0
- addons/shortcodes/img/shortcodes.gif +0 -0
- addons/shortcodes/img/wordpress-shortcode.png +0 -0
- addons/shortcodes/js/_notes/dwsync.xml +4 -0
- addons/shortcodes/js/dialog.js +14 -0
- addons/shortcodes/langs/_notes/dwsync.xml +4 -0
- addons/shortcodes/langs/en.js +4 -0
- addons/shortcodes/shortcodes.php +46 -0
- addons/style/_notes/dwsync.xml +6 -0
- addons/style/css/_notes/dwsync.xml +4 -0
- addons/style/css/props.css +13 -0
- addons/style/editor_plugin.js +1 -0
- addons/style/editor_plugin_src.js +55 -0
- addons/style/js/_notes/dwsync.xml +4 -0
- addons/style/js/props.js +635 -0
- addons/style/langs/_notes/dwsync.xml +4 -0
- addons/style/langs/en_dlg.js +1 -0
- addons/style/props.htm +840 -0
- addons/table/_notes/dwsync.xml +9 -0
- addons/table/cell.htm +180 -0
- addons/table/css/_notes/dwsync.xml +6 -0
- addons/table/css/cell.css +17 -0
- addons/table/css/row.css +25 -0
- addons/table/css/table.css +13 -0
- addons/table/editor_plugin.js +1 -0
__dev_notes.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
TO-DO:
|
2 |
+
* SHortcodes acting funny on various installations. /***** DONE *****/
|
3 |
+
* Extra space sometimes inserted with HTML magic.
|
4 |
+
* Drag and Drop functionality for buttons.
|
_notes/dwsync.xml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="__dev_notes.txt" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="admin_functions.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130211125944994228" remote="130211089800000000" Dst="2" />
|
5 |
+
<file name="default.mo" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="default.pot" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="main.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130216301278653718" remote="130216264800000000" Dst="2" />
|
8 |
+
<file name="options_callback_functions.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130216279956616033" remote="130216243800000000" Dst="2" />
|
9 |
+
<file name="options_functions.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130211128963061264" remote="130211092800000000" Dst="2" />
|
10 |
+
<file name="readme.txt" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130216289675206684" remote="130216253400000000" Dst="2" />
|
11 |
+
</dwsync>
|
addons/acheck/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186854427883875" remote="130186818000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186853878208715" remote="130186817400000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/acheck/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){/*tinymce.PluginManager.requireLangPack('acheck');*/tinymce.create('tinymce.plugins.AcheckPlugin',{init:function(ed,url){ed.addCommand('mceACheck',function(){var theCode='<html><body onLoad="document.accessform.submit();"> \n';theCode+='<h1>Submitting Code for Accessibility Checking.....</h1>\n';theCode+='<form action="http://achecker.ca/checker/index.php" name="accessform" method="post"> \n';theCode+='<input type="hidden" name="gid[]" value="8" /> \n';theCode+='<input type="hidden" name="show_source" value="1" /> \n';theCode+='<textarea name="validate_content">'+tinyMCE.activeEditor.getContent({format:'raw'})+'</textarea>\n';theCode+='<input type="submit" /></form> \n';theCode+='</body></html> \n';accessWin=window.open('','accessWin','');accessWin.document.writeln(theCode);accessWin.document.close();});ed.addButton('acheck',{/*title : 'acheck.desc',*/title : ed.getLang('acheck.desc'),cmd:'mceACheck'/*,image:url+'/img/acheck.gif'*/});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('acheck',n.nodeName=='acheck');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'ACheck Plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"1.0"};}});tinymce.PluginManager.add('acheck',tinymce.plugins.AcheckPlugin);})();
|
addons/acheck/editor_plugin_src.js
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2008-04-17 15:56:56Z cindy $
|
3 |
+
*
|
4 |
+
* @author Cindy Li
|
5 |
+
* @copyright Copyright � 2008, ATutor, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
(function() {
|
9 |
+
// Load plugin specific language pack
|
10 |
+
//tinymce.PluginManager.requireLangPack('acheck');
|
11 |
+
|
12 |
+
tinymce.create('tinymce.plugins.AcheckPlugin', {
|
13 |
+
/**
|
14 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
15 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
16 |
+
* of the editor instance to intercept that event.
|
17 |
+
*
|
18 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
19 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
20 |
+
*/
|
21 |
+
init : function(ed, url) {
|
22 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceACheck');
|
23 |
+
ed.addCommand('mceACheck', function() {
|
24 |
+
|
25 |
+
var theCode = '<html><body onLoad="document.accessform.submit();"> \n';
|
26 |
+
theCode += '<h1>Submitting Code for Accessibility Checking.....</h1>\n';
|
27 |
+
theCode += '<form action="http://achecker.ca/checker/index.php" name="accessform" method="post"> \n';
|
28 |
+
theCode += '<input type="hidden" name="gid[]" value="8" /> \n';
|
29 |
+
theCode += '<textarea name="validate_content">' + tinyMCE.activeEditor.getContent({format : 'raw'}) + '</textarea>\n';
|
30 |
+
theCode += '<input type="submit" /></form> \n';
|
31 |
+
theCode += '</body></html> \n';
|
32 |
+
accessWin = window.open('', 'accessWin', '');
|
33 |
+
accessWin.document.writeln(theCode);
|
34 |
+
accessWin.document.close();
|
35 |
+
});
|
36 |
+
|
37 |
+
// Register ACheck button
|
38 |
+
ed.addButton('acheck', {
|
39 |
+
//title : 'acheck.desc',
|
40 |
+
title : ed.getLang('acheck.desc'),
|
41 |
+
cmd : 'mceACheck',
|
42 |
+
//image : url + '/img/acheck.gif'
|
43 |
+
});
|
44 |
+
|
45 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
46 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
47 |
+
cm.setActive('acheck', n.nodeName == 'acheck');
|
48 |
+
});
|
49 |
+
},
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Creates control instances based in the incomming name. This method is normally not
|
53 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
54 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
55 |
+
* method can be used to create those.
|
56 |
+
*
|
57 |
+
* @param {String} n Name of the control to create.
|
58 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
59 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
60 |
+
*/
|
61 |
+
createControl : function(n, cm) {
|
62 |
+
return null;
|
63 |
+
},
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns information about the plugin as a name/value array.
|
67 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
68 |
+
*
|
69 |
+
* @return {Object} Name/value array containing information about the plugin.
|
70 |
+
*/
|
71 |
+
getInfo : function() {
|
72 |
+
return {
|
73 |
+
longname : 'ACheck Plugin',
|
74 |
+
author : 'ATutor',
|
75 |
+
authorurl : 'http://www.atutor.ca',
|
76 |
+
infourl : 'http://www.atutor.ca',
|
77 |
+
version : "1.0"
|
78 |
+
};
|
79 |
+
}
|
80 |
+
});
|
81 |
+
|
82 |
+
// Register plugin
|
83 |
+
tinymce.PluginManager.add('acheck', tinymce.plugins.AcheckPlugin);
|
84 |
+
})();
|
addons/acheck/img/Thumbs.db
ADDED
Binary file
|
addons/acheck/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="acheck.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="acheck.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/acheck/img/acheck.gif
ADDED
Binary file
|
addons/acheck/img/acheck.png
ADDED
Binary file
|
addons/acheck/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="dialog.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/acheck/js/dialog.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var ExampleDialog = {
|
4 |
+
init : function() {
|
5 |
+
var f = document.forms[0];
|
6 |
+
|
7 |
+
// Get the selected contents as text and place it in the input
|
8 |
+
f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
|
9 |
+
f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
|
10 |
+
},
|
11 |
+
|
12 |
+
insert : function() {
|
13 |
+
// Insert the contents from the input into the document
|
14 |
+
tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
|
15 |
+
tinyMCEPopup.close();
|
16 |
+
}
|
17 |
+
};
|
18 |
+
|
19 |
+
tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
|
addons/acheck/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/acheck/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.acheck',{
|
2 |
+
desc : 'Check Accessibility'
|
3 |
+
});
|
addons/acheck/langs/en_dlg.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.acheck_dlg',{
|
2 |
+
title : 'ATRC Accessibility Checker'
|
3 |
+
});
|
addons/advhr/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130110996000000000" remote="130110996000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130110993600000000" remote="130110993600000000" Dst="2" />
|
5 |
+
<file name="rule.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/advhr/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advhr.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advhr/css/advhr.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
2 |
+
.panel_wrapper div.current {height:80px;}
|
3 |
+
#width {width:50px; vertical-align:middle;}
|
4 |
+
#width2 {width:50px; vertical-align:middle;}
|
5 |
+
#size {width:100px;}
|
addons/advhr/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{/*title : 'advhr.advhr_desc',*/title : a.getLang('advhr.desc'),cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
|
addons/advhr/editor_plugin_src.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvancedHr', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/rule.htm',
|
18 |
+
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
19 |
+
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('advhr', {
|
28 |
+
/*title : 'advhr.advhr_desc',*/
|
29 |
+
title : ed.getLang('advhr.desc'),
|
30 |
+
cmd : 'mceAdvancedHr'
|
31 |
+
});
|
32 |
+
|
33 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
34 |
+
cm.setActive('advhr', n.nodeName == 'HR');
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.onClick.add(function(ed, e) {
|
38 |
+
e = e.target;
|
39 |
+
|
40 |
+
if (e.nodeName === 'HR')
|
41 |
+
ed.selection.select(e);
|
42 |
+
});
|
43 |
+
},
|
44 |
+
|
45 |
+
getInfo : function() {
|
46 |
+
return {
|
47 |
+
longname : 'Advanced HR',
|
48 |
+
author : 'Moxiecode Systems AB',
|
49 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
50 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
51 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
52 |
+
};
|
53 |
+
}
|
54 |
+
});
|
55 |
+
|
56 |
+
// Register plugin
|
57 |
+
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
58 |
+
})();
|
addons/advhr/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="rule.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111004400000000" remote="130111004400000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advhr/js/rule.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var AdvHRDialog = {
|
2 |
+
init : function(ed) {
|
3 |
+
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
|
4 |
+
|
5 |
+
w = dom.getAttrib(n, 'width');
|
6 |
+
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
|
7 |
+
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
|
8 |
+
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
|
9 |
+
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
|
10 |
+
},
|
11 |
+
|
12 |
+
update : function() {
|
13 |
+
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
|
14 |
+
|
15 |
+
h = '<hr';
|
16 |
+
|
17 |
+
if (f.size.value) {
|
18 |
+
h += ' size="' + f.size.value + '"';
|
19 |
+
st += ' height:' + f.size.value + 'px;';
|
20 |
+
}
|
21 |
+
|
22 |
+
if (f.width.value) {
|
23 |
+
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
|
24 |
+
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
|
25 |
+
}
|
26 |
+
|
27 |
+
if (f.noshade.checked) {
|
28 |
+
h += ' noshade="noshade"';
|
29 |
+
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
|
30 |
+
}
|
31 |
+
|
32 |
+
if (ed.settings.inline_styles)
|
33 |
+
h += ' style="' + tinymce.trim(st) + '"';
|
34 |
+
|
35 |
+
h += ' />';
|
36 |
+
|
37 |
+
ed.execCommand("mceInsertContent", false, h);
|
38 |
+
tinyMCEPopup.close();
|
39 |
+
}
|
40 |
+
};
|
41 |
+
|
42 |
+
//tinyMCEPopup.requireLangPack();
|
43 |
+
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
|
addons/advhr/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advhr/langs/en_dlg.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.advhr_dlg',{
|
2 |
+
desc: "Advanced HR",
|
3 |
+
|
4 |
+
size:"Height",
|
5 |
+
noshade:"No Shadow",
|
6 |
+
width:"Width",
|
7 |
+
normal:"Normal",
|
8 |
+
widthunits:"Units"
|
9 |
+
});
|
10 |
+
|
11 |
+
tinyMCE.addI18n('en.advhr',{
|
12 |
+
delta_width: "Width"
|
13 |
+
});
|
addons/advhr/rule.htm
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advhr.advhr_desc}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="js/rule.js"></script>
|
9 |
+
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
10 |
+
</head>
|
11 |
+
<body role="application">
|
12 |
+
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
16 |
+
</ul>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="panel_wrapper">
|
20 |
+
<div id="general_panel" class="panel current">
|
21 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
22 |
+
<tr role="group" aria-labelledby="width_label">
|
23 |
+
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
24 |
+
<td class="nowrap">
|
25 |
+
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
26 |
+
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
27 |
+
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
28 |
+
<option value="">px</option>
|
29 |
+
<option value="%">%</option>
|
30 |
+
</select>
|
31 |
+
</td>
|
32 |
+
</tr>
|
33 |
+
<tr>
|
34 |
+
<td><label for="size">{#advhr_dlg.size}</label></td>
|
35 |
+
<td><select id="size" name="size">
|
36 |
+
<option value="">{#advhr_dlg.normal}</option>
|
37 |
+
<option value="1">1</option>
|
38 |
+
<option value="2">2</option>
|
39 |
+
<option value="3">3</option>
|
40 |
+
<option value="4">4</option>
|
41 |
+
<option value="5">5</option>
|
42 |
+
</select></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td><label for="noshade">{#advhr_dlg.noshade}</label></td>
|
46 |
+
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
47 |
+
</tr>
|
48 |
+
</table>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<div class="mceActionPanel">
|
53 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
54 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
55 |
+
</div>
|
56 |
+
</form>
|
57 |
+
</body>
|
58 |
+
</html>
|
addons/advimage/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="image.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/advimage/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advimage.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advimage/css/advimage.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#src_list, #over_list, #out_list {width:280px;}
|
2 |
+
.mceActionPanel {margin-top:7px;}
|
3 |
+
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
4 |
+
.checkbox {border:0;}
|
5 |
+
.panel_wrapper div.current {height:305px;}
|
6 |
+
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
7 |
+
#align, #classlist {width:150px;}
|
8 |
+
#width, #height {vertical-align:middle; width:50px; text-align:center;}
|
9 |
+
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
|
10 |
+
#class_list {width:180px;}
|
11 |
+
input {width: 280px;}
|
12 |
+
#constrain, #onmousemovecheck {width:auto;}
|
13 |
+
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
|
addons/advimage/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
|
addons/advimage/editor_plugin_src.js
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvImage', function() {
|
16 |
+
// Internal image object like a flash placeholder
|
17 |
+
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
18 |
+
return;
|
19 |
+
|
20 |
+
ed.windowManager.open({
|
21 |
+
file : url + '/image.htm',
|
22 |
+
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
23 |
+
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
24 |
+
inline : 1
|
25 |
+
}, {
|
26 |
+
plugin_url : url
|
27 |
+
});
|
28 |
+
});
|
29 |
+
|
30 |
+
// Register buttons
|
31 |
+
ed.addButton('image', {
|
32 |
+
title : 'advimage.image_desc',
|
33 |
+
cmd : 'mceAdvImage'
|
34 |
+
});
|
35 |
+
},
|
36 |
+
|
37 |
+
getInfo : function() {
|
38 |
+
return {
|
39 |
+
longname : 'Advanced image',
|
40 |
+
author : 'Moxiecode Systems AB',
|
41 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
42 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
43 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
44 |
+
};
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
// Register plugin
|
49 |
+
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
50 |
+
})();
|
addons/advimage/image.htm
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advimage_dlg.dialog_title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="../../tinymce/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="../../tinymce/editable_selects.js"></script>
|
10 |
+
<script type="text/javascript" src="js/image.js"></script>
|
11 |
+
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
12 |
+
</head>
|
13 |
+
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
+
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
15 |
+
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
16 |
+
<div class="tabs">
|
17 |
+
<ul>
|
18 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
|
19 |
+
<li id="appearance_tab" aria-controls="appearance_panel"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
|
20 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="panel_wrapper">
|
25 |
+
<div id="general_panel" class="panel current">
|
26 |
+
<fieldset>
|
27 |
+
<legend>{#advimage_dlg.general}</legend>
|
28 |
+
|
29 |
+
<table role="presentation" class="properties">
|
30 |
+
<tr>
|
31 |
+
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
32 |
+
<td colspan="2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
33 |
+
<tr>
|
34 |
+
<td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" aria-required="true" /></td>
|
35 |
+
<td id="srcbrowsercontainer"> </td>
|
36 |
+
</tr>
|
37 |
+
</table></td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
|
41 |
+
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
|
45 |
+
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
|
49 |
+
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</fieldset>
|
53 |
+
|
54 |
+
<fieldset>
|
55 |
+
<legend>{#advimage_dlg.preview}</legend>
|
56 |
+
<div id="prev"></div>
|
57 |
+
</fieldset>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div id="appearance_panel" class="panel">
|
61 |
+
<fieldset>
|
62 |
+
<legend>{#advimage_dlg.tab_appearance}</legend>
|
63 |
+
|
64 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
65 |
+
<tr>
|
66 |
+
<td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
|
67 |
+
<td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
|
68 |
+
<option value="">{#not_set}</option>
|
69 |
+
<option value="baseline">{#advimage_dlg.align_baseline}</option>
|
70 |
+
<option value="top">{#advimage_dlg.align_top}</option>
|
71 |
+
<option value="middle">{#advimage_dlg.align_middle}</option>
|
72 |
+
<option value="bottom">{#advimage_dlg.align_bottom}</option>
|
73 |
+
<option value="text-top">{#advimage_dlg.align_texttop}</option>
|
74 |
+
<option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
|
75 |
+
<option value="left">{#advimage_dlg.align_left}</option>
|
76 |
+
<option value="right">{#advimage_dlg.align_right}</option>
|
77 |
+
</select>
|
78 |
+
</td>
|
79 |
+
<td rowspan="6" valign="top">
|
80 |
+
<div class="alignPreview">
|
81 |
+
<img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
|
82 |
+
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
83 |
+
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
84 |
+
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
85 |
+
erat volutpat.
|
86 |
+
</div>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
|
90 |
+
<tr role="group" aria-labelledby="widthlabel">
|
91 |
+
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
94 |
+
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
96 |
+
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
|
100 |
+
<tr>
|
101 |
+
<td> </td>
|
102 |
+
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
103 |
+
<tr>
|
104 |
+
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
105 |
+
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
106 |
+
</tr>
|
107 |
+
</table></td>
|
108 |
+
</tr>
|
109 |
+
|
110 |
+
<tr>
|
111 |
+
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
112 |
+
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
118 |
+
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
123 |
+
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td><label for="class_list">{#class_name}</label></td>
|
128 |
+
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
133 |
+
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
134 |
+
</tr>
|
135 |
+
|
136 |
+
<!-- <tr>
|
137 |
+
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
138 |
+
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
139 |
+
</tr> -->
|
140 |
+
</table>
|
141 |
+
</fieldset>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
<div id="advanced_panel" class="panel">
|
145 |
+
<fieldset>
|
146 |
+
<legend>{#advimage_dlg.swap_image}</legend>
|
147 |
+
|
148 |
+
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
149 |
+
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
150 |
+
|
151 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
152 |
+
<tr>
|
153 |
+
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
154 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
155 |
+
<tr>
|
156 |
+
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
157 |
+
<td id="onmouseoversrccontainer"> </td>
|
158 |
+
</tr>
|
159 |
+
</table></td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
163 |
+
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
164 |
+
</tr>
|
165 |
+
<tr>
|
166 |
+
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
167 |
+
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
168 |
+
<tr>
|
169 |
+
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
170 |
+
<td id="onmouseoutsrccontainer"> </td>
|
171 |
+
</tr>
|
172 |
+
</table></td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
176 |
+
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
177 |
+
</tr>
|
178 |
+
</table>
|
179 |
+
</fieldset>
|
180 |
+
|
181 |
+
<fieldset>
|
182 |
+
<legend>{#advimage_dlg.misc}</legend>
|
183 |
+
|
184 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
185 |
+
<tr>
|
186 |
+
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
187 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<tr>
|
191 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
192 |
+
<td>
|
193 |
+
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
194 |
+
<option value="">{#not_set}</option>
|
195 |
+
<option value="ltr">{#advimage_dlg.ltr}</option>
|
196 |
+
<option value="rtl">{#advimage_dlg.rtl}</option>
|
197 |
+
</select>
|
198 |
+
</td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
203 |
+
<td>
|
204 |
+
<input id="lang" name="lang" type="text" value="" />
|
205 |
+
</td>
|
206 |
+
</tr>
|
207 |
+
|
208 |
+
<tr>
|
209 |
+
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
210 |
+
<td>
|
211 |
+
<input id="usemap" name="usemap" type="text" value="" />
|
212 |
+
</td>
|
213 |
+
</tr>
|
214 |
+
|
215 |
+
<tr>
|
216 |
+
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
217 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
218 |
+
<tr>
|
219 |
+
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
220 |
+
<td id="longdesccontainer"> </td>
|
221 |
+
</tr>
|
222 |
+
</table></td>
|
223 |
+
</tr>
|
224 |
+
</table>
|
225 |
+
</fieldset>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
+
|
229 |
+
<div class="mceActionPanel">
|
230 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
231 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
232 |
+
</div>
|
233 |
+
</form>
|
234 |
+
</body>
|
235 |
+
</html>
|
addons/advimage/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="sample.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advimage/img/sample.gif
ADDED
Binary file
|
addons/advimage/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="image.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111269600000000" remote="130111269600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advimage/js/image.js
ADDED
@@ -0,0 +1,462 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ImageDialog = {
|
2 |
+
preInit : function() {
|
3 |
+
var url;
|
4 |
+
|
5 |
+
//tinyMCEPopup.requireLangPack();
|
6 |
+
|
7 |
+
if (url = tinyMCEPopup.getParam("external_image_list_url"))
|
8 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
9 |
+
},
|
10 |
+
|
11 |
+
init : function(ed) {
|
12 |
+
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
|
13 |
+
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
this.fillClassList('class_list');
|
16 |
+
this.fillFileList('src_list', fl);
|
17 |
+
this.fillFileList('over_list', fl);
|
18 |
+
this.fillFileList('out_list', fl);
|
19 |
+
TinyMCE_EditableSelects.init();
|
20 |
+
|
21 |
+
if (n.nodeName == 'IMG') {
|
22 |
+
nl.src.value = dom.getAttrib(n, 'src');
|
23 |
+
nl.width.value = dom.getAttrib(n, 'width');
|
24 |
+
nl.height.value = dom.getAttrib(n, 'height');
|
25 |
+
nl.alt.value = dom.getAttrib(n, 'alt');
|
26 |
+
nl.title.value = dom.getAttrib(n, 'title');
|
27 |
+
nl.vspace.value = this.getAttrib(n, 'vspace');
|
28 |
+
nl.hspace.value = this.getAttrib(n, 'hspace');
|
29 |
+
nl.border.value = this.getAttrib(n, 'border');
|
30 |
+
selectByValue(f, 'align', this.getAttrib(n, 'align'));
|
31 |
+
selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
|
32 |
+
nl.style.value = dom.getAttrib(n, 'style');
|
33 |
+
nl.id.value = dom.getAttrib(n, 'id');
|
34 |
+
nl.dir.value = dom.getAttrib(n, 'dir');
|
35 |
+
nl.lang.value = dom.getAttrib(n, 'lang');
|
36 |
+
nl.usemap.value = dom.getAttrib(n, 'usemap');
|
37 |
+
nl.longdesc.value = dom.getAttrib(n, 'longdesc');
|
38 |
+
nl.insert.value = ed.getLang('update');
|
39 |
+
|
40 |
+
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
|
41 |
+
nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
42 |
+
|
43 |
+
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
|
44 |
+
nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
45 |
+
|
46 |
+
if (ed.settings.inline_styles) {
|
47 |
+
// Move attribs to styles
|
48 |
+
if (dom.getAttrib(n, 'align'))
|
49 |
+
this.updateStyle('align');
|
50 |
+
|
51 |
+
if (dom.getAttrib(n, 'hspace'))
|
52 |
+
this.updateStyle('hspace');
|
53 |
+
|
54 |
+
if (dom.getAttrib(n, 'border'))
|
55 |
+
this.updateStyle('border');
|
56 |
+
|
57 |
+
if (dom.getAttrib(n, 'vspace'))
|
58 |
+
this.updateStyle('vspace');
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
// Setup browse button
|
63 |
+
document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
|
64 |
+
if (isVisible('srcbrowser'))
|
65 |
+
document.getElementById('src').style.width = '260px';
|
66 |
+
|
67 |
+
// Setup browse button
|
68 |
+
document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
|
69 |
+
if (isVisible('overbrowser'))
|
70 |
+
document.getElementById('onmouseoversrc').style.width = '260px';
|
71 |
+
|
72 |
+
// Setup browse button
|
73 |
+
document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
|
74 |
+
if (isVisible('outbrowser'))
|
75 |
+
document.getElementById('onmouseoutsrc').style.width = '260px';
|
76 |
+
|
77 |
+
// If option enabled default contrain proportions to checked
|
78 |
+
if (ed.getParam("advimage_constrain_proportions", true))
|
79 |
+
f.constrain.checked = true;
|
80 |
+
|
81 |
+
// Check swap image if valid data
|
82 |
+
if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
|
83 |
+
this.setSwapImage(true);
|
84 |
+
else
|
85 |
+
this.setSwapImage(false);
|
86 |
+
|
87 |
+
this.changeAppearance();
|
88 |
+
this.showPreviewImage(nl.src.value, 1);
|
89 |
+
},
|
90 |
+
|
91 |
+
insert : function(file, title) {
|
92 |
+
var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
|
93 |
+
|
94 |
+
if (f.src.value === '') {
|
95 |
+
if (ed.selection.getNode().nodeName == 'IMG') {
|
96 |
+
ed.dom.remove(ed.selection.getNode());
|
97 |
+
ed.execCommand('mceRepaint');
|
98 |
+
}
|
99 |
+
|
100 |
+
tinyMCEPopup.close();
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
|
105 |
+
if (!f.alt.value) {
|
106 |
+
tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
|
107 |
+
if (s)
|
108 |
+
t.insertAndClose();
|
109 |
+
});
|
110 |
+
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
t.insertAndClose();
|
116 |
+
},
|
117 |
+
|
118 |
+
insertAndClose : function() {
|
119 |
+
var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
|
120 |
+
|
121 |
+
tinyMCEPopup.restoreSelection();
|
122 |
+
|
123 |
+
// Fixes crash in Safari
|
124 |
+
if (tinymce.isWebKit)
|
125 |
+
ed.getWin().focus();
|
126 |
+
|
127 |
+
if (!ed.settings.inline_styles) {
|
128 |
+
args = {
|
129 |
+
vspace : nl.vspace.value,
|
130 |
+
hspace : nl.hspace.value,
|
131 |
+
border : nl.border.value,
|
132 |
+
align : getSelectValue(f, 'align')
|
133 |
+
};
|
134 |
+
} else {
|
135 |
+
// Remove deprecated values
|
136 |
+
args = {
|
137 |
+
vspace : '',
|
138 |
+
hspace : '',
|
139 |
+
border : '',
|
140 |
+
align : ''
|
141 |
+
};
|
142 |
+
}
|
143 |
+
|
144 |
+
tinymce.extend(args, {
|
145 |
+
src : nl.src.value.replace(/ /g, '%20'),
|
146 |
+
width : nl.width.value,
|
147 |
+
height : nl.height.value,
|
148 |
+
alt : nl.alt.value,
|
149 |
+
title : nl.title.value,
|
150 |
+
'class' : getSelectValue(f, 'class_list'),
|
151 |
+
style : nl.style.value,
|
152 |
+
id : nl.id.value,
|
153 |
+
dir : nl.dir.value,
|
154 |
+
lang : nl.lang.value,
|
155 |
+
usemap : nl.usemap.value,
|
156 |
+
longdesc : nl.longdesc.value
|
157 |
+
});
|
158 |
+
|
159 |
+
args.onmouseover = args.onmouseout = '';
|
160 |
+
|
161 |
+
if (f.onmousemovecheck.checked) {
|
162 |
+
if (nl.onmouseoversrc.value)
|
163 |
+
args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
|
164 |
+
|
165 |
+
if (nl.onmouseoutsrc.value)
|
166 |
+
args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
|
167 |
+
}
|
168 |
+
|
169 |
+
el = ed.selection.getNode();
|
170 |
+
|
171 |
+
if (el && el.nodeName == 'IMG') {
|
172 |
+
ed.dom.setAttribs(el, args);
|
173 |
+
} else {
|
174 |
+
tinymce.each(args, function(value, name) {
|
175 |
+
if (value === "") {
|
176 |
+
delete args[name];
|
177 |
+
}
|
178 |
+
});
|
179 |
+
|
180 |
+
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
|
181 |
+
ed.undoManager.add();
|
182 |
+
}
|
183 |
+
|
184 |
+
tinyMCEPopup.editor.execCommand('mceRepaint');
|
185 |
+
tinyMCEPopup.editor.focus();
|
186 |
+
tinyMCEPopup.close();
|
187 |
+
},
|
188 |
+
|
189 |
+
getAttrib : function(e, at) {
|
190 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
191 |
+
|
192 |
+
if (ed.settings.inline_styles) {
|
193 |
+
switch (at) {
|
194 |
+
case 'align':
|
195 |
+
if (v = dom.getStyle(e, 'float'))
|
196 |
+
return v;
|
197 |
+
|
198 |
+
if (v = dom.getStyle(e, 'vertical-align'))
|
199 |
+
return v;
|
200 |
+
|
201 |
+
break;
|
202 |
+
|
203 |
+
case 'hspace':
|
204 |
+
v = dom.getStyle(e, 'margin-left')
|
205 |
+
v2 = dom.getStyle(e, 'margin-right');
|
206 |
+
|
207 |
+
if (v && v == v2)
|
208 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
209 |
+
|
210 |
+
break;
|
211 |
+
|
212 |
+
case 'vspace':
|
213 |
+
v = dom.getStyle(e, 'margin-top')
|
214 |
+
v2 = dom.getStyle(e, 'margin-bottom');
|
215 |
+
if (v && v == v2)
|
216 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
217 |
+
|
218 |
+
break;
|
219 |
+
|
220 |
+
case 'border':
|
221 |
+
v = 0;
|
222 |
+
|
223 |
+
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
224 |
+
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
225 |
+
|
226 |
+
// False or not the same as prev
|
227 |
+
if (!sv || (sv != v && v !== 0)) {
|
228 |
+
v = 0;
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
|
232 |
+
if (sv)
|
233 |
+
v = sv;
|
234 |
+
});
|
235 |
+
|
236 |
+
if (v)
|
237 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
238 |
+
|
239 |
+
break;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
if (v = dom.getAttrib(e, at))
|
244 |
+
return v;
|
245 |
+
|
246 |
+
return '';
|
247 |
+
},
|
248 |
+
|
249 |
+
setSwapImage : function(st) {
|
250 |
+
var f = document.forms[0];
|
251 |
+
|
252 |
+
f.onmousemovecheck.checked = st;
|
253 |
+
setBrowserDisabled('overbrowser', !st);
|
254 |
+
setBrowserDisabled('outbrowser', !st);
|
255 |
+
|
256 |
+
if (f.over_list)
|
257 |
+
f.over_list.disabled = !st;
|
258 |
+
|
259 |
+
if (f.out_list)
|
260 |
+
f.out_list.disabled = !st;
|
261 |
+
|
262 |
+
f.onmouseoversrc.disabled = !st;
|
263 |
+
f.onmouseoutsrc.disabled = !st;
|
264 |
+
},
|
265 |
+
|
266 |
+
fillClassList : function(id) {
|
267 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
268 |
+
|
269 |
+
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
270 |
+
cl = [];
|
271 |
+
|
272 |
+
tinymce.each(v.split(';'), function(v) {
|
273 |
+
var p = v.split('=');
|
274 |
+
|
275 |
+
cl.push({'title' : p[0], 'class' : p[1]});
|
276 |
+
});
|
277 |
+
} else
|
278 |
+
cl = tinyMCEPopup.editor.dom.getClasses();
|
279 |
+
|
280 |
+
if (cl.length > 0) {
|
281 |
+
lst.options.length = 0;
|
282 |
+
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
283 |
+
|
284 |
+
tinymce.each(cl, function(o) {
|
285 |
+
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
286 |
+
});
|
287 |
+
} else
|
288 |
+
dom.remove(dom.getParent(id, 'tr'));
|
289 |
+
},
|
290 |
+
|
291 |
+
fillFileList : function(id, l) {
|
292 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
293 |
+
|
294 |
+
l = typeof(l) === 'function' ? l() : window[l];
|
295 |
+
lst.options.length = 0;
|
296 |
+
|
297 |
+
if (l && l.length > 0) {
|
298 |
+
lst.options[lst.options.length] = new Option('', '');
|
299 |
+
|
300 |
+
tinymce.each(l, function(o) {
|
301 |
+
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
302 |
+
});
|
303 |
+
} else
|
304 |
+
dom.remove(dom.getParent(id, 'tr'));
|
305 |
+
},
|
306 |
+
|
307 |
+
resetImageData : function() {
|
308 |
+
var f = document.forms[0];
|
309 |
+
|
310 |
+
f.elements.width.value = f.elements.height.value = '';
|
311 |
+
},
|
312 |
+
|
313 |
+
updateImageData : function(img, st) {
|
314 |
+
var f = document.forms[0];
|
315 |
+
|
316 |
+
if (!st) {
|
317 |
+
f.elements.width.value = img.width;
|
318 |
+
f.elements.height.value = img.height;
|
319 |
+
}
|
320 |
+
|
321 |
+
this.preloadImg = img;
|
322 |
+
},
|
323 |
+
|
324 |
+
changeAppearance : function() {
|
325 |
+
var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
|
326 |
+
|
327 |
+
if (img) {
|
328 |
+
if (ed.getParam('inline_styles')) {
|
329 |
+
ed.dom.setAttrib(img, 'style', f.style.value);
|
330 |
+
} else {
|
331 |
+
img.align = f.align.value;
|
332 |
+
img.border = f.border.value;
|
333 |
+
img.hspace = f.hspace.value;
|
334 |
+
img.vspace = f.vspace.value;
|
335 |
+
}
|
336 |
+
}
|
337 |
+
},
|
338 |
+
|
339 |
+
changeHeight : function() {
|
340 |
+
var f = document.forms[0], tp, t = this;
|
341 |
+
|
342 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
|
346 |
+
if (f.width.value == "" || f.height.value == "")
|
347 |
+
return;
|
348 |
+
|
349 |
+
tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
|
350 |
+
f.height.value = tp.toFixed(0);
|
351 |
+
},
|
352 |
+
|
353 |
+
changeWidth : function() {
|
354 |
+
var f = document.forms[0], tp, t = this;
|
355 |
+
|
356 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
357 |
+
return;
|
358 |
+
}
|
359 |
+
|
360 |
+
if (f.width.value == "" || f.height.value == "")
|
361 |
+
return;
|
362 |
+
|
363 |
+
tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
|
364 |
+
f.width.value = tp.toFixed(0);
|
365 |
+
},
|
366 |
+
|
367 |
+
updateStyle : function(ty) {
|
368 |
+
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
|
369 |
+
|
370 |
+
if (tinyMCEPopup.editor.settings.inline_styles) {
|
371 |
+
// Handle align
|
372 |
+
if (ty == 'align') {
|
373 |
+
dom.setStyle(img, 'float', '');
|
374 |
+
dom.setStyle(img, 'vertical-align', '');
|
375 |
+
|
376 |
+
v = getSelectValue(f, 'align');
|
377 |
+
if (v) {
|
378 |
+
if (v == 'left' || v == 'right')
|
379 |
+
dom.setStyle(img, 'float', v);
|
380 |
+
else
|
381 |
+
img.style.verticalAlign = v;
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
// Handle border
|
386 |
+
if (ty == 'border') {
|
387 |
+
b = img.style.border ? img.style.border.split(' ') : [];
|
388 |
+
bStyle = dom.getStyle(img, 'border-style');
|
389 |
+
bColor = dom.getStyle(img, 'border-color');
|
390 |
+
|
391 |
+
dom.setStyle(img, 'border', '');
|
392 |
+
|
393 |
+
v = f.border.value;
|
394 |
+
if (v || v == '0') {
|
395 |
+
if (v == '0')
|
396 |
+
img.style.border = isIE ? '0' : '0 none none';
|
397 |
+
else {
|
398 |
+
if (b.length == 3 && b[isIE ? 2 : 1])
|
399 |
+
bStyle = b[isIE ? 2 : 1];
|
400 |
+
else if (!bStyle || bStyle == 'none')
|
401 |
+
bStyle = 'solid';
|
402 |
+
if (b.length == 3 && b[isIE ? 0 : 2])
|
403 |
+
bColor = b[isIE ? 0 : 2];
|
404 |
+
else if (!bColor || bColor == 'none')
|
405 |
+
bColor = 'black';
|
406 |
+
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
407 |
+
}
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
// Handle hspace
|
412 |
+
if (ty == 'hspace') {
|
413 |
+
dom.setStyle(img, 'marginLeft', '');
|
414 |
+
dom.setStyle(img, 'marginRight', '');
|
415 |
+
|
416 |
+
v = f.hspace.value;
|
417 |
+
if (v) {
|
418 |
+
img.style.marginLeft = v + 'px';
|
419 |
+
img.style.marginRight = v + 'px';
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
+
// Handle vspace
|
424 |
+
if (ty == 'vspace') {
|
425 |
+
dom.setStyle(img, 'marginTop', '');
|
426 |
+
dom.setStyle(img, 'marginBottom', '');
|
427 |
+
|
428 |
+
v = f.vspace.value;
|
429 |
+
if (v) {
|
430 |
+
img.style.marginTop = v + 'px';
|
431 |
+
img.style.marginBottom = v + 'px';
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
// Merge
|
436 |
+
dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');
|
437 |
+
}
|
438 |
+
},
|
439 |
+
|
440 |
+
changeMouseMove : function() {
|
441 |
+
},
|
442 |
+
|
443 |
+
showPreviewImage : function(u, st) {
|
444 |
+
if (!u) {
|
445 |
+
tinyMCEPopup.dom.setHTML('prev', '');
|
446 |
+
return;
|
447 |
+
}
|
448 |
+
|
449 |
+
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
450 |
+
this.resetImageData();
|
451 |
+
|
452 |
+
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
453 |
+
|
454 |
+
if (!st)
|
455 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
456 |
+
else
|
457 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
458 |
+
}
|
459 |
+
};
|
460 |
+
|
461 |
+
ImageDialog.preInit();
|
462 |
+
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
addons/advimage/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advimage/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"});
|
addons/advlink/_notes/dwsync.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advlink.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186926700821259" remote="130186890600000000" Dst="2" />
|
5 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186926519898402" remote="130186890000000000" Dst="2" />
|
6 |
+
<file name="link.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
</dwsync>
|
addons/advlink/advlink.png
ADDED
Binary file
|
addons/advlink/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advlink.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advlink/css/advlink.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
2 |
+
.mceActionPanel {margin-top:7px;}
|
3 |
+
.panel_wrapper div.current {height:320px;}
|
4 |
+
#classlist, #title, #href {width:280px;}
|
5 |
+
#popupurl, #popupname {width:200px;}
|
6 |
+
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
7 |
+
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
8 |
+
#events_panel input {width:200px;}
|
addons/advlink/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advlink",{/*title : 'advlink.link_desc',*/title: a.getLang('advlink.link_desc'),cmd:"mceAdvLink"/*,image:b+"/img/advlink.png"*/});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("advlink",e&&f.nodeName!="A");c.setActive("advlink",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
|
addons/advlink/editor_plugin_src.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
this.editor = ed;
|
15 |
+
|
16 |
+
// Register commands
|
17 |
+
ed.addCommand('mceAdvLink', function() {
|
18 |
+
var se = ed.selection;
|
19 |
+
|
20 |
+
// No selection and not in link
|
21 |
+
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
22 |
+
return;
|
23 |
+
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : url + '/link.htm',
|
26 |
+
width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
|
27 |
+
height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
|
28 |
+
inline : 1
|
29 |
+
}, {
|
30 |
+
plugin_url : url
|
31 |
+
});
|
32 |
+
});
|
33 |
+
|
34 |
+
// Register buttons
|
35 |
+
ed.addButton('advlink', {
|
36 |
+
/*title : 'advlink.link_desc',*/
|
37 |
+
title: ed.getLang('advlink.link_desc'),
|
38 |
+
cmd : 'mceAdvLink',
|
39 |
+
//image: url + '/img/advlink.png'
|
40 |
+
});
|
41 |
+
|
42 |
+
ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
|
43 |
+
|
44 |
+
ed.onNodeChange.add(function(ed, cm, n, co) {
|
45 |
+
cm.setDisabled('advlink', co && n.nodeName != 'A');
|
46 |
+
cm.setActive('advlink', n.nodeName == 'A' && !n.name);
|
47 |
+
});
|
48 |
+
},
|
49 |
+
|
50 |
+
getInfo : function() {
|
51 |
+
return {
|
52 |
+
longname : 'Advanced link',
|
53 |
+
author : 'Moxiecode Systems AB',
|
54 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
55 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
56 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
57 |
+
};
|
58 |
+
}
|
59 |
+
});
|
60 |
+
|
61 |
+
// Register plugin
|
62 |
+
tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
|
63 |
+
})();
|
addons/advlink/img/Thumbs.db
ADDED
Binary file
|
addons/advlink/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advlink.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advlink/img/advlink.png
ADDED
Binary file
|
addons/advlink/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="advlink.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advlink/js/advlink.js
ADDED
@@ -0,0 +1,539 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Functions for the advlink plugin popup */
|
2 |
+
|
3 |
+
tinyMCEPopup.requireLangPack();
|
4 |
+
|
5 |
+
var templates = {
|
6 |
+
"window.open" : "window.open('${url}','${target}','${options}')"
|
7 |
+
};
|
8 |
+
|
9 |
+
function preinit() {
|
10 |
+
var url;
|
11 |
+
|
12 |
+
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
13 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
14 |
+
}
|
15 |
+
|
16 |
+
function changeClass() {
|
17 |
+
var f = document.forms[0];
|
18 |
+
|
19 |
+
f.classes.value = getSelectValue(f, 'classlist');
|
20 |
+
}
|
21 |
+
|
22 |
+
function init() {
|
23 |
+
tinyMCEPopup.resizeToInnerSize();
|
24 |
+
|
25 |
+
var formObj = document.forms[0];
|
26 |
+
var inst = tinyMCEPopup.editor;
|
27 |
+
var elm = inst.selection.getNode();
|
28 |
+
var action = "insert";
|
29 |
+
var html;
|
30 |
+
|
31 |
+
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
32 |
+
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
33 |
+
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
34 |
+
|
35 |
+
// Link list
|
36 |
+
html = getLinkListHTML('linklisthref','href');
|
37 |
+
if (html == "")
|
38 |
+
document.getElementById("linklisthrefrow").style.display = 'none';
|
39 |
+
else
|
40 |
+
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
41 |
+
|
42 |
+
// Anchor list
|
43 |
+
html = getAnchorListHTML('anchorlist','href');
|
44 |
+
if (html == "")
|
45 |
+
document.getElementById("anchorlistrow").style.display = 'none';
|
46 |
+
else
|
47 |
+
document.getElementById("anchorlistcontainer").innerHTML = html;
|
48 |
+
|
49 |
+
// Resize some elements
|
50 |
+
if (isVisible('hrefbrowser'))
|
51 |
+
document.getElementById('href').style.width = '260px';
|
52 |
+
|
53 |
+
if (isVisible('popupurlbrowser'))
|
54 |
+
document.getElementById('popupurl').style.width = '180px';
|
55 |
+
|
56 |
+
elm = inst.dom.getParent(elm, "A");
|
57 |
+
if (elm == null) {
|
58 |
+
var prospect = inst.dom.create("p", null, inst.selection.getContent());
|
59 |
+
if (prospect.childNodes.length === 1) {
|
60 |
+
elm = prospect.firstChild;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
if (elm != null && elm.nodeName == "A")
|
65 |
+
action = "update";
|
66 |
+
|
67 |
+
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
68 |
+
|
69 |
+
setPopupControlsDisabled(true);
|
70 |
+
|
71 |
+
if (action == "update") {
|
72 |
+
var href = inst.dom.getAttrib(elm, 'href');
|
73 |
+
var onclick = inst.dom.getAttrib(elm, 'onclick');
|
74 |
+
|
75 |
+
// Setup form data
|
76 |
+
setFormValue('href', href);
|
77 |
+
setFormValue('title', inst.dom.getAttrib(elm, 'title'));
|
78 |
+
setFormValue('id', inst.dom.getAttrib(elm, 'id'));
|
79 |
+
setFormValue('style', inst.dom.getAttrib(elm, "style"));
|
80 |
+
setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
|
81 |
+
setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
|
82 |
+
setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
|
83 |
+
setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
|
84 |
+
setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
|
85 |
+
setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
|
86 |
+
setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
87 |
+
setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
88 |
+
setFormValue('type', inst.dom.getAttrib(elm, 'type'));
|
89 |
+
setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
|
90 |
+
setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
|
91 |
+
setFormValue('onclick', onclick);
|
92 |
+
setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
|
93 |
+
setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
|
94 |
+
setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
|
95 |
+
setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
|
96 |
+
setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
|
97 |
+
setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
|
98 |
+
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
99 |
+
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
100 |
+
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
101 |
+
setFormValue('target', inst.dom.getAttrib(elm, 'target'));
|
102 |
+
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
103 |
+
|
104 |
+
// Parse onclick data
|
105 |
+
if (onclick != null && onclick.indexOf('window.open') != -1)
|
106 |
+
parseWindowOpen(onclick);
|
107 |
+
else
|
108 |
+
parseFunction(onclick);
|
109 |
+
|
110 |
+
// Select by the values
|
111 |
+
selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
|
112 |
+
selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
|
113 |
+
selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
|
114 |
+
selectByValue(formObj, 'linklisthref', href);
|
115 |
+
|
116 |
+
if (href.charAt(0) == '#')
|
117 |
+
selectByValue(formObj, 'anchorlist', href);
|
118 |
+
|
119 |
+
addClassesToList('classlist', 'advlink_styles');
|
120 |
+
|
121 |
+
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
122 |
+
selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
|
123 |
+
} else
|
124 |
+
addClassesToList('classlist', 'advlink_styles');
|
125 |
+
}
|
126 |
+
|
127 |
+
function checkPrefix(n) {
|
128 |
+
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
|
129 |
+
n.value = 'mailto:' + n.value;
|
130 |
+
|
131 |
+
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
|
132 |
+
n.value = 'http://' + n.value;
|
133 |
+
}
|
134 |
+
|
135 |
+
function setFormValue(name, value) {
|
136 |
+
document.forms[0].elements[name].value = value;
|
137 |
+
}
|
138 |
+
|
139 |
+
function parseWindowOpen(onclick) {
|
140 |
+
var formObj = document.forms[0];
|
141 |
+
|
142 |
+
// Preprocess center code
|
143 |
+
if (onclick.indexOf('return false;') != -1) {
|
144 |
+
formObj.popupreturn.checked = true;
|
145 |
+
onclick = onclick.replace('return false;', '');
|
146 |
+
} else
|
147 |
+
formObj.popupreturn.checked = false;
|
148 |
+
|
149 |
+
var onClickData = parseLink(onclick);
|
150 |
+
|
151 |
+
if (onClickData != null) {
|
152 |
+
formObj.ispopup.checked = true;
|
153 |
+
setPopupControlsDisabled(false);
|
154 |
+
|
155 |
+
var onClickWindowOptions = parseOptions(onClickData['options']);
|
156 |
+
var url = onClickData['url'];
|
157 |
+
|
158 |
+
formObj.popupname.value = onClickData['target'];
|
159 |
+
formObj.popupurl.value = url;
|
160 |
+
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
161 |
+
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
162 |
+
|
163 |
+
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
164 |
+
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
165 |
+
|
166 |
+
if (formObj.popupleft.value.indexOf('screen') != -1)
|
167 |
+
formObj.popupleft.value = "c";
|
168 |
+
|
169 |
+
if (formObj.popuptop.value.indexOf('screen') != -1)
|
170 |
+
formObj.popuptop.value = "c";
|
171 |
+
|
172 |
+
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
173 |
+
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
174 |
+
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
175 |
+
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
176 |
+
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
177 |
+
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
178 |
+
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
179 |
+
|
180 |
+
buildOnClick();
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
function parseFunction(onclick) {
|
185 |
+
var formObj = document.forms[0];
|
186 |
+
var onClickData = parseLink(onclick);
|
187 |
+
|
188 |
+
// TODO: Add stuff here
|
189 |
+
}
|
190 |
+
|
191 |
+
function getOption(opts, name) {
|
192 |
+
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
193 |
+
}
|
194 |
+
|
195 |
+
function setPopupControlsDisabled(state) {
|
196 |
+
var formObj = document.forms[0];
|
197 |
+
|
198 |
+
formObj.popupname.disabled = state;
|
199 |
+
formObj.popupurl.disabled = state;
|
200 |
+
formObj.popupwidth.disabled = state;
|
201 |
+
formObj.popupheight.disabled = state;
|
202 |
+
formObj.popupleft.disabled = state;
|
203 |
+
formObj.popuptop.disabled = state;
|
204 |
+
formObj.popuplocation.disabled = state;
|
205 |
+
formObj.popupscrollbars.disabled = state;
|
206 |
+
formObj.popupmenubar.disabled = state;
|
207 |
+
formObj.popupresizable.disabled = state;
|
208 |
+
formObj.popuptoolbar.disabled = state;
|
209 |
+
formObj.popupstatus.disabled = state;
|
210 |
+
formObj.popupreturn.disabled = state;
|
211 |
+
formObj.popupdependent.disabled = state;
|
212 |
+
|
213 |
+
setBrowserDisabled('popupurlbrowser', state);
|
214 |
+
}
|
215 |
+
|
216 |
+
function parseLink(link) {
|
217 |
+
link = link.replace(new RegExp(''', 'g'), "'");
|
218 |
+
|
219 |
+
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
220 |
+
|
221 |
+
// Is function name a template function
|
222 |
+
var template = templates[fnName];
|
223 |
+
if (template) {
|
224 |
+
// Build regexp
|
225 |
+
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
226 |
+
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
227 |
+
var replaceStr = "";
|
228 |
+
for (var i=0; i<variableNames.length; i++) {
|
229 |
+
// Is string value
|
230 |
+
if (variableNames[i].indexOf("'${") != -1)
|
231 |
+
regExp += "'(.*)'";
|
232 |
+
else // Number value
|
233 |
+
regExp += "([0-9]*)";
|
234 |
+
|
235 |
+
replaceStr += "$" + (i+1);
|
236 |
+
|
237 |
+
// Cleanup variable name
|
238 |
+
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
239 |
+
|
240 |
+
if (i != variableNames.length-1) {
|
241 |
+
regExp += "\\s*,\\s*";
|
242 |
+
replaceStr += "<delim>";
|
243 |
+
} else
|
244 |
+
regExp += ".*";
|
245 |
+
}
|
246 |
+
|
247 |
+
regExp += "\\);?";
|
248 |
+
|
249 |
+
// Build variable array
|
250 |
+
var variables = [];
|
251 |
+
variables["_function"] = fnName;
|
252 |
+
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
253 |
+
for (var i=0; i<variableNames.length; i++)
|
254 |
+
variables[variableNames[i]] = variableValues[i];
|
255 |
+
|
256 |
+
return variables;
|
257 |
+
}
|
258 |
+
|
259 |
+
return null;
|
260 |
+
}
|
261 |
+
|
262 |
+
function parseOptions(opts) {
|
263 |
+
if (opts == null || opts == "")
|
264 |
+
return [];
|
265 |
+
|
266 |
+
// Cleanup the options
|
267 |
+
opts = opts.toLowerCase();
|
268 |
+
opts = opts.replace(/;/g, ",");
|
269 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
270 |
+
|
271 |
+
var optionChunks = opts.split(',');
|
272 |
+
var options = [];
|
273 |
+
|
274 |
+
for (var i=0; i<optionChunks.length; i++) {
|
275 |
+
var parts = optionChunks[i].split('=');
|
276 |
+
|
277 |
+
if (parts.length == 2)
|
278 |
+
options[parts[0]] = parts[1];
|
279 |
+
}
|
280 |
+
|
281 |
+
return options;
|
282 |
+
}
|
283 |
+
|
284 |
+
function buildOnClick() {
|
285 |
+
var formObj = document.forms[0];
|
286 |
+
|
287 |
+
if (!formObj.ispopup.checked) {
|
288 |
+
formObj.onclick.value = "";
|
289 |
+
return;
|
290 |
+
}
|
291 |
+
|
292 |
+
var onclick = "window.open('";
|
293 |
+
var url = formObj.popupurl.value;
|
294 |
+
|
295 |
+
onclick += url + "','";
|
296 |
+
onclick += formObj.popupname.value + "','";
|
297 |
+
|
298 |
+
if (formObj.popuplocation.checked)
|
299 |
+
onclick += "location=yes,";
|
300 |
+
|
301 |
+
if (formObj.popupscrollbars.checked)
|
302 |
+
onclick += "scrollbars=yes,";
|
303 |
+
|
304 |
+
if (formObj.popupmenubar.checked)
|
305 |
+
onclick += "menubar=yes,";
|
306 |
+
|
307 |
+
if (formObj.popupresizable.checked)
|
308 |
+
onclick += "resizable=yes,";
|
309 |
+
|
310 |
+
if (formObj.popuptoolbar.checked)
|
311 |
+
onclick += "toolbar=yes,";
|
312 |
+
|
313 |
+
if (formObj.popupstatus.checked)
|
314 |
+
onclick += "status=yes,";
|
315 |
+
|
316 |
+
if (formObj.popupdependent.checked)
|
317 |
+
onclick += "dependent=yes,";
|
318 |
+
|
319 |
+
if (formObj.popupwidth.value != "")
|
320 |
+
onclick += "width=" + formObj.popupwidth.value + ",";
|
321 |
+
|
322 |
+
if (formObj.popupheight.value != "")
|
323 |
+
onclick += "height=" + formObj.popupheight.value + ",";
|
324 |
+
|
325 |
+
if (formObj.popupleft.value != "") {
|
326 |
+
if (formObj.popupleft.value != "c")
|
327 |
+
onclick += "left=" + formObj.popupleft.value + ",";
|
328 |
+
else
|
329 |
+
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
330 |
+
}
|
331 |
+
|
332 |
+
if (formObj.popuptop.value != "") {
|
333 |
+
if (formObj.popuptop.value != "c")
|
334 |
+
onclick += "top=" + formObj.popuptop.value + ",";
|
335 |
+
else
|
336 |
+
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
337 |
+
}
|
338 |
+
|
339 |
+
if (onclick.charAt(onclick.length-1) == ',')
|
340 |
+
onclick = onclick.substring(0, onclick.length-1);
|
341 |
+
|
342 |
+
onclick += "');";
|
343 |
+
|
344 |
+
if (formObj.popupreturn.checked)
|
345 |
+
onclick += "return false;";
|
346 |
+
|
347 |
+
// tinyMCE.debug(onclick);
|
348 |
+
|
349 |
+
formObj.onclick.value = onclick;
|
350 |
+
|
351 |
+
if (formObj.href.value == "")
|
352 |
+
formObj.href.value = url;
|
353 |
+
}
|
354 |
+
|
355 |
+
function setAttrib(elm, attrib, value) {
|
356 |
+
var formObj = document.forms[0];
|
357 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
358 |
+
var dom = tinyMCEPopup.editor.dom;
|
359 |
+
|
360 |
+
if (typeof(value) == "undefined" || value == null) {
|
361 |
+
value = "";
|
362 |
+
|
363 |
+
if (valueElm)
|
364 |
+
value = valueElm.value;
|
365 |
+
}
|
366 |
+
|
367 |
+
// Clean up the style
|
368 |
+
if (attrib == 'style')
|
369 |
+
value = dom.serializeStyle(dom.parseStyle(value), 'a');
|
370 |
+
|
371 |
+
dom.setAttrib(elm, attrib, value);
|
372 |
+
}
|
373 |
+
|
374 |
+
function getAnchorListHTML(id, target) {
|
375 |
+
var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
|
376 |
+
|
377 |
+
for (i=0, len=nodes.length; i<len; i++) {
|
378 |
+
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
|
379 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
380 |
+
}
|
381 |
+
|
382 |
+
if (html == "")
|
383 |
+
return "";
|
384 |
+
|
385 |
+
html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
|
386 |
+
+ ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
|
387 |
+
+ '>'
|
388 |
+
+ '<option value="">---</option>'
|
389 |
+
+ html
|
390 |
+
+ '</select>';
|
391 |
+
|
392 |
+
return html;
|
393 |
+
}
|
394 |
+
|
395 |
+
function insertAction() {
|
396 |
+
var inst = tinyMCEPopup.editor;
|
397 |
+
var elm, elementArray, i;
|
398 |
+
|
399 |
+
elm = inst.selection.getNode();
|
400 |
+
checkPrefix(document.forms[0].href);
|
401 |
+
|
402 |
+
elm = inst.dom.getParent(elm, "A");
|
403 |
+
|
404 |
+
// Remove element if there is no href
|
405 |
+
if (!document.forms[0].href.value) {
|
406 |
+
i = inst.selection.getBookmark();
|
407 |
+
inst.dom.remove(elm, 1);
|
408 |
+
inst.selection.moveToBookmark(i);
|
409 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
410 |
+
tinyMCEPopup.close();
|
411 |
+
return;
|
412 |
+
}
|
413 |
+
|
414 |
+
// Create new anchor elements
|
415 |
+
if (elm == null) {
|
416 |
+
inst.getDoc().execCommand("unlink", false, null);
|
417 |
+
tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
|
418 |
+
|
419 |
+
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
420 |
+
for (i=0; i<elementArray.length; i++)
|
421 |
+
setAllAttribs(elm = elementArray[i]);
|
422 |
+
} else
|
423 |
+
setAllAttribs(elm);
|
424 |
+
|
425 |
+
// Don't move caret if selection was image
|
426 |
+
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
|
427 |
+
inst.focus();
|
428 |
+
inst.selection.select(elm);
|
429 |
+
inst.selection.collapse(0);
|
430 |
+
tinyMCEPopup.storeSelection();
|
431 |
+
}
|
432 |
+
|
433 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
434 |
+
tinyMCEPopup.close();
|
435 |
+
}
|
436 |
+
|
437 |
+
function setAllAttribs(elm) {
|
438 |
+
var formObj = document.forms[0];
|
439 |
+
var href = formObj.href.value.replace(/ /g, '%20');
|
440 |
+
var target = getSelectValue(formObj, 'targetlist');
|
441 |
+
|
442 |
+
setAttrib(elm, 'href', href);
|
443 |
+
setAttrib(elm, 'title');
|
444 |
+
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
445 |
+
setAttrib(elm, 'id');
|
446 |
+
setAttrib(elm, 'style');
|
447 |
+
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
448 |
+
setAttrib(elm, 'rel');
|
449 |
+
setAttrib(elm, 'rev');
|
450 |
+
setAttrib(elm, 'charset');
|
451 |
+
setAttrib(elm, 'hreflang');
|
452 |
+
setAttrib(elm, 'dir');
|
453 |
+
setAttrib(elm, 'lang');
|
454 |
+
setAttrib(elm, 'tabindex');
|
455 |
+
setAttrib(elm, 'accesskey');
|
456 |
+
setAttrib(elm, 'type');
|
457 |
+
setAttrib(elm, 'onfocus');
|
458 |
+
setAttrib(elm, 'onblur');
|
459 |
+
setAttrib(elm, 'onclick');
|
460 |
+
setAttrib(elm, 'ondblclick');
|
461 |
+
setAttrib(elm, 'onmousedown');
|
462 |
+
setAttrib(elm, 'onmouseup');
|
463 |
+
setAttrib(elm, 'onmouseover');
|
464 |
+
setAttrib(elm, 'onmousemove');
|
465 |
+
setAttrib(elm, 'onmouseout');
|
466 |
+
setAttrib(elm, 'onkeypress');
|
467 |
+
setAttrib(elm, 'onkeydown');
|
468 |
+
setAttrib(elm, 'onkeyup');
|
469 |
+
|
470 |
+
// Refresh in old MSIE
|
471 |
+
if (tinyMCE.isMSIE5)
|
472 |
+
elm.outerHTML = elm.outerHTML;
|
473 |
+
}
|
474 |
+
|
475 |
+
function getSelectValue(form_obj, field_name) {
|
476 |
+
var elm = form_obj.elements[field_name];
|
477 |
+
|
478 |
+
if (!elm || elm.options == null || elm.selectedIndex == -1)
|
479 |
+
return "";
|
480 |
+
|
481 |
+
return elm.options[elm.selectedIndex].value;
|
482 |
+
}
|
483 |
+
|
484 |
+
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
485 |
+
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
486 |
+
return "";
|
487 |
+
|
488 |
+
var html = "";
|
489 |
+
|
490 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
491 |
+
html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';
|
492 |
+
html += 'this.options[this.selectedIndex].value;';
|
493 |
+
|
494 |
+
if (typeof(onchange_func) != "undefined")
|
495 |
+
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
496 |
+
|
497 |
+
html += '"><option value="">---</option>';
|
498 |
+
|
499 |
+
for (var i=0; i<tinyMCELinkList.length; i++)
|
500 |
+
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
501 |
+
|
502 |
+
html += '</select>';
|
503 |
+
|
504 |
+
return html;
|
505 |
+
|
506 |
+
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
507 |
+
}
|
508 |
+
|
509 |
+
function getTargetListHTML(elm_id, target_form_element) {
|
510 |
+
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
|
511 |
+
var html = '';
|
512 |
+
|
513 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';
|
514 |
+
html += 'this.options[this.selectedIndex].value;">';
|
515 |
+
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
|
516 |
+
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
|
517 |
+
html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
|
518 |
+
html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
|
519 |
+
|
520 |
+
for (var i=0; i<targets.length; i++) {
|
521 |
+
var key, value;
|
522 |
+
|
523 |
+
if (targets[i] == "")
|
524 |
+
continue;
|
525 |
+
|
526 |
+
key = targets[i].split('=')[0];
|
527 |
+
value = targets[i].split('=')[1];
|
528 |
+
|
529 |
+
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
530 |
+
}
|
531 |
+
|
532 |
+
html += '</select>';
|
533 |
+
|
534 |
+
return html;
|
535 |
+
}
|
536 |
+
|
537 |
+
// While loading
|
538 |
+
preinit();
|
539 |
+
tinyMCEPopup.onInit.add(init);
|
addons/advlink/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/advlink/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"});
|
addons/advlink/link.htm
ADDED
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advlink_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="../../tinymce/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="js/advlink.js"></script>
|
10 |
+
<link href="css/advlink.css" rel="stylesheet" type="text/css" />
|
11 |
+
</head>
|
12 |
+
<body id="advlink" style="display: none" role="application" onload="javascript:mcTabs.displayTab('general_tab','general_panel', true);" aria-labelledby="app_label">
|
13 |
+
<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advlink_dlg.title}</span>
|
14 |
+
<form onsubmit="insertAction();return false;" action="#">
|
15 |
+
<div class="tabs" role="presentation">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel" ><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
|
18 |
+
<li id="popup_tab" aria-controls="popup_panel" ><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
|
19 |
+
<li id="events_tab" aria-controls="events_panel"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
|
20 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="panel_wrapper" role="presentation">
|
25 |
+
<div id="general_panel" class="panel current">
|
26 |
+
<fieldset>
|
27 |
+
<legend>{#advlink_dlg.general_props}</legend>
|
28 |
+
|
29 |
+
<table border="0" cellpadding="4" cellspacing="0" role="presentation">
|
30 |
+
<tr>
|
31 |
+
<td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
|
32 |
+
<td><table border="0" cellspacing="0" cellpadding="0">
|
33 |
+
<tr>
|
34 |
+
<td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" aria-required="true" /></td>
|
35 |
+
<td id="hrefbrowsercontainer"> </td>
|
36 |
+
</tr>
|
37 |
+
</table></td>
|
38 |
+
</tr>
|
39 |
+
<tr id="linklisthrefrow">
|
40 |
+
<td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
|
41 |
+
<td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>
|
42 |
+
</tr>
|
43 |
+
<tr id="anchorlistrow">
|
44 |
+
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
|
45 |
+
<td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
|
49 |
+
<td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
|
53 |
+
<td><input id="title" name="title" type="text" value="" /></td>
|
54 |
+
</tr>
|
55 |
+
<tr>
|
56 |
+
<td><label id="classlabel" for="classlist">{#class_name}</label></td>
|
57 |
+
<td>
|
58 |
+
<select id="classlist" name="classlist" onchange="changeClass();">
|
59 |
+
<option value="" selected="selected">{#not_set}</option>
|
60 |
+
</select>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
</fieldset>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div id="popup_panel" class="panel">
|
68 |
+
<fieldset>
|
69 |
+
<legend>{#advlink_dlg.popup_props}</legend>
|
70 |
+
|
71 |
+
<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
|
72 |
+
<label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
|
73 |
+
|
74 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
75 |
+
<tr>
|
76 |
+
<td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td>
|
77 |
+
<td>
|
78 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
79 |
+
<tr>
|
80 |
+
<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
|
81 |
+
<td id="popupurlbrowsercontainer"> </td>
|
82 |
+
</tr>
|
83 |
+
</table>
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
<tr>
|
87 |
+
<td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td>
|
88 |
+
<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
|
89 |
+
</tr>
|
90 |
+
<tr role="group" aria-labelledby="popup_size_label">
|
91 |
+
<td class="nowrap"><label id="popup_size_label">{#advlink_dlg.popup_size}</label> </td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advlink_dlg.width}</span>
|
94 |
+
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advlink_dlg.height}</span>
|
96 |
+
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
<tr role="group" aria-labelledby="popup_position_label center_hint">
|
100 |
+
<td class="nowrap" id="labelleft"><label id="popup_position_label">{#advlink_dlg.popup_position}</label> </td>
|
101 |
+
<td class="nowrap">
|
102 |
+
<span style="display:none" id="x_voiceLabel">X</span>
|
103 |
+
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" aria-labelledby="x_voiceLabel" /> /
|
104 |
+
<span style="display:none" id="y_voiceLabel">Y</span>
|
105 |
+
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" aria-labelledby="y_voiceLabel" /> <span id="center_hint">(c /c = center)</span>
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
</table>
|
109 |
+
|
110 |
+
<fieldset>
|
111 |
+
<legend>{#advlink_dlg.popup_opts}</legend>
|
112 |
+
|
113 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
114 |
+
<tr>
|
115 |
+
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
116 |
+
<td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
|
117 |
+
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
118 |
+
<td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
122 |
+
<td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
|
123 |
+
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
124 |
+
<td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
128 |
+
<td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
|
129 |
+
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
130 |
+
<td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
134 |
+
<td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
|
135 |
+
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
136 |
+
<td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
|
137 |
+
</tr>
|
138 |
+
</table>
|
139 |
+
</fieldset>
|
140 |
+
</fieldset>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div id="advanced_panel" class="panel">
|
144 |
+
<fieldset>
|
145 |
+
<legend>{#advlink_dlg.advanced_props}</legend>
|
146 |
+
|
147 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
148 |
+
<tr>
|
149 |
+
<td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
|
150 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
151 |
+
</tr>
|
152 |
+
|
153 |
+
<tr>
|
154 |
+
<td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
|
155 |
+
<td><input type="text" id="style" name="style" value="" /></td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
|
160 |
+
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
|
165 |
+
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
166 |
+
</tr>
|
167 |
+
|
168 |
+
<tr>
|
169 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
|
170 |
+
<td>
|
171 |
+
<select id="dir" name="dir">
|
172 |
+
<option value="">{#not_set}</option>
|
173 |
+
<option value="ltr">{#advlink_dlg.ltr}</option>
|
174 |
+
<option value="rtl">{#advlink_dlg.rtl}</option>
|
175 |
+
</select>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
|
179 |
+
<tr>
|
180 |
+
<td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
|
181 |
+
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<tr>
|
185 |
+
<td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
|
186 |
+
<td>
|
187 |
+
<input id="lang" name="lang" type="text" value="" />
|
188 |
+
</td>
|
189 |
+
</tr>
|
190 |
+
|
191 |
+
<tr>
|
192 |
+
<td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
|
193 |
+
<td><input type="text" id="charset" name="charset" value="" /></td>
|
194 |
+
</tr>
|
195 |
+
|
196 |
+
<tr>
|
197 |
+
<td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
|
198 |
+
<td><input type="text" id="type" name="type" value="" /></td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
|
203 |
+
<td><select id="rel" name="rel">
|
204 |
+
<option value="">{#not_set}</option>
|
205 |
+
<option value="lightbox">Lightbox</option>
|
206 |
+
<option value="alternate">Alternate</option>
|
207 |
+
<option value="designates">Designates</option>
|
208 |
+
<option value="stylesheet">Stylesheet</option>
|
209 |
+
<option value="start">Start</option>
|
210 |
+
<option value="next">Next</option>
|
211 |
+
<option value="prev">Prev</option>
|
212 |
+
<option value="contents">Contents</option>
|
213 |
+
<option value="index">Index</option>
|
214 |
+
<option value="glossary">Glossary</option>
|
215 |
+
<option value="copyright">Copyright</option>
|
216 |
+
<option value="chapter">Chapter</option>
|
217 |
+
<option value="subsection">Subsection</option>
|
218 |
+
<option value="appendix">Appendix</option>
|
219 |
+
<option value="help">Help</option>
|
220 |
+
<option value="bookmark">Bookmark</option>
|
221 |
+
<option value="nofollow">No Follow</option>
|
222 |
+
<option value="tag">Tag</option>
|
223 |
+
</select>
|
224 |
+
</td>
|
225 |
+
</tr>
|
226 |
+
|
227 |
+
<tr>
|
228 |
+
<td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
|
229 |
+
<td><select id="rev" name="rev">
|
230 |
+
<option value="">{#not_set}</option>
|
231 |
+
<option value="alternate">Alternate</option>
|
232 |
+
<option value="designates">Designates</option>
|
233 |
+
<option value="stylesheet">Stylesheet</option>
|
234 |
+
<option value="start">Start</option>
|
235 |
+
<option value="next">Next</option>
|
236 |
+
<option value="prev">Prev</option>
|
237 |
+
<option value="contents">Contents</option>
|
238 |
+
<option value="index">Index</option>
|
239 |
+
<option value="glossary">Glossary</option>
|
240 |
+
<option value="copyright">Copyright</option>
|
241 |
+
<option value="chapter">Chapter</option>
|
242 |
+
<option value="subsection">Subsection</option>
|
243 |
+
<option value="appendix">Appendix</option>
|
244 |
+
<option value="help">Help</option>
|
245 |
+
<option value="bookmark">Bookmark</option>
|
246 |
+
</select>
|
247 |
+
</td>
|
248 |
+
</tr>
|
249 |
+
|
250 |
+
<tr>
|
251 |
+
<td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
|
252 |
+
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
253 |
+
</tr>
|
254 |
+
|
255 |
+
<tr>
|
256 |
+
<td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
|
257 |
+
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
258 |
+
</tr>
|
259 |
+
</table>
|
260 |
+
</fieldset>
|
261 |
+
</div>
|
262 |
+
|
263 |
+
<div id="events_panel" class="panel">
|
264 |
+
<fieldset>
|
265 |
+
<legend>{#advlink_dlg.event_props}</legend>
|
266 |
+
|
267 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
268 |
+
<tr>
|
269 |
+
<td class="column1"><label for="onfocus">onfocus</label></td>
|
270 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
271 |
+
</tr>
|
272 |
+
|
273 |
+
<tr>
|
274 |
+
<td class="column1"><label for="onblur">onblur</label></td>
|
275 |
+
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
276 |
+
</tr>
|
277 |
+
|
278 |
+
<tr>
|
279 |
+
<td class="column1"><label for="onclick">onclick</label></td>
|
280 |
+
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
281 |
+
</tr>
|
282 |
+
|
283 |
+
<tr>
|
284 |
+
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
285 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
286 |
+
</tr>
|
287 |
+
|
288 |
+
<tr>
|
289 |
+
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
290 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
291 |
+
</tr>
|
292 |
+
|
293 |
+
<tr>
|
294 |
+
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
295 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
296 |
+
</tr>
|
297 |
+
|
298 |
+
<tr>
|
299 |
+
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
300 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
301 |
+
</tr>
|
302 |
+
|
303 |
+
<tr>
|
304 |
+
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
305 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
306 |
+
</tr>
|
307 |
+
|
308 |
+
<tr>
|
309 |
+
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
310 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
311 |
+
</tr>
|
312 |
+
|
313 |
+
<tr>
|
314 |
+
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
315 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
316 |
+
</tr>
|
317 |
+
|
318 |
+
<tr>
|
319 |
+
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
320 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
321 |
+
</tr>
|
322 |
+
|
323 |
+
<tr>
|
324 |
+
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
325 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
326 |
+
</tr>
|
327 |
+
</table>
|
328 |
+
</fieldset>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div class="mceActionPanel">
|
333 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
334 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
335 |
+
</div>
|
336 |
+
</form>
|
337 |
+
</body>
|
338 |
+
</html>
|
addons/advlist/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/advlist/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
|
addons/advlist/editor_plugin_src.js
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var each = tinymce.each;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.AdvListPlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
function buildFormats(str) {
|
21 |
+
var formats = [];
|
22 |
+
|
23 |
+
each(str.split(/,/), function(type) {
|
24 |
+
formats.push({
|
25 |
+
title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
|
26 |
+
styles : {
|
27 |
+
listStyleType : type == 'default' ? '' : type
|
28 |
+
}
|
29 |
+
});
|
30 |
+
});
|
31 |
+
|
32 |
+
return formats;
|
33 |
+
};
|
34 |
+
|
35 |
+
// Setup number formats from config or default
|
36 |
+
t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
|
37 |
+
t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
|
38 |
+
|
39 |
+
if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent))
|
40 |
+
t.isIE7 = true;
|
41 |
+
},
|
42 |
+
|
43 |
+
createControl: function(name, cm) {
|
44 |
+
var t = this, btn, format, editor = t.editor;
|
45 |
+
|
46 |
+
if (name == 'numlist' || name == 'bullist') {
|
47 |
+
// Default to first item if it's a default item
|
48 |
+
if (t[name][0].title == 'advlist.def')
|
49 |
+
format = t[name][0];
|
50 |
+
|
51 |
+
function hasFormat(node, format) {
|
52 |
+
var state = true;
|
53 |
+
|
54 |
+
each(format.styles, function(value, name) {
|
55 |
+
// Format doesn't match
|
56 |
+
if (editor.dom.getStyle(node, name) != value) {
|
57 |
+
state = false;
|
58 |
+
return false;
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
return state;
|
63 |
+
};
|
64 |
+
|
65 |
+
function applyListFormat() {
|
66 |
+
var list, dom = editor.dom, sel = editor.selection;
|
67 |
+
|
68 |
+
// Check for existing list element
|
69 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
70 |
+
|
71 |
+
// Switch/add list type if needed
|
72 |
+
if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
|
73 |
+
editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
74 |
+
|
75 |
+
// Append styles to new list element
|
76 |
+
if (format) {
|
77 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
78 |
+
if (list) {
|
79 |
+
dom.setStyles(list, format.styles);
|
80 |
+
list.removeAttribute('data-mce-style');
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
editor.focus();
|
85 |
+
};
|
86 |
+
|
87 |
+
btn = cm.createSplitButton(name, {
|
88 |
+
title : 'advanced.' + name + '_desc',
|
89 |
+
'class' : 'mce_' + name,
|
90 |
+
onclick : function() {
|
91 |
+
applyListFormat();
|
92 |
+
}
|
93 |
+
});
|
94 |
+
|
95 |
+
btn.onRenderMenu.add(function(btn, menu) {
|
96 |
+
menu.onHideMenu.add(function() {
|
97 |
+
if (t.bookmark) {
|
98 |
+
editor.selection.moveToBookmark(t.bookmark);
|
99 |
+
t.bookmark = 0;
|
100 |
+
}
|
101 |
+
});
|
102 |
+
|
103 |
+
menu.onShowMenu.add(function() {
|
104 |
+
var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList;
|
105 |
+
|
106 |
+
if (list || format) {
|
107 |
+
fmtList = t[name];
|
108 |
+
|
109 |
+
// Unselect existing items
|
110 |
+
each(menu.items, function(item) {
|
111 |
+
var state = true;
|
112 |
+
|
113 |
+
item.setSelected(0);
|
114 |
+
|
115 |
+
if (list && !item.isDisabled()) {
|
116 |
+
each(fmtList, function(fmt) {
|
117 |
+
if (fmt.id == item.id) {
|
118 |
+
if (!hasFormat(list, fmt)) {
|
119 |
+
state = false;
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
});
|
124 |
+
|
125 |
+
if (state)
|
126 |
+
item.setSelected(1);
|
127 |
+
}
|
128 |
+
});
|
129 |
+
|
130 |
+
// Select the current format
|
131 |
+
if (!list)
|
132 |
+
menu.items[format.id].setSelected(1);
|
133 |
+
}
|
134 |
+
|
135 |
+
editor.focus();
|
136 |
+
|
137 |
+
// IE looses it's selection so store it away and restore it later
|
138 |
+
if (tinymce.isIE) {
|
139 |
+
t.bookmark = editor.selection.getBookmark(1);
|
140 |
+
}
|
141 |
+
});
|
142 |
+
|
143 |
+
menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);
|
144 |
+
|
145 |
+
each(t[name], function(item) {
|
146 |
+
// IE<8 doesn't support lower-greek, skip it
|
147 |
+
if (t.isIE7 && item.styles.listStyleType == 'lower-greek')
|
148 |
+
return;
|
149 |
+
|
150 |
+
item.id = editor.dom.uniqueId();
|
151 |
+
|
152 |
+
menu.add({id : item.id, title : item.title, onclick : function() {
|
153 |
+
format = item;
|
154 |
+
applyListFormat();
|
155 |
+
}});
|
156 |
+
});
|
157 |
+
});
|
158 |
+
|
159 |
+
return btn;
|
160 |
+
}
|
161 |
+
},
|
162 |
+
|
163 |
+
getInfo : function() {
|
164 |
+
return {
|
165 |
+
longname : 'Advanced lists',
|
166 |
+
author : 'Moxiecode Systems AB',
|
167 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
168 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
|
169 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
170 |
+
};
|
171 |
+
}
|
172 |
+
});
|
173 |
+
|
174 |
+
// Register plugin
|
175 |
+
tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
|
176 |
+
})();
|
addons/clear/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.dev.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111050600000000" remote="130111050600000000" Dst="2" />
|
4 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186864369226653" remote="130186828200000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/clear/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="clear.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/clear/css/clear.css
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mceClear {
|
2 |
+
border: 0px;
|
3 |
+
border-top: 1px dotted #cccccc;
|
4 |
+
display: block;
|
5 |
+
width: 100%;
|
6 |
+
height: 12px;
|
7 |
+
margin-top: 15px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.mceClearleft {
|
11 |
+
background: #ffffff url(../images/clearleft.gif) no-repeat left top;
|
12 |
+
}
|
13 |
+
|
14 |
+
.mceClearright {
|
15 |
+
background: #ffffff url(../images/clearright.gif) no-repeat right top;
|
16 |
+
}
|
17 |
+
|
18 |
+
.mceClearboth {
|
19 |
+
background: #ffffff url(../images/clearboth.gif) no-repeat center top;
|
20 |
+
}
|
21 |
+
|
22 |
+
|
addons/clear/editor_plugin.dev.js
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
// Load plugin specific language pack
|
3 |
+
//tinymce.PluginManager.requireLangPack('clear');
|
4 |
+
|
5 |
+
tinymce.create('tinymce.plugins.Clear', {
|
6 |
+
/**
|
7 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
8 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
9 |
+
* of the editor instance to intercept that event.
|
10 |
+
*
|
11 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
12 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
13 |
+
*/
|
14 |
+
init : function(ed, url) {
|
15 |
+
|
16 |
+
ed.addButton('clearleft', {
|
17 |
+
/*title : 'clear.clearleft_desc',*/
|
18 |
+
title : ed.getLang('div.clearleft_desc'),
|
19 |
+
cmd : 'clearLeft',
|
20 |
+
image : url + '/images/clearleft_button.gif'
|
21 |
+
});
|
22 |
+
ed.addButton('clearright', {
|
23 |
+
/*title : 'clear.clearright_desc',*/
|
24 |
+
title : ed.getLang('div.clearright_desc'),
|
25 |
+
cmd : 'clearRight',
|
26 |
+
image : url + '/images/clearright_button.gif'
|
27 |
+
});
|
28 |
+
ed.addButton('clearboth', {
|
29 |
+
/*title : 'clear.clearboth_desc',*/
|
30 |
+
title : ed.getLang('div.clearboth_desc'),
|
31 |
+
cmd : 'clearBoth',
|
32 |
+
image : url + '/images/clearboth_button.gif'
|
33 |
+
});
|
34 |
+
|
35 |
+
var clearHTML = '<img src="' + url + '/images/trans.gif" style="clear:$1;" class="mceClear mceClear$1 mceItemNoResize" title="'+ed.getLang('clear.clear_alt')+'" />';
|
36 |
+
var insertClear = function(clear){
|
37 |
+
var html = clearHTML.replace(/\$1/g, clear);
|
38 |
+
ed.execCommand('mceInsertContent', false, html);
|
39 |
+
// ed.selection.setContent('');
|
40 |
+
};
|
41 |
+
|
42 |
+
ed.addCommand('clearLeft', function(){ insertClear('left'); });
|
43 |
+
ed.addCommand('clearRight', function(){ insertClear('right'); });
|
44 |
+
ed.addCommand('clearBoth', function(){ insertClear('both'); });
|
45 |
+
|
46 |
+
// Set active buttons if user selected pagebreak or more break
|
47 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
48 |
+
cm.setActive('clearleft', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearleft'));
|
49 |
+
cm.setActive('clearright', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearright'));
|
50 |
+
cm.setActive('clearboth', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearboth'));
|
51 |
+
});
|
52 |
+
|
53 |
+
// Load plugin specific CSS into editor
|
54 |
+
ed.onInit.add(function() {
|
55 |
+
ed.dom.loadCSS(url + '/css/clear.css');
|
56 |
+
});
|
57 |
+
|
58 |
+
// Display clear instead if img in element path
|
59 |
+
ed.onPostRender.add(function() {
|
60 |
+
if (ed.theme.onResolveName) {
|
61 |
+
ed.theme.onResolveName.add(function(th, o) {
|
62 |
+
if (o.node.nodeName == 'IMG') {
|
63 |
+
if ( ed.dom.hasClass(o.node, 'mceClearleft') )
|
64 |
+
o.name = 'clear.left';
|
65 |
+
else if ( ed.dom.hasClass(o.node, 'mceClearright') )
|
66 |
+
o.name = 'clear.right';
|
67 |
+
else if ( ed.dom.hasClass(o.node, 'mceClearboth') )
|
68 |
+
o.name = 'clear.both';
|
69 |
+
}
|
70 |
+
});
|
71 |
+
}
|
72 |
+
});
|
73 |
+
|
74 |
+
// Replace clear with images
|
75 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
76 |
+
o.content = o.content.replace(/<div clear=" *([^" ]+) *"><\/div>/g, clearHTML);
|
77 |
+
o.content = o.content.replace(/<div style="clear: *([^"; ]+) *;?"><\/div>/g, clearHTML);
|
78 |
+
});
|
79 |
+
|
80 |
+
// Replace images with clear
|
81 |
+
ed.onPostProcess.add(function(ed, o) {
|
82 |
+
if (o.get){
|
83 |
+
o.content = o.content.replace(/<img[^>]+>/g, function(html) {
|
84 |
+
if (html.indexOf('class="mceClear') !== -1) {
|
85 |
+
var m, clear = (m = html.match(/mceClear([a-z]+)/)) ? m[1] : '';
|
86 |
+
html = '<div style="clear:'+clear+';"></div>';
|
87 |
+
}
|
88 |
+
return html;
|
89 |
+
});
|
90 |
+
}
|
91 |
+
});
|
92 |
+
},
|
93 |
+
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Creates control instances based in the incomming name. This method is normally not
|
97 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
98 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
99 |
+
* method can be used to create those.
|
100 |
+
*
|
101 |
+
* @param {String} n Name of the control to create.
|
102 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
103 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
104 |
+
*/
|
105 |
+
createControl : function(n, cm) {
|
106 |
+
return null;
|
107 |
+
},
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Returns information about the plugin as a name/value array.
|
111 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
112 |
+
*
|
113 |
+
* @return {Object} Name/value array containing information about the plugin.
|
114 |
+
*/
|
115 |
+
getInfo : function() {
|
116 |
+
return {
|
117 |
+
longname : 'Clear',
|
118 |
+
author : 'Miguel Ibero',
|
119 |
+
authorurl : 'http://www.peix.org',
|
120 |
+
infourl : 'http://www.peix.org/code',
|
121 |
+
version : "1.0"
|
122 |
+
};
|
123 |
+
}
|
124 |
+
});
|
125 |
+
|
126 |
+
// Register plugin
|
127 |
+
tinymce.PluginManager.add('clear', tinymce.plugins.Clear);
|
128 |
+
})();
|
129 |
+
|
addons/clear/editor_plugin.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function () {
|
3 |
+
//tinymce.PluginManager.requireLangPack('clear');
|
4 |
+
tinymce.create('tinymce.plugins.Clear', {
|
5 |
+
init: function (ed, url) {
|
6 |
+
ed.addButton('clearleft', {
|
7 |
+
/*title : 'clear.clearleft_desc',*/
|
8 |
+
title : ed.getLang('div.clearleft_desc'),
|
9 |
+
cmd: 'clearLeft',
|
10 |
+
//image: url + '/images/clearleft_button.gif'
|
11 |
+
});
|
12 |
+
ed.addButton('clearright', {
|
13 |
+
/*title : 'clear.clearright_desc',*/
|
14 |
+
title : ed.getLang('div.clearright_desc'),
|
15 |
+
cmd: 'clearRight',
|
16 |
+
//image: url + '/images/clearright_button.gif'
|
17 |
+
});
|
18 |
+
ed.addButton('clearboth', {
|
19 |
+
/*title : 'clear.clearboth_desc',*/
|
20 |
+
title : ed.getLang('div.clearboth_desc'),
|
21 |
+
cmd: 'clearBoth',
|
22 |
+
//image: url + '/images/clearboth_button.gif'
|
23 |
+
});
|
24 |
+
var clearHTML = '<img src="' + url + '/images/trans.gif" style="clear:$1;" class="mceClear mceClear$1 mceItemNoResize" title="' + ed.getLang('clear.clear_alt') + '" />';
|
25 |
+
var insertClear = function (clear) {
|
26 |
+
var html = clearHTML.replace(/\$1/g, clear);
|
27 |
+
ed.execCommand('mceInsertContent', false, html);
|
28 |
+
};
|
29 |
+
ed.addCommand('clearLeft', function () {
|
30 |
+
insertClear('left');
|
31 |
+
});
|
32 |
+
ed.addCommand('clearRight', function () {
|
33 |
+
insertClear('right');
|
34 |
+
});
|
35 |
+
ed.addCommand('clearBoth', function () {
|
36 |
+
insertClear('both');
|
37 |
+
});
|
38 |
+
ed.onNodeChange.add(function (ed, cm, n) {
|
39 |
+
cm.setActive('clearleft', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearleft'));
|
40 |
+
cm.setActive('clearright', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearright'));
|
41 |
+
cm.setActive('clearboth', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceClearboth'));
|
42 |
+
});
|
43 |
+
ed.onInit.add(function () {
|
44 |
+
ed.dom.loadCSS(url + '/css/clear.css');
|
45 |
+
});
|
46 |
+
ed.onPostRender.add(function () {
|
47 |
+
if (ed.theme.onResolveName) {
|
48 |
+
ed.theme.onResolveName.add(function (th, o) {
|
49 |
+
if (o.node.nodeName == 'IMG') {
|
50 |
+
if (ed.dom.hasClass(o.node, 'mceClearleft')) o.name = 'clear.left';
|
51 |
+
else if (ed.dom.hasClass(o.node, 'mceClearright')) o.name = 'clear.right';
|
52 |
+
else if (ed.dom.hasClass(o.node, 'mceClearboth')) o.name = 'clear.both';
|
53 |
+
}
|
54 |
+
});
|
55 |
+
}
|
56 |
+
});
|
57 |
+
ed.onBeforeSetContent.add(function (ed, o) {
|
58 |
+
o.content = o.content.replace(/<div clear=" *([^" ]+) *"><\/div>/g, clearHTML);
|
59 |
+
o.content = o.content.replace(/<div style="clear: *([^"; ]+) *;?"><\/div>/g, clearHTML);
|
60 |
+
});
|
61 |
+
ed.onPostProcess.add(function (ed, o) {
|
62 |
+
if (o.get) o.content = o.content.replace(/<img[^>]+>/g, function (html) {
|
63 |
+
if (html.indexOf('class="mceClear') !== -1) {
|
64 |
+
var m, clear = (m = html.match(/mceClear([a-z]+)/)) ? m[1] : '';
|
65 |
+
html = '<div style="clear:' + clear + ';"></div>';
|
66 |
+
}
|
67 |
+
return html;
|
68 |
+
});
|
69 |
+
});
|
70 |
+
},
|
71 |
+
createControl: function (n, cm) {
|
72 |
+
return null;
|
73 |
+
},
|
74 |
+
getInfo: function () {
|
75 |
+
return {
|
76 |
+
longname: 'Clear',
|
77 |
+
author: 'Miguel Ibero',
|
78 |
+
authorurl: 'http://www.peix.org',
|
79 |
+
infourl: 'http://www.peix.org/code',
|
80 |
+
version: "1.0"
|
81 |
+
};
|
82 |
+
}
|
83 |
+
});
|
84 |
+
tinymce.PluginManager.add('clear', tinymce.plugins.Clear);
|
85 |
+
})();
|
addons/clear/editor_plugin.js.LCK
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Josh Lobe||joshlobe@joshlobe.com
|
addons/clear/images/Thumbs.db
ADDED
Binary file
|
addons/clear/images/_notes/dwsync.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="clearboth.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="clearboth_button.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="clearleft.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="clearleft_button.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="clearright.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="clearright_button.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="trans.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
</dwsync>
|
addons/clear/images/clearboth.gif
ADDED
Binary file
|
addons/clear/images/clearboth_button.gif
ADDED
Binary file
|
addons/clear/images/clearleft.gif
ADDED
Binary file
|
addons/clear/images/clearleft_button.gif
ADDED
Binary file
|
addons/clear/images/clearright.gif
ADDED
Binary file
|
addons/clear/images/clearright_button.gif
ADDED
Binary file
|
addons/clear/images/trans.gif
ADDED
Binary file
|
addons/clear/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="es.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/clear/langs/en.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.clear',{
|
2 |
+
clearleft_desc:"Div Clear left",
|
3 |
+
clearright_desc:"Div Clear right",
|
4 |
+
clearboth_desc:"Div Clear both",
|
5 |
+
clear_alt:"Div Clear"
|
6 |
+
});
|
addons/clear/langs/es.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('es.clear',{
|
2 |
+
clearleft_desc:"Salir de flotante izquierdo",
|
3 |
+
clearright_desc:"Salir de flotante derecho",
|
4 |
+
clearboth_desc:"Salir de ambos flotantes",
|
5 |
+
clear_alt:"Salir de flotante"
|
6 |
+
});
|
addons/clker/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="dialog.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186889529113982" remote="130186853400000000" Dst="2" />
|
5 |
+
<file name="search.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/clker/dialog.htm
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>Clker.com - The online royalty free public domain clip art</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/dialog.js"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<form onsubmit="ClkerDialog.search();return false;" action="#">
|
10 |
+
<table width='100%'>
|
11 |
+
<tr>
|
12 |
+
<td valign='middle'>
|
13 |
+
<input type="text" style='font-size:1.5em' id="search" size='30' name="searchtext"/>
|
14 |
+
</td>
|
15 |
+
<td valign='middle'>
|
16 |
+
<div class="mceActionPanel">
|
17 |
+
<input type="button" id="insert" name="searchbut" value="Search" onclick="ClkerDialog.search();" />
|
18 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
19 |
+
</div>
|
20 |
+
</td>
|
21 |
+
<td valign='middle'>
|
22 |
+
<a href='http://www.clker.com' target='_blank'>Clker.com
|
23 |
+
plugin, V1.0</a>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
</table>
|
27 |
+
</form>
|
28 |
+
|
29 |
+
<div id='results'>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
</body>
|
33 |
+
</html>
|
addons/clker/editor_plugin.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
(function() {
|
9 |
+
// Load plugin specific language pack
|
10 |
+
//tinymce.PluginManager.requireLangPack('clker');
|
11 |
+
|
12 |
+
tinymce.create('tinymce.plugins.clkerPlugin', {
|
13 |
+
/**
|
14 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
15 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
16 |
+
* of the editor instance to intercept that event.
|
17 |
+
*
|
18 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
19 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
20 |
+
*/
|
21 |
+
init : function(ed, url) {
|
22 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
23 |
+
ed.addCommand('mceclker', function() {
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : url + '/dialog.htm',
|
26 |
+
width : 700 + parseInt(ed.getLang('clker.delta_width', 0)),
|
27 |
+
height : 450 + parseInt(ed.getLang('clker.delta_height', 0)),
|
28 |
+
inline : 1
|
29 |
+
}, {
|
30 |
+
plugin_url : url, // Plugin absolute URL
|
31 |
+
some_custom_arg : 'custom arg' // Custom argument
|
32 |
+
});
|
33 |
+
});
|
34 |
+
|
35 |
+
// Register clker button
|
36 |
+
ed.addButton('clker', {
|
37 |
+
/*title : 'Clker ClipArt Gallery',*/
|
38 |
+
|
39 |
+
title: ed.getLang('clker.gallery'),
|
40 |
+
cmd : 'mceclker',
|
41 |
+
//image : url + '/img/clker.gif'
|
42 |
+
});
|
43 |
+
|
44 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
45 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
46 |
+
cm.setActive('clker', n.nodeName == 'IMG');
|
47 |
+
});
|
48 |
+
},
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Creates control instances based in the incomming name. This method is normally not
|
52 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
53 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
54 |
+
* method can be used to create those.
|
55 |
+
*
|
56 |
+
* @param {String} n Name of the control to create.
|
57 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
58 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
59 |
+
*/
|
60 |
+
createControl : function(n, cm) {
|
61 |
+
return null;
|
62 |
+
},
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns information about the plugin as a name/value array.
|
66 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
67 |
+
*
|
68 |
+
* @return {Object} Name/value array containing information about the plugin.
|
69 |
+
*/
|
70 |
+
getInfo : function() {
|
71 |
+
return {
|
72 |
+
longname : 'clker plugin',
|
73 |
+
author : 'Mohamed Ibrahim',
|
74 |
+
authorurl : 'http://www.clker.com',
|
75 |
+
infourl : 'http://www.clker.com/clkerplugin',
|
76 |
+
version : "1.0"
|
77 |
+
};
|
78 |
+
}
|
79 |
+
});
|
80 |
+
|
81 |
+
// Register plugin
|
82 |
+
tinymce.PluginManager.add('clker', tinymce.plugins.clkerPlugin);
|
83 |
+
})();
|
addons/clker/img/Thumbs.db
ADDED
Binary file
|
addons/clker/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="before.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="clker.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="clker.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="end.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="next.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="start.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
</dwsync>
|
addons/clker/img/before.png
ADDED
Binary file
|
addons/clker/img/clker.gif
ADDED
Binary file
|
addons/clker/img/clker.png
ADDED
Binary file
|
addons/clker/img/end.png
ADDED
Binary file
|
addons/clker/img/next.png
ADDED
Binary file
|
addons/clker/img/start.png
ADDED
Binary file
|
addons/clker/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="dialog.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130120389600000000" remote="130120389600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/clker/js/dialog.js
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function GetAJAXObject()
|
2 |
+
{
|
3 |
+
var xmlHttp;
|
4 |
+
try {
|
5 |
+
// Firefox, Opera 8.0+, Safari
|
6 |
+
xmlHttp=new XMLHttpRequest();
|
7 |
+
} catch (e) {
|
8 |
+
// Internet Explorer
|
9 |
+
try {
|
10 |
+
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
|
11 |
+
} catch (e) {
|
12 |
+
try{
|
13 |
+
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
|
14 |
+
} catch (e) {
|
15 |
+
alert("Your browser does not support AJAX!");
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
return xmlHttp;
|
21 |
+
}
|
22 |
+
|
23 |
+
tinyMCEPopup.requireLangPack();
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
* Base64 encode / decode
|
28 |
+
* http://www.webtoolkit.info/
|
29 |
+
*
|
30 |
+
**/
|
31 |
+
|
32 |
+
var Base64 = {
|
33 |
+
|
34 |
+
// private property
|
35 |
+
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
36 |
+
|
37 |
+
// public method for encoding
|
38 |
+
encode : function (input) {
|
39 |
+
var output = "";
|
40 |
+
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
41 |
+
var i = 0;
|
42 |
+
|
43 |
+
input = Base64._utf8_encode(input);
|
44 |
+
|
45 |
+
while (i < input.length) {
|
46 |
+
|
47 |
+
chr1 = input.charCodeAt(i++);
|
48 |
+
chr2 = input.charCodeAt(i++);
|
49 |
+
chr3 = input.charCodeAt(i++);
|
50 |
+
|
51 |
+
enc1 = chr1 >> 2;
|
52 |
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
53 |
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
54 |
+
enc4 = chr3 & 63;
|
55 |
+
|
56 |
+
if (isNaN(chr2)) {
|
57 |
+
enc3 = enc4 = 64;
|
58 |
+
} else if (isNaN(chr3)) {
|
59 |
+
enc4 = 64;
|
60 |
+
}
|
61 |
+
|
62 |
+
output = output +
|
63 |
+
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
64 |
+
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
return output;
|
69 |
+
},
|
70 |
+
|
71 |
+
// public method for decoding
|
72 |
+
decode : function (input) {
|
73 |
+
var output = "";
|
74 |
+
var chr1, chr2, chr3;
|
75 |
+
var enc1, enc2, enc3, enc4;
|
76 |
+
var i = 0;
|
77 |
+
|
78 |
+
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
79 |
+
|
80 |
+
while (i < input.length) {
|
81 |
+
|
82 |
+
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
83 |
+
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
84 |
+
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
85 |
+
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
86 |
+
|
87 |
+
chr1 = (enc1 << 2) | (enc2 >> 4);
|
88 |
+
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
89 |
+
chr3 = ((enc3 & 3) << 6) | enc4;
|
90 |
+
|
91 |
+
output = output + String.fromCharCode(chr1);
|
92 |
+
|
93 |
+
if (enc3 != 64) {
|
94 |
+
output = output + String.fromCharCode(chr2);
|
95 |
+
}
|
96 |
+
if (enc4 != 64) {
|
97 |
+
output = output + String.fromCharCode(chr3);
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
|
102 |
+
output = Base64._utf8_decode(output);
|
103 |
+
|
104 |
+
return output;
|
105 |
+
|
106 |
+
},
|
107 |
+
|
108 |
+
// private method for UTF-8 encoding
|
109 |
+
_utf8_encode : function (string) {
|
110 |
+
string = string.replace(/\r\n/g,"\n");
|
111 |
+
var utftext = "";
|
112 |
+
|
113 |
+
for (var n = 0; n < string.length; n++) {
|
114 |
+
|
115 |
+
var c = string.charCodeAt(n);
|
116 |
+
|
117 |
+
if (c < 128) {
|
118 |
+
utftext += String.fromCharCode(c);
|
119 |
+
}
|
120 |
+
else if((c > 127) && (c < 2048)) {
|
121 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
122 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
123 |
+
}
|
124 |
+
else {
|
125 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
126 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
127 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
128 |
+
}
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
return utftext;
|
133 |
+
},
|
134 |
+
|
135 |
+
// private method for UTF-8 decoding
|
136 |
+
_utf8_decode : function (utftext) {
|
137 |
+
var string = "";
|
138 |
+
var i = 0;
|
139 |
+
var c = c1 = c2 = 0;
|
140 |
+
|
141 |
+
while ( i < utftext.length ) {
|
142 |
+
|
143 |
+
c = utftext.charCodeAt(i);
|
144 |
+
|
145 |
+
if (c < 128) {
|
146 |
+
string += String.fromCharCode(c);
|
147 |
+
i++;
|
148 |
+
}
|
149 |
+
else if((c > 191) && (c < 224)) {
|
150 |
+
c2 = utftext.charCodeAt(i+1);
|
151 |
+
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
152 |
+
i += 2;
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
c2 = utftext.charCodeAt(i+1);
|
156 |
+
c3 = utftext.charCodeAt(i+2);
|
157 |
+
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
158 |
+
i += 3;
|
159 |
+
}
|
160 |
+
|
161 |
+
}
|
162 |
+
|
163 |
+
return string;
|
164 |
+
}
|
165 |
+
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
+
var page=1;
|
170 |
+
var pages=0;
|
171 |
+
|
172 |
+
var ClkerDialog = {
|
173 |
+
init : function() {
|
174 |
+
var f = document.forms[0];
|
175 |
+
|
176 |
+
// Get the selected contents as text and place it in the input
|
177 |
+
//f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
|
178 |
+
//f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
|
179 |
+
},
|
180 |
+
|
181 |
+
inserturl : function(url){
|
182 |
+
tinyMCEPopup.editor.execCommand('mceInsertContent', false, Base64.decode(url));
|
183 |
+
tinyMCEPopup.close();
|
184 |
+
},
|
185 |
+
|
186 |
+
insert : function() {
|
187 |
+
// Insert the contents from the input into the document
|
188 |
+
tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
|
189 |
+
tinyMCEPopup.close();
|
190 |
+
},
|
191 |
+
|
192 |
+
gotostart : function() {
|
193 |
+
page=1;
|
194 |
+
this.search();
|
195 |
+
},
|
196 |
+
|
197 |
+
gotobefore : function() {
|
198 |
+
page-=1;
|
199 |
+
if (page<1) page=1;
|
200 |
+
this.search();
|
201 |
+
},
|
202 |
+
|
203 |
+
gotonext : function() {
|
204 |
+
page+=1;
|
205 |
+
if (page>pages) page=pages;
|
206 |
+
this.search();
|
207 |
+
},
|
208 |
+
|
209 |
+
gotoend : function() {
|
210 |
+
page=pages;
|
211 |
+
this.search();
|
212 |
+
},
|
213 |
+
|
214 |
+
search : function() {
|
215 |
+
var myxmlHttp=GetAJAXObject();
|
216 |
+
|
217 |
+
myxmlHttp.onreadystatechange=function(){
|
218 |
+
var el=document.getElementById("results");
|
219 |
+
|
220 |
+
if (myxmlHttp.readyState==4){
|
221 |
+
xml=myxmlHttp.responseText;
|
222 |
+
|
223 |
+
lines=xml.split("\n");
|
224 |
+
|
225 |
+
pages=lines[1]-0;
|
226 |
+
|
227 |
+
htres="<center><h2>"+lines[0]+" entries found</h2>";
|
228 |
+
htres+=" <table><tr>";
|
229 |
+
htres+=" <td><img src='img/start.png' style='cursor:pointer;' onclick='ClkerDialog.gotostart();'></td>";
|
230 |
+
htres+=" <td><img src='img/before.png' style='cursor:pointer;' onclick='ClkerDialog.gotobefore();'></td>";
|
231 |
+
htres+=" <td valign='center'><b>Page "+lines[2]+"/"+lines[1]+"</b></td>";
|
232 |
+
htres+=" <td><img src='img/next.png' style='cursor:pointer;' onclick='ClkerDialog.gotonext();'></td>";
|
233 |
+
htres+=" <td><img src='img/end.png' style='cursor:pointer;' onclick='ClkerDialog.gotoend();'></td>";
|
234 |
+
htres+=" </tr></table>";
|
235 |
+
htres+="</center>";
|
236 |
+
htres+="<br/><br/><style type='text/css'>.thumb{width:100px;} .thumb img{border:0px;} .thumb:hover{background: #ddddff;}</style>";
|
237 |
+
|
238 |
+
htres+="<center><table><tr>";
|
239 |
+
for(i=0;i<lines.length-3;++i){
|
240 |
+
if (lines[i+3].length<3) continue;
|
241 |
+
row=lines[i+3].split(",");
|
242 |
+
htres+="<td valign='bottom'>";
|
243 |
+
|
244 |
+
large="<a href='"+row[0]+"' target='_blank'><img style='border:0px;margin:5px;float:left;' src='"+row[2]+".hi.png' title='"+row[1]+"'/></a>";
|
245 |
+
large=Base64.encode(large);
|
246 |
+
med="<a href='"+row[0]+"' target='_blank'><img style='border:0px;margin:5px;float:left;' src='"+row[2]+".med.png' title='"+row[1]+"'/></a>";
|
247 |
+
med=Base64.encode(med);
|
248 |
+
small="<a href='"+row[0]+"' target='_blank'><img style='border:0px;margin:5px;float:left;' src='"+row[2]+".thumb.png' title='"+row[1]+"'/></a>";
|
249 |
+
small=Base64.encode(small);
|
250 |
+
|
251 |
+
htres+="<div class='thumb'><a href='javascript:void(0)' onclick='ClkerDialog.inserturl(\""+small+"\")'>";
|
252 |
+
htres+="<img src='"+row[2]+".thumb.png' title='"+row[1]+"'/></a>";
|
253 |
+
htres+="</div>";
|
254 |
+
|
255 |
+
htres+="<center><a href='javascript:void(0)' onclick='ClkerDialog.inserturl(\""+small+"\")'>Sml</a> ";
|
256 |
+
htres+="<a href='javascript:void(0)' onclick='ClkerDialog.inserturl(\""+med+"\")'>Med</a> ";
|
257 |
+
htres+="<a href='javascript:void(0)' onclick='ClkerDialog.inserturl(\""+large+"\")'>Lrg</a></center><br/><br/>";
|
258 |
+
htres+="</td>";
|
259 |
+
|
260 |
+
if ( (i+1)%6 ==0 ){
|
261 |
+
htres+="</tr><tr>";
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
htres+="</tr></table></center>";
|
266 |
+
|
267 |
+
el.innerHTML=htres;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
url="search.php?ps=12&page="+String(page)+"&words="+document.forms[0].searchtext.value;
|
272 |
+
myxmlHttp.open("GET",url,true);
|
273 |
+
myxmlHttp.send(null);
|
274 |
+
|
275 |
+
delete myxmlHttp;
|
276 |
+
}
|
277 |
+
};
|
278 |
+
|
279 |
+
tinyMCEPopup.onInit.add(ClkerDialog.init, ClkerDialog);
|
addons/clker/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/clker/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example',{
|
2 |
+
desc : 'This is just a template button'
|
3 |
+
});
|
addons/clker/langs/en_dlg.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example_dlg',{
|
2 |
+
title : 'clker.com - the online royalty free public domain clipart'
|
3 |
+
});
|
addons/clker/search.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?
|
2 |
+
$ps=($_GET[ps]+1)-1;
|
3 |
+
$page=($_GET[page]+1)-1;
|
4 |
+
$words=$_GET[words];
|
5 |
+
$Response=file_get_contents("http://www.clker.com/apis/tinymce.html?ps=$ps&page=$page&words=$words");
|
6 |
+
echo $Response;
|
7 |
+
?>
|
addons/codemagic/README.md
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
codemagic
|
2 |
+
=========
|
3 |
+
|
4 |
+
CodeMagic is an advanced source code editor plugin for Tinymce. It integrates the CodeMirror library for syntax coloring, and the JSBeautifier library for code formating and indentation.
|
addons/codemagic/_notes/dwsync.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="README.md" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
4 |
+
<file name="codemagic.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130112139000000000" remote="130112139000000000" Dst="2" />
|
5 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186906264405497" remote="130186870200000000" Dst="2" />
|
6 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186906132502798" remote="130186869600000000" Dst="2" />
|
7 |
+
<file name="licence.txt" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
8 |
+
</dwsync>
|
addons/codemagic/codemagic.htm
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{#codemagic_dlg.code_title}</title>
|
4 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
5 |
+
<script type="text/javascript" src="js/codemirror-compressed.js"></script>
|
6 |
+
<script type="text/javascript" src="js/codemagic.js"></script>
|
7 |
+
<script type="text/javascript" src="js/beautify.js"></script>
|
8 |
+
<script type="text/javascript" src="js/beautify-html.js"></script>
|
9 |
+
|
10 |
+
<link rel="stylesheet" media="all" type="text/css" href="css/style.css" />
|
11 |
+
<link rel="stylesheet" media="all" type="text/css" href="css/codemirror.css" />
|
12 |
+
<link rel="stylesheet" media="all" type="text/css" href="css/default.css" />
|
13 |
+
</head>
|
14 |
+
|
15 |
+
<body onResize="resizeInputs();" style="display: none; overflow: hidden;">
|
16 |
+
<form name="source" onSubmit="saveContent(); return false;" action="#">
|
17 |
+
<div style="float: left" class="title"><label for="htmlSource">{#codemagic_dlg.code_label}</label></div>
|
18 |
+
|
19 |
+
<div class="editor-buttons">
|
20 |
+
<a id="undo" class="disabled" href="javascript: void(0)" title="{#codemagic_dlg.undo}" onClick="undo();"><img src="img/icons/undo.png" alt="{#codemagic_dlg.undo}" /></a>
|
21 |
+
<a id="redo" class="disabled" href="javascript: void(0)" title="{#codemagic_dlg.redo}" onClick="redo();"><img src="img/icons/redo.png" alt="{#codemagic_dlg.redo}" /></a>
|
22 |
+
<a id="search_replace" href="javascript: void(0)" title="{#codemagic_dlg.search_replace}" onClick="toggleSearch(this, 'searchWindow');"><img src="img/icons/lens.png" alt="{#codemagic_dlg.search_replace}" /></a>
|
23 |
+
<a id="reintendt" href="javascript: void(0)" title="{#codemagic_dlg.reintendt}" onClick="reIntendt('htmlSource');"><img src="img/icons/file.png" alt="{#codemagic_dlg.reintendt}" /></a>
|
24 |
+
<div style="clear: both;"></div>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div id="wrapline" style="float: right">
|
28 |
+
<input type="checkbox" name="wraptext" id="wraptext" onClick="toggleWrapText(this);" class="wordWrapCode" checked="checked" /><label for="wraptext">{#codemagic_dlg.toggle_wraptext}</label>
|
29 |
+
<input type="checkbox" name="autocompletion" id="autocompletion" onClick="toggleAutocompletion(this);" class="wordWrapCode" checked="checked" /><label for="autocompletion">{#codemagic_dlg.toggle_autocompletion}</label>
|
30 |
+
<input type="checkbox" name="highlighting" id="highlighting" onClick="toggleHighlighting(this, 'htmlSource');" class="wordWrapCode" checked="checked" /><label for="highlighting">{#codemagic_dlg.toggle_highlighting}</label>
|
31 |
+
</div>
|
32 |
+
<div style="clear: both;"></div>
|
33 |
+
|
34 |
+
|
35 |
+
<div id="searchWindow" class="search-window" style="display: none;">
|
36 |
+
<h2>{#codemagic_dlg.search_replace}</h2>
|
37 |
+
<table>
|
38 |
+
<tr>
|
39 |
+
<td colspan="2"> </td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<td><label for="query">{#codemagic_dlg.search}</label>:</td>
|
43 |
+
<td><input id="query" type="text" style="width: 150px" /></td>
|
44 |
+
</tr>
|
45 |
+
<tr>
|
46 |
+
<td><label for="replace">{#codemagic_dlg.replace}</label>:</td>
|
47 |
+
<td><input id="replace" type="text" style="width: 150px" /></td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td colspan="2"> </td>
|
51 |
+
</tr>
|
52 |
+
<tr>
|
53 |
+
<td align="left"><input onClick="searchCode(); return false;" type="submit" value="{#codemagic_dlg.search}" class="button" style="float: none" /></td>
|
54 |
+
<td align="right"><input onClick="replaceCode(); return false;" type="submit" value="{#codemagic_dlg.replace}" class="button" style="float: none" /></td>
|
55 |
+
</tr>
|
56 |
+
</table>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" dir="ltr" class="htmlSource"></textarea>
|
60 |
+
|
61 |
+
<div class="mceActionPanel">
|
62 |
+
<input type="submit" role="button" name="insert" value="{#update}" id="insert" />
|
63 |
+
<input type="button" role="button" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" id="cancel" />
|
64 |
+
</div>
|
65 |
+
</form>
|
66 |
+
</body>
|
67 |
+
</html>
|
addons/codemagic/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="codemirror.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
4 |
+
<file name="default.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
5 |
+
<file name="style.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/codemagic/css/codemirror.css
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.CodeMirror {
|
2 |
+
overflow: auto;
|
3 |
+
height: 90%;
|
4 |
+
line-height: 14px;
|
5 |
+
font-size: 13px;
|
6 |
+
font-family: monospace;
|
7 |
+
background-color: #fff;
|
8 |
+
border:1px solid #abc6dd;
|
9 |
+
_position: relative; /* IE6 hack */
|
10 |
+
}
|
11 |
+
|
12 |
+
.CodeMirror-gutter {
|
13 |
+
position: absolute; left: 0; top: 0;
|
14 |
+
background-color: #f7f7f7;
|
15 |
+
border-right: 1px solid #eee;
|
16 |
+
min-width: 2em;
|
17 |
+
height: 100%;
|
18 |
+
}
|
19 |
+
.CodeMirror-gutter-text {
|
20 |
+
color: #aaa;
|
21 |
+
text-align: right;
|
22 |
+
padding: .4em .2em .4em .4em;
|
23 |
+
}
|
24 |
+
.CodeMirror-lines {
|
25 |
+
padding: .4em;
|
26 |
+
}
|
27 |
+
|
28 |
+
.CodeMirror pre {
|
29 |
+
-moz-border-radius: 0;
|
30 |
+
-webkit-border-radius: 0;
|
31 |
+
-o-border-radius: 0;
|
32 |
+
border-radius: 0;
|
33 |
+
border-width: 0; margin: 0; padding: 0; background: transparent;
|
34 |
+
font-family: inherit;
|
35 |
+
}
|
36 |
+
|
37 |
+
.CodeMirror pre.activeline {
|
38 |
+
background: none repeat scroll 0 0 #efefef !important;
|
39 |
+
}
|
40 |
+
|
41 |
+
.CodeMirror-cursor {
|
42 |
+
z-index: 10;
|
43 |
+
position: absolute;
|
44 |
+
visibility: hidden;
|
45 |
+
border-left: 1px solid black !important;
|
46 |
+
}
|
47 |
+
.CodeMirror-focused .CodeMirror-cursor {
|
48 |
+
visibility: visible;
|
49 |
+
}
|
50 |
+
|
51 |
+
span.CodeMirror-selected {
|
52 |
+
background: #ccc !important;
|
53 |
+
color: HighlightText !important;
|
54 |
+
}
|
55 |
+
.CodeMirror-focused span.CodeMirror-selected {
|
56 |
+
background: Highlight !important;
|
57 |
+
}
|
58 |
+
|
59 |
+
.CodeMirror-matchingbracket {color: #000 !important; background-color: #a0e0fc !important;}
|
60 |
+
.CodeMirror-nonmatchingbracket {color: #f22 !important;}
|
61 |
+
|
62 |
+
.CodeMirrorToolBar
|
63 |
+
{
|
64 |
+
border:1px solid #abc6dd;
|
65 |
+
border-bottom: 0;
|
66 |
+
background:#e5effd;
|
67 |
+
margin:0px;
|
68 |
+
padding:0;
|
69 |
+
}
|
70 |
+
.CMBtn
|
71 |
+
{
|
72 |
+
border:1px solid #b0c8e8;
|
73 |
+
background:#cadcf0;
|
74 |
+
font :700 10px verdana;
|
75 |
+
margin:5px;
|
76 |
+
border-radius: 2px;
|
77 |
+
-moz-border-radius: 2px;
|
78 |
+
-webkit-border-radius: 2px;
|
79 |
+
color: #6497d9;
|
80 |
+
}
|
81 |
+
|
82 |
+
.searched {
|
83 |
+
background-color: yellow;
|
84 |
+
}
|
85 |
+
|
86 |
+
.completions {
|
87 |
+
position: absolute;
|
88 |
+
border: 1px solid #000000;
|
89 |
+
background-color: #F0F0EE;
|
90 |
+
padding: 3px;
|
91 |
+
}
|
92 |
+
|
93 |
+
.completions select {
|
94 |
+
background-color: #FFFFFF;
|
95 |
+
border: 1px solid #B5A69C;
|
96 |
+
width: 200px;
|
97 |
+
height: 144px;
|
98 |
+
}
|
99 |
+
|
100 |
+
.wrapText {
|
101 |
+
word-wrap: break-word;
|
102 |
+
}
|
addons/codemagic/css/default.css
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
span.css-at {color: #0000ff;}
|
2 |
+
span.css-unit {color: #0000ff;}
|
3 |
+
span.css-value {color: #0000ff;}
|
4 |
+
span.css-identifier {color: #800000; font-weight: bold;}
|
5 |
+
span.css-selector {color: #ff00ff;}
|
6 |
+
span.css-important {color: #00F;}
|
7 |
+
span.css-colorcode {color: #0000ff;}
|
8 |
+
span.css-comment {color: gray;}
|
9 |
+
span.css-string {color: #008000;}
|
10 |
+
|
11 |
+
|
12 |
+
span.js-keyword {color: #000000; font-weight: bold;}
|
13 |
+
span.js-variable {color: #0000FF;}
|
14 |
+
span.js-property {color: #0000FF; font-weight: bold;}
|
15 |
+
span.js-atom {color: #ff0000;}
|
16 |
+
span.js-variabledef {color: #0000FF;}
|
17 |
+
span.js-localvariable {color: #0000FF;}
|
18 |
+
span.js-comment {color: #008000;}
|
19 |
+
span.js-string {color: #b70000;}
|
20 |
+
|
21 |
+
|
22 |
+
span.xml-tag {color: #800080; font-weight: bold;}
|
23 |
+
span.xml-attribute {color: #8080ff;}
|
24 |
+
span.xml-attname {color: #008080;}
|
25 |
+
span.xml-comment {color: #008000;}
|
26 |
+
span.xml-cdata {color: #48a;}
|
27 |
+
span.xml-processing {color: #999;}
|
28 |
+
span.xml-entity {color: #008000; font-weight: bold;}
|
addons/codemagic/css/style.css
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
a, img,
|
2 |
+
a img {
|
3 |
+
border: none;
|
4 |
+
}
|
5 |
+
|
6 |
+
.editor-buttons {
|
7 |
+
margin-left: -46px;
|
8 |
+
position: absolute;
|
9 |
+
left: 50%;
|
10 |
+
width: 95px;
|
11 |
+
top: 3px;
|
12 |
+
}
|
13 |
+
|
14 |
+
.editor-buttons a {
|
15 |
+
float: left;
|
16 |
+
display: block;
|
17 |
+
text-align: center;
|
18 |
+
width: 16px;
|
19 |
+
padding: 2px;
|
20 |
+
border: 1px solid #F0F0EE;
|
21 |
+
margin-right: 1px;
|
22 |
+
}
|
23 |
+
|
24 |
+
.editor-buttons a:hover,
|
25 |
+
.editor-buttons a.selected {
|
26 |
+
background-color: #C2CBE0;
|
27 |
+
border: 1px solid #0A246A;
|
28 |
+
}
|
29 |
+
|
30 |
+
.editor-buttons a.disabled,
|
31 |
+
.editor-buttons a.disabled:hover {
|
32 |
+
background-color: transparent;
|
33 |
+
border: 1px solid #F0F0EE;
|
34 |
+
cursor: default;
|
35 |
+
}
|
36 |
+
|
37 |
+
.editor-buttons a.disabled img {
|
38 |
+
opacity: .35;
|
39 |
+
filter: alpha(opacity=35);
|
40 |
+
-ms-filter: "alpha(opacity=35)";
|
41 |
+
}
|
42 |
+
|
43 |
+
.search-window {
|
44 |
+
background-color: #F0F0EE;
|
45 |
+
border: 1px solid #ABC6DD;
|
46 |
+
padding: 10px;
|
47 |
+
position: absolute;
|
48 |
+
right: -1px;
|
49 |
+
top: -1px;
|
50 |
+
z-index: 1000;
|
51 |
+
}
|
52 |
+
|
53 |
+
.htmlSource {
|
54 |
+
display: block;
|
55 |
+
width: 100%;
|
56 |
+
height: 100%;
|
57 |
+
font-family: 'Courier New', Courier, monospace;
|
58 |
+
font-size: 12px;
|
59 |
+
}
|
addons/codemagic/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){/*tinymce.PluginManager.requireLangPack('codemagic');*/tinymce.create('tinymce.plugins.CodeMagic',{init:function(ed,url){ed.addCommand('mceCodeMagic',function(){ed.windowManager.open({file:url+'/codemagic.htm',width:900,height:600,inline:1,maximizable:true},{plugin_url:url})});ed.addButton('codemagic',{title:ed.getLang('codemagic.editor_button'),cmd:'mceCodeMagic',/*image:url+'/img/code.png'*/});ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name)})},getInfo:function(){return{longname:'CodeMagic - syntax coloring and intendation',author:'Sutulustus',authorurl:'http://www.triad.sk/#/en',version:'0.9.5'}}});tinymce.PluginManager.add('codemagic',tinymce.plugins.CodeMagic)})();
|
addons/codemagic/editor_plugin_src.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2011, Sutulustus - Triad Advertising
|
5 |
+
* Released under MIT License.
|
6 |
+
*
|
7 |
+
* License: http://www.opensource.org/licenses/mit-license.php
|
8 |
+
*/
|
9 |
+
|
10 |
+
(function () {
|
11 |
+
//tinymce.PluginManager.requireLangPack('codemagic');
|
12 |
+
tinymce.create('tinymce.plugins.CodeMagic', {
|
13 |
+
|
14 |
+
init: function (ed, url) {
|
15 |
+
|
16 |
+
// Register commands
|
17 |
+
ed.addCommand('mceCodeMagic', function() {
|
18 |
+
ed.windowManager.open({
|
19 |
+
file : url + '/codemagic.htm',
|
20 |
+
width : 900,
|
21 |
+
height : 600,
|
22 |
+
inline : 1,
|
23 |
+
maximizable: true
|
24 |
+
}, {
|
25 |
+
plugin_url : url
|
26 |
+
});
|
27 |
+
});
|
28 |
+
|
29 |
+
// Register buttons
|
30 |
+
ed.addButton('codemagic', {
|
31 |
+
title: ed.getLang('codemagic.editor_button'),
|
32 |
+
cmd: 'mceCodeMagic',
|
33 |
+
//image: url + '/img/code.png'
|
34 |
+
});
|
35 |
+
|
36 |
+
ed.onNodeChange.add(function(ed, cm, n, co) {
|
37 |
+
cm.setDisabled('link', co && n.nodeName != 'A');
|
38 |
+
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
39 |
+
});
|
40 |
+
},
|
41 |
+
|
42 |
+
getInfo: function () {
|
43 |
+
return {
|
44 |
+
longname: 'CodeMagic - syntax coloring and intendation',
|
45 |
+
author: 'Sutulustus',
|
46 |
+
authorurl: 'http://www.triad.sk/#/en',
|
47 |
+
version: '0.9.5'
|
48 |
+
};
|
49 |
+
}
|
50 |
+
});
|
51 |
+
|
52 |
+
// Register plugin
|
53 |
+
tinymce.PluginManager.add('codemagic', tinymce.plugins.CodeMagic);
|
54 |
+
})();
|
addons/codemagic/img/Thumbs.db
ADDED
Binary file
|
addons/codemagic/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="Thumbs.db" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130112137800000000" remote="130112137800000000" Dst="2" />
|
4 |
+
<file name="code.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/codemagic/img/code.png
ADDED
Binary file
|
addons/codemagic/img/icons/Thumbs.db
ADDED
Binary file
|
addons/codemagic/img/icons/_notes/dwsync.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="Thumbs.db" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130112137800000000" remote="130112137800000000" Dst="2" />
|
4 |
+
<file name="file.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
5 |
+
<file name="lens.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
6 |
+
<file name="redo.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
7 |
+
<file name="undo.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
8 |
+
</dwsync>
|
addons/codemagic/img/icons/file.png
ADDED
Binary file
|
addons/codemagic/img/icons/lens.png
ADDED
Binary file
|
addons/codemagic/img/icons/redo.png
ADDED
Binary file
|
addons/codemagic/img/icons/undo.png
ADDED
Binary file
|
addons/codemagic/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="beautify-html.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130112156400000000" remote="130112156400000000" Dst="2" />
|
4 |
+
<file name="beautify.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
5 |
+
<file name="codemagic.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130171239203211460" remote="130171203000000000" Dst="2" />
|
6 |
+
<file name="codemirror-compressed.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
7 |
+
</dwsync>
|
addons/codemagic/js/beautify-html.js
ADDED
@@ -0,0 +1,571 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
|
3 |
+
Style HTML
|
4 |
+
---------------
|
5 |
+
|
6 |
+
Written by Nochum Sossonko, (nsossonko@hotmail.com)
|
7 |
+
|
8 |
+
Based on code initially developed by: Einar Lielmanis, <elfz@laacz.lv>
|
9 |
+
http://jsbeautifier.org
|
10 |
+
|
11 |
+
|
12 |
+
You are free to use this in any way you want, in case you find this useful or working for you.
|
13 |
+
|
14 |
+
Usage:
|
15 |
+
style_html(html_source);
|
16 |
+
|
17 |
+
Recent changes:
|
18 |
+
2013-04-08, bsy-web (bsy.github@gmail.com)
|
19 |
+
- added: (array) Parser.Utils.inline_token - to hold list of HTML inline elements for identification
|
20 |
+
- added: (string) new TK_TAG_INLINE token - to handle formatting of inline tags specifically
|
21 |
+
- added: (bool) Parser.found_leading_whitespace - to help with conditional inline tag formatting
|
22 |
+
- added: (bool) Parser.found_trailing_whitespace - to help with conditional inline tag formatting
|
23 |
+
- added: Comments through out the file to help follow flow of data and understand algorithm
|
24 |
+
- fixed: Space left when trimming whitespace after "<" inside tag (e.g. "< tag>"). Now outputs "<tag>"
|
25 |
+
- changed: get_token(), get_string, get_content(), and get_tag() only return array[string, string] (previously array[string, string] or just string)
|
26 |
+
- changed: unfinished content (unclosed tags or scripts) now get formatted even when EOF is reached
|
27 |
+
- todo: add option to print inline tags on same line as content (inline tags currently get newline if whitespace allows)
|
28 |
+
- todo: add indentation formatting for nested inline tags (e.g. <em>italic <strong>and bold</strong><em>)
|
29 |
+
- todo: create test driver script with input test cases to track how changes to this file affect final output (regression testing)
|
30 |
+
|
31 |
+
*/
|
32 |
+
|
33 |
+
// Wrapper function to invoke all the necessary constructors and deal with the output.
|
34 |
+
function style_html(html_source, indent_size, indent_character,
|
35 |
+
max_char, brace_style) {
|
36 |
+
|
37 |
+
var Parser, multi_parser;
|
38 |
+
|
39 |
+
/* Function: Parser()
|
40 |
+
This function initializes the parsing environment and contains many other sub-functions
|
41 |
+
which will be called as needed by an instance of Parser */
|
42 |
+
function Parser() {
|
43 |
+
this.pos = 0; //Parser position
|
44 |
+
this.found_leading_whitespace = false;
|
45 |
+
this.found_trailing_whitespace = false;
|
46 |
+
this.token = '';
|
47 |
+
this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
|
48 |
+
this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values
|
49 |
+
parent: 'parent1',
|
50 |
+
parentcount: 1,
|
51 |
+
parent1: ''
|
52 |
+
};
|
53 |
+
|
54 |
+
this.tag_type = '';
|
55 |
+
this.token_text = this.last_token = this.last_tag_token = this.last_text = this.token_type =
|
56 |
+
'';
|
57 |
+
|
58 |
+
this.Utils = { //Uilities made available to the various functions
|
59 |
+
// Entities considered white-space
|
60 |
+
whitespace: "\n\r\t ".split(''),
|
61 |
+
|
62 |
+
/*
|
63 |
+
HTML elements which are considered inline (and thus affected by whitespace such as newlines;
|
64 |
+
i.e. indentation considerations required for these tags)
|
65 |
+
|
66 |
+
SCA, 2013-04-04: Note: Some elements are both inline and single (e.g. br, input, img).
|
67 |
+
Check how this effects display logic and opt for keeping it in token array instead.
|
68 |
+
*/
|
69 |
+
inline_token: 'a,abbr,acronym,b,bdo,big,br,button,cite,code,dfn,em,i,img,input,kbd,label,map,object,q,samp,script,select,small,span,strong,sub,sup,textarea,tt'.split(','),
|
70 |
+
|
71 |
+
// HTML elements without a closing tag pair
|
72 |
+
single_token: '!doctype,?xml,area,base,basefont,br,embed,hr,img,input,isindex,link,meta,param,wbr'.split(','),
|
73 |
+
|
74 |
+
// Elements which get get extra blank line before them (stylistic preference)
|
75 |
+
extra_liners: 'body,head,/html'.split(','), //for tags that need a line of whitespace before them
|
76 |
+
|
77 |
+
// Function to check if given element is in given array
|
78 |
+
in_array: function (what, arr) {
|
79 |
+
for (var i = 0; i < arr.length; i++) {
|
80 |
+
if (what === arr[i]) {
|
81 |
+
return true;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
} /* End of Function: Parser() */
|
87 |
+
|
88 |
+
/* Function: get_content() */
|
89 |
+
this.get_content = function () { //function to capture regular content between tags
|
90 |
+
var input_char = '';
|
91 |
+
var content = [];
|
92 |
+
var space = false; //if a space is needed
|
93 |
+
|
94 |
+
// Ingest content until start of new tag ('<')
|
95 |
+
while (this.input.charAt(this.pos) !== '<') { // content ingestion complete if new tag is starting
|
96 |
+
if (this.pos >= this.input.length) { // we know we're at EOF...
|
97 |
+
return [content.join(''),'TK_EOF']; // ...so just pass back any ingested content to get printed
|
98 |
+
}
|
99 |
+
|
100 |
+
input_char = this.input.charAt(this.pos);
|
101 |
+
this.pos++;
|
102 |
+
this.line_char_count++;
|
103 |
+
|
104 |
+
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
105 |
+
if (content.length) { // only mark space as true if non-spaces have already been ingested (i.e leading whitespace doesn't count)
|
106 |
+
space = true; // flag non-leading whitespace encountered (can be used for breaking lines > max_char)
|
107 |
+
} else { // no content yet hence this is leading whitespace
|
108 |
+
this.found_leading_whitespace = true; // flag that whitespace came first so we can format inline tags correctly
|
109 |
+
}
|
110 |
+
|
111 |
+
this.line_char_count--;
|
112 |
+
this.found_trailing_whitespace = true; // flag that last char so far (even if singleton) is whitespace (for formatting inline tags correctly)
|
113 |
+
continue; // don't want to insert unnecessary space (start next iteration of loop)
|
114 |
+
}
|
115 |
+
else if (space) { // current char not a space but previous char may have been (which allows for long-line breaking)
|
116 |
+
|
117 |
+
// Insert a newline when the max_char is reached.
|
118 |
+
if (this.line_char_count >= this.max_char) {
|
119 |
+
// SCA: Note: This is the place to insert whitespace of choice for the inline tag case (or no newline)
|
120 |
+
content.push('\n'); // Start newline
|
121 |
+
|
122 |
+
// indent per nested tag depth
|
123 |
+
for (var i = 0; i < this.indent_level; i++) {
|
124 |
+
content.push(this.indent_string);
|
125 |
+
}
|
126 |
+
|
127 |
+
this.line_char_count = 0;
|
128 |
+
}
|
129 |
+
else {
|
130 |
+
content.push(' '); // put in that space that was left out in previous iteration
|
131 |
+
this.line_char_count++;
|
132 |
+
}
|
133 |
+
|
134 |
+
space = false;
|
135 |
+
this.found_trailing_whitespace = false; // last read char not space hence reset trailing space flag
|
136 |
+
}
|
137 |
+
|
138 |
+
content.push(input_char); //letter at-a-time (or string) inserted to an array
|
139 |
+
}
|
140 |
+
|
141 |
+
return [content.join(''), 'TK_CONTENT']; // start of new tag ('<') encountered so return current ingested string
|
142 |
+
} /* End of Function: get_content() */
|
143 |
+
|
144 |
+
/* Function: get_script() */
|
145 |
+
this.get_script = function () { //get the full content of a script to pass to js_beautify
|
146 |
+
|
147 |
+
var input_char = '';
|
148 |
+
var content = [];
|
149 |
+
var script_text = '';
|
150 |
+
var reg_match = new RegExp('\<\/script' + '\>', 'igm');
|
151 |
+
reg_match.lastIndex = this.pos;
|
152 |
+
var reg_array = reg_match.exec(this.input);
|
153 |
+
var end_script = reg_array ? reg_array.index : this.input.length; //absolute end of script
|
154 |
+
var reached_eof = (this.pos >= this.input.length);
|
155 |
+
|
156 |
+
while ((this.pos < end_script) && !reached_eof) { //get everything in between the script tags
|
157 |
+
input_char = this.input.charAt(this.pos);
|
158 |
+
this.pos++;
|
159 |
+
reached_eof = (this.pos >= this.input.length);
|
160 |
+
|
161 |
+
content.push(input_char);
|
162 |
+
}
|
163 |
+
|
164 |
+
script_text = !content.length ? '' : // check if we have an content
|
165 |
+
js_beautify( content.join(''), // apply the JS Beautifier on that content (even if it is partial, i.e. reached EOF)
|
166 |
+
{
|
167 |
+
indent_size: this.indent_size,
|
168 |
+
indent_char: this.indent_character,
|
169 |
+
indent_level: this.indent_level,
|
170 |
+
brace_style: this.brace_style
|
171 |
+
});
|
172 |
+
|
173 |
+
// return content.length ? content.join('') : ''; //we might not have any content at all
|
174 |
+
return [script_text, reached_eof ? 'TK_EOF' : 'TK_CONTENT'];
|
175 |
+
} /* Function: get_script() */
|
176 |
+
|
177 |
+
/* Function: record_tag(tag) */
|
178 |
+
this.record_tag = function (tag) { //function to record a tag and its parent in this.tags Object
|
179 |
+
if (this.tags[tag + 'count']) { //check for the existence of this tag type
|
180 |
+
this.tags[tag + 'count']++;
|
181 |
+
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
182 |
+
} else { //otherwise initialize this tag type
|
183 |
+
this.tags[tag + 'count'] = 1;
|
184 |
+
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
185 |
+
}
|
186 |
+
this.tags[tag + this.tags[tag + 'count'] + 'parent'] =
|
187 |
+
this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent)
|
188 |
+
this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1')
|
189 |
+
} /* End of Function: record_tag(tag) */
|
190 |
+
|
191 |
+
/* Function: retrieve_tag(tag) */
|
192 |
+
this.retrieve_tag = function (tag) { //function to retrieve the opening tag to the corresponding closer
|
193 |
+
if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it
|
194 |
+
var temp_parent = this.tags.parent; //check to see if it's a closable tag.
|
195 |
+
while (temp_parent) { //till we reach '' (the initial value);
|
196 |
+
if (tag + this.tags[tag + 'count'] ===
|
197 |
+
temp_parent) { //if this is it use it
|
198 |
+
break;
|
199 |
+
}
|
200 |
+
temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree
|
201 |
+
}
|
202 |
+
if (temp_parent) { //if we caught something
|
203 |
+
this.indent_level = this.tags[tag + this.tags[tag +
|
204 |
+
'count']]; //set the indent_level accordingly
|
205 |
+
this.tags.parent = this.tags[temp_parent +
|
206 |
+
'parent']; //and set the current parent
|
207 |
+
}
|
208 |
+
delete this.tags[tag + this.tags[tag + 'count'] +
|
209 |
+
'parent']; //delete the closed tags parent reference...
|
210 |
+
delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself
|
211 |
+
if (this.tags[tag + 'count'] == 1) {
|
212 |
+
delete this.tags[tag + 'count'];
|
213 |
+
} else {
|
214 |
+
this.tags[tag + 'count']--;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
} /* End of Function: retrieve_tag(tag) */
|
218 |
+
|
219 |
+
/* Function: get_tag() */
|
220 |
+
this.get_tag = function () { //function to get a full tag and parse its type
|
221 |
+
var input_char = '';
|
222 |
+
var content = [];
|
223 |
+
var space = false;
|
224 |
+
|
225 |
+
do {
|
226 |
+
if (this.pos >= this.input.length) { // if we reach end of input (we already have last char)
|
227 |
+
return [content.join(''), 'TK_EOF']; // pass back anything ingested so far (so not to lose it)
|
228 |
+
// and flag as reaching EOF
|
229 |
+
}
|
230 |
+
|
231 |
+
input_char = this.input.charAt(this.pos);
|
232 |
+
this.pos++;
|
233 |
+
this.line_char_count++;
|
234 |
+
|
235 |
+
if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space
|
236 |
+
space = true;
|
237 |
+
this.line_char_count--;
|
238 |
+
continue; // jump to next iteration of loop hence trimming leading white space inside tag (e.g. < p>)
|
239 |
+
}
|
240 |
+
|
241 |
+
// Case for quotes within the tag itself
|
242 |
+
if (input_char === "'" || input_char === '"') { // start of quoted string
|
243 |
+
// SCA: VERIFY: What is "!content[1]" supposed to check? Whitespace after '<' should be discarded.
|
244 |
+
if (!content[1] || content[1] !== '!') { //if we're in a comment, strings don't get treated specially
|
245 |
+
input_char += this.get_unformatted(input_char); // read everything up to end of single/double quote
|
246 |
+
space = true; // queue inserting space after quote contents and end quote (a check below prevents it for start quote which follows a '=')
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
// Cases where previous space should disappear
|
251 |
+
if (content[content.length - 1] === '<' || // if last stored char was '<' no space after it (e.g. "< a> -> "<a>)
|
252 |
+
input_char === '=') {// no space before '=' (e.g. "<a href ='/code/"> -> "<a href='/code/'>)
|
253 |
+
//input_char !== '>') {
|
254 |
+
space = false;
|
255 |
+
}
|
256 |
+
|
257 |
+
// Case for determining what do with previous whitespace
|
258 |
+
if (space && content.length && // if previous character was non-leading whitespace (came after some content)
|
259 |
+
content[content.length - 1] !== '=' && // if last stored char was "=" no space after it (e.g. "<a href= '/code/"> -> "<a href='/code/'>)
|
260 |
+
input_char !== '>') { // no space before '>' (e.g. "<a href='/code/" > -> "<a href='/code/'>)
|
261 |
+
|
262 |
+
// Note: Space is still true for end quotes
|
263 |
+
|
264 |
+
// Allow opening tag to break if longer than max_char
|
265 |
+
if (this.line_char_count >= this.max_char) {
|
266 |
+
this.print_newline(false, content);
|
267 |
+
this.line_char_count = 0;
|
268 |
+
} else { // append the previously digested space
|
269 |
+
content.push(' ');
|
270 |
+
this.line_char_count++;
|
271 |
+
}
|
272 |
+
|
273 |
+
space = false;
|
274 |
+
}
|
275 |
+
|
276 |
+
content.push(input_char); // append current char to tag string
|
277 |
+
} while (input_char !== '>'); // exit loop at tag closure character
|
278 |
+
|
279 |
+
|
280 |
+
// Arriving here means a complete tag was captured (e.g. "<xxx>")
|
281 |
+
var tag_complete = content.join('');
|
282 |
+
var tag_index;
|
283 |
+
|
284 |
+
if (tag_complete.indexOf(' ') != -1) { //if there's whitespace, thats where the tag name ends
|
285 |
+
tag_index = tag_complete.indexOf(' ');
|
286 |
+
} else { //otherwise go with the tag ending
|
287 |
+
tag_index = tag_complete.indexOf('>');
|
288 |
+
}
|
289 |
+
|
290 |
+
// Identify the type of tag that has just been ingested
|
291 |
+
var tag_check = tag_complete.substring(1, tag_index).toLowerCase();
|
292 |
+
|
293 |
+
if (tag_complete.charAt(tag_complete.length - 2) === '/' ||
|
294 |
+
this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /)
|
295 |
+
this.tag_type = 'SINGLE';
|
296 |
+
}
|
297 |
+
else if (tag_check === 'script') { //for later script handling
|
298 |
+
this.record_tag(tag_check);
|
299 |
+
this.tag_type = 'SCRIPT';
|
300 |
+
}
|
301 |
+
else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content)
|
302 |
+
this.record_tag(tag_check);
|
303 |
+
this.tag_type = 'STYLE';
|
304 |
+
}
|
305 |
+
else if (this.Utils.in_array(tag_check, this.Utils.inline_token)) { // check if current tag is an inline element
|
306 |
+
var inline_element = this.get_unformatted('</' + tag_check + '>',
|
307 |
+
tag_complete); //...delegate to get_unformatted function
|
308 |
+
content.push(inline_element);
|
309 |
+
this.tag_type = 'INLINE';
|
310 |
+
}
|
311 |
+
else if (tag_check.charAt(0) === '!') { //peek for <!-- comment
|
312 |
+
if (tag_check.indexOf('[if') != -1) { //peek for <!--[if conditional comment
|
313 |
+
if (tag_complete.indexOf('!IE') != -1) { //this type needs a closing --> so...
|
314 |
+
var comment = this.get_unformatted('-->',
|
315 |
+
tag_complete); //...delegate to get_unformatted
|
316 |
+
content.push(comment);
|
317 |
+
}
|
318 |
+
this.tag_type = 'START';
|
319 |
+
} else if (tag_check.indexOf('[endif') != -1) { //peek for <!--[endif end conditional comment
|
320 |
+
this.tag_type = 'END';
|
321 |
+
this.unindent();
|
322 |
+
} else if (tag_check.indexOf('[cdata[') != -1) { //if it's a <[cdata[ comment...
|
323 |
+
var comment = this.get_unformatted(']]>',
|
324 |
+
tag_complete); //...delegate to get_unformatted function
|
325 |
+
content.push(comment);
|
326 |
+
this.tag_type = 'SINGLE'; //<![CDATA[ comments are treated like single tags
|
327 |
+
} else {
|
328 |
+
var comment = this.get_unformatted('-->',
|
329 |
+
tag_complete);
|
330 |
+
content.push(comment);
|
331 |
+
this.tag_type = 'SINGLE';
|
332 |
+
}
|
333 |
+
}
|
334 |
+
else {
|
335 |
+
if (tag_check.charAt(0) === '/') { //this tag is a double tag (end tag, eg. </p>) so check for tag-ending
|
336 |
+
this.retrieve_tag(tag_check.substring(1)); //remove it and all ancestors
|
337 |
+
this.tag_type = 'END';
|
338 |
+
}
|
339 |
+
else { //otherwise it's a start-tag
|
340 |
+
this.record_tag(tag_check); //push it on the tag stack
|
341 |
+
this.tag_type = 'START'; // unidentified tags are labeled as a generic opening tag
|
342 |
+
}
|
343 |
+
|
344 |
+
if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line
|
345 |
+
this.print_newline(true, this.output); // SCA: Note: Why is this here instead of in standard location (final case statement)?
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
return [content.join(''), 'TK_TAG_' + this.tag_type]; // will only reach here if '>' was encountered
|
350 |
+
} /* Function: get_tag() */
|
351 |
+
|
352 |
+
/* Function: get_unformatted(delimiter, orig_tag) */
|
353 |
+
this.get_unformatted = function (delimiter, orig_tag) { //function to return unformatted content in its entirety
|
354 |
+
|
355 |
+
if (orig_tag && orig_tag.indexOf(delimiter) != -1) {
|
356 |
+
return '';
|
357 |
+
}
|
358 |
+
var input_char = '';
|
359 |
+
var content = '';
|
360 |
+
var space = true;
|
361 |
+
do {
|
362 |
+
|
363 |
+
if (this.pos >= this.input.length) {
|
364 |
+
return content;
|
365 |
+
}
|
366 |
+
|
367 |
+
input_char = this.input.charAt(this.pos);
|
368 |
+
this.pos++
|
369 |
+
|
370 |
+
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
371 |
+
if (!space) {
|
372 |
+
this.line_char_count--;
|
373 |
+
continue;
|
374 |
+
}
|
375 |
+
if (input_char === '\n' || input_char === '\r') {
|
376 |
+
content += '\n';
|
377 |
+
for (var i = 0; i < this.indent_level; i++) {
|
378 |
+
content += this.indent_string;
|
379 |
+
}
|
380 |
+
space = false; //...and make sure other indentation is erased
|
381 |
+
this.line_char_count = 0;
|
382 |
+
continue;
|
383 |
+
}
|
384 |
+
}
|
385 |
+
content += input_char;
|
386 |
+
this.line_char_count++;
|
387 |
+
space = true;
|
388 |
+
|
389 |
+
} while (content.indexOf(delimiter) == -1); // repeat digestion of each char until end tag is consumed
|
390 |
+
return content;
|
391 |
+
} /* End of Function: get_unformatted(delimiter, orig_tag) */
|
392 |
+
|
393 |
+
|
394 |
+
/* Function: get_token() */
|
395 |
+
this.get_token = function () { //initial handler for token-retrieval
|
396 |
+
if (this.last_token === 'TK_TAG_SCRIPT') { //check if we need to format script content (after <script> tag)
|
397 |
+
return this.get_script();
|
398 |
+
}
|
399 |
+
|
400 |
+
if (this.current_mode === 'CONTENT') {
|
401 |
+
return this.get_content();
|
402 |
+
}
|
403 |
+
|
404 |
+
if (this.current_mode === 'TAG') {
|
405 |
+
return this.get_tag();
|
406 |
+
}
|
407 |
+
} /* Function: get_token() */
|
408 |
+
|
409 |
+
/* Function: printer(js_source, indent_character, indent_size, max_char, brace_style) */
|
410 |
+
this.printer = function (js_source, indent_character,
|
411 |
+
indent_size, max_char, brace_style) { //handles input/output and some other printing functions
|
412 |
+
|
413 |
+
// Provides default values to arguments
|
414 |
+
this.input = js_source || ''; //gets the input for the Parser
|
415 |
+
this.output = [];
|
416 |
+
this.indent_character = indent_character || ' '; // ' '
|
417 |
+
this.indent_string = '';
|
418 |
+
this.indent_size = indent_size || 2;
|
419 |
+
this.brace_style = brace_style || 'collapse';
|
420 |
+
this.indent_level = 0;
|
421 |
+
this.max_char = max_char || 70; //maximum amount of characters per line
|
422 |
+
this.line_char_count = 0; //count to see if max_char was exceeded
|
423 |
+
|
424 |
+
// Create/cache indent unit: indent_character * indent_size
|
425 |
+
for (var i = 0; i < this.indent_size; i++) {
|
426 |
+
this.indent_string += this.indent_character;
|
427 |
+
}
|
428 |
+
|
429 |
+
/* Function: print_newline(ignore, arr) */
|
430 |
+
this.print_newline = function (ignore, arr) {
|
431 |
+
this.line_char_count = 0;
|
432 |
+
if (!arr || !arr.length) {
|
433 |
+
return;
|
434 |
+
}
|
435 |
+
if (!ignore) { //we might want the extra line
|
436 |
+
while (this.Utils.in_array(arr[arr.length - 1],
|
437 |
+
this.Utils.whitespace)) {
|
438 |
+
arr.pop();
|
439 |
+
}
|
440 |
+
}
|
441 |
+
arr.push('\n');
|
442 |
+
for (var i = 0; i < this.indent_level; i++) {
|
443 |
+
arr.push(this.indent_string);
|
444 |
+
}
|
445 |
+
} /* End of Function: print_newline(ignore, arr) */
|
446 |
+
|
447 |
+
|
448 |
+
this.print_token = function (text) {
|
449 |
+
this.output.push(text);
|
450 |
+
} /* End of Function: print_newline(ignore, arr) */
|
451 |
+
|
452 |
+
|
453 |
+
this.indent = function () {
|
454 |
+
this.indent_level++;
|
455 |
+
} /* End of Function: indent() */
|
456 |
+
|
457 |
+
|
458 |
+
this.unindent = function () {
|
459 |
+
if (this.indent_level > 0) {
|
460 |
+
this.indent_level--;
|
461 |
+
}
|
462 |
+
} /* End of Function: unindent() */
|
463 |
+
|
464 |
+
} /* End of Function: printer(js_source, indent_character, indent_size, max_char, brace_style) */
|
465 |
+
|
466 |
+
return this;
|
467 |
+
}
|
468 |
+
|
469 |
+
|
470 |
+
/*_____________________--------------------_____________________*/
|
471 |
+
|
472 |
+
|
473 |
+
// Create a new Parser
|
474 |
+
var last_token_had_trailing_whitespace = false;
|
475 |
+
multi_parser = new Parser(); //wrapping functions Parser
|
476 |
+
|
477 |
+
/*
|
478 |
+
html_source: Orginal source as stored in database. I think Ultimate TinyMCE disables WP parsing of HTML code so that it can reparse it each time CodeMagic is run. As passed into style_html, which is called from CodeMagic.js.
|
479 |
+
indent_character: Character to use as a single indent (e.g. space, tab, etc). As passed into style_html, which is called from CodeMagic.js.
|
480 |
+
indent_size: Width of left indent margin. As passed into style_html, which is called from CodeMagic.js.
|
481 |
+
max_char: Max length of line of source. As passed into style_html, which is called from CodeMagic.js.
|
482 |
+
brace_style: Unsure how each style is different. As passed into style_html, which is called from CodeMagic.js.
|
483 |
+
*/
|
484 |
+
multi_parser.printer(html_source, indent_character, indent_size,
|
485 |
+
max_char, brace_style); //initialize starting values
|
486 |
+
|
487 |
+
/*
|
488 |
+
Start moving through source token by token until EOF (end of file) is reached.
|
489 |
+
*/
|
490 |
+
do {
|
491 |
+
var t = multi_parser.get_token();
|
492 |
+
|
493 |
+
multi_parser.token_text = t[0];
|
494 |
+
multi_parser.token_type = t[1];
|
495 |
+
|
496 |
+
console.log(t[1] + ',\t"' + t[0] + '"');
|
497 |
+
|
498 |
+
/*
|
499 |
+
Handle each token type in a specific way.
|
500 |
+
*/
|
501 |
+
switch (multi_parser.token_type) {
|
502 |
+
case 'TK_TAG_START':
|
503 |
+
case 'TK_TAG_SCRIPT':
|
504 |
+
case 'TK_TAG_STYLE':
|
505 |
+
multi_parser.print_newline(false, multi_parser.output);
|
506 |
+
multi_parser.print_token(multi_parser.token_text);
|
507 |
+
multi_parser.indent(); // increase indent level
|
508 |
+
multi_parser.current_mode = 'CONTENT'; // toggle to check for content now that a tag has been digested
|
509 |
+
multi_parser.last_tag_token = multi_parser.token_type;
|
510 |
+
break;
|
511 |
+
|
512 |
+
case 'TK_TAG_END':
|
513 |
+
multi_parser.print_newline(true, multi_parser.output);
|
514 |
+
multi_parser.print_token(multi_parser.token_text);
|
515 |
+
multi_parser.current_mode = 'CONTENT'; // toggle to check for content now that a tag has been digested
|
516 |
+
multi_parser.last_tag_token = multi_parser.token_type;
|
517 |
+
break;
|
518 |
+
|
519 |
+
case 'TK_TAG_SINGLE':
|
520 |
+
multi_parser.print_newline(false, multi_parser.output);
|
521 |
+
multi_parser.print_token(multi_parser.token_text);
|
522 |
+
multi_parser.current_mode = 'CONTENT'; // toggle to check for content now that a tag has been digested
|
523 |
+
multi_parser.last_tag_token = multi_parser.token_type;
|
524 |
+
break;
|
525 |
+
|
526 |
+
case 'TK_TAG_INLINE':
|
527 |
+
//SCA: TODO: Apply indentation formatting to nested inline tags (e.g. <em>italic <strong>and bold</strong><em>).
|
528 |
+
// Currently puts all content as it gets it using get_unformatted. Could call style_html() recursively on it.
|
529 |
+
if ( // text preceeding and adjacent to inline tag with out space in between
|
530 |
+
(last_token_had_trailing_whitespace && (multi_parser.last_token === "TK_CONTENT")) || // it seems CONTENT is not guaranteed after a TAG (verified through logging of long HTML samples) hence the explicit condition statements
|
531 |
+
// empty string between current inline tag and previous tag is not inline
|
532 |
+
(!multi_parser.last_text && (multi_parser.last_tag_token !== "TK_TAG_INLINE"))
|
533 |
+
) {
|
534 |
+
// only time inline tag shoud not be formatted is if preceding text was content with no trailing whitespace
|
535 |
+
multi_parser.print_newline(false, multi_parser.output);
|
536 |
+
}
|
537 |
+
multi_parser.print_token(multi_parser.token_text);
|
538 |
+
multi_parser.current_mode = 'CONTENT'; // toggle to check for content now that a tag has been digested
|
539 |
+
multi_parser.last_tag_token = multi_parser.token_type;
|
540 |
+
break;
|
541 |
+
|
542 |
+
case 'TK_EOF': // print anything ingested before exiting (so incomplete tags don't disappear from end of input
|
543 |
+
case 'TK_CONTENT':
|
544 |
+
if (multi_parser.token_text !== '') { // check if there is any content
|
545 |
+
if (multi_parser.last_token === 'TK_TAG_INLINE') { // if the previous tag was an inline element
|
546 |
+
if (multi_parser.found_leading_whitespace) { // and current content had leading white space
|
547 |
+
// output whitespace (a space can be added rather than newline in future versions)
|
548 |
+
multi_parser.print_newline(false, multi_parser.output);
|
549 |
+
} // else output content adjacent to inline element (i.e. no whitespace)
|
550 |
+
} else { // previous tag was not a inline element
|
551 |
+
multi_parser.print_newline(false, multi_parser.output); // output newline
|
552 |
+
}
|
553 |
+
|
554 |
+
multi_parser.print_token(multi_parser.token_text);
|
555 |
+
}
|
556 |
+
|
557 |
+
multi_parser.current_mode = 'TAG'; // toggle to check for a tag now that content has been digested
|
558 |
+
break;
|
559 |
+
}
|
560 |
+
|
561 |
+
// Remember and reinitialize values for next loop iteration.
|
562 |
+
multi_parser.last_token = multi_parser.token_type;
|
563 |
+
multi_parser.last_text = multi_parser.token_text;
|
564 |
+
|
565 |
+
last_token_had_trailing_whitespace = multi_parser.found_trailing_whitespace; // needed in "case 'TK_TAG_INLINE'" for inline tag formatting
|
566 |
+
multi_parser.found_leading_whitespace = false; // reset to false so it can be set to true if encountered for next token
|
567 |
+
multi_parser.found_trailing_whitespace = false; // reset to false so it can be set to true if encountered for next token
|
568 |
+
} while (multi_parser.token_type !== 'TK_EOF');
|
569 |
+
|
570 |
+
return multi_parser.output.join(''); // return the fully formatted source
|
571 |
+
}
|
addons/codemagic/js/beautify.js
ADDED
@@ -0,0 +1,1147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*jslint onevar: false, plusplus: false */
|
2 |
+
/*
|
3 |
+
|
4 |
+
JS Beautifier
|
5 |
+
---------------
|
6 |
+
|
7 |
+
|
8 |
+
Written by Einar Lielmanis, <einar@jsbeautifier.org>
|
9 |
+
http://jsbeautifier.org/
|
10 |
+
|
11 |
+
Originally converted to javascript by Vital, <vital76@gmail.com>
|
12 |
+
"End braces on own line" added by Chris J. Shull, <chrisjshull@gmail.com>
|
13 |
+
|
14 |
+
You are free to use this in any way you want, in case you find this useful or working for you.
|
15 |
+
|
16 |
+
Usage:
|
17 |
+
js_beautify(js_source_text);
|
18 |
+
js_beautify(js_source_text, options);
|
19 |
+
|
20 |
+
The options are:
|
21 |
+
indent_size (default 4) — indentation size,
|
22 |
+
indent_char (default space) — character to indent with,
|
23 |
+
preserve_newlines (default true) — whether existing line breaks should be preserved,
|
24 |
+
preserve_max_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,
|
25 |
+
indent_level (default 0) — initial indentation level, you probably won't need this ever,
|
26 |
+
|
27 |
+
jslint_happy (default false) — if true, then jslint-stricter mode is enforced.
|
28 |
+
|
29 |
+
jslint_happy !jslint_happy
|
30 |
+
---------------------------------
|
31 |
+
function () function()
|
32 |
+
|
33 |
+
brace_style (default "collapse") - "collapse" | "expand" | "end-expand"
|
34 |
+
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
|
35 |
+
|
36 |
+
e.g
|
37 |
+
|
38 |
+
js_beautify(js_source_text, {indent_size: 1, indent_char: '\t'});
|
39 |
+
|
40 |
+
|
41 |
+
*/
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
function js_beautify(js_source_text, options) {
|
46 |
+
|
47 |
+
var input, output, token_text, last_type, last_text, last_last_text, last_word, flags, flag_store, indent_string;
|
48 |
+
var whitespace, wordchar, punct, parser_pos, line_starters, digits;
|
49 |
+
var prefix, token_type, do_block_just_closed;
|
50 |
+
var wanted_newline, just_added_newline, n_newlines;
|
51 |
+
|
52 |
+
|
53 |
+
// Some interpreters have unexpected results with foo = baz || bar;
|
54 |
+
options = options ? options : {};
|
55 |
+
|
56 |
+
var opt_brace_style;
|
57 |
+
|
58 |
+
// compatibility
|
59 |
+
if (options.space_after_anon_function !== undefined && options.jslint_happy === undefined) {
|
60 |
+
options.jslint_happy = options.space_after_anon_function;
|
61 |
+
}
|
62 |
+
if (options.braces_on_own_line !== undefined) { //graceful handling of depricated option
|
63 |
+
opt_brace_style = options.braces_on_own_line ? "expand" : "collapse";
|
64 |
+
}
|
65 |
+
opt_brace_style = options.brace_style ? options.brace_style : (opt_brace_style ? opt_brace_style : "collapse");
|
66 |
+
|
67 |
+
|
68 |
+
var opt_indent_size = options.indent_size ? options.indent_size : 4;
|
69 |
+
var opt_indent_char = options.indent_char ? options.indent_char : ' ';
|
70 |
+
var opt_preserve_newlines = typeof options.preserve_newlines === 'undefined' ? true : options.preserve_newlines;
|
71 |
+
var opt_max_preserve_newlines = typeof options.max_preserve_newlines === 'undefined' ? false : options.max_preserve_newlines;
|
72 |
+
var opt_indent_level = options.indent_level ? options.indent_level : 0; // starting indentation
|
73 |
+
var opt_jslint_happy = options.jslint_happy === 'undefined' ? false : options.jslint_happy;
|
74 |
+
var opt_keep_array_indentation = typeof options.keep_array_indentation === 'undefined' ? false : options.keep_array_indentation;
|
75 |
+
|
76 |
+
just_added_newline = false;
|
77 |
+
|
78 |
+
// cache the source's length.
|
79 |
+
var input_length = js_source_text.length;
|
80 |
+
|
81 |
+
function trim_output(eat_newlines) {
|
82 |
+
eat_newlines = typeof eat_newlines === 'undefined' ? false : eat_newlines;
|
83 |
+
while (output.length && (output[output.length - 1] === ' '
|
84 |
+
|| output[output.length - 1] === indent_string
|
85 |
+
|| (eat_newlines && (output[output.length - 1] === '\n' || output[output.length - 1] === '\r')))) {
|
86 |
+
output.pop();
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
function trim(s) {
|
91 |
+
return s.replace(/^\s\s*|\s\s*$/, '');
|
92 |
+
}
|
93 |
+
|
94 |
+
function print_newline(ignore_repeated) {
|
95 |
+
|
96 |
+
flags.eat_next_space = false;
|
97 |
+
if (opt_keep_array_indentation && is_array(flags.mode)) {
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
ignore_repeated = typeof ignore_repeated === 'undefined' ? true : ignore_repeated;
|
102 |
+
|
103 |
+
flags.if_line = false;
|
104 |
+
trim_output();
|
105 |
+
|
106 |
+
if (!output.length) {
|
107 |
+
return; // no newline on start of file
|
108 |
+
}
|
109 |
+
|
110 |
+
if (output[output.length - 1] !== "\n" || !ignore_repeated) {
|
111 |
+
just_added_newline = true;
|
112 |
+
output.push("\n");
|
113 |
+
}
|
114 |
+
for (var i = 0; i < flags.indentation_level; i += 1) {
|
115 |
+
output.push(indent_string);
|
116 |
+
}
|
117 |
+
if (flags.var_line && flags.var_line_reindented) {
|
118 |
+
if (opt_indent_char === ' ') {
|
119 |
+
output.push(' '); // var_line always pushes 4 spaces, so that the variables would be one under another
|
120 |
+
} else {
|
121 |
+
output.push(indent_string); // skip space-stuffing, if indenting with a tab
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
function print_single_space() {
|
129 |
+
if (flags.eat_next_space) {
|
130 |
+
flags.eat_next_space = false;
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
var last_output = ' ';
|
134 |
+
if (output.length) {
|
135 |
+
last_output = output[output.length - 1];
|
136 |
+
}
|
137 |
+
if (last_output !== ' ' && last_output !== '\n' && last_output !== indent_string) { // prevent occassional duplicate space
|
138 |
+
output.push(' ');
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
function print_token() {
|
144 |
+
just_added_newline = false;
|
145 |
+
flags.eat_next_space = false;
|
146 |
+
output.push(token_text);
|
147 |
+
}
|
148 |
+
|
149 |
+
function indent() {
|
150 |
+
flags.indentation_level += 1;
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
function remove_indent() {
|
155 |
+
if (output.length && output[output.length - 1] === indent_string) {
|
156 |
+
output.pop();
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
function set_mode(mode) {
|
161 |
+
if (flags) {
|
162 |
+
flag_store.push(flags);
|
163 |
+
}
|
164 |
+
flags = {
|
165 |
+
previous_mode: flags ? flags.mode : 'BLOCK',
|
166 |
+
mode: mode,
|
167 |
+
var_line: false,
|
168 |
+
var_line_tainted: false,
|
169 |
+
var_line_reindented: false,
|
170 |
+
in_html_comment: false,
|
171 |
+
if_line: false,
|
172 |
+
in_case: false,
|
173 |
+
eat_next_space: false,
|
174 |
+
indentation_baseline: -1,
|
175 |
+
indentation_level: (flags ? flags.indentation_level + ((flags.var_line && flags.var_line_reindented) ? 1 : 0) : opt_indent_level),
|
176 |
+
ternary_depth: 0
|
177 |
+
};
|
178 |
+
}
|
179 |
+
|
180 |
+
function is_array(mode) {
|
181 |
+
return mode === '[EXPRESSION]' || mode === '[INDENTED-EXPRESSION]';
|
182 |
+
}
|
183 |
+
|
184 |
+
function is_expression(mode) {
|
185 |
+
return mode === '[EXPRESSION]' || mode === '[INDENTED-EXPRESSION]' || mode === '(EXPRESSION)';
|
186 |
+
}
|
187 |
+
|
188 |
+
function restore_mode() {
|
189 |
+
do_block_just_closed = flags.mode === 'DO_BLOCK';
|
190 |
+
if (flag_store.length > 0) {
|
191 |
+
flags = flag_store.pop();
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
function in_array(what, arr) {
|
197 |
+
for (var i = 0; i < arr.length; i += 1) {
|
198 |
+
if (arr[i] === what) {
|
199 |
+
return true;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
return false;
|
203 |
+
}
|
204 |
+
|
205 |
+
function get_next_token() {
|
206 |
+
n_newlines = 0;
|
207 |
+
|
208 |
+
if (parser_pos >= input_length) {
|
209 |
+
return ['', 'TK_EOF'];
|
210 |
+
}
|
211 |
+
|
212 |
+
wanted_newline = false;
|
213 |
+
|
214 |
+
var c = input.charAt(parser_pos);
|
215 |
+
parser_pos += 1;
|
216 |
+
|
217 |
+
|
218 |
+
var keep_whitespace = opt_keep_array_indentation && is_array(flags.mode);
|
219 |
+
|
220 |
+
if (keep_whitespace) {
|
221 |
+
|
222 |
+
//
|
223 |
+
// slight mess to allow nice preservation of array indentation and reindent that correctly
|
224 |
+
// first time when we get to the arrays:
|
225 |
+
// var a = [
|
226 |
+
// ....'something'
|
227 |
+
// we make note of whitespace_count = 4 into flags.indentation_baseline
|
228 |
+
// so we know that 4 whitespaces in original source match indent_level of reindented source
|
229 |
+
//
|
230 |
+
// and afterwards, when we get to
|
231 |
+
// 'something,
|
232 |
+
// .......'something else'
|
233 |
+
// we know that this should be indented to indent_level + (7 - indentation_baseline) spaces
|
234 |
+
//
|
235 |
+
var whitespace_count = 0;
|
236 |
+
|
237 |
+
while (in_array(c, whitespace)) {
|
238 |
+
|
239 |
+
if (c === "\n") {
|
240 |
+
trim_output();
|
241 |
+
output.push("\n");
|
242 |
+
just_added_newline = true;
|
243 |
+
whitespace_count = 0;
|
244 |
+
} else {
|
245 |
+
if (c === '\t') {
|
246 |
+
whitespace_count += 4;
|
247 |
+
} else if (c === '\r') {
|
248 |
+
// nothing
|
249 |
+
} else {
|
250 |
+
whitespace_count += 1;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
if (parser_pos >= input_length) {
|
255 |
+
return ['', 'TK_EOF'];
|
256 |
+
}
|
257 |
+
|
258 |
+
c = input.charAt(parser_pos);
|
259 |
+
parser_pos += 1;
|
260 |
+
|
261 |
+
}
|
262 |
+
if (flags.indentation_baseline === -1) {
|
263 |
+
flags.indentation_baseline = whitespace_count;
|
264 |
+
}
|
265 |
+
|
266 |
+
if (just_added_newline) {
|
267 |
+
var i;
|
268 |
+
for (i = 0; i < flags.indentation_level + 1; i += 1) {
|
269 |
+
output.push(indent_string);
|
270 |
+
}
|
271 |
+
if (flags.indentation_baseline !== -1) {
|
272 |
+
for (i = 0; i < whitespace_count - flags.indentation_baseline; i++) {
|
273 |
+
output.push(' ');
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
} else {
|
279 |
+
while (in_array(c, whitespace)) {
|
280 |
+
|
281 |
+
if (c === "\n") {
|
282 |
+
n_newlines += ( (opt_max_preserve_newlines) ? (n_newlines <= opt_max_preserve_newlines) ? 1: 0: 1 );
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
if (parser_pos >= input_length) {
|
287 |
+
return ['', 'TK_EOF'];
|
288 |
+
}
|
289 |
+
|
290 |
+
c = input.charAt(parser_pos);
|
291 |
+
parser_pos += 1;
|
292 |
+
|
293 |
+
}
|
294 |
+
|
295 |
+
if (opt_preserve_newlines) {
|
296 |
+
if (n_newlines > 1) {
|
297 |
+
for (i = 0; i < n_newlines; i += 1) {
|
298 |
+
print_newline(i === 0);
|
299 |
+
just_added_newline = true;
|
300 |
+
}
|
301 |
+
}
|
302 |
+
}
|
303 |
+
wanted_newline = n_newlines > 0;
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
if (in_array(c, wordchar)) {
|
308 |
+
if (parser_pos < input_length) {
|
309 |
+
while (in_array(input.charAt(parser_pos), wordchar)) {
|
310 |
+
c += input.charAt(parser_pos);
|
311 |
+
parser_pos += 1;
|
312 |
+
if (parser_pos === input_length) {
|
313 |
+
break;
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
// small and surprisingly unugly hack for 1E-10 representation
|
319 |
+
if (parser_pos !== input_length && c.match(/^[0-9]+[Ee]$/) && (input.charAt(parser_pos) === '-' || input.charAt(parser_pos) === '+')) {
|
320 |
+
|
321 |
+
var sign = input.charAt(parser_pos);
|
322 |
+
parser_pos += 1;
|
323 |
+
|
324 |
+
var t = get_next_token(parser_pos);
|
325 |
+
c += sign + t[0];
|
326 |
+
return [c, 'TK_WORD'];
|
327 |
+
}
|
328 |
+
|
329 |
+
if (c === 'in') { // hack for 'in' operator
|
330 |
+
return [c, 'TK_OPERATOR'];
|
331 |
+
}
|
332 |
+
if (wanted_newline && last_type !== 'TK_OPERATOR'
|
333 |
+
&& last_type !== 'TK_EQUALS'
|
334 |
+
&& !flags.if_line && (opt_preserve_newlines || last_text !== 'var')) {
|
335 |
+
print_newline();
|
336 |
+
}
|
337 |
+
return [c, 'TK_WORD'];
|
338 |
+
}
|
339 |
+
|
340 |
+
if (c === '(' || c === '[') {
|
341 |
+
return [c, 'TK_START_EXPR'];
|
342 |
+
}
|
343 |
+
|
344 |
+
if (c === ')' || c === ']') {
|
345 |
+
return [c, 'TK_END_EXPR'];
|
346 |
+
}
|
347 |
+
|
348 |
+
if (c === '{') {
|
349 |
+
return [c, 'TK_START_BLOCK'];
|
350 |
+
}
|
351 |
+
|
352 |
+
if (c === '}') {
|
353 |
+
return [c, 'TK_END_BLOCK'];
|
354 |
+
}
|
355 |
+
|
356 |
+
if (c === ';') {
|
357 |
+
return [c, 'TK_SEMICOLON'];
|
358 |
+
}
|
359 |
+
|
360 |
+
if (c === '/') {
|
361 |
+
var comment = '';
|
362 |
+
// peek for comment /* ... */
|
363 |
+
var inline_comment = true;
|
364 |
+
if (input.charAt(parser_pos) === '*') {
|
365 |
+
parser_pos += 1;
|
366 |
+
if (parser_pos < input_length) {
|
367 |
+
while (! (input.charAt(parser_pos) === '*' && input.charAt(parser_pos + 1) && input.charAt(parser_pos + 1) === '/') && parser_pos < input_length) {
|
368 |
+
c = input.charAt(parser_pos);
|
369 |
+
comment += c;
|
370 |
+
if (c === '\x0d' || c === '\x0a') {
|
371 |
+
inline_comment = false;
|
372 |
+
}
|
373 |
+
parser_pos += 1;
|
374 |
+
if (parser_pos >= input_length) {
|
375 |
+
break;
|
376 |
+
}
|
377 |
+
}
|
378 |
+
}
|
379 |
+
parser_pos += 2;
|
380 |
+
if (inline_comment) {
|
381 |
+
return ['/*' + comment + '*/', 'TK_INLINE_COMMENT'];
|
382 |
+
} else {
|
383 |
+
return ['/*' + comment + '*/', 'TK_BLOCK_COMMENT'];
|
384 |
+
}
|
385 |
+
}
|
386 |
+
// peek for comment // ...
|
387 |
+
if (input.charAt(parser_pos) === '/') {
|
388 |
+
comment = c;
|
389 |
+
while (input.charAt(parser_pos) !== '\r' && input.charAt(parser_pos) !== '\n') {
|
390 |
+
comment += input.charAt(parser_pos);
|
391 |
+
parser_pos += 1;
|
392 |
+
if (parser_pos >= input_length) {
|
393 |
+
break;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
parser_pos += 1;
|
397 |
+
if (wanted_newline) {
|
398 |
+
print_newline();
|
399 |
+
}
|
400 |
+
return [comment, 'TK_COMMENT'];
|
401 |
+
}
|
402 |
+
|
403 |
+
}
|
404 |
+
|
405 |
+
if (c === "'" || // string
|
406 |
+
c === '"' || // string
|
407 |
+
(c === '/' &&
|
408 |
+
((last_type === 'TK_WORD' && in_array(last_text, ['return', 'do'])) ||
|
409 |
+
(last_type === 'TK_COMMENT' || last_type === 'TK_START_EXPR' || last_type === 'TK_START_BLOCK' || last_type === 'TK_END_BLOCK' || last_type === 'TK_OPERATOR' || last_type === 'TK_EQUALS' || last_type === 'TK_EOF' || last_type === 'TK_SEMICOLON')))) { // regexp
|
410 |
+
var sep = c;
|
411 |
+
var esc = false;
|
412 |
+
var resulting_string = c;
|
413 |
+
|
414 |
+
if (parser_pos < input_length) {
|
415 |
+
if (sep === '/') {
|
416 |
+
//
|
417 |
+
// handle regexp separately...
|
418 |
+
//
|
419 |
+
var in_char_class = false;
|
420 |
+
while (esc || in_char_class || input.charAt(parser_pos) !== sep) {
|
421 |
+
resulting_string += input.charAt(parser_pos);
|
422 |
+
if (!esc) {
|
423 |
+
esc = input.charAt(parser_pos) === '\\';
|
424 |
+
if (input.charAt(parser_pos) === '[') {
|
425 |
+
in_char_class = true;
|
426 |
+
} else if (input.charAt(parser_pos) === ']') {
|
427 |
+
in_char_class = false;
|
428 |
+
}
|
429 |
+
} else {
|
430 |
+
esc = false;
|
431 |
+
}
|
432 |
+
parser_pos += 1;
|
433 |
+
if (parser_pos >= input_length) {
|
434 |
+
// incomplete string/rexp when end-of-file reached.
|
435 |
+
// bail out with what had been received so far.
|
436 |
+
return [resulting_string, 'TK_STRING'];
|
437 |
+
}
|
438 |
+
}
|
439 |
+
|
440 |
+
} else {
|
441 |
+
//
|
442 |
+
// and handle string also separately
|
443 |
+
//
|
444 |
+
while (esc || input.charAt(parser_pos) !== sep) {
|
445 |
+
resulting_string += input.charAt(parser_pos);
|
446 |
+
if (!esc) {
|
447 |
+
esc = input.charAt(parser_pos) === '\\';
|
448 |
+
} else {
|
449 |
+
esc = false;
|
450 |
+
}
|
451 |
+
parser_pos += 1;
|
452 |
+
if (parser_pos >= input_length) {
|
453 |
+
// incomplete string/rexp when end-of-file reached.
|
454 |
+
// bail out with what had been received so far.
|
455 |
+
return [resulting_string, 'TK_STRING'];
|
456 |
+
}
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
|
461 |
+
|
462 |
+
}
|
463 |
+
|
464 |
+
parser_pos += 1;
|
465 |
+
|
466 |
+
resulting_string += sep;
|
467 |
+
|
468 |
+
if (sep === '/') {
|
469 |
+
// regexps may have modifiers /regexp/MOD , so fetch those, too
|
470 |
+
while (parser_pos < input_length && in_array(input.charAt(parser_pos), wordchar)) {
|
471 |
+
resulting_string += input.charAt(parser_pos);
|
472 |
+
parser_pos += 1;
|
473 |
+
}
|
474 |
+
}
|
475 |
+
return [resulting_string, 'TK_STRING'];
|
476 |
+
}
|
477 |
+
|
478 |
+
if (c === '#') {
|
479 |
+
|
480 |
+
|
481 |
+
if (output.length === 0 && input.charAt(parser_pos) === '!') {
|
482 |
+
// shebang
|
483 |
+
resulting_string = c;
|
484 |
+
while (parser_pos < input_length && c != '\n') {
|
485 |
+
c = input.charAt(parser_pos);
|
486 |
+
resulting_string += c;
|
487 |
+
parser_pos += 1;
|
488 |
+
}
|
489 |
+
output.push(trim(resulting_string) + '\n');
|
490 |
+
print_newline();
|
491 |
+
return get_next_token();
|
492 |
+
}
|
493 |
+
|
494 |
+
|
495 |
+
|
496 |
+
// Spidermonkey-specific sharp variables for circular references
|
497 |
+
// https://developer.mozilla.org/En/Sharp_variables_in_JavaScript
|
498 |
+
// http://mxr.mozilla.org/mozilla-central/source/js/src/jsscan.cpp around line 1935
|
499 |
+
var sharp = '#';
|
500 |
+
if (parser_pos < input_length && in_array(input.charAt(parser_pos), digits)) {
|
501 |
+
do {
|
502 |
+
c = input.charAt(parser_pos);
|
503 |
+
sharp += c;
|
504 |
+
parser_pos += 1;
|
505 |
+
} while (parser_pos < input_length && c !== '#' && c !== '=');
|
506 |
+
if (c === '#') {
|
507 |
+
//
|
508 |
+
} else if (input.charAt(parser_pos) === '[' && input.charAt(parser_pos + 1) === ']') {
|
509 |
+
sharp += '[]';
|
510 |
+
parser_pos += 2;
|
511 |
+
} else if (input.charAt(parser_pos) === '{' && input.charAt(parser_pos + 1) === '}') {
|
512 |
+
sharp += '{}';
|
513 |
+
parser_pos += 2;
|
514 |
+
}
|
515 |
+
return [sharp, 'TK_WORD'];
|
516 |
+
}
|
517 |
+
}
|
518 |
+
|
519 |
+
if (c === '<' && input.substring(parser_pos - 1, parser_pos + 3) === '<!--') {
|
520 |
+
parser_pos += 3;
|
521 |
+
flags.in_html_comment = true;
|
522 |
+
return ['<!--', 'TK_COMMENT'];
|
523 |
+
}
|
524 |
+
|
525 |
+
if (c === '-' && flags.in_html_comment && input.substring(parser_pos - 1, parser_pos + 2) === '-->') {
|
526 |
+
flags.in_html_comment = false;
|
527 |
+
parser_pos += 2;
|
528 |
+
if (wanted_newline) {
|
529 |
+
print_newline();
|
530 |
+
}
|
531 |
+
return ['-->', 'TK_COMMENT'];
|
532 |
+
}
|
533 |
+
|
534 |
+
if (in_array(c, punct)) {
|
535 |
+
while (parser_pos < input_length && in_array(c + input.charAt(parser_pos), punct)) {
|
536 |
+
c += input.charAt(parser_pos);
|
537 |
+
parser_pos += 1;
|
538 |
+
if (parser_pos >= input_length) {
|
539 |
+
break;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
|
543 |
+
if (c === '=') {
|
544 |
+
return [c, 'TK_EQUALS'];
|
545 |
+
} else {
|
546 |
+
return [c, 'TK_OPERATOR'];
|
547 |
+
}
|
548 |
+
}
|
549 |
+
|
550 |
+
return [c, 'TK_UNKNOWN'];
|
551 |
+
}
|
552 |
+
|
553 |
+
//----------------------------------
|
554 |
+
indent_string = '';
|
555 |
+
while (opt_indent_size > 0) {
|
556 |
+
indent_string += opt_indent_char;
|
557 |
+
opt_indent_size -= 1;
|
558 |
+
}
|
559 |
+
|
560 |
+
input = js_source_text;
|
561 |
+
|
562 |
+
last_word = ''; // last 'TK_WORD' passed
|
563 |
+
last_type = 'TK_START_EXPR'; // last token type
|
564 |
+
last_text = ''; // last token text
|
565 |
+
last_last_text = ''; // pre-last token text
|
566 |
+
output = [];
|
567 |
+
|
568 |
+
do_block_just_closed = false;
|
569 |
+
|
570 |
+
whitespace = "\n\r\t ".split('');
|
571 |
+
wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split('');
|
572 |
+
digits = '0123456789'.split('');
|
573 |
+
|
574 |
+
punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::'.split(' ');
|
575 |
+
|
576 |
+
// words which should always start on new line.
|
577 |
+
line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',');
|
578 |
+
|
579 |
+
// states showing if we are currently in expression (i.e. "if" case) - 'EXPRESSION', or in usual block (like, procedure), 'BLOCK'.
|
580 |
+
// some formatting depends on that.
|
581 |
+
flag_store = [];
|
582 |
+
set_mode('BLOCK');
|
583 |
+
|
584 |
+
parser_pos = 0;
|
585 |
+
while (true) {
|
586 |
+
var t = get_next_token(parser_pos);
|
587 |
+
token_text = t[0];
|
588 |
+
token_type = t[1];
|
589 |
+
if (token_type === 'TK_EOF') {
|
590 |
+
break;
|
591 |
+
}
|
592 |
+
|
593 |
+
switch (token_type) {
|
594 |
+
|
595 |
+
case 'TK_START_EXPR':
|
596 |
+
|
597 |
+
if (token_text === '[') {
|
598 |
+
|
599 |
+
if (last_type === 'TK_WORD' || last_text === ')') {
|
600 |
+
// this is array index specifier, break immediately
|
601 |
+
// a[x], fn()[x]
|
602 |
+
if (in_array(last_text, line_starters)) {
|
603 |
+
print_single_space();
|
604 |
+
}
|
605 |
+
set_mode('(EXPRESSION)');
|
606 |
+
print_token();
|
607 |
+
break;
|
608 |
+
}
|
609 |
+
|
610 |
+
if (flags.mode === '[EXPRESSION]' || flags.mode === '[INDENTED-EXPRESSION]') {
|
611 |
+
if (last_last_text === ']' && last_text === ',') {
|
612 |
+
// ], [ goes to new line
|
613 |
+
if (flags.mode === '[EXPRESSION]') {
|
614 |
+
flags.mode = '[INDENTED-EXPRESSION]';
|
615 |
+
if (!opt_keep_array_indentation) {
|
616 |
+
indent();
|
617 |
+
}
|
618 |
+
}
|
619 |
+
set_mode('[EXPRESSION]');
|
620 |
+
if (!opt_keep_array_indentation) {
|
621 |
+
print_newline();
|
622 |
+
}
|
623 |
+
} else if (last_text === '[') {
|
624 |
+
if (flags.mode === '[EXPRESSION]') {
|
625 |
+
flags.mode = '[INDENTED-EXPRESSION]';
|
626 |
+
if (!opt_keep_array_indentation) {
|
627 |
+
indent();
|
628 |
+
}
|
629 |
+
}
|
630 |
+
set_mode('[EXPRESSION]');
|
631 |
+
|
632 |
+
if (!opt_keep_array_indentation) {
|
633 |
+
print_newline();
|
634 |
+
}
|
635 |
+
} else {
|
636 |
+
set_mode('[EXPRESSION]');
|
637 |
+
}
|
638 |
+
} else {
|
639 |
+
set_mode('[EXPRESSION]');
|
640 |
+
}
|
641 |
+
|
642 |
+
|
643 |
+
|
644 |
+
} else {
|
645 |
+
set_mode('(EXPRESSION)');
|
646 |
+
}
|
647 |
+
|
648 |
+
if (last_text === ';' || last_type === 'TK_START_BLOCK') {
|
649 |
+
print_newline();
|
650 |
+
} else if (last_type === 'TK_END_EXPR' || last_type === 'TK_START_EXPR' || last_type === 'TK_END_BLOCK' || last_text === '.') {
|
651 |
+
// do nothing on (( and )( and ][ and ]( and .(
|
652 |
+
} else if (last_type !== 'TK_WORD' && last_type !== 'TK_OPERATOR') {
|
653 |
+
print_single_space();
|
654 |
+
} else if (last_word === 'function' || last_word === 'typeof') {
|
655 |
+
// function() vs function ()
|
656 |
+
if (opt_jslint_happy) {
|
657 |
+
print_single_space();
|
658 |
+
}
|
659 |
+
} else if (in_array(last_text, line_starters) || last_text === 'catch') {
|
660 |
+
print_single_space();
|
661 |
+
}
|
662 |
+
print_token();
|
663 |
+
|
664 |
+
break;
|
665 |
+
|
666 |
+
case 'TK_END_EXPR':
|
667 |
+
if (token_text === ']') {
|
668 |
+
if (opt_keep_array_indentation) {
|
669 |
+
if (last_text === '}') {
|
670 |
+
// trim_output();
|
671 |
+
// print_newline(true);
|
672 |
+
remove_indent();
|
673 |
+
print_token();
|
674 |
+
restore_mode();
|
675 |
+
break;
|
676 |
+
}
|
677 |
+
} else {
|
678 |
+
if (flags.mode === '[INDENTED-EXPRESSION]') {
|
679 |
+
if (last_text === ']') {
|
680 |
+
restore_mode();
|
681 |
+
print_newline();
|
682 |
+
print_token();
|
683 |
+
break;
|
684 |
+
}
|
685 |
+
}
|
686 |
+
}
|
687 |
+
}
|
688 |
+
restore_mode();
|
689 |
+
print_token();
|
690 |
+
break;
|
691 |
+
|
692 |
+
case 'TK_START_BLOCK':
|
693 |
+
|
694 |
+
if (last_word === 'do') {
|
695 |
+
set_mode('DO_BLOCK');
|
696 |
+
} else {
|
697 |
+
set_mode('BLOCK');
|
698 |
+
}
|
699 |
+
if (opt_brace_style=="expand") {
|
700 |
+
if (last_type !== 'TK_OPERATOR') {
|
701 |
+
if (last_text === 'return' || last_text === '=') {
|
702 |
+
print_single_space();
|
703 |
+
} else {
|
704 |
+
print_newline(true);
|
705 |
+
}
|
706 |
+
}
|
707 |
+
print_token();
|
708 |
+
indent();
|
709 |
+
} else {
|
710 |
+
if (last_type !== 'TK_OPERATOR' && last_type !== 'TK_START_EXPR') {
|
711 |
+
if (last_type === 'TK_START_BLOCK') {
|
712 |
+
print_newline();
|
713 |
+
} else {
|
714 |
+
print_single_space();
|
715 |
+
}
|
716 |
+
} else {
|
717 |
+
// if TK_OPERATOR or TK_START_EXPR
|
718 |
+
if (is_array(flags.previous_mode) && last_text === ',') {
|
719 |
+
if (last_last_text === '}') {
|
720 |
+
// }, { in array context
|
721 |
+
print_single_space();
|
722 |
+
} else {
|
723 |
+
print_newline(); // [a, b, c, {
|
724 |
+
}
|
725 |
+
}
|
726 |
+
}
|
727 |
+
indent();
|
728 |
+
print_token();
|
729 |
+
}
|
730 |
+
|
731 |
+
break;
|
732 |
+
|
733 |
+
case 'TK_END_BLOCK':
|
734 |
+
restore_mode();
|
735 |
+
if (opt_brace_style=="expand") {
|
736 |
+
if (last_text !== '{') {
|
737 |
+
print_newline();
|
738 |
+
}
|
739 |
+
print_token();
|
740 |
+
} else {
|
741 |
+
if (last_type === 'TK_START_BLOCK') {
|
742 |
+
// nothing
|
743 |
+
if (just_added_newline) {
|
744 |
+
remove_indent();
|
745 |
+
} else {
|
746 |
+
// {}
|
747 |
+
trim_output();
|
748 |
+
}
|
749 |
+
} else {
|
750 |
+
if (is_array(flags.mode) && opt_keep_array_indentation) {
|
751 |
+
// we REALLY need a newline here, but newliner would skip that
|
752 |
+
opt_keep_array_indentation = false;
|
753 |
+
print_newline();
|
754 |
+
opt_keep_array_indentation = true;
|
755 |
+
|
756 |
+
} else {
|
757 |
+
print_newline();
|
758 |
+
}
|
759 |
+
}
|
760 |
+
print_token();
|
761 |
+
}
|
762 |
+
break;
|
763 |
+
|
764 |
+
case 'TK_WORD':
|
765 |
+
|
766 |
+
// no, it's not you. even I have problems understanding how this works
|
767 |
+
// and what does what.
|
768 |
+
if (do_block_just_closed) {
|
769 |
+
// do {} ## while ()
|
770 |
+
print_single_space();
|
771 |
+
print_token();
|
772 |
+
print_single_space();
|
773 |
+
do_block_just_closed = false;
|
774 |
+
break;
|
775 |
+
}
|
776 |
+
|
777 |
+
if (token_text === 'function') {
|
778 |
+
if (flags.var_line) {
|
779 |
+
flags.var_line_reindented = true;
|
780 |
+
}
|
781 |
+
if ((just_added_newline || last_text === ';') && last_text !== '{') {
|
782 |
+
// make sure there is a nice clean space of at least one blank line
|
783 |
+
// before a new function definition
|
784 |
+
n_newlines = just_added_newline ? n_newlines : 0;
|
785 |
+
if ( ! opt_preserve_newlines) {
|
786 |
+
n_newlines = 1;
|
787 |
+
}
|
788 |
+
|
789 |
+
for (var i = 0; i < 2 - n_newlines; i++) {
|
790 |
+
print_newline(false);
|
791 |
+
}
|
792 |
+
}
|
793 |
+
}
|
794 |
+
|
795 |
+
if (token_text === 'case' || token_text === 'default') {
|
796 |
+
if (last_text === ':') {
|
797 |
+
// switch cases following one another
|
798 |
+
remove_indent();
|
799 |
+
} else {
|
800 |
+
// case statement starts in the same line where switch
|
801 |
+
flags.indentation_level--;
|
802 |
+
print_newline();
|
803 |
+
flags.indentation_level++;
|
804 |
+
}
|
805 |
+
print_token();
|
806 |
+
flags.in_case = true;
|
807 |
+
break;
|
808 |
+
}
|
809 |
+
|
810 |
+
prefix = 'NONE';
|
811 |
+
|
812 |
+
if (last_type === 'TK_END_BLOCK') {
|
813 |
+
|
814 |
+
if (!in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) {
|
815 |
+
prefix = 'NEWLINE';
|
816 |
+
} else {
|
817 |
+
if (opt_brace_style=="expand" || opt_brace_style=="end-expand") {
|
818 |
+
prefix = 'NEWLINE';
|
819 |
+
} else {
|
820 |
+
prefix = 'SPACE';
|
821 |
+
print_single_space();
|
822 |
+
}
|
823 |
+
}
|
824 |
+
} else if (last_type === 'TK_SEMICOLON' && (flags.mode === 'BLOCK' || flags.mode === 'DO_BLOCK')) {
|
825 |
+
prefix = 'NEWLINE';
|
826 |
+
} else if (last_type === 'TK_SEMICOLON' && is_expression(flags.mode)) {
|
827 |
+
prefix = 'SPACE';
|
828 |
+
} else if (last_type === 'TK_STRING') {
|
829 |
+
prefix = 'NEWLINE';
|
830 |
+
} else if (last_type === 'TK_WORD') {
|
831 |
+
if (last_text === 'else') {
|
832 |
+
// eat newlines between ...else *** some_op...
|
833 |
+
// won't preserve extra newlines in this place (if any), but don't care that much
|
834 |
+
trim_output(true);
|
835 |
+
}
|
836 |
+
prefix = 'SPACE';
|
837 |
+
} else if (last_type === 'TK_START_BLOCK') {
|
838 |
+
prefix = 'NEWLINE';
|
839 |
+
} else if (last_type === 'TK_END_EXPR') {
|
840 |
+
print_single_space();
|
841 |
+
prefix = 'NEWLINE';
|
842 |
+
}
|
843 |
+
|
844 |
+
if (in_array(token_text, line_starters) && last_text !== ')') {
|
845 |
+
if (last_text == 'else') {
|
846 |
+
prefix = 'SPACE';
|
847 |
+
} else {
|
848 |
+
prefix = 'NEWLINE';
|
849 |
+
}
|
850 |
+
}
|
851 |
+
|
852 |
+
if (flags.if_line && last_type === 'TK_END_EXPR') {
|
853 |
+
flags.if_line = false;
|
854 |
+
}
|
855 |
+
if (in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) {
|
856 |
+
if (last_type !== 'TK_END_BLOCK' || opt_brace_style=="expand" || opt_brace_style=="end-expand") {
|
857 |
+
print_newline();
|
858 |
+
} else {
|
859 |
+
trim_output(true);
|
860 |
+
print_single_space();
|
861 |
+
}
|
862 |
+
} else if (prefix === 'NEWLINE') {
|
863 |
+
if ((last_type === 'TK_START_EXPR' || last_text === '=' || last_text === ',') && token_text === 'function') {
|
864 |
+
// no need to force newline on 'function': (function
|
865 |
+
// DONOTHING
|
866 |
+
} else if (token_text === 'function' && last_text == 'new') {
|
867 |
+
print_single_space();
|
868 |
+
} else if (last_text === 'return' || last_text === 'throw') {
|
869 |
+
// no newline between 'return nnn'
|
870 |
+
print_single_space();
|
871 |
+
} else if (last_type !== 'TK_END_EXPR') {
|
872 |
+
if ((last_type !== 'TK_START_EXPR' || token_text !== 'var') && last_text !== ':') {
|
873 |
+
// no need to force newline on 'var': for (var x = 0...)
|
874 |
+
if (token_text === 'if' && last_word === 'else' && last_text !== '{') {
|
875 |
+
// no newline for } else if {
|
876 |
+
print_single_space();
|
877 |
+
} else {
|
878 |
+
flags.var_line = false;
|
879 |
+
flags.var_line_reindented = false;
|
880 |
+
print_newline();
|
881 |
+
}
|
882 |
+
}
|
883 |
+
} else if (in_array(token_text, line_starters) && last_text != ')') {
|
884 |
+
flags.var_line = false;
|
885 |
+
flags.var_line_reindented = false;
|
886 |
+
print_newline();
|
887 |
+
}
|
888 |
+
} else if (is_array(flags.mode) && last_text === ',' && last_last_text === '}') {
|
889 |
+
print_newline(); // }, in lists get a newline treatment
|
890 |
+
} else if (prefix === 'SPACE') {
|
891 |
+
print_single_space();
|
892 |
+
}
|
893 |
+
print_token();
|
894 |
+
last_word = token_text;
|
895 |
+
|
896 |
+
if (token_text === 'var') {
|
897 |
+
flags.var_line = true;
|
898 |
+
flags.var_line_reindented = false;
|
899 |
+
flags.var_line_tainted = false;
|
900 |
+
}
|
901 |
+
|
902 |
+
if (token_text === 'if') {
|
903 |
+
flags.if_line = true;
|
904 |
+
}
|
905 |
+
if (token_text === 'else') {
|
906 |
+
flags.if_line = false;
|
907 |
+
}
|
908 |
+
|
909 |
+
break;
|
910 |
+
|
911 |
+
case 'TK_SEMICOLON':
|
912 |
+
|
913 |
+
print_token();
|
914 |
+
flags.var_line = false;
|
915 |
+
flags.var_line_reindented = false;
|
916 |
+
if (flags.mode == 'OBJECT') {
|
917 |
+
// OBJECT mode is weird and doesn't get reset too well.
|
918 |
+
flags.mode = 'BLOCK';
|
919 |
+
}
|
920 |
+
break;
|
921 |
+
|
922 |
+
case 'TK_STRING':
|
923 |
+
|
924 |
+
if (last_type === 'TK_START_BLOCK' || last_type === 'TK_END_BLOCK' || last_type === 'TK_SEMICOLON') {
|
925 |
+
print_newline();
|
926 |
+
} else if (last_type === 'TK_WORD') {
|
927 |
+
print_single_space();
|
928 |
+
}
|
929 |
+
print_token();
|
930 |
+
break;
|
931 |
+
|
932 |
+
case 'TK_EQUALS':
|
933 |
+
if (flags.var_line) {
|
934 |
+
// just got an '=' in a var-line, different formatting/line-breaking, etc will now be done
|
935 |
+
flags.var_line_tainted = true;
|
936 |
+
}
|
937 |
+
print_single_space();
|
938 |
+
print_token();
|
939 |
+
print_single_space();
|
940 |
+
break;
|
941 |
+
|
942 |
+
case 'TK_OPERATOR':
|
943 |
+
|
944 |
+
var space_before = true;
|
945 |
+
var space_after = true;
|
946 |
+
|
947 |
+
if (flags.var_line && token_text === ',' && (is_expression(flags.mode))) {
|
948 |
+
// do not break on comma, for(var a = 1, b = 2)
|
949 |
+
flags.var_line_tainted = false;
|
950 |
+
}
|
951 |
+
|
952 |
+
if (flags.var_line) {
|
953 |
+
if (token_text === ',') {
|
954 |
+
if (flags.var_line_tainted) {
|
955 |
+
print_token();
|
956 |
+
flags.var_line_reindented = true;
|
957 |
+
flags.var_line_tainted = false;
|
958 |
+
print_newline();
|
959 |
+
break;
|
960 |
+
} else {
|
961 |
+
flags.var_line_tainted = false;
|
962 |
+
}
|
963 |
+
// } else if (token_text === ':') {
|
964 |
+
// hmm, when does this happen? tests don't catch this
|
965 |
+
// flags.var_line = false;
|
966 |
+
}
|
967 |
+
}
|
968 |
+
|
969 |
+
if (last_text === 'return' || last_text === 'throw') {
|
970 |
+
// "return" had a special handling in TK_WORD. Now we need to return the favor
|
971 |
+
print_single_space();
|
972 |
+
print_token();
|
973 |
+
break;
|
974 |
+
}
|
975 |
+
|
976 |
+
if (token_text === ':' && flags.in_case) {
|
977 |
+
print_token(); // colon really asks for separate treatment
|
978 |
+
print_newline();
|
979 |
+
flags.in_case = false;
|
980 |
+
break;
|
981 |
+
}
|
982 |
+
|
983 |
+
if (token_text === '::') {
|
984 |
+
// no spaces around exotic namespacing syntax operator
|
985 |
+
print_token();
|
986 |
+
break;
|
987 |
+
}
|
988 |
+
|
989 |
+
if (token_text === ',') {
|
990 |
+
if (flags.var_line) {
|
991 |
+
if (flags.var_line_tainted) {
|
992 |
+
print_token();
|
993 |
+
print_newline();
|
994 |
+
flags.var_line_tainted = false;
|
995 |
+
} else {
|
996 |
+
print_token();
|
997 |
+
print_single_space();
|
998 |
+
}
|
999 |
+
} else if (last_type === 'TK_END_BLOCK' && flags.mode !== "(EXPRESSION)") {
|
1000 |
+
print_token();
|
1001 |
+
if (flags.mode === 'OBJECT' && last_text === '}') {
|
1002 |
+
print_newline();
|
1003 |
+
} else {
|
1004 |
+
print_single_space();
|
1005 |
+
}
|
1006 |
+
} else {
|
1007 |
+
if (flags.mode === 'OBJECT') {
|
1008 |
+
print_token();
|
1009 |
+
print_newline();
|
1010 |
+
} else {
|
1011 |
+
// EXPR or DO_BLOCK
|
1012 |
+
print_token();
|
1013 |
+
print_single_space();
|
1014 |
+
}
|
1015 |
+
}
|
1016 |
+
break;
|
1017 |
+
// } else if (in_array(token_text, ['--', '++', '!']) || (in_array(token_text, ['-', '+']) && (in_array(last_type, ['TK_START_BLOCK', 'TK_START_EXPR', 'TK_EQUALS']) || in_array(last_text, line_starters) || in_array(last_text, ['==', '!=', '+=', '-=', '*=', '/=', '+', '-'])))) {
|
1018 |
+
} else if (in_array(token_text, ['--', '++', '!']) || (in_array(token_text, ['-', '+']) && (in_array(last_type, ['TK_START_BLOCK', 'TK_START_EXPR', 'TK_EQUALS', 'TK_OPERATOR']) || in_array(last_text, line_starters)))) {
|
1019 |
+
// unary operators (and binary +/- pretending to be unary) special cases
|
1020 |
+
|
1021 |
+
space_before = false;
|
1022 |
+
space_after = false;
|
1023 |
+
|
1024 |
+
if (last_text === ';' && is_expression(flags.mode)) {
|
1025 |
+
// for (;; ++i)
|
1026 |
+
// ^^^
|
1027 |
+
space_before = true;
|
1028 |
+
}
|
1029 |
+
if (last_type === 'TK_WORD' && in_array(last_text, line_starters)) {
|
1030 |
+
space_before = true;
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
if (flags.mode === 'BLOCK' && (last_text === '{' || last_text === ';')) {
|
1034 |
+
// { foo; --i }
|
1035 |
+
// foo(); --bar;
|
1036 |
+
print_newline();
|
1037 |
+
}
|
1038 |
+
} else if (token_text === '.') {
|
1039 |
+
// decimal digits or object.property
|
1040 |
+
space_before = false;
|
1041 |
+
|
1042 |
+
} else if (token_text === ':') {
|
1043 |
+
if (flags.ternary_depth == 0) {
|
1044 |
+
flags.mode = 'OBJECT';
|
1045 |
+
space_before = false;
|
1046 |
+
} else {
|
1047 |
+
flags.ternary_depth -= 1;
|
1048 |
+
}
|
1049 |
+
} else if (token_text === '?') {
|
1050 |
+
flags.ternary_depth += 1;
|
1051 |
+
}
|
1052 |
+
if (space_before) {
|
1053 |
+
print_single_space();
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
print_token();
|
1057 |
+
|
1058 |
+
if (space_after) {
|
1059 |
+
print_single_space();
|
1060 |
+
}
|
1061 |
+
|
1062 |
+
if (token_text === '!') {
|
1063 |
+
// flags.eat_next_space = true;
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
break;
|
1067 |
+
|
1068 |
+
case 'TK_BLOCK_COMMENT':
|
1069 |
+
|
1070 |
+
var lines = token_text.split(/\x0a|\x0d\x0a/);
|
1071 |
+
|
1072 |
+
if (/^\/\*\*/.test(token_text)) {
|
1073 |
+
// javadoc: reformat and reindent
|
1074 |
+
print_newline();
|
1075 |
+
output.push(lines[0]);
|
1076 |
+
for (i = 1; i < lines.length; i++) {
|
1077 |
+
print_newline();
|
1078 |
+
output.push(' ');
|
1079 |
+
output.push(trim(lines[i]));
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
} else {
|
1083 |
+
|
1084 |
+
// simple block comment: leave intact
|
1085 |
+
if (lines.length > 1) {
|
1086 |
+
// multiline comment block starts with a new line
|
1087 |
+
print_newline();
|
1088 |
+
trim_output();
|
1089 |
+
} else {
|
1090 |
+
// single-line /* comment */ stays where it is
|
1091 |
+
print_single_space();
|
1092 |
+
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
for (i = 0; i < lines.length; i++) {
|
1096 |
+
output.push(lines[i]);
|
1097 |
+
output.push('\n');
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
}
|
1101 |
+
print_newline();
|
1102 |
+
break;
|
1103 |
+
|
1104 |
+
case 'TK_INLINE_COMMENT':
|
1105 |
+
|
1106 |
+
print_single_space();
|
1107 |
+
print_token();
|
1108 |
+
if (is_expression(flags.mode)) {
|
1109 |
+
print_single_space();
|
1110 |
+
} else {
|
1111 |
+
print_newline();
|
1112 |
+
}
|
1113 |
+
break;
|
1114 |
+
|
1115 |
+
case 'TK_COMMENT':
|
1116 |
+
|
1117 |
+
// print_newline();
|
1118 |
+
if (wanted_newline) {
|
1119 |
+
print_newline();
|
1120 |
+
} else {
|
1121 |
+
print_single_space();
|
1122 |
+
}
|
1123 |
+
print_token();
|
1124 |
+
print_newline();
|
1125 |
+
break;
|
1126 |
+
|
1127 |
+
case 'TK_UNKNOWN':
|
1128 |
+
if (last_text === 'return' || last_text === 'throw') {
|
1129 |
+
print_single_space();
|
1130 |
+
}
|
1131 |
+
print_token();
|
1132 |
+
break;
|
1133 |
+
}
|
1134 |
+
|
1135 |
+
last_last_text = last_text;
|
1136 |
+
last_type = token_type;
|
1137 |
+
last_text = token_text;
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
return output.join('').replace(/[\n ]+$/, '');
|
1141 |
+
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
1145 |
+
// and you will be able to `var js_beautify = require("beautify").js_beautify`.
|
1146 |
+
if (typeof exports !== "undefined")
|
1147 |
+
exports.js_beautify = js_beautify;
|
addons/codemagic/js/codemagic.js
ADDED
@@ -0,0 +1,620 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//vatriable definition
|
2 |
+
var the = {
|
3 |
+
beautify_in_progress: false,
|
4 |
+
coloring_active: true,
|
5 |
+
autocompletion_active: true,
|
6 |
+
wraptext_active: false
|
7 |
+
}
|
8 |
+
var hlLine = null;
|
9 |
+
var lastPos = null;
|
10 |
+
var lastQuery = null;
|
11 |
+
var marked = [];
|
12 |
+
var pluginCodeMirror = null;
|
13 |
+
var pluginOptions = {
|
14 |
+
lineNumbers: true,
|
15 |
+
mode: "text/html",
|
16 |
+
indentUnit: 4,
|
17 |
+
matchBrackets: true,
|
18 |
+
onCursorActivity: function() {
|
19 |
+
pluginCodeMirror.setLineClass(hlLine, null);
|
20 |
+
hlLine = pluginCodeMirror.setLineClass(pluginCodeMirror.getCursor().line, "activeline");
|
21 |
+
},
|
22 |
+
onKeyEvent: function(i, e) {
|
23 |
+
if(the.autocompletion_active) {
|
24 |
+
/* Hook into charcode < */
|
25 |
+
if(String.fromCharCode(e.which == null ? e.keyCode : e.which) == "<") {
|
26 |
+
e.stop();
|
27 |
+
|
28 |
+
var cur = pluginCodeMirror.getCursor(false), token = pluginCodeMirror.getTokenAt(cur);
|
29 |
+
pluginCodeMirror.replaceRange("<", cur);
|
30 |
+
|
31 |
+
setTimeout(startComplete, 50);
|
32 |
+
return true;
|
33 |
+
|
34 |
+
// Hook into ctrl + space
|
35 |
+
} if (e.keyCode == 32 && (e.ctrlKey || e.metaKey) && !e.altKey) {
|
36 |
+
e.stop();
|
37 |
+
return startComplete();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
},
|
41 |
+
onHighlightComplete: onChangeCallback
|
42 |
+
}
|
43 |
+
|
44 |
+
//language and init
|
45 |
+
//tinyMCEPopup.requireLangPack();
|
46 |
+
tinyMCEPopup.onInit.add(onLoadInit);
|
47 |
+
|
48 |
+
|
49 |
+
//onload
|
50 |
+
function onLoadInit() {
|
51 |
+
tinyMCEPopup.resizeToInnerSize();
|
52 |
+
|
53 |
+
// Remove Gecko spellchecking
|
54 |
+
if (tinymce.isGecko)
|
55 |
+
document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
|
56 |
+
|
57 |
+
//insert html from tinymce to htmlSource textarea
|
58 |
+
document.getElementById("htmlSource").value = tinyMCEPopup.editor.getContent({ source_view : true });
|
59 |
+
|
60 |
+
//format the source code using JS Beautifier plugin
|
61 |
+
beautify("htmlSource");
|
62 |
+
|
63 |
+
if(the.coloring_active) {
|
64 |
+
//activate syntax coloring
|
65 |
+
activateCodeColoring("htmlSource");
|
66 |
+
}
|
67 |
+
|
68 |
+
// Add word wrapping. Must be done after beautify() is called.
|
69 |
+
if (the.wraptext_active) {
|
70 |
+
activateWrapText();
|
71 |
+
document.getElementById('wraptext').checked = true;
|
72 |
+
} else {
|
73 |
+
document.getElementById('wraptext').checked = false;
|
74 |
+
}
|
75 |
+
|
76 |
+
//resize window to fit the textarea
|
77 |
+
resizeInputs("htmlSource");
|
78 |
+
|
79 |
+
window.onresize = function(event) {
|
80 |
+
//resize window to fit the textarea
|
81 |
+
resizeInputs("htmlSource");
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
//activating syntax coloring
|
88 |
+
function activateCodeColoring(id) {
|
89 |
+
the.coloring_active = true;
|
90 |
+
|
91 |
+
document.getElementById("search_replace").className = "";
|
92 |
+
document.getElementById("reintendt").className = "";
|
93 |
+
document.getElementById("autocompletion").disabled = false;
|
94 |
+
|
95 |
+
pluginCodeMirror = CodeMirror.fromTextArea(document.getElementById(id), pluginOptions);
|
96 |
+
hlLine = pluginCodeMirror.setLineClass(0, "activeline");
|
97 |
+
pluginCodeMirror.focus();
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
//deactivating syntax coloring
|
102 |
+
function deactivateCodeColoring() {
|
103 |
+
the.coloring_active = false;
|
104 |
+
|
105 |
+
document.getElementById("undo").className = "disabled";
|
106 |
+
document.getElementById("redo").className = "disabled";
|
107 |
+
document.getElementById("search_replace").className = "disabled";
|
108 |
+
document.getElementById("reintendt").className = "disabled";
|
109 |
+
document.getElementById("autocompletion").disabled = true;
|
110 |
+
|
111 |
+
pluginCodeMirror.toTextArea();
|
112 |
+
pluginCodeMirror = null;
|
113 |
+
|
114 |
+
//resize window to fit the textarea
|
115 |
+
resizeInputs("htmlSource");
|
116 |
+
}
|
117 |
+
|
118 |
+
function activateWrapText() {
|
119 |
+
the.wraptext_active = true;
|
120 |
+
|
121 |
+
var elm = document.getElementById("htmlSource").nextSibling;
|
122 |
+
if (elm.className.indexOf("wrapText") == -1) {
|
123 |
+
elm.className += ' wrapText';
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
function deactivateWrapText() {
|
128 |
+
the.wraptext_active = false;
|
129 |
+
|
130 |
+
var elm = document.getElementById("htmlSource").nextSibling;
|
131 |
+
var classes = elm.className.split(" ");
|
132 |
+
var wrap = classes.indexOf("wrapText");
|
133 |
+
|
134 |
+
if (wrap) {
|
135 |
+
classes.splice(wrap, 1);
|
136 |
+
elm.className = classes.join(" ");
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
//toggle highlighting using a checkbox
|
141 |
+
function toggleHighlighting(elm, id) {
|
142 |
+
if (elm.checked) {
|
143 |
+
activateCodeColoring(id);
|
144 |
+
} else {
|
145 |
+
deactivateCodeColoring();
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
//toggle code autocompletion
|
150 |
+
function toggleAutocompletion(elm) {
|
151 |
+
if (elm.checked) {
|
152 |
+
the.autocompletion_active = true;
|
153 |
+
} else {
|
154 |
+
the.autocompletion_active = false;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
//toggle text wrapping
|
159 |
+
function toggleWrapText(elm) {
|
160 |
+
if (elm.checked) {
|
161 |
+
activateWrapText();
|
162 |
+
} else {
|
163 |
+
deactivateWrapText();
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
//save content bact to tinymce editor
|
168 |
+
function saveContent() {
|
169 |
+
tinyMCEPopup.editor.setContent(pluginCodeMirror.getValue(), { source_view : true });
|
170 |
+
tinyMCEPopup.close();
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
//resize textarea input
|
175 |
+
function resizeInputs(id) {
|
176 |
+
var vp = tinyMCEPopup.dom.getViewPort(window), el;
|
177 |
+
|
178 |
+
el = document.getElementById(id);
|
179 |
+
|
180 |
+
if (el) {
|
181 |
+
//el.style.width = (vp.w - 20) + "px";
|
182 |
+
el.style.height = (vp.h - 65) + "px";
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
//toggle search window
|
188 |
+
function toggleSearch(elm, id) {
|
189 |
+
if(!the.coloring_active) return false;
|
190 |
+
|
191 |
+
elm.className = "";
|
192 |
+
var element = document.getElementById(id);
|
193 |
+
|
194 |
+
if(element.style.display == "none") {
|
195 |
+
elm.className = "selected";
|
196 |
+
element.style.display = "block";
|
197 |
+
}
|
198 |
+
else element.style.display = "none";
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
|
206 |
+
/**
|
207 |
+
* CodeMirror 2
|
208 |
+
* -------------
|
209 |
+
*
|
210 |
+
* CodeMirror 2 is a rewrite of CodeMirror 1 (http://github.com/marijnh/CodeMirror).
|
211 |
+
* The docs live here http://codemirror.net/2/manual.html,
|
212 |
+
* and the project page is http://codemirror.net/2/.
|
213 |
+
* *
|
214 |
+
* http://codemirror.net/
|
215 |
+
*
|
216 |
+
* Copyright (C) 2011 by Marijn Haverbeke <marijnh@gmail.com>
|
217 |
+
*/
|
218 |
+
|
219 |
+
|
220 |
+
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
221 |
+
var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
|
222 |
+
var jsMode = CodeMirror.getMode(config, "javascript");
|
223 |
+
var cssMode = CodeMirror.getMode(config, "css");
|
224 |
+
|
225 |
+
function html(stream, state) {
|
226 |
+
var style = htmlMode.token(stream, state.htmlState);
|
227 |
+
if (style == "xml-tag" && stream.current() == ">" && state.htmlState.context) {
|
228 |
+
if (/^script$/i.test(state.htmlState.context.tagName)) {
|
229 |
+
state.token = javascript;
|
230 |
+
state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
|
231 |
+
} else if (/^style$/i.test(state.htmlState.context.tagName)) {
|
232 |
+
state.token = css;
|
233 |
+
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
|
234 |
+
}
|
235 |
+
}
|
236 |
+
return style;
|
237 |
+
}
|
238 |
+
function maybeBackup(stream, pat, style) {
|
239 |
+
var cur = stream.current();
|
240 |
+
var close = cur.search(pat);
|
241 |
+
if (close > -1) stream.backUp(cur.length - close);
|
242 |
+
return style;
|
243 |
+
}
|
244 |
+
|
245 |
+
function javascript(stream, state) {
|
246 |
+
if (stream.match(/^<\/\s*script\s*>/i, false)) {
|
247 |
+
state.token = html;
|
248 |
+
state.curState = null;
|
249 |
+
return html(stream, state);
|
250 |
+
}
|
251 |
+
return maybeBackup(stream, /<\/\s*script\s*>/, jsMode.token(stream, state.localState));
|
252 |
+
}
|
253 |
+
function css(stream, state) {
|
254 |
+
if (stream.match(/^<\/\s*style\s*>/i, false)) {
|
255 |
+
state.token = html;
|
256 |
+
state.localState = null;
|
257 |
+
return html(stream, state);
|
258 |
+
}
|
259 |
+
return maybeBackup(stream, /<\/\s*style\s*>/, cssMode.token(stream, state.localState));
|
260 |
+
}
|
261 |
+
|
262 |
+
return {
|
263 |
+
startState: function() {
|
264 |
+
var state = htmlMode.startState();
|
265 |
+
return {token: html, localState: null, htmlState: state};
|
266 |
+
},
|
267 |
+
|
268 |
+
copyState: function(state) {
|
269 |
+
if (state.localState)
|
270 |
+
var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState);
|
271 |
+
return {token: state.token, localState: local, htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
272 |
+
},
|
273 |
+
|
274 |
+
token: function(stream, state) {
|
275 |
+
return state.token(stream, state);
|
276 |
+
},
|
277 |
+
|
278 |
+
indent: function(state, textAfter) {
|
279 |
+
if (state.token == html || /^\s*<\//.test(textAfter))
|
280 |
+
return htmlMode.indent(state.htmlState, textAfter);
|
281 |
+
else if (state.token == javascript)
|
282 |
+
return jsMode.indent(state.localState, textAfter);
|
283 |
+
else
|
284 |
+
return cssMode.indent(state.localState, textAfter);
|
285 |
+
},
|
286 |
+
|
287 |
+
electricChars: "/{}:"
|
288 |
+
}
|
289 |
+
});
|
290 |
+
|
291 |
+
CodeMirror.defineMIME("text/html", "htmlmixed");
|
292 |
+
|
293 |
+
////////////////////////
|
294 |
+
//undo last action
|
295 |
+
function undo() {
|
296 |
+
pluginCodeMirror.undo();
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
//redo last action
|
301 |
+
function redo() {
|
302 |
+
pluginCodeMirror.redo();
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
//callback to onchange event on editor
|
307 |
+
function onChangeCallback(editor) {
|
308 |
+
var undo = editor.historySize().undo;
|
309 |
+
var redo = editor.historySize().redo;
|
310 |
+
|
311 |
+
if(undo > 0) document.getElementById("undo").className = "";
|
312 |
+
else document.getElementById("undo").className = "disabled";
|
313 |
+
|
314 |
+
if(redo > 0) document.getElementById("redo").className = "";
|
315 |
+
else document.getElementById("redo").className = "disabled";
|
316 |
+
}
|
317 |
+
|
318 |
+
////////////////////////
|
319 |
+
//reintendt html source code
|
320 |
+
function reIntendt(id) {
|
321 |
+
if(!the.coloring_active) return false;
|
322 |
+
|
323 |
+
deactivateCodeColoring();
|
324 |
+
document.getElementById("searchWindow").style.display = "none";
|
325 |
+
beautify(id);
|
326 |
+
activateCodeColoring(id);
|
327 |
+
}
|
328 |
+
|
329 |
+
////////////////////////
|
330 |
+
//search and replace
|
331 |
+
|
332 |
+
//unmarks all searched words
|
333 |
+
function unmark() {
|
334 |
+
for (var i = 0; i < marked.length; ++i) marked[i]();
|
335 |
+
marked.length = 0;
|
336 |
+
}
|
337 |
+
|
338 |
+
//search for query from #query input
|
339 |
+
function searchCode() {
|
340 |
+
unmark();
|
341 |
+
|
342 |
+
var text = document.getElementById("query").value;
|
343 |
+
if (!text) return false;
|
344 |
+
|
345 |
+
if(!pluginCodeMirror.getSearchCursor(text).findNext()) {
|
346 |
+
alert(tinyMCEPopup.getLang('codemagic_dlg.nothing_found'));
|
347 |
+
return false;
|
348 |
+
}
|
349 |
+
|
350 |
+
for (var cursor = pluginCodeMirror.getSearchCursor(text); cursor.findNext();)
|
351 |
+
marked.push(pluginCodeMirror.markText(cursor.from(), cursor.to(), "searched"));
|
352 |
+
|
353 |
+
if (lastQuery != text) lastPos = null;
|
354 |
+
|
355 |
+
var cursor = pluginCodeMirror.getSearchCursor(text, lastPos || pluginCodeMirror.getCursor());
|
356 |
+
if (!cursor.findNext()) {
|
357 |
+
cursor = pluginCodeMirror.getSearchCursor(text);
|
358 |
+
if (!cursor.findNext()) return;
|
359 |
+
}
|
360 |
+
pluginCodeMirror.setSelection(cursor.from(), cursor.to());
|
361 |
+
lastQuery = text; lastPos = cursor.to();
|
362 |
+
}
|
363 |
+
|
364 |
+
//replace
|
365 |
+
function replaceCode() {
|
366 |
+
unmark();
|
367 |
+
|
368 |
+
var text = document.getElementById("query").value;
|
369 |
+
var replace = document.getElementById("replace").value;
|
370 |
+
|
371 |
+
if (!text) return false;
|
372 |
+
|
373 |
+
if(!pluginCodeMirror.getSearchCursor(text).findNext()) {
|
374 |
+
alert(tinyMCEPopup.getLang('codemagic_dlg.nothing_to_replace'));
|
375 |
+
return false;
|
376 |
+
}
|
377 |
+
|
378 |
+
for (var cursor = pluginCodeMirror.getSearchCursor(text); cursor.findNext();)
|
379 |
+
pluginCodeMirror.replaceRange(replace, cursor.from(), cursor.to());
|
380 |
+
}
|
381 |
+
|
382 |
+
|
383 |
+
////////////////////////
|
384 |
+
//autocompletion
|
385 |
+
var tagNames = ("a abbr acronym address applet area b base basefont bdo big blockquote body br button" +
|
386 |
+
" caption center cite code col colgroup dd del dfn dir div dl dt em fieldset font form frame " +
|
387 |
+
" frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map" +
|
388 |
+
" menu meta noframes noscript object ol optgroup option p param pre q s samp script select small" +
|
389 |
+
" span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var").split(" ");
|
390 |
+
|
391 |
+
var pairedTags = ("a abbr acronym address applet b bdo big blockquote body button" +
|
392 |
+
" caption center cite code colgroup del dfn dir div dl em fieldset font form" +
|
393 |
+
" frameset h1 h2 h3 h4 h5 h6 head html i iframe ins kbd label legend li map" +
|
394 |
+
" menu noframes noscript object ol optgroup option p pre q s samp script select small" +
|
395 |
+
" span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var").split(" ");
|
396 |
+
|
397 |
+
var unPairedTags = ("area base basefont br col dd dt frame hr img input isindex link meta param").split(" ");
|
398 |
+
|
399 |
+
var specialTags = {
|
400 |
+
"applet" : { tag: 'applet width="" height=""></applet>', cusror: 8 },
|
401 |
+
"area" : { tag: 'area alt="" />', cusror: 6 },
|
402 |
+
"base" : { tag: 'base href="" />', cusror: 7 },
|
403 |
+
"form" : { tag: 'form action=""></form>', cusror: 9 },
|
404 |
+
"img" : { tag: 'img src="" alt="" />', cusror: 6 },
|
405 |
+
"map" : { tag: 'map name=""></map>', cusror: 7 },
|
406 |
+
"meta" : { tag: 'meta content="" />', cusror: 10 },
|
407 |
+
"optgroup" : { tag: 'optgroup label=""></optgroup>', cusror: 8 },
|
408 |
+
"param" : { tag: 'param name="" />', cusror: 7 },
|
409 |
+
"script" : { tag: 'script type=""></script>', cusror: 7 },
|
410 |
+
"style" : { tag: 'style type=""></style>', cusror: 7 },
|
411 |
+
"textarea" : { tag: 'textarea cols="" rows=""></textarea>', cusror: 7 }
|
412 |
+
}
|
413 |
+
|
414 |
+
// Minimal event-handling wrapper.
|
415 |
+
function stopEvent() {
|
416 |
+
if (this.preventDefault) {this.preventDefault(); this.stopPropagation();}
|
417 |
+
else {this.returnValue = false; this.cancelBubble = true;}
|
418 |
+
}
|
419 |
+
function addStop(event) {
|
420 |
+
if (!event.stop) event.stop = stopEvent;
|
421 |
+
return event;
|
422 |
+
}
|
423 |
+
function connect(node, type, handler) {
|
424 |
+
function wrapHandler(event) {
|
425 |
+
handler(addStop(event || window.event));
|
426 |
+
}
|
427 |
+
|
428 |
+
if (typeof node.addEventListener == "function")
|
429 |
+
node.addEventListener(type, wrapHandler, false);
|
430 |
+
else
|
431 |
+
node.attachEvent("on" + type, wrapHandler);
|
432 |
+
}
|
433 |
+
|
434 |
+
function forEach(arr, f) {
|
435 |
+
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
436 |
+
}
|
437 |
+
|
438 |
+
Array.prototype.inArray = function(value){
|
439 |
+
for (var key in this)
|
440 |
+
if (this[key] === value) return true;
|
441 |
+
return false;
|
442 |
+
}
|
443 |
+
|
444 |
+
|
445 |
+
|
446 |
+
//autocompletion start
|
447 |
+
function startComplete() {
|
448 |
+
var startingTag, unPaired;
|
449 |
+
|
450 |
+
// We want a single cursor position.
|
451 |
+
if (pluginCodeMirror.somethingSelected()) return;
|
452 |
+
|
453 |
+
// Find the token at the cursor
|
454 |
+
var cur = pluginCodeMirror.getCursor(false), token = pluginCodeMirror.getTokenAt(cur), tprop = token;
|
455 |
+
|
456 |
+
if(token.string.indexOf("<") == 0 && token.string.indexOf("</") != 0) {
|
457 |
+
token.string = token.string.replace("<", "");
|
458 |
+
token.start++;
|
459 |
+
startingTag = true;
|
460 |
+
} else if(token.string.indexOf("</") == 0) {
|
461 |
+
token.string = token.string.replace("</", "");
|
462 |
+
token.start += 2;
|
463 |
+
startingTag = false;
|
464 |
+
} else {
|
465 |
+
return;
|
466 |
+
}
|
467 |
+
|
468 |
+
//get the tags
|
469 |
+
var completions = getCompletions(token, startingTag);
|
470 |
+
if (!completions.length) return;
|
471 |
+
|
472 |
+
|
473 |
+
function insert(str) {
|
474 |
+
if(str == "") return;
|
475 |
+
|
476 |
+
//trim
|
477 |
+
str = str.replace(/^\s+|\s+$/g,"");
|
478 |
+
|
479 |
+
//is this an unpaired tag?
|
480 |
+
unPaired = unPairedTags.inArray(str) ? true : false;
|
481 |
+
|
482 |
+
if(specialTags[str] != null && startingTag) {
|
483 |
+
var insertTag = specialTags[str].tag;
|
484 |
+
var jumpTo = (token.start + str.length + specialTags[str].cusror);
|
485 |
+
} else if(startingTag && unPaired) {
|
486 |
+
var insertTag = str + " />";
|
487 |
+
var jumpTo = (token.start + str.length + 3);
|
488 |
+
} else if (startingTag) {
|
489 |
+
var insertTag = str + "></" + str + ">";
|
490 |
+
var jumpTo = (token.start + str.length + 1);
|
491 |
+
} else {
|
492 |
+
var insertTag = str + ">";
|
493 |
+
var jumpTo = (token.start + str.length + 1);
|
494 |
+
}
|
495 |
+
|
496 |
+
pluginCodeMirror.replaceRange(insertTag, {line: cur.line, ch: token.start}, {line: cur.line, ch: token.end});
|
497 |
+
pluginCodeMirror.setCursor({line: cur.line, ch: jumpTo});
|
498 |
+
}
|
499 |
+
|
500 |
+
// When there is only one completion, use it directly.
|
501 |
+
/*if (completions.length == 1) {
|
502 |
+
insert(completions[0]); return true;
|
503 |
+
}*/
|
504 |
+
|
505 |
+
// Build the select widget
|
506 |
+
var complete = document.createElement("div");
|
507 |
+
complete.className = "completions";
|
508 |
+
|
509 |
+
var sel = complete.appendChild(document.createElement("select"));
|
510 |
+
sel.multiple = false;
|
511 |
+
|
512 |
+
if (completions.length == 1) sel.multiple = true;
|
513 |
+
|
514 |
+
for (var i = 0; i < completions.length; ++i) {
|
515 |
+
var opt = sel.appendChild(document.createElement("option"));
|
516 |
+
opt.appendChild(document.createTextNode(completions[i]));
|
517 |
+
}
|
518 |
+
|
519 |
+
sel.firstChild.selected = true;
|
520 |
+
sel.size = Math.min(10, completions.length);
|
521 |
+
|
522 |
+
var pos = pluginCodeMirror.cursorCoords();
|
523 |
+
complete.style.left = pos.x + "px";
|
524 |
+
|
525 |
+
//top position
|
526 |
+
if(pos.yBot > 448) pos.yBot = pos.yBot - 165;
|
527 |
+
complete.style.top = pos.yBot + "px";
|
528 |
+
|
529 |
+
document.body.appendChild(complete);
|
530 |
+
|
531 |
+
|
532 |
+
var done = false;
|
533 |
+
function close() {
|
534 |
+
if (done) return;
|
535 |
+
done = true;
|
536 |
+
complete.parentNode.removeChild(complete);
|
537 |
+
}
|
538 |
+
function pick() {
|
539 |
+
insert(sel.options[sel.selectedIndex].innerHTML);
|
540 |
+
close();
|
541 |
+
setTimeout(function(){
|
542 |
+
pluginCodeMirror.focus();
|
543 |
+
}, 50);
|
544 |
+
}
|
545 |
+
|
546 |
+
//bind events
|
547 |
+
connect(sel, "blur", close);
|
548 |
+
connect(sel, "keydown", function(event) {
|
549 |
+
var code = event.keyCode;
|
550 |
+
|
551 |
+
// Enter, space, tab
|
552 |
+
if (code == 13 || code == 32 || code == 9) {event.stop(); pick();}
|
553 |
+
// Escape (FIX: closes the tinymce popup window)
|
554 |
+
else if (code == 27) {
|
555 |
+
event.stop(); close(); pluginCodeMirror.focus();
|
556 |
+
}
|
557 |
+
//other than arrow up/down
|
558 |
+
else if (code != 38 && code != 40 && code != 16 && code != 17 && code != 18 && code != 91 && code != 92) {
|
559 |
+
console.log([code]);
|
560 |
+
close();
|
561 |
+
pluginCodeMirror.focus();
|
562 |
+
if(code != 39 && code != 37) setTimeout(startComplete, 50);
|
563 |
+
else event.stop();
|
564 |
+
}
|
565 |
+
});
|
566 |
+
connect(sel, "dblclick", pick);
|
567 |
+
|
568 |
+
sel.focus();
|
569 |
+
|
570 |
+
// Opera sometimes ignores focusing a freshly created node
|
571 |
+
if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
|
572 |
+
return true;
|
573 |
+
}
|
574 |
+
|
575 |
+
function getCompletions(token, startingTag) {
|
576 |
+
var found = [], start = token.string;
|
577 |
+
|
578 |
+
function maybeAdd(str) {
|
579 |
+
if (str.indexOf(start) == 0) found.push(str);
|
580 |
+
}
|
581 |
+
|
582 |
+
if(startingTag) {
|
583 |
+
forEach(tagNames, maybeAdd)
|
584 |
+
} else {
|
585 |
+
forEach(pairedTags, maybeAdd)
|
586 |
+
}
|
587 |
+
|
588 |
+
return found;
|
589 |
+
}
|
590 |
+
|
591 |
+
|
592 |
+
|
593 |
+
|
594 |
+
|
595 |
+
/**
|
596 |
+
* JS Beautifier
|
597 |
+
* ---------------
|
598 |
+
* ...or, more specifically, all of the code powering jsbeautifier.org.
|
599 |
+
*
|
600 |
+
*
|
601 |
+
* Written by Einar Lielmanis, <einar@jsbeautifier.org>
|
602 |
+
*
|
603 |
+
* Thanks to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, Dave
|
604 |
+
* Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Hull and
|
605 |
+
* others.
|
606 |
+
*/
|
607 |
+
function beautify(id) {
|
608 |
+
|
609 |
+
if (the.beautify_in_progress) return;
|
610 |
+
the.beautify_in_progress = true;
|
611 |
+
|
612 |
+
var source = document.getElementById(id).value.replace(/^\s+/, '');
|
613 |
+
|
614 |
+
var indent_size = 4;
|
615 |
+
var indent_char = ' ';
|
616 |
+
var brace_style = 'collapse'; //collapse, expand, end-expand
|
617 |
+
|
618 |
+
document.getElementById(id).value = style_html(source, indent_size, indent_char, 120, brace_style);
|
619 |
+
the.beautify_in_progress = false;
|
620 |
+
}
|
addons/codemagic/js/codemirror-compressed.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var CodeMirror=function(){function D(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function C(a,b){if(!b)return a?a.length:0;if(!a)return b.length;for(var c=a.length,d=b.length;c>=0&&d>=0;--c,--d)if(a.charAt(c)!=b.charAt(d))break;return d+1}function B(a){return a.replace(/[<>&]/g,function(a){return a=="&"?"&":a=="<"?"<":">"})}function A(a){return{line:a.line,ch:a.ch}}function z(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function y(a,b){return a.line==b.line&&a.ch==b.ch}function x(a){return a.textContent||a.innerText||a.nodeValue||""}function w(a,b){var c=a.ownerDocument.body,d=0,e=0,f=!1;for(var g=a;g;g=g.offsetParent)d+=g.offsetLeft,e+=g.offsetTop,g==c&&(f=!0);var h=b&&f?null:c;for(var g=a.parentNode;g!=h;g=g.parentNode)g.scrollLeft!=null&&(d-=g.scrollLeft,e-=g.scrollTop);return{left:d,top:e}}function v(a,b){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var c=0,d=0;c<b;++c)a.charAt(c)=="\t"?d+=r-d%r:++d;return d}function n(){this.id=null}function m(a,b,c,d){function e(a){c(new l(a||window.event))}if(typeof a.addEventListener=="function"){a.addEventListener(b,e,!1);if(d)return function(){a.removeEventListener(b,e,!1)}}else{a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function l(a){this.e=a}function k(a){a.stop||(a.stop=j);return a}function j(){this.preventDefault?(this.preventDefault(),this.stopPropagation()):(this.returnValue=!1,this.cancelBubble=!0)}function i(){this.time=0,this.done=[],this.undone=[]}function h(a,b,c,d){for(var e=0,f=0,g=0;f<b;e+=2){var h=c[e],i=f+h.length;g==0?(i>a&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function g(a,b){this.styles=b||[a,null],this.stateAfter=null,this.text=a,this.marked=this.gutterMarker=this.className=null}function f(a){this.pos=this.start=0,this.string=a}function e(a,b,c){return a.startState?a.startState(b,c):!0}function d(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function a(b,c){function cI(a,b,c){this.atOccurrence=!1,c==null&&(c=typeof a=="string"&&a==a.toLowerCase()),b&&typeof b=="object"?b=bZ(b):b={line:0,ch:0},this.pos={from:b,to:b};if(typeof a!="string")this.matches=function(b,c){if(b){var d=T[c.line].text.slice(0,c.ch),e=d.match(a),f=0;while(e){var g=d.indexOf(e[0]);f+=g,d=d.slice(g+1);var h=d.match(a);if(h)e=h;else break;f++}}else var d=T[c.line].text.slice(c.ch),e=d.match(a),f=e&&c.ch+d.indexOf(e[0]);if(e)return{from:{line:c.line,ch:f},to:{line:c.line,ch:f+e[0].length},match:e}};else{c&&(a=a.toLowerCase());var d=c?function(a){return a.toLowerCase()}:function(a){return a},e=a.split("\n");e.length==1?this.matches=function(b,c){var e=d(T[c.line].text),f=a.length,g;if(b?c.ch>=f&&(g=e.lastIndexOf(a,c.ch-f))!=-1:(g=e.indexOf(a,c.ch))!=-1)return{from:{line:c.line,ch:g},to:{line:c.line,ch:g+f}}}:this.matches=function(a,b){var c=b.line,f=a?e.length-1:0,g=e[f],h=d(T[c].text),i=a?h.indexOf(g)+g.length:h.lastIndexOf(g);if(!(a?i>=b.ch||i!=g.length:i<=b.ch||i!=h.length-g.length))for(;;){if(a?!c:c==T.length-1)return;h=d(T[c+=a?-1:1].text),g=e[a?--f:++f];if(f>0&&f<e.length-1){if(h!=g)return;continue}var j=a?h.lastIndexOf(g):h.indexOf(g)+g.length;if(a?j!=h.length-g.length:j!=g.length)return;var k={line:b.line,ch:i},l={line:c,ch:j};return{from:a?l:k,to:a?k:l}}}}}function cH(a){return function(){cG++||cE();try{var b=a.apply(this,arguments)}finally{--cG||cF()}return b}}function cF(){var a=!1;bc&&(a=!bN()),ba.length?bQ(ba):bc&&bU(),a&&bN(),bc&&cx(),!bd&&(_===!0||_!==!1&&bc)&&bL(),bc&&f.matchBrackets&&setTimeout(cH(function(){bj&&(bj(),bj=null),cz(!1)}),20);var b=bb;bc&&f.onCursorActivity&&f.onCursorActivity(bm),b&&f.onChange&&bm&&f.onChange(bm,b)}function cE(){_=null,ba=[],bb=bc=!1}function cD(a){!U.length||Q.set(a,cH(cC))}function cC(){var a=+(new Date)+f.workTime,b=!1;while(U.length){if(!T[be].stateAfter)var c=be;else var c=U.pop();if(c>=T.length)continue;b=!0;var g=cA(c),h=g&&T[g-1].stateAfter;h?h=d(S,h):h=e(S);for(var i=g,j=T.length;i<j;++i){var k=T[i],l=k.stateAfter;if(+(new Date)>a){U.push(i),cD(f.workDelay),ba.push({from:c,to:i});return}var m=k.highlight(S,h);k.stateAfter=d(S,h);if(l&&!m&&k.text)break}ba.push({from:c,to:i})}b&&f.onHighlightComplete&&f.onHighlightComplete(bm)}function cB(a){var b=cA(a),c=b&&T[b-1].stateAfter;c?c=d(S,c):c=e(S);for(var f=b;f<a;++f){var g=T[f];g.highlight(S,c),g.stateAfter=d(S,c)}T[a].stateAfter||U.push(a);return c}function cA(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var f=T[d-1];if(f.stateAfter)return d;var g=f.indentation();if(c==null||b>g)c=d,b=g}return c}function cz(a){function p(a,b,c){if(!!a.text){var d=a.styles,e=g?0:a.text.length-1,f;for(var i=g?0:d.length-2,j=g?d.length:-2;i!=j;i+=2*h){var k=d[i];if(d[i+1]!=null&&d[i+1]!=m){e+=h*k.length;continue}for(var l=g?0:k.length-1,p=g?k.length:-1;l!=p;l+=h,e+=h)if(e>=b&&e<c&&o.test(f=k.charAt(l))){var q=cy[f];if(q.charAt(1)==">"==g)n.push(f);else{if(n.pop()!=q.charAt(0))return{pos:e,match:!1};if(!n.length)return{pos:e,match:!0}}}}}}var b=X.inverted?X.from:X.to,c=T[b.line],d=b.ch-1,e=d>=0&&cy[c.text.charAt(d)]||cy[c.text.charAt(++d)];if(!!e){var f=e.charAt(0),g=e.charAt(1)==">",h=g?1:-1,i=c.styles;for(var j=d+1,k=0,l=i.length;k<l;k+=2)if((j-=i[k].length)<=0){var m=i[k+1];break}var n=[c.text.charAt(d)],o=/[(){}[\]]/;for(var k=b.line,l=g?Math.min(k+50,T.length):Math.max(-1,k-50);k!=l;k+=h){var c=T[k],q=k==b.line,r=p(c,q&&g?d+1:0,q&&!g?d:c.text.length);if(r){var m=r.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",s=ci({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=ci({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=cH(function(){s(),t()});a?setTimeout(u,800):bj=u;break}}}}function cx(){clearInterval(R);var a=!0;N.style.visibility="",R=setInterval(function(){N.style.visibility=(a=!a)?"":"hidden"},650)}function cw(a){function e(){L.value!=d&&cH(bD)(L.value,"end"),L.style.cssText=c,bd=!1,bL(),bI()}var b=cv(a);if(!!b&&!window.opera){(y(X.from,X.to)||z(b,X.from)||!z(b,X.to))&&bX(b.line,b.ch);var c=L.style.cssText;L.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.pageY()-1)+"px; left: "+(a.pageX()-1)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden;";var d=L.value=bG();bM(),G(L,0,L.value.length),bd=!0;if(p){a.stop();var f=m(window,"mouseup",function(){f(),setTimeout(e,20)},!0)}else setTimeout(e,50)}}function cv(a,b){var c=w(u,!0),d=a.e.clientX,e=a.e.clientY;if(!b&&(d-c.left>u.clientWidth||e-c.top>u.clientHeight))return null;var f=w(M,!0),g=be+Math.floor((e-f.top)/cs());return bZ({line:g,ch:cp(bY(g),d-f.left)})}function cu(){return M.offsetLeft}function ct(){return M.offsetTop}function cs(){var a=O.childNodes.length;if(a)return O.offsetHeight/a||1;B.innerHTML="<pre>x</pre>";return B.firstChild.offsetHeight||1}function cr(a){var b=cq(a,!0),c=w(M);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function cq(a,b){var c=cs(),d=a.line-(b?be:0);return{x:co(a.line,a.ch),y:d*c,yBot:(d+1)*c}}function cp(a,b){function e(a){B.innerHTML="<pre><span>"+c.getHTML(null,null,!1,a)+"</span></pre>";return B.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=T[a],d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/cn("x")));for(;;){var k=e(j);if(k<=b&&j<h)j=Math.min(h,Math.ceil(j*1.2));else{i=k,h=j;break}}if(b>i)return h;j=Math.floor(h*.8),k=e(j),k<b&&(f=j,g=k);for(;;){if(h-f<=1)return i-b>b-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function co(a,b){if(b==0)return 0;B.innerHTML="<pre><span>"+T[a].getHTML(null,null,!1,b)+"</span></pre>";return B.firstChild.firstChild.offsetWidth}function cn(a){B.innerHTML="<pre><span>x</span></pre>",B.firstChild.firstChild.firstChild.nodeValue=a;return B.firstChild.firstChild.offsetWidth||10}function cm(a){if(typeof a=="number"){var b=a;a=T[a];if(!a)return null}else{var b=D(T,a);if(b==-1)return null}var c=a.gutterMarker;return{line:b,text:a.text,markerText:c&&c.text,markerClass:c&&c.style}}function cl(a,b){if(typeof a=="number"){var c=a;a=T[bY(a)]}else{var c=D(T,a);if(c==-1)return null}a.className!=b&&(a.className=b,ba.push({from:c,to:c+1}));return a}function ck(a){typeof a=="number"&&(a=T[bY(a)]),a.gutterMarker=null,bT()}function cj(a,b,c){typeof a=="number"&&(a=T[bY(a)]),a.gutterMarker={text:b,style:c},bT();return a}function ci(a,b,c){function e(a,b,c,e){var a=T[a],f=a.addMark(b,c,e);f.line=a,d.push(f)}a=bZ(a),b=bZ(b);var d=[];if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f<g;++f)e(f,0,null,c);e(b.line,0,b.ch,c)}ba.push({from:a.line,to:b.line+1});return function(){var a,b;for(var c=0;c<d.length;++c){var e=d[c],f=D(T,e.line);e.line.removeMark(e),f>-1&&(a==null&&(a=f),b=f)}a!=null&&ba.push({from:a,to:b+1})}}function ch(){var a=f.gutter||f.lineNumbers;I.style.display=a?"":"none",a?bT():O.parentNode.style.marginLeft=0}function cg(){S=a.getMode(f,f.mode);for(var b=0,c=T.length;b<c;++b)T[b].stateAfter=null;U=[0],cD()}function cf(a,b){if(b=="smart")if(!S.indent)b="prev";else var c=cB(a);var d=T[a],e=d.indentation(),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=T[a-1].indentation():h=0:b=="smart"?h=S.indent(c,d.text.slice(g.length)):b=="add"?h=e+f.indentUnit:b=="subtract"&&(h=e-f.indentUnit),h=Math.max(0,h);var i=h-e;if(!i){if(X.from.line!=a&&X.to.line!=a)return;var j=g}else{var j="",k=0;if(f.indentWithTabs)for(var l=Math.floor(h/r);l;--l)k+=r,j+="\t";while(k<h)++k,j+=" "}bC(j,{line:a,ch:0},{line:a,ch:g.length})}function ce(a){Y=null;switch(f.tabMode){case"default":return!1;case"indent":for(var b=X.from.line,c=X.to.line;b<=c;++b)cf(b,"smart");break;case"classic":if(y(X.from,X.to)){a?cf(X.from.line,"smart"):bD("\t","end");break};case"shift":for(var b=X.from.line,c=X.to.line;b<=c;++b)cf(b,a?"subtract":"add")}return!0}function cd(){bD("\n","end"),f.enterMode!="flat"&&cf(X.from.line,f.enterMode=="keep"?"prev":"smart")}function cc(a){bV({line:a,ch:0},{line:a,ch:T[a].text.length})}function cb(a){var b=T[a.line].text,c=a.ch,d=a.ch;while(c>0&&/\w/.test(b.charAt(c-1)))--c;while(d<b.length&&/\w/.test(b.charAt(d)))++d;bV({line:a.line,ch:c},{line:a.line,ch:d})}function ca(){var a=T.length-1;bW({line:0,ch:0},{line:a,ch:T[a].text.length})}function b_(a){bX(a?0:T.length-1,!0)}function b$(a){var b=Math.floor(u.clientHeight/cs()),c=X.inverted?X.from:X.to;bX(c.line+Math.max(b-1,1)*(a?1:-1),c.ch,!0)}function bZ(a){if(a.line<0)return{line:0,ch:0};if(a.line>=T.length)return{line:T.length-1,ch:T[T.length-1].text.length};var b=a.ch,c=T[a.line].text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function bY(a){return Math.max(0,Math.min(a,T.length-1))}function bX(a,b,c){var d=bZ({line:a,ch:b||0});(c?bV:bW)(d,d)}function bW(a,b,c,d){if(!y(X.from,a)||!y(X.to,b)){if(z(b,a)){var e=b;b=a,a=e}var f=y(X.to,b),g=y(X.from,a);y(a,b)?X.inverted=!1:f&&!g?X.inverted=!0:g&&!f&&(X.inverted=!1),c==null&&(c=X.from.line,d=X.to.line),y(a,b)?y(X.from,X.to)||ba.push({from:c,to:d+1}):y(X.from,X.to)?ba.push({from:a.line,to:b.line+1}):(y(a,X.from)||(a.line<c?ba.push({from:a.line,to:Math.min(b.line,c)+1}):ba.push({from:c,to:Math.min(d,a.line)+1})),y(b,X.to)||(b.line<d?ba.push({from:Math.max(c,a.line),to:d+1}):ba.push({from:Math.max(a.line,d),to:b.line+1}))),X.from=a,X.to=b,bc=!0}}function bV(a,b){var c=Y&&bZ(Y);c&&(z(c,a)?a=c:z(b,c)&&(b=c)),bW(a,b)}function bU(){var a=X.inverted?X.from:X.to,b=co(a.line,a.ch)+"px",c=(a.line-be)*cs()+"px";K.style.top=c,y(X.from,X.to)?(N.style.top=c,N.style.left=b,N.style.display=""):N.style.display="none"}function bT(){if(!!f.gutter||!!f.lineNumbers){var a=H.offsetHeight,b=u.clientHeight;I.style.height=(a-b<2?b:a)+"px";var c=[];for(var d=be;d<bf;++d){var e=T[d].gutterMarker,g=f.lineNumbers?d+f.firstLineNumber:null;e&&e.text?g=e.text.replace("%N%",g!=null?g:""):g==null&&(g="\u00a0"),c.push(e&&e.style?'<pre class="'+e.style+'">':"<pre>",g,"</pre>")}I.style.display="none",J.innerHTML=c.join("");var h=String(T.length).length,i=J.firstChild,j=x(i),k="";while(j.length+k.length<h)k+="\u00a0";k&&i.insertBefore(l.createTextNode(k),i.firstChild),I.style.display="",M.style.marginLeft=I.offsetWidth+"px"}}function bS(a){var b=X.from.line,c=X.to.line,d=0,e=o&&l.createElement("div");for(var f=0,g=a.length;f<g;++f){var h=a[f],i=h.to-h.from-h.domSize,j=O.childNodes[h.domStart+h.domSize+d]||null;if(o)for(var k=Math.max(-i,h.domSize);k>0;--k)O.removeChild(j?j.previousSibling:O.lastChild);else if(i){for(var k=Math.max(0,i);k>0;--k)O.insertBefore(l.createElement("pre"),j);for(var k=Math.max(0,-i);k>0;--k)O.removeChild(j?j.previousSibling:O.lastChild)}var m=O.childNodes[h.domStart+d],n=b<h.from&&c>=h.from;for(var k=h.from;k<h.to;++k){var p=null,q=null;n?(p=0,c==k&&(n=!1,q=X.to.ch)):b==k&&(c==k?(p=X.from.ch,q=X.to.ch):(n=!0,p=X.from.ch)),o?(e.innerHTML=T[k].getHTML(p,q,!0),O.insertBefore(e.firstChild,j)):(m.innerHTML=T[k].getHTML(p,q,!1),m.className=T[k].className||"",m=m.nextSibling)}d+=i}}function bR(a,b){var c=[],d={line:a,ch:0},e=z(X.from,d)&&!z(X.to,d);for(var f=a;f<b;++f){var g=null,h=null;e?(g=0,X.to.line==f&&(e=!1,h=X.to.ch)):X.from.line==f&&(X.to.line==f?(g=X.from.ch,h=X.to.ch):(e=!0,g=X.from.ch)),c.push(T[f].getHTML(g,h,!0))}O.innerHTML=c.join("")}function bQ(a){if(!u.clientWidth)be=bf=0;else{var b=a===!0?[]:[{from:be,to:bf,domStart:0}];for(var c=0,d=a.length||0;c<d;++c){var e=a[c],f=[],g=e.diff||0;for(var h=0,i=b.length;h<i;++h){var j=b[h];e.to<=j.from?f.push({from:j.from+g,to:j.to+g,domStart:j.domStart}):j.to<=e.from?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from,domStart:j.domStart}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g,domStart:j.domStart+(e.to-j.from)}))}b=f}var k=bP(),l=Math.min(be,Math.max(k.from-3,0)),m=Math.min(T.length,Math.max(bf,k.to+3)),n=[],o=0,p=bf-be,q=l,r=0;for(var c=0,d=b.length;c<d;++c){var j=b[c];if(j.to<=l)continue;if(j.from>=m)break;if(j.domStart>o||j.from>q)n.push({from:q,to:j.from,domSize:j.domStart-o,domStart:o}),r+=j.from-q;q=j.to,o=j.domStart+(j.to-j.from)}if(o!=p||q!=m)r+=Math.abs(m-q),n.push({from:q,to:m,domSize:p-o,domStart:o});if(!n.length)return;O.style.display="none",r>(k.to-k.from)*.3?bR(l=Math.max(k.from-10,0),m=Math.min(k.to+7,T.length)):bS(n),O.style.display="";var s=l!=be||m!=bf||bg!=u.clientHeight;be=l,bf=m,H.style.top=l*cs()+"px",s&&(bg=u.clientHeight,v.style.height=T.length*cs()+2*ct()+"px",bT());var t=cn(bk);M.style.width=t>u.clientWidth?t+"px":"";if(O.childNodes.length!=bf-be)throw new Error("BAD PATCH! "+JSON.stringify(n)+" size="+(bf-be)+" nodes="+O.childNodes.length);bU()}}function bP(){var a=cs(),b=u.scrollTop-ct();return{from:Math.min(T.length,Math.max(0,Math.floor(b/a))),to:Math.min(T.length,Math.ceil((b+u.clientHeight)/a))}}function bO(a,b,c,d){var e=cu(),g=ct(),h=cs();b+=g,d+=g,a+=e,c+=e;var i=u.clientHeight,j=u.scrollTop,k=!1,l=!0;b<j?(u.scrollTop=Math.max(0,b-2*h),k=!0):d>j+i&&(u.scrollTop=d+h-i,k=!0);var m=u.clientWidth,n=u.scrollLeft;a<n?(u.scrollLeft=Math.max(0,a-10),k=!0):c>m+n&&(u.scrollLeft=c+10-m,k=!0,c>v.clientWidth&&(l=!1)),k&&f.onScroll&&f.onScroll(bm);return l}function bN(){var a=cq(X.inverted?X.from:X.to);return bO(a.x,a.y,a.x,a.yBot)}function bM(){f.readOnly!="nocursor"&&L.focus()}function bL(){var a=[],b=Math.max(0,X.from.line-1),c=Math.min(T.length,X.to.line+2);for(var d=b;d<c;++d)a.push(T[d].text);a=L.value=a.join(q);var e=X.from.ch,f=X.to.ch;for(var d=b;d<X.from.line;++d)e+=q.length+T[d].text.length;for(var d=b;d<X.to.line;++d)f+=q.length+T[d].text.length;bi={text:a,from:b,to:c,start:e,end:f},G(L,e,Z?e:f)}function bK(){function g(a,c){var d=0;for(;;){var e=b.indexOf("\n",d);if(e==-1||(b.charAt(e-1)=="\r"?e-1:e)>=a)return{line:c,ch:a-d};++c,d=e+1}}if(!bd){var a=!1,b=L.value,c=F(L);if(!c)return!1;var a=bi.text!=b,d=Z,e=a||c.start!=bi.start||c.end!=(d?bi.start:bi.end);if(!e&&!d)return!1;if(a){Y=Z=null;if(f.readOnly){_=!0;return"changed"}}var h=g(c.start,bi.from),i=g(c.end,bi.from);if(d){h=c.start==d.anchor?i:h,i=Y?X.to:c.start==d.anchor?h:i;if(!z(h,i)){Z=null,X.inverted=!1;var j=h;h=i,i=j}}h.line==i.line&&h.line==X.from.line&&h.line==X.to.line&&!Y&&(_=!1);if(a){var k=0,l=b.length,m=Math.min(l,bi.text.length),n,o=bi.from,p=-1;while(k<m&&(n=b.charAt(k))==bi.text.charAt(k))++k,n=="\n"&&(o++,p=k);var q=p>-1?k-p:k,r=bi.to-1,s=bi.text.length;for(;;){n=bi.text.charAt(s),n=="\n"&&r--;if(b.charAt(l)!=n){++l,++s;break}if(s<=k||l<=k)break;--l,--s}var p=bi.text.lastIndexOf("\n",s-1),t=p==-1?s:s-p-1;bx({line:o,ch:q},{line:r,ch:t},E(b.slice(k,l)),h,i);if(o!=r||h.line!=o)_=!0}else bW(h,i);bi.text=b,bi.start=c.start,bi.end=c.end;return a?"changed":e?"moved":!1}}function bJ(a){function c(){cE();var d=bK();d=="moved"&&a&&(t[a]=!0),!d&&!b?(b=!0,P.set(80,c)):(bH=!1,bI()),cF()}var b=!1;bH=!0,P.set(20,c)}function bI(){bH||P.set(2e3,function(){cE(),bK(),W&&bI(),cF()})}function bG(){return bF(X.from,X.to)}function bF(a,b){var c=a.line,d=b.line;if(c==d)return T[c].text.slice(a.ch,b.ch);var e=[T[c].text.slice(a.ch)];for(var f=c+1;f<d;++f)e.push(T[f].text);e.push(T[d].text.slice(0,b.ch));return e.join("\n")}function bE(a,b,c,d){var e=a.length==1?a[0].length+b.ch:a[a.length-1].length,f=d({line:b.line+a.length-1,ch:e});bx(b,c,a,f.from,f.to)}function bD(a,b){bE(E(a),X.from,X.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:X.from,to:X.from}:{from:X.from,to:a}})}function bC(a,b,c){function d(d){if(z(d,b))return d;if(!z(c,d))return e;var f=d.line+a.length-(c.line-b.line)-1,g=d.ch;d.line==c.line&&(g+=a[a.length-1].length-(c.ch-(c.line==b.line?b.ch:0)));return{line:f,ch:g}}b=bZ(b),c?c=bZ(c):c=b,a=E(a);var e;bE(a,b,c,function(a){e=a;return{from:d(X.from),to:d(X.to)}});return e}function bB(a,b,c,d,e){function s(a){return a<=Math.min(b.line,b.line+q)?a:a+q}var f=!1,h=bk.length;for(var i=a.line;i<b.line;++i)if(T[i].text.length==h){f=!0;break}var j=b.line-a.line,k=T[a.line],l=T[b.line];if(k==l)if(c.length==1)k.replace(a.ch,b.ch,c[0]);else{l=k.split(b.ch,c[c.length-1]);var m=[a.line+1,j];k.replace(a.ch,k.text.length,c[0]);for(var i=1,n=c.length-1;i<n;++i)m.push(new g(c[i]));m.push(l),T.splice.apply(T,m)}else if(c.length==1)k.replace(a.ch,k.text.length,c[0]+l.text.slice(b.ch)),T.splice(a.line+1,j);else{var m=[a.line+1,j-1];k.replace(a.ch,k.text.length,c[0]),l.replace(0,b.ch,c[c.length-1]);for(var i=1,n=c.length-1;i<n;++i)m.push(new g(c[i]));T.splice.apply(T,m)}for(var i=a.line,n=i+c.length;i<n;++i){var o=T[i].text;o.length>h&&(bk=o,h=o.length,f=!1)}if(f){h=0;for(var i=0,n=T.length;i<n;++i){var o=T[i].text;o.length>h&&(h=o.length,bk=o)}}var p=[],q=c.length-j-1;for(var i=0,o=U.length;i<o;++i){var r=U[i];r<a.line?p.push(r):r>b.line&&p.push(r+q)}c.length&&p.push(a.line),U=p,cD(100),ba.push({from:a.line,to:b.line+1,diff:q}),bb={from:a,to:b,text:c},bW(d,e,s(X.from.line),s(X.to.line)),v.style.height=T.length*cs()+2*ct()+"px"}function bA(){by(V.undone,V.done)}function bz(){by(V.done,V.undone)}function by(a,b){var c=a.pop();if(c){var d=[],e=c.start+c.added;for(var f=c.start;f<e;++f)d.push(T[f].text);b.push({start:c.start,added:c.old.length,old:d});var g=bZ({line:c.start+c.old.length-1,ch:C(d[d.length-1],c.old[c.old.length-1])});bB({line:c.start,ch:0},{line:e-1,ch:T[e-1].text.length},c.old,g,g)}}function bx(a,b,c,d,e){if(V){var g=[];for(var h=a.line,i=b.line+1;h<i;++h)g.push(T[h].text);V.addChange(a.line,c.length,g);while(V.done.length>f.undoDepth)V.done.shift()}bB(a,b,c,d,e)}function bw(){W&&f.onBlur&&f.onBlur(bm),clearInterval(R),Y=null,W=!1,u.className=u.className.replace(" CodeMirror-focused","")}function bv(){f.readOnly!="nocursor"&&(!W&&f.onFocus&&f.onFocus(bm),W=!0,bI(),u.className.search(/\bCodeMirror-focused\b/)==-1&&(u.className+=" CodeMirror-focused"),cx())}function bu(a){if(!f.onKeyEvent||!f.onKeyEvent(bm,k(a.e))){if(f.electricChars&&S.electricChars){var b=String.fromCharCode(a.e.charCode==null?a.e.keyCode:a.e.charCode);S.electricChars.indexOf(b)>-1&&setTimeout(cH(function(){cf(X.to.line,"smart")}),50)}var c=a.e.keyCode;c==13?(f.readOnly||cd(),a.stop()):!a.e.ctrlKey&&!a.e.altKey&&!a.e.metaKey&&c==9&&f.tabMode!="default"?a.stop():bJ(bh)}}function bt(a){if(!f.onKeyEvent||!f.onKeyEvent(bm,k(a.e)))Z&&(Z=null,_=!0),a.e.keyCode==16&&(Y=null)}function bs(a){W||bv();var b=a.e.keyCode,c=(s?a.e.metaKey:a.e.ctrlKey)&&!a.e.altKey,d=a.e.ctrlKey||a.e.altKey||a.e.metaKey;b==16||a.e.shiftKey?Y=Y||(X.inverted?X.to:X.from):Y=null;if(!f.onKeyEvent||!f.onKeyEvent(bm,k(a.e))){if(b==33||b==34){b$(b==34);return a.stop()}if(c&&(b==36||b==35||s&&(b==38||b==40))){b_(b==36||b==38);return a.stop()}if(c&&b==65){ca();return a.stop()}if(!f.readOnly){if(!d&&b==13)return;if(!d&&b==9&&ce(a.e.shiftKey))return a.stop();if(c&&b==90){bz();return a.stop()}if(c&&(a.e.shiftKey&&b==90||b==89)){bA();return a.stop()}}bh=(c?"c":"")+b;if(X.inverted&&t.hasOwnProperty(bh)){var e=F(L);e&&(Z={anchor:e.start},G(L,e.start,e.start))}bJ(bh)}}function br(a){var b=cv(a,!0),c=a.e.dataTransfer.files;if(!!b&&!f.readOnly)if(c&&c.length&&window.FileReader&&window.File){var d=c.length,e=Array(d),g=0;for(var h=0;h<d;++h)i(c[h],h);function i(a,c){var f=new FileReader;f.onload=function(){e[c]=f.result,++g==d&&bC(e.join(""),bZ(b),bZ(b))},f.readAsText(a)}}else try{var e=a.e.dataTransfer.getData("Text");e&&bC(e,b,b)}catch(a){}}function bq(a){var b=cv(a);!b||(cb(b),a.stop(),$=+(new Date))}function bp(a){function i(a){var b=cv(a,!0);if(b&&!y(b,e)){W||bv(),e=b,bV(d,b),_=!1;var c=bP();if(b.line>=c.to||b.line<c.from)g=setTimeout(cH(function(){i(a)}),150)}}function h(){bM(),_=!0,j(),k()}var b=$;$=null;for(var c=a.target();c!=u;c=c.parentNode)if(c.parentNode==J){f.onGutterClick&&f.onGutterClick(bm,D(J.childNodes,c)+be);return a.stop()}p&&a.button()==3&&cw(a);if(a.button()==1){var d=cv(a),e=d,g;if(!d){a.target()==u&&a.stop();return}W||bv(),a.stop();if(b&&+(new Date)-b<400)return cc(d.line);bX(d.line,d.ch,!0);var j=m(l,"mousemove",cH(function(a){clearTimeout(g),a.stop(),i(a)}),!0),k=m(l,"mouseup",cH(function(a){clearTimeout(g);var b=cv(a);b&&bV(d,b),a.stop(),h()}),!0)}}function bo(a){var b=[];for(var c=0,d=T.length;c<d;++c)b.push(T[c].text);return b.join("\n")}function bn(a){V=null;var b={line:0,ch:0};bx(b,{line:T.length-1,ch:T[T.length-1].text.length},E(a),b,b),V=new i}function bl(a){return a>=0&&a<T.length}var f={},h=a.defaults;for(var j in h)h.hasOwnProperty(j)&&(f[j]=(c&&c.hasOwnProperty(j)?c:h)[j]);var l=f.document,u=l.createElement("div");u.className="CodeMirror",window.ActiveXObject&&/MSIE [1-7]\b/.test(navigator.userAgent)&&(u.style.position="relative"),u.innerHTML='<div style="position: relative"><div style="position: absolute; height: 0; width: 0; overflow: hidden;"></div><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div style="overflow: hidden; position: absolute; width: 1px; height: 0; left: 0"><textarea style="position: absolute; width: 100000px;" wrap="off"></textarea></div><div class="CodeMirror-lines"><div style="position: relative"><pre class="CodeMirror-cursor"> </pre><div></div></div></div></div></div>',b.appendChild?b.appendChild(u):b(u);var v=u.firstChild,B=v.firstChild,H=B.nextSibling,I=H.firstChild,J=I.firstChild,K=I.nextSibling,L=K.firstChild,M=K.nextSibling.firstChild,N=M.firstChild,O=N.nextSibling;f.tabindex!=null&&(L.tabindex=f.tabindex),!f.gutter&&!f.lineNumbers&&(I.style.display="none");var P=new n,Q=new n,R,S,T=[new g("")],U,V=new i,W;cg();var X={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Y,Z,$,_,ba,bb,bc,bd,be=0,bf=0,bg=0,bh=null,bi,bj,bk="";cH(function(){bn(f.value||""),_=!1})(),setTimeout(bL,20),m(u,"mousedown",cH(bp)),p||m(u,"contextmenu",cH(cw)),m(v,"dblclick",cH(bq)),m(u,"scroll",function(){bQ([]),f.onScroll&&f.onScroll(bm)}),m(window,"resize",function(){bQ(!0)}),m(L,"keyup",cH(bt)),m(L,"keydown",cH(bs)),m(L,"keypress",cH(bu)),m(L,"focus",bv),m(L,"blur",bw),m(u,"dragenter",function(a){a.stop()}),m(u,"dragover",function(a){a.stop()}),m(u,"drop",cH(br)),m(u,"paste",function(){bM(),bJ()}),m(L,"paste",function(){bJ()}),m(L,"cut",function(){bJ()}),l.activeElement==L?bv():bw();var bm={getValue:bo,setValue:cH(bn),getSelection:bG,replaceSelection:cH(bD),focus:function(){bM(),bv(),bJ()},setOption:function(a,b){f[a]=b,a=="lineNumbers"||a=="gutter"?ch():a=="mode"||a=="indentUnit"?cg():a=="readOnly"&&b=="nocursor"&&L.blur()},getOption:function(a){return f[a]},undo:cH(bz),redo:cH(bA),indentLine:cH(function(a){bl(a)&&cf(a,"smart")}),historySize:function(){return{undo:V.done.length,redo:V.undone.length}},matchBrackets:cH(function(){cz(!0)}),getTokenAt:function(a){a=bZ(a);return T[a.line].getTokenAt(S,cB(a.line),a.ch)},cursorCoords:function(a){a==null&&(a=X.inverted);return cr(a?X.from:X.to)},charCoords:function(a){return cr(bZ(a))},coordsChar:function(a){var b=w(M),c=bY(Math.min(T.length-1,be+Math.floor((a.y-b.top)/cs())));return bZ({line:c,ch:cp(bY(c),a.x-b.left)})},getSearchCursor:function(a,b,c){return new cI(a,b,c)},markText:cH(function(a,b,c){return cH(ci(a,b,c))}),setMarker:cj,clearMarker:ck,setLineClass:cH(cl),lineInfo:cm,addWidget:function(a,b,c){var a=cq(bZ(a),!0);b.style.top=be*cs()+a.yBot+ct()+"px",b.style.left=a.x+cu()+"px",v.appendChild(b),c&&bO(a.x,a.yBot,a.x+b.offsetWidth,a.yBot+b.offsetHeight)},lineCount:function(){return T.length},getCursor:function(a){a==null&&(a=X.inverted);return A(a?X.from:X.to)},somethingSelected:function(){return!y(X.from,X.to)},setCursor:cH(function(a,b){b==null&&typeof a.line=="number"?bX(a.line,a.ch):bX(a,b)}),setSelection:cH(function(a,b){bW(bZ(a),bZ(b||a))}),getLine:function(a){if(bl(a))return T[a].text},setLine:cH(function(a,b){bl(a)&&bC(b,{line:a,ch:0},{line:a,ch:T[a].text.length})}),removeLine:cH(function(a){bl(a)&&bC("",{line:a,ch:0},bZ({line:a+1,ch:0}))}),replaceRange:cH(bC),getRange:function(a,b){return bF(bZ(a),bZ(b))},operation:function(a){return cH(a)()},refresh:function(){bQ(!0)},getInputField:function(){return L},getWrapperElement:function(){return u}},bH=!1,cy={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},cG=0;cI.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function d(a){var c={line:a,ch:0};b.pos={from:c,to:c},b.atOccurrence=!1;return!1}var b=this,c=bZ(a?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(a,c)){this.atOccurrence=!0;return this.pos.match||!0}if(a){if(!c.line)return d(0);c={line:c.line-1,ch:T[c.line-1].text.length}}else{if(c.line==T.length-1)return d(T.length);c={line:c.line+1,ch:0}}}},from:function(){if(this.atOccurrence)return A(this.pos.from)},to:function(){if(this.atOccurrence)return A(this.pos.to)}};return bm}a.defaults={value:"",mode:null,indentUnit:2,indentWithTabs:!1,tabMode:"classic",enterMode:"indent",electricChars:!0,onKeyEvent:null,lineNumbers:!1,gutter:!1,firstLineNumber:1,readOnly:!1,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,undoDepth:40,tabindex:null,document:window.document};var b={},c={};a.defineMode=function(c,d){!a.defaults.mode&&c!="null"&&(a.defaults.mode=c),b[c]=d},a.defineMIME=function(a,b){c[a]=b},a.getMode=function(d,e){typeof e=="string"&&c.hasOwnProperty(e)&&(e=c[e]);if(typeof e=="string")var f=e,g={};else if(e!=null)var f=e.name,g=e;var h=b[f];if(!h){window.console&&console.warn("No mode "+f+" found, falling back to plain text.");return a.getMode(d,"text/plain")}return h(d,g||{})},a.listModes=function(){var a=[];for(var c in b)b.propertyIsEnumerable(c)&&a.push(c);return a},a.listMIMEs=function(){var a=[];for(var b in c)c.propertyIsEnumerable(b)&&a.push(b);return a},a.fromTextArea=function(b,c){function d(){b.value=h.getValue()}c||(c={}),c.value=b.value,!c.tabindex&&b.tabindex&&(c.tabindex=b.tabindex);if(b.form){var e=m(b.form,"submit",d,!0);if(typeof b.form.submit=="function"){var f=b.form.submit;function g(){d(),b.form.submit=f,b.form.submit(),b.form.submit=g}b.form.submit=g}}b.style.display="none";var h=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);h.save=d,h.toTextArea=function(){d(),b.parentNode.removeChild(h.getWrapperElement()),b.style.display="",b.form&&(e(),typeof b.form.submit=="function"&&(b.form.submit=f))};return h},a.startState=e,a.copyState=d,f.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if(typeof a=="string")var c=b==a;else var c=b&&(a.test?a.test(b):a(b));if(c){++this.pos;return b}},eatWhile:function(a){var b=this.start;while(this.eat(a));return this.pos>b},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1){this.pos=b;return!0}},backUp:function(a){this.pos-=a},column:function(){return v(this.string,this.start)},indentation:function(){return v(this.string)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);e&&b!==!1&&(this.pos+=e[0].length);return e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos){b!==!1&&(this.pos+=a.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)}},g.prototype={replace:function(a,b,c){var d=[],e=this.marked;h(0,a,this.styles,d),c&&d.push(c,null),h(b,this.text.length,this.styles,d),this.styles=d,this.text=this.text.slice(0,a)+c+this.text.slice(b),this.stateAfter=null;if(e){var f=c.length-(b-a),g=this.text.length;function i(a){return a<=Math.min(b,b+f)?a:a+f}for(var j=0;j<e.length;++j){var k=e[j],l=!1;k.from>=g?l=!0:(k.from=i(k.from),k.to!=null&&(k.to=i(k.to)));if(l||k.from>=k.to)e.splice(j,1),j--}}},split:function(a,b){var c=[b,null];h(a,this.text.length,this.styles,c);return new g(b+this.text.slice(a),c)},addMark:function(a,b,c){var d=this.marked,e={from:a,to:b,style:c};this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(a,b){return a.from-b.from});return e},removeMark:function(a){var b=this.marked;if(!!b)for(var c=0;c<b.length;++c)if(b[c]==a){b.splice(c,1);break}},highlight:function(a,b){var c=new f(this.text),d=this.styles,e=0,g=!1,h=d[0],i;this.text==""&&a.blankLine&&a.blankLine(b);while(!c.eol()){var j=a.token(c,b),k=this.text.slice(c.start,c.pos);c.start=c.pos,e&&d[e-1]==j?d[e-2]+=k:k&&(!g&&(d[e+1]!=j||e&&d[e-2]!=i)&&(g=!0),d[e++]=k,d[e++]=j,i=h,h=d[e]);if(c.pos>5e3){d[e++]=this.text.slice(c.pos),d[e++]=null;break}}d.length!=e&&(d.length=e,g=!0),e&&d[e-2]!=i&&(g=!0);return g},getTokenAt:function(a,b,c){var d=this.text,e=new f(d);while(e.pos<c&&!e.eol()){e.start=e.pos;var g=a.token(e,b)}return{start:e.start,end:e.pos,string:e.current(),className:g||null,state:b}},indentation:function(){return v(this.text)},getHTML:function(a,b,c,d){function f(a,b){!a||(b?e.push('<span class="',b,'">',B(a),"</span>"):e.push(B(a)))}var e=[];c&&e.push(this.className?'<pre class="'+this.className+'">':"<pre>");var g=this.styles,h=this.text,i=this.marked;a==b&&(a=null);var j=h.length;d!=null&&(j=Math.min(d,j));if(!h&&d==null)f(" ",a!=null&&b==null?"CodeMirror-selected":null);else if(!i&&a==null)for(var k=0,l=0;l<j;k+=2){var m=g[k],n=m.length;l+n>j&&(m=m.slice(0,j-l)),l+=n,f(m,g[k+1])}else{var o=0,k=0,p="",q,r=0,s=-1,t=null;function u(){i&&(s+=1,t=s<i.length?i[s]:null)}u();while(o<j){var v=j,w="";if(a!=null)if(a>o)v=a;else if(b==null||b>o)w=" CodeMirror-selected",b!=null&&(v=Math.min(v,b));while(t&&t.to!=null&&t.to<=o)u();t&&(t.from>o?v=Math.min(v,t.from):(w+=" "+t.style,t.to!=null&&(v=Math.min(v,t.to))));for(;;){var x=o+p.length,y=q;w&&(y=q?q+w:w),f(x>v?p.slice(0,v-o):p,y);if(x>=v){p=p.slice(v-o),o=v;break}o=x,p=g[k++],q=g[k++]}}a!=null&&b==null&&f(" ","CodeMirror-selected")}c&&e.push("</pre>");return e.join("")}},i.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+(new Date),e=this.done[this.done.length-1];if(d-this.time>400||!e||e.start>a+b||e.start+e.added<a-e.added+e.old.length)this.done.push({start:a,added:b,old:c});else{var f=0;if(a<e.start){for(var g=e.start-a-1;g>=0;--g)e.old.unshift(c[g]);e.added+=e.start-a,e.start=a}else e.start<a&&(f=a-e.start,b+=f);for(var g=e.added-f,h=c.length;g<h;++g)e.old.push(c[g]);e.added<b&&(e.added=b)}this.time=d}},l.prototype={stop:function(){j.call(this.e)},target:function(){return this.e.target||this.e.srcElement},button:function(){if(this.e.which)return this.e.which;if(this.e.button&1)return 1;if(this.e.button&2)return 3;if(this.e.button&4)return 2},pageX:function(){if(this.e.pageX!=null)return this.e.pageX;var a=this.target().ownerDocument;return this.e.clientX+a.body.scrollLeft+a.documentElement.scrollLeft},pageY:function(){if(this.e.pageY!=null)return this.e.pageY;var a=this.target().ownerDocument;return this.e.clientY+a.body.scrollTop+a.documentElement.scrollTop}},n.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var o=function(){var a=document.createElement("pre");a.innerHTML=" ";return!a.innerHTML}(),p=/gecko\/\d{7}/i.test(navigator.userAgent),q="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(q="\r\n")})();var r=8,s=/Mac/.test(navigator.platform),t={};for(var u=35;u<=40;++u)t[u]=t["c"+u]=!0;if("\n\nb".split(/\n/).length!=3)var E=function(a){var b=0,c,d=[];while((c=a.indexOf("\n",b))>-1)d.push(a.slice(b,a.charAt(c-1)=="\r"?c-1:c)),b=c+1;d.push(a.slice(b));return d};else var E=function(a){return a.split(/\r?\n/)};if(window.getSelection)var F=function(a){try{return{start:a.selectionStart,end:a.selectionEnd}}catch(b){return null}},G=function(a,b,c){try{a.setSelectionRange(b,c)}catch(d){}};else var F=function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){return null}if(!b||b.parentElement()!=a)return null;var d=a.value,e=d.length,f=a.createTextRange();f.moveToBookmark(b.getBookmark());var g=a.createTextRange();g.collapse(!1);if(f.compareEndPoints("StartToEnd",g)>-1)return{start:e,end:e};var h=-f.moveStart("character",-e);for(var i=d.indexOf("\r");i>-1&&i<h;i=d.indexOf("\r",i+1),h++);if(f.compareEndPoints("EndToEnd",g)>-1)return{start:h,end:e};var j=-f.moveEnd("character",-e);for(var i=d.indexOf("\r");i>-1&&i<j;i=d.indexOf("\r",i+1),j++);return{start:h,end:j}},G=function(a,b,c){var d=a.createTextRange();d.collapse(!0);var e=d.duplicate(),f=0,g=a.value;for(var h=g.indexOf("\n");h>-1&&h<b;h=g.indexOf("\n",h+1))++f;d.move("character",b-f);for(;h>-1&&h<c;h=g.indexOf("\n",h+1))++f;e.move("character",c-f),d.setEndPoint("EndToEnd",e),d.select()};a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");return a}();CodeMirror.defineMode("javascript",function(a,b){function R(a,b){if(a=="variable"){v(b);return u()}}function Q(a,b){if(a=="variable"){v(b);return u(Q)}if(a=="(")return u(z(")"),x,I(R,")"),A,C,y)}function P(a){a!=")"&&u(D)}function O(a,b){if(a==";")return u(P);if(b=="in")return u(D);return u(D,B(";"),P)}function N(a,b){if(b=="in")return u(D);return u(E,O)}function M(a){if(a=="var")return u(K,O);if(a==";")return t(O);if(a=="variable")return u(N);return t(O)}function L(a,b){if(b=="=")return u(D,L);if(a==",")return u(K)}function K(a,b){if(a=="variable"){v(b);return u(L)}return u()}function J(a){if(a=="}")return u();return t(C,J)}function I(a,b){function c(d){if(d==",")return u(a,c);if(d==b)return u();return u(B(b))}return function(d){return d==b?u():t(a,c)}}function H(a){a=="variable"&&(s.marked="js-property");if(o.hasOwnProperty(a))return u(B(":"),D)}function G(a){if(a=="variable"){s.marked="js-property";return u()}}function F(a){if(a==":")return u(A,C);return t(E,B(";"),A)}function E(a,b){if(a=="operator"&&/\+\+|--/.test(b))return u(E);if(a=="operator")return u(D);if(a!=";"){if(a=="(")return u(z(")"),I(D,")"),A,E);if(a==".")return u(G,E);if(a=="[")return u(z("]"),D,B("]"),A,E)}}function D(a){if(o.hasOwnProperty(a))return u(E);if(a=="function")return u(Q);if(a=="keyword c")return u(D);if(a=="(")return u(z(")"),D,B(")"),A,E);if(a=="operator")return u(D);if(a=="[")return u(z("]"),I(D,"]"),A,E);if(a=="{")return u(z("}"),I(H,"}"),A,E);return u()}function C(a){if(a=="var")return u(z("vardef"),K,B(";"),A);if(a=="keyword a")return u(z("form"),D,C,A);if(a=="keyword b")return u(z("form"),C,A);if(a=="{")return u(z("}"),J,A);if(a==";")return u();if(a=="function")return u(Q);if(a=="for")return u(z("form"),B("("),z(")"),M,B(")"),A,C,A);if(a=="variable")return u(z("stat"),F);if(a=="switch")return u(z("form"),D,z("}","switch"),B("{"),J,A,A);if(a=="case")return u(D,B(":"));if(a=="default")return u(B(":"));if(a=="catch")return u(z("form"),x,B("("),R,B(")"),C,A,y);return t(z("stat"),D,B(";"),A)}function B(a){return function(b){return b==a?u():a==";"?t():u(arguments.callee)}}function A(){var a=s.state;a.lexical.prev&&(a.lexical.type==")"&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function z(a,b){var c=function(){var c=s.state;c.lexical=new p(c.indented,s.stream.column(),a,null,c.lexical,b)};c.lex=!0;return c}function y(){s.state.localVars=s.state.context.vars,s.state.context=s.state.context.prev}function x(){s.state.context||(s.state.localVars=w),s.state.context={prev:s.state.context,vars:s.state.localVars}}function v(a){var b=s.state;if(b.context){s.marked="js-variabledef";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function u(){t.apply(null,arguments);return!0}function t(){for(var a=arguments.length-1;a>=0;a--)s.cc.push(arguments[a])}function r(a,b,c,e,f){var g=a.cc;s.state=a,s.stream=f,s.marked=null,s.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;){var h=g.length?g.pop():d?D:C;if(h(c,e)){while(g.length&&g[g.length-1].lex)g.pop()();if(s.marked)return s.marked;if(c=="variable"&&q(a,e))return"js-localvariable";return b}}}function q(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function p(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,d!=null&&(this.align=d)}function n(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=l;break}c=d=="*"}return k("comment","js-comment")}function m(a){return function(b,c){h(b,a)||(c.tokenize=l);return k("string","js-string")}}function l(a,b){var c=a.next();if(c=='"'||c=="'")return g(a,b,m(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if(c=="0"&&a.eat(/x/i)){a.eatWhile(/[\da-f]/i);return k("number","js-atom")}if(/\d/.test(c)){a.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);return k("number","js-atom")}if(c=="/"){if(a.eat("*"))return g(a,b,n);if(a.eat("/")){a.skipToEnd();return k("comment","js-comment")}if(b.reAllowed){h(a,"/"),a.eatWhile(/[gimy]/);return k("regexp","js-string")}a.eatWhile(f);return k("operator",null,a.current())}if(f.test(c)){a.eatWhile(f);return k("operator",null,a.current())}a.eatWhile(/[\w\$_]/);var d=a.current(),i=e.propertyIsEnumerable(d)&&e[d];return i?k(i.type,i.style,d):k("variable","js-variable",d)}function k(a,b,c){i=a,j=c;return b}function h(a,b){var c=!1,d;while((d=a.next())!=null){if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}function g(a,b,c){b.tokenize=c;return c(a,b)}var c=a.indentUnit,d=b.json,e=function(){function a(a){return{type:a,style:"js-keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"js-atom"};return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),f=/[+\-*&%=<>!?|]/,i,j,o={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},s={state:null,column:null,marked:null,cc:null},w={name:"this",next:{name:"arguments"}};A.lex=!0;return{startState:function(a){return{tokenize:l,reAllowed:!0,cc:[],lexical:new p((a||0)-c,0,"block",!1),localVars:null,context:null,indented:0}},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);if(i=="comment")return c;b.reAllowed=i=="operator"||i=="keyword c"||i.match(/^[\[{}\(,;:]$/);return r(b,c,i,j,a)},indent:function(a,b){if(a.tokenize!=l)return 0;var d=b&&b.charAt(0),e=a.lexical,f=e.type,g=d==f;return f=="vardef"?e.indented+4:f=="form"&&d=="{"?e.indented:f=="stat"||f=="form"?e.indented+c:e.info=="switch"&&!g?e.indented+(/^(?:case|default)\b/.test(b)?c:2*c):e.align?e.column+(g?0:1):e.indented+(g?0:c)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("xml",function(a,b){function v(a){if(a=="xml-word"&&d.allowUnquoted){m="xml-attribute";return o()}if(a=="xml-attribute")return o();return n()}function u(a){if(a=="xml-word"){m="xml-attname";return o(u)}if(a=="equals")return o(v,u);return n()}function t(a){if(a=="endTag")return o();return n()}function s(a){return function(b){if(b=="selfcloseTag"||b=="endTag"&&d.autoSelfClosers.hasOwnProperty(l.tagName.toLowerCase()))return o();if(b=="endTag"){p(l.tagName,a);return o()}return o()}}function r(a){if(a=="openTag"){l.tagName=f;return o(u,s(l.startOfLine))}if(a=="closeTag"){q();return o(t)}if(a=="xml-cdata"){(!l.context||l.context.name!="!cdata")&&p("!cdata"),l.tokenize==h&&q();return o()}return o()}function q(){l.context&&(l.context=l.context.prev)}function p(a,b){var c=d.doNotIndent.hasOwnProperty(a)||l.context&&l.context.noIndent;l.context={prev:l.context,tagName:a,indent:l.indented,startOfLine:b,noIndent:c}}function o(){n.apply(null,arguments);return!0}function n(){for(var a=arguments.length-1;a>=0;a--)l.cc.push(arguments[a])}function k(a,b){return function(c,d){while(!c.eol()){if(c.match(b)){d.tokenize=h;break}c.next()}return a}}function j(a){return function(b,c){while(!b.eol())if(b.next()==a){c.tokenize=i;break}return"xml-attribute"}}function i(a,b){var c=a.next();if(c==">"||c=="/"&&a.eat(">")){b.tokenize=h,g=c==">"?"endTag":"selfcloseTag";return"xml-tag"}if(c=="="){g="equals";return null}if(/[\'\"]/.test(c)){b.tokenize=j(c);return b.tokenize(a,b)}a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);return"xml-word"}function h(a,b){function c(c){b.tokenize=c;return c(a,b)}var d=a.next();if(d=="<"){if(a.eat("!")){if(a.eat("["))return a.match("CDATA[")?c(k("xml-cdata","]]>")):null;if(a.match("--"))return c(k("xml-comment","-->"));if(a.match("DOCTYPE")){a.eatWhile(/[\w\._\-]/);return c(k("xml-doctype",">"))}return null}if(a.eat("?")){a.eatWhile(/[\w\._\-]/),b.tokenize=k("xml-processing","?>");return"xml-processing"}g=a.eat("/")?"closeTag":"openTag",a.eatSpace(),f="";var e;while(e=a.eat(/[^\s\u00a0=<>\"\'\/?]/))f+=e;b.tokenize=i;return"xml-tag"}if(d=="&"){a.eatWhile(/[^;]/),a.eat(";");return"xml-entity"}a.eatWhile(/[^&<]/);return null}var c=a.indentUnit,d=b.htmlMode?{autoSelfClosers:{br:!0,img:!0,hr:!0,link:!0,input:!0,meta:!0,col:!0,frame:!0,base:!0,area:!0},doNotIndent:{pre:!0,"!cdata":!0},allowUnquoted:!0}:{autoSelfClosers:{},doNotIndent:{"!cdata":!0},allowUnquoted:!1},e=b.alignCDATA,f,g,l,m;return{startState:function(){return{tokenize:h,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(a,b){a.sol()&&(b.startOfLine=!0,b.indented=a.indentation());if(a.eatSpace())return null;m=g=f=null;var c=b.tokenize(a,b);if((c||g)&&c!="xml-comment"){l=b;for(;;){var d=b.cc.pop()||r;if(d(g||c))break}}b.startOfLine=!1;return m||c},indent:function(a,b){var d=a.context;if(d&&d.noIndent)return 0;if(e&&/<!\[CDATA\[/.test(b))return 0;d&&/^<\//.test(b)&&(d=d.prev);while(d&&!d.startOfLine)d=d.prev;return d?d.indent+c:0},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("css",function(a){function h(a){return function(b,c){var f=!1,g;while((g=b.next())!=null){if(g==a&&!f)break;f=!f&&g=="\\"}f||(c.tokenize=e);return d("css-string","string")}}function g(a,b){var c=0,f;while((f=a.next())!=null){if(c>=2&&f==">"){b.tokenize=e;break}c=f=="-"?c+1:0}return d("css-comment","comment")}function f(a,b){var c=!1,f;while((f=a.next())!=null){if(c&&f=="/"){b.tokenize=e;break}c=f=="*"}return d("css-comment","comment")}function e(a,b){var c=a.next();if(c=="@"){a.eatWhile(/\w/);return d("css-at",a.current())}if(c=="/"&&a.eat("*")){b.tokenize=f;return f(a,b)}if(c=="<"&&a.eat("!")){b.tokenize=g;return g(a,b)}if(c=="=")d(null,"compare");else{if(c!="~"&&c!="|"||!a.eat("=")){if(c=='"'||c=="'"){b.tokenize=h(c);return b.tokenize(a,b)}if(c=="#"){a.eatWhile(/\w/);return d("css-selector","hash")}if(c=="!"){a.match(/^\s*\w*/);return d("css-important","important")}if(/\d/.test(c)){a.eatWhile(/[\w.%]/);return d("css-unit","unit")}if(/[,.+>*\/]/.test(c))return d(null,"select-op");if(/[;{}:\[\]]/.test(c))return d(null,c);a.eatWhile(/[\w\\\-_]/);return d("css-identifier","identifier")}return d(null,"compare")}}function d(a,b){c=b;return a}var b=a.indentUnit,c;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];if(c=="hash"&&e=="rule")d="css-colorcode";else if(d=="css-identifier")if(e=="rule")d="css-value";else if(!e||e=="@media{")d="css-selector";e=="rule"&&/^[\{\};]$/.test(c)&&b.stack.pop(),c=="{"?e=="@media"?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):c=="}"?b.stack.pop():c=="@media"?b.stack.push("@media"):e!="rule"&&e!="@media"&&c!="comment"&&b.stack.push("rule");return d},indent:function(a,c){var d=a.stack.length;/^\}/.test(c)&&(d-=a.stack[a.stack.length-1]=="rule"?2:1);return a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(a,b){function i(a,b){if(a.match(/^<\/\s*style\s*>/i,!1)){b.token=f,b.localState=null;return f(a,b)}return g(a,/<\/\s*style\s*>/,e.token(a,b.localState))}function h(a,b){if(a.match(/^<\/\s*script\s*>/i,!1)){b.token=f,b.curState=null;return f(a,b)}return g(a,/<\/\s*script\s*>/,d.token(a,b.localState))}function g(a,b,c){var d=a.current(),e=d.search(b);e>-1&&a.backUp(d.length-e);return c}function f(a,b){var f=c.token(a,b.htmlState);f=="xml-tag"&&a.current()==">"&&b.htmlState.context&&(/^script$/i.test(b.htmlState.context.tagName)?(b.token=h,b.localState=d.startState(c.indent(b.htmlState,""))):/^style$/i.test(b.htmlState.context.tagName)&&(b.token=i,b.localState=e.startState(c.indent(b.htmlState,""))));return f}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"javascript"),e=CodeMirror.getMode(a,"css");return{startState:function(){var a=c.startState();return{token:f,localState:null,htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.token==i?e:d,a.localState);return{token:a.token,localState:b,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==f||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.token==h?d.indent(a.localState,b):e.indent(a.localState,b)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed")
|
addons/codemagic/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="cs.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
4 |
+
<file name="cs_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
5 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
6 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
7 |
+
<file name="sk.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
8 |
+
<file name="sk_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="129945744000000000" remote="129945744000000000" Dst="2" />
|
9 |
+
</dwsync>
|
addons/codemagic/langs/cs.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('cs.codemagic',{
|
2 |
+
editor_button: "Upravit HTML kód"
|
3 |
+
});
|
addons/codemagic/langs/cs_dlg.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('cs.codemagic',{
|
2 |
+
code_title: "CodeMagic - zvýraznení syntaxe a formátování kódu",
|
3 |
+
code_label: "Editovat kód",
|
4 |
+
toggle_highlighting: "Zvýraznení kódu",
|
5 |
+
toggle_autocompletion: "Doplňování kódu",
|
6 |
+
search: "Hledat",
|
7 |
+
replace: "Nahradit",
|
8 |
+
undo: "Zpět",
|
9 |
+
redo: "Opakovat",
|
10 |
+
search_replace: "Hledat a nahradit",
|
11 |
+
reintendt: "Zformátovat kód",
|
12 |
+
nothing_found: "Hledaný výraz nebyl nalezen.",
|
13 |
+
nothing_to_replace: "Není co nahradit."
|
14 |
+
});
|
addons/codemagic/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.codemagic',{
|
2 |
+
editor_button: "Edit source code"
|
3 |
+
});
|
addons/codemagic/langs/en_dlg.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.codemagic_dlg',{
|
2 |
+
code_title: "CodeMagic - syntax coloring and intendation",
|
3 |
+
code_label: "Edit code",
|
4 |
+
toggle_highlighting: "Syntax highlighting",
|
5 |
+
toggle_autocompletion: "Auto completion",
|
6 |
+
toggle_wraptext: "Wrap text",
|
7 |
+
search: "Search",
|
8 |
+
replace: "Replace",
|
9 |
+
undo: "Undo",
|
10 |
+
redo: "Redo",
|
11 |
+
search_replace: "Search and Replace",
|
12 |
+
reintendt: "Format HTML code",
|
13 |
+
nothing_found: "Nothing found.",
|
14 |
+
nothing_to_replace: "Nothing to replace."
|
15 |
+
});
|
addons/codemagic/langs/sk.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('sk.codemagic',{
|
2 |
+
editor_button: "Upraviť HTML kód"
|
3 |
+
});
|
addons/codemagic/langs/sk_dlg.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('sk.codemagic',{
|
2 |
+
code_title: "CodeMagic - zvýraznenie syntaxe a formátovanie kódu",
|
3 |
+
code_label: "Editovať kód",
|
4 |
+
toggle_highlighting: "Zvýraznenie kódu",
|
5 |
+
toggle_autocompletion: "Doplňovenie kódu",
|
6 |
+
search: "Hľadať",
|
7 |
+
replace: "Nahradiť",
|
8 |
+
undo: "Späť",
|
9 |
+
redo: "Opakovať",
|
10 |
+
search_replace: "Hľadať a nahradiť",
|
11 |
+
reintendt: "Sformátovať kód",
|
12 |
+
nothing_found: "Hľadaný výraz nebol nájdený.",
|
13 |
+
nothing_to_replace: "Nie je čo nahradiť."
|
14 |
+
});
|
addons/codemagic/licence.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2011 sutulustus.com
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
6 |
+
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
7 |
+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
8 |
+
|
9 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
10 |
+
|
11 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
12 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
addons/directionality/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111065000000000" remote="130111065000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111063200000000" remote="130111063200000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/directionality/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{/*title : 'directionality.ltr_desc',*/title:b.getLang('directionality.ltr_desc'),cmd:"mceDirectionLTR"});b.addButton("rtl",{/*title : 'directionality.rtl_desc',*/title:b.getLang('directionality.rtl_desc'),cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
addons/directionality/editor_plugin_src.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Directionality', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
function setDir(dir) {
|
19 |
+
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
|
20 |
+
|
21 |
+
if (blocks.length) {
|
22 |
+
curDir = dom.getAttrib(blocks[0], "dir");
|
23 |
+
|
24 |
+
tinymce.each(blocks, function(block) {
|
25 |
+
// Add dir to block if the parent block doesn't already have that dir
|
26 |
+
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
27 |
+
if (curDir != dir) {
|
28 |
+
dom.setAttrib(block, "dir", dir);
|
29 |
+
} else {
|
30 |
+
dom.setAttrib(block, "dir", null);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
});
|
34 |
+
|
35 |
+
ed.nodeChanged();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
ed.addCommand('mceDirectionLTR', function() {
|
40 |
+
setDir("ltr");
|
41 |
+
});
|
42 |
+
|
43 |
+
ed.addCommand('mceDirectionRTL', function() {
|
44 |
+
setDir("rtl");
|
45 |
+
});
|
46 |
+
|
47 |
+
ed.addButton('ltr', {/*title : 'directionality.ltr_desc',*/title : ed.getLang('directionality.ltr_desc'), cmd : 'mceDirectionLTR'});
|
48 |
+
ed.addButton('rtl', {/*title : 'directionality.rtl_desc',*/title : ed.getLang('directionality.rtl_desc'), cmd : 'mceDirectionRTL'});
|
49 |
+
|
50 |
+
ed.onNodeChange.add(t._nodeChange, t);
|
51 |
+
},
|
52 |
+
|
53 |
+
getInfo : function() {
|
54 |
+
return {
|
55 |
+
longname : 'Directionality',
|
56 |
+
author : 'Moxiecode Systems AB',
|
57 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
58 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
59 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
60 |
+
};
|
61 |
+
},
|
62 |
+
|
63 |
+
// Private methods
|
64 |
+
|
65 |
+
_nodeChange : function(ed, cm, n) {
|
66 |
+
var dom = ed.dom, dir;
|
67 |
+
|
68 |
+
n = dom.getParent(n, dom.isBlock);
|
69 |
+
if (!n) {
|
70 |
+
cm.setDisabled('ltr', 1);
|
71 |
+
cm.setDisabled('rtl', 1);
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
dir = dom.getAttrib(n, 'dir');
|
76 |
+
cm.setActive('ltr', dir == "ltr");
|
77 |
+
cm.setDisabled('ltr', 0);
|
78 |
+
cm.setActive('rtl', dir == "rtl");
|
79 |
+
cm.setDisabled('rtl', 0);
|
80 |
+
}
|
81 |
+
});
|
82 |
+
|
83 |
+
// Register plugin
|
84 |
+
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
|
85 |
+
})();
|
addons/emotions/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111345800000000" remote="130111345800000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111345800000000" remote="130111345800000000" Dst="2" />
|
5 |
+
<file name="emotions.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/emotions/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:500+parseInt(b.getLang("emotions.delta_width",0)),height:500+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:b.getLang("emotions.emotions_desc"),cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
|
addons/emotions/editor_plugin_src.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function(tinymce) {
|
12 |
+
tinymce.create('tinymce.plugins.EmotionsPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceEmotion', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/emotions.htm',
|
18 |
+
width : 500 + parseInt(ed.getLang('emotions.delta_width', 0)),
|
19 |
+
height : 500 + parseInt(ed.getLang('emotions.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('emotions', {title : ed.getLang('emotions.emotions_desc'), cmd : 'mceEmotion'});
|
28 |
+
},
|
29 |
+
|
30 |
+
getInfo : function() {
|
31 |
+
return {
|
32 |
+
longname : 'Emotions',
|
33 |
+
author : 'Moxiecode Systems AB',
|
34 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
35 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
|
36 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
37 |
+
};
|
38 |
+
}
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register plugin
|
42 |
+
tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
|
43 |
+
})(tinymce);
|
addons/emotions/emotions.htm
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#emotions_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/emotions.js"></script>
|
7 |
+
</head>
|
8 |
+
<body style="display:none;" role="application" aria-labelledby="app_title">
|
9 |
+
<span style="display:none;" id="app_title">{#emotions_dlg.title}</span>
|
10 |
+
<div align="center">
|
11 |
+
<div class="title">{#emotions_dlg.title}:<br /><br /></div>
|
12 |
+
|
13 |
+
<table id="emoticon_table" role="presentation" border="0" cellspacing="0" cellpadding="4">
|
14 |
+
<th colspan="16">Primary Emoticons:</th>
|
15 |
+
<tr>
|
16 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cool}" href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" /></a></td>
|
17 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry}" href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" /></a></td>
|
18 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.embarassed}" href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" /></a></td>
|
19 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.foot_in_mouth}" href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" /></a></td>
|
20 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.frown}" href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" /></a></td>
|
21 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.innocent}" href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" /></a></td>
|
22 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.kiss}" href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" /></a></td>
|
23 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.laughing}" href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" /></a></td>
|
24 |
+
<!-- </tr>
|
25 |
+
<tr> -->
|
26 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.money_mouth}" href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}"/></a></td>
|
27 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.sealed}" href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" /></a></td>
|
28 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.smile}" href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" /></a></td>
|
29 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.surprised}" href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" /></a></td>
|
30 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.tongue_out}" href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue_out}" /></a></td>
|
31 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.undecided}" href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" /></a></td>
|
32 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.wink}" href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" /></a></td>
|
33 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.yell}" href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" /></a></td>
|
34 |
+
</tr> <tr><td> </td></tr>
|
35 |
+
|
36 |
+
<th colspan="16">Blueticons</th>
|
37 |
+
<tr>
|
38 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Ahhhh}" href="javascript:EmotionsDialog.insert('blueicons/Ahhhh.png','emotions_dlg.Ahhhh');"><img src="img/blueicons/Ahhhh.png" width="18" height="18" border="0" alt="{#emotions_dlg.Ahhhh}" /></a></td>
|
39 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Alien}" href="javascript:EmotionsDialog.insert('blueicons/Alien.png','emotions_dlg.Alien');"><img src="img/blueicons/Alien.png" width="18" height="18" border="0" alt="{#emotions_dlg.Alien}" /></a></td>
|
40 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Blush}" href="javascript:EmotionsDialog.insert('blueicons/Blush.png','emotions_dlg.Blush');"><img src="img/blueicons/Blush.png" width="18" height="18" border="0" alt="{#emotions_dlg.Blush}" /></a></td>
|
41 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Cool1}" href="javascript:EmotionsDialog.insert('blueicons/Cool1.png','emotions_dlg.Cool1');"><img src="img/blueicons/Cool1.png" width="18" height="18" border="0" alt="{#emotions_dlg.Cool1}" /></a></td>
|
42 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Crying}" href="javascript:EmotionsDialog.insert('blueicons/Crying.png','emotions_dlg.Crying');"><img src="img/blueicons/Crying.png" width="18" height="18" border="0" alt="{#emotions_dlg.Crying}" /></a></td>
|
43 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Devil}" href="javascript:EmotionsDialog.insert('blueicons/Devil.png','emotions_dlg.Devil');"><img src="img/blueicons/Devil.png" width="18" height="18" border="0" alt="{#emotions_dlg.Devil}" /></a></td>
|
44 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Happy}" href="javascript:EmotionsDialog.insert('blueicons/Happy.png','emotions_dlg.Happy');"><img src="img/blueicons/Happy.png" width="18" height="18" border="0" alt="{#emotions_dlg.Happy}" /></a></td>
|
45 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Huh}" href="javascript:EmotionsDialog.insert('blueicons/Huh.png','emotions_dlg.Huh');"><img src="img/blueicons/Huh.png" width="18" height="18" border="0" alt="{#emotions_dlg.Huh}" /></a></td>
|
46 |
+
<!-- </tr>
|
47 |
+
<tr> -->
|
48 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Love}" href="javascript:EmotionsDialog.insert('blueicons/Love.png','emotions_dlg.Love');"><img src="img/blueicons/Love.png" width="18" height="18" border="0" alt="{#emotions_dlg.Love}" /></a></td>
|
49 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Sick}" href="javascript:EmotionsDialog.insert('blueicons/Sick.png','emotions_dlg.Sick');"><img src="img/blueicons/Sick.png" width="18" height="18" border="0" alt="{#emotions_dlg.Sick}" /></a></td>
|
50 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Sleep}" href="javascript:EmotionsDialog.insert('blueicons/Sleep.png','emotions_dlg.Sleep');"><img src="img/blueicons/Sleep.png" width="18" height="18" border="0" alt="{#emotions_dlg.Sleep}" /></a></td>
|
51 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Smile1}" href="javascript:EmotionsDialog.insert('blueicons/Smile1.png','emotions_dlg.Smile1');"><img src="img/blueicons/Smile1.png" width="18" height="18" border="0" alt="{#emotions_dlg.Smile1}" /></a></td>
|
52 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Tear}" href="javascript:EmotionsDialog.insert('blueicons/Tear.png','emotions_dlg.Tear');"><img src="img/blueicons/Tear.png" width="18" height="18" border="0" alt="{#emotions_dlg.Tear}" /></a></td>
|
53 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Tounge}" href="javascript:EmotionsDialog.insert('blueicons/Tounge.png','emotions_dlg.Tounge');"><img src="img/blueicons/Tounge.png" width="18" height="18" border="0" alt="{#emotions_dlg.Tounge}" /></a></td>
|
54 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Wink1}" href="javascript:EmotionsDialog.insert('blueicons/Wink1.png','emotions_dlg.Wink1');"><img src="img/blueicons/Wink1.png" width="18" height="18" border="0" alt="{#emotions_dlg.Wink1}" /></a></td>
|
55 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.Yikes}" href="javascript:EmotionsDialog.insert('blueicons/Yikes.png','emotions_dlg.Yikes');"><img src="img/blueicons/Yikes.png" width="18" height="18" border="0" alt="{#emotions_dlg.Yikes}" /></a></td>
|
56 |
+
</tr> <tr><td> </td></tr>
|
57 |
+
|
58 |
+
<th colspan="16">Popo Icons</th>
|
59 |
+
<tr>
|
60 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.amazing}" href="javascript:EmotionsDialog.insert('popo/amazing.png','emotions_dlg.amazing');"><img src="img/popo/amazing.png" width="18" height="18" border="0" alt="{#emotions_dlg.amazing}" /></a></td>
|
61 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.big_smile}" href="javascript:EmotionsDialog.insert('popo/big_smile.png','emotions_dlg.big_smile');"><img src="img/popo/big_smile.png" width="18" height="18" border="0" alt="{#emotions_dlg.big_smile}" /></a></td>
|
62 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry1}" href="javascript:EmotionsDialog.insert('popo/cry1.png','emotions_dlg.cry1');"><img src="img/popo/cry1.png" width="18" height="18" border="0" alt="{#emotions_dlg.cry1}" /></a></td>
|
63 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.electric_shock}" href="javascript:EmotionsDialog.insert('popo/electric_shock.png','emotions_dlg.electric_shock');"><img src="img/popo/electric_shock.png" width="18" height="18" border="0" alt="{#emotions_dlg.electric_shock}" /></a></td>
|
64 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.exciting}" href="javascript:EmotionsDialog.insert('popo/exciting.png','emotions_dlg.exciting');"><img src="img/popo/exciting.png" width="18" height="18" border="0" alt="{#emotions_dlg.exciting}" /></a></td>
|
65 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.eyes_dropped}" href="javascript:EmotionsDialog.insert('popo/eyes_dropped.png','emotions_dlg.eyes_dropped');"><img src="img/popo/eyes_dropped.png" width="18" height="18" border="0" alt="{#emotions_dlg.eyes_dropped}" /></a></td>
|
66 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.girl}" href="javascript:EmotionsDialog.insert('popo/girl.png','emotions_dlg.girl');"><img src="img/popo/girl.png" width="18" height="18" border="0" alt="{#emotions_dlg.girl}" /></a></td>
|
67 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.grimace}" href="javascript:EmotionsDialog.insert('popo/grimace.png','emotions_dlg.grimace');"><img src="img/popo/grimace.png" width="18" height="18" border="0" alt="{#emotions_dlg.grimace}" /></a></td>
|
68 |
+
<!-- </tr>
|
69 |
+
<tr> -->
|
70 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.haha}" href="javascript:EmotionsDialog.insert('popo/haha.png','emotions_dlg.haha');"><img src="img/popo/haha.png" width="18" height="18" border="0" alt="{#emotions_dlg.haha}" /></a></td>
|
71 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.scorn}" href="javascript:EmotionsDialog.insert('popo/scorn.png','emotions_dlg.scorn');"><img src="img/popo/scorn.png" width="18" height="18" border="0" alt="{#emotions_dlg.scorn}" /></a></td>
|
72 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.secret_smile}" href="javascript:EmotionsDialog.insert('popo/secret_smile.png','emotions_dlg.secret_smile');"><img src="img/popo/secret_smile.png" width="18" height="18" border="0" alt="{#emotions_dlg.secret_smile}" /></a></td>
|
73 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.shame}" href="javascript:EmotionsDialog.insert('popo/shame.png','emotions_dlg.shame');"><img src="img/popo/shame.png" width="18" height="18" border="0" alt="{#emotions_dlg.shame}" /></a></td>
|
74 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.shocked}" href="javascript:EmotionsDialog.insert('popo/shocked.png','emotions_dlg.shocked');"><img src="img/popo/shocked.png" width="18" height="18" border="0" alt="{#emotions_dlg.shocked}" /></a></td>
|
75 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.unhappy}" href="javascript:EmotionsDialog.insert('popo/unhappy.png','emotions_dlg.unhappy');"><img src="img/popo/unhappy.png" width="18" height="18" border="0" alt="{#emotions_dlg.unhappy}" /></a></td>
|
76 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.victory}" href="javascript:EmotionsDialog.insert('popo/victory.png','emotions_dlg.victory');"><img src="img/popo/victory.png" width="18" height="18" border="0" alt="{#emotions_dlg.victory}" /></a></td>
|
77 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.what}" href="javascript:EmotionsDialog.insert('popo/what.png','emotions_dlg.what');"><img src="img/popo/what.png" width="18" height="18" border="0" alt="{#emotions_dlg.what}" /></a></td>
|
78 |
+
</tr> <tr><td> </td></tr>
|
79 |
+
|
80 |
+
<th colspan="16">More Popo's</th>
|
81 |
+
<tr>
|
82 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoadore}" href="javascript:EmotionsDialog.insert('popobig/adore.png','emotions_dlg.popoadore');"><img src="img/popobig/adore.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoadore}" /></a></td>
|
83 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoah}" href="javascript:EmotionsDialog.insert('popobig/ah.png','emotions_dlg.popoah');"><img src="img/popobig/ah.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoah}" /></a></td>
|
84 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoangry}" href="javascript:EmotionsDialog.insert('popobig/angry.png','emotions_dlg.popoangry');"><img src="img/popobig/angry.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoangry}" /></a></td>
|
85 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popobaffle}" href="javascript:EmotionsDialog.insert('popobig/baffle.png','emotions_dlg.popobaffle');"><img src="img/popobig/baffle.png" width="36" height="36" border="0" alt="{#emotions_dlg.popobaffle}" /></a></td>
|
86 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popobeat_ball}" href="javascript:EmotionsDialog.insert('popobig/beat_ball.png','emotions_dlg.popobeat_ball');"><img src="img/popobig/beat_ball.png" width="36" height="36" border="0" alt="{#emotions_dlg.popobeat_ball}" /></a></td>
|
87 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popobeat_brick}" href="javascript:EmotionsDialog.insert('popobig/beat_brick.png','emotions_dlg.popobeat_brick');"><img src="img/popobig/beat_brick.png" width="36" height="36" border="0" alt="{#emotions_dlg.popobeat_brick}" /></a></td>
|
88 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popobig_smile}" href="javascript:EmotionsDialog.insert('popobig/big_smile.png','emotions_dlg.popobig_smile');"><img src="img/popobig/big_smile.png" width="36" height="36" border="0" alt="{#emotions_dlg.popobig_smile}" /></a></td>
|
89 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoboss}" href="javascript:EmotionsDialog.insert('popobig/boss.png','emotions_dlg.popoboss');"><img src="img/popobig/boss.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoboss}" /></a></td>
|
90 |
+
</tr>
|
91 |
+
|
92 |
+
<tr>
|
93 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoburn_joss_stick}" href="javascript:EmotionsDialog.insert('popobig/burn_joss_stick.png','emotions_dlg.popoburn_joss_stick');"><img src="img/popobig/burn_joss_stick.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoburn_joss_stick}" /></a></td>
|
94 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popocanny}" href="javascript:EmotionsDialog.insert('popobig/canny.png','emotions_dlg.popocanny');"><img src="img/popobig/canny.png" width="36" height="36" border="0" alt="{#emotions_dlg.popocanny}" /></a></td>
|
95 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popofurious}" href="javascript:EmotionsDialog.insert('popobig/furious.png','emotions_dlg.popofurious');"><img src="img/popobig/furious.png" width="36" height="36" border="0" alt="{#emotions_dlg.popofurious}" /></a></td>
|
96 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoconfident}" href="javascript:EmotionsDialog.insert('popobig/confident.png','emotions_dlg.popoconfident');"><img src="img/popobig/confident.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoconfident}" /></a></td>
|
97 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoconfuse}" href="javascript:EmotionsDialog.insert('popobig/confuse.png','emotions_dlg.popoconfuse');"><img src="img/popobig/confuse.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoconfuse}" /></a></td>
|
98 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popocry}" href="javascript:EmotionsDialog.insert('popobig/cry.png','emotions_dlg.popocry');"><img src="img/popobig/cry.png" width="36" height="36" border="0" alt="{#emotions_dlg.popocry}" /></a></td>
|
99 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popodoubt}" href="javascript:EmotionsDialog.insert('popobig/doubt.png','emotions_dlg.popodoubt');"><img src="img/popobig/doubt.png" width="36" height="36" border="0" alt="{#emotions_dlg.popodoubt}" /></a></td>
|
100 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popodribble}" href="javascript:EmotionsDialog.insert('popobig/dribble.png','emotions_dlg.popodribble');"><img src="img/popobig/dribble.png" width="36" height="36" border="0" alt="{#emotions_dlg.popodribble}" /></a></td>
|
101 |
+
</tr>
|
102 |
+
|
103 |
+
<tr>
|
104 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoembarrassed}" href="javascript:EmotionsDialog.insert('popobig/embarrassed.png','emotions_dlg.popoembarrassed');"><img src="img/popobig/embarrassed.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoembarrassed}" /></a></td>
|
105 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popofeel_good}" href="javascript:EmotionsDialog.insert('popobig/feel_good.png','emotions_dlg.popofeel_good');"><img src="img/popobig/feel_good.png" width="36" height="36" border="0" alt="{#emotions_dlg.popofeel_good}" /></a></td>
|
106 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popohaha}" href="javascript:EmotionsDialog.insert('popobig/haha.png','emotions_dlg.popohaha');"><img src="img/popobig/haha.png" width="36" height="36" border="0" alt="{#emotions_dlg.popohaha}" /></a></td>
|
107 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popohell_boy}" href="javascript:EmotionsDialog.insert('popobig/hell_boy.png','emotions_dlg.popohell_boy');"><img src="img/popobig/hell_boy.png" width="36" height="36" border="0" alt="{#emotions_dlg.popohell_boy}" /></a></td>
|
108 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popolook_down}" href="javascript:EmotionsDialog.insert('popobig/look_down.png','emotions_dlg.popolook_down');"><img src="img/popobig/look_down.png" width="36" height="36" border="0" alt="{#emotions_dlg.popolook_down}" /></a></td>
|
109 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popomatrix}" href="javascript:EmotionsDialog.insert('popobig/matrix.png','emotions_dlg.popomatrix');"><img src="img/popobig/matrix.png" width="36" height="36" border="0" alt="{#emotions_dlg.popomatrix}" /></a></td>
|
110 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popomisdoubt}" href="javascript:EmotionsDialog.insert('popobig/misdoubt.png','emotions_dlg.popomisdoubt');"><img src="img/popobig/misdoubt.png" width="36" height="36" border="0" alt="{#emotions_dlg.popomisdoubt}" /></a></td>
|
111 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popooh}" href="javascript:EmotionsDialog.insert('popobig/oh.png','emotions_dlg.popooh');"><img src="img/popobig/oh.png" width="36" height="36" border="0" alt="{#emotions_dlg.popooh}" /></a></td>
|
112 |
+
</tr>
|
113 |
+
|
114 |
+
<tr>
|
115 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popoops}" href="javascript:EmotionsDialog.insert('popobig/ops.png','emotions_dlg.popoops');"><img src="img/popobig/ops.png" width="36" height="36" border="0" alt="{#emotions_dlg.popoops}" /></a></td>
|
116 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.poposad}" href="javascript:EmotionsDialog.insert('popobig/sad.png','emotions_dlg.poposad');"><img src="img/popobig/sad.png" width="36" height="36" border="0" alt="{#emotions_dlg.poposad}" /></a></td>
|
117 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popostill_dreaming}" href="javascript:EmotionsDialog.insert('popobig/still_dreaming.png','emotions_dlg.popostill_dreaming');"><img src="img/popobig/still_dreaming.png" width="36" height="36" border="0" alt="{#emotions_dlg.popostill_dreaming}" /></a></td>
|
118 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.poposurrender}" href="javascript:EmotionsDialog.insert('popobig/surrender.png','emotions_dlg.poposurrender');"><img src="img/popobig/surrender.png" width="36" height="36" border="0" alt="{#emotions_dlg.poposurrender}" /></a></td>
|
119 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.poposweet_kiss}" href="javascript:EmotionsDialog.insert('popobig/sweet_kiss.png','emotions_dlg.poposweet_kiss');"><img src="img/popobig/sweet_kiss.png" width="36" height="36" border="0" alt="{#emotions_dlg.poposweet_kiss}" /></a></td>
|
120 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popotired}" href="javascript:EmotionsDialog.insert('popobig/tired.png','emotions_dlg.popotired');"><img src="img/popobig/tired.png" width="36" height="36" border="0" alt="{#emotions_dlg.popotired}" /></a></td>
|
121 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popotoo_sad}" href="javascript:EmotionsDialog.insert('popobig/too_sad.png','emotions_dlg.popotoo_sad');"><img src="img/popobig/too_sad.png" width="36" height="36" border="0" alt="{#emotions_dlg.popotoo_sad}" /></a></td>
|
122 |
+
<td colspan="2"><a class="emoticon_link" role="button" title="{#emotions_dlg.popowhat}" href="javascript:EmotionsDialog.insert('popobig/what.png','emotions_dlg.popowhat');"><img src="img/popobig/what.png" width="36" height="36" border="0" alt="{#emotions_dlg.popowhat}" /></a></td>
|
123 |
+
</tr>
|
124 |
+
</table>
|
125 |
+
<br />
|
126 |
+
<br />
|
127 |
+
<div>{#emotions_dlg.usage}</div>
|
128 |
+
</div>
|
129 |
+
</body>
|
130 |
+
</html>
|
addons/emotions/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="smiley-cool.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="smiley-cry.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="smiley-embarassed.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="smiley-foot-in-mouth.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="smiley-frown.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="smiley-innocent.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="smiley-kiss.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="smiley-laughing.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="smiley-money-mouth.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="smiley-sealed.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
<file name="smiley-smile.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
14 |
+
<file name="smiley-surprised.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
15 |
+
<file name="smiley-tongue-out.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
16 |
+
<file name="smiley-undecided.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
17 |
+
<file name="smiley-wink.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
18 |
+
<file name="smiley-yell.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
19 |
+
</dwsync>
|
addons/emotions/img/blueicons/Ahhhh.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Alien.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Blush.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Cool1.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Crying.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Devil.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Happy.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Huh.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Love.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Sick.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Sleep.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Smile1.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Tear.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Tounge.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Wink1.png
ADDED
Binary file
|
addons/emotions/img/blueicons/Yikes.png
ADDED
Binary file
|
addons/emotions/img/blueicons/_notes/dwsync.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="Ahhhh.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="Alien.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="Blush.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="Cool1.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="Crying.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="Devil.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="Happy.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="Huh.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="Love.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="Sick.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
<file name="Sleep.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
14 |
+
<file name="Smile1.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
15 |
+
<file name="Tear.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
16 |
+
<file name="Tounge.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
17 |
+
<file name="Wink1.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
18 |
+
<file name="Yikes.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
19 |
+
</dwsync>
|
addons/emotions/img/popo/_notes/dwsync.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="amazing.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="big_smile.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="cry1.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="electric_shock.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="exciting.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="eyes_dropped.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="girl.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="grimace.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="haha.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="scorn.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
<file name="secret_smile.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
14 |
+
<file name="shame.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
15 |
+
<file name="shocked.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
16 |
+
<file name="unhappy.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
17 |
+
<file name="victory.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
18 |
+
<file name="what.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
19 |
+
</dwsync>
|
addons/emotions/img/popo/amazing.png
ADDED
Binary file
|
addons/emotions/img/popo/big_smile.png
ADDED
Binary file
|
addons/emotions/img/popo/cry1.png
ADDED
Binary file
|
addons/emotions/img/popo/electric_shock.png
ADDED
Binary file
|
addons/emotions/img/popo/exciting.png
ADDED
Binary file
|
addons/emotions/img/popo/eyes_dropped.png
ADDED
Binary file
|
addons/emotions/img/popo/girl.png
ADDED
Binary file
|
addons/emotions/img/popo/grimace.png
ADDED
Binary file
|
addons/emotions/img/popo/haha.png
ADDED
Binary file
|
addons/emotions/img/popo/scorn.png
ADDED
Binary file
|
addons/emotions/img/popo/secret_smile.png
ADDED
Binary file
|
addons/emotions/img/popo/shame.png
ADDED
Binary file
|
addons/emotions/img/popo/shocked.png
ADDED
Binary file
|
addons/emotions/img/popo/unhappy.png
ADDED
Binary file
|
addons/emotions/img/popo/victory.png
ADDED
Binary file
|
addons/emotions/img/popo/what.png
ADDED
Binary file
|
addons/emotions/img/popobig/_notes/dwsync.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="adore.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="ah.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="angry.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="baffle.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="beat_ball.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="beat_brick.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="big_smile.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="boss.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="burn_joss_stick.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="canny.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
<file name="confident.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
14 |
+
<file name="confuse.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
15 |
+
<file name="cry.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
16 |
+
<file name="doubt.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
17 |
+
<file name="dribble.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
18 |
+
<file name="embarrassed.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
19 |
+
<file name="feel_good.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
20 |
+
<file name="furious.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
21 |
+
<file name="haha.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
22 |
+
<file name="hell_boy.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
23 |
+
<file name="look_down.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
24 |
+
<file name="matrix.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
25 |
+
<file name="misdoubt.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
26 |
+
<file name="oh.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
27 |
+
<file name="ops.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
28 |
+
<file name="sad.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
29 |
+
<file name="still_dreaming.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
30 |
+
<file name="surrender.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
31 |
+
<file name="sweet_kiss.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
32 |
+
<file name="tired.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
33 |
+
<file name="too_sad.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
34 |
+
<file name="what.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
35 |
+
</dwsync>
|
addons/emotions/img/popobig/adore.png
ADDED
Binary file
|
addons/emotions/img/popobig/ah.png
ADDED
Binary file
|
addons/emotions/img/popobig/angry.png
ADDED
Binary file
|
addons/emotions/img/popobig/baffle.png
ADDED
Binary file
|
addons/emotions/img/popobig/beat_ball.png
ADDED
Binary file
|
addons/emotions/img/popobig/beat_brick.png
ADDED
Binary file
|
addons/emotions/img/popobig/big_smile.png
ADDED
Binary file
|
addons/emotions/img/popobig/boss.png
ADDED
Binary file
|
addons/emotions/img/popobig/burn_joss_stick.png
ADDED
Binary file
|
addons/emotions/img/popobig/canny.png
ADDED
Binary file
|
addons/emotions/img/popobig/confident.png
ADDED
Binary file
|
addons/emotions/img/popobig/confuse.png
ADDED
Binary file
|
addons/emotions/img/popobig/cry.png
ADDED
Binary file
|
addons/emotions/img/popobig/doubt.png
ADDED
Binary file
|
addons/emotions/img/popobig/dribble.png
ADDED
Binary file
|
addons/emotions/img/popobig/embarrassed.png
ADDED
Binary file
|
addons/emotions/img/popobig/feel_good.png
ADDED
Binary file
|
addons/emotions/img/popobig/furious.png
ADDED
Binary file
|
addons/emotions/img/popobig/haha.png
ADDED
Binary file
|
addons/emotions/img/popobig/hell_boy.png
ADDED
Binary file
|
addons/emotions/img/popobig/look_down.png
ADDED
Binary file
|
addons/emotions/img/popobig/matrix.png
ADDED
Binary file
|
addons/emotions/img/popobig/misdoubt.png
ADDED
Binary file
|
addons/emotions/img/popobig/oh.png
ADDED
Binary file
|
addons/emotions/img/popobig/ops.png
ADDED
Binary file
|
addons/emotions/img/popobig/sad.png
ADDED
Binary file
|
addons/emotions/img/popobig/still_dreaming.png
ADDED
Binary file
|
addons/emotions/img/popobig/surrender.png
ADDED
Binary file
|
addons/emotions/img/popobig/sweet_kiss.png
ADDED
Binary file
|
addons/emotions/img/popobig/tired.png
ADDED
Binary file
|
addons/emotions/img/popobig/too_sad.png
ADDED
Binary file
|
addons/emotions/img/popobig/what.png
ADDED
Binary file
|
addons/emotions/img/smiley-cool.gif
ADDED
Binary file
|
addons/emotions/img/smiley-cry.gif
ADDED
Binary file
|
addons/emotions/img/smiley-embarassed.gif
ADDED
Binary file
|
addons/emotions/img/smiley-foot-in-mouth.gif
ADDED
Binary file
|
addons/emotions/img/smiley-frown.gif
ADDED
Binary file
|
addons/emotions/img/smiley-innocent.gif
ADDED
Binary file
|
addons/emotions/img/smiley-kiss.gif
ADDED
Binary file
|
addons/emotions/img/smiley-laughing.gif
ADDED
Binary file
|
addons/emotions/img/smiley-money-mouth.gif
ADDED
Binary file
|
addons/emotions/img/smiley-sealed.gif
ADDED
Binary file
|
addons/emotions/img/smiley-smile.gif
ADDED
Binary file
|
addons/emotions/img/smiley-surprised.gif
ADDED
Binary file
|
addons/emotions/img/smiley-tongue-out.gif
ADDED
Binary file
|
addons/emotions/img/smiley-undecided.gif
ADDED
Binary file
|
addons/emotions/img/smiley-wink.gif
ADDED
Binary file
|
addons/emotions/img/smiley-yell.gif
ADDED
Binary file
|
addons/emotions/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="emotions.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/emotions/js/emotions.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var EmotionsDialog = {
|
4 |
+
addKeyboardNavigation: function(){
|
5 |
+
var tableElm, cells, settings;
|
6 |
+
|
7 |
+
cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table");
|
8 |
+
|
9 |
+
settings ={
|
10 |
+
root: "emoticon_table",
|
11 |
+
items: cells
|
12 |
+
};
|
13 |
+
cells[0].tabindex=0;
|
14 |
+
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
|
15 |
+
if (tinymce.isGecko) {
|
16 |
+
cells[0].focus();
|
17 |
+
} else {
|
18 |
+
setTimeout(function(){
|
19 |
+
cells[0].focus();
|
20 |
+
}, 100);
|
21 |
+
}
|
22 |
+
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
|
23 |
+
},
|
24 |
+
init : function(ed) {
|
25 |
+
tinyMCEPopup.resizeToInnerSize();
|
26 |
+
this.addKeyboardNavigation();
|
27 |
+
},
|
28 |
+
|
29 |
+
insert : function(file, title) {
|
30 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
31 |
+
|
32 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
|
33 |
+
src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
|
34 |
+
alt : ed.getLang(title),
|
35 |
+
title : ed.getLang(title),
|
36 |
+
border : 0
|
37 |
+
}));
|
38 |
+
|
39 |
+
tinyMCEPopup.close();
|
40 |
+
}
|
41 |
+
};
|
42 |
+
|
43 |
+
tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
|
addons/emotions/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/emotions/langs/en_dlg.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.emotions_dlg',{
|
2 |
+
Ahhhh:"Ahhhh",
|
3 |
+
amazing:"Amazing",
|
4 |
+
big_smile:"Big Smile",
|
5 |
+
cry1:"Cry",
|
6 |
+
electric_shock:"Electric Shock",
|
7 |
+
exciting:"Exciting",
|
8 |
+
eyes_dropped:"Eyes Dropped",
|
9 |
+
girl:"Girl",
|
10 |
+
grimace:"Grimace",
|
11 |
+
haha:"Ha Ha",
|
12 |
+
scorn:"Scorn",
|
13 |
+
secret_smile:"Secret Smile",
|
14 |
+
shame:"Shame",
|
15 |
+
shocked:"Shocked",
|
16 |
+
unhappy:"Unhappy",
|
17 |
+
victory:"Victory",
|
18 |
+
what:"What",
|
19 |
+
Alien:"Alien",
|
20 |
+
Blush:"Blush",
|
21 |
+
Crying:"Crying",
|
22 |
+
Cool1:"Cool",
|
23 |
+
Devil:"Devil",
|
24 |
+
Happy:"Happy",
|
25 |
+
Huh:"Huh",
|
26 |
+
Love:"Love",
|
27 |
+
Sick:"Sick",
|
28 |
+
Sleep:"Sleep",
|
29 |
+
Smile1:"Smile1",
|
30 |
+
Tear:"Tear",
|
31 |
+
Tounge:"Tounge",
|
32 |
+
cry:"Cry",
|
33 |
+
cool:"Cool",
|
34 |
+
desc:"Emotions",
|
35 |
+
title:"Josh's Custom Emotions Menu:",
|
36 |
+
usage:"Choose Wisely...",
|
37 |
+
yell:"Yell",
|
38 |
+
wink:"Wink",
|
39 |
+
Wink1:"Wink",
|
40 |
+
Yikes:"Yikes",
|
41 |
+
undecided:"Undecided",
|
42 |
+
tongue_out:"Tongue Out",
|
43 |
+
surprised:"Surprised",
|
44 |
+
smile:"Smile",
|
45 |
+
sealed:"Sealed",
|
46 |
+
money_mouth:"Money Mouth",
|
47 |
+
laughing:"Laughing",
|
48 |
+
kiss:"Kiss",
|
49 |
+
innocent:"Innocent",
|
50 |
+
frown:"Frown",
|
51 |
+
foot_in_mouth:"Foot in Mouth",
|
52 |
+
embarassed:"Embarassed",
|
53 |
+
popoadore:"Adore",
|
54 |
+
popoah:"Ahh!",
|
55 |
+
popoangry:"Angry",
|
56 |
+
popobaffle:"Baffle",
|
57 |
+
popobeat_ball:"Hit with Ball",
|
58 |
+
popobeat_brick:"Hit with Brick",
|
59 |
+
popobig_smile:"Big Smile",
|
60 |
+
popoboss:"Big Boss",
|
61 |
+
popoburn_joss_stick:"Pray",
|
62 |
+
popocanny:"Canny",
|
63 |
+
popofurious:"Furious",
|
64 |
+
popoconfident:"Confident",
|
65 |
+
popoconfuse:"Confused",
|
66 |
+
popocry:"Crying",
|
67 |
+
popodoubt:"Doubt it!",
|
68 |
+
popodribble:"Dribble",
|
69 |
+
popoembarrassed:"Embarrassed",
|
70 |
+
popofeel_good:"Feeling Good",
|
71 |
+
popohaha:"Ha Ha",
|
72 |
+
popohell_boy:"Hell Boy",
|
73 |
+
popolook_down:"Yeah... Sure",
|
74 |
+
popomatrix:"Matrix",
|
75 |
+
popomisdoubt:"Oh Really?",
|
76 |
+
popooh:"Ugh!",
|
77 |
+
popoops:"Oops",
|
78 |
+
poposad:"Sad",
|
79 |
+
popostill_dreaming:"Still Dreaming",
|
80 |
+
poposurrender:"I Surrender!",
|
81 |
+
poposweet_kiss:"Sweet Kiss",
|
82 |
+
popotired:"So Tired",
|
83 |
+
popotoo_sad:"Too Sad",
|
84 |
+
popowhat:"What?!"
|
85 |
+
});
|
addons/encode/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186903240917634" remote="130186867200000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186903072887160" remote="130186866600000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/encode/editor_plugin.js
ADDED
@@ -0,0 +1,1062 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/*! Gibberish-AES
|
13 |
+
* A lightweight Javascript Libray for OpenSSL compatible AES CBC encryption.
|
14 |
+
*
|
15 |
+
* Author: Mark Percival
|
16 |
+
* Email: mark@mpercival.com
|
17 |
+
* Copyright: Mark Percival - http://mpercival.com 2008
|
18 |
+
*
|
19 |
+
* With thanks to:
|
20 |
+
* Josh Davis - http://www.josh-davis.org/ecmaScrypt
|
21 |
+
* Chris Veness - http://www.movable-type.co.uk/scripts/aes.html
|
22 |
+
* Michel I. Gallant - http://www.jensign.com/
|
23 |
+
*
|
24 |
+
* License: MIT
|
25 |
+
*
|
26 |
+
* Usage: GibberishAES.enc("secret", "password")
|
27 |
+
* Outputs: AES Encrypted text encoded in Base64
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
var GibberishAES = (function(){
|
32 |
+
var Nr = 14,
|
33 |
+
/* Default to 256 Bit Encryption */
|
34 |
+
Nk = 8,
|
35 |
+
Decrypt = false,
|
36 |
+
|
37 |
+
enc_utf8 = function(s)
|
38 |
+
{
|
39 |
+
try {
|
40 |
+
return unescape(encodeURIComponent(s));
|
41 |
+
}
|
42 |
+
catch(e) {
|
43 |
+
throw 'Error on UTF-8 encode';
|
44 |
+
}
|
45 |
+
},
|
46 |
+
|
47 |
+
dec_utf8 = function(s)
|
48 |
+
{
|
49 |
+
try {
|
50 |
+
return decodeURIComponent(escape(s));
|
51 |
+
}
|
52 |
+
catch(e) {
|
53 |
+
throw ('Bad Key');
|
54 |
+
}
|
55 |
+
},
|
56 |
+
|
57 |
+
padBlock = function(byteArr)
|
58 |
+
{
|
59 |
+
var array = [], cpad, i;
|
60 |
+
if (byteArr.length < 16) {
|
61 |
+
cpad = 16 - byteArr.length;
|
62 |
+
array = [cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad];
|
63 |
+
}
|
64 |
+
for (i = 0; i < byteArr.length; i++)
|
65 |
+
{
|
66 |
+
array[i] = byteArr[i];
|
67 |
+
}
|
68 |
+
return array;
|
69 |
+
},
|
70 |
+
|
71 |
+
block2s = function(block, lastBlock)
|
72 |
+
{
|
73 |
+
var string = '', padding, i;
|
74 |
+
if (lastBlock) {
|
75 |
+
padding = block[15];
|
76 |
+
if (padding > 16) {
|
77 |
+
throw ('Decryption error: Maybe bad key');
|
78 |
+
}
|
79 |
+
if (padding == 16) {
|
80 |
+
return '';
|
81 |
+
}
|
82 |
+
for (i = 0; i < 16 - padding; i++) {
|
83 |
+
string += String.fromCharCode(block[i]);
|
84 |
+
}
|
85 |
+
} else {
|
86 |
+
for (i = 0; i < 16; i++) {
|
87 |
+
string += String.fromCharCode(block[i]);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return string;
|
91 |
+
},
|
92 |
+
|
93 |
+
a2h = function(numArr)
|
94 |
+
{
|
95 |
+
var string = '', i;
|
96 |
+
for (i = 0; i < numArr.length; i++) {
|
97 |
+
string += (numArr[i] < 16 ? '0': '') + numArr[i].toString(16);
|
98 |
+
}
|
99 |
+
return string;
|
100 |
+
},
|
101 |
+
|
102 |
+
h2a = function(s)
|
103 |
+
{
|
104 |
+
var ret = [];
|
105 |
+
s.replace(/(..)/g,
|
106 |
+
function(s) {
|
107 |
+
ret.push(parseInt(s, 16));
|
108 |
+
});
|
109 |
+
return ret;
|
110 |
+
},
|
111 |
+
|
112 |
+
s2a = function(string) {
|
113 |
+
string = enc_utf8(string);
|
114 |
+
var array = [], i;
|
115 |
+
for (i = 0; i < string.length; i++)
|
116 |
+
{
|
117 |
+
array[i] = string.charCodeAt(i);
|
118 |
+
}
|
119 |
+
return array;
|
120 |
+
},
|
121 |
+
|
122 |
+
size = function(newsize)
|
123 |
+
{
|
124 |
+
switch (newsize)
|
125 |
+
{
|
126 |
+
case 128:
|
127 |
+
Nr = 10;
|
128 |
+
Nk = 4;
|
129 |
+
break;
|
130 |
+
case 192:
|
131 |
+
Nr = 12;
|
132 |
+
Nk = 6;
|
133 |
+
break;
|
134 |
+
case 256:
|
135 |
+
Nr = 14;
|
136 |
+
Nk = 8;
|
137 |
+
break;
|
138 |
+
default:
|
139 |
+
throw ('Invalid Key Size Specified:' + newsize);
|
140 |
+
}
|
141 |
+
},
|
142 |
+
|
143 |
+
randArr = function(num) {
|
144 |
+
var result = [], i;
|
145 |
+
for (i = 0; i < num; i++) {
|
146 |
+
result = result.concat(Math.floor(Math.random() * 256));
|
147 |
+
}
|
148 |
+
return result;
|
149 |
+
},
|
150 |
+
|
151 |
+
openSSLKey = function(passwordArr, saltArr) {
|
152 |
+
// Number of rounds depends on the size of the AES in use
|
153 |
+
// 3 rounds for 256
|
154 |
+
// 2 rounds for the key, 1 for the IV
|
155 |
+
// 2 rounds for 128
|
156 |
+
// 1 round for the key, 1 round for the IV
|
157 |
+
// 3 rounds for 192 since it's not evenly divided by 128 bits
|
158 |
+
var rounds = Nr >= 12 ? 3: 2,
|
159 |
+
key = [],
|
160 |
+
iv = [],
|
161 |
+
md5_hash = [],
|
162 |
+
result = [],
|
163 |
+
data00 = passwordArr.concat(saltArr),
|
164 |
+
i;
|
165 |
+
md5_hash[0] = GibberishAES.Hash.MD5(data00);
|
166 |
+
result = md5_hash[0];
|
167 |
+
for (i = 1; i < rounds; i++) {
|
168 |
+
md5_hash[i] = GibberishAES.Hash.MD5(md5_hash[i - 1].concat(data00));
|
169 |
+
result = result.concat(md5_hash[i]);
|
170 |
+
}
|
171 |
+
key = result.slice(0, 4 * Nk);
|
172 |
+
iv = result.slice(4 * Nk, 4 * Nk + 16);
|
173 |
+
return {
|
174 |
+
key: key,
|
175 |
+
iv: iv
|
176 |
+
};
|
177 |
+
},
|
178 |
+
|
179 |
+
rawEncrypt = function(plaintext, key, iv) {
|
180 |
+
// plaintext, key and iv as byte arrays
|
181 |
+
key = expandKey(key);
|
182 |
+
var numBlocks = Math.ceil(plaintext.length / 16),
|
183 |
+
blocks = [],
|
184 |
+
i,
|
185 |
+
cipherBlocks = [];
|
186 |
+
for (i = 0; i < numBlocks; i++) {
|
187 |
+
blocks[i] = padBlock(plaintext.slice(i * 16, i * 16 + 16));
|
188 |
+
}
|
189 |
+
if (plaintext.length % 16 === 0) {
|
190 |
+
blocks.push([16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]);
|
191 |
+
// CBC OpenSSL padding scheme
|
192 |
+
numBlocks++;
|
193 |
+
}
|
194 |
+
for (i = 0; i < blocks.length; i++) {
|
195 |
+
blocks[i] = (i === 0) ? xorBlocks(blocks[i], iv) : xorBlocks(blocks[i], cipherBlocks[i - 1]);
|
196 |
+
cipherBlocks[i] = encryptBlock(blocks[i], key);
|
197 |
+
}
|
198 |
+
return cipherBlocks;
|
199 |
+
},
|
200 |
+
|
201 |
+
rawDecrypt = function(cryptArr, key, iv, binary) {
|
202 |
+
// cryptArr, key and iv as byte arrays
|
203 |
+
key = expandKey(key);
|
204 |
+
var numBlocks = cryptArr.length / 16,
|
205 |
+
cipherBlocks = [],
|
206 |
+
i,
|
207 |
+
plainBlocks = [],
|
208 |
+
string = '';
|
209 |
+
for (i = 0; i < numBlocks; i++) {
|
210 |
+
cipherBlocks.push(cryptArr.slice(i * 16, (i + 1) * 16));
|
211 |
+
}
|
212 |
+
for (i = cipherBlocks.length - 1; i >= 0; i--) {
|
213 |
+
plainBlocks[i] = decryptBlock(cipherBlocks[i], key);
|
214 |
+
plainBlocks[i] = (i === 0) ? xorBlocks(plainBlocks[i], iv) : xorBlocks(plainBlocks[i], cipherBlocks[i - 1]);
|
215 |
+
}
|
216 |
+
for (i = 0; i < numBlocks - 1; i++) {
|
217 |
+
string += block2s(plainBlocks[i]);
|
218 |
+
}
|
219 |
+
string += block2s(plainBlocks[i], true);
|
220 |
+
return binary ? string : dec_utf8(string);
|
221 |
+
},
|
222 |
+
|
223 |
+
encryptBlock = function(block, words) {
|
224 |
+
Decrypt = false;
|
225 |
+
var state = addRoundKey(block, words, 0),
|
226 |
+
round;
|
227 |
+
for (round = 1; round < (Nr + 1); round++) {
|
228 |
+
state = subBytes(state);
|
229 |
+
state = shiftRows(state);
|
230 |
+
if (round < Nr) {
|
231 |
+
state = mixColumns(state);
|
232 |
+
}
|
233 |
+
//last round? don't mixColumns
|
234 |
+
state = addRoundKey(state, words, round);
|
235 |
+
}
|
236 |
+
|
237 |
+
return state;
|
238 |
+
},
|
239 |
+
|
240 |
+
decryptBlock = function(block, words) {
|
241 |
+
Decrypt = true;
|
242 |
+
var state = addRoundKey(block, words, Nr),
|
243 |
+
round;
|
244 |
+
for (round = Nr - 1; round > -1; round--) {
|
245 |
+
state = shiftRows(state);
|
246 |
+
state = subBytes(state);
|
247 |
+
state = addRoundKey(state, words, round);
|
248 |
+
if (round > 0) {
|
249 |
+
state = mixColumns(state);
|
250 |
+
}
|
251 |
+
//last round? don't mixColumns
|
252 |
+
}
|
253 |
+
|
254 |
+
return state;
|
255 |
+
},
|
256 |
+
|
257 |
+
subBytes = function(state) {
|
258 |
+
var S = Decrypt ? SBoxInv: SBox,
|
259 |
+
temp = [],
|
260 |
+
i;
|
261 |
+
for (i = 0; i < 16; i++) {
|
262 |
+
temp[i] = S[state[i]];
|
263 |
+
}
|
264 |
+
return temp;
|
265 |
+
},
|
266 |
+
|
267 |
+
shiftRows = function(state) {
|
268 |
+
var temp = [],
|
269 |
+
shiftBy = Decrypt ? [0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3] : [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11],
|
270 |
+
i;
|
271 |
+
for (i = 0; i < 16; i++) {
|
272 |
+
temp[i] = state[shiftBy[i]];
|
273 |
+
}
|
274 |
+
return temp;
|
275 |
+
},
|
276 |
+
|
277 |
+
mixColumns = function(state) {
|
278 |
+
var t = [],
|
279 |
+
c;
|
280 |
+
if (!Decrypt) {
|
281 |
+
for (c = 0; c < 4; c++) {
|
282 |
+
t[c * 4] = G2X[state[c * 4]] ^ G3X[state[1 + c * 4]] ^ state[2 + c * 4] ^ state[3 + c * 4];
|
283 |
+
t[1 + c * 4] = state[c * 4] ^ G2X[state[1 + c * 4]] ^ G3X[state[2 + c * 4]] ^ state[3 + c * 4];
|
284 |
+
t[2 + c * 4] = state[c * 4] ^ state[1 + c * 4] ^ G2X[state[2 + c * 4]] ^ G3X[state[3 + c * 4]];
|
285 |
+
t[3 + c * 4] = G3X[state[c * 4]] ^ state[1 + c * 4] ^ state[2 + c * 4] ^ G2X[state[3 + c * 4]];
|
286 |
+
}
|
287 |
+
}else {
|
288 |
+
for (c = 0; c < 4; c++) {
|
289 |
+
t[c*4] = GEX[state[c*4]] ^ GBX[state[1+c*4]] ^ GDX[state[2+c*4]] ^ G9X[state[3+c*4]];
|
290 |
+
t[1+c*4] = G9X[state[c*4]] ^ GEX[state[1+c*4]] ^ GBX[state[2+c*4]] ^ GDX[state[3+c*4]];
|
291 |
+
t[2+c*4] = GDX[state[c*4]] ^ G9X[state[1+c*4]] ^ GEX[state[2+c*4]] ^ GBX[state[3+c*4]];
|
292 |
+
t[3+c*4] = GBX[state[c*4]] ^ GDX[state[1+c*4]] ^ G9X[state[2+c*4]] ^ GEX[state[3+c*4]];
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
return t;
|
297 |
+
},
|
298 |
+
|
299 |
+
addRoundKey = function(state, words, round) {
|
300 |
+
var temp = [],
|
301 |
+
i;
|
302 |
+
for (i = 0; i < 16; i++) {
|
303 |
+
temp[i] = state[i] ^ words[round][i];
|
304 |
+
}
|
305 |
+
return temp;
|
306 |
+
},
|
307 |
+
|
308 |
+
xorBlocks = function(block1, block2) {
|
309 |
+
var temp = [],
|
310 |
+
i;
|
311 |
+
for (i = 0; i < 16; i++) {
|
312 |
+
temp[i] = block1[i] ^ block2[i];
|
313 |
+
}
|
314 |
+
return temp;
|
315 |
+
},
|
316 |
+
|
317 |
+
expandKey = function(key) {
|
318 |
+
// Expects a 1d number array
|
319 |
+
var w = [],
|
320 |
+
temp = [],
|
321 |
+
i,
|
322 |
+
r,
|
323 |
+
t,
|
324 |
+
flat = [],
|
325 |
+
j;
|
326 |
+
|
327 |
+
for (i = 0; i < Nk; i++) {
|
328 |
+
r = [key[4 * i], key[4 * i + 1], key[4 * i + 2], key[4 * i + 3]];
|
329 |
+
w[i] = r;
|
330 |
+
}
|
331 |
+
|
332 |
+
for (i = Nk; i < (4 * (Nr + 1)); i++) {
|
333 |
+
w[i] = [];
|
334 |
+
for (t = 0; t < 4; t++) {
|
335 |
+
temp[t] = w[i - 1][t];
|
336 |
+
}
|
337 |
+
if (i % Nk === 0) {
|
338 |
+
temp = subWord(rotWord(temp));
|
339 |
+
temp[0] ^= Rcon[i / Nk - 1];
|
340 |
+
} else if (Nk > 6 && i % Nk == 4) {
|
341 |
+
temp = subWord(temp);
|
342 |
+
}
|
343 |
+
for (t = 0; t < 4; t++) {
|
344 |
+
w[i][t] = w[i - Nk][t] ^ temp[t];
|
345 |
+
}
|
346 |
+
}
|
347 |
+
for (i = 0; i < (Nr + 1); i++) {
|
348 |
+
flat[i] = [];
|
349 |
+
for (j = 0; j < 4; j++) {
|
350 |
+
flat[i].push(w[i * 4 + j][0], w[i * 4 + j][1], w[i * 4 + j][2], w[i * 4 + j][3]);
|
351 |
+
}
|
352 |
+
}
|
353 |
+
return flat;
|
354 |
+
},
|
355 |
+
|
356 |
+
subWord = function(w) {
|
357 |
+
// apply SBox to 4-byte word w
|
358 |
+
for (var i = 0; i < 4; i++) {
|
359 |
+
w[i] = SBox[w[i]];
|
360 |
+
}
|
361 |
+
return w;
|
362 |
+
},
|
363 |
+
|
364 |
+
rotWord = function(w) {
|
365 |
+
// rotate 4-byte word w left by one byte
|
366 |
+
var tmp = w[0],
|
367 |
+
i;
|
368 |
+
for (i = 0; i < 4; i++) {
|
369 |
+
w[i] = w[i + 1];
|
370 |
+
}
|
371 |
+
w[3] = tmp;
|
372 |
+
return w;
|
373 |
+
},
|
374 |
+
|
375 |
+
|
376 |
+
// S-box
|
377 |
+
SBox = [
|
378 |
+
99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171,
|
379 |
+
118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164,
|
380 |
+
114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113,
|
381 |
+
216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226,
|
382 |
+
235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214,
|
383 |
+
179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203,
|
384 |
+
190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69,
|
385 |
+
249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245,
|
386 |
+
188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68,
|
387 |
+
23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42,
|
388 |
+
144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73,
|
389 |
+
6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109,
|
390 |
+
141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37,
|
391 |
+
46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62,
|
392 |
+
181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225,
|
393 |
+
248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
|
394 |
+
140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187,
|
395 |
+
22],
|
396 |
+
|
397 |
+
// Precomputed lookup table for the inverse SBox
|
398 |
+
SBoxInv = [
|
399 |
+
82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215,
|
400 |
+
251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222,
|
401 |
+
233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66,
|
402 |
+
250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73,
|
403 |
+
109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92,
|
404 |
+
204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21,
|
405 |
+
70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247,
|
406 |
+
228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2,
|
407 |
+
193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220,
|
408 |
+
234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173,
|
409 |
+
53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29,
|
410 |
+
41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75,
|
411 |
+
198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168,
|
412 |
+
51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81,
|
413 |
+
127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160,
|
414 |
+
224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
|
415 |
+
23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12,
|
416 |
+
125],
|
417 |
+
// Rijndael Rcon
|
418 |
+
Rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94,
|
419 |
+
188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
|
420 |
+
|
421 |
+
G2X = [
|
422 |
+
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16,
|
423 |
+
0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
|
424 |
+
0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46,
|
425 |
+
0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
|
426 |
+
0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76,
|
427 |
+
0x78, 0x7a, 0x7c, 0x7e, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e,
|
428 |
+
0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6,
|
429 |
+
0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe,
|
430 |
+
0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6,
|
431 |
+
0xd8, 0xda, 0xdc, 0xde, 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee,
|
432 |
+
0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, 0x1b, 0x19, 0x1f, 0x1d,
|
433 |
+
0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05,
|
434 |
+
0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d,
|
435 |
+
0x23, 0x21, 0x27, 0x25, 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55,
|
436 |
+
0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45, 0x7b, 0x79, 0x7f, 0x7d,
|
437 |
+
0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65,
|
438 |
+
0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d,
|
439 |
+
0x83, 0x81, 0x87, 0x85, 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5,
|
440 |
+
0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5, 0xdb, 0xd9, 0xdf, 0xdd,
|
441 |
+
0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
|
442 |
+
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed,
|
443 |
+
0xe3, 0xe1, 0xe7, 0xe5
|
444 |
+
],
|
445 |
+
|
446 |
+
G3X = [
|
447 |
+
0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d,
|
448 |
+
0x14, 0x17, 0x12, 0x11, 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39,
|
449 |
+
|
450 |
+
0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, 0x60, 0x63, 0x66, 0x65,
|
451 |
+
0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,
|
452 |
+
0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d,
|
453 |
+
0x44, 0x47, 0x42, 0x41, 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9,
|
454 |
+
0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1, 0xf0, 0xf3, 0xf6, 0xf5,
|
455 |
+
0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1,
|
456 |
+
0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd,
|
457 |
+
0xb4, 0xb7, 0xb2, 0xb1, 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99,
|
458 |
+
0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81, 0x9b, 0x98, 0x9d, 0x9e,
|
459 |
+
0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a,
|
460 |
+
0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6,
|
461 |
+
0xbf, 0xbc, 0xb9, 0xba, 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2,
|
462 |
+
0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea, 0xcb, 0xc8, 0xcd, 0xce,
|
463 |
+
0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda,
|
464 |
+
0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46,
|
465 |
+
0x4f, 0x4c, 0x49, 0x4a, 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62,
|
466 |
+
0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a, 0x3b, 0x38, 0x3d, 0x3e,
|
467 |
+
0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,
|
468 |
+
0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16,
|
469 |
+
0x1f, 0x1c, 0x19, 0x1a
|
470 |
+
],
|
471 |
+
|
472 |
+
G9X = [
|
473 |
+
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53,
|
474 |
+
0x6c, 0x65, 0x7e, 0x77, 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf,
|
475 |
+
0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7, 0x3b, 0x32, 0x29, 0x20,
|
476 |
+
0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c,
|
477 |
+
0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8,
|
478 |
+
0xc7, 0xce, 0xd5, 0xdc, 0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49,
|
479 |
+
0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01, 0xe6, 0xef, 0xf4, 0xfd,
|
480 |
+
0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91,
|
481 |
+
0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e,
|
482 |
+
0x21, 0x28, 0x33, 0x3a, 0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2,
|
483 |
+
0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa, 0xec, 0xe5, 0xfe, 0xf7,
|
484 |
+
0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b,
|
485 |
+
0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f,
|
486 |
+
0x10, 0x19, 0x02, 0x0b, 0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8,
|
487 |
+
0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0, 0x47, 0x4e, 0x55, 0x5c,
|
488 |
+
0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30,
|
489 |
+
0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9,
|
490 |
+
0xf6, 0xff, 0xe4, 0xed, 0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35,
|
491 |
+
0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d, 0xa1, 0xa8, 0xb3, 0xba,
|
492 |
+
0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6,
|
493 |
+
0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62,
|
494 |
+
0x5d, 0x54, 0x4f, 0x46
|
495 |
+
],
|
496 |
+
|
497 |
+
GBX = [
|
498 |
+
0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45,
|
499 |
+
0x74, 0x7f, 0x62, 0x69, 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81,
|
500 |
+
0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9, 0x7b, 0x70, 0x6d, 0x66,
|
501 |
+
0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12,
|
502 |
+
0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e,
|
503 |
+
0xbf, 0xb4, 0xa9, 0xa2, 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7,
|
504 |
+
0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f, 0x46, 0x4d, 0x50, 0x5b,
|
505 |
+
0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f,
|
506 |
+
0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8,
|
507 |
+
0xf9, 0xf2, 0xef, 0xe4, 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c,
|
508 |
+
0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54, 0xf7, 0xfc, 0xe1, 0xea,
|
509 |
+
0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e,
|
510 |
+
0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02,
|
511 |
+
0x33, 0x38, 0x25, 0x2e, 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd,
|
512 |
+
0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5, 0x3c, 0x37, 0x2a, 0x21,
|
513 |
+
0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55,
|
514 |
+
0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44,
|
515 |
+
0x75, 0x7e, 0x63, 0x68, 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80,
|
516 |
+
0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8, 0x7a, 0x71, 0x6c, 0x67,
|
517 |
+
0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13,
|
518 |
+
0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f,
|
519 |
+
0xbe, 0xb5, 0xa8, 0xa3
|
520 |
+
],
|
521 |
+
|
522 |
+
GDX = [
|
523 |
+
0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f,
|
524 |
+
0x5c, 0x51, 0x46, 0x4b, 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3,
|
525 |
+
0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b, 0xbb, 0xb6, 0xa1, 0xac,
|
526 |
+
0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0,
|
527 |
+
0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14,
|
528 |
+
0x37, 0x3a, 0x2d, 0x20, 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e,
|
529 |
+
0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26, 0xbd, 0xb0, 0xa7, 0xaa,
|
530 |
+
0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6,
|
531 |
+
0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9,
|
532 |
+
0x8a, 0x87, 0x90, 0x9d, 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25,
|
533 |
+
0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d, 0xda, 0xd7, 0xc0, 0xcd,
|
534 |
+
0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91,
|
535 |
+
0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75,
|
536 |
+
0x56, 0x5b, 0x4c, 0x41, 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42,
|
537 |
+
0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a, 0xb1, 0xbc, 0xab, 0xa6,
|
538 |
+
0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa,
|
539 |
+
0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8,
|
540 |
+
0xeb, 0xe6, 0xf1, 0xfc, 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44,
|
541 |
+
0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c, 0x0c, 0x01, 0x16, 0x1b,
|
542 |
+
0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47,
|
543 |
+
0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3,
|
544 |
+
0x80, 0x8d, 0x9a, 0x97
|
545 |
+
],
|
546 |
+
|
547 |
+
GEX = [
|
548 |
+
0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62,
|
549 |
+
0x48, 0x46, 0x54, 0x5a, 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca,
|
550 |
+
0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba, 0xdb, 0xd5, 0xc7, 0xc9,
|
551 |
+
0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81,
|
552 |
+
0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59,
|
553 |
+
0x73, 0x7d, 0x6f, 0x61, 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87,
|
554 |
+
0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7, 0x4d, 0x43, 0x51, 0x5f,
|
555 |
+
0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17,
|
556 |
+
0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14,
|
557 |
+
0x3e, 0x30, 0x22, 0x2c, 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc,
|
558 |
+
0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc, 0x41, 0x4f, 0x5d, 0x53,
|
559 |
+
0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b,
|
560 |
+
0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3,
|
561 |
+
0xe9, 0xe7, 0xf5, 0xfb, 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0,
|
562 |
+
0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0, 0x7a, 0x74, 0x66, 0x68,
|
563 |
+
0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20,
|
564 |
+
0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e,
|
565 |
+
0xa4, 0xaa, 0xb8, 0xb6, 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26,
|
566 |
+
0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56, 0x37, 0x39, 0x2b, 0x25,
|
567 |
+
0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d,
|
568 |
+
0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5,
|
569 |
+
0x9f, 0x91, 0x83, 0x8d
|
570 |
+
],
|
571 |
+
|
572 |
+
enc = function(string, pass, binary) {
|
573 |
+
// string, password in plaintext
|
574 |
+
var salt = randArr(8),
|
575 |
+
pbe = openSSLKey(s2a(pass), salt),
|
576 |
+
key = pbe.key,
|
577 |
+
iv = pbe.iv,
|
578 |
+
cipherBlocks,
|
579 |
+
saltBlock = [[83, 97, 108, 116, 101, 100, 95, 95].concat(salt)];
|
580 |
+
if (!binary) {
|
581 |
+
string = s2a(string);
|
582 |
+
}
|
583 |
+
cipherBlocks = rawEncrypt(string, key, iv);
|
584 |
+
// Spells out 'Salted__'
|
585 |
+
cipherBlocks = saltBlock.concat(cipherBlocks);
|
586 |
+
return Base64.encode(cipherBlocks);
|
587 |
+
},
|
588 |
+
|
589 |
+
dec = function(string, pass, binary) {
|
590 |
+
// string, password in plaintext
|
591 |
+
var cryptArr = Base64.decode(string),
|
592 |
+
salt = cryptArr.slice(8, 16),
|
593 |
+
pbe = openSSLKey(s2a(pass), salt),
|
594 |
+
key = pbe.key,
|
595 |
+
iv = pbe.iv;
|
596 |
+
cryptArr = cryptArr.slice(16, cryptArr.length);
|
597 |
+
// Take off the Salted__ffeeddcc
|
598 |
+
string = rawDecrypt(cryptArr, key, iv, binary);
|
599 |
+
return string;
|
600 |
+
},
|
601 |
+
|
602 |
+
MD5 = function(numArr) {
|
603 |
+
|
604 |
+
function rotateLeft(lValue, iShiftBits) {
|
605 |
+
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
606 |
+
}
|
607 |
+
|
608 |
+
function addUnsigned(lX, lY) {
|
609 |
+
var lX4,
|
610 |
+
lY4,
|
611 |
+
lX8,
|
612 |
+
lY8,
|
613 |
+
lResult;
|
614 |
+
lX8 = (lX & 0x80000000);
|
615 |
+
lY8 = (lY & 0x80000000);
|
616 |
+
lX4 = (lX & 0x40000000);
|
617 |
+
lY4 = (lY & 0x40000000);
|
618 |
+
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
|
619 |
+
if (lX4 & lY4) {
|
620 |
+
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
|
621 |
+
}
|
622 |
+
if (lX4 | lY4) {
|
623 |
+
if (lResult & 0x40000000) {
|
624 |
+
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
|
625 |
+
} else {
|
626 |
+
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
|
627 |
+
}
|
628 |
+
} else {
|
629 |
+
return (lResult ^ lX8 ^ lY8);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
function f(x, y, z) {
|
634 |
+
return (x & y) | ((~x) & z);
|
635 |
+
}
|
636 |
+
function g(x, y, z) {
|
637 |
+
return (x & z) | (y & (~z));
|
638 |
+
}
|
639 |
+
function h(x, y, z) {
|
640 |
+
return (x ^ y ^ z);
|
641 |
+
}
|
642 |
+
function funcI(x, y, z) {
|
643 |
+
return (y ^ (x | (~z)));
|
644 |
+
}
|
645 |
+
|
646 |
+
function ff(a, b, c, d, x, s, ac) {
|
647 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(f(b, c, d), x), ac));
|
648 |
+
return addUnsigned(rotateLeft(a, s), b);
|
649 |
+
}
|
650 |
+
|
651 |
+
function gg(a, b, c, d, x, s, ac) {
|
652 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(g(b, c, d), x), ac));
|
653 |
+
return addUnsigned(rotateLeft(a, s), b);
|
654 |
+
}
|
655 |
+
|
656 |
+
function hh(a, b, c, d, x, s, ac) {
|
657 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(h(b, c, d), x), ac));
|
658 |
+
return addUnsigned(rotateLeft(a, s), b);
|
659 |
+
}
|
660 |
+
|
661 |
+
function ii(a, b, c, d, x, s, ac) {
|
662 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(funcI(b, c, d), x), ac));
|
663 |
+
return addUnsigned(rotateLeft(a, s), b);
|
664 |
+
}
|
665 |
+
|
666 |
+
function convertToWordArray(numArr) {
|
667 |
+
var lWordCount,
|
668 |
+
lMessageLength = numArr.length,
|
669 |
+
lNumberOfWords_temp1 = lMessageLength + 8,
|
670 |
+
lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64,
|
671 |
+
lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16,
|
672 |
+
lWordArray = [],
|
673 |
+
lBytePosition = 0,
|
674 |
+
lByteCount = 0;
|
675 |
+
while (lByteCount < lMessageLength) {
|
676 |
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
677 |
+
lBytePosition = (lByteCount % 4) * 8;
|
678 |
+
lWordArray[lWordCount] = (lWordArray[lWordCount] | (numArr[lByteCount] << lBytePosition));
|
679 |
+
lByteCount++;
|
680 |
+
}
|
681 |
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
682 |
+
lBytePosition = (lByteCount % 4) * 8;
|
683 |
+
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
684 |
+
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
685 |
+
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
686 |
+
return lWordArray;
|
687 |
+
}
|
688 |
+
|
689 |
+
function wordToHex(lValue) {
|
690 |
+
var lByte,
|
691 |
+
lCount,
|
692 |
+
wordToHexArr = [];
|
693 |
+
for (lCount = 0; lCount <= 3; lCount++) {
|
694 |
+
lByte = (lValue >>> (lCount * 8)) & 255;
|
695 |
+
wordToHexArr = wordToHexArr.concat(lByte);
|
696 |
+
}
|
697 |
+
return wordToHexArr;
|
698 |
+
}
|
699 |
+
|
700 |
+
/*function utf8Encode(string) {
|
701 |
+
string = string.replace(/\r\n/g, "\n");
|
702 |
+
var utftext = "",
|
703 |
+
n,
|
704 |
+
c;
|
705 |
+
|
706 |
+
for (n = 0; n < string.length; n++) {
|
707 |
+
|
708 |
+
c = string.charCodeAt(n);
|
709 |
+
|
710 |
+
if (c < 128) {
|
711 |
+
utftext += String.fromCharCode(c);
|
712 |
+
}
|
713 |
+
else if ((c > 127) && (c < 2048)) {
|
714 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
715 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
716 |
+
}
|
717 |
+
else {
|
718 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
719 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
720 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
721 |
+
}
|
722 |
+
|
723 |
+
}
|
724 |
+
|
725 |
+
return utftext;
|
726 |
+
}*/
|
727 |
+
|
728 |
+
var x = [],
|
729 |
+
k,
|
730 |
+
AA,
|
731 |
+
BB,
|
732 |
+
CC,
|
733 |
+
DD,
|
734 |
+
a,
|
735 |
+
b,
|
736 |
+
c,
|
737 |
+
d,
|
738 |
+
S11 = 7,
|
739 |
+
S12 = 12,
|
740 |
+
S13 = 17,
|
741 |
+
S14 = 22,
|
742 |
+
S21 = 5,
|
743 |
+
S22 = 9,
|
744 |
+
S23 = 14,
|
745 |
+
S24 = 20,
|
746 |
+
S31 = 4,
|
747 |
+
S32 = 11,
|
748 |
+
S33 = 16,
|
749 |
+
S34 = 23,
|
750 |
+
S41 = 6,
|
751 |
+
S42 = 10,
|
752 |
+
S43 = 15,
|
753 |
+
S44 = 21;
|
754 |
+
|
755 |
+
x = convertToWordArray(numArr);
|
756 |
+
|
757 |
+
a = 0x67452301;
|
758 |
+
b = 0xEFCDAB89;
|
759 |
+
c = 0x98BADCFE;
|
760 |
+
d = 0x10325476;
|
761 |
+
|
762 |
+
for (k = 0; k < x.length; k += 16) {
|
763 |
+
AA = a;
|
764 |
+
BB = b;
|
765 |
+
CC = c;
|
766 |
+
DD = d;
|
767 |
+
a = ff(a, b, c, d, x[k + 0], S11, 0xD76AA478);
|
768 |
+
d = ff(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
|
769 |
+
c = ff(c, d, a, b, x[k + 2], S13, 0x242070DB);
|
770 |
+
b = ff(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
|
771 |
+
a = ff(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
|
772 |
+
d = ff(d, a, b, c, x[k + 5], S12, 0x4787C62A);
|
773 |
+
c = ff(c, d, a, b, x[k + 6], S13, 0xA8304613);
|
774 |
+
b = ff(b, c, d, a, x[k + 7], S14, 0xFD469501);
|
775 |
+
a = ff(a, b, c, d, x[k + 8], S11, 0x698098D8);
|
776 |
+
d = ff(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
|
777 |
+
c = ff(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
|
778 |
+
b = ff(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
|
779 |
+
a = ff(a, b, c, d, x[k + 12], S11, 0x6B901122);
|
780 |
+
d = ff(d, a, b, c, x[k + 13], S12, 0xFD987193);
|
781 |
+
c = ff(c, d, a, b, x[k + 14], S13, 0xA679438E);
|
782 |
+
b = ff(b, c, d, a, x[k + 15], S14, 0x49B40821);
|
783 |
+
a = gg(a, b, c, d, x[k + 1], S21, 0xF61E2562);
|
784 |
+
d = gg(d, a, b, c, x[k + 6], S22, 0xC040B340);
|
785 |
+
c = gg(c, d, a, b, x[k + 11], S23, 0x265E5A51);
|
786 |
+
b = gg(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
|
787 |
+
a = gg(a, b, c, d, x[k + 5], S21, 0xD62F105D);
|
788 |
+
d = gg(d, a, b, c, x[k + 10], S22, 0x2441453);
|
789 |
+
c = gg(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
|
790 |
+
b = gg(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
|
791 |
+
a = gg(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
|
792 |
+
d = gg(d, a, b, c, x[k + 14], S22, 0xC33707D6);
|
793 |
+
c = gg(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
|
794 |
+
b = gg(b, c, d, a, x[k + 8], S24, 0x455A14ED);
|
795 |
+
a = gg(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
|
796 |
+
d = gg(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
|
797 |
+
c = gg(c, d, a, b, x[k + 7], S23, 0x676F02D9);
|
798 |
+
b = gg(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
|
799 |
+
a = hh(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
|
800 |
+
d = hh(d, a, b, c, x[k + 8], S32, 0x8771F681);
|
801 |
+
c = hh(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
|
802 |
+
b = hh(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
|
803 |
+
a = hh(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
|
804 |
+
d = hh(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
|
805 |
+
c = hh(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
|
806 |
+
b = hh(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
|
807 |
+
a = hh(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
|
808 |
+
d = hh(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
|
809 |
+
c = hh(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
|
810 |
+
b = hh(b, c, d, a, x[k + 6], S34, 0x4881D05);
|
811 |
+
a = hh(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
|
812 |
+
d = hh(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
|
813 |
+
c = hh(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
|
814 |
+
b = hh(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
|
815 |
+
a = ii(a, b, c, d, x[k + 0], S41, 0xF4292244);
|
816 |
+
d = ii(d, a, b, c, x[k + 7], S42, 0x432AFF97);
|
817 |
+
c = ii(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
|
818 |
+
b = ii(b, c, d, a, x[k + 5], S44, 0xFC93A039);
|
819 |
+
a = ii(a, b, c, d, x[k + 12], S41, 0x655B59C3);
|
820 |
+
d = ii(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
|
821 |
+
c = ii(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
|
822 |
+
b = ii(b, c, d, a, x[k + 1], S44, 0x85845DD1);
|
823 |
+
a = ii(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
|
824 |
+
d = ii(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
|
825 |
+
c = ii(c, d, a, b, x[k + 6], S43, 0xA3014314);
|
826 |
+
b = ii(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
|
827 |
+
a = ii(a, b, c, d, x[k + 4], S41, 0xF7537E82);
|
828 |
+
d = ii(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
|
829 |
+
c = ii(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
|
830 |
+
b = ii(b, c, d, a, x[k + 9], S44, 0xEB86D391);
|
831 |
+
a = addUnsigned(a, AA);
|
832 |
+
b = addUnsigned(b, BB);
|
833 |
+
c = addUnsigned(c, CC);
|
834 |
+
d = addUnsigned(d, DD);
|
835 |
+
}
|
836 |
+
|
837 |
+
return wordToHex(a).concat(wordToHex(b), wordToHex(c), wordToHex(d));
|
838 |
+
},
|
839 |
+
|
840 |
+
|
841 |
+
Base64 = (function(){
|
842 |
+
// Takes a Nx16x1 byte array and converts it to Base64
|
843 |
+
var _chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
844 |
+
chars = _chars.split(''),
|
845 |
+
|
846 |
+
encode = function(b, withBreaks) {
|
847 |
+
var flatArr = [],
|
848 |
+
b64 = '',
|
849 |
+
i,
|
850 |
+
broken_b64;
|
851 |
+
totalChunks = Math.floor(b.length * 16 / 3);
|
852 |
+
for (i = 0; i < b.length * 16; i++) {
|
853 |
+
flatArr.push(b[Math.floor(i / 16)][i % 16]);
|
854 |
+
}
|
855 |
+
for (i = 0; i < flatArr.length; i = i + 3) {
|
856 |
+
b64 += chars[flatArr[i] >> 2];
|
857 |
+
b64 += chars[((flatArr[i] & 3) << 4) | (flatArr[i + 1] >> 4)];
|
858 |
+
if (! (flatArr[i + 1] === undefined)) {
|
859 |
+
b64 += chars[((flatArr[i + 1] & 15) << 2) | (flatArr[i + 2] >> 6)];
|
860 |
+
} else {
|
861 |
+
b64 += '=';
|
862 |
+
}
|
863 |
+
if (! (flatArr[i + 2] === undefined)) {
|
864 |
+
b64 += chars[flatArr[i + 2] & 63];
|
865 |
+
} else {
|
866 |
+
b64 += '=';
|
867 |
+
}
|
868 |
+
}
|
869 |
+
// OpenSSL is super particular about line breaks
|
870 |
+
broken_b64 = b64.slice(0, 64) + '\n';
|
871 |
+
for (i = 1; i < (Math.ceil(b64.length / 64)); i++) {
|
872 |
+
broken_b64 += b64.slice(i * 64, i * 64 + 64) + (Math.ceil(b64.length / 64) == i + 1 ? '': '\n');
|
873 |
+
}
|
874 |
+
return broken_b64;
|
875 |
+
},
|
876 |
+
|
877 |
+
decode = function(string) {
|
878 |
+
string = string.replace(/\n/g, '');
|
879 |
+
var flatArr = [],
|
880 |
+
c = [],
|
881 |
+
b = [],
|
882 |
+
i;
|
883 |
+
for (i = 0; i < string.length; i = i + 4) {
|
884 |
+
c[0] = _chars.indexOf(string.charAt(i));
|
885 |
+
c[1] = _chars.indexOf(string.charAt(i + 1));
|
886 |
+
c[2] = _chars.indexOf(string.charAt(i + 2));
|
887 |
+
c[3] = _chars.indexOf(string.charAt(i + 3));
|
888 |
+
|
889 |
+
b[0] = (c[0] << 2) | (c[1] >> 4);
|
890 |
+
b[1] = ((c[1] & 15) << 4) | (c[2] >> 2);
|
891 |
+
b[2] = ((c[2] & 3) << 6) | c[3];
|
892 |
+
flatArr.push(b[0], b[1], b[2]);
|
893 |
+
}
|
894 |
+
flatArr = flatArr.slice(0, flatArr.length - (flatArr.length % 16));
|
895 |
+
return flatArr;
|
896 |
+
};
|
897 |
+
|
898 |
+
//internet explorer
|
899 |
+
if(typeof Array.indexOf === "function") {
|
900 |
+
_chars = chars;
|
901 |
+
}
|
902 |
+
|
903 |
+
/*
|
904 |
+
//other way to solve internet explorer problem
|
905 |
+
if(!Array.indexOf){
|
906 |
+
Array.prototype.indexOf = function(obj){
|
907 |
+
for(var i=0; i<this.length; i++){
|
908 |
+
if(this[i]===obj){
|
909 |
+
return i;
|
910 |
+
}
|
911 |
+
}
|
912 |
+
return -1;
|
913 |
+
}
|
914 |
+
}
|
915 |
+
*/
|
916 |
+
|
917 |
+
|
918 |
+
return {
|
919 |
+
"encode": encode,
|
920 |
+
"decode": decode
|
921 |
+
};
|
922 |
+
})();
|
923 |
+
|
924 |
+
return {
|
925 |
+
"size": size,
|
926 |
+
"h2a":h2a,
|
927 |
+
"expandKey":expandKey,
|
928 |
+
"encryptBlock":encryptBlock,
|
929 |
+
"decryptBlock":decryptBlock,
|
930 |
+
"Decrypt":Decrypt,
|
931 |
+
"s2a":s2a,
|
932 |
+
"rawEncrypt":rawEncrypt,
|
933 |
+
"dec":dec,
|
934 |
+
"openSSLKey":openSSLKey,
|
935 |
+
"a2h":a2h,
|
936 |
+
"enc":enc,
|
937 |
+
"Hash":{"MD5":MD5},
|
938 |
+
"Base64":Base64
|
939 |
+
};
|
940 |
+
|
941 |
+
})();
|
942 |
+
|
943 |
+
|
944 |
+
(function() {
|
945 |
+
// Load plugin specific language pack
|
946 |
+
//tinymce.PluginManager.requireLangPack('encode');
|
947 |
+
|
948 |
+
tinymce.create('tinymce.plugins.encodePlugin', {
|
949 |
+
/**
|
950 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
951 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
952 |
+
* of the editor instance to intercept that event.
|
953 |
+
*
|
954 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
955 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
956 |
+
*/
|
957 |
+
init : function(ed, url) {
|
958 |
+
|
959 |
+
|
960 |
+
|
961 |
+
|
962 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceencode');
|
963 |
+
ed.addCommand('mceencode', function() {
|
964 |
+
|
965 |
+
|
966 |
+
|
967 |
+
|
968 |
+
function Encrypt(theText) {
|
969 |
+
output = new String;
|
970 |
+
output = GibberishAES.enc(theText, "KFFB!e7Gac&*0(E!");
|
971 |
+
return output;
|
972 |
+
}
|
973 |
+
var getText = tinyMCE.activeEditor.getContent({format : 'raw'});
|
974 |
+
getText = getText.replace(/<\/pre>/g,"");
|
975 |
+
getText = getText.replace(/<pre>/g,"");
|
976 |
+
getText = '<pre>' + Encrypt(getText) + '</pre>';
|
977 |
+
|
978 |
+
tinyMCE.activeEditor.setContent(getText, {format : 'raw'});
|
979 |
+
|
980 |
+
|
981 |
+
});
|
982 |
+
|
983 |
+
ed.addCommand('mcedecode', function() {
|
984 |
+
|
985 |
+
|
986 |
+
function unEncrypt(theText) {
|
987 |
+
output = new String;
|
988 |
+
output = GibberishAES.dec(theText, "KFFB!e7Gac&*0(E!");
|
989 |
+
return output;
|
990 |
+
}
|
991 |
+
var getText = tinyMCE.activeEditor.getContent({format : 'raw'});
|
992 |
+
getText = getText.replace(/<p>/g,"");
|
993 |
+
getText = getText.replace(/<\/p>/g,"");
|
994 |
+
getText = getText.replace(/<\/pre>/g,"");
|
995 |
+
getText = getText.replace(/<pre>/g,"");
|
996 |
+
getText = getText.replace(/<br \/>/g,"");
|
997 |
+
getText = getText.replace(/<br>/g,"");
|
998 |
+
getText = unEncrypt(getText);
|
999 |
+
getText = '<pre>' + getText + '</pre>';
|
1000 |
+
tinyMCE.activeEditor.setContent(getText, {format : 'raw'});
|
1001 |
+
|
1002 |
+
|
1003 |
+
});
|
1004 |
+
|
1005 |
+
// Register encode button
|
1006 |
+
ed.addButton('encode', {
|
1007 |
+
/*title : 'Encrypt This Text',*/
|
1008 |
+
title : ed.getLang('encode.encode'),
|
1009 |
+
cmd : 'mceencode',
|
1010 |
+
//image : url + '/img/encode.gif'
|
1011 |
+
});
|
1012 |
+
|
1013 |
+
// Register encode button
|
1014 |
+
ed.addButton('decode', {
|
1015 |
+
/*title : 'Decrypt This Text',*/
|
1016 |
+
title : ed.getLang('encode.decode'),
|
1017 |
+
cmd : 'mcedecode',
|
1018 |
+
//image : url + '/img/decode.gif'
|
1019 |
+
});
|
1020 |
+
|
1021 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
1022 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
1023 |
+
cm.setActive('encode', n.nodeName == 'IMG');
|
1024 |
+
});
|
1025 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
1026 |
+
cm.setActive('decode', n.nodeName == 'IMG');
|
1027 |
+
}); },
|
1028 |
+
|
1029 |
+
/**
|
1030 |
+
* Creates control instances based in the incomming name. This method is normally not
|
1031 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
1032 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
1033 |
+
* method can be used to create those.
|
1034 |
+
*
|
1035 |
+
* @param {String} n Name of the control to create.
|
1036 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
1037 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
1038 |
+
*/
|
1039 |
+
createControl : function(n, cm) {
|
1040 |
+
return null;
|
1041 |
+
},
|
1042 |
+
|
1043 |
+
/**
|
1044 |
+
* Returns information about the plugin as a name/value array.
|
1045 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
1046 |
+
*
|
1047 |
+
* @return {Object} Name/value array containing information about the plugin.
|
1048 |
+
*/
|
1049 |
+
getInfo : function() {
|
1050 |
+
return {
|
1051 |
+
longname : 'encode plugin',
|
1052 |
+
author : 'Some author',
|
1053 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
1054 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/encode',
|
1055 |
+
version : "1.0"
|
1056 |
+
};
|
1057 |
+
}
|
1058 |
+
});
|
1059 |
+
|
1060 |
+
// Register plugin
|
1061 |
+
tinymce.PluginManager.add('encode', tinymce.plugins.encodePlugin);
|
1062 |
+
})();
|
addons/encode/editor_plugin_src.js
ADDED
@@ -0,0 +1,1062 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/*! Gibberish-AES
|
13 |
+
* A lightweight Javascript Libray for OpenSSL compatible AES CBC encryption.
|
14 |
+
*
|
15 |
+
* Author: Mark Percival
|
16 |
+
* Email: mark@mpercival.com
|
17 |
+
* Copyright: Mark Percival - http://mpercival.com 2008
|
18 |
+
*
|
19 |
+
* With thanks to:
|
20 |
+
* Josh Davis - http://www.josh-davis.org/ecmaScrypt
|
21 |
+
* Chris Veness - http://www.movable-type.co.uk/scripts/aes.html
|
22 |
+
* Michel I. Gallant - http://www.jensign.com/
|
23 |
+
*
|
24 |
+
* License: MIT
|
25 |
+
*
|
26 |
+
* Usage: GibberishAES.enc("secret", "password")
|
27 |
+
* Outputs: AES Encrypted text encoded in Base64
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
var GibberishAES = (function(){
|
32 |
+
var Nr = 14,
|
33 |
+
/* Default to 256 Bit Encryption */
|
34 |
+
Nk = 8,
|
35 |
+
Decrypt = false,
|
36 |
+
|
37 |
+
enc_utf8 = function(s)
|
38 |
+
{
|
39 |
+
try {
|
40 |
+
return unescape(encodeURIComponent(s));
|
41 |
+
}
|
42 |
+
catch(e) {
|
43 |
+
throw 'Error on UTF-8 encode';
|
44 |
+
}
|
45 |
+
},
|
46 |
+
|
47 |
+
dec_utf8 = function(s)
|
48 |
+
{
|
49 |
+
try {
|
50 |
+
return decodeURIComponent(escape(s));
|
51 |
+
}
|
52 |
+
catch(e) {
|
53 |
+
throw ('Bad Key');
|
54 |
+
}
|
55 |
+
},
|
56 |
+
|
57 |
+
padBlock = function(byteArr)
|
58 |
+
{
|
59 |
+
var array = [], cpad, i;
|
60 |
+
if (byteArr.length < 16) {
|
61 |
+
cpad = 16 - byteArr.length;
|
62 |
+
array = [cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad, cpad];
|
63 |
+
}
|
64 |
+
for (i = 0; i < byteArr.length; i++)
|
65 |
+
{
|
66 |
+
array[i] = byteArr[i];
|
67 |
+
}
|
68 |
+
return array;
|
69 |
+
},
|
70 |
+
|
71 |
+
block2s = function(block, lastBlock)
|
72 |
+
{
|
73 |
+
var string = '', padding, i;
|
74 |
+
if (lastBlock) {
|
75 |
+
padding = block[15];
|
76 |
+
if (padding > 16) {
|
77 |
+
throw ('Decryption error: Maybe bad key');
|
78 |
+
}
|
79 |
+
if (padding == 16) {
|
80 |
+
return '';
|
81 |
+
}
|
82 |
+
for (i = 0; i < 16 - padding; i++) {
|
83 |
+
string += String.fromCharCode(block[i]);
|
84 |
+
}
|
85 |
+
} else {
|
86 |
+
for (i = 0; i < 16; i++) {
|
87 |
+
string += String.fromCharCode(block[i]);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return string;
|
91 |
+
},
|
92 |
+
|
93 |
+
a2h = function(numArr)
|
94 |
+
{
|
95 |
+
var string = '', i;
|
96 |
+
for (i = 0; i < numArr.length; i++) {
|
97 |
+
string += (numArr[i] < 16 ? '0': '') + numArr[i].toString(16);
|
98 |
+
}
|
99 |
+
return string;
|
100 |
+
},
|
101 |
+
|
102 |
+
h2a = function(s)
|
103 |
+
{
|
104 |
+
var ret = [];
|
105 |
+
s.replace(/(..)/g,
|
106 |
+
function(s) {
|
107 |
+
ret.push(parseInt(s, 16));
|
108 |
+
});
|
109 |
+
return ret;
|
110 |
+
},
|
111 |
+
|
112 |
+
s2a = function(string) {
|
113 |
+
string = enc_utf8(string);
|
114 |
+
var array = [], i;
|
115 |
+
for (i = 0; i < string.length; i++)
|
116 |
+
{
|
117 |
+
array[i] = string.charCodeAt(i);
|
118 |
+
}
|
119 |
+
return array;
|
120 |
+
},
|
121 |
+
|
122 |
+
size = function(newsize)
|
123 |
+
{
|
124 |
+
switch (newsize)
|
125 |
+
{
|
126 |
+
case 128:
|
127 |
+
Nr = 10;
|
128 |
+
Nk = 4;
|
129 |
+
break;
|
130 |
+
case 192:
|
131 |
+
Nr = 12;
|
132 |
+
Nk = 6;
|
133 |
+
break;
|
134 |
+
case 256:
|
135 |
+
Nr = 14;
|
136 |
+
Nk = 8;
|
137 |
+
break;
|
138 |
+
default:
|
139 |
+
throw ('Invalid Key Size Specified:' + newsize);
|
140 |
+
}
|
141 |
+
},
|
142 |
+
|
143 |
+
randArr = function(num) {
|
144 |
+
var result = [], i;
|
145 |
+
for (i = 0; i < num; i++) {
|
146 |
+
result = result.concat(Math.floor(Math.random() * 256));
|
147 |
+
}
|
148 |
+
return result;
|
149 |
+
},
|
150 |
+
|
151 |
+
openSSLKey = function(passwordArr, saltArr) {
|
152 |
+
// Number of rounds depends on the size of the AES in use
|
153 |
+
// 3 rounds for 256
|
154 |
+
// 2 rounds for the key, 1 for the IV
|
155 |
+
// 2 rounds for 128
|
156 |
+
// 1 round for the key, 1 round for the IV
|
157 |
+
// 3 rounds for 192 since it's not evenly divided by 128 bits
|
158 |
+
var rounds = Nr >= 12 ? 3: 2,
|
159 |
+
key = [],
|
160 |
+
iv = [],
|
161 |
+
md5_hash = [],
|
162 |
+
result = [],
|
163 |
+
data00 = passwordArr.concat(saltArr),
|
164 |
+
i;
|
165 |
+
md5_hash[0] = GibberishAES.Hash.MD5(data00);
|
166 |
+
result = md5_hash[0];
|
167 |
+
for (i = 1; i < rounds; i++) {
|
168 |
+
md5_hash[i] = GibberishAES.Hash.MD5(md5_hash[i - 1].concat(data00));
|
169 |
+
result = result.concat(md5_hash[i]);
|
170 |
+
}
|
171 |
+
key = result.slice(0, 4 * Nk);
|
172 |
+
iv = result.slice(4 * Nk, 4 * Nk + 16);
|
173 |
+
return {
|
174 |
+
key: key,
|
175 |
+
iv: iv
|
176 |
+
};
|
177 |
+
},
|
178 |
+
|
179 |
+
rawEncrypt = function(plaintext, key, iv) {
|
180 |
+
// plaintext, key and iv as byte arrays
|
181 |
+
key = expandKey(key);
|
182 |
+
var numBlocks = Math.ceil(plaintext.length / 16),
|
183 |
+
blocks = [],
|
184 |
+
i,
|
185 |
+
cipherBlocks = [];
|
186 |
+
for (i = 0; i < numBlocks; i++) {
|
187 |
+
blocks[i] = padBlock(plaintext.slice(i * 16, i * 16 + 16));
|
188 |
+
}
|
189 |
+
if (plaintext.length % 16 === 0) {
|
190 |
+
blocks.push([16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]);
|
191 |
+
// CBC OpenSSL padding scheme
|
192 |
+
numBlocks++;
|
193 |
+
}
|
194 |
+
for (i = 0; i < blocks.length; i++) {
|
195 |
+
blocks[i] = (i === 0) ? xorBlocks(blocks[i], iv) : xorBlocks(blocks[i], cipherBlocks[i - 1]);
|
196 |
+
cipherBlocks[i] = encryptBlock(blocks[i], key);
|
197 |
+
}
|
198 |
+
return cipherBlocks;
|
199 |
+
},
|
200 |
+
|
201 |
+
rawDecrypt = function(cryptArr, key, iv, binary) {
|
202 |
+
// cryptArr, key and iv as byte arrays
|
203 |
+
key = expandKey(key);
|
204 |
+
var numBlocks = cryptArr.length / 16,
|
205 |
+
cipherBlocks = [],
|
206 |
+
i,
|
207 |
+
plainBlocks = [],
|
208 |
+
string = '';
|
209 |
+
for (i = 0; i < numBlocks; i++) {
|
210 |
+
cipherBlocks.push(cryptArr.slice(i * 16, (i + 1) * 16));
|
211 |
+
}
|
212 |
+
for (i = cipherBlocks.length - 1; i >= 0; i--) {
|
213 |
+
plainBlocks[i] = decryptBlock(cipherBlocks[i], key);
|
214 |
+
plainBlocks[i] = (i === 0) ? xorBlocks(plainBlocks[i], iv) : xorBlocks(plainBlocks[i], cipherBlocks[i - 1]);
|
215 |
+
}
|
216 |
+
for (i = 0; i < numBlocks - 1; i++) {
|
217 |
+
string += block2s(plainBlocks[i]);
|
218 |
+
}
|
219 |
+
string += block2s(plainBlocks[i], true);
|
220 |
+
return binary ? string : dec_utf8(string);
|
221 |
+
},
|
222 |
+
|
223 |
+
encryptBlock = function(block, words) {
|
224 |
+
Decrypt = false;
|
225 |
+
var state = addRoundKey(block, words, 0),
|
226 |
+
round;
|
227 |
+
for (round = 1; round < (Nr + 1); round++) {
|
228 |
+
state = subBytes(state);
|
229 |
+
state = shiftRows(state);
|
230 |
+
if (round < Nr) {
|
231 |
+
state = mixColumns(state);
|
232 |
+
}
|
233 |
+
//last round? don't mixColumns
|
234 |
+
state = addRoundKey(state, words, round);
|
235 |
+
}
|
236 |
+
|
237 |
+
return state;
|
238 |
+
},
|
239 |
+
|
240 |
+
decryptBlock = function(block, words) {
|
241 |
+
Decrypt = true;
|
242 |
+
var state = addRoundKey(block, words, Nr),
|
243 |
+
round;
|
244 |
+
for (round = Nr - 1; round > -1; round--) {
|
245 |
+
state = shiftRows(state);
|
246 |
+
state = subBytes(state);
|
247 |
+
state = addRoundKey(state, words, round);
|
248 |
+
if (round > 0) {
|
249 |
+
state = mixColumns(state);
|
250 |
+
}
|
251 |
+
//last round? don't mixColumns
|
252 |
+
}
|
253 |
+
|
254 |
+
return state;
|
255 |
+
},
|
256 |
+
|
257 |
+
subBytes = function(state) {
|
258 |
+
var S = Decrypt ? SBoxInv: SBox,
|
259 |
+
temp = [],
|
260 |
+
i;
|
261 |
+
for (i = 0; i < 16; i++) {
|
262 |
+
temp[i] = S[state[i]];
|
263 |
+
}
|
264 |
+
return temp;
|
265 |
+
},
|
266 |
+
|
267 |
+
shiftRows = function(state) {
|
268 |
+
var temp = [],
|
269 |
+
shiftBy = Decrypt ? [0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3] : [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11],
|
270 |
+
i;
|
271 |
+
for (i = 0; i < 16; i++) {
|
272 |
+
temp[i] = state[shiftBy[i]];
|
273 |
+
}
|
274 |
+
return temp;
|
275 |
+
},
|
276 |
+
|
277 |
+
mixColumns = function(state) {
|
278 |
+
var t = [],
|
279 |
+
c;
|
280 |
+
if (!Decrypt) {
|
281 |
+
for (c = 0; c < 4; c++) {
|
282 |
+
t[c * 4] = G2X[state[c * 4]] ^ G3X[state[1 + c * 4]] ^ state[2 + c * 4] ^ state[3 + c * 4];
|
283 |
+
t[1 + c * 4] = state[c * 4] ^ G2X[state[1 + c * 4]] ^ G3X[state[2 + c * 4]] ^ state[3 + c * 4];
|
284 |
+
t[2 + c * 4] = state[c * 4] ^ state[1 + c * 4] ^ G2X[state[2 + c * 4]] ^ G3X[state[3 + c * 4]];
|
285 |
+
t[3 + c * 4] = G3X[state[c * 4]] ^ state[1 + c * 4] ^ state[2 + c * 4] ^ G2X[state[3 + c * 4]];
|
286 |
+
}
|
287 |
+
}else {
|
288 |
+
for (c = 0; c < 4; c++) {
|
289 |
+
t[c*4] = GEX[state[c*4]] ^ GBX[state[1+c*4]] ^ GDX[state[2+c*4]] ^ G9X[state[3+c*4]];
|
290 |
+
t[1+c*4] = G9X[state[c*4]] ^ GEX[state[1+c*4]] ^ GBX[state[2+c*4]] ^ GDX[state[3+c*4]];
|
291 |
+
t[2+c*4] = GDX[state[c*4]] ^ G9X[state[1+c*4]] ^ GEX[state[2+c*4]] ^ GBX[state[3+c*4]];
|
292 |
+
t[3+c*4] = GBX[state[c*4]] ^ GDX[state[1+c*4]] ^ G9X[state[2+c*4]] ^ GEX[state[3+c*4]];
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
return t;
|
297 |
+
},
|
298 |
+
|
299 |
+
addRoundKey = function(state, words, round) {
|
300 |
+
var temp = [],
|
301 |
+
i;
|
302 |
+
for (i = 0; i < 16; i++) {
|
303 |
+
temp[i] = state[i] ^ words[round][i];
|
304 |
+
}
|
305 |
+
return temp;
|
306 |
+
},
|
307 |
+
|
308 |
+
xorBlocks = function(block1, block2) {
|
309 |
+
var temp = [],
|
310 |
+
i;
|
311 |
+
for (i = 0; i < 16; i++) {
|
312 |
+
temp[i] = block1[i] ^ block2[i];
|
313 |
+
}
|
314 |
+
return temp;
|
315 |
+
},
|
316 |
+
|
317 |
+
expandKey = function(key) {
|
318 |
+
// Expects a 1d number array
|
319 |
+
var w = [],
|
320 |
+
temp = [],
|
321 |
+
i,
|
322 |
+
r,
|
323 |
+
t,
|
324 |
+
flat = [],
|
325 |
+
j;
|
326 |
+
|
327 |
+
for (i = 0; i < Nk; i++) {
|
328 |
+
r = [key[4 * i], key[4 * i + 1], key[4 * i + 2], key[4 * i + 3]];
|
329 |
+
w[i] = r;
|
330 |
+
}
|
331 |
+
|
332 |
+
for (i = Nk; i < (4 * (Nr + 1)); i++) {
|
333 |
+
w[i] = [];
|
334 |
+
for (t = 0; t < 4; t++) {
|
335 |
+
temp[t] = w[i - 1][t];
|
336 |
+
}
|
337 |
+
if (i % Nk === 0) {
|
338 |
+
temp = subWord(rotWord(temp));
|
339 |
+
temp[0] ^= Rcon[i / Nk - 1];
|
340 |
+
} else if (Nk > 6 && i % Nk == 4) {
|
341 |
+
temp = subWord(temp);
|
342 |
+
}
|
343 |
+
for (t = 0; t < 4; t++) {
|
344 |
+
w[i][t] = w[i - Nk][t] ^ temp[t];
|
345 |
+
}
|
346 |
+
}
|
347 |
+
for (i = 0; i < (Nr + 1); i++) {
|
348 |
+
flat[i] = [];
|
349 |
+
for (j = 0; j < 4; j++) {
|
350 |
+
flat[i].push(w[i * 4 + j][0], w[i * 4 + j][1], w[i * 4 + j][2], w[i * 4 + j][3]);
|
351 |
+
}
|
352 |
+
}
|
353 |
+
return flat;
|
354 |
+
},
|
355 |
+
|
356 |
+
subWord = function(w) {
|
357 |
+
// apply SBox to 4-byte word w
|
358 |
+
for (var i = 0; i < 4; i++) {
|
359 |
+
w[i] = SBox[w[i]];
|
360 |
+
}
|
361 |
+
return w;
|
362 |
+
},
|
363 |
+
|
364 |
+
rotWord = function(w) {
|
365 |
+
// rotate 4-byte word w left by one byte
|
366 |
+
var tmp = w[0],
|
367 |
+
i;
|
368 |
+
for (i = 0; i < 4; i++) {
|
369 |
+
w[i] = w[i + 1];
|
370 |
+
}
|
371 |
+
w[3] = tmp;
|
372 |
+
return w;
|
373 |
+
},
|
374 |
+
|
375 |
+
|
376 |
+
// S-box
|
377 |
+
SBox = [
|
378 |
+
99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171,
|
379 |
+
118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164,
|
380 |
+
114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113,
|
381 |
+
216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226,
|
382 |
+
235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214,
|
383 |
+
179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203,
|
384 |
+
190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69,
|
385 |
+
249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245,
|
386 |
+
188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68,
|
387 |
+
23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42,
|
388 |
+
144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73,
|
389 |
+
6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109,
|
390 |
+
141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37,
|
391 |
+
46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62,
|
392 |
+
181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225,
|
393 |
+
248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
|
394 |
+
140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187,
|
395 |
+
22],
|
396 |
+
|
397 |
+
// Precomputed lookup table for the inverse SBox
|
398 |
+
SBoxInv = [
|
399 |
+
82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215,
|
400 |
+
251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222,
|
401 |
+
233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66,
|
402 |
+
250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73,
|
403 |
+
109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92,
|
404 |
+
204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21,
|
405 |
+
70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247,
|
406 |
+
228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2,
|
407 |
+
193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220,
|
408 |
+
234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173,
|
409 |
+
53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29,
|
410 |
+
41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75,
|
411 |
+
198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168,
|
412 |
+
51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81,
|
413 |
+
127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160,
|
414 |
+
224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
|
415 |
+
23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12,
|
416 |
+
125],
|
417 |
+
// Rijndael Rcon
|
418 |
+
Rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94,
|
419 |
+
188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
|
420 |
+
|
421 |
+
G2X = [
|
422 |
+
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16,
|
423 |
+
0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
|
424 |
+
0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46,
|
425 |
+
0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
|
426 |
+
0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76,
|
427 |
+
0x78, 0x7a, 0x7c, 0x7e, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e,
|
428 |
+
0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6,
|
429 |
+
0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe,
|
430 |
+
0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6,
|
431 |
+
0xd8, 0xda, 0xdc, 0xde, 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee,
|
432 |
+
0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, 0x1b, 0x19, 0x1f, 0x1d,
|
433 |
+
0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05,
|
434 |
+
0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d,
|
435 |
+
0x23, 0x21, 0x27, 0x25, 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55,
|
436 |
+
0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45, 0x7b, 0x79, 0x7f, 0x7d,
|
437 |
+
0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65,
|
438 |
+
0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d,
|
439 |
+
0x83, 0x81, 0x87, 0x85, 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5,
|
440 |
+
0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5, 0xdb, 0xd9, 0xdf, 0xdd,
|
441 |
+
0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
|
442 |
+
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed,
|
443 |
+
0xe3, 0xe1, 0xe7, 0xe5
|
444 |
+
],
|
445 |
+
|
446 |
+
G3X = [
|
447 |
+
0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d,
|
448 |
+
0x14, 0x17, 0x12, 0x11, 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39,
|
449 |
+
|
450 |
+
0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, 0x60, 0x63, 0x66, 0x65,
|
451 |
+
0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,
|
452 |
+
0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d,
|
453 |
+
0x44, 0x47, 0x42, 0x41, 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9,
|
454 |
+
0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1, 0xf0, 0xf3, 0xf6, 0xf5,
|
455 |
+
0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1,
|
456 |
+
0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd,
|
457 |
+
0xb4, 0xb7, 0xb2, 0xb1, 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99,
|
458 |
+
0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81, 0x9b, 0x98, 0x9d, 0x9e,
|
459 |
+
0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a,
|
460 |
+
0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6,
|
461 |
+
0xbf, 0xbc, 0xb9, 0xba, 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2,
|
462 |
+
0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea, 0xcb, 0xc8, 0xcd, 0xce,
|
463 |
+
0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda,
|
464 |
+
0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46,
|
465 |
+
0x4f, 0x4c, 0x49, 0x4a, 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62,
|
466 |
+
0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a, 0x3b, 0x38, 0x3d, 0x3e,
|
467 |
+
0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,
|
468 |
+
0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16,
|
469 |
+
0x1f, 0x1c, 0x19, 0x1a
|
470 |
+
],
|
471 |
+
|
472 |
+
G9X = [
|
473 |
+
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53,
|
474 |
+
0x6c, 0x65, 0x7e, 0x77, 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf,
|
475 |
+
0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7, 0x3b, 0x32, 0x29, 0x20,
|
476 |
+
0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c,
|
477 |
+
0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8,
|
478 |
+
0xc7, 0xce, 0xd5, 0xdc, 0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49,
|
479 |
+
0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01, 0xe6, 0xef, 0xf4, 0xfd,
|
480 |
+
0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91,
|
481 |
+
0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e,
|
482 |
+
0x21, 0x28, 0x33, 0x3a, 0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2,
|
483 |
+
0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa, 0xec, 0xe5, 0xfe, 0xf7,
|
484 |
+
0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b,
|
485 |
+
0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f,
|
486 |
+
0x10, 0x19, 0x02, 0x0b, 0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8,
|
487 |
+
0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0, 0x47, 0x4e, 0x55, 0x5c,
|
488 |
+
0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30,
|
489 |
+
0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9,
|
490 |
+
0xf6, 0xff, 0xe4, 0xed, 0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35,
|
491 |
+
0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d, 0xa1, 0xa8, 0xb3, 0xba,
|
492 |
+
0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6,
|
493 |
+
0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62,
|
494 |
+
0x5d, 0x54, 0x4f, 0x46
|
495 |
+
],
|
496 |
+
|
497 |
+
GBX = [
|
498 |
+
0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45,
|
499 |
+
0x74, 0x7f, 0x62, 0x69, 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81,
|
500 |
+
0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9, 0x7b, 0x70, 0x6d, 0x66,
|
501 |
+
0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12,
|
502 |
+
0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e,
|
503 |
+
0xbf, 0xb4, 0xa9, 0xa2, 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7,
|
504 |
+
0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f, 0x46, 0x4d, 0x50, 0x5b,
|
505 |
+
0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f,
|
506 |
+
0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8,
|
507 |
+
0xf9, 0xf2, 0xef, 0xe4, 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c,
|
508 |
+
0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54, 0xf7, 0xfc, 0xe1, 0xea,
|
509 |
+
0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e,
|
510 |
+
0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02,
|
511 |
+
0x33, 0x38, 0x25, 0x2e, 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd,
|
512 |
+
0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5, 0x3c, 0x37, 0x2a, 0x21,
|
513 |
+
0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55,
|
514 |
+
0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44,
|
515 |
+
0x75, 0x7e, 0x63, 0x68, 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80,
|
516 |
+
0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8, 0x7a, 0x71, 0x6c, 0x67,
|
517 |
+
0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13,
|
518 |
+
0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f,
|
519 |
+
0xbe, 0xb5, 0xa8, 0xa3
|
520 |
+
],
|
521 |
+
|
522 |
+
GDX = [
|
523 |
+
0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f,
|
524 |
+
0x5c, 0x51, 0x46, 0x4b, 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3,
|
525 |
+
0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b, 0xbb, 0xb6, 0xa1, 0xac,
|
526 |
+
0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0,
|
527 |
+
0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14,
|
528 |
+
0x37, 0x3a, 0x2d, 0x20, 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e,
|
529 |
+
0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26, 0xbd, 0xb0, 0xa7, 0xaa,
|
530 |
+
0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6,
|
531 |
+
0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9,
|
532 |
+
0x8a, 0x87, 0x90, 0x9d, 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25,
|
533 |
+
0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d, 0xda, 0xd7, 0xc0, 0xcd,
|
534 |
+
0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91,
|
535 |
+
0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75,
|
536 |
+
0x56, 0x5b, 0x4c, 0x41, 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42,
|
537 |
+
0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a, 0xb1, 0xbc, 0xab, 0xa6,
|
538 |
+
0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa,
|
539 |
+
0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8,
|
540 |
+
0xeb, 0xe6, 0xf1, 0xfc, 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44,
|
541 |
+
0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c, 0x0c, 0x01, 0x16, 0x1b,
|
542 |
+
0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47,
|
543 |
+
0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3,
|
544 |
+
0x80, 0x8d, 0x9a, 0x97
|
545 |
+
],
|
546 |
+
|
547 |
+
GEX = [
|
548 |
+
0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62,
|
549 |
+
0x48, 0x46, 0x54, 0x5a, 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca,
|
550 |
+
0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba, 0xdb, 0xd5, 0xc7, 0xc9,
|
551 |
+
0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81,
|
552 |
+
0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59,
|
553 |
+
0x73, 0x7d, 0x6f, 0x61, 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87,
|
554 |
+
0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7, 0x4d, 0x43, 0x51, 0x5f,
|
555 |
+
0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17,
|
556 |
+
0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14,
|
557 |
+
0x3e, 0x30, 0x22, 0x2c, 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc,
|
558 |
+
0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc, 0x41, 0x4f, 0x5d, 0x53,
|
559 |
+
0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b,
|
560 |
+
0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3,
|
561 |
+
0xe9, 0xe7, 0xf5, 0xfb, 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0,
|
562 |
+
0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0, 0x7a, 0x74, 0x66, 0x68,
|
563 |
+
0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20,
|
564 |
+
0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e,
|
565 |
+
0xa4, 0xaa, 0xb8, 0xb6, 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26,
|
566 |
+
0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56, 0x37, 0x39, 0x2b, 0x25,
|
567 |
+
0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d,
|
568 |
+
0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5,
|
569 |
+
0x9f, 0x91, 0x83, 0x8d
|
570 |
+
],
|
571 |
+
|
572 |
+
enc = function(string, pass, binary) {
|
573 |
+
// string, password in plaintext
|
574 |
+
var salt = randArr(8),
|
575 |
+
pbe = openSSLKey(s2a(pass), salt),
|
576 |
+
key = pbe.key,
|
577 |
+
iv = pbe.iv,
|
578 |
+
cipherBlocks,
|
579 |
+
saltBlock = [[83, 97, 108, 116, 101, 100, 95, 95].concat(salt)];
|
580 |
+
if (!binary) {
|
581 |
+
string = s2a(string);
|
582 |
+
}
|
583 |
+
cipherBlocks = rawEncrypt(string, key, iv);
|
584 |
+
// Spells out 'Salted__'
|
585 |
+
cipherBlocks = saltBlock.concat(cipherBlocks);
|
586 |
+
return Base64.encode(cipherBlocks);
|
587 |
+
},
|
588 |
+
|
589 |
+
dec = function(string, pass, binary) {
|
590 |
+
// string, password in plaintext
|
591 |
+
var cryptArr = Base64.decode(string),
|
592 |
+
salt = cryptArr.slice(8, 16),
|
593 |
+
pbe = openSSLKey(s2a(pass), salt),
|
594 |
+
key = pbe.key,
|
595 |
+
iv = pbe.iv;
|
596 |
+
cryptArr = cryptArr.slice(16, cryptArr.length);
|
597 |
+
// Take off the Salted__ffeeddcc
|
598 |
+
string = rawDecrypt(cryptArr, key, iv, binary);
|
599 |
+
return string;
|
600 |
+
},
|
601 |
+
|
602 |
+
MD5 = function(numArr) {
|
603 |
+
|
604 |
+
function rotateLeft(lValue, iShiftBits) {
|
605 |
+
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
606 |
+
}
|
607 |
+
|
608 |
+
function addUnsigned(lX, lY) {
|
609 |
+
var lX4,
|
610 |
+
lY4,
|
611 |
+
lX8,
|
612 |
+
lY8,
|
613 |
+
lResult;
|
614 |
+
lX8 = (lX & 0x80000000);
|
615 |
+
lY8 = (lY & 0x80000000);
|
616 |
+
lX4 = (lX & 0x40000000);
|
617 |
+
lY4 = (lY & 0x40000000);
|
618 |
+
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
|
619 |
+
if (lX4 & lY4) {
|
620 |
+
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
|
621 |
+
}
|
622 |
+
if (lX4 | lY4) {
|
623 |
+
if (lResult & 0x40000000) {
|
624 |
+
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
|
625 |
+
} else {
|
626 |
+
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
|
627 |
+
}
|
628 |
+
} else {
|
629 |
+
return (lResult ^ lX8 ^ lY8);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
function f(x, y, z) {
|
634 |
+
return (x & y) | ((~x) & z);
|
635 |
+
}
|
636 |
+
function g(x, y, z) {
|
637 |
+
return (x & z) | (y & (~z));
|
638 |
+
}
|
639 |
+
function h(x, y, z) {
|
640 |
+
return (x ^ y ^ z);
|
641 |
+
}
|
642 |
+
function funcI(x, y, z) {
|
643 |
+
return (y ^ (x | (~z)));
|
644 |
+
}
|
645 |
+
|
646 |
+
function ff(a, b, c, d, x, s, ac) {
|
647 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(f(b, c, d), x), ac));
|
648 |
+
return addUnsigned(rotateLeft(a, s), b);
|
649 |
+
}
|
650 |
+
|
651 |
+
function gg(a, b, c, d, x, s, ac) {
|
652 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(g(b, c, d), x), ac));
|
653 |
+
return addUnsigned(rotateLeft(a, s), b);
|
654 |
+
}
|
655 |
+
|
656 |
+
function hh(a, b, c, d, x, s, ac) {
|
657 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(h(b, c, d), x), ac));
|
658 |
+
return addUnsigned(rotateLeft(a, s), b);
|
659 |
+
}
|
660 |
+
|
661 |
+
function ii(a, b, c, d, x, s, ac) {
|
662 |
+
a = addUnsigned(a, addUnsigned(addUnsigned(funcI(b, c, d), x), ac));
|
663 |
+
return addUnsigned(rotateLeft(a, s), b);
|
664 |
+
}
|
665 |
+
|
666 |
+
function convertToWordArray(numArr) {
|
667 |
+
var lWordCount,
|
668 |
+
lMessageLength = numArr.length,
|
669 |
+
lNumberOfWords_temp1 = lMessageLength + 8,
|
670 |
+
lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64,
|
671 |
+
lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16,
|
672 |
+
lWordArray = [],
|
673 |
+
lBytePosition = 0,
|
674 |
+
lByteCount = 0;
|
675 |
+
while (lByteCount < lMessageLength) {
|
676 |
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
677 |
+
lBytePosition = (lByteCount % 4) * 8;
|
678 |
+
lWordArray[lWordCount] = (lWordArray[lWordCount] | (numArr[lByteCount] << lBytePosition));
|
679 |
+
lByteCount++;
|
680 |
+
}
|
681 |
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
682 |
+
lBytePosition = (lByteCount % 4) * 8;
|
683 |
+
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
684 |
+
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
685 |
+
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
686 |
+
return lWordArray;
|
687 |
+
}
|
688 |
+
|
689 |
+
function wordToHex(lValue) {
|
690 |
+
var lByte,
|
691 |
+
lCount,
|
692 |
+
wordToHexArr = [];
|
693 |
+
for (lCount = 0; lCount <= 3; lCount++) {
|
694 |
+
lByte = (lValue >>> (lCount * 8)) & 255;
|
695 |
+
wordToHexArr = wordToHexArr.concat(lByte);
|
696 |
+
}
|
697 |
+
return wordToHexArr;
|
698 |
+
}
|
699 |
+
|
700 |
+
/*function utf8Encode(string) {
|
701 |
+
string = string.replace(/\r\n/g, "\n");
|
702 |
+
var utftext = "",
|
703 |
+
n,
|
704 |
+
c;
|
705 |
+
|
706 |
+
for (n = 0; n < string.length; n++) {
|
707 |
+
|
708 |
+
c = string.charCodeAt(n);
|
709 |
+
|
710 |
+
if (c < 128) {
|
711 |
+
utftext += String.fromCharCode(c);
|
712 |
+
}
|
713 |
+
else if ((c > 127) && (c < 2048)) {
|
714 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
715 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
716 |
+
}
|
717 |
+
else {
|
718 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
719 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
720 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
721 |
+
}
|
722 |
+
|
723 |
+
}
|
724 |
+
|
725 |
+
return utftext;
|
726 |
+
}*/
|
727 |
+
|
728 |
+
var x = [],
|
729 |
+
k,
|
730 |
+
AA,
|
731 |
+
BB,
|
732 |
+
CC,
|
733 |
+
DD,
|
734 |
+
a,
|
735 |
+
b,
|
736 |
+
c,
|
737 |
+
d,
|
738 |
+
S11 = 7,
|
739 |
+
S12 = 12,
|
740 |
+
S13 = 17,
|
741 |
+
S14 = 22,
|
742 |
+
S21 = 5,
|
743 |
+
S22 = 9,
|
744 |
+
S23 = 14,
|
745 |
+
S24 = 20,
|
746 |
+
S31 = 4,
|
747 |
+
S32 = 11,
|
748 |
+
S33 = 16,
|
749 |
+
S34 = 23,
|
750 |
+
S41 = 6,
|
751 |
+
S42 = 10,
|
752 |
+
S43 = 15,
|
753 |
+
S44 = 21;
|
754 |
+
|
755 |
+
x = convertToWordArray(numArr);
|
756 |
+
|
757 |
+
a = 0x67452301;
|
758 |
+
b = 0xEFCDAB89;
|
759 |
+
c = 0x98BADCFE;
|
760 |
+
d = 0x10325476;
|
761 |
+
|
762 |
+
for (k = 0; k < x.length; k += 16) {
|
763 |
+
AA = a;
|
764 |
+
BB = b;
|
765 |
+
CC = c;
|
766 |
+
DD = d;
|
767 |
+
a = ff(a, b, c, d, x[k + 0], S11, 0xD76AA478);
|
768 |
+
d = ff(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
|
769 |
+
c = ff(c, d, a, b, x[k + 2], S13, 0x242070DB);
|
770 |
+
b = ff(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
|
771 |
+
a = ff(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
|
772 |
+
d = ff(d, a, b, c, x[k + 5], S12, 0x4787C62A);
|
773 |
+
c = ff(c, d, a, b, x[k + 6], S13, 0xA8304613);
|
774 |
+
b = ff(b, c, d, a, x[k + 7], S14, 0xFD469501);
|
775 |
+
a = ff(a, b, c, d, x[k + 8], S11, 0x698098D8);
|
776 |
+
d = ff(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
|
777 |
+
c = ff(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
|
778 |
+
b = ff(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
|
779 |
+
a = ff(a, b, c, d, x[k + 12], S11, 0x6B901122);
|
780 |
+
d = ff(d, a, b, c, x[k + 13], S12, 0xFD987193);
|
781 |
+
c = ff(c, d, a, b, x[k + 14], S13, 0xA679438E);
|
782 |
+
b = ff(b, c, d, a, x[k + 15], S14, 0x49B40821);
|
783 |
+
a = gg(a, b, c, d, x[k + 1], S21, 0xF61E2562);
|
784 |
+
d = gg(d, a, b, c, x[k + 6], S22, 0xC040B340);
|
785 |
+
c = gg(c, d, a, b, x[k + 11], S23, 0x265E5A51);
|
786 |
+
b = gg(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
|
787 |
+
a = gg(a, b, c, d, x[k + 5], S21, 0xD62F105D);
|
788 |
+
d = gg(d, a, b, c, x[k + 10], S22, 0x2441453);
|
789 |
+
c = gg(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
|
790 |
+
b = gg(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
|
791 |
+
a = gg(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
|
792 |
+
d = gg(d, a, b, c, x[k + 14], S22, 0xC33707D6);
|
793 |
+
c = gg(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
|
794 |
+
b = gg(b, c, d, a, x[k + 8], S24, 0x455A14ED);
|
795 |
+
a = gg(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
|
796 |
+
d = gg(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
|
797 |
+
c = gg(c, d, a, b, x[k + 7], S23, 0x676F02D9);
|
798 |
+
b = gg(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
|
799 |
+
a = hh(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
|
800 |
+
d = hh(d, a, b, c, x[k + 8], S32, 0x8771F681);
|
801 |
+
c = hh(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
|
802 |
+
b = hh(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
|
803 |
+
a = hh(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
|
804 |
+
d = hh(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
|
805 |
+
c = hh(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
|
806 |
+
b = hh(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
|
807 |
+
a = hh(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
|
808 |
+
d = hh(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
|
809 |
+
c = hh(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
|
810 |
+
b = hh(b, c, d, a, x[k + 6], S34, 0x4881D05);
|
811 |
+
a = hh(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
|
812 |
+
d = hh(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
|
813 |
+
c = hh(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
|
814 |
+
b = hh(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
|
815 |
+
a = ii(a, b, c, d, x[k + 0], S41, 0xF4292244);
|
816 |
+
d = ii(d, a, b, c, x[k + 7], S42, 0x432AFF97);
|
817 |
+
c = ii(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
|
818 |
+
b = ii(b, c, d, a, x[k + 5], S44, 0xFC93A039);
|
819 |
+
a = ii(a, b, c, d, x[k + 12], S41, 0x655B59C3);
|
820 |
+
d = ii(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
|
821 |
+
c = ii(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
|
822 |
+
b = ii(b, c, d, a, x[k + 1], S44, 0x85845DD1);
|
823 |
+
a = ii(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
|
824 |
+
d = ii(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
|
825 |
+
c = ii(c, d, a, b, x[k + 6], S43, 0xA3014314);
|
826 |
+
b = ii(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
|
827 |
+
a = ii(a, b, c, d, x[k + 4], S41, 0xF7537E82);
|
828 |
+
d = ii(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
|
829 |
+
c = ii(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
|
830 |
+
b = ii(b, c, d, a, x[k + 9], S44, 0xEB86D391);
|
831 |
+
a = addUnsigned(a, AA);
|
832 |
+
b = addUnsigned(b, BB);
|
833 |
+
c = addUnsigned(c, CC);
|
834 |
+
d = addUnsigned(d, DD);
|
835 |
+
}
|
836 |
+
|
837 |
+
return wordToHex(a).concat(wordToHex(b), wordToHex(c), wordToHex(d));
|
838 |
+
},
|
839 |
+
|
840 |
+
|
841 |
+
Base64 = (function(){
|
842 |
+
// Takes a Nx16x1 byte array and converts it to Base64
|
843 |
+
var _chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
844 |
+
chars = _chars.split(''),
|
845 |
+
|
846 |
+
encode = function(b, withBreaks) {
|
847 |
+
var flatArr = [],
|
848 |
+
b64 = '',
|
849 |
+
i,
|
850 |
+
broken_b64;
|
851 |
+
totalChunks = Math.floor(b.length * 16 / 3);
|
852 |
+
for (i = 0; i < b.length * 16; i++) {
|
853 |
+
flatArr.push(b[Math.floor(i / 16)][i % 16]);
|
854 |
+
}
|
855 |
+
for (i = 0; i < flatArr.length; i = i + 3) {
|
856 |
+
b64 += chars[flatArr[i] >> 2];
|
857 |
+
b64 += chars[((flatArr[i] & 3) << 4) | (flatArr[i + 1] >> 4)];
|
858 |
+
if (! (flatArr[i + 1] === undefined)) {
|
859 |
+
b64 += chars[((flatArr[i + 1] & 15) << 2) | (flatArr[i + 2] >> 6)];
|
860 |
+
} else {
|
861 |
+
b64 += '=';
|
862 |
+
}
|
863 |
+
if (! (flatArr[i + 2] === undefined)) {
|
864 |
+
b64 += chars[flatArr[i + 2] & 63];
|
865 |
+
} else {
|
866 |
+
b64 += '=';
|
867 |
+
}
|
868 |
+
}
|
869 |
+
// OpenSSL is super particular about line breaks
|
870 |
+
broken_b64 = b64.slice(0, 64) + '\n';
|
871 |
+
for (i = 1; i < (Math.ceil(b64.length / 64)); i++) {
|
872 |
+
broken_b64 += b64.slice(i * 64, i * 64 + 64) + (Math.ceil(b64.length / 64) == i + 1 ? '': '\n');
|
873 |
+
}
|
874 |
+
return broken_b64;
|
875 |
+
},
|
876 |
+
|
877 |
+
decode = function(string) {
|
878 |
+
string = string.replace(/\n/g, '');
|
879 |
+
var flatArr = [],
|
880 |
+
c = [],
|
881 |
+
b = [],
|
882 |
+
i;
|
883 |
+
for (i = 0; i < string.length; i = i + 4) {
|
884 |
+
c[0] = _chars.indexOf(string.charAt(i));
|
885 |
+
c[1] = _chars.indexOf(string.charAt(i + 1));
|
886 |
+
c[2] = _chars.indexOf(string.charAt(i + 2));
|
887 |
+
c[3] = _chars.indexOf(string.charAt(i + 3));
|
888 |
+
|
889 |
+
b[0] = (c[0] << 2) | (c[1] >> 4);
|
890 |
+
b[1] = ((c[1] & 15) << 4) | (c[2] >> 2);
|
891 |
+
b[2] = ((c[2] & 3) << 6) | c[3];
|
892 |
+
flatArr.push(b[0], b[1], b[2]);
|
893 |
+
}
|
894 |
+
flatArr = flatArr.slice(0, flatArr.length - (flatArr.length % 16));
|
895 |
+
return flatArr;
|
896 |
+
};
|
897 |
+
|
898 |
+
//internet explorer
|
899 |
+
if(typeof Array.indexOf === "function") {
|
900 |
+
_chars = chars;
|
901 |
+
}
|
902 |
+
|
903 |
+
/*
|
904 |
+
//other way to solve internet explorer problem
|
905 |
+
if(!Array.indexOf){
|
906 |
+
Array.prototype.indexOf = function(obj){
|
907 |
+
for(var i=0; i<this.length; i++){
|
908 |
+
if(this[i]===obj){
|
909 |
+
return i;
|
910 |
+
}
|
911 |
+
}
|
912 |
+
return -1;
|
913 |
+
}
|
914 |
+
}
|
915 |
+
*/
|
916 |
+
|
917 |
+
|
918 |
+
return {
|
919 |
+
"encode": encode,
|
920 |
+
"decode": decode
|
921 |
+
};
|
922 |
+
})();
|
923 |
+
|
924 |
+
return {
|
925 |
+
"size": size,
|
926 |
+
"h2a":h2a,
|
927 |
+
"expandKey":expandKey,
|
928 |
+
"encryptBlock":encryptBlock,
|
929 |
+
"decryptBlock":decryptBlock,
|
930 |
+
"Decrypt":Decrypt,
|
931 |
+
"s2a":s2a,
|
932 |
+
"rawEncrypt":rawEncrypt,
|
933 |
+
"dec":dec,
|
934 |
+
"openSSLKey":openSSLKey,
|
935 |
+
"a2h":a2h,
|
936 |
+
"enc":enc,
|
937 |
+
"Hash":{"MD5":MD5},
|
938 |
+
"Base64":Base64
|
939 |
+
};
|
940 |
+
|
941 |
+
})();
|
942 |
+
|
943 |
+
|
944 |
+
(function() {
|
945 |
+
// Load plugin specific language pack
|
946 |
+
//tinymce.PluginManager.requireLangPack('encode');
|
947 |
+
|
948 |
+
tinymce.create('tinymce.plugins.encodePlugin', {
|
949 |
+
/**
|
950 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
951 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
952 |
+
* of the editor instance to intercept that event.
|
953 |
+
*
|
954 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
955 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
956 |
+
*/
|
957 |
+
init : function(ed, url) {
|
958 |
+
|
959 |
+
|
960 |
+
|
961 |
+
|
962 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceencode');
|
963 |
+
ed.addCommand('mceencode', function() {
|
964 |
+
|
965 |
+
|
966 |
+
|
967 |
+
|
968 |
+
function Encrypt(theText) {
|
969 |
+
output = new String;
|
970 |
+
output = GibberishAES.enc(theText, "KFFB!e7Gac&*0(E!");
|
971 |
+
return output;
|
972 |
+
}
|
973 |
+
var getText = tinyMCE.activeEditor.getContent({format : 'raw'});
|
974 |
+
getText = getText.replace(/<\/pre>/g,"");
|
975 |
+
getText = getText.replace(/<pre>/g,"");
|
976 |
+
getText = '<pre>' + Encrypt(getText) + '</pre>';
|
977 |
+
|
978 |
+
tinyMCE.activeEditor.setContent(getText, {format : 'raw'});
|
979 |
+
|
980 |
+
|
981 |
+
});
|
982 |
+
|
983 |
+
ed.addCommand('mcedecode', function() {
|
984 |
+
|
985 |
+
|
986 |
+
function unEncrypt(theText) {
|
987 |
+
output = new String;
|
988 |
+
output = GibberishAES.dec(theText, "KFFB!e7Gac&*0(E!");
|
989 |
+
return output;
|
990 |
+
}
|
991 |
+
var getText = tinyMCE.activeEditor.getContent({format : 'raw'});
|
992 |
+
getText = getText.replace(/<p>/g,"");
|
993 |
+
getText = getText.replace(/<\/p>/g,"");
|
994 |
+
getText = getText.replace(/<\/pre>/g,"");
|
995 |
+
getText = getText.replace(/<pre>/g,"");
|
996 |
+
getText = getText.replace(/<br \/>/g,"");
|
997 |
+
getText = getText.replace(/<br>/g,"");
|
998 |
+
getText = unEncrypt(getText);
|
999 |
+
getText = '<pre>' + getText + '</pre>';
|
1000 |
+
tinyMCE.activeEditor.setContent(getText, {format : 'raw'});
|
1001 |
+
|
1002 |
+
|
1003 |
+
});
|
1004 |
+
|
1005 |
+
// Register encode button
|
1006 |
+
ed.addButton('encode', {
|
1007 |
+
/*title : 'Encrypt This Text',*/
|
1008 |
+
title : ed.getLang('encode.encode'),
|
1009 |
+
cmd : 'mceencode',
|
1010 |
+
//image : url + '/img/encode.gif'
|
1011 |
+
});
|
1012 |
+
|
1013 |
+
// Register encode button
|
1014 |
+
ed.addButton('decode', {
|
1015 |
+
/*title : 'Decrypt This Text',*/
|
1016 |
+
title : ed.getLang('encode.decode'),
|
1017 |
+
cmd : 'mcedecode',
|
1018 |
+
//image : url + '/img/decode.gif'
|
1019 |
+
});
|
1020 |
+
|
1021 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
1022 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
1023 |
+
cm.setActive('encode', n.nodeName == 'IMG');
|
1024 |
+
});
|
1025 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
1026 |
+
cm.setActive('decode', n.nodeName == 'IMG');
|
1027 |
+
}); },
|
1028 |
+
|
1029 |
+
/**
|
1030 |
+
* Creates control instances based in the incomming name. This method is normally not
|
1031 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
1032 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
1033 |
+
* method can be used to create those.
|
1034 |
+
*
|
1035 |
+
* @param {String} n Name of the control to create.
|
1036 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
1037 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
1038 |
+
*/
|
1039 |
+
createControl : function(n, cm) {
|
1040 |
+
return null;
|
1041 |
+
},
|
1042 |
+
|
1043 |
+
/**
|
1044 |
+
* Returns information about the plugin as a name/value array.
|
1045 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
1046 |
+
*
|
1047 |
+
* @return {Object} Name/value array containing information about the plugin.
|
1048 |
+
*/
|
1049 |
+
getInfo : function() {
|
1050 |
+
return {
|
1051 |
+
longname : 'encode plugin',
|
1052 |
+
author : 'Some author',
|
1053 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
1054 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/encode',
|
1055 |
+
version : "1.0"
|
1056 |
+
};
|
1057 |
+
}
|
1058 |
+
});
|
1059 |
+
|
1060 |
+
// Register plugin
|
1061 |
+
tinymce.PluginManager.add('encode', tinymce.plugins.encodePlugin);
|
1062 |
+
})();
|
addons/encode/img/Thumbs.db
ADDED
Binary file
|
addons/encode/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="decode.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="encode.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="encode.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/encode/img/decode.gif
ADDED
Binary file
|
addons/encode/img/encode.gif
ADDED
Binary file
|
addons/encode/img/encode.png
ADDED
Binary file
|
addons/encode/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/encode/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example',{
|
2 |
+
desc : 'This is just a template button'
|
3 |
+
});
|
addons/encode/langs/en_dlg.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example_dlg',{
|
2 |
+
title : 'This is just a example title'
|
3 |
+
});
|
addons/equation/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186891002582035" remote="130186854600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/equation/editor_plugin.js
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
var popupEqnwin = null;
|
3 |
+
(function() {
|
4 |
+
|
5 |
+
tinymce.create('tinymce.plugins.EquationPlugin', {
|
6 |
+
init: function(ed, url) {
|
7 |
+
ed.addCommand('equationCommand', function(a, latex) {
|
8 |
+
|
9 |
+
//open a popup window when the button is clicked
|
10 |
+
if (popupEqnwin==null || popupEqnwin.closed || !popupEqnwin.location)
|
11 |
+
{
|
12 |
+
var url='http://latex.codecogs.com/editor_json3.php?type=url&editor=TinyMCE';
|
13 |
+
|
14 |
+
//if(language!='') url+='&lang='+language;
|
15 |
+
if(latex!==undefined)
|
16 |
+
{
|
17 |
+
latex=unescape(latex);
|
18 |
+
latex=latex.replace(/\+/g,'+');
|
19 |
+
url+='&latex='+escape(latex);
|
20 |
+
}
|
21 |
+
|
22 |
+
popupEqnwin=window.open('','LaTexEditor','width=700,height=450,status=1,scrollbars=yes,resizable=1');
|
23 |
+
if (!popupEqnwin.opener) popupEqnwin.opener = self;
|
24 |
+
popupEqnwin.document.open();
|
25 |
+
popupEqnwin.document.write('<!DOCTYPE html><html><head><script src="'+url+'" type="text/javascript"></script></head><body></body></html>');
|
26 |
+
popupEqnwin.document.close();
|
27 |
+
}
|
28 |
+
else if (window.focus)
|
29 |
+
{
|
30 |
+
popupEqnwin.focus()
|
31 |
+
if(latex!==undefined)
|
32 |
+
{
|
33 |
+
latex=unescape(latex);
|
34 |
+
/* latex = latex.replace(/\\/g,'\\\\');
|
35 |
+
latex = latex.replace(/\'/g,'\\\'');
|
36 |
+
latex = latex.replace(/\"/g,'\\"');
|
37 |
+
latex = latex.replace(/\0/g,'\\0');
|
38 |
+
*/
|
39 |
+
try
|
40 |
+
{
|
41 |
+
popupEqnwin.EqEditor.load(latex);
|
42 |
+
}
|
43 |
+
|
44 |
+
catch(err)
|
45 |
+
{
|
46 |
+
alert(err.message);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
popupEqnwin.document.getElementById("latex_formula").focus();
|
50 |
+
popupEqnwin.document.getElementById("latex_formula").select();
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
});
|
55 |
+
|
56 |
+
ed.addButton('equation', {
|
57 |
+
//title: 'Equation Editor',
|
58 |
+
title: ed.getLang('equation.title'),
|
59 |
+
//image: url + '/img/equation.gif',
|
60 |
+
cmd: 'equationCommand' });
|
61 |
+
|
62 |
+
ed.onDblClick.add(function(ed, e) {
|
63 |
+
if (e.target.nodeName.toLowerCase() == "img") {
|
64 |
+
var sName = e.target.src.match( /http:\/\/(latex.codecogs.com)\/(gif|svg)\.latex\?(.*)/ );
|
65 |
+
|
66 |
+
if(sName[1]=='latex.codecogs.com')
|
67 |
+
tinymce.execCommand('equationCommand', false, sName[3]);
|
68 |
+
}
|
69 |
+
});
|
70 |
+
|
71 |
+
},
|
72 |
+
|
73 |
+
createControl : function(n, cm) { return null; }
|
74 |
+
});
|
75 |
+
|
76 |
+
tinymce.PluginManager.add('equation', tinymce.plugins.EquationPlugin);
|
77 |
+
})();
|
78 |
+
|
79 |
+
|
80 |
+
// Add a new placeholder at the actual selection.
|
81 |
+
TinyMCE_Add = function( name )
|
82 |
+
{
|
83 |
+
var sName = name.match( /(gif|svg)\.latex\?(.*)/ );
|
84 |
+
var latex= unescape(sName[2]);
|
85 |
+
latex = latex.replace(/@plus;/g,'+');
|
86 |
+
latex = latex.replace(/+/g,'+');
|
87 |
+
latex = latex.replace(/&space;/g,' ');
|
88 |
+
|
89 |
+
tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<img src="'+name+'" alt="'+latex+'" align="absmiddle" />');
|
90 |
+
tinyMCE.execCommand('mceFocus', false, tinymce.activeEditor.editorId);
|
91 |
+
};
|
addons/equation/img/Thumbs.db
ADDED
Binary file
|
addons/equation/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="equation.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/equation/img/equation.gif
ADDED
Binary file
|
addons/ezimage/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186907208025079" remote="130186870800000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186907040502162" remote="130186870800000000" Dst="2" />
|
5 |
+
<file name="ezimage.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/ezimage/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="ezimage.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/ezimage/css/ezimage.css
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB */
|
2 |
+
|
3 |
+
html {margin: 0px; height: 100%}
|
4 |
+
body {margin: 10px 10px 0px 10px; border: none}
|
5 |
+
html, body {padding:0; overflow: hidden}
|
6 |
+
|
7 |
+
a:link, a:visited {color: #0000FF}
|
8 |
+
a:hover, a:active, a:focus {color: #000086}
|
9 |
+
|
10 |
+
p {margin: 0px 0px 10px 0px}
|
11 |
+
|
12 |
+
table {border: none; margin: 0px; text-align: center; font: 8pt}
|
13 |
+
tr {vertical-align: top}
|
14 |
+
td {margin: 0px; padding: 0px; text-align: left; vertical-align: top}
|
15 |
+
|
16 |
+
input[type=radio], input[type=checkbox] {vertical-align: middle; height: 19px; margin: 1px 0px 0px 0px}
|
17 |
+
label {position:relative; left: 2px; top: -1px; margin: 0px}
|
18 |
+
|
19 |
+
.mceActionPanel {margin-top: 10px}
|
20 |
+
.fleft {float: left}
|
21 |
+
.fright {float: right}
|
22 |
+
|
23 |
+
#aboutcmd {font-size: 8pt; text-align: right; color: #0000FF; text-decoration: underline; cursor: pointer}
|
24 |
+
#aboutbox {z-index: 50; position: absolute; top: 2px; left: 40px; border: 1px solid #003333; background: #FFFFFF;
|
25 |
+
padding: 7px; color: #003333; display: none; width: 365px; cursor: pointer}
|
26 |
+
#src {width: 396px}
|
27 |
+
|
28 |
+
#txt, #alt, #width {width: 220px; position: relative; top: 2px}
|
29 |
+
#altlabel {margin-left: 10px}
|
30 |
+
#width {width: 50px}
|
31 |
+
|
32 |
+
#posleft, #poscenter, #posright {position: relative; top: -2px}
|
33 |
+
#txtastitle, #txtascaption, #altastxt, #popimg, #posleft, #poscenter, #posright, #automarg
|
34 |
+
{border: none; background: #F0F0EE; margin: 0px 0px 0px 2px; vertical-align: middle; text-align: left}
|
35 |
+
|
36 |
+
#popimg {position: relative; left: 0px}
|
37 |
+
#pophlp {display: none; font-size: 8pt; font-variant: small-caps; float: right; color: #999999; margin: 0px 2px 0px 0px}
|
38 |
+
|
39 |
+
#margtop, #margleft, #margright, #margbottom, #margaxe {text-align: center; position: relative}
|
40 |
+
#margtop, #margleft, #margright, #margbottom {left: -15px}
|
41 |
+
#margaxe {background: gray; left: -15px}
|
42 |
+
#automarg {position: relative}
|
43 |
+
|
44 |
+
#prevlabel {font-variant: small-caps; float: left}
|
45 |
+
#prev {margin: 0px; padding: 5px; border: 1px solid #000; width: 428px; height: 163px; overflow: auto; top: -20px}
|
46 |
+
#prevmsg {margin: 0px; padding: 0px; width: 428px; top: -20px; text-align: center;
|
47 |
+
color: #808080; font: 8pt "Sans Serif"; visibility: hidden}
|
48 |
+
#prevcmd {border:0px; margin:0px; padding:0px; width:94px; height:26px; cursor:pointer; padding-bottom:2px;
|
49 |
+
font-weight:bold; background:url(../../../themes/advanced/skins/default/img/buttons.png) 0px -26px}
|
50 |
+
|
51 |
+
#org {visibility: hidden; position: absolute; top: 3px; left: 3px}
|
addons/ezimage/editor_plugin.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
// (this file will be the only one compressed (same filename w/o "_src") since it participates to the TinyMCE load-time)
|
3 |
+
|
4 |
+
(function() {
|
5 |
+
// Load plugin specific language pack
|
6 |
+
//tinymce.PluginManager.requireLangPack('ezimage');
|
7 |
+
|
8 |
+
tinymce.create('tinymce.plugins.ezimagePlugin', {
|
9 |
+
/**
|
10 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
11 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
12 |
+
* of the editor instance to intercept that event.
|
13 |
+
*
|
14 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
15 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
16 |
+
*/
|
17 |
+
init : function(ed, url) {
|
18 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceezimage');
|
19 |
+
ed.addCommand('mceezimage', function() {
|
20 |
+
ed.windowManager.open({
|
21 |
+
file : url + '/ezimage.htm',
|
22 |
+
width : 460 + parseInt(ed.getLang('ezimage.delta_width', 0)),
|
23 |
+
height : 450 + parseInt(ed.getLang('ezimage.delta_height', 0)),
|
24 |
+
inline : 1
|
25 |
+
}, {
|
26 |
+
plugin_url : url // Plugin absolute URL
|
27 |
+
//some_custom_arg : 'custom arg' // Custom argument
|
28 |
+
});
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register ezimage button
|
32 |
+
ed.addButton('ezimage', {
|
33 |
+
title : ed.getLang('ezimage.desc'),
|
34 |
+
cmd : 'mceezimage',
|
35 |
+
//image : url + '/img/ezimage.gif'
|
36 |
+
});
|
37 |
+
|
38 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
39 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
40 |
+
cm.setActive('ezimage', n.nodeName == 'IMG');
|
41 |
+
});
|
42 |
+
},
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Creates control instances based in the incomming name. This method is normally not
|
46 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
47 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
48 |
+
* method can be used to create those.
|
49 |
+
*
|
50 |
+
* @param {String} n Name of the control to create.
|
51 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
52 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
53 |
+
*/
|
54 |
+
createControl : function(n, cm) {
|
55 |
+
return null;
|
56 |
+
},
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Returns information about the plugin as a name/value array.
|
60 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
61 |
+
*
|
62 |
+
* @return {Object} Name/value array containing information about the plugin.
|
63 |
+
*/
|
64 |
+
getInfo : function() {
|
65 |
+
return {
|
66 |
+
longname : 'ezimage plugin',
|
67 |
+
author : 'FFh Lab / Eric Lequien',
|
68 |
+
authorurl : 'http://ffh-lab.com',
|
69 |
+
infourl : 'http://ffh-lab.com/ezimage.html',
|
70 |
+
version : "1.0"
|
71 |
+
};
|
72 |
+
}
|
73 |
+
});
|
74 |
+
|
75 |
+
// Register plugin
|
76 |
+
tinymce.PluginManager.add('ezimage', tinymce.plugins.ezimagePlugin);
|
77 |
+
})();
|
addons/ezimage/editor_plugin_src.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
// (this file will be the only one compressed (same filename w/o "_src") since it participates to the TinyMCE load-time)
|
3 |
+
|
4 |
+
(function() {
|
5 |
+
// Load plugin specific language pack
|
6 |
+
//tinymce.PluginManager.requireLangPack('ezimage');
|
7 |
+
|
8 |
+
tinymce.create('tinymce.plugins.ezimagePlugin', {
|
9 |
+
/**
|
10 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
11 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
12 |
+
* of the editor instance to intercept that event.
|
13 |
+
*
|
14 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
15 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
16 |
+
*/
|
17 |
+
init : function(ed, url) {
|
18 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceezimage');
|
19 |
+
ed.addCommand('mceezimage', function() {
|
20 |
+
ed.windowManager.open({
|
21 |
+
file : url + '/ezimage.htm',
|
22 |
+
width : 460 + parseInt(ed.getLang('ezimage.delta_width', 0)),
|
23 |
+
height : 450 + parseInt(ed.getLang('ezimage.delta_height', 0)),
|
24 |
+
inline : 1
|
25 |
+
}, {
|
26 |
+
plugin_url : url // Plugin absolute URL
|
27 |
+
//some_custom_arg : 'custom arg' // Custom argument
|
28 |
+
});
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register ezimage button
|
32 |
+
ed.addButton('ezimage', {
|
33 |
+
title : ed.getLang('ezimage.desc'),
|
34 |
+
cmd : 'mceezimage',
|
35 |
+
//image : url + '/img/ezimage.gif'
|
36 |
+
});
|
37 |
+
|
38 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
39 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
40 |
+
cm.setActive('ezimage', n.nodeName == 'IMG');
|
41 |
+
});
|
42 |
+
},
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Creates control instances based in the incomming name. This method is normally not
|
46 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
47 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
48 |
+
* method can be used to create those.
|
49 |
+
*
|
50 |
+
* @param {String} n Name of the control to create.
|
51 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
52 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
53 |
+
*/
|
54 |
+
createControl : function(n, cm) {
|
55 |
+
return null;
|
56 |
+
},
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Returns information about the plugin as a name/value array.
|
60 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
61 |
+
*
|
62 |
+
* @return {Object} Name/value array containing information about the plugin.
|
63 |
+
*/
|
64 |
+
getInfo : function() {
|
65 |
+
return {
|
66 |
+
longname : 'ezimage plugin',
|
67 |
+
author : 'FFh Lab / Eric Lequien',
|
68 |
+
authorurl : 'http://ffh-lab.com',
|
69 |
+
infourl : 'http://ffh-lab.com/ezimage.html',
|
70 |
+
version : "1.0"
|
71 |
+
};
|
72 |
+
}
|
73 |
+
});
|
74 |
+
|
75 |
+
// Register plugin
|
76 |
+
tinymce.PluginManager.add('ezimage', tinymce.plugins.ezimagePlugin);
|
77 |
+
})();
|
addons/ezimage/ezimage.htm
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml"> <!-- Transitional to be compliant to W3C specs in spite of <a>:target attribute -->
|
3 |
+
|
4 |
+
<!-- Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB -->
|
5 |
+
|
6 |
+
<head>
|
7 |
+
<meta http-equiv="Content-Type" content="text/html" />
|
8 |
+
<title>{#ezimage_dlg.title}</title>
|
9 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
10 |
+
<script type="text/javascript" src="js/ezimage.js"></script>
|
11 |
+
<link href="css/ezimage.css" rel="stylesheet" type="text/css" />
|
12 |
+
</head>
|
13 |
+
<body>
|
14 |
+
|
15 |
+
<form action="#">
|
16 |
+
<p id="aboutcmd" onclick="display('aboutbox','block');">{#ezimage_dlg.about}</p>
|
17 |
+
<div id="aboutbox" onclick="display(this.id,'none');">
|
18 |
+
EasyImage plugin 1.0 (c) <a href="http://ffh-lab.com/" target="_blank">FFh Lab</a> / Eric Lequien, 2009-2012
|
19 |
+
<br />for TinyMCE 3.x (c) <a href="http://tinymce.moxiecode.com/" target="_blank">Moxiecode Systems AB</a>, 2003-2012
|
20 |
+
<hr />{#ezimage_dlg.legal}</div>
|
21 |
+
|
22 |
+
<p>{#ezimage_dlg.src} : <input id="src" name="src" type="text" class="text" onchange="showPrev();" /></p>
|
23 |
+
|
24 |
+
<p>{#ezimage_dlg.txt} : <input id="txt" name="txt" type="text" class="text" onchange="showPrev();" />
|
25 |
+
<input id="txtastitle" name="opttxt" type="radio" value="title" /><label for="txtastitle">{#ezimage_dlg.txtastitle}</label>
|
26 |
+
<input checked="checked" id="txtascaption" name="opttxt" type="radio" value="caption" /><label for"txtascaption">{#ezimage_dlg.txtascaption}</label>
|
27 |
+
<br /><span id="altlabel">{#ezimage_dlg.alt} : </span>
|
28 |
+
<input id="alt" name="alt" type="text" class="text" onchange="showPrev();" style="display: none" />
|
29 |
+
<input checked="checked" id="altastxt" name="altastxt" type="checkbox" value="altastxt"
|
30 |
+
onclick="adjustAltDisplay(); showPrev();" /><label for="altastxt">{#ezimage_dlg.altastxt}</label></p>
|
31 |
+
|
32 |
+
<p>{#ezimage_dlg.width} : <input id="width" name="width" type="text" class="text" maxlength="3" onchange="showPrev();" />
|
33 |
+
{#ezimage_dlg.popup}
|
34 |
+
: <input id="popimg" name="popimg" type="checkbox" value="popimg" onclick="showPrev();" /></p>
|
35 |
+
|
36 |
+
<table>
|
37 |
+
<tr>
|
38 |
+
<td>
|
39 |
+
<table id="position">
|
40 |
+
<tr><td rowspan="3">{#ezimage_dlg.align} :</td>
|
41 |
+
<td><input checked="checked" id="posleft" name="optpos" type="radio" value="left" onclick="setAutomargins(document.forms[0],true);showPrev();" /><label for="pos">{#ezimage_dlg.left}</label></td></tr>
|
42 |
+
<tr><td><input id="poscenter" name="optpos" type="radio" value="center" onclick="setAutomargins(document.forms[0],true);showPrev();" /><label for="poscenter">{#ezimage_dlg.center}</label></td></tr>
|
43 |
+
<tr><td><input id="posright" name="optpos" type="radio" value="right" onclick="setAutomargins(document.forms[0],true);showPrev();" /><label for="posright">{#ezimage_dlg.right}</label></td></tr>
|
44 |
+
</table>
|
45 |
+
</td>
|
46 |
+
<td> </td>
|
47 |
+
<td>
|
48 |
+
<table id="margins">
|
49 |
+
<tr><td rowspan="3">{#ezimage_dlg.margin} :</td>
|
50 |
+
<td></td>
|
51 |
+
<td><input id="margtop" name="margtop" type="text" class="text" maxlength="4" size="3" onchange="showPrev();" /></td>
|
52 |
+
<td></td></tr>
|
53 |
+
<tr><td><input id="margleft" name="margleft" type="text" class="text" maxlength="4" size="3" onchange="showPrev();" /></td>
|
54 |
+
<td><input id="margaxe" name="margaxe" type="text" size="3" readonly="readonly" /></td>
|
55 |
+
<td><input id="margright" name="margright" type="text" class="text" maxlength="4" size="3"
|
56 |
+
onchange="showPrev();" /></td></tr>
|
57 |
+
<tr><td></td>
|
58 |
+
<td><input id="margbottom" name="margbottom" type="text" class="text" maxlength="4" size="3"
|
59 |
+
onchange="showPrev();" /></td>
|
60 |
+
<td></td></tr>
|
61 |
+
</table>
|
62 |
+
</td>
|
63 |
+
<td><table id="automargins">
|
64 |
+
<tr><td>{#ezimage_dlg.automargin} :</td>
|
65 |
+
<td><input id="automarg" name="automarg" type="checkbox" value="automarg"
|
66 |
+
onclick="setAutomargins(document.forms[0],this.checked);showPrev();" /></td></tr>
|
67 |
+
</table>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
</table>
|
71 |
+
|
72 |
+
<div id="prevlabel">{#ezimage_dlg.preview}</div><div id="pophlp">{#ezimage_dlg.pophlp}</div>
|
73 |
+
<div id="prev"></div>
|
74 |
+
<div id="prevmsg">{#ezimage_dlg.prevmsg}</div>
|
75 |
+
|
76 |
+
<div id="org"></div>
|
77 |
+
|
78 |
+
<div class="mceActionPanel">
|
79 |
+
<div class="fleft">
|
80 |
+
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ezimageDialog.insert();" />
|
81 |
+
<input type="button" id="prevcmd" name="prevcmd" value="{#ezimage_dlg.prevcmd}" onclick="showPrev();" />
|
82 |
+
|
83 |
+
</div>
|
84 |
+
<div class="fright">
|
85 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /></div>
|
86 |
+
</div>
|
87 |
+
</form>
|
88 |
+
</body>
|
89 |
+
</html>
|
addons/ezimage/img/Thumbs.db
ADDED
Binary file
|
addons/ezimage/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="ezimage.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/ezimage/img/ezimage.gif
ADDED
Binary file
|
addons/ezimage/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="ezimage.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/ezimage/js/ezimage.js
ADDED
@@ -0,0 +1,583 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
|
3 |
+
tinyMCEPopup.requireLangPack();
|
4 |
+
|
5 |
+
define("MARGSTD", 5);
|
6 |
+
|
7 |
+
var ezimageDialog = {
|
8 |
+
init : function() {
|
9 |
+
// Get the actual property of the selected image if any
|
10 |
+
var f = document.forms[0];
|
11 |
+
var n = tinyMCEPopup.editor.selection.getNode();
|
12 |
+
|
13 |
+
tinyMCEPopup.resizeToInnerSize();
|
14 |
+
|
15 |
+
if (n.nodeName == 'IMG'){
|
16 |
+
f.src.value = n.src;
|
17 |
+
f.width.value = n.width;
|
18 |
+
getImagePos(n, f);
|
19 |
+
getImageMarg(n, f);
|
20 |
+
getAssociatedTexts(n, f);
|
21 |
+
getImagePopupState(n, f);
|
22 |
+
if (isAutomarginsCompat(f) == true)
|
23 |
+
setAutomargins(f, true);
|
24 |
+
} else
|
25 |
+
setAutomargins(f, true);
|
26 |
+
|
27 |
+
showPrev();
|
28 |
+
},
|
29 |
+
|
30 |
+
insert : function() {
|
31 |
+
// Insert the defined image or update the selected one
|
32 |
+
var ed = tinyMCEPopup.editor;
|
33 |
+
var n = ed.selection.getNode();
|
34 |
+
var f = document.forms[0];
|
35 |
+
|
36 |
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
37 |
+
|
38 |
+
if (f.src.value === ''){
|
39 |
+
if (n.nodeName == 'IMG'){
|
40 |
+
ed.dom.remove(n);
|
41 |
+
ed.execCommand('mceRepaint');}
|
42 |
+
} else {
|
43 |
+
if (n.nodeName != 'IMG'){
|
44 |
+
ed.execCommand('mceInsertContent', false, '<img id="_ezimage_tmp" />', {skip_undo : 1});
|
45 |
+
n = ed.getDoc().getElementById('_ezimage_tmp');
|
46 |
+
ed.dom.setAttrib('_ezimage_tmp', 'id', '');}
|
47 |
+
|
48 |
+
n.src = f.src.value;
|
49 |
+
n.width = f.width.value;
|
50 |
+
n.removeAttribute("height"); /* maintains w/h ratio */
|
51 |
+
applyImageMarg(f, n);
|
52 |
+
applyImagePos(f, n);
|
53 |
+
applyAssociatedTexts(f, ed.getDoc(), n);
|
54 |
+
applyImagePopup(f, ed.getDoc(), n);
|
55 |
+
}
|
56 |
+
|
57 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
58 |
+
tinyMCEPopup.close();
|
59 |
+
}
|
60 |
+
};
|
61 |
+
|
62 |
+
function define(name, value) {
|
63 |
+
// Defines a constant (const being not well implemented in all browsers)
|
64 |
+
// REF : v903.3016 from http://phpjs.org/functions/define
|
65 |
+
// (org. by Paulo Ricardo F. Santos, rev. by Andrea Giammarchi, revamp by Brett Zamir)
|
66 |
+
var defn, replace, script, that = this, d = this.window.document;
|
67 |
+
var toString = function (name, value) {
|
68 |
+
return 'const ' + name + '=' + (
|
69 |
+
/^(null|true|false|(\+|\-)?\d+(\.\d+)?)$/.test(value = String(value)) ? value : '"' + replace(value) + '"'
|
70 |
+
); };
|
71 |
+
try {
|
72 |
+
eval('const e=1');
|
73 |
+
replace = function (value){
|
74 |
+
var replace = {"\x08":"b", "\x0A":"\\n", "\x0B":"v", "\x0C":"f", "\x0D":"\\r", '"':'"', "\\":"\\"};
|
75 |
+
return value.replace(/\x08|[\x0A-\x0D]|"|\\/g, function(value){return "\\"+replace[value];});};
|
76 |
+
|
77 |
+
defn = function (name, value){
|
78 |
+
if (d.createElementNS) {
|
79 |
+
script = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
|
80 |
+
} else {script = d.createElement('script');}
|
81 |
+
|
82 |
+
script.type = 'text/javascript';
|
83 |
+
script.appendChild(d.createTextNode(toString(name, value)));
|
84 |
+
d.documentElement.appendChild(script);
|
85 |
+
d.documentElement.removeChild(script);};
|
86 |
+
} catch (e){
|
87 |
+
replace = function (value) {var replace = {"\x0A":"\\n", "\x0D":"\\r"};
|
88 |
+
return value.replace(/"/g, '""').replace(/\n|\r/g, function(value){return replace[value];});};
|
89 |
+
|
90 |
+
defn = (this.execScript ?
|
91 |
+
function (name, value){
|
92 |
+
that.execScript(toString(name, value), 'VBScript');
|
93 |
+
}:
|
94 |
+
function (name, value){
|
95 |
+
eval(toString(name, value).substring(6));
|
96 |
+
});
|
97 |
+
}
|
98 |
+
defn(name, value);
|
99 |
+
}
|
100 |
+
|
101 |
+
function Left(str, n){
|
102 |
+
// Extract the n first left chars of the given string
|
103 |
+
if (n <= 0)
|
104 |
+
return "";
|
105 |
+
else if (n > String(str).length)
|
106 |
+
return str;
|
107 |
+
else
|
108 |
+
return String(str).substring(0,n);
|
109 |
+
}
|
110 |
+
|
111 |
+
function Right(str, n){
|
112 |
+
// Extract the n last right chars of the given string
|
113 |
+
if (n <= 0)
|
114 |
+
return "";
|
115 |
+
else if (n > String(str).length)
|
116 |
+
return str;
|
117 |
+
else {
|
118 |
+
var iLen = String(str).length;
|
119 |
+
return String(str).substring(iLen, iLen - n);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
function isNumeric(s){
|
124 |
+
// Indique si une chaine est une valeur num�rique
|
125 |
+
var valid = "0123456789.";
|
126 |
+
var ret = true; var ch; var i;
|
127 |
+
|
128 |
+
for (i = 0 ; i < s.length && ret == true ; i++){
|
129 |
+
ch = s.charAt(i);
|
130 |
+
if (valid.indexOf(ch) == -1)
|
131 |
+
ret = false;}
|
132 |
+
return ret;}
|
133 |
+
|
134 |
+
function getRadio(r) {
|
135 |
+
// Indicate the checked value in a given radio buttons group
|
136 |
+
if(!r)return;
|
137 |
+
|
138 |
+
var l = r.length;
|
139 |
+
|
140 |
+
if(l == undefined)
|
141 |
+
if(r.checked)
|
142 |
+
return r.value;
|
143 |
+
else
|
144 |
+
return "";
|
145 |
+
|
146 |
+
for(var i = 0; i < l; i++){
|
147 |
+
if(r[i].checked){
|
148 |
+
return r[i].value;}}
|
149 |
+
|
150 |
+
return "";
|
151 |
+
}
|
152 |
+
|
153 |
+
function setRadio(r, val) {
|
154 |
+
// Select a button in a given radio buttons group (unckeck all if unexisting value)
|
155 |
+
if(!r) return;
|
156 |
+
|
157 |
+
var l = r.length;
|
158 |
+
|
159 |
+
if(l == undefined){
|
160 |
+
r.checked = (r.value == val.toString());
|
161 |
+
return;}
|
162 |
+
|
163 |
+
for(var i = 0; i < l; i++){
|
164 |
+
r[i].checked = false;
|
165 |
+
if(r[i].value == val.toString()){
|
166 |
+
r[i].checked = true;}}
|
167 |
+
}
|
168 |
+
|
169 |
+
function getFloat(n){
|
170 |
+
// Cross-browser way to retrieve float style value of given node
|
171 |
+
return (typeof n.style.cssFloat === 'string') ? n.style.cssFloat : n.style.styleFloat;
|
172 |
+
}
|
173 |
+
|
174 |
+
function setFloat(n, v){
|
175 |
+
// Cross-browser way to define float style value of given node
|
176 |
+
if (typeof n.style.cssFloat === 'string')
|
177 |
+
n.style.cssFloat = v;
|
178 |
+
else
|
179 |
+
n.style.styleFloat = v;
|
180 |
+
}
|
181 |
+
|
182 |
+
function getTxtInside(n){
|
183 |
+
// Cross-browser way to retrieve inner-text of given node
|
184 |
+
return (typeof n.innerText === 'string') ? n.innerText : n.textContent;
|
185 |
+
}
|
186 |
+
|
187 |
+
function setTxtInside(n, v){
|
188 |
+
// Cross-browser way to define inner-text of given node
|
189 |
+
if (typeof n.innerText === 'string')
|
190 |
+
n.innerText = v;
|
191 |
+
else
|
192 |
+
n.textContent = v;
|
193 |
+
}
|
194 |
+
|
195 |
+
function getImagePos(n, f){
|
196 |
+
// D�termine le style rassemblant style display/text-align/[margin] de centrage, propri�t� align et style float courants
|
197 |
+
// (priorit� : style float -> prop. align -> style display/text-align)
|
198 |
+
var pos = 'left'; /* default */
|
199 |
+
var flt = getFloat(n);
|
200 |
+
|
201 |
+
/* analyse d'une �ventuelle combinaison de style display/text-align existante */
|
202 |
+
if (n.style.display == 'block' && n.style.textAlign == 'center')
|
203 |
+
pos = 'center';
|
204 |
+
|
205 |
+
/* analyse d'�ventuelle propri�t� align existante (aspect vertical ignor�) */
|
206 |
+
if (n.align != 'undefined' && n.align != "")
|
207 |
+
pos = (n.align == 'right') ? 'right' : 'left';
|
208 |
+
|
209 |
+
/* analyse d'un �ventuel style float existant */
|
210 |
+
if (flt != "")
|
211 |
+
pos = (flt != 'none') ? flt : 'left';
|
212 |
+
|
213 |
+
/* renseignement des champs de bo�te */
|
214 |
+
setRadio(f.optpos, pos);
|
215 |
+
}
|
216 |
+
|
217 |
+
function getImageMarg(n, f){
|
218 |
+
// D�termine le style rassemblant propri�t�s [h|v]space et style margin[-*] courants
|
219 |
+
// (priorit� : style margin sur div wrapper -> style margin-* sur img -> style margin sur img -> prop. hspace/vspace)
|
220 |
+
var m; var mt; var mr; var mb; var ml;
|
221 |
+
var arr = new Array(); var i; var l; var p;
|
222 |
+
|
223 |
+
/* analyse d'eventuelles propri�t�s hspace & vspace existantes */
|
224 |
+
ml = (n.hspace != 'undefined') ? n.hspace : 0;
|
225 |
+
mr = (n.hspace != 'undefined') ? n.hspace : 0;
|
226 |
+
mt = (n.vspace != 'undefined') ? n.vspace : 0;
|
227 |
+
mb = (n.vspace != 'undefined') ? n.vspace : 0;
|
228 |
+
|
229 |
+
/* analyse d'un �ventuel style margin global existant */
|
230 |
+
if (n.style.margin != ""){
|
231 |
+
arr = n.style.margin.split(" ", 4);
|
232 |
+
l = arr.length;
|
233 |
+
|
234 |
+
if (l == 1)
|
235 |
+
mt = mr = mb = ml = arr[0];
|
236 |
+
else if (l == 2){
|
237 |
+
mt = mb = arr[0];
|
238 |
+
mr = ml = arr[1];}
|
239 |
+
else if (l == 3){
|
240 |
+
mt = arr[0];
|
241 |
+
mr = ml = arr[1];
|
242 |
+
mb = arr[2];}
|
243 |
+
else{ // >= 4
|
244 |
+
mt = arr[0];
|
245 |
+
mr = arr[1];
|
246 |
+
mb = arr[2];
|
247 |
+
ml = arr[3];}}
|
248 |
+
|
249 |
+
/* analyse d'un �ventuel style en margin-* isol�s existant */
|
250 |
+
if (n.style.marginTop != ""){
|
251 |
+
mt = n.style.marginTop;}
|
252 |
+
if (n.style.marginRight != ""){
|
253 |
+
mr = n.style.marginRight;}
|
254 |
+
if (n.style.marginBottom != ""){
|
255 |
+
mb = n.style.marginBottom;}
|
256 |
+
if (n.style.marginLeft != ""){
|
257 |
+
ml = n.style.marginLeft;}
|
258 |
+
|
259 |
+
/* analyse d'un �ventuel style margin global existant sur un div wrapper */
|
260 |
+
if (n.parentNode.className == 'imgwrapper' && n.parentNode.style.margin != ""){
|
261 |
+
arr = n.parentNode.style.margin.split(" ", 4);
|
262 |
+
l = arr.length;
|
263 |
+
|
264 |
+
if (l == 1)
|
265 |
+
mt = mr = mb = ml = arr[0];
|
266 |
+
else if (l == 2){
|
267 |
+
mt = mb = arr[0];
|
268 |
+
mr = ml = arr[1];}
|
269 |
+
else if (l == 3){
|
270 |
+
mt = arr[0];
|
271 |
+
mr = ml = arr[1];
|
272 |
+
mb = arr[2];}
|
273 |
+
else{ // >= 4
|
274 |
+
mt = arr[0];
|
275 |
+
mr = arr[1];
|
276 |
+
mb = arr[2];
|
277 |
+
ml = arr[3];}}
|
278 |
+
|
279 |
+
/* suppression d'une unit� �ventuelle (ie. 'px') */
|
280 |
+
if (Right(mt, 2) == 'px' && mt != 'auto')
|
281 |
+
mt = Left(mt, mt.length - 2);
|
282 |
+
if (Right(mr, 2) == 'px' && mr != 'auto')
|
283 |
+
mr = Left(mr, mr.length - 2);
|
284 |
+
if (Right(mb, 2) == 'px' && mb != 'auto')
|
285 |
+
mb = Left(mb, mb.length - 2);
|
286 |
+
if (Right(ml, 2) == 'px' && ml != 'auto')
|
287 |
+
ml = Left(ml, ml.length - 2);
|
288 |
+
|
289 |
+
/* renseignement des champs de bo�te */
|
290 |
+
f.margtop.value = mt;
|
291 |
+
f.margright.value = mr;
|
292 |
+
f.margbottom.value = mb;
|
293 |
+
f.margleft.value = ml;
|
294 |
+
}
|
295 |
+
|
296 |
+
function getAssociatedTexts(n, f){
|
297 |
+
// D�termine les textes associ�s � l'image et options aff�rentes
|
298 |
+
// knowing txt can comes from title or caption in parent-div, priority is given to caption (wich is more visible)
|
299 |
+
var alt = ""; var txt = "";
|
300 |
+
var opttxt = 'caption';
|
301 |
+
var altastxt;
|
302 |
+
|
303 |
+
/* analyse */
|
304 |
+
if (n.alt != 'undefined')
|
305 |
+
alt = n.alt;
|
306 |
+
|
307 |
+
if (n.title != 'undefined'){
|
308 |
+
txt = n.title;
|
309 |
+
if (n.title != "")
|
310 |
+
opttxt = 'title';}
|
311 |
+
|
312 |
+
if (n.parentNode.tagName.toLowerCase() == 'div'){
|
313 |
+
if (n.parentNode.className == 'imgwrapper'){
|
314 |
+
txt = getTxtInside(n.parentNode);
|
315 |
+
opttxt = 'caption';}}
|
316 |
+
|
317 |
+
altastxt = (alt == txt) ? true : false;
|
318 |
+
|
319 |
+
/* renseignement des champs de bo�te */
|
320 |
+
f.txt.value = txt;
|
321 |
+
setRadio(f.opttxt, opttxt);
|
322 |
+
|
323 |
+
f.alt.value = alt;
|
324 |
+
f.altastxt.checked = altastxt;
|
325 |
+
adjustAltDisplay();
|
326 |
+
}
|
327 |
+
|
328 |
+
function getImagePopupState(n, f){
|
329 |
+
// D�termine si l'image actuelle procure la fonctionnalit� de popup vers image originale
|
330 |
+
if (n.onclick)
|
331 |
+
f.popimg.checked = (n.onclick.toString().indexOf("window.open") != -1) ? true : false;
|
332 |
+
else
|
333 |
+
f.popimg.checked = false;
|
334 |
+
}
|
335 |
+
|
336 |
+
function isAutomarginsCompat(f){
|
337 |
+
// d�terminate if current margins match what automargins would be for current position
|
338 |
+
// (if margins are all zero, we consider it's compat, but caller has to call setAutomargin)
|
339 |
+
var pos = getRadio(f.optpos);
|
340 |
+
var mt = f.margtop.value;
|
341 |
+
var mr = f.margright.value;
|
342 |
+
var mb = f.margbottom.value;
|
343 |
+
var ml = f.margleft.value;
|
344 |
+
|
345 |
+
if (pos == 'left'){
|
346 |
+
if ((mt == 0 && mr == MARGSTD && mb == MARGSTD && ml == 0)
|
347 |
+
|| (mt == 0 && mr == 0 && mb == 0 && ml == 0)) return true;
|
348 |
+
} else if (pos == 'right'){
|
349 |
+
if ((mt == 0 && mr == 0 && mb == MARGSTD && ml == MARGSTD)
|
350 |
+
|| (mt == 0 && mr == 0 && mb == 0 && ml == 0)) return true;
|
351 |
+
} else { /* center */
|
352 |
+
if ((mt == MARGSTD && mr == 'auto' && mb == MARGSTD && ml == 'auto')
|
353 |
+
|| (mt == 0 && mr == 0 && mb == 0 && ml == 0)) return true;}
|
354 |
+
|
355 |
+
return false;
|
356 |
+
}
|
357 |
+
|
358 |
+
function setAutomargins(f, op){
|
359 |
+
// ON/OFF automargins ; d�terminate and apply right automargins for current position when op:true
|
360 |
+
// (forced ON at every pos* option change ; ie. click on a pos* radio button)
|
361 |
+
var pos = getRadio(f.optpos);
|
362 |
+
|
363 |
+
if (op == true){
|
364 |
+
if (f.automarg.checked == false) f.automarg.checked = true; /* check if not done */
|
365 |
+
f.margtop.setAttribute("readOnly", "readonly");
|
366 |
+
f.margright.setAttribute("readOnly", "readonly");
|
367 |
+
f.margbottom.setAttribute("readOnly", "readonly");
|
368 |
+
f.margleft.setAttribute("readOnly", "readonly");
|
369 |
+
f.margtop.style.background = "#C0C0C0";
|
370 |
+
f.margright.style.background = "#C0C0C0";
|
371 |
+
f.margbottom.style.background = "#C0C0C0";
|
372 |
+
f.margleft.style.background = "#C0C0C0";
|
373 |
+
|
374 |
+
if (pos == 'left'){
|
375 |
+
f.margtop.value = f.margleft.value = 0;
|
376 |
+
f.margright.value = f.margbottom.value = MARGSTD;
|
377 |
+
} else if (pos == 'right'){
|
378 |
+
f.margtop.value = f.margright.value = 0;
|
379 |
+
f.margleft.value = f.margbottom.value = MARGSTD;
|
380 |
+
} else { /* center */
|
381 |
+
f.margtop.value = f.margbottom.value = MARGSTD;
|
382 |
+
f.margleft.value = f.margright.value = 'auto';}
|
383 |
+
} else {
|
384 |
+
if (f.automarg.checked == true) f.automarg.checked = false; /* unchecked if necessary */
|
385 |
+
f.margtop.removeAttribute("readOnly");
|
386 |
+
f.margright.removeAttribute("readOnly");
|
387 |
+
f.margbottom.removeAttribute("readOnly");
|
388 |
+
f.margleft.removeAttribute("readOnly");
|
389 |
+
f.margtop.style.background = "#FFFFFF";
|
390 |
+
f.margright.style.background = "#FFFFFF";
|
391 |
+
f.margbottom.style.background = "#FFFFFF";
|
392 |
+
f.margleft.style.background = "#FFFFFF";}
|
393 |
+
}
|
394 |
+
|
395 |
+
function applyImagePos(f, n){
|
396 |
+
// Application effective de la position choisie pour l'image
|
397 |
+
var pos = getRadio(f.optpos);
|
398 |
+
|
399 |
+
/* reset */
|
400 |
+
if (n.align != 'undefined') n.removeAttribute("align");
|
401 |
+
if (getFloat(n) != "") setFloat(n, "");
|
402 |
+
if (n.style.display != "") n.style.display = "";
|
403 |
+
if (n.style.textAlign != "") n.style.textAlign = "";
|
404 |
+
|
405 |
+
/* apply */
|
406 |
+
if (pos == 'left' || pos == 'right'){
|
407 |
+
tinyMCEPopup.editor.dom.setStyle(n, 'float', pos);
|
408 |
+
} else { /* center */
|
409 |
+
tinyMCEPopup.editor.dom.setStyle(n, 'display', 'block');
|
410 |
+
tinyMCEPopup.editor.dom.setStyle(n, 'text-align', 'center');}
|
411 |
+
}
|
412 |
+
|
413 |
+
function applyImageMarg(f, n){
|
414 |
+
// Application effective des marges choisies pour l'image
|
415 |
+
|
416 |
+
/* reset */
|
417 |
+
if (n.hspace != 'undefined') n.removeAttribute("hspace");
|
418 |
+
if (n.vspace != 'undefined') n.removeAttribute("vspace");
|
419 |
+
if (n.style.margin != "") n.style.margin = "";
|
420 |
+
if (n.style.marginTop != "") n.style.marginTop = "";
|
421 |
+
if (n.style.marginRight != "") n.style.marginRight = "";
|
422 |
+
if (n.style.marginBottom != "") n.style.marginBottom = "";
|
423 |
+
if (n.style.marginLeft != "") n.style.marginLeft = "";
|
424 |
+
|
425 |
+
/* concat�ne */
|
426 |
+
mt = (isNumeric(f.margtop.value) == true) ? f.margtop.value + "px" : f.margtop.value;
|
427 |
+
mr = (isNumeric(f.margright.value) == true) ? f.margright.value + "px" : f.margright.value;
|
428 |
+
mb = (isNumeric(f.margbottom.value) == true) ? f.margbottom.value + "px" : f.margbottom.value;
|
429 |
+
ml = (isNumeric(f.margleft.value) == true) ? f.margleft.value + "px" : f.margleft.value;
|
430 |
+
|
431 |
+
m = mt + " " + mr + " " + mb + " " + ml;
|
432 |
+
|
433 |
+
/* apply */
|
434 |
+
tinyMCEPopup.editor.dom.setStyle(n, 'margin', m);
|
435 |
+
}
|
436 |
+
|
437 |
+
function adjustAltDisplay(){
|
438 |
+
// Called on every onclick event on altastxt checkbox
|
439 |
+
var op = (document.forms[0].altastxt.checked == true) ? 'none' : 'inline';
|
440 |
+
display('alt', op);
|
441 |
+
}
|
442 |
+
|
443 |
+
function applyAssociatedTexts(f, doc, n){
|
444 |
+
// Application effective de la l�gende (attention, 'doc' doit �tre celui contenant 'n')
|
445 |
+
var ed = tinyMCEPopup.editor;
|
446 |
+
var flt = getFloat(n);
|
447 |
+
var wrapper; var bwrapped = false;
|
448 |
+
var caption;
|
449 |
+
|
450 |
+
/* reset & apply alt/title */
|
451 |
+
if (n.alt != 'undefined') n.removeAttribute("alt");
|
452 |
+
if (n.title != 'undefined') n.removeAttribute("title");
|
453 |
+
|
454 |
+
if (f.altastxt.checked == true){
|
455 |
+
if (f.txt.value != "")
|
456 |
+
n.alt = f.txt.value;
|
457 |
+
} else {
|
458 |
+
if (f.alt.value != "")
|
459 |
+
n.alt = f.alt.value;}
|
460 |
+
|
461 |
+
if (f.txt.value != "" && getRadio(f.opttxt) == 'title')
|
462 |
+
n.title = f.txt.value;
|
463 |
+
|
464 |
+
/* reset & apply caption */
|
465 |
+
if (n.parentNode.className == 'imgwrapper'){
|
466 |
+
if (getRadio(f.opttxt) != 'caption' || (getRadio(f.opttxt) == 'caption' && f.txt.value == "")){
|
467 |
+
ed.dom.setStyle(n, 'margin', n.parentNode.style.margin);
|
468 |
+
ed.dom.setOuterHTML(n.parentNode, n.outerHTML);
|
469 |
+
} else {
|
470 |
+
bwrapped = true;}}
|
471 |
+
|
472 |
+
if (f.txt.value != "" && getRadio(f.opttxt) == 'caption'){
|
473 |
+
var margin = n.style.margin;
|
474 |
+
ed.dom.setStyle(n, 'margin', "");
|
475 |
+
|
476 |
+
if (bwrapped == false){
|
477 |
+
wrapper = doc.createElement("div");
|
478 |
+
wrapper.className = 'imgwrapper';
|
479 |
+
n.parentNode.replaceChild(wrapper, n);
|
480 |
+
} else {
|
481 |
+
wrapper = n.parentNode;
|
482 |
+
wrapper.innerHTML = "";}
|
483 |
+
|
484 |
+
wrapper.appendChild(n);
|
485 |
+
caption = doc.createTextNode(f.txt.value);
|
486 |
+
wrapper.appendChild(caption);
|
487 |
+
|
488 |
+
ed.dom.setStyle(wrapper, 'width', n.width);
|
489 |
+
ed.dom.setStyle(wrapper, 'text-align', 'center');
|
490 |
+
|
491 |
+
ed.dom.setStyle(wrapper, 'float', flt);
|
492 |
+
ed.dom.setStyle(wrapper, 'margin', margin);}
|
493 |
+
}
|
494 |
+
|
495 |
+
function applyImagePopup(f, doc, n){
|
496 |
+
// Mise en place effective ou annulation de la fonctionnalit� de popup vers image en taille originale
|
497 |
+
if (f.popimg.checked == true){
|
498 |
+
var ed = tinyMCEPopup.editor;
|
499 |
+
var u = f.src.value;
|
500 |
+
var w; var h; var wmax; var hmax;
|
501 |
+
var wimg; var himg;
|
502 |
+
var wmarg = 20; var hmarg = 25;
|
503 |
+
var scroll = 0; var wscroll = 17; var hscroll = 22;
|
504 |
+
|
505 |
+
/* compute dimensions */
|
506 |
+
setImageOrg(f);
|
507 |
+
wimg = f._ezimage_org.width;
|
508 |
+
himg = f._ezimage_org.height;
|
509 |
+
wmax = screen.availWidth;
|
510 |
+
hmax = screen.availHeight;
|
511 |
+
w = (wimg + wmarg <= wmax) ? wimg + wmarg : wmax;
|
512 |
+
h = (himg + hmarg <= hmax) ? himg + hmarg : hmax;
|
513 |
+
if (h == hmax){scroll = 1; w += wscroll;}
|
514 |
+
if (w == wmax){scroll = 1; h += hscroll;}
|
515 |
+
if (h > hmax) h = hmax;
|
516 |
+
if (w > wmax) w = wmax;
|
517 |
+
|
518 |
+
/* apply */
|
519 |
+
if (doc == document) /* to dialog preview */
|
520 |
+
tinymce.dom.Event.add(n, 'click', function(e){window.open(u, 'pop', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=' + scroll + ', copyhistory=0, resizable=1, width=' + w + ', height=' + h + ', left=0, top=0'); if((navigator.appName=='Microsoft Internet Explorer' && navigator.appVersion.substring(0,3)=='4.0')==false) pop.focus();});
|
521 |
+
else /* to editor content */
|
522 |
+
ed.dom.setAttrib(n, "onclick", "window.open('" + u + "', 'pop', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=" + scroll + ", copyhistory=0, resizable=1, width=" + w + ", height=" + h + ", left=0, top=0'); if((navigator.appName=='Microsoft Internet Explorer' && navigator.appVersion.substring(0,3)=='4.0')==false) pop.focus();");
|
523 |
+
|
524 |
+
ed.dom.setStyle(n, "cursor", "pointer");
|
525 |
+
} else {
|
526 |
+
n.style.cursor = "";
|
527 |
+
n.removeAttribute("onclick");
|
528 |
+
tinymce.dom.Event.remove(n, 'click');}
|
529 |
+
}
|
530 |
+
|
531 |
+
function setImageOrg(f){
|
532 |
+
// Installe l'image originale en r�f�rence dans un div en masqu� (utile aux calcul de dimensions)
|
533 |
+
tinyMCEPopup.dom.setHTML('org', "<img id='_ezimage_org' src='" + f.src.value + "' border='0' />");
|
534 |
+
}
|
535 |
+
|
536 |
+
function showPrev(){
|
537 |
+
// Met � jour l'aper�u (et ajuste la taille si elle est � z�ro ou ind�finie)
|
538 |
+
var i; var itag;
|
539 |
+
var f = document.forms[0];
|
540 |
+
var ed = tinyMCEPopup.editor;
|
541 |
+
var n = ed.selection.getNode();
|
542 |
+
|
543 |
+
var u = f.src.value;
|
544 |
+
var w = f.width.value;
|
545 |
+
var b = (n.border) ? n.border : 0;
|
546 |
+
|
547 |
+
var t = "<font color='#808080'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id sapien odio, feugiat elementum mi. Quisque semper sem ut eros mattis pulvinar. Nulla facilisi. Ut pellentesque, arcu accumsan lobortis interdum, felis quam elementum enim, eget iaculis libero neque nec libero. Nunc nisi leo, ullamcorper nec malesuada aliquam, pretium quis enim. Phasellus et varius tortor. Sed sit amet mauris tellus, vitae venenatis arcu. Praesent tristique molestie vulputate. Etiam non neque sed leo bibendum mattis nec nec lectus. In molestie, felis tristique purus dictum est.</font>";
|
548 |
+
|
549 |
+
if (!u){
|
550 |
+
tinyMCEPopup.dom.setHTML('prev', '');
|
551 |
+
return;}
|
552 |
+
|
553 |
+
setImageOrg(f);
|
554 |
+
if (!w || w <= 0){
|
555 |
+
f.width.value = f._ezimage_org.width;
|
556 |
+
w = f.width.value;}
|
557 |
+
|
558 |
+
itag = "<img id='_ezimage_prev' src='" + u + "' border='" + b + "' width='" + w + "' />";
|
559 |
+
tinyMCEPopup.dom.setHTML('prev', (w <= 350) ? itag + t : itag);
|
560 |
+
i = f._ezimage_prev;
|
561 |
+
|
562 |
+
if (w <= 350){
|
563 |
+
applyImageMarg(f, i);
|
564 |
+
applyImagePos(f, i);
|
565 |
+
applyAssociatedTexts(f, document, i);
|
566 |
+
display('prevmsg','hidden');
|
567 |
+
} else
|
568 |
+
display('prevmsg','visible');
|
569 |
+
|
570 |
+
applyImagePopup(f, document, i);
|
571 |
+
display('pophlp', (f.popimg.checked == true) ? 'inline' : 'none');
|
572 |
+
}
|
573 |
+
|
574 |
+
function display(id, op){
|
575 |
+
// Montre/cache un �l�ment du document courant
|
576 |
+
// (pour masquer en conservant l'emplacement, passer "hidden" plut�t que "none")
|
577 |
+
var elt = document.getElementById(id);
|
578 |
+
|
579 |
+
if (op != "hidden" && op != "visible") elt.style.display = op;
|
580 |
+
elt.style.visibility = (op == "none" || op == "hidden") ? "hidden" : "visible";
|
581 |
+
}
|
582 |
+
|
583 |
+
tinyMCEPopup.onInit.add(ezimageDialog.init, ezimageDialog);
|
addons/ezimage/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="fr.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="fr_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
</dwsync>
|
addons/ezimage/langs/en.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
|
3 |
+
tinyMCE.addI18n('en.ezimage',{
|
4 |
+
desc : 'Insert / edit an image'
|
5 |
+
});
|
addons/ezimage/langs/en_dlg.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
|
3 |
+
tinyMCE.addI18n('en.ezimage_dlg',{
|
4 |
+
title : 'Insert / edit an image',
|
5 |
+
src : 'URL',
|
6 |
+
width : 'Width (implicit height)',
|
7 |
+
margin : 'Margins',
|
8 |
+
automargin : 'Auto margins',
|
9 |
+
align : 'Alignment',
|
10 |
+
left : 'left',
|
11 |
+
center : 'center',
|
12 |
+
right : 'right',
|
13 |
+
txt : 'Text',
|
14 |
+
txtastitle : 'as tooltip',
|
15 |
+
txtascaption : 'as caption',
|
16 |
+
alt : 'Alt',
|
17 |
+
altastxt : 'same as above',
|
18 |
+
popup : 'Original in Popup',
|
19 |
+
pophlp : 'with clickable image',
|
20 |
+
preview : 'Preview',
|
21 |
+
prevmsg : 'No place for a real preview with agencement when image is too big',
|
22 |
+
prevcmd : 'Preview',
|
23 |
+
about : 'About...',
|
24 |
+
legal : 'This plugin is Freeware and Open-source (more infos in the PDF documentation delivered with the package)'
|
25 |
+
});
|
addons/ezimage/langs/fr.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
|
3 |
+
tinyMCE.addI18n('fr.ezimage',{
|
4 |
+
desc : 'Ins�rer / �diter une image'
|
5 |
+
});
|
addons/ezimage/langs/fr_dlg.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Easy Image plugin 1.0 (c) FFh Lab / Eric Lequien for TinyMCE 3.x+ (c) Moxiecode Systems AB
|
2 |
+
|
3 |
+
tinyMCE.addI18n('fr.ezimage_dlg',{
|
4 |
+
title : 'Ins�rer / �diter une image',
|
5 |
+
src : 'URL',
|
6 |
+
width : 'Largeur (hauteur implicite)',
|
7 |
+
margin : 'Marges',
|
8 |
+
automargin : 'Marges auto',
|
9 |
+
align : 'Alignement',
|
10 |
+
left : 'gauche',
|
11 |
+
center : 'centre',
|
12 |
+
right : 'droite',
|
13 |
+
txt : 'Texte',
|
14 |
+
txtastitle : 'en bulle',
|
15 |
+
txtascaption : 'en l�gende',
|
16 |
+
alt : ' Alt',
|
17 |
+
altastxt : 'comme ci-dessus',
|
18 |
+
popup : 'Original en Popup',
|
19 |
+
pophlp : 'avec image cliquable',
|
20 |
+
preview : 'Aper�u',
|
21 |
+
prevmsg : 'Pas de place pour r�el aper�u avec agencement sur image trop grande',
|
22 |
+
prevcmd : 'Aper�u',
|
23 |
+
about : 'A Propos...',
|
24 |
+
legal : 'Ce plugin est Freeware et Open-source (plus d\'infos dans la documentation PDF livr�e avec le package)'
|
25 |
+
});
|
addons/imgmap/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186913283618938" remote="130186876800000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186913324491364" remote="130186876800000000" Dst="2" />
|
5 |
+
<file name="popup.html" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/imgmap/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="imgmap.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/imgmap/css/imgmap.css
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FIELDSET {
|
3 |
+
margin: 0;
|
4 |
+
padding: 5px 5px;
|
5 |
+
}
|
6 |
+
|
7 |
+
LEGEND {
|
8 |
+
background-image: url(../images/bullet_green.gif);
|
9 |
+
background-repeat: no-repeat;
|
10 |
+
background-position: left center;
|
11 |
+
padding-left: 15px;
|
12 |
+
padding-right: 5px;
|
13 |
+
}
|
14 |
+
LEGEND A {
|
15 |
+
border: none!important;
|
16 |
+
text-decoration: none;
|
17 |
+
cursor: pointer;
|
18 |
+
}
|
19 |
+
|
20 |
+
.fieldset_off {
|
21 |
+
border-bottom: none;
|
22 |
+
border-right: none;
|
23 |
+
}
|
24 |
+
.fieldset_off LEGEND {
|
25 |
+
background-image: url(../images/bullet_orange.gif);
|
26 |
+
}
|
27 |
+
.fieldset_off DIV {
|
28 |
+
display: none;
|
29 |
+
}
|
30 |
+
|
31 |
+
.button1 {
|
32 |
+
padding-bottom: 2px;
|
33 |
+
border: 0pt none;
|
34 |
+
cursor: pointer;
|
35 |
+
font-weight: bold;
|
36 |
+
height: 21px;
|
37 |
+
width: 90px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.source_desc {
|
41 |
+
clear: left;
|
42 |
+
float: left;
|
43 |
+
width: 200px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.source_url {
|
47 |
+
float: left;
|
48 |
+
width: 250px;
|
49 |
+
height: 24px;
|
50 |
+
}
|
51 |
+
.source_url INPUT, .source_url SELECT {
|
52 |
+
font-size: 95%;
|
53 |
+
width: 240px;
|
54 |
+
padding: 0 0 0 1px;
|
55 |
+
}
|
56 |
+
|
57 |
+
A.source_accept {
|
58 |
+
display: block;
|
59 |
+
float: left;
|
60 |
+
padding-left: 18px;
|
61 |
+
color: #888888!important;
|
62 |
+
background-image: url(../images/accept.gif);
|
63 |
+
background-repeat: no-repeat;
|
64 |
+
background-position: left center;
|
65 |
+
font-size: 90%;
|
66 |
+
letter-spacing: -1px;
|
67 |
+
border: none!important;
|
68 |
+
}
|
69 |
+
A.source_accept:hover {
|
70 |
+
color: #333333!important;
|
71 |
+
}
|
72 |
+
|
73 |
+
#img_area_form {
|
74 |
+
margin: 5px 0px;
|
75 |
+
padding: 0;
|
76 |
+
border: 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
#form_container {
|
80 |
+
white-space: nowrap;
|
81 |
+
overflow: auto;
|
82 |
+
height: 88px;
|
83 |
+
border-top: solid 1px #bfc1c5;
|
84 |
+
}
|
85 |
+
|
86 |
+
#form_container INPUT, #form_container SELECT {
|
87 |
+
border: 1px solid black;
|
88 |
+
font-size: 10px;
|
89 |
+
margin: 0;
|
90 |
+
padding: 0 0 0 1px;
|
91 |
+
}
|
92 |
+
|
93 |
+
.img_area {
|
94 |
+
display: block;
|
95 |
+
vertical-align: middle;
|
96 |
+
line-height: 20px;
|
97 |
+
height: 20px;
|
98 |
+
}
|
99 |
+
|
100 |
+
.img_id {
|
101 |
+
font-weight: bold;
|
102 |
+
width: 25px;
|
103 |
+
padding: 0px 3px;
|
104 |
+
text-align: right;
|
105 |
+
border: none!important;
|
106 |
+
background: none;
|
107 |
+
}
|
108 |
+
.img_active {
|
109 |
+
border: none!important;
|
110 |
+
}
|
111 |
+
.img_coords {
|
112 |
+
width: 72px;
|
113 |
+
}
|
114 |
+
.img_href {
|
115 |
+
width: 82px;
|
116 |
+
}
|
117 |
+
.img_alt {
|
118 |
+
width: 82px;
|
119 |
+
}
|
120 |
+
.img_target {
|
121 |
+
width: 82px;
|
122 |
+
}
|
123 |
+
|
124 |
+
#pic_container {
|
125 |
+
position: relative;
|
126 |
+
width: 100%;
|
127 |
+
height: 300px;
|
128 |
+
border: solid 0px #efefef;
|
129 |
+
overflow: auto;
|
130 |
+
}
|
131 |
+
|
132 |
+
#pic_container .imgmap_label {
|
133 |
+
font: bold 10px Arial;
|
134 |
+
color: #100;
|
135 |
+
padding: 1px 2px;
|
136 |
+
}
|
137 |
+
|
138 |
+
#status_container {
|
139 |
+
font-weight: bold!important;
|
140 |
+
font-size: 90%;
|
141 |
+
color: #e95949;
|
142 |
+
width: 100%;
|
143 |
+
}
|
144 |
+
|
145 |
+
#button_container img {
|
146 |
+
margin: 0 1px;
|
147 |
+
cursor: pointer;
|
148 |
+
}
|
149 |
+
|
150 |
+
#fieldset_html {
|
151 |
+
text-align: left;
|
152 |
+
}
|
153 |
+
|
154 |
+
#html_container {
|
155 |
+
border: 1px solid black;
|
156 |
+
margin: 5px 0;
|
157 |
+
padding: 1px 0 0 1px;
|
158 |
+
height: 100px;
|
159 |
+
width: 100%;
|
160 |
+
}
|
addons/imgmap/editor_plugin.js
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
(function() {
|
4 |
+
//tinymce.PluginManager.requireLangPack('imgmap');
|
5 |
+
|
6 |
+
tinymce.create('tinymce.plugins.imgmapPlugin', {
|
7 |
+
init : function(ed, url) {
|
8 |
+
// Register commands
|
9 |
+
ed.addCommand('mceimgmapPopup', function() {
|
10 |
+
var e = ed.selection.getNode();
|
11 |
+
|
12 |
+
// Internal image object like a flash placeholder
|
13 |
+
if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
|
14 |
+
return;
|
15 |
+
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/popup.html',
|
18 |
+
width : 700,
|
19 |
+
height : 560,
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
//tinyMCE.getButtonHTML(cn, 'lang_imgmap_desc', '{$pluginurl}/images/tinymce_button.gif', 'mceimgmapPopup');
|
28 |
+
ed.addButton('imgmap', {
|
29 |
+
title : ed.getLang('imgmap.desc'),
|
30 |
+
cmd : 'mceimgmapPopup',
|
31 |
+
//image : url + '/images/tinymce_button.gif'
|
32 |
+
});
|
33 |
+
|
34 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
35 |
+
ed.onNodeChange.add(function(ed, cm, node) {
|
36 |
+
if (node == null)
|
37 |
+
return;
|
38 |
+
|
39 |
+
//check parents
|
40 |
+
//if image parent already has imagemap, toggle selected state, if simple image, use normal state
|
41 |
+
do {
|
42 |
+
//console.log(node.nodeName);
|
43 |
+
if (node.nodeName == "IMG" && ed.dom.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
44 |
+
if (ed.dom.getAttrib(node, 'usemap') != '') {
|
45 |
+
cm.setDisabled('imgmap', false);
|
46 |
+
cm.setActive('imgmap', true);
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
cm.setDisabled('imgmap', false);
|
50 |
+
cm.setActive('imgmap', false);
|
51 |
+
}
|
52 |
+
return true;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
while ((node = node.parentNode));
|
56 |
+
|
57 |
+
//button disabled by default
|
58 |
+
cm.setDisabled('imgmap', true);
|
59 |
+
cm.setActive('imgmap', false);
|
60 |
+
return true;
|
61 |
+
});
|
62 |
+
|
63 |
+
},
|
64 |
+
|
65 |
+
getInfo : function() {
|
66 |
+
return {
|
67 |
+
longname : 'Image Map Editor',
|
68 |
+
author : 'Adam Maschek, John Ericksen',
|
69 |
+
authorurl : 'http://imgmap.googlecode.com',
|
70 |
+
infourl : 'http://imgmap.googlecode.com',
|
71 |
+
version : "2.0"
|
72 |
+
};
|
73 |
+
}
|
74 |
+
});
|
75 |
+
|
76 |
+
// Register plugin
|
77 |
+
tinymce.PluginManager.add('imgmap', tinymce.plugins.imgmapPlugin);
|
78 |
+
})();
|
79 |
+
|
80 |
+
|
81 |
+
var TinyMCE_imgmapPlugin = {
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
86 |
+
switch (command) {
|
87 |
+
case "mceimgmapPopup":
|
88 |
+
var template = new Array();
|
89 |
+
template['file'] = '../../plugins/imgmap/popup.html';
|
90 |
+
template['width'] = 700;
|
91 |
+
template['height'] = 670;
|
92 |
+
|
93 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
94 |
+
var elm = inst.getFocusElement();
|
95 |
+
|
96 |
+
if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
|
97 |
+
return true;
|
98 |
+
|
99 |
+
tinyMCE.openWindow(template, {editor_id : editor_id, scrollbars : "yes", resizable: "yes"});
|
100 |
+
return true;
|
101 |
+
}
|
102 |
+
return false;
|
103 |
+
},
|
104 |
+
|
105 |
+
|
106 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
107 |
+
|
108 |
+
if (node == null)
|
109 |
+
return;
|
110 |
+
|
111 |
+
//check parents
|
112 |
+
//if image parent already has imagemap, toggle selected state, if simple image, use normal state
|
113 |
+
do {
|
114 |
+
//console.log(node.nodeName);
|
115 |
+
if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
116 |
+
if (tinyMCE.getAttrib(node, 'usemap') != '') {
|
117 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonSelected');
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonNormal');
|
121 |
+
}
|
122 |
+
return true;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
while ((node = node.parentNode));
|
126 |
+
|
127 |
+
//button disabled by default
|
128 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonDisabled');
|
129 |
+
return true;
|
130 |
+
}
|
131 |
+
|
132 |
+
};
|
133 |
+
|
134 |
+
//tinyMCE.addPlugin("imgmap", TinyMCE_imgmapPlugin);
|
135 |
+
//tinymce.PluginManager.add("imgmap", tinymce.plugins.imgmapPlugin);
|
addons/imgmap/editor_plugin_src.js
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
(function() {
|
4 |
+
//tinymce.PluginManager.requireLangPack('imgmap');
|
5 |
+
|
6 |
+
tinymce.create('tinymce.plugins.imgmapPlugin', {
|
7 |
+
init : function(ed, url) {
|
8 |
+
// Register commands
|
9 |
+
ed.addCommand('mceimgmapPopup', function() {
|
10 |
+
var e = ed.selection.getNode();
|
11 |
+
|
12 |
+
// Internal image object like a flash placeholder
|
13 |
+
if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
|
14 |
+
return;
|
15 |
+
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/popup.html',
|
18 |
+
width : 700,
|
19 |
+
height : 560,
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
//tinyMCE.getButtonHTML(cn, 'lang_imgmap_desc', '{$pluginurl}/images/tinymce_button.gif', 'mceimgmapPopup');
|
28 |
+
ed.addButton('imgmap', {
|
29 |
+
title : ed.getLang('imgmap.desc'),
|
30 |
+
cmd : 'mceimgmapPopup',
|
31 |
+
//image : url + '/images/tinymce_button.gif'
|
32 |
+
});
|
33 |
+
|
34 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
35 |
+
ed.onNodeChange.add(function(ed, cm, node) {
|
36 |
+
if (node == null)
|
37 |
+
return;
|
38 |
+
|
39 |
+
//check parents
|
40 |
+
//if image parent already has imagemap, toggle selected state, if simple image, use normal state
|
41 |
+
do {
|
42 |
+
//console.log(node.nodeName);
|
43 |
+
if (node.nodeName == "IMG" && ed.dom.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
44 |
+
if (ed.dom.getAttrib(node, 'usemap') != '') {
|
45 |
+
cm.setDisabled('imgmap', false);
|
46 |
+
cm.setActive('imgmap', true);
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
cm.setDisabled('imgmap', false);
|
50 |
+
cm.setActive('imgmap', false);
|
51 |
+
}
|
52 |
+
return true;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
while ((node = node.parentNode));
|
56 |
+
|
57 |
+
//button disabled by default
|
58 |
+
cm.setDisabled('imgmap', true);
|
59 |
+
cm.setActive('imgmap', false);
|
60 |
+
return true;
|
61 |
+
});
|
62 |
+
|
63 |
+
},
|
64 |
+
|
65 |
+
getInfo : function() {
|
66 |
+
return {
|
67 |
+
longname : 'Image Map Editor',
|
68 |
+
author : 'Adam Maschek, John Ericksen',
|
69 |
+
authorurl : 'http://imgmap.googlecode.com',
|
70 |
+
infourl : 'http://imgmap.googlecode.com',
|
71 |
+
version : "2.0"
|
72 |
+
};
|
73 |
+
}
|
74 |
+
});
|
75 |
+
|
76 |
+
// Register plugin
|
77 |
+
tinymce.PluginManager.add('imgmap', tinymce.plugins.imgmapPlugin);
|
78 |
+
})();
|
79 |
+
|
80 |
+
|
81 |
+
var TinyMCE_imgmapPlugin = {
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
86 |
+
switch (command) {
|
87 |
+
case "mceimgmapPopup":
|
88 |
+
var template = new Array();
|
89 |
+
template['file'] = '../../plugins/imgmap/popup.html';
|
90 |
+
template['width'] = 700;
|
91 |
+
template['height'] = 670;
|
92 |
+
|
93 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
94 |
+
var elm = inst.getFocusElement();
|
95 |
+
|
96 |
+
if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
|
97 |
+
return true;
|
98 |
+
|
99 |
+
tinyMCE.openWindow(template, {editor_id : editor_id, scrollbars : "yes", resizable: "yes"});
|
100 |
+
return true;
|
101 |
+
}
|
102 |
+
return false;
|
103 |
+
},
|
104 |
+
|
105 |
+
|
106 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
107 |
+
|
108 |
+
if (node == null)
|
109 |
+
return;
|
110 |
+
|
111 |
+
//check parents
|
112 |
+
//if image parent already has imagemap, toggle selected state, if simple image, use normal state
|
113 |
+
do {
|
114 |
+
//console.log(node.nodeName);
|
115 |
+
if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
116 |
+
if (tinyMCE.getAttrib(node, 'usemap') != '') {
|
117 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonSelected');
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonNormal');
|
121 |
+
}
|
122 |
+
return true;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
while ((node = node.parentNode));
|
126 |
+
|
127 |
+
//button disabled by default
|
128 |
+
tinyMCE.switchClass(editor_id + '_imgmap', 'mceButtonDisabled');
|
129 |
+
return true;
|
130 |
+
}
|
131 |
+
|
132 |
+
};
|
133 |
+
|
134 |
+
//tinyMCE.addPlugin("imgmap", TinyMCE_imgmapPlugin);
|
135 |
+
//tinymce.PluginManager.add("imgmap", tinymce.plugins.imgmapPlugin);
|
addons/imgmap/images/Thumbs.db
ADDED
Binary file
|
addons/imgmap/images/_notes/dwsync.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="accept.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="add.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="bullet_green.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="bullet_orange.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="clipboard.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="delete.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="edit.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="html.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="tinymce_button.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="zoom.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
</dwsync>
|
addons/imgmap/images/accept.gif
ADDED
Binary file
|
addons/imgmap/images/add.gif
ADDED
Binary file
|
addons/imgmap/images/bullet_green.gif
ADDED
Binary file
|
addons/imgmap/images/bullet_orange.gif
ADDED
Binary file
|
addons/imgmap/images/clipboard.gif
ADDED
Binary file
|
addons/imgmap/images/delete.gif
ADDED
Binary file
|
addons/imgmap/images/edit.gif
ADDED
Binary file
|
addons/imgmap/images/html.gif
ADDED
Binary file
|
addons/imgmap/images/tinymce_button.gif
ADDED
Binary file
|
addons/imgmap/images/zoom.gif
ADDED
Binary file
|
addons/imgmap/jscripts/_notes/dwsync.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="excanvas.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="functions.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="imgmap.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="imgmap_packed.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="lang_de.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="lang_en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="lang_es.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="lang_fr.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="lang_hu.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="lang_pt.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
</dwsync>
|
addons/imgmap/jscripts/excanvas.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if(!window.CanvasRenderingContext2D){(function(){var I=Math,i=I.round,L=I.sin,M=I.cos,m=10,A=m/2,Q={init:function(a){var b=a||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var c=this;b.attachEvent("onreadystatechange",function(){c.r(b)})}},r:function(a){if(a.readyState=="complete"){if(!a.namespaces["s"]){a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var b=a.createStyleSheet();b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";
|
2 |
+
var c=a.getElementsByTagName("canvas");for(var d=0;d<c.length;d++){if(!c[d].getContext){this.initElement(c[d])}}}},q:function(a){var b=a.outerHTML,c=a.ownerDocument.createElement(b);if(b.slice(-2)!="/>"){var d="/"+a.tagName,e;while((e=a.nextSibling)&&e.tagName!=d){e.removeNode()}if(e){e.removeNode()}}a.parentNode.replaceChild(c,a);return c},initElement:function(a){a=this.q(a);a.getContext=function(){if(this.l){return this.l}return this.l=new K(this)};a.attachEvent("onpropertychange",V);a.attachEvent("onresize",
|
3 |
+
W);var b=a.attributes;if(b.width&&b.width.specified){a.style.width=b.width.nodeValue+"px"}else{a.width=a.clientWidth}if(b.height&&b.height.specified){a.style.height=b.height.nodeValue+"px"}else{a.height=a.clientHeight}return a}};function V(a){var b=a.srcElement;switch(a.propertyName){case "width":b.style.width=b.attributes.width.nodeValue+"px";b.getContext().clearRect();break;case "height":b.style.height=b.attributes.height.nodeValue+"px";b.getContext().clearRect();break}}function W(a){var b=a.srcElement;
|
4 |
+
if(b.firstChild){b.firstChild.style.width=b.clientWidth+"px";b.firstChild.style.height=b.clientHeight+"px"}}Q.init();var R=[];for(var E=0;E<16;E++){for(var F=0;F<16;F++){R[E*16+F]=E.toString(16)+F.toString(16)}}function J(){return[[1,0,0],[0,1,0],[0,0,1]]}function G(a,b){var c=J();for(var d=0;d<3;d++){for(var e=0;e<3;e++){var g=0;for(var h=0;h<3;h++){g+=a[d][h]*b[h][e]}c[d][e]=g}}return c}function N(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=
|
5 |
+
a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.d=a.d;b.e=a.e}function O(a){var b,c=1;a=String(a);if(a.substring(0,3)=="rgb"){var d=a.indexOf("(",3),e=a.indexOf(")",d+1),g=a.substring(d+1,e).split(",");b="#";for(var h=0;h<3;h++){b+=R[Number(g[h])]}if(g.length==4&&a.substr(3,1)=="a"){c=g[3]}}else{b=a}return[b,c]}function S(a){switch(a){case "butt":return"flat";case "round":return"round";
|
6 |
+
case "square":default:return"square"}}function K(a){this.a=J();this.m=[];this.k=[];this.c=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=m*1;this.globalAlpha=1;this.canvas=a;var b=a.ownerDocument.createElement("div");b.style.width=a.clientWidth+"px";b.style.height=a.clientHeight+"px";b.style.overflow="hidden";b.style.position="absolute";a.appendChild(b);this.j=b;this.d=1;this.e=1}var j=K.prototype;j.clearRect=function(){this.j.innerHTML=
|
7 |
+
"";this.c=[]};j.beginPath=function(){this.c=[]};j.moveTo=function(a,b){this.c.push({type:"moveTo",x:a,y:b});this.f=a;this.g=b};j.lineTo=function(a,b){this.c.push({type:"lineTo",x:a,y:b});this.f=a;this.g=b};j.bezierCurveTo=function(a,b,c,d,e,g){this.c.push({type:"bezierCurveTo",cp1x:a,cp1y:b,cp2x:c,cp2y:d,x:e,y:g});this.f=e;this.g=g};j.quadraticCurveTo=function(a,b,c,d){var e=this.f+0.6666666666666666*(a-this.f),g=this.g+0.6666666666666666*(b-this.g),h=e+(c-this.f)/3,l=g+(d-this.g)/3;this.bezierCurveTo(e,
|
8 |
+
g,h,l,c,d)};j.arc=function(a,b,c,d,e,g){c*=m;var h=g?"at":"wa",l=a+M(d)*c-A,n=b+L(d)*c-A,o=a+M(e)*c-A,f=b+L(e)*c-A;if(l==o&&!g){l+=0.125}this.c.push({type:h,x:a,y:b,radius:c,xStart:l,yStart:n,xEnd:o,yEnd:f})};j.rect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath()};j.strokeRect=function(a,b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.stroke()};j.fillRect=function(a,
|
9 |
+
b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill()};j.createLinearGradient=function(a,b,c,d){var e=new H("gradient");return e};j.createRadialGradient=function(a,b,c,d,e,g){var h=new H("gradientradial");h.n=c;h.o=g;h.i.x=a;h.i.y=b;return h};j.drawImage=function(a,b){var c,d,e,g,h,l,n,o,f=a.runtimeStyle.width,k=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var q=a.width,r=a.height;a.runtimeStyle.width=
|
10 |
+
f;a.runtimeStyle.height=k;if(arguments.length==3){c=arguments[1];d=arguments[2];h=(l=0);n=(e=q);o=(g=r)}else if(arguments.length==5){c=arguments[1];d=arguments[2];e=arguments[3];g=arguments[4];h=(l=0);n=q;o=r}else if(arguments.length==9){h=arguments[1];l=arguments[2];n=arguments[3];o=arguments[4];c=arguments[5];d=arguments[6];e=arguments[7];g=arguments[8]}else{throw"Invalid number of arguments";}var s=this.b(c,d),t=[],v=10,w=10;t.push(" <g_vml_:group",' coordsize="',m*v,",",m*w,'"',' coordorigin="0,0"',
|
11 |
+
' style="width:',v,";height:",w,";position:absolute;");if(this.a[0][0]!=1||this.a[0][1]){var x=[];x.push("M11='",this.a[0][0],"',","M12='",this.a[1][0],"',","M21='",this.a[0][1],"',","M22='",this.a[1][1],"',","Dx='",i(s.x/m),"',","Dy='",i(s.y/m),"'");var p=s,y=this.b(c+e,d),z=this.b(c,d+g),B=this.b(c+e,d+g);p.x=Math.max(p.x,y.x,z.x,B.x);p.y=Math.max(p.y,y.y,z.y,B.y);t.push("padding:0 ",i(p.x/m),"px ",i(p.y/m),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",x.join(""),", sizingmethod='clip');")}else{t.push("top:",
|
12 |
+
i(s.y/m),"px;left:",i(s.x/m),"px;")}t.push(' ">','<g_vml_:image src="',a.src,'"',' style="width:',m*e,";"," height:",m*g,';"',' cropleft="',h/q,'"',' croptop="',l/r,'"',' cropright="',(q-h-n)/q,'"',' cropbottom="',(r-l-o)/r,'"'," />","</g_vml_:group>");this.j.insertAdjacentHTML("BeforeEnd",t.join(""))};j.stroke=function(a){var b=[],c=O(a?this.fillStyle:this.strokeStyle),d=c[0],e=c[1]*this.globalAlpha,g=10,h=10;b.push("<g_vml_:shape",' fillcolor="',d,'"',' filled="',Boolean(a),'"',' style="position:absolute;width:',
|
13 |
+
g,";height:",h,';"',' coordorigin="0 0" coordsize="',m*g," ",m*h,'"',' stroked="',!a,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',d,'"',' path="');var l={x:null,y:null},n={x:null,y:null};for(var o=0;o<this.c.length;o++){var f=this.c[o];if(f.type=="moveTo"){b.push(" m ");var k=this.b(f.x,f.y);b.push(i(k.x),",",i(k.y))}else if(f.type=="lineTo"){b.push(" l ");var k=this.b(f.x,f.y);b.push(i(k.x),",",i(k.y))}else if(f.type=="close"){b.push(" x ")}else if(f.type=="bezierCurveTo"){b.push(" c ");
|
14 |
+
var k=this.b(f.x,f.y),q=this.b(f.cp1x,f.cp1y),r=this.b(f.cp2x,f.cp2y);b.push(i(q.x),",",i(q.y),",",i(r.x),",",i(r.y),",",i(k.x),",",i(k.y))}else if(f.type=="at"||f.type=="wa"){b.push(" ",f.type," ");var k=this.b(f.x,f.y),s=this.b(f.xStart,f.yStart),t=this.b(f.xEnd,f.yEnd);b.push(i(k.x-this.d*f.radius),",",i(k.y-this.e*f.radius)," ",i(k.x+this.d*f.radius),",",i(k.y+this.e*f.radius)," ",i(s.x),",",i(s.y)," ",i(t.x),",",i(t.y))}if(k){if(l.x==null||k.x<l.x){l.x=k.x}if(n.x==null||k.x>n.x){n.x=k.x}if(l.y==
|
15 |
+
null||k.y<l.y){l.y=k.y}if(n.y==null||k.y>n.y){n.y=k.y}}}b.push(' ">');if(typeof this.fillStyle=="object"){var v={x:"50%",y:"50%"},w=n.x-l.x,x=n.y-l.y,p=w>x?w:x;v.x=i(this.fillStyle.i.x/w*100+50)+"%";v.y=i(this.fillStyle.i.y/x*100+50)+"%";var y=[];if(this.fillStyle.p=="gradientradial"){var z=this.fillStyle.n/p*100,B=this.fillStyle.o/p*100-z}else{var z=0,B=100}var C={offset:null,color:null},D={offset:null,color:null};this.fillStyle.h.sort(function(T,U){return T.offset-U.offset});for(var o=0;o<this.fillStyle.h.length;o++){var u=
|
16 |
+
this.fillStyle.h[o];y.push(u.offset*B+z,"% ",u.color,",");if(u.offset>C.offset||C.offset==null){C.offset=u.offset;C.color=u.color}if(u.offset<D.offset||D.offset==null){D.offset=u.offset;D.color=u.color}}y.pop();b.push("<g_vml_:fill",' color="',D.color,'"',' color2="',C.color,'"',' type="',this.fillStyle.p,'"',' focusposition="',v.x,", ",v.y,'"',' colors="',y.join(""),'"',' opacity="',e,'" />')}else if(a){b.push('<g_vml_:fill color="',d,'" opacity="',e,'" />')}else{b.push("<g_vml_:stroke",' opacity="',
|
17 |
+
e,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',S(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',d,'" />')}b.push("</g_vml_:shape>");this.j.insertAdjacentHTML("beforeEnd",b.join(""));this.c=[]};j.fill=function(){this.stroke(true)};j.closePath=function(){this.c.push({type:"close"})};j.b=function(a,b){return{x:m*(a*this.a[0][0]+b*this.a[1][0]+this.a[2][0])-A,y:m*(a*this.a[0][1]+b*this.a[1][1]+this.a[2][1])-A}};j.save=function(){var a={};N(this,a);
|
18 |
+
this.k.push(a);this.m.push(this.a);this.a=G(J(),this.a)};j.restore=function(){N(this.k.pop(),this);this.a=this.m.pop()};j.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];this.a=G(c,this.a)};j.rotate=function(a){var b=M(a),c=L(a),d=[[b,c,0],[-c,b,0],[0,0,1]];this.a=G(d,this.a)};j.scale=function(a,b){this.d*=a;this.e*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];this.a=G(c,this.a)};j.clip=function(){};j.arcTo=function(){};j.createPattern=function(){return new P};function H(a){this.p=a;this.n=0;this.o=
|
19 |
+
0;this.h=[];this.i={x:0,y:0}}H.prototype.addColorStop=function(a,b){b=O(b);this.h.push({offset:1-a,color:b})};function P(){}G_vmlCanvasManager=Q;CanvasRenderingContext2D=K;CanvasGradient=H;CanvasPattern=P})()};
|
addons/imgmap/jscripts/functions.js
ADDED
@@ -0,0 +1,543 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var myimgmap;
|
2 |
+
var editor = null;
|
3 |
+
var img_obj = null;
|
4 |
+
var map_obj = null;
|
5 |
+
//array of form elements
|
6 |
+
var props = [];
|
7 |
+
|
8 |
+
function init() {
|
9 |
+
|
10 |
+
tinyMCEPopup.resizeToInnerSize();
|
11 |
+
//tinyMCE.setWindowArg('mce_windowresize', true);//i guess we dont need this
|
12 |
+
|
13 |
+
editor = tinyMCEPopup.editor;
|
14 |
+
img_obj = editor.selection.getNode();
|
15 |
+
|
16 |
+
//late init
|
17 |
+
myimgmap = new imgmap({
|
18 |
+
mode : "editor",
|
19 |
+
custom_callbacks : {
|
20 |
+
'onStatusMessage' : function(str) {gui_statusMessage(str);},//to display status messages on gui
|
21 |
+
'onHtmlChanged' : function(str) {gui_htmlChanged(str);},//to display updated html on gui
|
22 |
+
//'onModeChanged' : function(mode) {gui_modeChanged(mode);},//to switch normal and preview modes on gui
|
23 |
+
'onAddArea' : function(id) {gui_addArea(id);},//to add new form element on gui
|
24 |
+
'onRemoveArea' : function(id) {gui_removeArea(id);},//to remove form elements from gui
|
25 |
+
'onAreaChanged' : function(obj) {gui_areaChanged(obj);},
|
26 |
+
'onSelectArea' : function(obj) {gui_selectArea(obj);}//to select form element when an area is clicked
|
27 |
+
},
|
28 |
+
pic_container: document.getElementById('pic_container'),
|
29 |
+
bounding_box : false
|
30 |
+
});
|
31 |
+
|
32 |
+
|
33 |
+
//we need this to load languages
|
34 |
+
myimgmap.onLoad();
|
35 |
+
|
36 |
+
myimgmap.loadImage(img_obj);
|
37 |
+
//console.log(myimgmap);
|
38 |
+
|
39 |
+
myimgmap.addEvent(document.getElementById('html_container'), 'blur', gui_htmlBlur);
|
40 |
+
myimgmap.addEvent(document.getElementById('html_container'), 'focus', gui_htmlFocus);
|
41 |
+
|
42 |
+
//check if the image has a valid map already assigned
|
43 |
+
var mapname = img_obj.getAttribute('usemap', 2) || img_obj.usemap ;
|
44 |
+
//console.log(mapname);
|
45 |
+
if (mapname != null && mapname != '') {
|
46 |
+
mapname = mapname.substr(1);
|
47 |
+
var maps = editor.contentWindow.document.getElementsByTagName('MAP');
|
48 |
+
//console.log(maps);
|
49 |
+
for (var i=0; i < maps.length; i++) {
|
50 |
+
// IE doesn't return name?
|
51 |
+
if (maps[i].name == mapname || maps[i].id == mapname) {
|
52 |
+
map_obj = maps[i];
|
53 |
+
myimgmap.setMapHTML(map_obj);
|
54 |
+
break;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
function updateAction() {
|
61 |
+
if (img_obj != null && img_obj.nodeName == "IMG") {
|
62 |
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
63 |
+
|
64 |
+
if (typeof map_obj == 'undefined' || map_obj == null) {
|
65 |
+
map_obj = editor.contentWindow.document.createElement('MAP');
|
66 |
+
img_obj.parentNode.appendChild(map_obj);
|
67 |
+
}
|
68 |
+
|
69 |
+
//map_obj.innerHTML = myimgmap.getMapInnerHTML();
|
70 |
+
editor.dom.setHTML(map_obj, myimgmap.getMapInnerHTML());
|
71 |
+
map_obj.name = myimgmap.getMapName();
|
72 |
+
map_obj.id = myimgmap.getMapId();
|
73 |
+
|
74 |
+
img_obj.setAttribute('usemap', "#" + myimgmap.getMapName(), 0);
|
75 |
+
//img_obj.setAttribute('border', '0');
|
76 |
+
|
77 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
78 |
+
}
|
79 |
+
tinyMCEPopup.close();
|
80 |
+
}
|
81 |
+
|
82 |
+
function cancelAction() {
|
83 |
+
tinyMCEPopup.close();
|
84 |
+
}
|
85 |
+
|
86 |
+
//remove the map object and unset the usemap attribute
|
87 |
+
function removeAction() {
|
88 |
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
89 |
+
if (img_obj != null && img_obj.nodeName == "IMG") {
|
90 |
+
img_obj.removeAttribute('usemap', 0);
|
91 |
+
}
|
92 |
+
if (typeof map_obj != 'undefined' && map_obj != null) {
|
93 |
+
map_obj.parentNode.removeChild(map_obj);
|
94 |
+
}
|
95 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
96 |
+
tinyMCEPopup.close();
|
97 |
+
}
|
98 |
+
|
99 |
+
/** FUNCTION SECTION (code taken from default_interface) *****************************/
|
100 |
+
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Handles mouseover on props row.
|
104 |
+
*/
|
105 |
+
function gui_row_mouseover(e) {
|
106 |
+
if (myimgmap.is_drawing) {return;}//exit if in drawing state
|
107 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
108 |
+
var obj = (myimgmap.isMSIE) ? window.event.srcElement : e.currentTarget;
|
109 |
+
if (typeof obj.aid == 'undefined') {obj = obj.parentNode;}
|
110 |
+
//console.log(obj.aid);
|
111 |
+
myimgmap.highlightArea(obj.aid);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Handles mouseout on props row.
|
116 |
+
*/
|
117 |
+
function gui_row_mouseout(e) {
|
118 |
+
if (myimgmap.is_drawing) {return;}//exit if in drawing state
|
119 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
120 |
+
var obj = (myimgmap.isMSIE) ? window.event.srcElement : e.currentTarget;
|
121 |
+
if (typeof obj.aid == 'undefined') {obj = obj.parentNode;}
|
122 |
+
myimgmap.blurArea(obj.aid);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Handles click on props row.
|
127 |
+
*/
|
128 |
+
function gui_row_click(e) {
|
129 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
130 |
+
var obj = (myimgmap.isMSIE) ? window.event.srcElement : e.currentTarget;
|
131 |
+
//var multiple = (e.originalTarget.name == 'img_active');
|
132 |
+
//myimgmap.log(e.originalTarget);
|
133 |
+
if (typeof obj.aid == 'undefined') {obj = obj.parentNode;}
|
134 |
+
//gui_row_select(obj.aid, false, multiple);
|
135 |
+
gui_row_select(obj.aid, false, false);
|
136 |
+
myimgmap.currentid = obj.aid;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Handles click on a property row.
|
141 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
142 |
+
* @date 2006-06-06 16:55:29
|
143 |
+
*/
|
144 |
+
function gui_row_select(id, setfocus, multiple) {
|
145 |
+
if (myimgmap.is_drawing) {return;}//exit if in drawing state
|
146 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
147 |
+
if (!document.getElementById('img_active_'+id)) {return;}
|
148 |
+
//if (!multiple)
|
149 |
+
gui_cb_unselect_all();
|
150 |
+
document.getElementById('img_active_'+id).checked = 1;
|
151 |
+
if (setfocus) {
|
152 |
+
document.getElementById('img_active_'+id).focus();
|
153 |
+
}
|
154 |
+
//remove all background styles
|
155 |
+
for (var i = 0; i < props.length; i++) {
|
156 |
+
if (props[i]) {
|
157 |
+
props[i].style.background = '';
|
158 |
+
}
|
159 |
+
}
|
160 |
+
//put highlight on actual props row
|
161 |
+
props[id].style.background = '#e7e7e7';
|
162 |
+
};
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Handles delete keypress when focus is on the leading checkbox/radio.
|
166 |
+
* @author adam
|
167 |
+
*/
|
168 |
+
function gui_cb_keydown(e) {
|
169 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
170 |
+
var key = (myimgmap.isMSIE) ? event.keyCode : e.keyCode;
|
171 |
+
//alert(key);
|
172 |
+
if (key == 46) {
|
173 |
+
//delete pressed
|
174 |
+
myimgmap.removeArea(myimgmap.currentid);
|
175 |
+
}
|
176 |
+
};
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Unchecks all checboxes/radios.
|
180 |
+
*/
|
181 |
+
function gui_cb_unselect_all() {
|
182 |
+
for (var i = 0; i < props.length; i++) {
|
183 |
+
if (props[i]) {
|
184 |
+
document.getElementById('img_active_'+i).checked = false;
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Handles arrow keys on img_coords input field.
|
191 |
+
* Changes the coordinate values by +/- 1 and updates the corresponding canvas area.
|
192 |
+
* @author adam
|
193 |
+
* @date 25-09-2007 17:12:43
|
194 |
+
*/
|
195 |
+
function gui_coords_keydown(e) {
|
196 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
197 |
+
var key = (myimgmap.isMSIE || myimgmap.isOpera) ? event.keyCode : e.keyCode;
|
198 |
+
var obj = (myimgmap.isMSIE || myimgmap.isOpera) ? window.event.srcElement : e.originalTarget;
|
199 |
+
//obj is the input field
|
200 |
+
//this.log(key);
|
201 |
+
//this.log(obj);
|
202 |
+
if (key == 40 || key == 38) {
|
203 |
+
//down or up pressed
|
204 |
+
//get the coords
|
205 |
+
var coords = obj.value.split(',');
|
206 |
+
var s = getSelectionStart(obj);//helper function
|
207 |
+
var j = 0;
|
208 |
+
for (var i=0; i<coords.length; i++) {
|
209 |
+
j+=coords[i].length;
|
210 |
+
if (j > s) {
|
211 |
+
//this is the coord we want
|
212 |
+
if (key == 40 && coords[i] > 0) {coords[i]--;}
|
213 |
+
if (key == 38) {coords[i]++;}
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
//jump one more because of comma
|
217 |
+
j++;
|
218 |
+
}
|
219 |
+
obj.value = coords.join(',');
|
220 |
+
if (obj.value != myimgmap.areas[obj.parentNode.aid].lastInput) {
|
221 |
+
myimgmap._recalculate(obj.parentNode.aid, obj.value);//contains repaint
|
222 |
+
}
|
223 |
+
//set cursor back to its original position
|
224 |
+
setSelectionRange(obj, s);
|
225 |
+
return true;
|
226 |
+
}
|
227 |
+
};
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Gets the position of the cursor in the input box.
|
231 |
+
* @author Diego Perlini
|
232 |
+
* @url http://javascript.nwbox.com/cursor_position/
|
233 |
+
*/
|
234 |
+
function getSelectionStart(obj) {
|
235 |
+
if (obj.createTextRange) {
|
236 |
+
var r = document.selection.createRange().duplicate();
|
237 |
+
r.moveEnd('character', obj.value.length);
|
238 |
+
if (r.text === '') {return obj.value.length;}
|
239 |
+
return obj.value.lastIndexOf(r.text);
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
return obj.selectionStart;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Sets the position of the cursor in the input box.
|
248 |
+
* @link http://www.codingforums.com/archive/index.php/t-90176.html
|
249 |
+
*/
|
250 |
+
function setSelectionRange(obj, start, end) {
|
251 |
+
if (typeof end == "undefined") {end = start;}
|
252 |
+
if (obj.setSelectionRange) {
|
253 |
+
obj.focus(); // to make behaviour consistent with IE
|
254 |
+
obj.setSelectionRange(start, end);
|
255 |
+
}
|
256 |
+
else if (obj.createTextRange) {
|
257 |
+
var range = obj.createTextRange();
|
258 |
+
range.collapse(true);
|
259 |
+
range.moveEnd('character', end);
|
260 |
+
range.moveStart('character', start);
|
261 |
+
range.select();
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Called when one of the properties change, and the recalculate function
|
267 |
+
* must be called.
|
268 |
+
* @date 2006.10.24. 22:42:02
|
269 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
270 |
+
*/
|
271 |
+
function gui_input_change(e) {
|
272 |
+
if (myimgmap.viewmode === 1) {return;}//exit if preview mode
|
273 |
+
if (myimgmap.is_drawing) {return;}//exit if drawing
|
274 |
+
//console.log('blur');
|
275 |
+
var obj = (myimgmap.isMSIE) ? window.event.srcElement : e.currentTarget;
|
276 |
+
//console.log(obj);
|
277 |
+
var id = obj.parentNode.aid;
|
278 |
+
//console.log(this.areas[id]);
|
279 |
+
if (obj.name == 'img_href') {myimgmap.areas[id].ahref = obj.value;}
|
280 |
+
else if (obj.name == 'img_alt') {myimgmap.areas[id].aalt = obj.value;}
|
281 |
+
else if (obj.name == 'img_title') {myimgmap.areas[id].atitle = obj.value;}
|
282 |
+
else if (obj.name == 'img_target') {myimgmap.areas[id].atarget = obj.value;}
|
283 |
+
else if (obj.name == 'img_shape') {
|
284 |
+
if (myimgmap.areas[id].shape != obj.value && myimgmap.areas[id].shape != 'undefined') {
|
285 |
+
//shape changed, adjust coords intelligently inside _normCoords
|
286 |
+
var coords = '';
|
287 |
+
if (props[id]) {
|
288 |
+
coords = props[id].getElementsByTagName('input')[2].value;
|
289 |
+
}
|
290 |
+
else {
|
291 |
+
coords = myimgmap.areas[id].lastInput || '' ;
|
292 |
+
}
|
293 |
+
coords = myimgmap._normCoords(coords, obj.value, 'from'+myimgmap.areas[id].shape);
|
294 |
+
if (props[id]) {
|
295 |
+
props[id].getElementsByTagName('input')[2].value = coords;
|
296 |
+
}
|
297 |
+
myimgmap.areas[id].shape = obj.value;
|
298 |
+
myimgmap._recalculate(id, coords);
|
299 |
+
myimgmap.areas[id].lastInput = coords;
|
300 |
+
}
|
301 |
+
else if (myimgmap.areas[id].shape == 'undefined') {
|
302 |
+
myimgmap.nextShape = obj.value;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
if (myimgmap.areas[id] && myimgmap.areas[id].shape != 'undefined') {
|
306 |
+
myimgmap._recalculate(id, props[id].getElementsByTagName('input')[2].value);
|
307 |
+
myimgmap.fireEvent('onHtmlChanged', myimgmap.getMapHTML());//temp ## shouldnt be here
|
308 |
+
}
|
309 |
+
};
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Called from imgmap when a new area is added.
|
313 |
+
*/
|
314 |
+
function gui_addArea(id) {
|
315 |
+
//var id = props.length;
|
316 |
+
//id = 1;
|
317 |
+
props[id] = document.createElement('DIV');
|
318 |
+
document.getElementById('form_container').appendChild(props[id]);
|
319 |
+
|
320 |
+
props[id].id = 'img_area_' + id;
|
321 |
+
props[id].aid = id;
|
322 |
+
props[id].className = 'img_area';
|
323 |
+
//hook ROW event handlers
|
324 |
+
myimgmap.addEvent(props[id], 'mouseover', gui_row_mouseover);
|
325 |
+
myimgmap.addEvent(props[id], 'mouseout', gui_row_mouseout);
|
326 |
+
myimgmap.addEvent(props[id], 'click', gui_row_click);
|
327 |
+
var temp = '<input type="text" name="img_id" class="img_id" value="' + id + '" readonly="1"/>';
|
328 |
+
//temp+= '<input type="checkbox" name="img_active" class="img_active" id="img_active_'+id+'" value="'+id+'">';
|
329 |
+
//could be checkbox in the future
|
330 |
+
temp+= '<input type="radio" name="img_active" class="img_active" id="img_active_'+id+'" value="'+id+'">';
|
331 |
+
temp+= '<select name="img_shape" class="img_shape">';
|
332 |
+
temp+= '<option value="rect" >rectangle</option>';
|
333 |
+
temp+= '<option value="circle" >circle</option>';
|
334 |
+
temp+= '<option value="poly" >polygon</option>';
|
335 |
+
temp+= '</select>';
|
336 |
+
temp+= 'Coords: <input type="text" name="img_coords" class="img_coords" value="">';
|
337 |
+
temp+= 'Href: <input type="text" name="img_href" class="img_href" value="">';
|
338 |
+
temp+= 'Alt: <input type="text" name="img_alt" class="img_alt" value="">';
|
339 |
+
temp+= 'Target: <select name="img_target" class="img_target">';
|
340 |
+
temp+= '<option value="" ><not set></option>';
|
341 |
+
temp+= '<option value="_self" >this window</option>';
|
342 |
+
temp+= '<option value="_blank" >new window</option>';
|
343 |
+
temp+= '<option value="_top" >top window</option>';
|
344 |
+
temp+= '</select>';
|
345 |
+
props[id].innerHTML = temp;
|
346 |
+
//hook more event handlers to individual inputs
|
347 |
+
|
348 |
+
myimgmap.addEvent(props[id].getElementsByTagName('input')[1], 'keydown', gui_cb_keydown);
|
349 |
+
myimgmap.addEvent(props[id].getElementsByTagName('input')[2], 'keydown', gui_coords_keydown);
|
350 |
+
myimgmap.addEvent(props[id].getElementsByTagName('input')[2], 'change', gui_input_change);
|
351 |
+
myimgmap.addEvent(props[id].getElementsByTagName('input')[3], 'change', gui_input_change);
|
352 |
+
myimgmap.addEvent(props[id].getElementsByTagName('input')[4], 'change', gui_input_change);
|
353 |
+
myimgmap.addEvent(props[id].getElementsByTagName('select')[0], 'change', gui_input_change);
|
354 |
+
myimgmap.addEvent(props[id].getElementsByTagName('select')[1], 'change', gui_input_change);
|
355 |
+
if (myimgmap.isSafari) {
|
356 |
+
//need these for safari
|
357 |
+
myimgmap.addEvent(props[id].getElementsByTagName('select')[0], 'change', gui_row_click);
|
358 |
+
myimgmap.addEvent(props[id].getElementsByTagName('select')[1], 'change', gui_row_click);
|
359 |
+
}
|
360 |
+
//set shape as nextshape if set
|
361 |
+
if (myimgmap.nextShape) {props[id].getElementsByTagName('select')[0].value = myimgmap.nextShape;}
|
362 |
+
//alert(this.props[id].parentNode.innerHTML);
|
363 |
+
gui_row_select(id, true);
|
364 |
+
}
|
365 |
+
|
366 |
+
/**
|
367 |
+
* Called from imgmap when an area was removed.
|
368 |
+
*/
|
369 |
+
function gui_removeArea(id) {
|
370 |
+
if (props[id]) {
|
371 |
+
//shall we leave the last one?
|
372 |
+
var pprops = props[id].parentNode;
|
373 |
+
pprops.removeChild(props[id]);
|
374 |
+
var lastid = pprops.lastChild.aid;
|
375 |
+
props[id] = null;
|
376 |
+
try {
|
377 |
+
gui_row_select(lastid, true);
|
378 |
+
myimgmap.currentid = lastid;
|
379 |
+
}
|
380 |
+
catch (err) {
|
381 |
+
//alert('noparent');
|
382 |
+
}
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Called from imgmap when mode changed to a given value (preview or normal)
|
388 |
+
*/
|
389 |
+
function gui_modeChanged(mode) {
|
390 |
+
var nodes, i;
|
391 |
+
if (mode == 1) {
|
392 |
+
//preview mode
|
393 |
+
if (document.getElementById('html_container')) {
|
394 |
+
document.getElementById('html_container').disabled = true;
|
395 |
+
}
|
396 |
+
//disable form elements (inputs and selects)
|
397 |
+
nodes = document.getElementById('form_container').getElementsByTagName("input");
|
398 |
+
for (i=0; i<nodes.length; i++) {
|
399 |
+
nodes[i].disabled = true;
|
400 |
+
}
|
401 |
+
nodes = document.getElementById('form_container').getElementsByTagName("select");
|
402 |
+
for (i=0; i<nodes.length; i++) {
|
403 |
+
nodes[i].disabled = true;
|
404 |
+
}
|
405 |
+
document.getElementById('i_preview').src = 'example1_files/edit.gif';
|
406 |
+
}
|
407 |
+
else {
|
408 |
+
//normal mode
|
409 |
+
if (document.getElementById('html_container')) {
|
410 |
+
document.getElementById('html_container').disabled = false;
|
411 |
+
}
|
412 |
+
//enable form elements (inputs and selects)
|
413 |
+
nodes = document.getElementById('form_container').getElementsByTagName("input");
|
414 |
+
for (i=0; i<nodes.length; i++) {
|
415 |
+
nodes[i].disabled = false;
|
416 |
+
}
|
417 |
+
nodes = document.getElementById('form_container').getElementsByTagName("select");
|
418 |
+
for (i=0; i<nodes.length; i++) {
|
419 |
+
nodes[i].disabled = false;
|
420 |
+
}
|
421 |
+
document.getElementById('i_preview').src = 'example1_files/zoom.gif';
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Called from imgmap with the new html code when changed.
|
427 |
+
*/
|
428 |
+
function gui_htmlChanged(str) {
|
429 |
+
if (document.getElementById('html_container')) {
|
430 |
+
document.getElementById('html_container').value = str;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Called from imgmap with new status string.
|
436 |
+
*/
|
437 |
+
function gui_statusMessage(str) {
|
438 |
+
if (document.getElementById('status_container')) {
|
439 |
+
document.getElementById('status_container').innerHTML = str;
|
440 |
+
}
|
441 |
+
window.defaultStatus = str;//for IE
|
442 |
+
}
|
443 |
+
|
444 |
+
function gui_areaChanged(area) {
|
445 |
+
var id = area.aid;
|
446 |
+
if (props[id]) {
|
447 |
+
if (area.shape) {props[id].getElementsByTagName('select')[0].value = area.shape;}
|
448 |
+
if (area.lastInput) {props[id].getElementsByTagName('input')[2].value = area.lastInput;}
|
449 |
+
if (area.ahref) {props[id].getElementsByTagName('input')[3].value = area.ahref;}
|
450 |
+
if (area.aalt) {props[id].getElementsByTagName('input')[4].value = area.aalt;}
|
451 |
+
if (area.atarget) {props[id].getElementsByTagName('select')[1].value = area.atarget;}
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Called when the grand HTML code loses focus, and the changes must be reflected.
|
458 |
+
* @date 2006.10.24. 22:51:20
|
459 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
460 |
+
*/
|
461 |
+
function gui_htmlBlur() {
|
462 |
+
var elem = document.getElementById('html_container');
|
463 |
+
var oldvalue = elem.getAttribute('oldvalue');
|
464 |
+
if (oldvalue != elem.value) {
|
465 |
+
//dirty
|
466 |
+
myimgmap.setMapHTML(elem.value);
|
467 |
+
}
|
468 |
+
};
|
469 |
+
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Called when the optional html container gets focus.
|
473 |
+
* We need to memorize its old value in order to be able to
|
474 |
+
* detect changes in the code that needs to be reflected.
|
475 |
+
* @date 20-02-2007 17:51:16
|
476 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
477 |
+
*/
|
478 |
+
function gui_htmlFocus() {
|
479 |
+
var elem = document.getElementById('html_container');
|
480 |
+
elem.setAttribute('oldvalue', elem.value);
|
481 |
+
elem.select();
|
482 |
+
};
|
483 |
+
|
484 |
+
function gui_htmlShow() {
|
485 |
+
toggleFieldset(document.getElementById('fieldset_html'), 1);
|
486 |
+
document.getElementById('html_container').focus();
|
487 |
+
}
|
488 |
+
|
489 |
+
/**
|
490 |
+
* Change the labeling mode directly in imgmap config then repaint all areas.
|
491 |
+
*/
|
492 |
+
function changelabeling(obj) {
|
493 |
+
myimgmap.config.label = obj.value;
|
494 |
+
myimgmap._repaintAll();
|
495 |
+
}
|
496 |
+
|
497 |
+
/**
|
498 |
+
* Change the bounding box mode straight in imgmap config then relax all areas.
|
499 |
+
* (Relax just repaints the borders and opacity.)
|
500 |
+
*/
|
501 |
+
function toggleBoundingBox(obj) {
|
502 |
+
//console.log(obj.checked);
|
503 |
+
myimgmap.config.bounding_box = obj.checked;
|
504 |
+
myimgmap.relaxAllAreas();
|
505 |
+
}
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Toggles fieldset visibility by changing the className.
|
509 |
+
* External css needed with the appropriate classnames.
|
510 |
+
* @date 2006.10.24. 22:13:34
|
511 |
+
* @author Adam Maschek (maschek@freemail.hu)
|
512 |
+
*/
|
513 |
+
function toggleFieldset(fieldset, on) {
|
514 |
+
if (fieldset) {
|
515 |
+
if (fieldset.className == 'fieldset_off' || on == 1) {
|
516 |
+
fieldset.className = '';
|
517 |
+
}
|
518 |
+
else {
|
519 |
+
fieldset.className = 'fieldset_off';
|
520 |
+
}
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
function gui_selectArea(obj) {
|
525 |
+
gui_row_select(obj.aid, true, false);
|
526 |
+
}
|
527 |
+
|
528 |
+
function gui_zoom() {
|
529 |
+
var scale = document.getElementById('dd_zoom').value;
|
530 |
+
var pic = document.getElementById('pic_container').getElementsByTagName('img')[0];
|
531 |
+
if (typeof pic == 'undefined') {return false;}
|
532 |
+
if (typeof pic.oldwidth == 'undefined' || !pic.oldwidth) {
|
533 |
+
pic.oldwidth = pic.width;
|
534 |
+
}
|
535 |
+
if (typeof pic.oldheight == 'undefined' || !pic.oldheight) {
|
536 |
+
pic.oldheight = pic.height;
|
537 |
+
}
|
538 |
+
pic.width = pic.oldwidth * scale;
|
539 |
+
pic.height = pic.oldheight * scale;
|
540 |
+
myimgmap.scaleAllAreas(scale);
|
541 |
+
}
|
542 |
+
|
543 |
+
|
addons/imgmap/jscripts/imgmap.js
ADDED
@@ -0,0 +1,2900 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Image Map Editor (imgmap) - in-browser imagemap editor
|
3 |
+
* Copyright (C) 2006 - 2008 Adam Maschek (adam.maschek @ gmail.com)
|
4 |
+
*
|
5 |
+
* This program is free software; you can redistribute it and/or
|
6 |
+
* modify it under the terms of the GNU General Public License
|
7 |
+
* as published by the Free Software Foundation; either version 2
|
8 |
+
* of the License, or (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program; if not, write to the Free Software
|
17 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
18 |
+
*/
|
19 |
+
/**
|
20 |
+
* @fileoverview
|
21 |
+
* Online Image Map Editor - main script file.
|
22 |
+
* This is the main script file of the Online Image Map Editor.
|
23 |
+
*
|
24 |
+
* TODO:
|
25 |
+
* -scriptload race condition fix
|
26 |
+
* -destroy/cleanup function ?
|
27 |
+
* -testing highlighter
|
28 |
+
* -cursor area_mousemove in opera not refreshing quite well - bug reported
|
29 |
+
* -get rid of memo array
|
30 |
+
* -highlight which control point is edited in html or form mode
|
31 |
+
* -more comments, especially on config vars
|
32 |
+
* -make function names more logical
|
33 |
+
* - dumpconfig
|
34 |
+
* -prepare for bad input /poly not properly closed?
|
35 |
+
* -prepare for % values in coords
|
36 |
+
* -prepare for default shape http://www.w3.org/TR/html4/struct/objects.html#edef-AREA
|
37 |
+
*
|
38 |
+
* @date 26-02-2007 2:24:50
|
39 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
40 |
+
* @copyright
|
41 |
+
* @version 2.1
|
42 |
+
*
|
43 |
+
*/
|
44 |
+
/**
|
45 |
+
* @author Adam Maschek
|
46 |
+
* @constructor
|
47 |
+
* @param config The config object.
|
48 |
+
*/
|
49 |
+
function imgmap(config) {
|
50 |
+
|
51 |
+
/** Version string of imgmap */
|
52 |
+
this.version = "2.1";
|
53 |
+
|
54 |
+
/** Build date of imgmap */
|
55 |
+
this.buildDate = "2009/01/06 21:48";
|
56 |
+
|
57 |
+
/** Sequential build number of imgmap */
|
58 |
+
this.buildNumber = "96";
|
59 |
+
|
60 |
+
/** Config object of the imgmap instance */
|
61 |
+
this.config = {};
|
62 |
+
|
63 |
+
/** Status flag to indicate current drawing mode */
|
64 |
+
this.is_drawing = 0;
|
65 |
+
|
66 |
+
/** Array to hold language strings */
|
67 |
+
this.strings = [];
|
68 |
+
|
69 |
+
/** Helper array for some drawing operations */
|
70 |
+
this.memory = [];
|
71 |
+
|
72 |
+
/** Array to hold reference to all areas (canvases) */
|
73 |
+
this.areas = [];
|
74 |
+
|
75 |
+
/** Array to hold last log entries */
|
76 |
+
this.logStore = [];
|
77 |
+
|
78 |
+
/** Associative array to hold bound event handlers */
|
79 |
+
this.eventHandlers = {};
|
80 |
+
|
81 |
+
this.currentid = 0;
|
82 |
+
this.draggedId = null;
|
83 |
+
this.selectedId = null;
|
84 |
+
this.nextShape = 'rect';
|
85 |
+
|
86 |
+
/** possible values: 0 - edit, 1 - preview */
|
87 |
+
this.viewmode = 0;
|
88 |
+
|
89 |
+
/** array of dynamically loaded javascripts */
|
90 |
+
this.loadedScripts = [];
|
91 |
+
this.isLoaded = false;
|
92 |
+
this.cntReloads = 0;
|
93 |
+
|
94 |
+
/** holds the name of the actively edited map, use getMapName to read it */
|
95 |
+
this.mapname = '';
|
96 |
+
|
97 |
+
/** holds the id of the actively edited map, use getMapIdto read it */
|
98 |
+
this.mapid = '';
|
99 |
+
|
100 |
+
/** watermark to attach to output */
|
101 |
+
this.waterMark = '<!-- Created by Online Image Map Editor (http://www.maschek.hu/imagemap/index) -->';
|
102 |
+
|
103 |
+
/** global scale of areas (1-normal, 2-doubled, 0.5-half, etc.) */
|
104 |
+
this.globalscale = 1;
|
105 |
+
|
106 |
+
/** is_drawing draw mode constant */
|
107 |
+
this.DM_RECTANGLE_DRAW = 1;
|
108 |
+
/** is_drawing draw mode constant */
|
109 |
+
this.DM_RECTANGLE_MOVE = 11;
|
110 |
+
/** is_drawing draw mode constant */
|
111 |
+
this.DM_RECTANGLE_RESIZE_TOP = 12;
|
112 |
+
/** is_drawing draw mode constant */
|
113 |
+
this.DM_RECTANGLE_RESIZE_RIGHT = 13;
|
114 |
+
/** is_drawing draw mode constant */
|
115 |
+
this.DM_RECTANGLE_RESIZE_BOTTOM = 14;
|
116 |
+
/** is_drawing draw mode constant */
|
117 |
+
this.DM_RECTANGLE_RESIZE_LEFT = 15;
|
118 |
+
|
119 |
+
/** is_drawing draw mode constant */
|
120 |
+
this.DM_SQUARE_DRAW = 2;
|
121 |
+
/** is_drawing draw mode constant */
|
122 |
+
this.DM_SQUARE_MOVE = 21;
|
123 |
+
/** is_drawing draw mode constant */
|
124 |
+
this.DM_SQUARE_RESIZE_TOP = 22;
|
125 |
+
/** is_drawing draw mode constant */
|
126 |
+
this.DM_SQUARE_RESIZE_RIGHT = 23;
|
127 |
+
/** is_drawing draw mode constant */
|
128 |
+
this.DM_SQUARE_RESIZE_BOTTOM = 24;
|
129 |
+
/** is_drawing draw mode constant */
|
130 |
+
this.DM_SQUARE_RESIZE_LEFT = 25;
|
131 |
+
|
132 |
+
/** is_drawing draw mode constant */
|
133 |
+
this.DM_POLYGON_DRAW = 3;
|
134 |
+
/** is_drawing draw mode constant */
|
135 |
+
this.DM_POLYGON_LASTDRAW = 30;
|
136 |
+
/** is_drawing draw mode constant */
|
137 |
+
this.DM_POLYGON_MOVE = 31;
|
138 |
+
|
139 |
+
/** is_drawing draw mode constant */
|
140 |
+
this.DM_BEZIER_DRAW = 4;
|
141 |
+
/** is_drawing draw mode constant */
|
142 |
+
this.DM_BEZIER_LASTDRAW = 40;
|
143 |
+
/** is_drawing draw mode constant */
|
144 |
+
this.DM_BEZIER_MOVE = 41;
|
145 |
+
|
146 |
+
//set some config defaults
|
147 |
+
this.config.mode = "editor";
|
148 |
+
//possible values: editor - classical editor, editor2 - dreamweaver style editor, highlighter - map highlighter
|
149 |
+
|
150 |
+
this.config.baseroot = '';
|
151 |
+
this.config.lang = '';
|
152 |
+
this.config.defaultLang = 'en';
|
153 |
+
this.config.loglevel = 0;
|
154 |
+
this.config.custom_callbacks = {};//possible values: see below!
|
155 |
+
|
156 |
+
/** Callback events that you can handle in your GUI. */
|
157 |
+
this.event_types = [
|
158 |
+
'onModeChanged',
|
159 |
+
'onHtmlChanged',
|
160 |
+
'onAddArea',
|
161 |
+
'onRemoveArea',
|
162 |
+
'onDrawArea',
|
163 |
+
'onResizeArea',
|
164 |
+
'onRelaxArea',
|
165 |
+
'onFocusArea',
|
166 |
+
'onBlurArea',
|
167 |
+
'onMoveArea',
|
168 |
+
'onSelectRow',
|
169 |
+
'onLoadImage',
|
170 |
+
'onSetMap',
|
171 |
+
'onGetMap',
|
172 |
+
'onSelectArea',
|
173 |
+
'onStatusMessage',
|
174 |
+
'onAreaChanged'];
|
175 |
+
|
176 |
+
//default color values
|
177 |
+
this.config.CL_DRAW_BOX = '#E32636';
|
178 |
+
this.config.CL_DRAW_SHAPE = '#d00';
|
179 |
+
this.config.CL_DRAW_BG = '#fff';
|
180 |
+
this.config.CL_NORM_BOX = '#E32636';
|
181 |
+
this.config.CL_NORM_SHAPE = '#d00';
|
182 |
+
this.config.CL_NORM_BG = '#fff';
|
183 |
+
this.config.CL_HIGHLIGHT_BOX = '#E32636';
|
184 |
+
this.config.CL_HIGHLIGHT_SHAPE = '#d00';
|
185 |
+
this.config.CL_HIGHLIGHT_BG = '#fff';
|
186 |
+
this.config.CL_KNOB = '#555';
|
187 |
+
|
188 |
+
this.config.bounding_box = true;
|
189 |
+
this.config.label = '%n';
|
190 |
+
//the format string of the area labels - possible values: %n - number, %c - coords, %h - href, %a - alt, %t - title
|
191 |
+
|
192 |
+
this.config.label_class = 'imgmap_label';
|
193 |
+
//the css class to apply on labels
|
194 |
+
this.config.label_style = 'font: bold 10px Arial';
|
195 |
+
//this.config.label_style = 'font-weight: bold; font-size: 10px; font-family: Arial; color: #964';
|
196 |
+
//the css style(s) to apply on labels
|
197 |
+
|
198 |
+
this.config.hint = '#%n %h';
|
199 |
+
//the format string of the area mouseover hints - possible values: %n - number, %c - coords, %h - href, %a - alt, %t - title
|
200 |
+
|
201 |
+
this.config.draw_opacity = '35';
|
202 |
+
//the opacity value of the area while drawing, moving or resizing - possible values 0 - 100 or range "(x)-y"
|
203 |
+
this.config.norm_opacity = '50';
|
204 |
+
//the opacity value of the area while relaxed - possible values 0 - 100 or range "(x)-y"
|
205 |
+
this.config.highlight_opacity = '70';
|
206 |
+
//the opacity value of the area while highlighted - possible values 0 - 100 or range "(x)-y"
|
207 |
+
this.config.cursor_default = 'crosshair'; //auto/pointer
|
208 |
+
//the css cursor while hovering over the image
|
209 |
+
|
210 |
+
//browser sniff
|
211 |
+
var ua = navigator.userAgent;
|
212 |
+
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
|
213 |
+
this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);
|
214 |
+
this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);
|
215 |
+
this.isMSIE7 = this.isMSIE && (ua.indexOf('MSIE 7') != -1);
|
216 |
+
this.isGecko = ua.indexOf('Gecko') != -1;
|
217 |
+
this.isSafari = ua.indexOf('Safari') != -1;
|
218 |
+
this.isOpera = (typeof window.opera != 'undefined');
|
219 |
+
|
220 |
+
this.addEvent(document, 'keydown', this.eventHandlers.doc_keydown = this.doc_keydown.bind(this));
|
221 |
+
this.addEvent(document, 'keyup', this.eventHandlers.doc_keyup = this.doc_keyup.bind(this));
|
222 |
+
this.addEvent(document, 'mousedown', this.eventHandlers.doc_mousedown = this.doc_mousedown.bind(this));
|
223 |
+
|
224 |
+
if (config) {
|
225 |
+
this.setup(config);
|
226 |
+
}
|
227 |
+
|
228 |
+
}
|
229 |
+
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Return an object given by id or object itself.
|
233 |
+
* @date 22-02-2007 0:14:50
|
234 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
235 |
+
* @param objorid A DOM object, or id of a DOM object.
|
236 |
+
* @return The identified DOM object or null on error.
|
237 |
+
*/
|
238 |
+
imgmap.prototype.assignOID = function(objorid) {
|
239 |
+
try {
|
240 |
+
if (typeof objorid == 'undefined') {
|
241 |
+
this.log("Undefined object passed to assignOID.");// Called from: " + arguments.callee.caller, 1);
|
242 |
+
return null;
|
243 |
+
}
|
244 |
+
else if (typeof objorid == 'object') {
|
245 |
+
return objorid;
|
246 |
+
}
|
247 |
+
else if (typeof objorid == 'string') {
|
248 |
+
return document.getElementById(objorid);
|
249 |
+
}
|
250 |
+
}
|
251 |
+
catch (err) {
|
252 |
+
this.log("Error in assignOID", 1);
|
253 |
+
}
|
254 |
+
return null;
|
255 |
+
};
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Main setup function.
|
260 |
+
* Can be called manually or constructor will call it.
|
261 |
+
* @date 22-02-2007 0:15:42
|
262 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
263 |
+
* @param config config object
|
264 |
+
* @return True if all went ok.
|
265 |
+
*/
|
266 |
+
imgmap.prototype.setup = function(config) {
|
267 |
+
//this.config = config;
|
268 |
+
for (var i in config) {
|
269 |
+
if (config.hasOwnProperty(i)) {
|
270 |
+
this.config[i] = config[i];
|
271 |
+
}
|
272 |
+
}
|
273 |
+
//this.log('setup');
|
274 |
+
//set pic_container element - supposedly it already exists in the DOM
|
275 |
+
if (config && config.pic_container) {
|
276 |
+
this.pic_container = this.assignOID(config.pic_container);
|
277 |
+
this.disableSelection(this.pic_container);
|
278 |
+
}
|
279 |
+
|
280 |
+
if (!this.config.baseroot) {
|
281 |
+
//search for a base - theoretically there can only be one, but lets search
|
282 |
+
//for the first non-empty
|
283 |
+
var bases = document.getElementsByTagName('base');
|
284 |
+
var base = '';
|
285 |
+
for (i=0; i<bases.length; i++) {//i declared earlier
|
286 |
+
if (bases[i].href) {
|
287 |
+
base = bases[i].href;
|
288 |
+
//append slash if missing
|
289 |
+
if (base.charAt(base.length-1) != '/') {
|
290 |
+
base+= '/';
|
291 |
+
}
|
292 |
+
break;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
//search for scripts
|
296 |
+
var scripts = document.getElementsByTagName('script');
|
297 |
+
for (i=0; i<scripts.length; i++) {//i declared earlier
|
298 |
+
if (scripts[i].src && scripts[i].src.match(/imgmap\w*\.js(\?.*?)?$/)) {
|
299 |
+
var src = scripts[i].src;
|
300 |
+
//cut filename part, leave last slash
|
301 |
+
src = src.substring(0, src.lastIndexOf('/') + 1);
|
302 |
+
//set final baseroot path
|
303 |
+
if (base && src.indexOf('://') == -1) {
|
304 |
+
this.config.baseroot = base + src;
|
305 |
+
}
|
306 |
+
else {
|
307 |
+
this.config.baseroot = src;
|
308 |
+
}
|
309 |
+
//exit loop
|
310 |
+
break;
|
311 |
+
}
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
//load excanvas js - as soon as possible
|
316 |
+
if (this.isMSIE &&
|
317 |
+
typeof window.CanvasRenderingContext2D == 'undefined' && typeof G_vmlCanvasManager == 'undefined') {
|
318 |
+
this.loadScript(this.config.baseroot + 'excanvas.js');
|
319 |
+
//alert('loadcanvas');
|
320 |
+
}
|
321 |
+
//alert(this.config.baseroot);
|
322 |
+
|
323 |
+
//load language js - as soon as possible
|
324 |
+
if (!this.config.lang) {
|
325 |
+
this.config.lang = this.detectLanguage();
|
326 |
+
}
|
327 |
+
this.loadScript(this.config.baseroot + 'lang_' + this.config.lang + '.js');
|
328 |
+
|
329 |
+
//check event hooks
|
330 |
+
var found, j, le;
|
331 |
+
for (i in this.config.custom_callbacks) {
|
332 |
+
if (this.config.custom_callbacks.hasOwnProperty(i)) {
|
333 |
+
found = false;
|
334 |
+
for (j=0, le = this.event_types.length; j<le; j++) {
|
335 |
+
if (i == this.event_types[j]) {
|
336 |
+
found = true;
|
337 |
+
break;
|
338 |
+
}
|
339 |
+
}
|
340 |
+
if (!found) {
|
341 |
+
this.log("Unknown custom callback: " + i, 1);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
//hook onload event - as late as possible
|
347 |
+
this.addEvent(window, 'load', this.onLoad.bind(this));
|
348 |
+
return true;
|
349 |
+
};
|
350 |
+
|
351 |
+
|
352 |
+
/**
|
353 |
+
* currently unused
|
354 |
+
* @ignore
|
355 |
+
*/
|
356 |
+
imgmap.prototype.retryDelayed = function(fn, delay, tries) {
|
357 |
+
if (typeof fn.tries == 'undefined') {fn.tries = 0;}
|
358 |
+
//alert(fn.tries+1);
|
359 |
+
if (fn.tries++ < tries) {
|
360 |
+
//alert('ss');
|
361 |
+
window.setTimeout(function() {
|
362 |
+
fn.apply(this);
|
363 |
+
}, delay);
|
364 |
+
}
|
365 |
+
};
|
366 |
+
|
367 |
+
|
368 |
+
/**
|
369 |
+
* EVENT HANDLER: Handle event when the page with scripts is loaded.
|
370 |
+
* @date 22-02-2007 0:16:22
|
371 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
372 |
+
* @param e The event object.
|
373 |
+
*/
|
374 |
+
imgmap.prototype.onLoad = function(e) {
|
375 |
+
if (this.isLoaded) {return true;}
|
376 |
+
var _this = this;
|
377 |
+
//this.log('readystate: ' + document.readyState);
|
378 |
+
if (typeof imgmapStrings == 'undefined') {
|
379 |
+
if (this.cntReloads++ < 5) {
|
380 |
+
//this.retryDelayed(_this.onLoad(), 1000, 3);
|
381 |
+
window.setTimeout(function () {_this.onLoad(e);} ,1200);
|
382 |
+
this.log('Delaying onload (language ' + this.config.lang + ' not loaded, try: ' + this.cntReloads + ')');
|
383 |
+
return false;
|
384 |
+
}
|
385 |
+
else if (this.config.lang != this.config.defaultLang && this.config.defaultLang != 'en') {
|
386 |
+
this.log('Falling back to default language: ' + this.config.defaultLang);
|
387 |
+
this.cntReloads = 0;
|
388 |
+
this.config.lang = this.config.defaultLang;
|
389 |
+
this.loadScript(this.config.baseroot + 'lang_' + this.config.lang + '.js');
|
390 |
+
window.setTimeout(function () {_this.onLoad(e);} ,1200);
|
391 |
+
return false;
|
392 |
+
}
|
393 |
+
else if (this.config.lang != 'en') {
|
394 |
+
this.log('Falling back to english language');
|
395 |
+
this.cntReloads = 0;
|
396 |
+
this.config.lang = 'en';
|
397 |
+
this.loadScript(this.config.baseroot + 'lang_' + this.config.lang + '.js');
|
398 |
+
window.setTimeout(function () {_this.onLoad(e);} ,1200);
|
399 |
+
return false;
|
400 |
+
}
|
401 |
+
}
|
402 |
+
//else
|
403 |
+
try {
|
404 |
+
this.loadStrings(imgmapStrings);
|
405 |
+
}
|
406 |
+
catch (err) {
|
407 |
+
this.log("Unable to load language strings", 1);
|
408 |
+
}
|
409 |
+
|
410 |
+
//check if ExplorerCanvas correctly loaded - detect if browser supports canvas
|
411 |
+
//alert(typeof G_vmlCanvasManager + this.isMSIE + typeof window.CanvasRenderingContext2D);
|
412 |
+
if (this.isMSIE) {
|
413 |
+
//alert('cccc');
|
414 |
+
//alert(typeof G_vmlCanvasManager);
|
415 |
+
if (typeof window.CanvasRenderingContext2D == 'undefined' && typeof G_vmlCanvasManager == 'undefined') {
|
416 |
+
//alert('bbb');
|
417 |
+
/*
|
418 |
+
if (this.cntReloads++ < 5) {
|
419 |
+
var _this = this;
|
420 |
+
//this.retryDelayed(_this.onLoad(), 1000, 3);
|
421 |
+
window.setTimeout(function () {
|
422 |
+
_this.onLoad(e);
|
423 |
+
}
|
424 |
+
,1000
|
425 |
+
);
|
426 |
+
//alert('aaa');
|
427 |
+
this.log('Delaying onload (excanvas not loaded, try: ' + this.cntReloads + ')');
|
428 |
+
return false;
|
429 |
+
}
|
430 |
+
*/
|
431 |
+
this.log(this.strings.ERR_EXCANVAS_LOAD, 2);//critical error
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
if (this.config.mode == 'highlighter') {
|
436 |
+
//call global scope function
|
437 |
+
imgmap_spawnObjects(this.config);
|
438 |
+
}
|
439 |
+
this.isLoaded = true;
|
440 |
+
return true;
|
441 |
+
};
|
442 |
+
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Attach new 'evt' event handler 'callback' to 'obj'
|
446 |
+
* @date 24-02-2007 21:16:20
|
447 |
+
* @param obj The object on which the handler is defined.
|
448 |
+
* @param evt The name of the event, like mousedown.
|
449 |
+
* @param callback The callback function (named if you want it to be removed).
|
450 |
+
*/
|
451 |
+
imgmap.prototype.addEvent = function(obj, evt, callback) {
|
452 |
+
if (obj.attachEvent) {
|
453 |
+
//Microsoft style registration model
|
454 |
+
return obj.attachEvent("on" + evt, callback);
|
455 |
+
}
|
456 |
+
else if (obj.addEventListener) {
|
457 |
+
//W3C style model
|
458 |
+
obj.addEventListener(evt, callback, false);
|
459 |
+
return true;
|
460 |
+
}
|
461 |
+
else {
|
462 |
+
obj['on' + evt] = callback;
|
463 |
+
}
|
464 |
+
};
|
465 |
+
|
466 |
+
|
467 |
+
/**
|
468 |
+
* Detach 'evt' event handled by 'callback' from 'obj' object.
|
469 |
+
* Callback must be a non anonymous function, see eventHandlers.
|
470 |
+
* @see #eventHandlers
|
471 |
+
* Example: myimgmap.removeEvent(myimgmap.pic, 'mousedown', myimgmap.eventHandlers.img_mousedown);
|
472 |
+
* @date 24-11-2007 15:22:17
|
473 |
+
* @param obj The object on which the handler is defined.
|
474 |
+
* @param evt The name of the event, like mousedown.
|
475 |
+
* @param callback The named callback function.
|
476 |
+
*/
|
477 |
+
imgmap.prototype.removeEvent = function(obj, evt, callback) {
|
478 |
+
if (obj.detachEvent) {
|
479 |
+
//Microsoft style detach model
|
480 |
+
return obj.detachEvent("on" + evt, callback);
|
481 |
+
}
|
482 |
+
else if (obj.removeEventListener) {
|
483 |
+
//W3C style model
|
484 |
+
obj.removeEventListener(evt, callback, false);
|
485 |
+
return true;
|
486 |
+
}
|
487 |
+
else {
|
488 |
+
obj['on' + evt] = null;
|
489 |
+
}
|
490 |
+
};
|
491 |
+
|
492 |
+
|
493 |
+
/**
|
494 |
+
* We need this because load events for scripts function slightly differently.
|
495 |
+
* @link http://dean.edwards.name/weblog/2006/06/again/
|
496 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
497 |
+
* @date 24-03-2007 11:02:21
|
498 |
+
*/
|
499 |
+
imgmap.prototype.addLoadEvent = function(obj, callback) {
|
500 |
+
if (obj.attachEvent) {
|
501 |
+
//Microsoft style registration model
|
502 |
+
return obj.attachEvent("onreadystatechange", callback);
|
503 |
+
}
|
504 |
+
else if (obj.addEventListener) {
|
505 |
+
//W3C style registration model
|
506 |
+
obj.addEventListener('load', callback, false);
|
507 |
+
return true;
|
508 |
+
}
|
509 |
+
else {
|
510 |
+
obj.onload = callback;
|
511 |
+
}
|
512 |
+
};
|
513 |
+
|
514 |
+
|
515 |
+
/**
|
516 |
+
* Include another js script into the current document.
|
517 |
+
* @date 22-02-2007 0:17:04
|
518 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
519 |
+
* @param url The url of the script we want to load.
|
520 |
+
* @see #script_load
|
521 |
+
* @see #addLoadEvent
|
522 |
+
*/
|
523 |
+
imgmap.prototype.loadScript = function(url) {
|
524 |
+
if (url === '') {return false;}
|
525 |
+
if (this.loadedScripts[url] == 1) {return true;}//script already loaded
|
526 |
+
this.log('Loading script: ' + url);
|
527 |
+
//we might need this someday for safari?
|
528 |
+
//var temp = '<script language="javascript" type="text/javascript" src="' + url + '"></script>';
|
529 |
+
//document.write(temp);
|
530 |
+
try {
|
531 |
+
var head = document.getElementsByTagName('head')[0];
|
532 |
+
var temp = document.createElement('SCRIPT');
|
533 |
+
temp.setAttribute('language', 'javascript');
|
534 |
+
temp.setAttribute('type', 'text/javascript');
|
535 |
+
temp.setAttribute('src', url);
|
536 |
+
//temp.setAttribute('defer', true);
|
537 |
+
head.appendChild(temp);
|
538 |
+
this.addLoadEvent(temp, this.script_load.bind(this));
|
539 |
+
}
|
540 |
+
catch (err) {
|
541 |
+
this.log('Error loading script: ' + url);
|
542 |
+
}
|
543 |
+
return true;
|
544 |
+
};
|
545 |
+
|
546 |
+
|
547 |
+
/**
|
548 |
+
* EVENT HANDLER: Event handler of external script loaded.
|
549 |
+
* @param e The event object.
|
550 |
+
*/
|
551 |
+
imgmap.prototype.script_load = function(e) {
|
552 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
553 |
+
var url = obj.src;
|
554 |
+
var complete = false;
|
555 |
+
//alert(url);
|
556 |
+
if (typeof obj.readyState != 'undefined') {
|
557 |
+
//explorer
|
558 |
+
if (obj.readyState == 'complete') {
|
559 |
+
complete = true;
|
560 |
+
}
|
561 |
+
}
|
562 |
+
else {
|
563 |
+
//other browsers?
|
564 |
+
complete = true;
|
565 |
+
}
|
566 |
+
if (complete) {
|
567 |
+
this.loadedScripts[url] = 1;
|
568 |
+
this.log('Loaded script: ' + url);
|
569 |
+
return true;
|
570 |
+
}
|
571 |
+
};
|
572 |
+
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Load strings from a key:value object to the prototype strings array.
|
576 |
+
* @author adam
|
577 |
+
* @date 2007
|
578 |
+
* @param obj Javascript object that holds key:value pairs.
|
579 |
+
*/
|
580 |
+
imgmap.prototype.loadStrings = function(obj) {
|
581 |
+
for (var key in obj) {
|
582 |
+
if (obj.hasOwnProperty(key)) {
|
583 |
+
this.strings[key] = obj[key];
|
584 |
+
}
|
585 |
+
}
|
586 |
+
};
|
587 |
+
|
588 |
+
|
589 |
+
/**
|
590 |
+
* This function is to load a given img url to the pic_container.
|
591 |
+
*
|
592 |
+
* Loading an image will clear all current maps.
|
593 |
+
* @see #useImage
|
594 |
+
* @param img The imageurl or object to load (if object, function will get url, and do a recall)
|
595 |
+
* @param imgw The width we want to force on the image (optional)
|
596 |
+
* @param imgh The height we want to force on the image (optional)
|
597 |
+
* @returns True on success
|
598 |
+
*/
|
599 |
+
imgmap.prototype.loadImage = function(img, imgw, imgh) {
|
600 |
+
//test for container
|
601 |
+
if (typeof this.pic_container == 'undefined') {
|
602 |
+
this.log('You must have pic_container defined to use loadImage!', 2);
|
603 |
+
return false;
|
604 |
+
}
|
605 |
+
//wipe all
|
606 |
+
this.removeAllAreas();
|
607 |
+
//reset scale
|
608 |
+
this.globalscale = 1;
|
609 |
+
this.fireEvent('onHtmlChanged', '');//empty
|
610 |
+
if (!this._getLastArea()) {
|
611 |
+
//init with one new area if there was none editable
|
612 |
+
if (this.config.mode != "editor2") {this.addNewArea();}
|
613 |
+
}
|
614 |
+
if (typeof img == 'string') {
|
615 |
+
//there is an image given with url to load
|
616 |
+
if (typeof this.pic == 'undefined') {
|
617 |
+
this.pic = document.createElement('IMG');
|
618 |
+
this.pic_container.appendChild(this.pic);
|
619 |
+
//event handler hooking - only at the first load
|
620 |
+
this.addEvent(this.pic, 'mousedown', this.eventHandlers.img_mousedown = this.img_mousedown.bind(this));
|
621 |
+
this.addEvent(this.pic, 'mouseup', this.eventHandlers.img_mouseup = this.img_mouseup.bind(this));
|
622 |
+
this.addEvent(this.pic, 'mousemove', this.eventHandlers.img_mousemove = this.img_mousemove.bind(this));
|
623 |
+
this.pic.style.cursor = this.config.cursor_default;
|
624 |
+
}
|
625 |
+
//img ='../../'+img;
|
626 |
+
this.log('Loading image: ' + img, 0);
|
627 |
+
//calculate timestamp to bypass browser cache mechanism
|
628 |
+
var q = '?';
|
629 |
+
if (img.indexOf('?') > -1) {
|
630 |
+
q = '&';
|
631 |
+
}
|
632 |
+
this.pic.src = img + q + (new Date().getTime());
|
633 |
+
if (imgw && imgw > 0) {this.pic.setAttribute('width', imgw);}
|
634 |
+
if (imgh && imgh > 0) {this.pic.setAttribute('height', imgh);}
|
635 |
+
this.fireEvent('onLoadImage', this.pic);
|
636 |
+
return true;
|
637 |
+
}
|
638 |
+
else if (typeof img == 'object') {
|
639 |
+
//we have to use the src of the image object
|
640 |
+
var src = img.src; //img.getAttribute('src');
|
641 |
+
if (src === '' && img.getAttribute('mce_src') !== '') {
|
642 |
+
//if it is a tinymce object, it has no src but mce_src attribute!
|
643 |
+
src = img.getAttribute('mce_src');
|
644 |
+
}
|
645 |
+
else if (src === '' && img.getAttribute('_fcksavedurl') !== '') {
|
646 |
+
//if it is an fck object, it might have only _fcksavedurl attribute!
|
647 |
+
src = img.getAttribute('_fcksavedurl');
|
648 |
+
}
|
649 |
+
// Get the displayed dimensions of the image
|
650 |
+
if (!imgw) {
|
651 |
+
imgw = img.clientWidth;
|
652 |
+
}
|
653 |
+
if (!imgh) {
|
654 |
+
imgh = img.clientHeight;
|
655 |
+
}
|
656 |
+
//recurse, this time with the url string
|
657 |
+
return this.loadImage(src, imgw, imgh);
|
658 |
+
}
|
659 |
+
};
|
660 |
+
|
661 |
+
|
662 |
+
/**
|
663 |
+
* We use this when there is an existing image object we want to handle with imgmap.
|
664 |
+
* Mainly used in highlighter mode.
|
665 |
+
* @author adam
|
666 |
+
* @see #loadImage
|
667 |
+
* @see #imgmap_spawnObjects
|
668 |
+
* @date 2007
|
669 |
+
* @param img DOM object or id of image we want to use.
|
670 |
+
*/
|
671 |
+
imgmap.prototype.useImage = function(img) {
|
672 |
+
//wipe all
|
673 |
+
this.removeAllAreas();
|
674 |
+
if (!this._getLastArea()) {
|
675 |
+
//init with one new area if there was none editable
|
676 |
+
if (this.config.mode != "editor2") {this.addNewArea();}
|
677 |
+
}
|
678 |
+
img = this.assignOID(img);
|
679 |
+
if (typeof img == 'object') {
|
680 |
+
if (typeof this.pic != 'undefined') {
|
681 |
+
//remove previous handlers
|
682 |
+
this.removeEvent(this.pic, 'mousedown', this.eventHandlers.img_mousedown);
|
683 |
+
this.removeEvent(this.pic, 'mouseup', this.eventHandlers.img_mouseup);
|
684 |
+
this.removeEvent(this.pic, 'mousemove', this.eventHandlers.img_mousemove);
|
685 |
+
this.pic.style.cursor = '';
|
686 |
+
}
|
687 |
+
this.pic = img;
|
688 |
+
//hook event handlers
|
689 |
+
this.addEvent(this.pic, 'mousedown', this.eventHandlers.img_mousedown = this.img_mousedown.bind(this));
|
690 |
+
this.addEvent(this.pic, 'mouseup', this.eventHandlers.img_mouseup = this.img_mouseup.bind(this));
|
691 |
+
this.addEvent(this.pic, 'mousemove', this.eventHandlers.img_mousemove = this.img_mousemove.bind(this));
|
692 |
+
this.pic.style.cursor = this.config.cursor_default;
|
693 |
+
|
694 |
+
if (this.pic.parentNode.className == 'pic_container') {
|
695 |
+
//use existing container
|
696 |
+
this.pic_container = this.pic.parentNode;
|
697 |
+
}
|
698 |
+
else {
|
699 |
+
//dynamically create container
|
700 |
+
this.pic_container = document.createElement("div");
|
701 |
+
this.pic_container.className = 'pic_container';
|
702 |
+
this.pic.parentNode.insertBefore(this.pic_container, this.pic);
|
703 |
+
//ref: If the node already exists it is removed from current parent node, then added to new parent node.
|
704 |
+
this.pic_container.appendChild(this.pic);
|
705 |
+
}
|
706 |
+
|
707 |
+
this.fireEvent('onLoadImage', this.pic);
|
708 |
+
return true;
|
709 |
+
}
|
710 |
+
};
|
711 |
+
|
712 |
+
|
713 |
+
/**
|
714 |
+
* Fires custom hook onStatusMessage, passing the status string.
|
715 |
+
* Use this to update your GUI.
|
716 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
717 |
+
* @date 26-07-2008 13:22:54
|
718 |
+
* @param str The status string
|
719 |
+
*/
|
720 |
+
imgmap.prototype.statusMessage = function(str) {
|
721 |
+
this.fireEvent('onStatusMessage', str);
|
722 |
+
};
|
723 |
+
|
724 |
+
|
725 |
+
/**
|
726 |
+
* Adds basic logging functionality using firebug console object if available.
|
727 |
+
* Also tries to use AIR introspector if available.
|
728 |
+
* @date 20-02-2007 17:55:18
|
729 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
730 |
+
* @param obj The object or string you want to debug/echo.
|
731 |
+
* @level level The log level, 0 being the smallest issue.
|
732 |
+
*/
|
733 |
+
imgmap.prototype.log = function(obj, level) {
|
734 |
+
if (level === '' || typeof level == 'undefined') {level = 0;}
|
735 |
+
if (this.config.loglevel != -1 && level >= this.config.loglevel) {
|
736 |
+
this.logStore.push({level: level, obj: obj});
|
737 |
+
}
|
738 |
+
if (typeof console == 'object') {
|
739 |
+
console.log(obj);
|
740 |
+
}
|
741 |
+
else if (this.isOpera) {
|
742 |
+
opera.postError(level + ': ' + obj);
|
743 |
+
}
|
744 |
+
else if (typeof air == 'object') {
|
745 |
+
//we are inside AIR
|
746 |
+
if (typeof air.Introspector == 'object') {
|
747 |
+
air.Introspector.Console.log(obj);
|
748 |
+
}
|
749 |
+
else {
|
750 |
+
air.trace(obj);
|
751 |
+
}
|
752 |
+
}
|
753 |
+
else {
|
754 |
+
if (level > 1) {
|
755 |
+
//alert(level + ': ' + obj);
|
756 |
+
//dump with all pevious errors:
|
757 |
+
var msg = '';
|
758 |
+
for (var i=0, le = this.logStore.length; i<le; i++) {
|
759 |
+
msg+= this.logStore[i].level + ': ' + this.logStore[i].obj + "\n";
|
760 |
+
}
|
761 |
+
alert(msg);
|
762 |
+
}
|
763 |
+
else {
|
764 |
+
window.defaultStatus = (level + ': ' + obj);
|
765 |
+
}
|
766 |
+
}
|
767 |
+
};
|
768 |
+
|
769 |
+
|
770 |
+
/**
|
771 |
+
* Produces the image map HTML output with the defined areas.
|
772 |
+
* Invokes getMapInnerHTML.
|
773 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
774 |
+
* @date 2006-06-06 15:10:27
|
775 |
+
* @param flags Currently ony 'noscale' used to prevent scaling of coordinates in preview mode.
|
776 |
+
* @return The generated html code.
|
777 |
+
*/
|
778 |
+
imgmap.prototype.getMapHTML = function(flags) {
|
779 |
+
var html = '<map id="'+this.getMapId()+'" name="'+this.getMapName()+'">' + this.getMapInnerHTML(flags) + this.waterMark + '</map>';
|
780 |
+
this.fireEvent('onGetMap', html);
|
781 |
+
//alert(html);
|
782 |
+
return html;
|
783 |
+
};
|
784 |
+
|
785 |
+
|
786 |
+
/**
|
787 |
+
* Get the map areas part only of the current imagemap.
|
788 |
+
* @see #getMapHTML
|
789 |
+
* @author adam
|
790 |
+
* @param flags Currently ony 'noscale' used to prevent scaling of coordinates in preview mode.
|
791 |
+
* @return The generated map code without the map wrapper.
|
792 |
+
*/
|
793 |
+
imgmap.prototype.getMapInnerHTML = function(flags) {
|
794 |
+
var html, coords;
|
795 |
+
html = '';
|
796 |
+
//foreach area properties
|
797 |
+
for (var i=0, le = this.areas.length; i<le; i++) {
|
798 |
+
if (this.areas[i]) {
|
799 |
+
if (this.areas[i].shape && this.areas[i].shape != 'undefined') {
|
800 |
+
coords = this.areas[i].lastInput;
|
801 |
+
if (flags && flags.match(/noscale/)) {
|
802 |
+
//for preview use real coordinates, not scaled
|
803 |
+
var cs = coords.split(',');
|
804 |
+
for (var j=0, le2 = cs.length; j<le2; j++) {
|
805 |
+
cs[j] = Math.round(cs[j] * this.globalscale);
|
806 |
+
}
|
807 |
+
coords = cs.join(',');
|
808 |
+
}
|
809 |
+
html+= '<area shape="' + this.areas[i].shape + '"' +
|
810 |
+
' alt="' + this.areas[i].aalt + '"' +
|
811 |
+
' title="' + this.areas[i].atitle + '"' +
|
812 |
+
' coords="' + coords + '"' +
|
813 |
+
' href="' + this.areas[i].ahref + '"' +
|
814 |
+
' target="' + this.areas[i].atarget + '" />';
|
815 |
+
}
|
816 |
+
}
|
817 |
+
}
|
818 |
+
//alert(html);
|
819 |
+
return html;
|
820 |
+
};
|
821 |
+
|
822 |
+
|
823 |
+
/**
|
824 |
+
* Get the map name of the current imagemap.
|
825 |
+
* If doesnt exist, nor map id, generate a new name based on timestamp.
|
826 |
+
* The most portable solution is to use the same value for id and name.
|
827 |
+
* This also conforms the HTML 5 specification, that says:
|
828 |
+
* "If the id attribute is also specified, both attributes must have the same value."
|
829 |
+
* @link http://www.w3.org/html/wg/html5/#the-map-element
|
830 |
+
* @author adam
|
831 |
+
* @see #getMapId
|
832 |
+
* @return The name of the map.
|
833 |
+
*/
|
834 |
+
imgmap.prototype.getMapName = function() {
|
835 |
+
if (this.mapname === '') {
|
836 |
+
if (this.mapid !== '') {return this.mapid;}
|
837 |
+
var now = new Date();
|
838 |
+
this.mapname = 'imgmap' + now.getFullYear() + (now.getMonth()+1) + now.getDate() + now.getHours() + now.getMinutes() + now.getSeconds();
|
839 |
+
}
|
840 |
+
return this.mapname;
|
841 |
+
};
|
842 |
+
|
843 |
+
|
844 |
+
/**
|
845 |
+
* Get the map id of the current imagemap.
|
846 |
+
* If doesnt exist, use map name.
|
847 |
+
* @author adam
|
848 |
+
* @see #getMapName
|
849 |
+
* @return The id of the map.
|
850 |
+
*/
|
851 |
+
imgmap.prototype.getMapId = function() {
|
852 |
+
if (this.mapid === '') {
|
853 |
+
this.mapid = this.getMapName();
|
854 |
+
}
|
855 |
+
return this.mapid;
|
856 |
+
};
|
857 |
+
|
858 |
+
|
859 |
+
/**
|
860 |
+
* Convert wild shape names to normal ones.
|
861 |
+
* @date 25-12-2008 19:27:06
|
862 |
+
* @param shape The name of the shape to convert.
|
863 |
+
* @return The normalized shape name, rect as default.
|
864 |
+
*/
|
865 |
+
imgmap.prototype._normShape = function(shape) {
|
866 |
+
if (!shape) {return 'rect';}
|
867 |
+
shape = shape.trim().toLowerCase();
|
868 |
+
if (shape.substring(0, 4) == 'rect') {return 'rect';}
|
869 |
+
if (shape.substring(0, 4) == 'circ') {return 'circle';}
|
870 |
+
if (shape.substring(0, 4) == 'poly') {return 'poly';}
|
871 |
+
return 'rect';
|
872 |
+
};
|
873 |
+
|
874 |
+
|
875 |
+
/**
|
876 |
+
* Try to normalize coordinates that came from:
|
877 |
+
* 1. html textarea
|
878 |
+
* 2. user input in the active area's input field
|
879 |
+
* 3. from the html source in case of plugins or highlighter
|
880 |
+
* Example of inputs that need to be handled:
|
881 |
+
* 035,035 075,062
|
882 |
+
* 150,217, 190,257, 150,297,110,257
|
883 |
+
* @author adam
|
884 |
+
* @param coords The coordinates in a string.
|
885 |
+
* @param shape The shape of the object (rect, circle, poly, bezier1).
|
886 |
+
* @param flag Flags that modify the operation. (fromcircle, frompoly, fromrect, preserve)
|
887 |
+
* @returns The normalized coordinates.
|
888 |
+
*/
|
889 |
+
imgmap.prototype._normCoords = function(coords, shape, flag) {
|
890 |
+
//function level var declarations
|
891 |
+
var i;//generic cycle counter
|
892 |
+
var sx;//smallest x
|
893 |
+
var sy;//smallest y
|
894 |
+
var gx;//greatest x
|
895 |
+
var gy;//greatest y
|
896 |
+
var temp;
|
897 |
+
|
898 |
+
//console.log('normcoords: ' + coords + ' - ' + shape + ' - ' + flag);
|
899 |
+
coords = coords.trim();
|
900 |
+
if (coords === '') {return '';}
|
901 |
+
var oldcoords = coords;
|
902 |
+
//replace some general junk
|
903 |
+
coords = coords.replace(/(\d)(\D)+(\d)/g, "$1,$3");
|
904 |
+
coords = coords.replace(/,\D+(\d)/g, ",$1");//cut leading junk
|
905 |
+
coords = coords.replace(/,0+(\d)/g, ",$1");//cut leading zeros
|
906 |
+
coords = coords.replace(/(\d)(\D)+,/g, "$1,");
|
907 |
+
coords = coords.replace(/^\D+(\d)/g, "$1");//cut leading junk
|
908 |
+
coords = coords.replace(/^0+(\d)/g, "$1");//cut leading zeros
|
909 |
+
coords = coords.replace(/(\d)(\D)+$/g, "$1");//cut trailing junk
|
910 |
+
//console.log('>'+coords + ' - ' + shape + ' - ' + flag);
|
911 |
+
//now fix other issues
|
912 |
+
var parts = coords.split(',');
|
913 |
+
if (shape == 'rect') {
|
914 |
+
if (flag == 'fromcircle') {
|
915 |
+
var r = parts[2];
|
916 |
+
parts[0] = parts[0] - r;
|
917 |
+
parts[1] = parts[1] - r;
|
918 |
+
parts[2] = parseInt(parts[0], 10) + 2 * r;
|
919 |
+
parts[3] = parseInt(parts[1], 10) + 2 * r;
|
920 |
+
}
|
921 |
+
else if (flag == 'frompoly') {
|
922 |
+
sx = parseInt(parts[0], 10); gx = parseInt(parts[0], 10);
|
923 |
+
sy = parseInt(parts[1], 10); gy = parseInt(parts[1], 10);
|
924 |
+
for (i=0, le = parts.length; i<le; i++) {
|
925 |
+
if (i % 2 === 0 && parseInt(parts[i], 10) < sx) {
|
926 |
+
sx = parseInt(parts[i], 10);}
|
927 |
+
if (i % 2 === 1 && parseInt(parts[i], 10) < sy) {
|
928 |
+
sy = parseInt(parts[i], 10);}
|
929 |
+
if (i % 2 === 0 && parseInt(parts[i], 10) > gx) {
|
930 |
+
gx = parseInt(parts[i], 10);}
|
931 |
+
if (i % 2 === 1 && parseInt(parts[i], 10) > gy) {
|
932 |
+
gy = parseInt(parts[i], 10);}
|
933 |
+
//console.log(sx+","+sy+","+gx+","+gy);
|
934 |
+
}
|
935 |
+
parts[0] = sx; parts[1] = sy;
|
936 |
+
parts[2] = gx; parts[3] = gy;
|
937 |
+
}
|
938 |
+
if (!(parseInt(parts[1], 10) >= 0)) {parts[1] = parts[0];}
|
939 |
+
if (!(parseInt(parts[2], 10) >= 0)) {parts[2] = parseInt(parts[0], 10) + 10;}
|
940 |
+
if (!(parseInt(parts[3], 10) >= 0)) {parts[3] = parseInt(parts[1], 10) + 10;}
|
941 |
+
if (parseInt(parts[0], 10) > parseInt(parts[2], 10)) {
|
942 |
+
temp = parts[0];
|
943 |
+
parts[0] = parts[2];
|
944 |
+
parts[2] = temp;
|
945 |
+
}
|
946 |
+
if (parseInt(parts[1], 10) > parseInt(parts[3], 10)) {
|
947 |
+
temp = parts[1];
|
948 |
+
parts[1] = parts[3];
|
949 |
+
parts[3] = temp;
|
950 |
+
}
|
951 |
+
coords = parts[0]+","+parts[1]+","+parts[2]+","+parts[3];
|
952 |
+
//console.log(coords);
|
953 |
+
}
|
954 |
+
else if (shape == 'circle') {
|
955 |
+
if (flag == 'fromrect') {
|
956 |
+
sx = parseInt(parts[0], 10); gx = parseInt(parts[2], 10);
|
957 |
+
sy = parseInt(parts[1], 10); gy = parseInt(parts[3], 10);
|
958 |
+
//use smaller side
|
959 |
+
parts[2] = (gx - sx < gy - sy) ? gx - sx : gy - sy;
|
960 |
+
parts[2] = Math.floor(parts[2] / 2);//radius
|
961 |
+
parts[0] = sx + parts[2];
|
962 |
+
parts[1] = sy + parts[2];
|
963 |
+
}
|
964 |
+
else if (flag == 'frompoly') {
|
965 |
+
sx = parseInt(parts[0], 10); gx = parseInt(parts[0], 10);
|
966 |
+
sy = parseInt(parts[1], 10); gy = parseInt(parts[1], 10);
|
967 |
+
for (i=0, le = parts.length; i<le; i++) {
|
968 |
+
if (i % 2 === 0 && parseInt(parts[i], 10) < sx) {
|
969 |
+
sx = parseInt(parts[i], 10);}
|
970 |
+
if (i % 2 === 1 && parseInt(parts[i], 10) < sy) {
|
971 |
+
sy = parseInt(parts[i], 10);}
|
972 |
+
if (i % 2 === 0 && parseInt(parts[i], 10) > gx) {
|
973 |
+
gx = parseInt(parts[i], 10);}
|
974 |
+
if (i % 2 === 1 && parseInt(parts[i], 10) > gy) {
|
975 |
+
gy = parseInt(parts[i], 10);}
|
976 |
+
//console.log(sx+","+sy+","+gx+","+gy);
|
977 |
+
}
|
978 |
+
//use smaller side
|
979 |
+
parts[2] = (gx - sx < gy - sy) ? gx - sx : gy - sy;
|
980 |
+
parts[2] = Math.floor(parts[2] / 2);//radius
|
981 |
+
parts[0] = sx + parts[2];
|
982 |
+
parts[1] = sy + parts[2];
|
983 |
+
}
|
984 |
+
if (!(parseInt(parts[1], 10) > 0)) {parts[1] = parts[0];}
|
985 |
+
if (!(parseInt(parts[2], 10) > 0)) {parts[2] = 10;}
|
986 |
+
coords = parts[0]+","+parts[1]+","+parts[2];
|
987 |
+
}
|
988 |
+
else if (shape == 'poly') {
|
989 |
+
if (flag == 'fromrect') {
|
990 |
+
parts[4] = parts[2];
|
991 |
+
parts[5] = parts[3];
|
992 |
+
parts[2] = parts[0];
|
993 |
+
parts[6] = parts[4];
|
994 |
+
parts[7] = parts[1];
|
995 |
+
}
|
996 |
+
else if (flag == 'fromcircle') {
|
997 |
+
//@url http://www.pixelwit.com/blog/2007/06/29/basic-circle-drawing-actionscript/
|
998 |
+
var centerX = parseInt(parts[0], 10);
|
999 |
+
var centerY = parseInt(parts[1], 10);
|
1000 |
+
var radius = parseInt(parts[2], 10);
|
1001 |
+
var j = 0;
|
1002 |
+
parts[j++] = centerX + radius;
|
1003 |
+
parts[j++] = centerY;
|
1004 |
+
var sides = 60;//constant = sides the fake circle will have
|
1005 |
+
for (i=0; i<=sides; i++) {
|
1006 |
+
var pointRatio = i/sides;
|
1007 |
+
var xSteps = Math.cos(pointRatio*2*Math.PI);
|
1008 |
+
var ySteps = Math.sin(pointRatio*2*Math.PI);
|
1009 |
+
var pointX = centerX + xSteps * radius;
|
1010 |
+
var pointY = centerY + ySteps * radius;
|
1011 |
+
parts[j++] = Math.round(pointX);
|
1012 |
+
parts[j++] = Math.round(pointY);
|
1013 |
+
}
|
1014 |
+
//console.log(parts);
|
1015 |
+
}
|
1016 |
+
coords = parts.join(',');
|
1017 |
+
}
|
1018 |
+
else if (shape == 'bezier1') {
|
1019 |
+
coords = parts.join(',');
|
1020 |
+
}
|
1021 |
+
if (flag == 'preserve' && oldcoords != coords) {
|
1022 |
+
//return original and throw error
|
1023 |
+
//throw "invalid coords";
|
1024 |
+
return oldcoords;
|
1025 |
+
}
|
1026 |
+
return coords;
|
1027 |
+
};
|
1028 |
+
|
1029 |
+
|
1030 |
+
/**
|
1031 |
+
* Sets the coordinates according to the given HTML map code or DOM object.
|
1032 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1033 |
+
* @date 2006-06-07 11:47:16
|
1034 |
+
* @param map DOM object or string of a map you want to apply.
|
1035 |
+
* @return True on success
|
1036 |
+
*/
|
1037 |
+
imgmap.prototype.setMapHTML = function(map) {
|
1038 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
1039 |
+
|
1040 |
+
this.fireEvent('onSetMap', map);
|
1041 |
+
//this.log(map);
|
1042 |
+
//remove all areas
|
1043 |
+
this.removeAllAreas();
|
1044 |
+
//console.log(this.areas);
|
1045 |
+
|
1046 |
+
var oMap;
|
1047 |
+
if (typeof map == 'string') {
|
1048 |
+
var oHolder = document.createElement('DIV');
|
1049 |
+
oHolder.innerHTML = map;
|
1050 |
+
oMap = oHolder.firstChild;
|
1051 |
+
}
|
1052 |
+
else if (typeof map == 'object') {
|
1053 |
+
oMap = map;
|
1054 |
+
}
|
1055 |
+
if (!oMap || oMap.nodeName.toLowerCase() !== 'map') {return false;}
|
1056 |
+
this.mapname = oMap.name;
|
1057 |
+
this.mapid = oMap.id;
|
1058 |
+
var newareas = oMap.getElementsByTagName('area');
|
1059 |
+
var shape, coords, href, alt, title, target;
|
1060 |
+
for (var i=0, le = newareas.length; i<le; i++) {
|
1061 |
+
shape = coords = href = alt = title = target = '';
|
1062 |
+
|
1063 |
+
id = this.addNewArea();//btw id == this.currentid, just this form is a bit clearer
|
1064 |
+
|
1065 |
+
shape = this._normShape(newareas[i].getAttribute('shape', 2));
|
1066 |
+
|
1067 |
+
this.initArea(id, shape);
|
1068 |
+
|
1069 |
+
if (newareas[i].getAttribute('coords', 2)) {
|
1070 |
+
//normalize coords
|
1071 |
+
coords = this._normCoords(newareas[i].getAttribute('coords', 2), shape);
|
1072 |
+
this.areas[id].lastInput = coords;
|
1073 |
+
//for area this one will be set in recalculate
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
href = newareas[i].getAttribute('href', 2);
|
1077 |
+
// FCKeditor stored url to prevent mangling from the browser.
|
1078 |
+
var sSavedUrl = newareas[i].getAttribute( '_fcksavedurl' );
|
1079 |
+
if (sSavedUrl) {
|
1080 |
+
href = sSavedUrl;
|
1081 |
+
}
|
1082 |
+
if (href) {
|
1083 |
+
this.areas[id].ahref = href;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
alt = newareas[i].getAttribute('alt');
|
1087 |
+
if (alt) {
|
1088 |
+
this.areas[id].aalt = alt;
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
title = newareas[i].getAttribute('title');
|
1092 |
+
if (!title) {title = alt;}
|
1093 |
+
if (title) {
|
1094 |
+
this.areas[id].atitle = title;
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
target = newareas[i].getAttribute('target');
|
1098 |
+
if (target) {target = target.toLowerCase();}
|
1099 |
+
// if (target == '') target = '_self';
|
1100 |
+
this.areas[id].atarget = target;
|
1101 |
+
|
1102 |
+
this._recalculate(id, coords);//contains repaint
|
1103 |
+
this.relaxArea(id);
|
1104 |
+
|
1105 |
+
this.fireEvent('onAreaChanged', this.areas[id]);
|
1106 |
+
|
1107 |
+
}//end for areas
|
1108 |
+
this.fireEvent('onHtmlChanged', this.getMapHTML());
|
1109 |
+
return true;
|
1110 |
+
};
|
1111 |
+
|
1112 |
+
|
1113 |
+
/**
|
1114 |
+
* Preview image with imagemap applied.
|
1115 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1116 |
+
* @date 2006-06-06 14:51:01
|
1117 |
+
* @url http://www.quirksmode.org/bugreports/archives/2005/03/Usemap_attribute_wrongly_case_sensitive.html
|
1118 |
+
* @return False on error, 0 when switched to edit mode, 1 when switched to preview mode
|
1119 |
+
*/
|
1120 |
+
imgmap.prototype.togglePreview = function() {
|
1121 |
+
var i;//generic cycle counter
|
1122 |
+
|
1123 |
+
if (!this.pic) {return false;}//exit if pic is undefined
|
1124 |
+
|
1125 |
+
//dynamically create preview container
|
1126 |
+
if (!this.preview) {
|
1127 |
+
this.preview = document.createElement('DIV');
|
1128 |
+
this.preview.style.display = 'none';
|
1129 |
+
this.pic_container.appendChild(this.preview);
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
if (this.viewmode === 0) {
|
1133 |
+
//hide canvas elements and labels
|
1134 |
+
for (i=0, le = this.areas.length; i<le; i++) {
|
1135 |
+
if (this.areas[i]) {
|
1136 |
+
this.areas[i].style.display = 'none';
|
1137 |
+
if (this.areas[i].label) {this.areas[i].label.style.display = 'none';}
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
//activate image map
|
1141 |
+
this.preview.innerHTML = this.getMapHTML('noscale');
|
1142 |
+
this.pic.setAttribute('border', '0', 0);
|
1143 |
+
this.pic.setAttribute('usemap', '#' + this.mapname, 0);
|
1144 |
+
this.pic.style.cursor = 'auto';
|
1145 |
+
this.viewmode = 1;
|
1146 |
+
this.statusMessage(this.strings.PREVIEW_MODE);
|
1147 |
+
}
|
1148 |
+
else {
|
1149 |
+
//show canvas elements
|
1150 |
+
for (i=0, le = this.areas.length; i<le; i++) {
|
1151 |
+
if (this.areas[i]) {
|
1152 |
+
this.areas[i].style.display = '';
|
1153 |
+
if (this.areas[i].label && this.config.label) {this.areas[i].label.style.display = '';}
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
//clear image map
|
1157 |
+
this.preview.innerHTML = '';
|
1158 |
+
this.pic.style.cursor = this.config.cursor_default;
|
1159 |
+
this.pic.removeAttribute('usemap', 0);
|
1160 |
+
this.viewmode = 0;
|
1161 |
+
this.statusMessage(this.strings.DESIGN_MODE);
|
1162 |
+
this.is_drawing = 0;
|
1163 |
+
}
|
1164 |
+
this.fireEvent('onModeChanged', this.viewmode);
|
1165 |
+
return this.viewmode;
|
1166 |
+
};
|
1167 |
+
|
1168 |
+
|
1169 |
+
/**
|
1170 |
+
* Adds a new area. It will later become a canvas.
|
1171 |
+
* GUI should use the onAddArea callback to act accordingly.
|
1172 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1173 |
+
* @date 2006-06-06 16:49:25
|
1174 |
+
* @see #initArea
|
1175 |
+
*/
|
1176 |
+
imgmap.prototype.addNewArea = function() {
|
1177 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
1178 |
+
var lastarea = this._getLastArea();
|
1179 |
+
var id = (lastarea) ? lastarea.aid + 1 : 0;
|
1180 |
+
//alert(id);
|
1181 |
+
|
1182 |
+
//insert new possibly? unknown area (will be initialized at mousedown)
|
1183 |
+
this.areas[id] = document.createElement('DIV');
|
1184 |
+
this.areas[id].id = this.mapname + 'area' + id;
|
1185 |
+
this.areas[id].aid = id;
|
1186 |
+
this.areas[id].shape = "undefined";
|
1187 |
+
|
1188 |
+
this.currentid = id;
|
1189 |
+
this.fireEvent('onAddArea', id);
|
1190 |
+
return id;
|
1191 |
+
};
|
1192 |
+
|
1193 |
+
|
1194 |
+
/**
|
1195 |
+
* Initialize a new area.
|
1196 |
+
* Create the canvas, initialize it.
|
1197 |
+
* Reset area parameters.
|
1198 |
+
* @param id The id of the area (already existing with undefined shape)
|
1199 |
+
* @param shape The shape the area will have (rect, circle, poly, bezier1)
|
1200 |
+
*/
|
1201 |
+
imgmap.prototype.initArea = function(id, shape) {
|
1202 |
+
if (!this.areas[id]) {return false;}//if all was erased, return
|
1203 |
+
//remove preinited dummy div or already placed canvas
|
1204 |
+
if (this.areas[id].parentNode) {this.areas[id].parentNode.removeChild(this.areas[id]);}
|
1205 |
+
if (this.areas[id].label) {this.areas[id].label.parentNode.removeChild(this.areas[id].label);}
|
1206 |
+
this.areas[id] = null;
|
1207 |
+
//create CANVAS node
|
1208 |
+
this.areas[id] = document.createElement('CANVAS');
|
1209 |
+
this.pic_container.appendChild(this.areas[id]);
|
1210 |
+
this.pic_container.style.position = 'relative';
|
1211 |
+
//alert('init' + typeof G_vmlCanvasManager);
|
1212 |
+
if (typeof G_vmlCanvasManager != "undefined") {
|
1213 |
+
//override CANVAS with VML object
|
1214 |
+
this.areas[id] = G_vmlCanvasManager.initElement(this.areas[id]);
|
1215 |
+
//this.areas[id] = this.pic.parentNode.lastChild;
|
1216 |
+
}
|
1217 |
+
this.areas[id].id = this.mapname + 'area' + id;
|
1218 |
+
this.areas[id].aid = id;
|
1219 |
+
this.areas[id].shape = shape;
|
1220 |
+
this.areas[id].ahref = '';
|
1221 |
+
this.areas[id].atitle = '';
|
1222 |
+
this.areas[id].aalt = '';
|
1223 |
+
this.areas[id].atarget = ''; // '_self';
|
1224 |
+
this.areas[id].style.position = 'absolute';
|
1225 |
+
this.areas[id].style.top = this.pic.offsetTop + 'px';
|
1226 |
+
this.areas[id].style.left = this.pic.offsetLeft + 'px';
|
1227 |
+
this._setopacity(this.areas[id], this.config.CL_DRAW_BG, this.config.draw_opacity);
|
1228 |
+
//hook event handlers
|
1229 |
+
this.areas[id].onmousedown = this.area_mousedown.bind(this);
|
1230 |
+
this.areas[id].onmouseup = this.area_mouseup.bind(this);
|
1231 |
+
this.areas[id].onmousemove = this.area_mousemove.bind(this);
|
1232 |
+
this.areas[id].onmouseover = this.area_mouseover.bind(this);
|
1233 |
+
this.areas[id].onmouseout = this.area_mouseout.bind(this);
|
1234 |
+
//initialize memory object
|
1235 |
+
this.memory[id] = {};
|
1236 |
+
this.memory[id].downx = 0;
|
1237 |
+
this.memory[id].downy = 0;
|
1238 |
+
this.memory[id].left = 0;
|
1239 |
+
this.memory[id].top = 0;
|
1240 |
+
this.memory[id].width = 0;
|
1241 |
+
this.memory[id].height = 0;
|
1242 |
+
this.memory[id].xpoints = [];
|
1243 |
+
this.memory[id].ypoints = [];
|
1244 |
+
//create label node
|
1245 |
+
this.areas[id].label = document.createElement('DIV');
|
1246 |
+
this.pic_container.appendChild(this.areas[id].label);
|
1247 |
+
this.areas[id].label.className = this.config.label_class;
|
1248 |
+
this.assignCSS(this.areas[id].label, this.config.label_style);
|
1249 |
+
this.areas[id].label.style.position = 'absolute';
|
1250 |
+
};
|
1251 |
+
|
1252 |
+
|
1253 |
+
/**
|
1254 |
+
* Resets area border and opacity to a normal state after drawing.
|
1255 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1256 |
+
* @date 15-02-2007 22:07:28
|
1257 |
+
* @param id The id of the area.
|
1258 |
+
* @see #relaxAllAreas
|
1259 |
+
*/
|
1260 |
+
imgmap.prototype.relaxArea = function(id) {
|
1261 |
+
if (!this.areas[id]) {return;}
|
1262 |
+
this.fireEvent('onRelaxArea', id);
|
1263 |
+
this._setBorder(id, 'NORM');
|
1264 |
+
this._setopacity(this.areas[id], this.config.CL_NORM_BG, this.config.norm_opacity);
|
1265 |
+
};
|
1266 |
+
|
1267 |
+
|
1268 |
+
/**
|
1269 |
+
* Resets area border and opacity of all areas.
|
1270 |
+
* Calls relaxArea on each of them.
|
1271 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1272 |
+
* @date 23-04-2007 23:31:09
|
1273 |
+
* @see #relaxArea
|
1274 |
+
*/
|
1275 |
+
imgmap.prototype.relaxAllAreas = function() {
|
1276 |
+
for (var i=0, le = this.areas.length; i<le; i++) {
|
1277 |
+
if (this.areas[i]) {
|
1278 |
+
this.relaxArea(i);
|
1279 |
+
}
|
1280 |
+
}
|
1281 |
+
};
|
1282 |
+
|
1283 |
+
|
1284 |
+
/**
|
1285 |
+
* Set border of a given area according to style flag.
|
1286 |
+
* Possible values of style: NORM, HIGHLIGHT, DRAW.
|
1287 |
+
* Non-rectangle shapes wont get a border if config.bounding_box is false.
|
1288 |
+
* @date 26-12-2008 22:34:41
|
1289 |
+
* @param id The id of the area to set the border on.
|
1290 |
+
* @param style Coloring style (NORM, HIGHLIGHT, DRAW), see relevant colors in config.
|
1291 |
+
* @since 2.1
|
1292 |
+
*/
|
1293 |
+
imgmap.prototype._setBorder = function(id, style) {
|
1294 |
+
if (this.areas[id].shape == 'rect' || this.config.bounding_box) {
|
1295 |
+
this.areas[id].style.borderWidth = '1px';
|
1296 |
+
this.areas[id].style.borderStyle = (style == 'DRAW' ? 'dotted' : 'solid');
|
1297 |
+
this.areas[id].style.borderColor = this.config['CL_' + style + '_' + (this.areas[id].shape == 'rect' ? 'SHAPE' : 'BOX')];
|
1298 |
+
}
|
1299 |
+
else {
|
1300 |
+
//clear border
|
1301 |
+
this.areas[id].style.border = '';
|
1302 |
+
}
|
1303 |
+
};
|
1304 |
+
|
1305 |
+
|
1306 |
+
/**
|
1307 |
+
* Set opacity of area to the given percentage, as well as set the background color.
|
1308 |
+
* If percentage contains a dash(-), the setting of the opacity will be gradual.
|
1309 |
+
* @param area The area object.
|
1310 |
+
* @param bgcolor New background color
|
1311 |
+
* @param pct Percentage of the opacity.
|
1312 |
+
*/
|
1313 |
+
imgmap.prototype._setopacity = function(area, bgcolor, pct) {
|
1314 |
+
if (bgcolor) {area.style.backgroundColor = bgcolor;}
|
1315 |
+
if (pct && typeof pct == 'string' && pct.match(/^\d*\-\d+$/)) {
|
1316 |
+
//gradual fade
|
1317 |
+
var parts = pct.split('-');
|
1318 |
+
if (typeof parts[0] != 'undefined') {
|
1319 |
+
//set initial opacity
|
1320 |
+
parts[0] = parseInt(parts[0], 10);
|
1321 |
+
this._setopacity(area, bgcolor, parts[0]);
|
1322 |
+
}
|
1323 |
+
if (typeof parts[1] != 'undefined') {
|
1324 |
+
parts[1] = parseInt(parts[1], 10);
|
1325 |
+
var curr = this._getopacity(area);
|
1326 |
+
//this.log('curr: '+curr);
|
1327 |
+
var _this = this;
|
1328 |
+
var diff = Math.round(parts[1] - curr);
|
1329 |
+
if (diff > 5) {
|
1330 |
+
window.setTimeout(function () {_this._setopacity(area, null, '-'+parts[1]);}, 20);
|
1331 |
+
pct = 1*curr + 5;
|
1332 |
+
}
|
1333 |
+
else if (diff < -3) {
|
1334 |
+
window.setTimeout(function () {_this._setopacity(area, null, '-'+parts[1]);}, 20);
|
1335 |
+
pct = 1*curr - 3;
|
1336 |
+
}
|
1337 |
+
else {
|
1338 |
+
//final set
|
1339 |
+
pct = parts[1];
|
1340 |
+
}
|
1341 |
+
}
|
1342 |
+
}
|
1343 |
+
if (!isNaN(pct)) {
|
1344 |
+
pct = Math.round(parseInt(pct, 10));
|
1345 |
+
//this.log('set ('+area.aid+'): ' + pct, 1);
|
1346 |
+
area.style.opacity = pct / 100;
|
1347 |
+
area.style.filter = 'alpha(opacity='+pct+')';
|
1348 |
+
}
|
1349 |
+
};
|
1350 |
+
|
1351 |
+
|
1352 |
+
/**
|
1353 |
+
* Get the currently set opacity of a given area.
|
1354 |
+
* @author adam
|
1355 |
+
* @param area The area (canvas) you want to get opacity info from.
|
1356 |
+
* @return Opacity value in a range of 0-100.
|
1357 |
+
*/
|
1358 |
+
imgmap.prototype._getopacity = function(area) {
|
1359 |
+
if (area.style.opacity <= 1) {
|
1360 |
+
return area.style.opacity * 100;
|
1361 |
+
}
|
1362 |
+
if (area.style.filter) {
|
1363 |
+
//alpha(opacity=NaN)
|
1364 |
+
return parseInt(area.style.filter.replace(/alpha\(opacity\=([^\)]*)\)/ig, "$1"), 10);
|
1365 |
+
}
|
1366 |
+
return 100;//default opacity
|
1367 |
+
};
|
1368 |
+
|
1369 |
+
|
1370 |
+
/**
|
1371 |
+
* Removes the area marked by id.
|
1372 |
+
* removeAllAreas will indicate a mass flag so that the output HTML will only be updated at
|
1373 |
+
* the end of the operation.
|
1374 |
+
* Callback will call the GUI code to remove GUI elements.
|
1375 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1376 |
+
* @date 11-02-2007 20:40:58
|
1377 |
+
* @param id The id of the area to remove.
|
1378 |
+
* @param mass Flag to indicate skipping the call of onHtmlChanged callback
|
1379 |
+
* @see #removeAllAreas
|
1380 |
+
*/
|
1381 |
+
imgmap.prototype.removeArea = function(id, mass) {
|
1382 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
1383 |
+
if (id === null || typeof id == "undefined") {return;}//exit if no id given
|
1384 |
+
|
1385 |
+
try {
|
1386 |
+
//remove area and label
|
1387 |
+
//explicitly set some values to null to avoid IE circular reference memleak
|
1388 |
+
this.areas[id].label.parentNode.removeChild(this.areas[id].label);
|
1389 |
+
this.areas[id].parentNode.removeChild(this.areas[id]);
|
1390 |
+
this.areas[id].label.className = null;
|
1391 |
+
//this.areas[id].label.style = null;
|
1392 |
+
//console.log(this.areas[id].label);
|
1393 |
+
this.areas[id].label = null;
|
1394 |
+
this.areas[id].onmouseover = null;
|
1395 |
+
this.areas[id].onmouseout = null;
|
1396 |
+
this.areas[id].onmouseup = null;
|
1397 |
+
this.areas[id].onmousedown = null;
|
1398 |
+
this.areas[id].onmousemove = null;
|
1399 |
+
// console.log(this.areas[id].label);
|
1400 |
+
|
1401 |
+
}
|
1402 |
+
catch (err) {
|
1403 |
+
//alert('noparent');
|
1404 |
+
}
|
1405 |
+
this.areas[id] = null;
|
1406 |
+
this.fireEvent('onRemoveArea', id);
|
1407 |
+
//update grand html
|
1408 |
+
if (!mass) {this.fireEvent('onHtmlChanged', this.getMapHTML());}
|
1409 |
+
};
|
1410 |
+
|
1411 |
+
|
1412 |
+
/**
|
1413 |
+
* Removes all areas.
|
1414 |
+
* Will call removeArea on all areas.
|
1415 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1416 |
+
* @date 2006-06-07 11:55:34
|
1417 |
+
* @see #removeArea
|
1418 |
+
*/
|
1419 |
+
imgmap.prototype.removeAllAreas = function() {
|
1420 |
+
for (var i = 0, le = this.areas.length; i < le; i++) {
|
1421 |
+
if (this.areas[i]) {
|
1422 |
+
this.removeArea(i, true);
|
1423 |
+
}
|
1424 |
+
}
|
1425 |
+
//only call this at the end, use mass param above to avoid calling it in process
|
1426 |
+
this.fireEvent('onHtmlChanged', this.getMapHTML());
|
1427 |
+
};
|
1428 |
+
|
1429 |
+
|
1430 |
+
/**
|
1431 |
+
* Scales all areas.
|
1432 |
+
* Will store scale parameter in globalscale property.
|
1433 |
+
* This is needed to know how to draw new areas on an already scaled canvas.
|
1434 |
+
* @author adam
|
1435 |
+
* @date 02-11-2008 14:13:14
|
1436 |
+
* @param scale Scale factor (1-original, 0.5-half, 2-double, etc.)
|
1437 |
+
*/
|
1438 |
+
imgmap.prototype.scaleAllAreas = function(scale) {
|
1439 |
+
var rscale = 1;//relative scale
|
1440 |
+
try {
|
1441 |
+
rscale = scale / this.globalscale;
|
1442 |
+
}
|
1443 |
+
catch (err) {
|
1444 |
+
this.log("Invalid (global)scale", 1);
|
1445 |
+
}
|
1446 |
+
//console.log('gscale: '+this.globalscale);
|
1447 |
+
//console.log('scale: '+scale);
|
1448 |
+
//console.log('rscale: '+rscale);
|
1449 |
+
|
1450 |
+
this.globalscale = scale;
|
1451 |
+
for (var i = 0, le = this.areas.length; i < le; i++) {
|
1452 |
+
if (this.areas[i] && this.areas[i].shape != 'undefined') {
|
1453 |
+
this.scaleArea(i, rscale);
|
1454 |
+
}
|
1455 |
+
}
|
1456 |
+
};
|
1457 |
+
|
1458 |
+
|
1459 |
+
/**
|
1460 |
+
* Scales one area.
|
1461 |
+
* @author adam
|
1462 |
+
* @date 02-11-2008 14:13:14
|
1463 |
+
* @param rscale Relative scale factor (1-keep, 0.5-half, 2-double, etc.)
|
1464 |
+
*/
|
1465 |
+
imgmap.prototype.scaleArea = function(id, rscale) {
|
1466 |
+
|
1467 |
+
//set position and new dimensions
|
1468 |
+
this.areas[id].style.top = parseInt(this.areas[id].style.top, 10) * rscale + 'px';
|
1469 |
+
this.areas[id].style.left = parseInt(this.areas[id].style.left, 10) * rscale + 'px';
|
1470 |
+
this.setAreaSize(id, this.areas[id].width * rscale, this.areas[id].height * rscale);
|
1471 |
+
|
1472 |
+
//handle polygon/bezier coordinates scaling
|
1473 |
+
if (this.areas[id].shape == 'poly' || this.areas[id].shape == 'bezier1') {
|
1474 |
+
for (var i=0, le = this.areas[id].xpoints.length; i<le; i++) {
|
1475 |
+
this.areas[id].xpoints[i]*= rscale;
|
1476 |
+
this.areas[id].ypoints[i]*= rscale;
|
1477 |
+
}
|
1478 |
+
}
|
1479 |
+
|
1480 |
+
this._repaint(this.areas[id], this.config.CL_NORM_SHAPE);
|
1481 |
+
this._updatecoords(id);
|
1482 |
+
};
|
1483 |
+
|
1484 |
+
|
1485 |
+
/**
|
1486 |
+
* Put label in the top left corner according to label config.
|
1487 |
+
* By default it will contain the number of the area (area.aid)
|
1488 |
+
* @param id The id of the area to add label to.
|
1489 |
+
*/
|
1490 |
+
imgmap.prototype._putlabel = function(id) {
|
1491 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
1492 |
+
if (!this.areas[id].label) {return;}//not yet inited
|
1493 |
+
try {
|
1494 |
+
if (!this.config.label) {
|
1495 |
+
this.areas[id].label.innerHTML = '';
|
1496 |
+
this.areas[id].label.style.display = 'none';
|
1497 |
+
}
|
1498 |
+
else {
|
1499 |
+
this.areas[id].label.style.display = '';
|
1500 |
+
var label = this.config.label;
|
1501 |
+
label = label.replace(/%n/g, String(id));
|
1502 |
+
label = label.replace(/%c/g, String(this.areas[id].lastInput));
|
1503 |
+
label = label.replace(/%h/g, String(this.areas[id].ahref));
|
1504 |
+
label = label.replace(/%a/g, String(this.areas[id].aalt));
|
1505 |
+
label = label.replace(/%t/g, String(this.areas[id].atitle));
|
1506 |
+
this.areas[id].label.innerHTML = label;
|
1507 |
+
}
|
1508 |
+
//align to the top left corner
|
1509 |
+
this.areas[id].label.style.top = this.areas[id].style.top;
|
1510 |
+
this.areas[id].label.style.left = this.areas[id].style.left;
|
1511 |
+
}
|
1512 |
+
catch (err) {
|
1513 |
+
this.log("Error putting label", 1);
|
1514 |
+
}
|
1515 |
+
};
|
1516 |
+
|
1517 |
+
|
1518 |
+
/**
|
1519 |
+
* Set area title and alt (for IE) according to the hint configuration.
|
1520 |
+
* This will show up in the usual yellow box when you hover over with the mouse.
|
1521 |
+
* @param id The id of the area to set hint at.
|
1522 |
+
*/
|
1523 |
+
imgmap.prototype._puthint = function(id) {
|
1524 |
+
try {
|
1525 |
+
if (!this.config.hint) {
|
1526 |
+
this.areas[id].title = '';
|
1527 |
+
this.areas[id].alt = '';
|
1528 |
+
}
|
1529 |
+
else {
|
1530 |
+
var hint = this.config.hint;
|
1531 |
+
hint = hint.replace(/%n/g, String(id));
|
1532 |
+
hint = hint.replace(/%c/g, String(this.areas[id].lastInput));
|
1533 |
+
hint = hint.replace(/%h/g, String(this.areas[id].ahref));
|
1534 |
+
hint = hint.replace(/%a/g, String(this.areas[id].aalt));
|
1535 |
+
hint = hint.replace(/%t/g, String(this.areas[id].atitle));
|
1536 |
+
this.areas[id].title = hint;
|
1537 |
+
this.areas[id].alt = hint;
|
1538 |
+
}
|
1539 |
+
}
|
1540 |
+
catch (err) {
|
1541 |
+
this.log("Error putting hint", 1);
|
1542 |
+
}
|
1543 |
+
};
|
1544 |
+
|
1545 |
+
|
1546 |
+
/**
|
1547 |
+
* Will call repaint on all areas.
|
1548 |
+
* Useful when you change labeling or hint config on the GUI.
|
1549 |
+
* @see #_repaint
|
1550 |
+
*/
|
1551 |
+
imgmap.prototype._repaintAll = function() {
|
1552 |
+
for (var i=0, le = this.areas.length; i<le; i++) {
|
1553 |
+
if (this.areas[i]) {
|
1554 |
+
this._repaint(this.areas[i], this.config.CL_NORM_SHAPE);
|
1555 |
+
}
|
1556 |
+
}
|
1557 |
+
};
|
1558 |
+
|
1559 |
+
|
1560 |
+
/**
|
1561 |
+
* Repaints the actual canvas content.
|
1562 |
+
* This is the only canvas drawing magic that is happening.
|
1563 |
+
* In fact rectangles will not have any canvas content, just a normal css border.
|
1564 |
+
* After repainting the canvas, it will call putlabel and puthint methods.
|
1565 |
+
* @param area The area object.
|
1566 |
+
* @param color Color of the line to draw on the canvas.
|
1567 |
+
* @param x Only used for polygons/beziers as the newest control point x.
|
1568 |
+
* @param y Only used for polygons/beziers as the newest control point y.
|
1569 |
+
*/
|
1570 |
+
imgmap.prototype._repaint = function(area, color, x, y) {
|
1571 |
+
var ctx;//canvas context
|
1572 |
+
var width, height, left, top;//canvas properties
|
1573 |
+
var i;//loop counter
|
1574 |
+
if (area.shape == 'circle') {
|
1575 |
+
width = parseInt(area.style.width, 10);
|
1576 |
+
var radius = Math.floor(width/2) - 1;
|
1577 |
+
//get canvas context
|
1578 |
+
//alert(area.tagName);
|
1579 |
+
ctx = area.getContext("2d");
|
1580 |
+
//clear canvas
|
1581 |
+
ctx.clearRect(0, 0, width, width);
|
1582 |
+
//draw circle
|
1583 |
+
ctx.beginPath();
|
1584 |
+
ctx.strokeStyle = color;
|
1585 |
+
ctx.arc(radius, radius, radius, 0, Math.PI*2, 0);
|
1586 |
+
ctx.stroke();
|
1587 |
+
ctx.closePath();
|
1588 |
+
//draw center
|
1589 |
+
ctx.strokeStyle = this.config.CL_KNOB;
|
1590 |
+
ctx.strokeRect(radius, radius, 1, 1);
|
1591 |
+
//put label
|
1592 |
+
this._putlabel(area.aid);
|
1593 |
+
this._puthint(area.aid);
|
1594 |
+
}
|
1595 |
+
else if (area.shape == 'rect') {
|
1596 |
+
//put label
|
1597 |
+
this._putlabel(area.aid);
|
1598 |
+
this._puthint(area.aid);
|
1599 |
+
}
|
1600 |
+
else if (area.shape == 'poly') {
|
1601 |
+
width = parseInt(area.style.width, 10);
|
1602 |
+
height = parseInt(area.style.height, 10);
|
1603 |
+
left = parseInt(area.style.left, 10);
|
1604 |
+
top = parseInt(area.style.top, 10);
|
1605 |
+
if (area.xpoints) {
|
1606 |
+
//get canvas context
|
1607 |
+
ctx = area.getContext("2d");
|
1608 |
+
//clear canvas
|
1609 |
+
ctx.clearRect(0, 0, width, height);
|
1610 |
+
//draw polygon
|
1611 |
+
ctx.beginPath();
|
1612 |
+
ctx.strokeStyle = color;
|
1613 |
+
ctx.moveTo(area.xpoints[0] - left, area.ypoints[0] - top);
|
1614 |
+
for (i=1, le = area.xpoints.length; i<le; i++) {
|
1615 |
+
ctx.lineTo(area.xpoints[i] - left , area.ypoints[i] - top);
|
1616 |
+
}
|
1617 |
+
if (this.is_drawing == this.DM_POLYGON_DRAW || this.is_drawing == this.DM_POLYGON_LASTDRAW) {
|
1618 |
+
//only draw to the current position if not moving
|
1619 |
+
ctx.lineTo(x - left - 5 , y - top - 5);
|
1620 |
+
}
|
1621 |
+
ctx.lineTo(area.xpoints[0] - left , area.ypoints[0] - top);
|
1622 |
+
ctx.stroke();
|
1623 |
+
ctx.closePath();
|
1624 |
+
}
|
1625 |
+
//put label
|
1626 |
+
this._putlabel(area.aid);
|
1627 |
+
this._puthint(area.aid);
|
1628 |
+
}
|
1629 |
+
else if (area.shape == 'bezier1') {
|
1630 |
+
width = parseInt(area.style.width, 10);
|
1631 |
+
height = parseInt(area.style.height, 10);
|
1632 |
+
left = parseInt(area.style.left, 10);
|
1633 |
+
top = parseInt(area.style.top, 10);
|
1634 |
+
if (area.xpoints) {
|
1635 |
+
//get canvas context
|
1636 |
+
ctx = area.getContext("2d");
|
1637 |
+
//clear canvas
|
1638 |
+
ctx.clearRect(0, 0, width, height);
|
1639 |
+
//draw bezier1 (every second point is control point)
|
1640 |
+
ctx.beginPath();
|
1641 |
+
ctx.strokeStyle = color;
|
1642 |
+
//move to the beginning position
|
1643 |
+
ctx.moveTo(area.xpoints[0] - left, area.ypoints[0] - top);
|
1644 |
+
//draw previous points - use every second point only
|
1645 |
+
for (i=2, le = area.xpoints.length; i<le; i+=2) {
|
1646 |
+
ctx.quadraticCurveTo(area.xpoints[i-1] - left, area.ypoints[i-1] - top, area.xpoints[i] - left, area.ypoints[i] - top);
|
1647 |
+
}
|
1648 |
+
if (this.is_drawing == this.DM_BEZIER_DRAW || this.is_drawing == this.DM_BEZIER_LASTDRAW) {
|
1649 |
+
//only draw to the current position if not moving
|
1650 |
+
if (area.xpoints.length % 2 === 0 && area.xpoints.length > 1) {
|
1651 |
+
//drawing point - draw a curve to it using the previous control point
|
1652 |
+
ctx.quadraticCurveTo(area.xpoints[area.xpoints.length - 1] - left - 5 , area.ypoints[area.ypoints.length - 1] - top - 5, x - left - 5 , y - top - 5);
|
1653 |
+
}
|
1654 |
+
else {
|
1655 |
+
//control point - simply draw a line to it
|
1656 |
+
ctx.lineTo(x - left - 5 , y - top - 5);
|
1657 |
+
}
|
1658 |
+
}
|
1659 |
+
//close area by drawing a line to the first point
|
1660 |
+
ctx.lineTo(area.xpoints[0] - left , area.ypoints[0] - top);
|
1661 |
+
ctx.stroke();
|
1662 |
+
ctx.closePath();
|
1663 |
+
}
|
1664 |
+
//put label
|
1665 |
+
this._putlabel(area.aid);
|
1666 |
+
this._puthint(area.aid);
|
1667 |
+
}
|
1668 |
+
};
|
1669 |
+
|
1670 |
+
|
1671 |
+
/**
|
1672 |
+
* Updates Area coordinates.
|
1673 |
+
* Called when needed, eg. on mousemove, mousedown.
|
1674 |
+
* Also updates html container value (thru hook).
|
1675 |
+
* Calls callback onAreaChanged and onHtmlChanged so that GUI can follow.
|
1676 |
+
* This is an important hook to your GUI.
|
1677 |
+
* Uses globalscale to scale real coordinates to area coordinates.
|
1678 |
+
* @date 2006.10.24. 22:39:27
|
1679 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1680 |
+
* @param id The id of the area.
|
1681 |
+
*/
|
1682 |
+
imgmap.prototype._updatecoords = function(id) {
|
1683 |
+
|
1684 |
+
var left = Math.round(parseInt(this.areas[id].style.left, 10) / this.globalscale);
|
1685 |
+
var top = Math.round(parseInt(this.areas[id].style.top, 10) / this.globalscale);
|
1686 |
+
var height = Math.round(parseInt(this.areas[id].style.height, 10) / this.globalscale);
|
1687 |
+
var width = Math.round(parseInt(this.areas[id].style.width, 10) / this.globalscale);
|
1688 |
+
|
1689 |
+
var value = '';
|
1690 |
+
if (this.areas[id].shape == 'rect') {
|
1691 |
+
value = left + ',' + top + ',' + (left + width) + ',' + (top + height);
|
1692 |
+
this.areas[id].lastInput = value;
|
1693 |
+
}
|
1694 |
+
else if (this.areas[id].shape == 'circle') {
|
1695 |
+
var radius = Math.floor(width/2) - 1;
|
1696 |
+
value = (left + radius) + ',' + (top + radius) + ',' + radius;
|
1697 |
+
this.areas[id].lastInput = value;
|
1698 |
+
}
|
1699 |
+
else if (this.areas[id].shape == 'poly' || this.areas[id].shape == 'bezier1') {
|
1700 |
+
if (this.areas[id].xpoints) {
|
1701 |
+
for (var i=0, le = this.areas[id].xpoints.length; i<le; i++) {
|
1702 |
+
value+= Math.round(this.areas[id].xpoints[i] / this.globalscale) + ',' +
|
1703 |
+
Math.round(this.areas[id].ypoints[i] / this.globalscale) + ',';
|
1704 |
+
}
|
1705 |
+
value = value.substring(0, value.length - 1);
|
1706 |
+
}
|
1707 |
+
this.areas[id].lastInput = value;
|
1708 |
+
}
|
1709 |
+
|
1710 |
+
this.fireEvent('onAreaChanged', this.areas[id]);
|
1711 |
+
this.fireEvent('onHtmlChanged', this.getMapHTML());
|
1712 |
+
};
|
1713 |
+
|
1714 |
+
|
1715 |
+
/**
|
1716 |
+
* Updates the visual representation of the area with the given id according
|
1717 |
+
* to the new coordinates that typically come from an input on the GUI.
|
1718 |
+
* Uses globalscale to scale area coordinates to real coordinates.
|
1719 |
+
* @date 2006.10.24. 22:46:55
|
1720 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
1721 |
+
* @param id The id of the area.
|
1722 |
+
* @param coords The new coords, they will be normalized.
|
1723 |
+
*/
|
1724 |
+
imgmap.prototype._recalculate = function(id, coords) {
|
1725 |
+
try {
|
1726 |
+
if (coords) {
|
1727 |
+
coords = this._normCoords(coords, this.areas[id].shape, 'preserve');
|
1728 |
+
}
|
1729 |
+
else {
|
1730 |
+
coords = this.areas[id].lastInput || '' ;
|
1731 |
+
}
|
1732 |
+
|
1733 |
+
var parts = coords.split(',');
|
1734 |
+
if (this.areas[id].shape == 'rect') {
|
1735 |
+
if (parts.length != 4 ||
|
1736 |
+
parseInt(parts[0], 10) > parseInt(parts[2], 10) ||
|
1737 |
+
parseInt(parts[1], 10) > parseInt(parts[3], 10)) {throw "invalid coords";}
|
1738 |
+
this.areas[id].style.left = this.globalscale * (this.pic.offsetLeft + parseInt(parts[0], 10)) + 'px';
|
1739 |
+
this.areas[id].style.top = this.globalscale * (this.pic.offsetTop + parseInt(parts[1], 10)) + 'px';
|
1740 |
+
this.setAreaSize(id, this.globalscale * (parts[2] - parts[0]), this.globalscale * (parts[3] - parts[1]));
|
1741 |
+
this._repaint(this.areas[id], this.config.CL_NORM_SHAPE);
|
1742 |
+
}
|
1743 |
+
else if (this.areas[id].shape == 'circle') {
|
1744 |
+
if (parts.length != 3 ||
|
1745 |
+
parseInt(parts[2], 10) < 0) {throw "invalid coords";}
|
1746 |
+
var width = 2 * (parts[2]);
|
1747 |
+
//alert(parts[2]);
|
1748 |
+
//alert(width);
|
1749 |
+
this.setAreaSize(id, this.globalscale * width, this.globalscale * width);
|
1750 |
+
this.areas[id].style.left = this.globalscale * (this.pic.offsetLeft + parseInt(parts[0], 10) - width/2) + 'px';
|
1751 |
+
this.areas[id].style.top = this.globalscale * (this.pic.offsetTop + parseInt(parts[1], 10) - width/2) + 'px';
|
1752 |
+
this._repaint(this.areas[id], this.config.CL_NORM_SHAPE);
|
1753 |
+
}
|
1754 |
+
else if (this.areas[id].shape == 'poly' || this.areas[id].shape == 'bezier1') {
|
1755 |
+
if (parts.length < 2) {throw "invalid coords";}
|
1756 |
+
this.areas[id].xpoints = [];
|
1757 |
+
this.areas[id].ypoints = [];
|
1758 |
+
for (var i=0, le = parts.length; i<le; i+=2) {
|
1759 |
+
this.areas[id].xpoints[this.areas[id].xpoints.length] = this.globalscale * (this.pic.offsetLeft + parseInt(parts[i], 10));
|
1760 |
+
this.areas[id].ypoints[this.areas[id].ypoints.length] = this.globalscale * (this.pic.offsetTop + parseInt(parts[i+1], 10));
|
1761 |
+
this._polygongrow(this.areas[id], this.globalscale * parts[i], this.globalscale * parts[i+1]);
|
1762 |
+
}
|
1763 |
+
this._polygonshrink(this.areas[id]);//includes repaint
|
1764 |
+
}
|
1765 |
+
}
|
1766 |
+
catch (err) {
|
1767 |
+
var msg = (err.message) ? err.message : 'error calculating coordinates';
|
1768 |
+
this.log(msg, 1);
|
1769 |
+
this.statusMessage(this.strings.ERR_INVALID_COORDS);
|
1770 |
+
if (this.areas[id].lastInput) {
|
1771 |
+
this.fireEvent('onAreaChanged', this.areas[id]);
|
1772 |
+
}
|
1773 |
+
this._repaint(this.areas[id], this.config.CL_NORM_SHAPE);
|
1774 |
+
return;
|
1775 |
+
}
|
1776 |
+
//on success update lastInput
|
1777 |
+
this.areas[id].lastInput = coords;
|
1778 |
+
};
|
1779 |
+
|
1780 |
+
|
1781 |
+
/**
|
1782 |
+
* Grow polygon area to be able to contain the given new coordinates.
|
1783 |
+
* @author adam
|
1784 |
+
* @param area The area to grow.
|
1785 |
+
* @param newx The new coordinate x.
|
1786 |
+
* @param newy The new coordinate y.
|
1787 |
+
* @see #_polygonshrink
|
1788 |
+
*/
|
1789 |
+
imgmap.prototype._polygongrow = function(area, newx, newy) {
|
1790 |
+
//this.log('pgrow');
|
1791 |
+
var xdiff = newx - parseInt(area.style.left, 10);
|
1792 |
+
var ydiff = newy - parseInt(area.style.top , 10);
|
1793 |
+
var pad = 0;//padding on the edges
|
1794 |
+
var pad2 = 0;//twice the padding
|
1795 |
+
|
1796 |
+
if (newx < parseInt(area.style.left, 10)) {
|
1797 |
+
area.style.left = (newx - pad) + 'px';
|
1798 |
+
this.setAreaSize(area.aid, parseInt(area.style.width, 10) + Math.abs(xdiff) + pad2, null);
|
1799 |
+
}
|
1800 |
+
else if (newx > parseInt(area.style.left, 10) + parseInt(area.style.width, 10)) {
|
1801 |
+
this.setAreaSize(area.aid, newx - parseInt(area.style.left, 10) + pad2, null);
|
1802 |
+
}
|
1803 |
+
if (newy < parseInt(area.style.top, 10)) {
|
1804 |
+
area.style.top = (newy - pad) + 'px';
|
1805 |
+
this.setAreaSize(area.aid, null, parseInt(area.style.height, 10) + Math.abs(ydiff) + pad2);
|
1806 |
+
}
|
1807 |
+
else if (newy > parseInt(area.style.top, 10) + parseInt(area.style.height, 10)) {
|
1808 |
+
this.setAreaSize(area.aid, null, newy - parseInt(area.style.top, 10) + pad2);
|
1809 |
+
}
|
1810 |
+
};
|
1811 |
+
|
1812 |
+
|
1813 |
+
/**
|
1814 |
+
* Shrink the polygon bounding area to the necessary size, by first reducing it
|
1815 |
+
* to the minimum, and then gradually growing it.
|
1816 |
+
* We need this because while we were drawing the polygon, it might have expanded
|
1817 |
+
* the canvas more than needed.
|
1818 |
+
* Will repaint the area.
|
1819 |
+
* @author adam
|
1820 |
+
* @param area The area to shrink.
|
1821 |
+
* @see #_polygongrow
|
1822 |
+
*/
|
1823 |
+
imgmap.prototype._polygonshrink = function(area) {
|
1824 |
+
//this.log('pshrink');
|
1825 |
+
area.style.left = (area.xpoints[0]) + 'px';
|
1826 |
+
area.style.top = (area.ypoints[0]) + 'px';
|
1827 |
+
this.setAreaSize(area.aid, 0, 0);
|
1828 |
+
for (var i=0, le = area.xpoints.length; i<le; i++) {
|
1829 |
+
this._polygongrow(area, area.xpoints[i], area.ypoints[i]);
|
1830 |
+
}
|
1831 |
+
this._repaint(area, this.config.CL_NORM_SHAPE);
|
1832 |
+
};
|
1833 |
+
|
1834 |
+
|
1835 |
+
/**
|
1836 |
+
* EVENT HANDLER: Handles mousemove on the image.
|
1837 |
+
* This is the main drawing routine.
|
1838 |
+
* Depending on the current shape, will draw the rect/circle/poly to the new position.
|
1839 |
+
* @param e The event object.
|
1840 |
+
*/
|
1841 |
+
imgmap.prototype.img_mousemove = function(e) {
|
1842 |
+
//function level var declarations
|
1843 |
+
var x;
|
1844 |
+
var y;
|
1845 |
+
var xdiff;
|
1846 |
+
var ydiff;
|
1847 |
+
var diff;
|
1848 |
+
|
1849 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
1850 |
+
//event.x is relative to parent element, but page.x is NOT
|
1851 |
+
//pos coordinates are the same absolute coords, offset coords are relative to parent
|
1852 |
+
var pos = this._getPos(this.pic);
|
1853 |
+
x = (this.isMSIE) ? (window.event.x - this.pic.offsetLeft) : (e.pageX - pos.x);
|
1854 |
+
y = (this.isMSIE) ? (window.event.y - this.pic.offsetTop) : (e.pageY - pos.y);
|
1855 |
+
x = x + this.pic_container.scrollLeft;
|
1856 |
+
y = y + this.pic_container.scrollTop;
|
1857 |
+
|
1858 |
+
|
1859 |
+
//this.log(x + ' - ' + y + ': ' + this.memory[this.currentid].downx + ' - ' +this.memory[this.currentid].downy);
|
1860 |
+
|
1861 |
+
//exit if outside image
|
1862 |
+
if (x<0 || y<0 || x>this.pic.width || y>this.pic.height) {return;}
|
1863 |
+
|
1864 |
+
//old dimensions that need to be updated in this function
|
1865 |
+
if (this.memory[this.currentid]) {
|
1866 |
+
var top = this.memory[this.currentid].top;
|
1867 |
+
var left = this.memory[this.currentid].left;
|
1868 |
+
var height = this.memory[this.currentid].height;
|
1869 |
+
var width = this.memory[this.currentid].width;
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
// Handle shift state for Safari
|
1873 |
+
// Safari doesn't generate keyboard events for modifiers: http://bugs.webkit.org/show_bug.cgi?id=11696
|
1874 |
+
if (this.isSafari) {
|
1875 |
+
if (e.shiftKey) {
|
1876 |
+
if (this.is_drawing == this.DM_RECTANGLE_DRAW) {
|
1877 |
+
this.is_drawing = this.DM_SQUARE_DRAW;
|
1878 |
+
this.statusMessage(this.strings.SQUARE2_DRAW);
|
1879 |
+
}
|
1880 |
+
}
|
1881 |
+
else {
|
1882 |
+
if (this.is_drawing == this.DM_SQUARE_DRAW && this.areas[this.currentid].shape == 'rect') {
|
1883 |
+
//not for circle!
|
1884 |
+
this.is_drawing = this.DM_RECTANGLE_DRAW;
|
1885 |
+
this.statusMessage(this.strings.RECTANGLE_DRAW);
|
1886 |
+
}
|
1887 |
+
}
|
1888 |
+
}
|
1889 |
+
|
1890 |
+
|
1891 |
+
if (this.is_drawing == this.DM_RECTANGLE_DRAW) {
|
1892 |
+
//rectangle mode
|
1893 |
+
this.fireEvent('onDrawArea', this.currentid);
|
1894 |
+
xdiff = x - this.memory[this.currentid].downx;
|
1895 |
+
ydiff = y - this.memory[this.currentid].downy;
|
1896 |
+
//alert(xdiff);
|
1897 |
+
this.setAreaSize(this.currentid, Math.abs(xdiff), Math.abs(ydiff));
|
1898 |
+
if (xdiff < 0) {
|
1899 |
+
this.areas[this.currentid].style.left = (x + 1) + 'px';
|
1900 |
+
}
|
1901 |
+
if (ydiff < 0) {
|
1902 |
+
this.areas[this.currentid].style.top = (y + 1) + 'px';
|
1903 |
+
}
|
1904 |
+
}
|
1905 |
+
else if (this.is_drawing == this.DM_SQUARE_DRAW) {
|
1906 |
+
//square mode - align to shorter side
|
1907 |
+
this.fireEvent('onDrawArea', this.currentid);
|
1908 |
+
xdiff = x - this.memory[this.currentid].downx;
|
1909 |
+
ydiff = y - this.memory[this.currentid].downy;
|
1910 |
+
if (Math.abs(xdiff) < Math.abs(ydiff)) {
|
1911 |
+
diff = Math.abs(parseInt(xdiff, 10));
|
1912 |
+
}
|
1913 |
+
else {
|
1914 |
+
diff = Math.abs(parseInt(ydiff, 10));
|
1915 |
+
}
|
1916 |
+
//alert(xdiff);
|
1917 |
+
this.setAreaSize(this.currentid, diff, diff);
|
1918 |
+
if (xdiff < 0) {
|
1919 |
+
this.areas[this.currentid].style.left = (this.memory[this.currentid].downx + diff*-1) + 'px';
|
1920 |
+
}
|
1921 |
+
if (ydiff < 0) {
|
1922 |
+
this.areas[this.currentid].style.top = (this.memory[this.currentid].downy + diff*-1 + 1) + 'px';
|
1923 |
+
}
|
1924 |
+
}
|
1925 |
+
else if (this.is_drawing == this.DM_POLYGON_DRAW || this.is_drawing == this.DM_BEZIER_DRAW) {
|
1926 |
+
//polygon or bezier mode
|
1927 |
+
this.fireEvent('onDrawArea', this.currentid);
|
1928 |
+
this._polygongrow(this.areas[this.currentid], x, y);
|
1929 |
+
}
|
1930 |
+
else if (this.is_drawing == this.DM_RECTANGLE_MOVE || this.is_drawing == this.DM_SQUARE_MOVE) {
|
1931 |
+
this.fireEvent('onMoveArea', this.currentid);
|
1932 |
+
x = x - this.memory[this.currentid].rdownx;
|
1933 |
+
y = y - this.memory[this.currentid].rdowny;
|
1934 |
+
if (x + width > this.pic.width || y + height > this.pic.height) {return;}
|
1935 |
+
if (x < 0 || y < 0) {return;}
|
1936 |
+
//this.log(x + ' - '+width+ '+'+this.memory[this.currentid].rdownx +'='+xdiff );
|
1937 |
+
this.areas[this.currentid].style.left = x + 1 + 'px';
|
1938 |
+
this.areas[this.currentid].style.top = y + 1 + 'px';
|
1939 |
+
}
|
1940 |
+
else if (this.is_drawing == this.DM_POLYGON_MOVE || this.is_drawing == this.DM_BEZIER_MOVE) {
|
1941 |
+
this.fireEvent('onMoveArea', this.currentid);
|
1942 |
+
x = x - this.memory[this.currentid].rdownx;
|
1943 |
+
y = y - this.memory[this.currentid].rdowny;
|
1944 |
+
if (x + width > this.pic.width || y + height > this.pic.height) {return;}
|
1945 |
+
if (x < 0 || y < 0) {return;}
|
1946 |
+
xdiff = x - left;
|
1947 |
+
ydiff = y - top;
|
1948 |
+
if (this.areas[this.currentid].xpoints) {
|
1949 |
+
for (var i=0, le = this.areas[this.currentid].xpoints.length; i<le; i++) {
|
1950 |
+
this.areas[this.currentid].xpoints[i] = this.memory[this.currentid].xpoints[i] + xdiff;
|
1951 |
+
this.areas[this.currentid].ypoints[i] = this.memory[this.currentid].ypoints[i] + ydiff;
|
1952 |
+
}
|
1953 |
+
}
|
1954 |
+
this.areas[this.currentid].style.left = x + 'px';
|
1955 |
+
this.areas[this.currentid].style.top = y + 'px';
|
1956 |
+
}
|
1957 |
+
else if (this.is_drawing == this.DM_SQUARE_RESIZE_LEFT) {
|
1958 |
+
this.fireEvent('onResizeArea', this.currentid);
|
1959 |
+
diff = x - left;
|
1960 |
+
//alert(diff);
|
1961 |
+
if ((width + (-1 * diff)) > 0) {
|
1962 |
+
//real resize left
|
1963 |
+
this.areas[this.currentid].style.left = x + 1 + 'px';
|
1964 |
+
this.areas[this.currentid].style.top = (top + (diff/2)) + 'px';
|
1965 |
+
this.setAreaSize(this.currentid, parseInt(width + (-1 * diff), 10), parseInt(height + (-1 * diff), 10));
|
1966 |
+
}
|
1967 |
+
else {
|
1968 |
+
//jump to another state
|
1969 |
+
this.memory[this.currentid].width = 0;
|
1970 |
+
this.memory[this.currentid].height = 0;
|
1971 |
+
this.memory[this.currentid].left = x;
|
1972 |
+
this.memory[this.currentid].top = y;
|
1973 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_RIGHT;
|
1974 |
+
}
|
1975 |
+
}
|
1976 |
+
else if (this.is_drawing == this.DM_SQUARE_RESIZE_RIGHT) {
|
1977 |
+
this.fireEvent('onResizeArea', this.currentid);
|
1978 |
+
diff = x - left - width;
|
1979 |
+
if ((width + (diff)) - 1 > 0) {
|
1980 |
+
//real resize right
|
1981 |
+
this.areas[this.currentid].style.top = (top + (-1* diff/2)) + 'px';
|
1982 |
+
this.setAreaSize(this.currentid, (width + (diff)) - 1, (height + (diff)));
|
1983 |
+
}
|
1984 |
+
else {
|
1985 |
+
//jump to another state
|
1986 |
+
this.memory[this.currentid].width = 0;
|
1987 |
+
this.memory[this.currentid].height = 0;
|
1988 |
+
this.memory[this.currentid].left = x;
|
1989 |
+
this.memory[this.currentid].top = y;
|
1990 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_LEFT;
|
1991 |
+
}
|
1992 |
+
}
|
1993 |
+
else if (this.is_drawing == this.DM_SQUARE_RESIZE_TOP) {
|
1994 |
+
this.fireEvent('onResizeArea', this.currentid);
|
1995 |
+
diff = y - top;
|
1996 |
+
if ((width + (-1 * diff)) > 0) {
|
1997 |
+
//real resize top
|
1998 |
+
this.areas[this.currentid].style.top = y + 1 + 'px';
|
1999 |
+
this.areas[this.currentid].style.left = (left + (diff/2)) + 'px';
|
2000 |
+
this.setAreaSize(this.currentid, (width + (-1 * diff)), (height + (-1 * diff)));
|
2001 |
+
}
|
2002 |
+
else {
|
2003 |
+
//jump to another state
|
2004 |
+
this.memory[this.currentid].width = 0;
|
2005 |
+
this.memory[this.currentid].height = 0;
|
2006 |
+
this.memory[this.currentid].left = x;
|
2007 |
+
this.memory[this.currentid].top = y;
|
2008 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_BOTTOM;
|
2009 |
+
}
|
2010 |
+
}
|
2011 |
+
else if (this.is_drawing == this.DM_SQUARE_RESIZE_BOTTOM) {
|
2012 |
+
this.fireEvent('onResizeArea', this.currentid);
|
2013 |
+
diff = y - top - height;
|
2014 |
+
if ((width + (diff)) - 1 > 0) {
|
2015 |
+
//real resize bottom
|
2016 |
+
this.areas[this.currentid].style.left = (left + (-1* diff/2)) + 'px';
|
2017 |
+
this.setAreaSize(this.currentid, (width + (diff)) - 1 , (height + (diff)) - 1);
|
2018 |
+
}
|
2019 |
+
else {
|
2020 |
+
//jump to another state
|
2021 |
+
this.memory[this.currentid].width = 0;
|
2022 |
+
this.memory[this.currentid].height = 0;
|
2023 |
+
this.memory[this.currentid].left = x;
|
2024 |
+
this.memory[this.currentid].top = y;
|
2025 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_TOP;
|
2026 |
+
}
|
2027 |
+
}
|
2028 |
+
else if (this.is_drawing == this.DM_RECTANGLE_RESIZE_LEFT) {
|
2029 |
+
this.fireEvent('onResizeArea', this.currentid);
|
2030 |
+
xdiff = x - left;
|
2031 |
+
if (width + (-1 * xdiff) > 0) {
|
2032 |
+
//real resize left
|
2033 |
+
this.areas[this.currentid].style.left = x + 1 + 'px';
|
2034 |
+
this.setAreaSize(this.currentid, width + (-1 * xdiff), null);
|
2035 |
+
}
|
2036 |
+
else {
|
2037 |
+
//jump to another state
|
2038 |
+
this.memory[this.currentid].width = 0;
|
2039 |
+
this.memory[this.currentid].left = x;
|
2040 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_RIGHT;
|
2041 |
+
}
|
2042 |
+
}
|
2043 |
+
else if (this.is_drawing == this.DM_RECTANGLE_RESIZE_RIGHT) {
|
2044 |
+
this.fireEvent('onResizeArea', this.currentid);
|
2045 |
+
xdiff = x - left - width;
|
2046 |
+
if ((width + (xdiff)) - 1 > 0) {
|
2047 |
+
//real resize right
|
2048 |
+
this.setAreaSize(this.currentid, (width + (xdiff)) - 1, null);
|
2049 |
+
}
|
2050 |
+
else {
|
2051 |
+
//jump to another state
|
2052 |
+
this.memory[this.currentid].width = 0;
|
2053 |
+
this.memory[this.currentid].left = x;
|
2054 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_LEFT;
|
2055 |
+
}
|
2056 |
+
}
|
2057 |
+
else if (this.is_drawing == this.DM_RECTANGLE_RESIZE_TOP) {
|
2058 |
+
this.fireEvent('onResizeArea', this.currentid);
|
2059 |
+
ydiff = y - top;
|
2060 |
+
if ((height + (-1 * ydiff)) > 0) {
|
2061 |
+
//real resize top
|
2062 |
+
this.areas[this.currentid].style.top = y + 1 + 'px';
|
2063 |
+
this.setAreaSize(this.currentid, null, (height + (-1 * ydiff)));
|
2064 |
+
}
|
2065 |
+
else {
|
2066 |
+
//jump to another state
|
2067 |
+
this.memory[this.currentid].height = 0;
|
2068 |
+
this.memory[this.currentid].top = y;
|
2069 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_BOTTOM;
|
2070 |
+
}
|
2071 |
+
}
|
2072 |
+
else if (this.is_drawing == this.DM_RECTANGLE_RESIZE_BOTTOM) {
|
2073 |
+
this.fireEvent('onResizeArea', this.currentid);
|
2074 |
+
ydiff = y - top - height;
|
2075 |
+
if ((height + (ydiff)) - 1 > 0) {
|
2076 |
+
//real resize bottom
|
2077 |
+
this.setAreaSize(this.currentid, null, (height + (ydiff)) - 1);
|
2078 |
+
}
|
2079 |
+
else {
|
2080 |
+
//jump to another state
|
2081 |
+
this.memory[this.currentid].height = 0;
|
2082 |
+
this.memory[this.currentid].top = y;
|
2083 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_TOP;
|
2084 |
+
}
|
2085 |
+
}
|
2086 |
+
|
2087 |
+
//repaint canvas elements
|
2088 |
+
if (this.is_drawing) {
|
2089 |
+
this._repaint(this.areas[this.currentid], this.config.CL_DRAW_SHAPE, x, y);
|
2090 |
+
this._updatecoords(this.currentid);
|
2091 |
+
}
|
2092 |
+
|
2093 |
+
};
|
2094 |
+
|
2095 |
+
|
2096 |
+
/**
|
2097 |
+
* EVENT HANDLER: Handles mouseup on the image.
|
2098 |
+
* Handles dragging and resizing.
|
2099 |
+
* @param e The event object.
|
2100 |
+
*/
|
2101 |
+
imgmap.prototype.img_mouseup = function(e) {
|
2102 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2103 |
+
//console.log('img_mouseup');
|
2104 |
+
//if (!this.props[this.currentid]) return;
|
2105 |
+
var pos = this._getPos(this.pic);
|
2106 |
+
var x = (this.isMSIE) ? (window.event.x - this.pic.offsetLeft) : (e.pageX - pos.x);
|
2107 |
+
var y = (this.isMSIE) ? (window.event.y - this.pic.offsetTop) : (e.pageY - pos.y);
|
2108 |
+
x = x + this.pic_container.scrollLeft;
|
2109 |
+
y = y + this.pic_container.scrollTop;
|
2110 |
+
//for everything that is move or resize
|
2111 |
+
if (this.is_drawing != this.DM_RECTANGLE_DRAW &&
|
2112 |
+
this.is_drawing != this.DM_SQUARE_DRAW &&
|
2113 |
+
this.is_drawing != this.DM_POLYGON_DRAW &&
|
2114 |
+
this.is_drawing != this.DM_POLYGON_LASTDRAW &&
|
2115 |
+
this.is_drawing != this.DM_BEZIER_DRAW &&
|
2116 |
+
this.is_drawing != this.DM_BEZIER_LASTDRAW) {
|
2117 |
+
//end dragging
|
2118 |
+
this.draggedId = null;
|
2119 |
+
//finish state
|
2120 |
+
this.is_drawing = 0;
|
2121 |
+
this.statusMessage(this.strings.READY);
|
2122 |
+
this.relaxArea(this.currentid);
|
2123 |
+
if (this.areas[this.currentid] == this._getLastArea()) {
|
2124 |
+
//if (this.config.mode != "editor2") this.addNewArea();
|
2125 |
+
return;
|
2126 |
+
}
|
2127 |
+
this.memory[this.currentid].downx = x;
|
2128 |
+
this.memory[this.currentid].downy = y;
|
2129 |
+
}
|
2130 |
+
};
|
2131 |
+
|
2132 |
+
|
2133 |
+
/**
|
2134 |
+
* EVENT HANDLER: Handles mousedown on the image.
|
2135 |
+
* Handles beggining or end of draw, or polygon/bezier point set.
|
2136 |
+
* @param e The event object.
|
2137 |
+
*/
|
2138 |
+
imgmap.prototype.img_mousedown = function(e) {
|
2139 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2140 |
+
if (!this.areas[this.currentid] && this.config.mode != "editor2") {return;}
|
2141 |
+
//console.log('img_mousedown');
|
2142 |
+
var pos = this._getPos(this.pic);
|
2143 |
+
|
2144 |
+
var x = (this.isMSIE) ? (window.event.x - this.pic.offsetLeft) : (e.pageX - pos.x);
|
2145 |
+
var y = (this.isMSIE) ? (window.event.y - this.pic.offsetTop) : (e.pageY - pos.y);
|
2146 |
+
x = x + this.pic_container.scrollLeft;
|
2147 |
+
y = y + this.pic_container.scrollTop;
|
2148 |
+
|
2149 |
+
// Handle the Shift state
|
2150 |
+
if (!e) {
|
2151 |
+
e = window.event;
|
2152 |
+
}
|
2153 |
+
|
2154 |
+
if (e.shiftKey) {
|
2155 |
+
if (this.is_drawing == this.DM_POLYGON_DRAW) {
|
2156 |
+
this.is_drawing = this.DM_POLYGON_LASTDRAW;
|
2157 |
+
}
|
2158 |
+
else if (this.is_drawing == this.DM_BEZIER_DRAW) {
|
2159 |
+
this.is_drawing = this.DM_BEZIER_LASTDRAW;
|
2160 |
+
}
|
2161 |
+
}
|
2162 |
+
//console.log(this.is_drawing);
|
2163 |
+
//this.statusMessage(x + ' - ' + y + ': ' + this.props[this.currentid].getElementsByTagName('select')[0].value);
|
2164 |
+
if (this.is_drawing == this.DM_POLYGON_DRAW || this.is_drawing == this.DM_BEZIER_DRAW) {
|
2165 |
+
//its not finish state yet
|
2166 |
+
this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length] = x - 5;
|
2167 |
+
this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length] = y - 5;
|
2168 |
+
this.memory[this.currentid].downx = x;
|
2169 |
+
this.memory[this.currentid].downy = y;
|
2170 |
+
return;
|
2171 |
+
}
|
2172 |
+
else if (this.is_drawing && this.is_drawing != this.DM_POLYGON_DRAW && this.is_drawing != this.DM_BEZIER_DRAW) {
|
2173 |
+
//finish any other state
|
2174 |
+
if (this.is_drawing == this.DM_POLYGON_LASTDRAW || this.is_drawing == this.DM_BEZIER_LASTDRAW) {
|
2175 |
+
//add last controlpoint and update coords
|
2176 |
+
this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length] = x - 5;
|
2177 |
+
this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length] = y - 5;
|
2178 |
+
this._updatecoords(this.currentid);
|
2179 |
+
this.is_drawing = 0;
|
2180 |
+
this._polygonshrink(this.areas[this.currentid]);
|
2181 |
+
}
|
2182 |
+
this.is_drawing = 0;
|
2183 |
+
this.statusMessage(this.strings.READY);
|
2184 |
+
this.relaxArea(this.currentid);
|
2185 |
+
if (this.areas[this.currentid] == this._getLastArea()) {
|
2186 |
+
//editor mode adds next area automatically
|
2187 |
+
if (this.config.mode != "editor2") {this.addNewArea();}
|
2188 |
+
return;
|
2189 |
+
}
|
2190 |
+
return;
|
2191 |
+
}
|
2192 |
+
|
2193 |
+
if (this.config.mode == "editor2") {
|
2194 |
+
if (!this.nextShape) {return;}
|
2195 |
+
this.addNewArea();
|
2196 |
+
//console.log("init: " + this.nextShape);
|
2197 |
+
this.initArea(this.currentid, this.nextShape);
|
2198 |
+
}
|
2199 |
+
else if (this.areas[this.currentid].shape == 'undefined' || this.areas[this.currentid].shape == 'poly') {
|
2200 |
+
//var shape = (this.props[this.currentid]) ? this.props[this.currentid].getElementsByTagName('select')[0].value : this.nextShape;
|
2201 |
+
var shape = this.nextShape;
|
2202 |
+
if (!shape) {shape = 'rect';}
|
2203 |
+
//console.log("init: " + shape);
|
2204 |
+
this.initArea(this.currentid, shape);
|
2205 |
+
}
|
2206 |
+
if (this.areas[this.currentid].shape == 'poly') {
|
2207 |
+
this.is_drawing = this.DM_POLYGON_DRAW;
|
2208 |
+
this.statusMessage(this.strings.POLYGON_DRAW);
|
2209 |
+
|
2210 |
+
this.areas[this.currentid].style.left = x + 'px';
|
2211 |
+
this.areas[this.currentid].style.top = y + 'px';
|
2212 |
+
this.areas[this.currentid].style.width = 0;
|
2213 |
+
this.areas[this.currentid].style.height = 0;
|
2214 |
+
this.areas[this.currentid].xpoints = [];
|
2215 |
+
this.areas[this.currentid].ypoints = [];
|
2216 |
+
this.areas[this.currentid].xpoints[0] = x;
|
2217 |
+
this.areas[this.currentid].ypoints[0] = y;
|
2218 |
+
}
|
2219 |
+
else if (this.areas[this.currentid].shape == 'bezier1') {
|
2220 |
+
this.is_drawing = this.DM_BEZIER_DRAW;
|
2221 |
+
this.statusMessage(this.strings.BEZIER_DRAW);
|
2222 |
+
|
2223 |
+
this.areas[this.currentid].style.left = x + 'px';
|
2224 |
+
this.areas[this.currentid].style.top = y + 'px';
|
2225 |
+
this.areas[this.currentid].style.width = 0;
|
2226 |
+
this.areas[this.currentid].style.height = 0;
|
2227 |
+
this.areas[this.currentid].xpoints = [];
|
2228 |
+
this.areas[this.currentid].ypoints = [];
|
2229 |
+
this.areas[this.currentid].xpoints[0] = x;
|
2230 |
+
this.areas[this.currentid].ypoints[0] = y;
|
2231 |
+
}
|
2232 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2233 |
+
this.is_drawing = this.DM_RECTANGLE_DRAW;
|
2234 |
+
this.statusMessage(this.strings.RECTANGLE_DRAW);
|
2235 |
+
|
2236 |
+
this.areas[this.currentid].style.left = x + 'px';
|
2237 |
+
this.areas[this.currentid].style.top = y + 'px';
|
2238 |
+
this.areas[this.currentid].style.width = 0;
|
2239 |
+
this.areas[this.currentid].style.height = 0;
|
2240 |
+
}
|
2241 |
+
else if (this.areas[this.currentid].shape == 'circle') {
|
2242 |
+
this.is_drawing = this.DM_SQUARE_DRAW;
|
2243 |
+
this.statusMessage(this.strings.SQUARE_DRAW);
|
2244 |
+
|
2245 |
+
this.areas[this.currentid].style.left = x + 'px';
|
2246 |
+
this.areas[this.currentid].style.top = y + 'px';
|
2247 |
+
this.areas[this.currentid].style.width = 0;
|
2248 |
+
this.areas[this.currentid].style.height = 0;
|
2249 |
+
}
|
2250 |
+
|
2251 |
+
this._setBorder(this.currentid, 'DRAW');
|
2252 |
+
this.memory[this.currentid].downx = x;
|
2253 |
+
this.memory[this.currentid].downy = y;
|
2254 |
+
};
|
2255 |
+
|
2256 |
+
|
2257 |
+
/**
|
2258 |
+
* Highlights a given area.
|
2259 |
+
* Sets opacity and repaints.
|
2260 |
+
* @date 2007.12.28. 18:23:00
|
2261 |
+
* @param id The id of the area to blur.
|
2262 |
+
* @param flag Modifier, possible values: grad - for gradual fade in
|
2263 |
+
*/
|
2264 |
+
imgmap.prototype.highlightArea = function(id, flag) {
|
2265 |
+
if (this.is_drawing) {return;}//exit if in drawing state
|
2266 |
+
if (this.areas[id] && this.areas[id].shape != 'undefined') {
|
2267 |
+
//area exists - highlight it
|
2268 |
+
this.fireEvent('onFocusArea', this.areas[id]);
|
2269 |
+
this._setBorder(id, 'HIGHLIGHT');
|
2270 |
+
var opacity = this.config.highlight_opacity;
|
2271 |
+
if (flag == 'grad') {
|
2272 |
+
//apply gradient opacity
|
2273 |
+
opacity = '-' + opacity;
|
2274 |
+
}
|
2275 |
+
this._setopacity(this.areas[id], this.config.CL_HIGHLIGHT_BG, opacity);
|
2276 |
+
this._repaint(this.areas[id], this.config.CL_HIGHLIGHT_SHAPE);
|
2277 |
+
}
|
2278 |
+
};
|
2279 |
+
|
2280 |
+
|
2281 |
+
/**
|
2282 |
+
* Blurs a given area.
|
2283 |
+
* Sets opacity and repaints.
|
2284 |
+
* @date 2007.12.28. 18:23:26
|
2285 |
+
* @param id The id of the area to blur.
|
2286 |
+
* @param flag Modifier, possible values: grad - for gradual fade out
|
2287 |
+
*/
|
2288 |
+
imgmap.prototype.blurArea = function(id, flag) {
|
2289 |
+
if (this.is_drawing) {return;}//exit if in drawing state
|
2290 |
+
if (this.areas[id] && this.areas[id].shape != 'undefined') {
|
2291 |
+
//area exists - fade it back
|
2292 |
+
this.fireEvent('onBlurArea', this.areas[id]);
|
2293 |
+
this._setBorder(id, 'NORM');
|
2294 |
+
var opacity = this.config.norm_opacity;
|
2295 |
+
if (flag == 'grad') {
|
2296 |
+
//apply gradient opacity
|
2297 |
+
opacity = '-' + opacity;
|
2298 |
+
}
|
2299 |
+
this._setopacity(this.areas[id], this.config.CL_NORM_BG, opacity);
|
2300 |
+
this._repaint(this.areas[id], this.config.CL_NORM_SHAPE);
|
2301 |
+
}
|
2302 |
+
};
|
2303 |
+
|
2304 |
+
|
2305 |
+
/**
|
2306 |
+
* EVENT HANDLER: Handles event of mousemove on imgmap areas.
|
2307 |
+
* - changes cursor depending where we are inside the area (buggy in opera)
|
2308 |
+
* - handles area resize
|
2309 |
+
* - handles area move
|
2310 |
+
* @url http://evolt.org/article/Mission_Impossible_mouse_position/17/23335/index.html
|
2311 |
+
* @url http://my.opera.com/community/forums/topic.dml?id=239498&t=1217158015&page=1
|
2312 |
+
* @author adam
|
2313 |
+
* @param e The event object.
|
2314 |
+
*/
|
2315 |
+
imgmap.prototype.area_mousemove = function(e) {
|
2316 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2317 |
+
if (!this.is_drawing) {
|
2318 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
2319 |
+
if (obj.tagName == 'DIV') {
|
2320 |
+
//do this because of label
|
2321 |
+
obj = obj.parentNode;
|
2322 |
+
}
|
2323 |
+
if (obj.tagName == 'image' || obj.tagName == 'group' ||
|
2324 |
+
obj.tagName == 'shape' || obj.tagName == 'stroke') {
|
2325 |
+
//do this because of excanvas
|
2326 |
+
obj = obj.parentNode.parentNode;
|
2327 |
+
}
|
2328 |
+
//opera fix - adam - 04-12-2007 23:14:05
|
2329 |
+
if (this.isOpera) {
|
2330 |
+
e.layerX = e.offsetX;
|
2331 |
+
e.layerY = e.offsetY;
|
2332 |
+
}
|
2333 |
+
var xdiff = (this.isMSIE) ? (window.event.offsetX) : (e.layerX);
|
2334 |
+
var ydiff = (this.isMSIE) ? (window.event.offsetY) : (e.layerY);
|
2335 |
+
//this.log(obj.aid + ' : ' + xdiff + ',' + ydiff);
|
2336 |
+
var resizable = (obj.shape == 'rect' || obj.shape == 'circle');
|
2337 |
+
if (resizable && xdiff < 6 && ydiff > 6) {
|
2338 |
+
//move left
|
2339 |
+
obj.style.cursor = 'w-resize';
|
2340 |
+
}
|
2341 |
+
else if (resizable && xdiff > parseInt(obj.style.width, 10) - 6 && ydiff > 6) {
|
2342 |
+
//move right
|
2343 |
+
obj.style.cursor = 'e-resize';
|
2344 |
+
}
|
2345 |
+
else if (resizable && xdiff > 6 && ydiff < 6) {
|
2346 |
+
//move top
|
2347 |
+
obj.style.cursor = 'n-resize';
|
2348 |
+
}
|
2349 |
+
else if (resizable && ydiff > parseInt(obj.style.height, 10) - 6 && xdiff > 6) {
|
2350 |
+
//move bottom
|
2351 |
+
obj.style.cursor = 's-resize';
|
2352 |
+
}
|
2353 |
+
else {
|
2354 |
+
//move all
|
2355 |
+
obj.style.cursor = 'move';
|
2356 |
+
}
|
2357 |
+
if (obj.aid != this.draggedId) {
|
2358 |
+
//not dragged or different
|
2359 |
+
if (obj.style.cursor == 'move') {obj.style.cursor = 'default';}
|
2360 |
+
return;
|
2361 |
+
}
|
2362 |
+
//moved here from mousedown
|
2363 |
+
if (xdiff < 6 && ydiff > 6) {
|
2364 |
+
//move left
|
2365 |
+
if (this.areas[this.currentid].shape == 'circle') {
|
2366 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_LEFT;
|
2367 |
+
this.statusMessage(this.strings.SQUARE_RESIZE_LEFT);
|
2368 |
+
}
|
2369 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2370 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_LEFT;
|
2371 |
+
this.statusMessage(this.strings.RECTANGLE_RESIZE_LEFT);
|
2372 |
+
}
|
2373 |
+
}
|
2374 |
+
else if (xdiff > parseInt(this.areas[this.currentid].style.width, 10) - 6 && ydiff > 6) {
|
2375 |
+
//move right
|
2376 |
+
if (this.areas[this.currentid].shape == 'circle') {
|
2377 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_RIGHT;
|
2378 |
+
this.statusMessage(this.strings.SQUARE_RESIZE_RIGHT);
|
2379 |
+
}
|
2380 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2381 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_RIGHT;
|
2382 |
+
this.statusMessage(this.strings.RECTANGLE_RESIZE_RIGHT);
|
2383 |
+
}
|
2384 |
+
}
|
2385 |
+
else if (xdiff > 6 && ydiff < 6) {
|
2386 |
+
//move top
|
2387 |
+
if (this.areas[this.currentid].shape == 'circle') {
|
2388 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_TOP;
|
2389 |
+
this.statusMessage(this.strings.SQUARE_RESIZE_TOP);
|
2390 |
+
}
|
2391 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2392 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_TOP;
|
2393 |
+
this.statusMessage(this.strings.RECTANGLE_RESIZE_TOP);
|
2394 |
+
}
|
2395 |
+
}
|
2396 |
+
else if (ydiff > parseInt(this.areas[this.currentid].style.height, 10) - 6 && xdiff > 6) {
|
2397 |
+
//move bottom
|
2398 |
+
if (this.areas[this.currentid].shape == 'circle') {
|
2399 |
+
this.is_drawing = this.DM_SQUARE_RESIZE_BOTTOM;
|
2400 |
+
this.statusMessage(this.strings.SQUARE_RESIZE_BOTTOM);
|
2401 |
+
}
|
2402 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2403 |
+
this.is_drawing = this.DM_RECTANGLE_RESIZE_BOTTOM;
|
2404 |
+
this.statusMessage(this.strings.RECTANGLE_RESIZE_BOTTOM);
|
2405 |
+
}
|
2406 |
+
}
|
2407 |
+
else/*if (xdiff < 10 && ydiff < 10 ) */{
|
2408 |
+
//move all
|
2409 |
+
if (this.areas[this.currentid].shape == 'circle') {
|
2410 |
+
this.is_drawing = this.DM_SQUARE_MOVE;
|
2411 |
+
this.statusMessage(this.strings.SQUARE_MOVE);
|
2412 |
+
this.memory[this.currentid].rdownx = xdiff;
|
2413 |
+
this.memory[this.currentid].rdowny = ydiff;
|
2414 |
+
}
|
2415 |
+
else if (this.areas[this.currentid].shape == 'rect') {
|
2416 |
+
this.is_drawing = this.DM_RECTANGLE_MOVE;
|
2417 |
+
this.statusMessage(this.strings.RECTANGLE_MOVE);
|
2418 |
+
this.memory[this.currentid].rdownx = xdiff;
|
2419 |
+
this.memory[this.currentid].rdowny = ydiff;
|
2420 |
+
}
|
2421 |
+
else if (this.areas[this.currentid].shape == 'poly' || this.areas[this.currentid].shape == 'bezier1') {
|
2422 |
+
if (this.areas[this.currentid].xpoints) {
|
2423 |
+
for (var i=0, le = this.areas[this.currentid].xpoints.length; i<le; i++) {
|
2424 |
+
this.memory[this.currentid].xpoints[i] = this.areas[this.currentid].xpoints[i];
|
2425 |
+
this.memory[this.currentid].ypoints[i] = this.areas[this.currentid].ypoints[i];
|
2426 |
+
}
|
2427 |
+
}
|
2428 |
+
|
2429 |
+
if (this.areas[this.currentid].shape == 'poly') {
|
2430 |
+
this.is_drawing = this.DM_POLYGON_MOVE;
|
2431 |
+
this.statusMessage(this.strings.POLYGON_MOVE);
|
2432 |
+
}
|
2433 |
+
else if (this.areas[this.currentid].shape == 'bezier1') {
|
2434 |
+
this.is_drawing = this.DM_BEZIER_MOVE;
|
2435 |
+
this.statusMessage(this.strings.BEZIER_MOVE);
|
2436 |
+
}
|
2437 |
+
|
2438 |
+
this.memory[this.currentid].rdownx = xdiff;
|
2439 |
+
this.memory[this.currentid].rdowny = ydiff;
|
2440 |
+
}
|
2441 |
+
}
|
2442 |
+
|
2443 |
+
//common memory settings (preparing to move or resize)
|
2444 |
+
this.memory[this.currentid].width = parseInt(this.areas[this.currentid].style.width, 10);
|
2445 |
+
this.memory[this.currentid].height = parseInt(this.areas[this.currentid].style.height, 10);
|
2446 |
+
this.memory[this.currentid].top = parseInt(this.areas[this.currentid].style.top, 10);
|
2447 |
+
this.memory[this.currentid].left = parseInt(this.areas[this.currentid].style.left, 10);
|
2448 |
+
this._setBorder(this.currentid, 'DRAW');
|
2449 |
+
this._setopacity(this.areas[this.currentid], this.config.CL_DRAW_BG, this.config.draw_opacity);
|
2450 |
+
}
|
2451 |
+
else {
|
2452 |
+
//if drawing and not ie, have to propagate to image event
|
2453 |
+
this.img_mousemove(e);
|
2454 |
+
}
|
2455 |
+
};
|
2456 |
+
|
2457 |
+
|
2458 |
+
/**
|
2459 |
+
* EVENT HANDLER: Handles event of mouseup on imgmap areas.
|
2460 |
+
* Basically clears draggedId.
|
2461 |
+
* @author adam
|
2462 |
+
* @param e The event object
|
2463 |
+
*/
|
2464 |
+
imgmap.prototype.area_mouseup = function(e) {
|
2465 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2466 |
+
//console.log('area_mouseup');
|
2467 |
+
if (!this.is_drawing) {
|
2468 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
2469 |
+
if (obj.tagName == 'DIV') {
|
2470 |
+
//do this because of label
|
2471 |
+
obj = obj.parentNode;
|
2472 |
+
}
|
2473 |
+
if (obj.tagName == 'image' || obj.tagName == 'group' ||
|
2474 |
+
obj.tagName == 'shape' || obj.tagName == 'stroke') {
|
2475 |
+
//do this because of excanvas
|
2476 |
+
obj = obj.parentNode.parentNode;
|
2477 |
+
}
|
2478 |
+
if (this.areas[this.currentid] != obj) {
|
2479 |
+
//trying to draw on a different canvas,switch to this one
|
2480 |
+
if (typeof obj.aid == 'undefined') {
|
2481 |
+
this.log('Cannot identify target area', 1);
|
2482 |
+
return;
|
2483 |
+
}
|
2484 |
+
//this.form_selectRow(obj.aid, true);
|
2485 |
+
//this.currentid = obj.aid;
|
2486 |
+
}
|
2487 |
+
this.draggedId = null;
|
2488 |
+
}
|
2489 |
+
else {
|
2490 |
+
//if drawing and not ie, have to propagate to image event
|
2491 |
+
//console.log('propup');
|
2492 |
+
this.img_mouseup(e);
|
2493 |
+
}
|
2494 |
+
};
|
2495 |
+
|
2496 |
+
|
2497 |
+
/**
|
2498 |
+
* EVENT HANDLER: Handles event of mouseover on imgmap areas.
|
2499 |
+
* Calls gradual highlight on the given area.
|
2500 |
+
* @author adam
|
2501 |
+
* @param e The event object
|
2502 |
+
*/
|
2503 |
+
imgmap.prototype.area_mouseover = function(e) {
|
2504 |
+
if (this.viewmode === 1 && this.config.mode !== '') {return;}//exit if preview mode
|
2505 |
+
if (!this.is_drawing) {
|
2506 |
+
//this.log('area_mouseover');
|
2507 |
+
//identify source object
|
2508 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
2509 |
+
if (obj.tagName == 'DIV') {
|
2510 |
+
//do this because of label
|
2511 |
+
obj = obj.parentNode;
|
2512 |
+
}
|
2513 |
+
if (obj.tagName == 'image' || obj.tagName == 'group' ||
|
2514 |
+
obj.tagName == 'shape' || obj.tagName == 'stroke') {
|
2515 |
+
//do this because of excanvas
|
2516 |
+
obj = obj.parentNode.parentNode;
|
2517 |
+
}
|
2518 |
+
/*
|
2519 |
+
//switch to hovered area
|
2520 |
+
if (this.areas[this.currentid] != obj) {
|
2521 |
+
//trying to draw on a different canvas, switch to this one
|
2522 |
+
if (typeof obj.aid == 'undefined') {
|
2523 |
+
this.log('Cannot identify target area', 1);
|
2524 |
+
return;
|
2525 |
+
}
|
2526 |
+
this.form_selectRow(obj.aid, true);
|
2527 |
+
this.currentid = obj.aid;
|
2528 |
+
}
|
2529 |
+
*/
|
2530 |
+
this.highlightArea(obj.aid, 'grad');
|
2531 |
+
}
|
2532 |
+
};
|
2533 |
+
|
2534 |
+
|
2535 |
+
/**
|
2536 |
+
* EVENT HANDLER: Handles event of mouseout on imgmap areas.
|
2537 |
+
* Calls gradient blur on the given area.
|
2538 |
+
* @author adam
|
2539 |
+
* @param e The event object
|
2540 |
+
*/
|
2541 |
+
imgmap.prototype.area_mouseout = function(e) {
|
2542 |
+
if (this.viewmode === 1 && this.config.mode !== '') {return;}//exit if preview mode
|
2543 |
+
if (!this.is_drawing) {
|
2544 |
+
//this.log('area_mouseout');
|
2545 |
+
//identify source object
|
2546 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
2547 |
+
if (obj.tagName == 'DIV') {
|
2548 |
+
//do this because of label
|
2549 |
+
obj = obj.parentNode;
|
2550 |
+
}
|
2551 |
+
if (obj.tagName == 'image' || obj.tagName == 'group' ||
|
2552 |
+
obj.tagName == 'shape' || obj.tagName == 'stroke') {
|
2553 |
+
//do this because of excanvas
|
2554 |
+
obj = obj.parentNode.parentNode;
|
2555 |
+
}
|
2556 |
+
this.blurArea(obj.aid, 'grad');
|
2557 |
+
}
|
2558 |
+
};
|
2559 |
+
|
2560 |
+
|
2561 |
+
/**
|
2562 |
+
* EVENT HANDLER: Handles event of mousedown on imgmap areas.
|
2563 |
+
* Sets the variables draggedid, selectedid and currentid to the given area.
|
2564 |
+
* @author adam
|
2565 |
+
* @param e The event object
|
2566 |
+
*/
|
2567 |
+
imgmap.prototype.area_mousedown = function(e) {
|
2568 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2569 |
+
//console.log('area_mousedown');
|
2570 |
+
if (!this.is_drawing) {
|
2571 |
+
var obj = (this.isMSIE) ? window.event.srcElement : e.currentTarget;
|
2572 |
+
if (obj.tagName == 'DIV') {
|
2573 |
+
//do this because of label
|
2574 |
+
obj = obj.parentNode;
|
2575 |
+
}
|
2576 |
+
if (obj.tagName == 'image' || obj.tagName == 'group' ||
|
2577 |
+
obj.tagName == 'shape' || obj.tagName == 'stroke') {
|
2578 |
+
//do this because of excanvas
|
2579 |
+
obj = obj.parentNode.parentNode;
|
2580 |
+
}
|
2581 |
+
if (this.areas[this.currentid] != obj) {
|
2582 |
+
//trying to draw on a different canvas, switch to this one
|
2583 |
+
if (typeof obj.aid == 'undefined') {
|
2584 |
+
this.log('Cannot identify target area', 1);
|
2585 |
+
return;
|
2586 |
+
}
|
2587 |
+
this.currentid = obj.aid;
|
2588 |
+
}
|
2589 |
+
//this.log('selected = '+this.currentid);
|
2590 |
+
this.draggedId = this.currentid;
|
2591 |
+
this.selectedId = this.currentid;
|
2592 |
+
this.fireEvent('onSelectArea', this.areas[this.currentid]);
|
2593 |
+
//stop event propagation to document level
|
2594 |
+
if (this.isMSIE) {
|
2595 |
+
window.event.cancelBubble = true;
|
2596 |
+
}
|
2597 |
+
else {
|
2598 |
+
e.stopPropagation();
|
2599 |
+
}
|
2600 |
+
}
|
2601 |
+
else {
|
2602 |
+
//if drawing and not ie, have to propagate to image event
|
2603 |
+
//console.log('propdown');
|
2604 |
+
this.img_mousedown(e);
|
2605 |
+
}
|
2606 |
+
};
|
2607 |
+
|
2608 |
+
|
2609 |
+
/**
|
2610 |
+
* EVENT HANDLER: Handles event 'keydown' on document.
|
2611 |
+
* Handles SHIFT hold while drawing.
|
2612 |
+
* Note: Safari doesn't generate keyboard events for modifiers:
|
2613 |
+
* @url http://bugs.webkit.org/show_bug.cgi?id=11696
|
2614 |
+
* @author adam
|
2615 |
+
* @param e The event object
|
2616 |
+
*/
|
2617 |
+
imgmap.prototype.doc_keydown = function(e) {
|
2618 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2619 |
+
var key = (this.isMSIE) ? event.keyCode : e.keyCode;
|
2620 |
+
//console.log(key);
|
2621 |
+
if (key == 46) {
|
2622 |
+
//delete key pressed
|
2623 |
+
if (this.selectedId !== null && !this.is_drawing) {this.removeArea(this.selectedId);}
|
2624 |
+
}
|
2625 |
+
else if (key == 16) {
|
2626 |
+
//shift key pressed
|
2627 |
+
if (this.is_drawing == this.DM_RECTANGLE_DRAW) {
|
2628 |
+
this.is_drawing = this.DM_SQUARE_DRAW;
|
2629 |
+
this.statusMessage(this.strings.SQUARE2_DRAW);
|
2630 |
+
}
|
2631 |
+
}
|
2632 |
+
};
|
2633 |
+
|
2634 |
+
|
2635 |
+
/**
|
2636 |
+
* EVENT HANDLER: Handles event 'keyup' on document.
|
2637 |
+
* Handles SHIFT release while drawing.
|
2638 |
+
* @author adam
|
2639 |
+
* @param e The event object
|
2640 |
+
*/
|
2641 |
+
imgmap.prototype.doc_keyup = function(e) {
|
2642 |
+
var key = (this.isMSIE) ? event.keyCode : e.keyCode;
|
2643 |
+
//alert(key);
|
2644 |
+
if (key == 16) {
|
2645 |
+
//shift key released
|
2646 |
+
if (this.is_drawing == this.DM_SQUARE_DRAW && this.areas[this.currentid].shape == 'rect') {
|
2647 |
+
//not for circle!
|
2648 |
+
this.is_drawing = this.DM_RECTANGLE_DRAW;
|
2649 |
+
this.statusMessage(this.strings.RECTANGLE_DRAW);
|
2650 |
+
}
|
2651 |
+
}
|
2652 |
+
};
|
2653 |
+
|
2654 |
+
|
2655 |
+
/**
|
2656 |
+
* EVENT HANDLER: Handles event 'mousedown' on document.
|
2657 |
+
* @author adam
|
2658 |
+
* @param e The event object
|
2659 |
+
*/
|
2660 |
+
imgmap.prototype.doc_mousedown = function(e) {
|
2661 |
+
if (this.viewmode === 1) {return;}//exit if preview mode
|
2662 |
+
if (!this.is_drawing) {
|
2663 |
+
this.selectedId = null;
|
2664 |
+
}
|
2665 |
+
};
|
2666 |
+
|
2667 |
+
|
2668 |
+
/**
|
2669 |
+
* Get the real position of the element.
|
2670 |
+
* Deal with browser differences when trying to get the position of an area.
|
2671 |
+
* @param element The element you want the position of.
|
2672 |
+
* @return An object with x and y members.
|
2673 |
+
*/
|
2674 |
+
imgmap.prototype._getPos = function(element) {
|
2675 |
+
var xpos = 0;
|
2676 |
+
var ypos = 0;
|
2677 |
+
if (element) {
|
2678 |
+
var elementOffsetParent = element.offsetParent;
|
2679 |
+
// If the element has an offset parent
|
2680 |
+
if (elementOffsetParent) {
|
2681 |
+
// While there is an offset parent
|
2682 |
+
while ((elementOffsetParent = element.offsetParent)) {
|
2683 |
+
//offset might give negative in opera when the image is scrolled
|
2684 |
+
if (element.offsetLeft > 0) {xpos += element.offsetLeft;}
|
2685 |
+
if (element.offsetTop > 0) {ypos += element.offsetTop;}
|
2686 |
+
element = elementOffsetParent;
|
2687 |
+
}
|
2688 |
+
}
|
2689 |
+
else {
|
2690 |
+
xpos = element.offsetLeft;
|
2691 |
+
ypos = element.offsetTop;
|
2692 |
+
}
|
2693 |
+
}
|
2694 |
+
return {x: xpos, y: ypos};
|
2695 |
+
};
|
2696 |
+
|
2697 |
+
|
2698 |
+
/**
|
2699 |
+
* Gets the last (visible and editable) area.
|
2700 |
+
* @author Adam Maschek (adam.maschek(at)gmail.com)
|
2701 |
+
* @date 2006-06-15 16:34:51
|
2702 |
+
* @returns The last area object or null.
|
2703 |
+
*/
|
2704 |
+
imgmap.prototype._getLastArea = function() {
|
2705 |
+
for (var i = this.areas.length-1; i>=0; i--) {
|
2706 |
+
if (this.areas[i]) {
|
2707 |
+
return this.areas[i];
|
2708 |
+
}
|
2709 |
+
}
|
2710 |
+
return null;
|
2711 |
+
};
|
2712 |
+
|
2713 |
+
|
2714 |
+
/**
|
2715 |
+
* Parses cssText to single style declarations.
|
2716 |
+
* @author adam
|
2717 |
+
* @date 25-09-2007 18:19:51
|
2718 |
+
* @param obj The DOM object to apply styles on.
|
2719 |
+
* @param cssText The css declarations to apply.
|
2720 |
+
*/
|
2721 |
+
imgmap.prototype.assignCSS = function(obj, cssText) {
|
2722 |
+
var parts = cssText.split(';');
|
2723 |
+
for (var i=0; i<parts.length; i++) {
|
2724 |
+
var p = parts[i].split(':');
|
2725 |
+
//we need to camelcase by - signs
|
2726 |
+
var pp = p[0].trim().split('-');
|
2727 |
+
var prop = pp[0];
|
2728 |
+
for (var j=1; j<pp.length; j++) {
|
2729 |
+
//replace first letters to uppercase
|
2730 |
+
prop+= pp[j].replace(/^./, pp[j].substring(0,1).toUpperCase());
|
2731 |
+
}
|
2732 |
+
obj.style[prop.trim()] = p[1].trim();
|
2733 |
+
}
|
2734 |
+
};
|
2735 |
+
|
2736 |
+
|
2737 |
+
/**
|
2738 |
+
* To fire callback hooks on custom events, passing them the object of the event.
|
2739 |
+
* @author adam
|
2740 |
+
* @date 13-10-2007 15:24:49
|
2741 |
+
* @param evt The type of event
|
2742 |
+
* @param obj The object of the event. (can be an id, a string, an object, whatever is most relevant)
|
2743 |
+
*/
|
2744 |
+
imgmap.prototype.fireEvent = function(evt, obj) {
|
2745 |
+
//this.log("Firing event: " + evt);
|
2746 |
+
if (typeof this.config.custom_callbacks[evt] == 'function') {
|
2747 |
+
return this.config.custom_callbacks[evt](obj);
|
2748 |
+
}
|
2749 |
+
};
|
2750 |
+
|
2751 |
+
|
2752 |
+
/**
|
2753 |
+
* To set area dimensions.
|
2754 |
+
* This is needed to achieve the same result in all browsers.
|
2755 |
+
* @author adam
|
2756 |
+
* @date 10-12-2007 22:29:41
|
2757 |
+
* @param id The id of the area (canvas) to resize.
|
2758 |
+
* @param w The desired width in pixels.
|
2759 |
+
* @param h The desired height in pixels.
|
2760 |
+
*/
|
2761 |
+
imgmap.prototype.setAreaSize = function(id, w, h) {
|
2762 |
+
if (id === null) {id = this.currentid;}
|
2763 |
+
if (w !== null) {
|
2764 |
+
this.areas[id].width = w;
|
2765 |
+
this.areas[id].style.width = (w) + 'px';
|
2766 |
+
this.areas[id].setAttribute('width', w);
|
2767 |
+
}
|
2768 |
+
if (h !== null) {
|
2769 |
+
this.areas[id].height = h;
|
2770 |
+
this.areas[id].style.height = (h) + 'px';
|
2771 |
+
this.areas[id].setAttribute('height', h);
|
2772 |
+
}
|
2773 |
+
};
|
2774 |
+
|
2775 |
+
|
2776 |
+
/**
|
2777 |
+
* Tries to detect preferred language of user.
|
2778 |
+
* @date 2007.12.28. 15:43:46
|
2779 |
+
* @return The two byte language code. (We dont care now for pt-br, etc.)
|
2780 |
+
*/
|
2781 |
+
imgmap.prototype.detectLanguage = function() {
|
2782 |
+
var lang;
|
2783 |
+
if (navigator.userLanguage) {
|
2784 |
+
lang = navigator.userLanguage.toLowerCase();
|
2785 |
+
}
|
2786 |
+
else if (navigator.language) {
|
2787 |
+
lang = navigator.language.toLowerCase();
|
2788 |
+
}
|
2789 |
+
else {
|
2790 |
+
return this.config.defaultLang;
|
2791 |
+
}
|
2792 |
+
//this.log(lang, 2);
|
2793 |
+
if (lang.length >= 2) {
|
2794 |
+
lang = lang.substring(0,2);
|
2795 |
+
return lang;
|
2796 |
+
}
|
2797 |
+
return this.config.defaultLang;
|
2798 |
+
};
|
2799 |
+
|
2800 |
+
|
2801 |
+
/**
|
2802 |
+
* Disable selection on a given object.
|
2803 |
+
* This is especially useful in Safari, where dragging around areas
|
2804 |
+
* keeps selecting all sorts of things.
|
2805 |
+
* @author Bret Taylor
|
2806 |
+
* @url http://ajaxcookbook.org/disable-text-selection/
|
2807 |
+
* @date 27-07-2008 1:57:45
|
2808 |
+
* @param element The DOM element on which you want to disable selection.
|
2809 |
+
*/
|
2810 |
+
imgmap.prototype.disableSelection = function(element) {
|
2811 |
+
if (typeof element == 'undefined' || !element) {return false;}
|
2812 |
+
if (typeof element.onselectstart != "undefined") {
|
2813 |
+
element.onselectstart = function() {
|
2814 |
+
return false;
|
2815 |
+
};
|
2816 |
+
}
|
2817 |
+
if (typeof element.unselectable != "undefined") {
|
2818 |
+
element.unselectable = "on";
|
2819 |
+
}
|
2820 |
+
if (typeof element.style.MozUserSelect != "undefined") {
|
2821 |
+
element.style.MozUserSelect = "none";
|
2822 |
+
}
|
2823 |
+
};
|
2824 |
+
|
2825 |
+
|
2826 |
+
/**
|
2827 |
+
* @date 11-02-2007 19:57:05
|
2828 |
+
* @url http://www.deepwood.net/writing/method-references.html.utf8
|
2829 |
+
* @author Daniel Brockman
|
2830 |
+
* @addon
|
2831 |
+
*/
|
2832 |
+
Function.prototype.bind = function(object) {
|
2833 |
+
var method = this;
|
2834 |
+
return function () {
|
2835 |
+
return method.apply(object, arguments);
|
2836 |
+
};
|
2837 |
+
};
|
2838 |
+
|
2839 |
+
|
2840 |
+
/**
|
2841 |
+
* Extends String with trim function.
|
2842 |
+
* @url http://www.somacon.com/p355.php
|
2843 |
+
* @addon
|
2844 |
+
*/
|
2845 |
+
String.prototype.trim = function() {
|
2846 |
+
return this.replace(/^\s+|\s+$/g,"");
|
2847 |
+
};
|
2848 |
+
/**
|
2849 |
+
* Extends String with ltrim function.
|
2850 |
+
* @url http://www.somacon.com/p355.php
|
2851 |
+
* @addon
|
2852 |
+
*/
|
2853 |
+
String.prototype.ltrim = function() {
|
2854 |
+
return this.replace(/^\s+/,"");
|
2855 |
+
};
|
2856 |
+
/**
|
2857 |
+
* Extends String with rtrim function.
|
2858 |
+
* @url http://www.somacon.com/p355.php
|
2859 |
+
* @addon
|
2860 |
+
*/
|
2861 |
+
String.prototype.rtrim = function() {
|
2862 |
+
return this.replace(/\s+$/,"");
|
2863 |
+
};
|
2864 |
+
|
2865 |
+
|
2866 |
+
/**
|
2867 |
+
* Spawn an imgmap object for each imagemap found in the document.
|
2868 |
+
* This is used for highlighter mode only.
|
2869 |
+
* @param config An imgmap config object
|
2870 |
+
*/
|
2871 |
+
function imgmap_spawnObjects(config) {
|
2872 |
+
//console.log('spawnobjects');
|
2873 |
+
var maps = document.getElementsByTagName('map');
|
2874 |
+
var imgs = document.getElementsByTagName('img');
|
2875 |
+
var imaps = [];
|
2876 |
+
//console.log(maps.length);
|
2877 |
+
for (var i=0, le=maps.length; i<le; i++) {
|
2878 |
+
for (var j=0, le2=imgs.length; j<le2; j++) {
|
2879 |
+
//console.log(i);
|
2880 |
+
// console.log(maps[i].name);
|
2881 |
+
// console.log(imgs[j].getAttribute('usemap'));
|
2882 |
+
if ('#' + maps[i].name == imgs[j].getAttribute('usemap')) {
|
2883 |
+
//we found one matching pair
|
2884 |
+
// console.log(maps[i]);
|
2885 |
+
config.mode = '';
|
2886 |
+
imapn = new imgmap(config);
|
2887 |
+
//imapn.setup(config);
|
2888 |
+
imapn.useImage(imgs[j]);
|
2889 |
+
imapn.setMapHTML(maps[i]);
|
2890 |
+
imapn.viewmode = 1;
|
2891 |
+
|
2892 |
+
imaps.push(imapn);
|
2893 |
+
|
2894 |
+
}
|
2895 |
+
}
|
2896 |
+
}
|
2897 |
+
}
|
2898 |
+
|
2899 |
+
//global instance?
|
2900 |
+
//imgmap_spawnObjects();?
|
addons/imgmap/jscripts/imgmap_packed.js
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function imgmap(_1){this.version="2.1";this.buildDate="2009/01/06 21:45";this.buildNumber="95";this.config={};this.is_drawing=0;this.strings=[];this.memory=[];this.areas=[];this.logStore=[];this.eventHandlers={};this.currentid=0;this.draggedId=null;this.selectedId=null;this.nextShape="rect";this.viewmode=0;this.loadedScripts=[];this.isLoaded=false;this.cntReloads=0;this.mapname="";this.mapid="";this.waterMark="<!-- Created by Online Image Map Editor (http://www.maschek.hu/imagemap/index) -->";this.globalscale=1;this.DM_RECTANGLE_DRAW=1;this.DM_RECTANGLE_MOVE=11;this.DM_RECTANGLE_RESIZE_TOP=12;this.DM_RECTANGLE_RESIZE_RIGHT=13;this.DM_RECTANGLE_RESIZE_BOTTOM=14;this.DM_RECTANGLE_RESIZE_LEFT=15;this.DM_SQUARE_DRAW=2;this.DM_SQUARE_MOVE=21;this.DM_SQUARE_RESIZE_TOP=22;this.DM_SQUARE_RESIZE_RIGHT=23;this.DM_SQUARE_RESIZE_BOTTOM=24;this.DM_SQUARE_RESIZE_LEFT=25;this.DM_POLYGON_DRAW=3;this.DM_POLYGON_LASTDRAW=30;this.DM_POLYGON_MOVE=31;this.DM_BEZIER_DRAW=4;this.DM_BEZIER_LASTDRAW=40;this.DM_BEZIER_MOVE=41;this.config.mode="editor";this.config.baseroot="";this.config.lang="";this.config.defaultLang="en";this.config.loglevel=0;this.config.custom_callbacks={};this.event_types=["onModeChanged","onHtmlChanged","onAddArea","onRemoveArea","onDrawArea","onResizeArea","onRelaxArea","onFocusArea","onBlurArea","onMoveArea","onSelectRow","onLoadImage","onSetMap","onGetMap","onSelectArea","onStatusMessage","onAreaChanged"];this.config.CL_DRAW_BOX="#E32636";this.config.CL_DRAW_SHAPE="#d00";this.config.CL_DRAW_BG="#fff";this.config.CL_NORM_BOX="#E32636";this.config.CL_NORM_SHAPE="#d00";this.config.CL_NORM_BG="#fff";this.config.CL_HIGHLIGHT_BOX="#E32636";this.config.CL_HIGHLIGHT_SHAPE="#d00";this.config.CL_HIGHLIGHT_BG="#fff";this.config.CL_KNOB="#555";this.config.bounding_box=true;this.config.label="%n";this.config.label_class="imgmap_label";this.config.label_style="font: bold 10px Arial";this.config.hint="#%n %h";this.config.draw_opacity="35";this.config.norm_opacity="50";this.config.highlight_opacity="70";this.config.cursor_default="crosshair";var ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf("MSIE 5")!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf("MSIE 5.0")!=-1);this.isMSIE7=this.isMSIE&&(ua.indexOf("MSIE 7")!=-1);this.isGecko=ua.indexOf("Gecko")!=-1;this.isSafari=ua.indexOf("Safari")!=-1;this.isOpera=(typeof window.opera!="undefined");this.addEvent(document,"keydown",this.eventHandlers.doc_keydown=this.doc_keydown.bind(this));this.addEvent(document,"keyup",this.eventHandlers.doc_keyup=this.doc_keyup.bind(this));this.addEvent(document,"mousedown",this.eventHandlers.doc_mousedown=this.doc_mousedown.bind(this));if(_1){this.setup(_1);}}
|
3 |
+
imgmap.prototype.assignOID=function(_3){try{if(typeof _3=="undefined"){this.log("Undefined object passed to assignOID.");return null;}else{if(typeof _3=="object"){return _3;}else{if(typeof _3=="string"){return document.getElementById(_3);}}}}
|
4 |
+
catch(err){this.log("Error in assignOID",1);}
|
5 |
+
return null;};imgmap.prototype.setup=function(_4){for(var i in _4){if(_4.hasOwnProperty(i)){this.config[i]=_4[i];}}
|
6 |
+
if(_4&&_4.pic_container){this.pic_container=this.assignOID(_4.pic_container);this.disableSelection(this.pic_container);}
|
7 |
+
if(!this.config.baseroot){var _6=document.getElementsByTagName("base");var _7="";for(i=0;i<_6.length;i++){if(_6[i].href){_7=_6[i].href;if(_7.charAt(_7.length-1)!="/"){_7+="/";}
|
8 |
+
break;}}
|
9 |
+
var _8=document.getElementsByTagName("script");for(i=0;i<_8.length;i++){if(_8[i].src&&_8[i].src.match(/imgmap\w*\.js(\?.*?)?$/)){var _9=_8[i].src;_9=_9.substring(0,_9.lastIndexOf("/")+1);if(_7&&_9.indexOf("://")==-1){this.config.baseroot=_7+_9;}else{this.config.baseroot=_9;}
|
10 |
+
break;}}}
|
11 |
+
if(this.isMSIE&&typeof window.CanvasRenderingContext2D=="undefined"&&typeof G_vmlCanvasManager=="undefined"){this.loadScript(this.config.baseroot+"excanvas.js");}
|
12 |
+
if(!this.config.lang){this.config.lang=this.detectLanguage();}
|
13 |
+
this.loadScript(this.config.baseroot+"lang_"+this.config.lang+".js");var _a,j,le;for(i in this.config.custom_callbacks){if(this.config.custom_callbacks.hasOwnProperty(i)){_a=false;for(j=0,le=this.event_types.length;j<le;j++){if(i==this.event_types[j]){_a=true;break;}}
|
14 |
+
if(!_a){this.log("Unknown custom callback: "+i,1);}}}
|
15 |
+
this.addEvent(window,"load",this.onLoad.bind(this));return true;};imgmap.prototype.retryDelayed=function(fn,_e,_f){if(typeof fn.tries=="undefined"){fn.tries=0;}
|
16 |
+
if(fn.tries++<_f){window.setTimeout(function(){fn.apply(this);},_e);}};imgmap.prototype.onLoad=function(e){if(this.isLoaded){return true;}
|
17 |
+
var _11=this;if(typeof imgmapStrings=="undefined"){if(this.cntReloads++<5){window.setTimeout(function(){_11.onLoad(e);},1200);this.log("Delaying onload (language "+this.config.lang+" not loaded, try: "+this.cntReloads+")");return false;}else{if(this.config.lang!=this.config.defaultLang&&this.config.defaultLang!="en"){this.log("Falling back to default language: "+this.config.defaultLang);this.cntReloads=0;this.config.lang=this.config.defaultLang;this.loadScript(this.config.baseroot+"lang_"+this.config.lang+".js");window.setTimeout(function(){_11.onLoad(e);},1200);return false;}else{if(this.config.lang!="en"){this.log("Falling back to english language");this.cntReloads=0;this.config.lang="en";this.loadScript(this.config.baseroot+"lang_"+this.config.lang+".js");window.setTimeout(function(){_11.onLoad(e);},1200);return false;}}}}
|
18 |
+
try{this.loadStrings(imgmapStrings);}
|
19 |
+
catch(err){this.log("Unable to load language strings",1);}
|
20 |
+
if(this.isMSIE){if(typeof window.CanvasRenderingContext2D=="undefined"&&typeof G_vmlCanvasManager=="undefined"){this.log(this.strings.ERR_EXCANVAS_LOAD,2);}}
|
21 |
+
if(this.config.mode=="highlighter"){imgmap_spawnObjects(this.config);}
|
22 |
+
this.isLoaded=true;return true;};imgmap.prototype.addEvent=function(obj,evt,_14){if(obj.attachEvent){return obj.attachEvent("on"+evt,_14);}else{if(obj.addEventListener){obj.addEventListener(evt,_14,false);return true;}else{obj["on"+evt]=_14;}}};imgmap.prototype.removeEvent=function(obj,evt,_17){if(obj.detachEvent){return obj.detachEvent("on"+evt,_17);}else{if(obj.removeEventListener){obj.removeEventListener(evt,_17,false);return true;}else{obj["on"+evt]=null;}}};imgmap.prototype.addLoadEvent=function(obj,_19){if(obj.attachEvent){return obj.attachEvent("onreadystatechange",_19);}else{if(obj.addEventListener){obj.addEventListener("load",_19,false);return true;}else{obj.onload=_19;}}};imgmap.prototype.loadScript=function(url){if(url===""){return false;}
|
23 |
+
if(this.loadedScripts[url]==1){return true;}
|
24 |
+
this.log("Loading script: "+url);try{var _1b=document.getElementsByTagName("head")[0];var _1c=document.createElement("SCRIPT");_1c.setAttribute("language","javascript");_1c.setAttribute("type","text/javascript");_1c.setAttribute("src",url);_1b.appendChild(_1c);this.addLoadEvent(_1c,this.script_load.bind(this));}
|
25 |
+
catch(err){this.log("Error loading script: "+url);}
|
26 |
+
return true;};imgmap.prototype.script_load=function(e){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;var url=obj.src;var _20=false;if(typeof obj.readyState!="undefined"){if(obj.readyState=="complete"){_20=true;}}else{_20=true;}
|
27 |
+
if(_20){this.loadedScripts[url]=1;this.log("Loaded script: "+url);return true;}};imgmap.prototype.loadStrings=function(obj){for(var key in obj){if(obj.hasOwnProperty(key)){this.strings[key]=obj[key];}}};imgmap.prototype.loadImage=function(img,_24,_25){if(typeof this.pic_container=="undefined"){this.log("You must have pic_container defined to use loadImage!",2);return false;}
|
28 |
+
this.removeAllAreas();this.globalscale=1;this.fireEvent("onHtmlChanged","");if(!this._getLastArea()){if(this.config.mode!="editor2"){this.addNewArea();}}
|
29 |
+
if(typeof img=="string"){if(typeof this.pic=="undefined"){this.pic=document.createElement("IMG");this.pic_container.appendChild(this.pic);this.addEvent(this.pic,"mousedown",this.eventHandlers.img_mousedown=this.img_mousedown.bind(this));this.addEvent(this.pic,"mouseup",this.eventHandlers.img_mouseup=this.img_mouseup.bind(this));this.addEvent(this.pic,"mousemove",this.eventHandlers.img_mousemove=this.img_mousemove.bind(this));this.pic.style.cursor=this.config.cursor_default;}
|
30 |
+
this.log("Loading image: "+img,0);var q="?";if(img.indexOf("?")>-1){q="&";}
|
31 |
+
this.pic.src=img+q+(new Date().getTime());if(_24&&_24>0){this.pic.setAttribute("width",_24);}
|
32 |
+
if(_25&&_25>0){this.pic.setAttribute("height",_25);}
|
33 |
+
this.fireEvent("onLoadImage",this.pic);return true;}else{if(typeof img=="object"){var src=img.src;if(src===""&&img.getAttribute("mce_src")!==""){src=img.getAttribute("mce_src");}else{if(src===""&&img.getAttribute("_fcksavedurl")!==""){src=img.getAttribute("_fcksavedurl");}}
|
34 |
+
if(!_24){_24=img.clientWidth;}
|
35 |
+
if(!_25){_25=img.clientHeight;}
|
36 |
+
return this.loadImage(src,_24,_25);}}};imgmap.prototype.useImage=function(img){this.removeAllAreas();if(!this._getLastArea()){if(this.config.mode!="editor2"){this.addNewArea();}}
|
37 |
+
img=this.assignOID(img);if(typeof img=="object"){if(typeof this.pic!="undefined"){this.removeEvent(this.pic,"mousedown",this.eventHandlers.img_mousedown);this.removeEvent(this.pic,"mouseup",this.eventHandlers.img_mouseup);this.removeEvent(this.pic,"mousemove",this.eventHandlers.img_mousemove);this.pic.style.cursor="";}
|
38 |
+
this.pic=img;this.addEvent(this.pic,"mousedown",this.eventHandlers.img_mousedown=this.img_mousedown.bind(this));this.addEvent(this.pic,"mouseup",this.eventHandlers.img_mouseup=this.img_mouseup.bind(this));this.addEvent(this.pic,"mousemove",this.eventHandlers.img_mousemove=this.img_mousemove.bind(this));this.pic.style.cursor=this.config.cursor_default;if(this.pic.parentNode.className=="pic_container"){this.pic_container=this.pic.parentNode;}else{this.pic_container=document.createElement("div");this.pic_container.className="pic_container";this.pic.parentNode.insertBefore(this.pic_container,this.pic);this.pic_container.appendChild(this.pic);}
|
39 |
+
this.fireEvent("onLoadImage",this.pic);return true;}};imgmap.prototype.statusMessage=function(str){this.fireEvent("onStatusMessage",str);};imgmap.prototype.log=function(obj,_2b){if(_2b===""||typeof _2b=="undefined"){_2b=0;}
|
40 |
+
if(this.config.loglevel!=-1&&_2b>=this.config.loglevel){this.logStore.push({level:_2b,obj:obj});}
|
41 |
+
if(typeof console=="object"){console.log(obj);}else{if(this.isOpera){opera.postError(_2b+": "+obj);}else{if(typeof air=="object"){if(typeof air.Introspector=="object"){air.Introspector.Console.log(obj);}else{air.trace(obj);}}else{if(_2b>1){var msg="";for(var i=0,le=this.logStore.length;i<le;i++){msg+=this.logStore[i].level+": "+this.logStore[i].obj+"\n";}
|
42 |
+
alert(msg);}else{window.defaultStatus=(_2b+": "+obj);}}}}};imgmap.prototype.getMapHTML=function(_2f){var _30="<map id=\""+this.getMapId()+"\" name=\""+this.getMapName()+"\">"+this.getMapInnerHTML(_2f)+this.waterMark+"</map>";this.fireEvent("onGetMap",_30);return _30;};imgmap.prototype.getMapInnerHTML=function(_31){var _32,_33;_32="";for(var i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){if(this.areas[i].shape&&this.areas[i].shape!="undefined"){_33=this.areas[i].lastInput;if(_31&&_31.match(/noscale/)){var cs=_33.split(",");for(var j=0,le2=cs.length;j<le2;j++){cs[j]=Math.round(cs[j]*this.globalscale);}
|
43 |
+
_33=cs.join(",");}
|
44 |
+
_32+="<area shape=\""+this.areas[i].shape+"\""+" alt=\""+this.areas[i].aalt+"\""+" title=\""+this.areas[i].atitle+"\""+" coords=\""+_33+"\""+" href=\""+this.areas[i].ahref+"\""+" target=\""+this.areas[i].atarget+"\" />";}}}
|
45 |
+
return _32;};imgmap.prototype.getMapName=function(){if(this.mapname===""){if(this.mapid!==""){return this.mapid;}
|
46 |
+
var now=new Date();this.mapname="imgmap"+now.getFullYear()+(now.getMonth()+1)+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds();}
|
47 |
+
return this.mapname;};imgmap.prototype.getMapId=function(){if(this.mapid===""){this.mapid=this.getMapName();}
|
48 |
+
return this.mapid;};imgmap.prototype._normShape=function(_3a){if(!_3a){return"rect";}
|
49 |
+
_3a=_3a.trim().toLowerCase();if(_3a.substring(0,4)=="rect"){return"rect";}
|
50 |
+
if(_3a.substring(0,4)=="circ"){return"circle";}
|
51 |
+
if(_3a.substring(0,4)=="poly"){return"poly";}
|
52 |
+
return"rect";};imgmap.prototype._normCoords=function(_3b,_3c,_3d){var i;var sx;var sy;var gx;var gy;var _43;_3b=_3b.trim();if(_3b===""){return"";}
|
53 |
+
var _44=_3b;_3b=_3b.replace(/(\d)(\D)+(\d)/g,"$1,$3");_3b=_3b.replace(/,\D+(\d)/g,",$1");_3b=_3b.replace(/,0+(\d)/g,",$1");_3b=_3b.replace(/(\d)(\D)+,/g,"$1,");_3b=_3b.replace(/^\D+(\d)/g,"$1");_3b=_3b.replace(/^0+(\d)/g,"$1");_3b=_3b.replace(/(\d)(\D)+$/g,"$1");var _45=_3b.split(",");if(_3c=="rect"){if(_3d=="fromcircle"){var r=_45[2];_45[0]=_45[0]-r;_45[1]=_45[1]-r;_45[2]=parseInt(_45[0],10)+2*r;_45[3]=parseInt(_45[1],10)+2*r;}else{if(_3d=="frompoly"){sx=parseInt(_45[0],10);gx=parseInt(_45[0],10);sy=parseInt(_45[1],10);gy=parseInt(_45[1],10);for(i=0,le=_45.length;i<le;i++){if(i%2===0&&parseInt(_45[i],10)<sx){sx=parseInt(_45[i],10);}
|
54 |
+
if(i%2===1&&parseInt(_45[i],10)<sy){sy=parseInt(_45[i],10);}
|
55 |
+
if(i%2===0&&parseInt(_45[i],10)>gx){gx=parseInt(_45[i],10);}
|
56 |
+
if(i%2===1&&parseInt(_45[i],10)>gy){gy=parseInt(_45[i],10);}}
|
57 |
+
_45[0]=sx;_45[1]=sy;_45[2]=gx;_45[3]=gy;}}
|
58 |
+
if(!(parseInt(_45[1],10)>=0)){_45[1]=_45[0];}
|
59 |
+
if(!(parseInt(_45[2],10)>=0)){_45[2]=parseInt(_45[0],10)+10;}
|
60 |
+
if(!(parseInt(_45[3],10)>=0)){_45[3]=parseInt(_45[1],10)+10;}
|
61 |
+
if(parseInt(_45[0],10)>parseInt(_45[2],10)){_43=_45[0];_45[0]=_45[2];_45[2]=_43;}
|
62 |
+
if(parseInt(_45[1],10)>parseInt(_45[3],10)){_43=_45[1];_45[1]=_45[3];_45[3]=_43;}
|
63 |
+
_3b=_45[0]+","+_45[1]+","+_45[2]+","+_45[3];}else{if(_3c=="circle"){if(_3d=="fromrect"){sx=parseInt(_45[0],10);gx=parseInt(_45[2],10);sy=parseInt(_45[1],10);gy=parseInt(_45[3],10);_45[2]=(gx-sx<gy-sy)?gx-sx:gy-sy;_45[2]=Math.floor(_45[2]/2);_45[0]=sx+_45[2];_45[1]=sy+_45[2];}else{if(_3d=="frompoly"){sx=parseInt(_45[0],10);gx=parseInt(_45[0],10);sy=parseInt(_45[1],10);gy=parseInt(_45[1],10);for(i=0,le=_45.length;i<le;i++){if(i%2===0&&parseInt(_45[i],10)<sx){sx=parseInt(_45[i],10);}
|
64 |
+
if(i%2===1&&parseInt(_45[i],10)<sy){sy=parseInt(_45[i],10);}
|
65 |
+
if(i%2===0&&parseInt(_45[i],10)>gx){gx=parseInt(_45[i],10);}
|
66 |
+
if(i%2===1&&parseInt(_45[i],10)>gy){gy=parseInt(_45[i],10);}}
|
67 |
+
_45[2]=(gx-sx<gy-sy)?gx-sx:gy-sy;_45[2]=Math.floor(_45[2]/2);_45[0]=sx+_45[2];_45[1]=sy+_45[2];}}
|
68 |
+
if(!(parseInt(_45[1],10)>0)){_45[1]=_45[0];}
|
69 |
+
if(!(parseInt(_45[2],10)>0)){_45[2]=10;}
|
70 |
+
_3b=_45[0]+","+_45[1]+","+_45[2];}else{if(_3c=="poly"){if(_3d=="fromrect"){_45[4]=_45[2];_45[5]=_45[3];_45[2]=_45[0];_45[6]=_45[4];_45[7]=_45[1];}else{if(_3d=="fromcircle"){var _47=parseInt(_45[0],10);var _48=parseInt(_45[1],10);var _49=parseInt(_45[2],10);var j=0;_45[j++]=_47+_49;_45[j++]=_48;var _4b=60;for(i=0;i<=_4b;i++){var _4c=i/_4b;var _4d=Math.cos(_4c*2*Math.PI);var _4e=Math.sin(_4c*2*Math.PI);var _4f=_47+_4d*_49;var _50=_48+_4e*_49;_45[j++]=Math.round(_4f);_45[j++]=Math.round(_50);}}}
|
71 |
+
_3b=_45.join(",");}else{if(_3c=="bezier1"){_3b=_45.join(",");}}}}
|
72 |
+
if(_3d=="preserve"&&_44!=_3b){return _44;}
|
73 |
+
return _3b;};imgmap.prototype.setMapHTML=function(map){if(this.viewmode===1){return;}
|
74 |
+
this.fireEvent("onSetMap",map);this.removeAllAreas();var _52;if(typeof map=="string"){var _53=document.createElement("DIV");_53.innerHTML=map;_52=_53.firstChild;}else{if(typeof map=="object"){_52=map;}}
|
75 |
+
if(!_52||_52.nodeName.toLowerCase()!=="map"){return false;}
|
76 |
+
this.mapname=_52.name;this.mapid=_52.id;var _54=_52.getElementsByTagName("area");var _55,_56,_57,alt,_59,_5a;for(var i=0,le=_54.length;i<le;i++){_55=_56=_57=alt=_59=_5a="";id=this.addNewArea();_55=this._normShape(_54[i].getAttribute("shape",2));this.initArea(id,_55);if(_54[i].getAttribute("coords",2)){_56=this._normCoords(_54[i].getAttribute("coords",2),_55);this.areas[id].lastInput=_56;}
|
77 |
+
_57=_54[i].getAttribute("href",2);var _5d=_54[i].getAttribute("_fcksavedurl");if(_5d){_57=_5d;}
|
78 |
+
if(_57){this.areas[id].ahref=_57;}
|
79 |
+
alt=_54[i].getAttribute("alt");if(alt){this.areas[id].aalt=alt;}
|
80 |
+
_59=_54[i].getAttribute("title");if(!_59){_59=alt;}
|
81 |
+
if(_59){this.areas[id].atitle=_59;}
|
82 |
+
_5a=_54[i].getAttribute("target");if(_5a){_5a=_5a.toLowerCase();}
|
83 |
+
this.areas[id].atarget=_5a;this._recalculate(id,_56);this.relaxArea(id);this.fireEvent("onAreaChanged",this.areas[id]);}
|
84 |
+
this.fireEvent("onHtmlChanged",this.getMapHTML());return true;};imgmap.prototype.togglePreview=function(){var i;if(!this.pic){return false;}
|
85 |
+
if(!this.preview){this.preview=document.createElement("DIV");this.preview.style.display="none";this.pic_container.appendChild(this.preview);}
|
86 |
+
if(this.viewmode===0){for(i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){this.areas[i].style.display="none";if(this.areas[i].label){this.areas[i].label.style.display="none";}}}
|
87 |
+
this.preview.innerHTML=this.getMapHTML("noscale");this.pic.setAttribute("border","0",0);this.pic.setAttribute("usemap","#"+this.mapname,0);this.pic.style.cursor="auto";this.viewmode=1;this.statusMessage(this.strings.PREVIEW_MODE);}else{for(i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){this.areas[i].style.display="";if(this.areas[i].label&&this.config.label){this.areas[i].label.style.display="";}}}
|
88 |
+
this.preview.innerHTML="";this.pic.style.cursor=this.config.cursor_default;this.pic.removeAttribute("usemap",0);this.viewmode=0;this.statusMessage(this.strings.DESIGN_MODE);this.is_drawing=0;}
|
89 |
+
this.fireEvent("onModeChanged",this.viewmode);return this.viewmode;};imgmap.prototype.addNewArea=function(){if(this.viewmode===1){return;}
|
90 |
+
var _5f=this._getLastArea();var id=(_5f)?_5f.aid+1:0;this.areas[id]=document.createElement("DIV");this.areas[id].id=this.mapname+"area"+id;this.areas[id].aid=id;this.areas[id].shape="undefined";this.currentid=id;this.fireEvent("onAddArea",id);return id;};imgmap.prototype.initArea=function(id,_62){if(!this.areas[id]){return false;}
|
91 |
+
if(this.areas[id].parentNode){this.areas[id].parentNode.removeChild(this.areas[id]);}
|
92 |
+
if(this.areas[id].label){this.areas[id].label.parentNode.removeChild(this.areas[id].label);}
|
93 |
+
this.areas[id]=null;this.areas[id]=document.createElement("CANVAS");this.pic_container.appendChild(this.areas[id]);this.pic_container.style.position="relative";if(typeof G_vmlCanvasManager!="undefined"){this.areas[id]=G_vmlCanvasManager.initElement(this.areas[id]);}
|
94 |
+
this.areas[id].id=this.mapname+"area"+id;this.areas[id].aid=id;this.areas[id].shape=_62;this.areas[id].ahref="";this.areas[id].atitle="";this.areas[id].aalt="";this.areas[id].atarget="";this.areas[id].style.position="absolute";this.areas[id].style.top=this.pic.offsetTop+"px";this.areas[id].style.left=this.pic.offsetLeft+"px";this._setopacity(this.areas[id],this.config.CL_DRAW_BG,this.config.draw_opacity);this.areas[id].onmousedown=this.area_mousedown.bind(this);this.areas[id].onmouseup=this.area_mouseup.bind(this);this.areas[id].onmousemove=this.area_mousemove.bind(this);this.areas[id].onmouseover=this.area_mouseover.bind(this);this.areas[id].onmouseout=this.area_mouseout.bind(this);this.memory[id]={};this.memory[id].downx=0;this.memory[id].downy=0;this.memory[id].left=0;this.memory[id].top=0;this.memory[id].width=0;this.memory[id].height=0;this.memory[id].xpoints=[];this.memory[id].ypoints=[];this.areas[id].label=document.createElement("DIV");this.pic_container.appendChild(this.areas[id].label);this.areas[id].label.className=this.config.label_class;this.assignCSS(this.areas[id].label,this.config.label_style);this.areas[id].label.style.position="absolute";};imgmap.prototype.relaxArea=function(id){if(!this.areas[id]){return;}
|
95 |
+
this.fireEvent("onRelaxArea",id);this._setBorder(id,"NORM");this._setopacity(this.areas[id],this.config.CL_NORM_BG,this.config.norm_opacity);};imgmap.prototype.relaxAllAreas=function(){for(var i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){this.relaxArea(i);}}};imgmap.prototype._setBorder=function(id,_67){if(this.areas[id].shape=="rect"||this.config.bounding_box){this.areas[id].style.borderWidth="1px";this.areas[id].style.borderStyle=(_67=="DRAW"?"dotted":"solid");this.areas[id].style.borderColor=this.config["CL_"+_67+"_"+(this.areas[id].shape=="rect"?"SHAPE":"BOX")];}else{this.areas[id].style.border="";}};imgmap.prototype._setopacity=function(_68,_69,pct){if(_69){_68.style.backgroundColor=_69;}
|
96 |
+
if(pct&&typeof pct=="string"&&pct.match(/^\d*\-\d+$/)){var _6b=pct.split("-");if(typeof _6b[0]!="undefined"){_6b[0]=parseInt(_6b[0],10);this._setopacity(_68,_69,_6b[0]);}
|
97 |
+
if(typeof _6b[1]!="undefined"){_6b[1]=parseInt(_6b[1],10);var _6c=this._getopacity(_68);var _6d=this;var _6e=Math.round(_6b[1]-_6c);if(_6e>5){window.setTimeout(function(){_6d._setopacity(_68,null,"-"+_6b[1]);},20);pct=1*_6c+5;}else{if(_6e<-3){window.setTimeout(function(){_6d._setopacity(_68,null,"-"+_6b[1]);},20);pct=1*_6c-3;}else{pct=_6b[1];}}}}
|
98 |
+
if(!isNaN(pct)){pct=Math.round(parseInt(pct,10));_68.style.opacity=pct/100;_68.style.filter="alpha(opacity="+pct+")";}};imgmap.prototype._getopacity=function(_6f){if(_6f.style.opacity<=1){return _6f.style.opacity*100;}
|
99 |
+
if(_6f.style.filter){return parseInt(_6f.style.filter.replace(/alpha\(opacity\=([^\)]*)\)/ig,"$1"),10);}
|
100 |
+
return 100;};imgmap.prototype.removeArea=function(id,_71){if(this.viewmode===1){return;}
|
101 |
+
if(id===null||typeof id=="undefined"){return;}
|
102 |
+
try{this.areas[id].label.parentNode.removeChild(this.areas[id].label);this.areas[id].parentNode.removeChild(this.areas[id]);this.areas[id].label.className=null;this.areas[id].label=null;this.areas[id].onmouseover=null;this.areas[id].onmouseout=null;this.areas[id].onmouseup=null;this.areas[id].onmousedown=null;this.areas[id].onmousemove=null;}
|
103 |
+
catch(err){}
|
104 |
+
this.areas[id]=null;this.fireEvent("onRemoveArea",id);if(!_71){this.fireEvent("onHtmlChanged",this.getMapHTML());}};imgmap.prototype.removeAllAreas=function(){for(var i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){this.removeArea(i,true);}}
|
105 |
+
this.fireEvent("onHtmlChanged",this.getMapHTML());};imgmap.prototype.scaleAllAreas=function(_74){var _75=1;try{_75=_74/this.globalscale;}
|
106 |
+
catch(err){this.log("Invalid (global)scale",1);}
|
107 |
+
this.globalscale=_74;for(var i=0,le=this.areas.length;i<le;i++){if(this.areas[i]&&this.areas[i].shape!="undefined"){this.scaleArea(i,_75);}}};imgmap.prototype.scaleArea=function(id,_79){this.areas[id].style.top=parseInt(this.areas[id].style.top,10)*_79+"px";this.areas[id].style.left=parseInt(this.areas[id].style.left,10)*_79+"px";this.setAreaSize(id,this.areas[id].width*_79,this.areas[id].height*_79);if(this.areas[id].shape=="poly"||this.areas[id].shape=="bezier1"){for(var i=0,le=this.areas[id].xpoints.length;i<le;i++){this.areas[id].xpoints[i]*=_79;this.areas[id].ypoints[i]*=_79;}}
|
108 |
+
this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);this._updatecoords(id);};imgmap.prototype._putlabel=function(id){if(this.viewmode===1){return;}
|
109 |
+
if(!this.areas[id].label){return;}
|
110 |
+
try{if(!this.config.label){this.areas[id].label.innerHTML="";this.areas[id].label.style.display="none";}else{this.areas[id].label.style.display="";var _7d=this.config.label;_7d=_7d.replace(/%n/g,String(id));_7d=_7d.replace(/%c/g,String(this.areas[id].lastInput));_7d=_7d.replace(/%h/g,String(this.areas[id].ahref));_7d=_7d.replace(/%a/g,String(this.areas[id].aalt));_7d=_7d.replace(/%t/g,String(this.areas[id].atitle));this.areas[id].label.innerHTML=_7d;}
|
111 |
+
this.areas[id].label.style.top=this.areas[id].style.top;this.areas[id].label.style.left=this.areas[id].style.left;}
|
112 |
+
catch(err){this.log("Error putting label",1);}};imgmap.prototype._puthint=function(id){try{if(!this.config.hint){this.areas[id].title="";this.areas[id].alt="";}else{var _7f=this.config.hint;_7f=_7f.replace(/%n/g,String(id));_7f=_7f.replace(/%c/g,String(this.areas[id].lastInput));_7f=_7f.replace(/%h/g,String(this.areas[id].ahref));_7f=_7f.replace(/%a/g,String(this.areas[id].aalt));_7f=_7f.replace(/%t/g,String(this.areas[id].atitle));this.areas[id].title=_7f;this.areas[id].alt=_7f;}}
|
113 |
+
catch(err){this.log("Error putting hint",1);}};imgmap.prototype._repaintAll=function(){for(var i=0,le=this.areas.length;i<le;i++){if(this.areas[i]){this._repaint(this.areas[i],this.config.CL_NORM_SHAPE);}}};imgmap.prototype._repaint=function(_82,_83,x,y){var ctx;var _87,_88,_89,top;var i;if(_82.shape=="circle"){_87=parseInt(_82.style.width,10);var _8c=Math.floor(_87/2)-1;ctx=_82.getContext("2d");ctx.clearRect(0,0,_87,_87);ctx.beginPath();ctx.strokeStyle=_83;ctx.arc(_8c,_8c,_8c,0,Math.PI*2,0);ctx.stroke();ctx.closePath();ctx.strokeStyle=this.config.CL_KNOB;ctx.strokeRect(_8c,_8c,1,1);this._putlabel(_82.aid);this._puthint(_82.aid);}else{if(_82.shape=="rect"){this._putlabel(_82.aid);this._puthint(_82.aid);}else{if(_82.shape=="poly"){_87=parseInt(_82.style.width,10);_88=parseInt(_82.style.height,10);_89=parseInt(_82.style.left,10);top=parseInt(_82.style.top,10);if(_82.xpoints){ctx=_82.getContext("2d");ctx.clearRect(0,0,_87,_88);ctx.beginPath();ctx.strokeStyle=_83;ctx.moveTo(_82.xpoints[0]-_89,_82.ypoints[0]-top);for(i=1,le=_82.xpoints.length;i<le;i++){ctx.lineTo(_82.xpoints[i]-_89,_82.ypoints[i]-top);}
|
114 |
+
if(this.is_drawing==this.DM_POLYGON_DRAW||this.is_drawing==this.DM_POLYGON_LASTDRAW){ctx.lineTo(x-_89-5,y-top-5);}
|
115 |
+
ctx.lineTo(_82.xpoints[0]-_89,_82.ypoints[0]-top);ctx.stroke();ctx.closePath();}
|
116 |
+
this._putlabel(_82.aid);this._puthint(_82.aid);}else{if(_82.shape=="bezier1"){_87=parseInt(_82.style.width,10);_88=parseInt(_82.style.height,10);_89=parseInt(_82.style.left,10);top=parseInt(_82.style.top,10);if(_82.xpoints){ctx=_82.getContext("2d");ctx.clearRect(0,0,_87,_88);ctx.beginPath();ctx.strokeStyle=_83;ctx.moveTo(_82.xpoints[0]-_89,_82.ypoints[0]-top);for(i=2,le=_82.xpoints.length;i<le;i+=2){ctx.quadraticCurveTo(_82.xpoints[i-1]-_89,_82.ypoints[i-1]-top,_82.xpoints[i]-_89,_82.ypoints[i]-top);}
|
117 |
+
if(this.is_drawing==this.DM_BEZIER_DRAW||this.is_drawing==this.DM_BEZIER_LASTDRAW){if(_82.xpoints.length%2===0&&_82.xpoints.length>1){ctx.quadraticCurveTo(_82.xpoints[_82.xpoints.length-1]-_89-5,_82.ypoints[_82.ypoints.length-1]-top-5,x-_89-5,y-top-5);}else{ctx.lineTo(x-_89-5,y-top-5);}}
|
118 |
+
ctx.lineTo(_82.xpoints[0]-_89,_82.ypoints[0]-top);ctx.stroke();ctx.closePath();}
|
119 |
+
this._putlabel(_82.aid);this._puthint(_82.aid);}}}}};imgmap.prototype._updatecoords=function(id){var _8e=Math.round(parseInt(this.areas[id].style.left,10)/this.globalscale);var top=Math.round(parseInt(this.areas[id].style.top,10)/this.globalscale);var _90=Math.round(parseInt(this.areas[id].style.height,10)/this.globalscale);var _91=Math.round(parseInt(this.areas[id].style.width,10)/this.globalscale);var _92="";if(this.areas[id].shape=="rect"){_92=_8e+","+top+","+(_8e+_91)+","+(top+_90);this.areas[id].lastInput=_92;}else{if(this.areas[id].shape=="circle"){var _93=Math.floor(_91/2)-1;_92=(_8e+_93)+","+(top+_93)+","+_93;this.areas[id].lastInput=_92;}else{if(this.areas[id].shape=="poly"||this.areas[id].shape=="bezier1"){if(this.areas[id].xpoints){for(var i=0,le=this.areas[id].xpoints.length;i<le;i++){_92+=Math.round(this.areas[id].xpoints[i]/this.globalscale)+","+Math.round(this.areas[id].ypoints[i]/this.globalscale)+",";}
|
120 |
+
_92=_92.substring(0,_92.length-1);}
|
121 |
+
this.areas[id].lastInput=_92;}}}
|
122 |
+
this.fireEvent("onAreaChanged",this.areas[id]);this.fireEvent("onHtmlChanged",this.getMapHTML());};imgmap.prototype._recalculate=function(id,_97){try{if(_97){_97=this._normCoords(_97,this.areas[id].shape,"preserve");}else{_97=this.areas[id].lastInput||"";}
|
123 |
+
var _98=_97.split(",");if(this.areas[id].shape=="rect"){if(_98.length!=4||parseInt(_98[0],10)>parseInt(_98[2],10)||parseInt(_98[1],10)>parseInt(_98[3],10)){throw"invalid coords";}
|
124 |
+
this.areas[id].style.left=this.globalscale*(this.pic.offsetLeft+parseInt(_98[0],10))+"px";this.areas[id].style.top=this.globalscale*(this.pic.offsetTop+parseInt(_98[1],10))+"px";this.setAreaSize(id,this.globalscale*(_98[2]-_98[0]),this.globalscale*(_98[3]-_98[1]));this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);}else{if(this.areas[id].shape=="circle"){if(_98.length!=3||parseInt(_98[2],10)<0){throw"invalid coords";}
|
125 |
+
var _99=2*(_98[2]);this.setAreaSize(id,this.globalscale*_99,this.globalscale*_99);this.areas[id].style.left=this.globalscale*(this.pic.offsetLeft+parseInt(_98[0],10)-_99/2)+"px";this.areas[id].style.top=this.globalscale*(this.pic.offsetTop+parseInt(_98[1],10)-_99/2)+"px";this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);}else{if(this.areas[id].shape=="poly"||this.areas[id].shape=="bezier1"){if(_98.length<2){throw"invalid coords";}
|
126 |
+
this.areas[id].xpoints=[];this.areas[id].ypoints=[];for(var i=0,le=_98.length;i<le;i+=2){this.areas[id].xpoints[this.areas[id].xpoints.length]=this.globalscale*(this.pic.offsetLeft+parseInt(_98[i],10));this.areas[id].ypoints[this.areas[id].ypoints.length]=this.globalscale*(this.pic.offsetTop+parseInt(_98[i+1],10));this._polygongrow(this.areas[id],this.globalscale*_98[i],this.globalscale*_98[i+1]);}
|
127 |
+
this._polygonshrink(this.areas[id]);}}}}
|
128 |
+
catch(err){var msg=(err.message)?err.message:"error calculating coordinates";this.log(msg,1);this.statusMessage(this.strings.ERR_INVALID_COORDS);if(this.areas[id].lastInput){this.fireEvent("onAreaChanged",this.areas[id]);}
|
129 |
+
this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);return;}
|
130 |
+
this.areas[id].lastInput=_97;};imgmap.prototype._polygongrow=function(_9d,_9e,_9f){var _a0=_9e-parseInt(_9d.style.left,10);var _a1=_9f-parseInt(_9d.style.top,10);var pad=0;var _a3=0;if(_9e<parseInt(_9d.style.left,10)){_9d.style.left=(_9e-pad)+"px";this.setAreaSize(_9d.aid,parseInt(_9d.style.width,10)+Math.abs(_a0)+_a3,null);}else{if(_9e>parseInt(_9d.style.left,10)+parseInt(_9d.style.width,10)){this.setAreaSize(_9d.aid,_9e-parseInt(_9d.style.left,10)+_a3,null);}}
|
131 |
+
if(_9f<parseInt(_9d.style.top,10)){_9d.style.top=(_9f-pad)+"px";this.setAreaSize(_9d.aid,null,parseInt(_9d.style.height,10)+Math.abs(_a1)+_a3);}else{if(_9f>parseInt(_9d.style.top,10)+parseInt(_9d.style.height,10)){this.setAreaSize(_9d.aid,null,_9f-parseInt(_9d.style.top,10)+_a3);}}};imgmap.prototype._polygonshrink=function(_a4){_a4.style.left=(_a4.xpoints[0])+"px";_a4.style.top=(_a4.ypoints[0])+"px";this.setAreaSize(_a4.aid,0,0);for(var i=0,le=_a4.xpoints.length;i<le;i++){this._polygongrow(_a4,_a4.xpoints[i],_a4.ypoints[i]);}
|
132 |
+
this._repaint(_a4,this.config.CL_NORM_SHAPE);};imgmap.prototype.img_mousemove=function(e){var x;var y;var _aa;var _ab;var _ac;if(this.viewmode===1){return;}
|
133 |
+
var pos=this._getPos(this.pic);x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);x=x+this.pic_container.scrollLeft;y=y+this.pic_container.scrollTop;if(x<0||y<0||x>this.pic.width||y>this.pic.height){return;}
|
134 |
+
if(this.memory[this.currentid]){var top=this.memory[this.currentid].top;var _af=this.memory[this.currentid].left;var _b0=this.memory[this.currentid].height;var _b1=this.memory[this.currentid].width;}
|
135 |
+
if(this.isSafari){if(e.shiftKey){if(this.is_drawing==this.DM_RECTANGLE_DRAW){this.is_drawing=this.DM_SQUARE_DRAW;this.statusMessage(this.strings.SQUARE2_DRAW);}}else{if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_DRAW;this.statusMessage(this.strings.RECTANGLE_DRAW);}}}
|
136 |
+
if(this.is_drawing==this.DM_RECTANGLE_DRAW){this.fireEvent("onDrawArea",this.currentid);_aa=x-this.memory[this.currentid].downx;_ab=y-this.memory[this.currentid].downy;this.setAreaSize(this.currentid,Math.abs(_aa),Math.abs(_ab));if(_aa<0){this.areas[this.currentid].style.left=(x+1)+"px";}
|
137 |
+
if(_ab<0){this.areas[this.currentid].style.top=(y+1)+"px";}}else{if(this.is_drawing==this.DM_SQUARE_DRAW){this.fireEvent("onDrawArea",this.currentid);_aa=x-this.memory[this.currentid].downx;_ab=y-this.memory[this.currentid].downy;if(Math.abs(_aa)<Math.abs(_ab)){_ac=Math.abs(parseInt(_aa,10));}else{_ac=Math.abs(parseInt(_ab,10));}
|
138 |
+
this.setAreaSize(this.currentid,_ac,_ac);if(_aa<0){this.areas[this.currentid].style.left=(this.memory[this.currentid].downx+_ac*-1)+"px";}
|
139 |
+
if(_ab<0){this.areas[this.currentid].style.top=(this.memory[this.currentid].downy+_ac*-1+1)+"px";}}else{if(this.is_drawing==this.DM_POLYGON_DRAW||this.is_drawing==this.DM_BEZIER_DRAW){this.fireEvent("onDrawArea",this.currentid);this._polygongrow(this.areas[this.currentid],x,y);}else{if(this.is_drawing==this.DM_RECTANGLE_MOVE||this.is_drawing==this.DM_SQUARE_MOVE){this.fireEvent("onMoveArea",this.currentid);x=x-this.memory[this.currentid].rdownx;y=y-this.memory[this.currentid].rdowny;if(x+_b1>this.pic.width||y+_b0>this.pic.height){return;}
|
140 |
+
if(x<0||y<0){return;}
|
141 |
+
this.areas[this.currentid].style.left=x+1+"px";this.areas[this.currentid].style.top=y+1+"px";}else{if(this.is_drawing==this.DM_POLYGON_MOVE||this.is_drawing==this.DM_BEZIER_MOVE){this.fireEvent("onMoveArea",this.currentid);x=x-this.memory[this.currentid].rdownx;y=y-this.memory[this.currentid].rdowny;if(x+_b1>this.pic.width||y+_b0>this.pic.height){return;}
|
142 |
+
if(x<0||y<0){return;}
|
143 |
+
_aa=x-_af;_ab=y-top;if(this.areas[this.currentid].xpoints){for(var i=0,le=this.areas[this.currentid].xpoints.length;i<le;i++){this.areas[this.currentid].xpoints[i]=this.memory[this.currentid].xpoints[i]+_aa;this.areas[this.currentid].ypoints[i]=this.memory[this.currentid].ypoints[i]+_ab;}}
|
144 |
+
this.areas[this.currentid].style.left=x+"px";this.areas[this.currentid].style.top=y+"px";}else{if(this.is_drawing==this.DM_SQUARE_RESIZE_LEFT){this.fireEvent("onResizeArea",this.currentid);_ac=x-_af;if((_b1+(-1*_ac))>0){this.areas[this.currentid].style.left=x+1+"px";this.areas[this.currentid].style.top=(top+(_ac/2))+"px";this.setAreaSize(this.currentid,parseInt(_b1+(-1*_ac),10),parseInt(_b0+(-1*_ac),10));}else{this.memory[this.currentid].width=0;this.memory[this.currentid].height=0;this.memory[this.currentid].left=x;this.memory[this.currentid].top=y;this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT;}}else{if(this.is_drawing==this.DM_SQUARE_RESIZE_RIGHT){this.fireEvent("onResizeArea",this.currentid);_ac=x-_af-_b1;if((_b1+(_ac))-1>0){this.areas[this.currentid].style.top=(top+(-1*_ac/2))+"px";this.setAreaSize(this.currentid,(_b1+(_ac))-1,(_b0+(_ac)));}else{this.memory[this.currentid].width=0;this.memory[this.currentid].height=0;this.memory[this.currentid].left=x;this.memory[this.currentid].top=y;this.is_drawing=this.DM_SQUARE_RESIZE_LEFT;}}else{if(this.is_drawing==this.DM_SQUARE_RESIZE_TOP){this.fireEvent("onResizeArea",this.currentid);_ac=y-top;if((_b1+(-1*_ac))>0){this.areas[this.currentid].style.top=y+1+"px";this.areas[this.currentid].style.left=(_af+(_ac/2))+"px";this.setAreaSize(this.currentid,(_b1+(-1*_ac)),(_b0+(-1*_ac)));}else{this.memory[this.currentid].width=0;this.memory[this.currentid].height=0;this.memory[this.currentid].left=x;this.memory[this.currentid].top=y;this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM;}}else{if(this.is_drawing==this.DM_SQUARE_RESIZE_BOTTOM){this.fireEvent("onResizeArea",this.currentid);_ac=y-top-_b0;if((_b1+(_ac))-1>0){this.areas[this.currentid].style.left=(_af+(-1*_ac/2))+"px";this.setAreaSize(this.currentid,(_b1+(_ac))-1,(_b0+(_ac))-1);}else{this.memory[this.currentid].width=0;this.memory[this.currentid].height=0;this.memory[this.currentid].left=x;this.memory[this.currentid].top=y;this.is_drawing=this.DM_SQUARE_RESIZE_TOP;}}else{if(this.is_drawing==this.DM_RECTANGLE_RESIZE_LEFT){this.fireEvent("onResizeArea",this.currentid);_aa=x-_af;if(_b1+(-1*_aa)>0){this.areas[this.currentid].style.left=x+1+"px";this.setAreaSize(this.currentid,_b1+(-1*_aa),null);}else{this.memory[this.currentid].width=0;this.memory[this.currentid].left=x;this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT;}}else{if(this.is_drawing==this.DM_RECTANGLE_RESIZE_RIGHT){this.fireEvent("onResizeArea",this.currentid);_aa=x-_af-_b1;if((_b1+(_aa))-1>0){this.setAreaSize(this.currentid,(_b1+(_aa))-1,null);}else{this.memory[this.currentid].width=0;this.memory[this.currentid].left=x;this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT;}}else{if(this.is_drawing==this.DM_RECTANGLE_RESIZE_TOP){this.fireEvent("onResizeArea",this.currentid);_ab=y-top;if((_b0+(-1*_ab))>0){this.areas[this.currentid].style.top=y+1+"px";this.setAreaSize(this.currentid,null,(_b0+(-1*_ab)));}else{this.memory[this.currentid].height=0;this.memory[this.currentid].top=y;this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM;}}else{if(this.is_drawing==this.DM_RECTANGLE_RESIZE_BOTTOM){this.fireEvent("onResizeArea",this.currentid);_ab=y-top-_b0;if((_b0+(_ab))-1>0){this.setAreaSize(this.currentid,null,(_b0+(_ab))-1);}else{this.memory[this.currentid].height=0;this.memory[this.currentid].top=y;this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP;}}}}}}}}}}}}}}
|
145 |
+
if(this.is_drawing){this._repaint(this.areas[this.currentid],this.config.CL_DRAW_SHAPE,x,y);this._updatecoords(this.currentid);}};imgmap.prototype.img_mouseup=function(e){if(this.viewmode===1){return;}
|
146 |
+
var pos=this._getPos(this.pic);var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);x=x+this.pic_container.scrollLeft;y=y+this.pic_container.scrollTop;if(this.is_drawing!=this.DM_RECTANGLE_DRAW&&this.is_drawing!=this.DM_SQUARE_DRAW&&this.is_drawing!=this.DM_POLYGON_DRAW&&this.is_drawing!=this.DM_POLYGON_LASTDRAW&&this.is_drawing!=this.DM_BEZIER_DRAW&&this.is_drawing!=this.DM_BEZIER_LASTDRAW){this.draggedId=null;this.is_drawing=0;this.statusMessage(this.strings.READY);this.relaxArea(this.currentid);if(this.areas[this.currentid]==this._getLastArea()){return;}
|
147 |
+
this.memory[this.currentid].downx=x;this.memory[this.currentid].downy=y;}};imgmap.prototype.img_mousedown=function(e){if(this.viewmode===1){return;}
|
148 |
+
if(!this.areas[this.currentid]&&this.config.mode!="editor2"){return;}
|
149 |
+
var pos=this._getPos(this.pic);var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);x=x+this.pic_container.scrollLeft;y=y+this.pic_container.scrollTop;if(!e){e=window.event;}
|
150 |
+
if(e.shiftKey){if(this.is_drawing==this.DM_POLYGON_DRAW){this.is_drawing=this.DM_POLYGON_LASTDRAW;}else{if(this.is_drawing==this.DM_BEZIER_DRAW){this.is_drawing=this.DM_BEZIER_LASTDRAW;}}}
|
151 |
+
if(this.is_drawing==this.DM_POLYGON_DRAW||this.is_drawing==this.DM_BEZIER_DRAW){this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5;this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5;this.memory[this.currentid].downx=x;this.memory[this.currentid].downy=y;return;}else{if(this.is_drawing&&this.is_drawing!=this.DM_POLYGON_DRAW&&this.is_drawing!=this.DM_BEZIER_DRAW){if(this.is_drawing==this.DM_POLYGON_LASTDRAW||this.is_drawing==this.DM_BEZIER_LASTDRAW){this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5;this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5;this._updatecoords(this.currentid);this.is_drawing=0;this._polygonshrink(this.areas[this.currentid]);}
|
152 |
+
this.is_drawing=0;this.statusMessage(this.strings.READY);this.relaxArea(this.currentid);if(this.areas[this.currentid]==this._getLastArea()){if(this.config.mode!="editor2"){this.addNewArea();}
|
153 |
+
return;}
|
154 |
+
return;}}
|
155 |
+
if(this.config.mode=="editor2"){if(!this.nextShape){return;}
|
156 |
+
this.addNewArea();this.initArea(this.currentid,this.nextShape);}else{if(this.areas[this.currentid].shape=="undefined"||this.areas[this.currentid].shape=="poly"){var _bc=this.nextShape;if(!_bc){_bc="rect";}
|
157 |
+
this.initArea(this.currentid,_bc);}}
|
158 |
+
if(this.areas[this.currentid].shape=="poly"){this.is_drawing=this.DM_POLYGON_DRAW;this.statusMessage(this.strings.POLYGON_DRAW);this.areas[this.currentid].style.left=x+"px";this.areas[this.currentid].style.top=y+"px";this.areas[this.currentid].style.width=0;this.areas[this.currentid].style.height=0;this.areas[this.currentid].xpoints=[];this.areas[this.currentid].ypoints=[];this.areas[this.currentid].xpoints[0]=x;this.areas[this.currentid].ypoints[0]=y;}else{if(this.areas[this.currentid].shape=="bezier1"){this.is_drawing=this.DM_BEZIER_DRAW;this.statusMessage(this.strings.BEZIER_DRAW);this.areas[this.currentid].style.left=x+"px";this.areas[this.currentid].style.top=y+"px";this.areas[this.currentid].style.width=0;this.areas[this.currentid].style.height=0;this.areas[this.currentid].xpoints=[];this.areas[this.currentid].ypoints=[];this.areas[this.currentid].xpoints[0]=x;this.areas[this.currentid].ypoints[0]=y;}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_DRAW;this.statusMessage(this.strings.RECTANGLE_DRAW);this.areas[this.currentid].style.left=x+"px";this.areas[this.currentid].style.top=y+"px";this.areas[this.currentid].style.width=0;this.areas[this.currentid].style.height=0;}else{if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_DRAW;this.statusMessage(this.strings.SQUARE_DRAW);this.areas[this.currentid].style.left=x+"px";this.areas[this.currentid].style.top=y+"px";this.areas[this.currentid].style.width=0;this.areas[this.currentid].style.height=0;}}}}
|
159 |
+
this._setBorder(this.currentid,"DRAW");this.memory[this.currentid].downx=x;this.memory[this.currentid].downy=y;};imgmap.prototype.highlightArea=function(id,_be){if(this.is_drawing){return;}
|
160 |
+
if(this.areas[id]&&this.areas[id].shape!="undefined"){this.fireEvent("onFocusArea",this.areas[id]);this._setBorder(id,"HIGHLIGHT");var _bf=this.config.highlight_opacity;if(_be=="grad"){_bf="-"+_bf;}
|
161 |
+
this._setopacity(this.areas[id],this.config.CL_HIGHLIGHT_BG,_bf);this._repaint(this.areas[id],this.config.CL_HIGHLIGHT_SHAPE);}};imgmap.prototype.blurArea=function(id,_c1){if(this.is_drawing){return;}
|
162 |
+
if(this.areas[id]&&this.areas[id].shape!="undefined"){this.fireEvent("onBlurArea",this.areas[id]);this._setBorder(id,"NORM");var _c2=this.config.norm_opacity;if(_c1=="grad"){_c2="-"+_c2;}
|
163 |
+
this._setopacity(this.areas[id],this.config.CL_NORM_BG,_c2);this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);}};imgmap.prototype.area_mousemove=function(e){if(this.viewmode===1){return;}
|
164 |
+
if(!this.is_drawing){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;if(obj.tagName=="DIV"){obj=obj.parentNode;}
|
165 |
+
if(obj.tagName=="image"||obj.tagName=="group"||obj.tagName=="shape"||obj.tagName=="stroke"){obj=obj.parentNode.parentNode;}
|
166 |
+
if(this.isOpera){e.layerX=e.offsetX;e.layerY=e.offsetY;}
|
167 |
+
var _c5=(this.isMSIE)?(window.event.offsetX):(e.layerX);var _c6=(this.isMSIE)?(window.event.offsetY):(e.layerY);var _c7=(obj.shape=="rect"||obj.shape=="circle");if(_c7&&_c5<6&&_c6>6){obj.style.cursor="w-resize";}else{if(_c7&&_c5>parseInt(obj.style.width,10)-6&&_c6>6){obj.style.cursor="e-resize";}else{if(_c7&&_c5>6&&_c6<6){obj.style.cursor="n-resize";}else{if(_c7&&_c6>parseInt(obj.style.height,10)-6&&_c5>6){obj.style.cursor="s-resize";}else{obj.style.cursor="move";}}}}
|
168 |
+
if(obj.aid!=this.draggedId){if(obj.style.cursor=="move"){obj.style.cursor="default";}
|
169 |
+
return;}
|
170 |
+
if(_c5<6&&_c6>6){if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_RESIZE_LEFT;this.statusMessage(this.strings.SQUARE_RESIZE_LEFT);}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT;this.statusMessage(this.strings.RECTANGLE_RESIZE_LEFT);}}}else{if(_c5>parseInt(this.areas[this.currentid].style.width,10)-6&&_c6>6){if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT;this.statusMessage(this.strings.SQUARE_RESIZE_RIGHT);}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT;this.statusMessage(this.strings.RECTANGLE_RESIZE_RIGHT);}}}else{if(_c5>6&&_c6<6){if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_RESIZE_TOP;this.statusMessage(this.strings.SQUARE_RESIZE_TOP);}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP;this.statusMessage(this.strings.RECTANGLE_RESIZE_TOP);}}}else{if(_c6>parseInt(this.areas[this.currentid].style.height,10)-6&&_c5>6){if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM;this.statusMessage(this.strings.SQUARE_RESIZE_BOTTOM);}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM;this.statusMessage(this.strings.RECTANGLE_RESIZE_BOTTOM);}}}else{if(this.areas[this.currentid].shape=="circle"){this.is_drawing=this.DM_SQUARE_MOVE;this.statusMessage(this.strings.SQUARE_MOVE);this.memory[this.currentid].rdownx=_c5;this.memory[this.currentid].rdowny=_c6;}else{if(this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_MOVE;this.statusMessage(this.strings.RECTANGLE_MOVE);this.memory[this.currentid].rdownx=_c5;this.memory[this.currentid].rdowny=_c6;}else{if(this.areas[this.currentid].shape=="poly"||this.areas[this.currentid].shape=="bezier1"){if(this.areas[this.currentid].xpoints){for(var i=0,le=this.areas[this.currentid].xpoints.length;i<le;i++){this.memory[this.currentid].xpoints[i]=this.areas[this.currentid].xpoints[i];this.memory[this.currentid].ypoints[i]=this.areas[this.currentid].ypoints[i];}}
|
171 |
+
if(this.areas[this.currentid].shape=="poly"){this.is_drawing=this.DM_POLYGON_MOVE;this.statusMessage(this.strings.POLYGON_MOVE);}else{if(this.areas[this.currentid].shape=="bezier1"){this.is_drawing=this.DM_BEZIER_MOVE;this.statusMessage(this.strings.BEZIER_MOVE);}}
|
172 |
+
this.memory[this.currentid].rdownx=_c5;this.memory[this.currentid].rdowny=_c6;}}}}}}}
|
173 |
+
this.memory[this.currentid].width=parseInt(this.areas[this.currentid].style.width,10);this.memory[this.currentid].height=parseInt(this.areas[this.currentid].style.height,10);this.memory[this.currentid].top=parseInt(this.areas[this.currentid].style.top,10);this.memory[this.currentid].left=parseInt(this.areas[this.currentid].style.left,10);this._setBorder(this.currentid,"DRAW");this._setopacity(this.areas[this.currentid],this.config.CL_DRAW_BG,this.config.draw_opacity);}else{this.img_mousemove(e);}};imgmap.prototype.area_mouseup=function(e){if(this.viewmode===1){return;}
|
174 |
+
if(!this.is_drawing){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;if(obj.tagName=="DIV"){obj=obj.parentNode;}
|
175 |
+
if(obj.tagName=="image"||obj.tagName=="group"||obj.tagName=="shape"||obj.tagName=="stroke"){obj=obj.parentNode.parentNode;}
|
176 |
+
if(this.areas[this.currentid]!=obj){if(typeof obj.aid=="undefined"){this.log("Cannot identify target area",1);return;}}
|
177 |
+
this.draggedId=null;}else{this.img_mouseup(e);}};imgmap.prototype.area_mouseover=function(e){if(this.viewmode===1&&this.config.mode!==""){return;}
|
178 |
+
if(!this.is_drawing){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;if(obj.tagName=="DIV"){obj=obj.parentNode;}
|
179 |
+
if(obj.tagName=="image"||obj.tagName=="group"||obj.tagName=="shape"||obj.tagName=="stroke"){obj=obj.parentNode.parentNode;}
|
180 |
+
this.highlightArea(obj.aid,"grad");}};imgmap.prototype.area_mouseout=function(e){if(this.viewmode===1&&this.config.mode!==""){return;}
|
181 |
+
if(!this.is_drawing){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;if(obj.tagName=="DIV"){obj=obj.parentNode;}
|
182 |
+
if(obj.tagName=="image"||obj.tagName=="group"||obj.tagName=="shape"||obj.tagName=="stroke"){obj=obj.parentNode.parentNode;}
|
183 |
+
this.blurArea(obj.aid,"grad");}};imgmap.prototype.area_mousedown=function(e){if(this.viewmode===1){return;}
|
184 |
+
if(!this.is_drawing){var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;if(obj.tagName=="DIV"){obj=obj.parentNode;}
|
185 |
+
if(obj.tagName=="image"||obj.tagName=="group"||obj.tagName=="shape"||obj.tagName=="stroke"){obj=obj.parentNode.parentNode;}
|
186 |
+
if(this.areas[this.currentid]!=obj){if(typeof obj.aid=="undefined"){this.log("Cannot identify target area",1);return;}
|
187 |
+
this.currentid=obj.aid;}
|
188 |
+
this.draggedId=this.currentid;this.selectedId=this.currentid;this.fireEvent("onSelectArea",this.areas[this.currentid]);if(this.isMSIE){window.event.cancelBubble=true;}else{e.stopPropagation();}}else{this.img_mousedown(e);}};imgmap.prototype.doc_keydown=function(e){if(this.viewmode===1){return;}
|
189 |
+
var key=(this.isMSIE)?event.keyCode:e.keyCode;if(key==46){if(this.selectedId!==null&&!this.is_drawing){this.removeArea(this.selectedId);}}else{if(key==16){if(this.is_drawing==this.DM_RECTANGLE_DRAW){this.is_drawing=this.DM_SQUARE_DRAW;this.statusMessage(this.strings.SQUARE2_DRAW);}}}};imgmap.prototype.doc_keyup=function(e){var key=(this.isMSIE)?event.keyCode:e.keyCode;if(key==16){if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rect"){this.is_drawing=this.DM_RECTANGLE_DRAW;this.statusMessage(this.strings.RECTANGLE_DRAW);}}};imgmap.prototype.doc_mousedown=function(e){if(this.viewmode===1){return;}
|
190 |
+
if(!this.is_drawing){this.selectedId=null;}};imgmap.prototype._getPos=function(_d7){var _d8=0;var _d9=0;if(_d7){var _da=_d7.offsetParent;if(_da){while((_da=_d7.offsetParent)){if(_d7.offsetLeft>0){_d8+=_d7.offsetLeft;}
|
191 |
+
if(_d7.offsetTop>0){_d9+=_d7.offsetTop;}
|
192 |
+
_d7=_da;}}else{_d8=_d7.offsetLeft;_d9=_d7.offsetTop;}}
|
193 |
+
return{x:_d8,y:_d9};};imgmap.prototype._getLastArea=function(){for(var i=this.areas.length-1;i>=0;i--){if(this.areas[i]){return this.areas[i];}}
|
194 |
+
return null;};imgmap.prototype.assignCSS=function(obj,_dd){var _de=_dd.split(";");for(var i=0;i<_de.length;i++){var p=_de[i].split(":");var pp=p[0].trim().split("-");var _e2=pp[0];for(var j=1;j<pp.length;j++){_e2+=pp[j].replace(/^./,pp[j].substring(0,1).toUpperCase());}
|
195 |
+
obj.style[_e2.trim()]=p[1].trim();}};imgmap.prototype.fireEvent=function(evt,obj){if(typeof this.config.custom_callbacks[evt]=="function"){return this.config.custom_callbacks[evt](obj);}};imgmap.prototype.setAreaSize=function(id,w,h){if(id===null){id=this.currentid;}
|
196 |
+
if(w!==null){this.areas[id].width=w;this.areas[id].style.width=(w)+"px";this.areas[id].setAttribute("width",w);}
|
197 |
+
if(h!==null){this.areas[id].height=h;this.areas[id].style.height=(h)+"px";this.areas[id].setAttribute("height",h);}};imgmap.prototype.detectLanguage=function(){var _e9;if(navigator.userLanguage){_e9=navigator.userLanguage.toLowerCase();}else{if(navigator.language){_e9=navigator.language.toLowerCase();}else{return this.config.defaultLang;}}
|
198 |
+
if(_e9.length>=2){_e9=_e9.substring(0,2);return _e9;}
|
199 |
+
return this.config.defaultLang;};imgmap.prototype.disableSelection=function(_ea){if(typeof _ea=="undefined"||!_ea){return false;}
|
200 |
+
if(typeof _ea.onselectstart!="undefined"){_ea.onselectstart=function(){return false;};}
|
201 |
+
if(typeof _ea.unselectable!="undefined"){_ea.unselectable="on";}
|
202 |
+
if(typeof _ea.style.MozUserSelect!="undefined"){_ea.style.MozUserSelect="none";}};Function.prototype.bind=function(_eb){var _ec=this;return function(){return _ec.apply(_eb,arguments);};};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.ltrim=function(){return this.replace(/^\s+/,"");};String.prototype.rtrim=function(){return this.replace(/\s+$/,"");};function imgmap_spawnObjects(_ed){var _ee=document.getElementsByTagName("map");var _ef=document.getElementsByTagName("img");var _f0=[];for(var i=0,le=_ee.length;i<le;i++){for(var j=0,le2=_ef.length;j<le2;j++){if("#"+_ee[i].name==_ef[j].getAttribute("usemap")){_ed.mode="";imapn=new imgmap(_ed);imapn.useImage(_ef[j]);imapn.setMapHTML(_ee[i]);imapn.viewmode=1;_f0.push(imapn);}}}}
|
addons/imgmap/jscripts/lang_de.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//german string resources by Iwan Fux
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : 'Bereit',
|
6 |
+
PREVIEW_MODE : 'Vorschau Modus. Image Map testen.',
|
7 |
+
DESIGN_MODE : 'Design Modus. Neue Formen hinzufügen oder bestehende bearbeiten.',
|
8 |
+
|
9 |
+
HINT_ADD : 'Neuen Bereich hinzufügen',
|
10 |
+
HINT_DELETE : 'Ausgewählte Bereiche löschen',
|
11 |
+
HINT_PREVIEW : 'Vorschau Image Map',
|
12 |
+
HINT_HTML : 'Image Map HTML erhalten',
|
13 |
+
HINT_CLIPBOARD : 'In Zwischenablage kopieren',
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : 'Viereck wird gezeichnet. SHIFT drücken für Quadrat Modus.',
|
16 |
+
RECTANGLE_MOVE : 'Viereck wird bewegt',
|
17 |
+
RECTANGLE_RESIZE_TOP : 'Viereckhöhe wird verändert',
|
18 |
+
RECTANGLE_RESIZE_RIGHT : 'Viereckbreite wird verändert',
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : 'Viereckhöhe wird verändert',
|
20 |
+
RECTANGLE_RESIZE_LEFT : 'Viereckbreite wird verändert',
|
21 |
+
|
22 |
+
SQUARE_DRAW : 'Kreis wird gezeichnet',
|
23 |
+
SQUARE2_DRAW : 'Quadrat wird gezeichnet. SHIFT loslassen für Viereck Modus.',
|
24 |
+
SQUARE_MOVE : 'Kreis wird bewegt',
|
25 |
+
SQUARE_RESIZE_TOP : 'Kreisgrösse wird verändert',
|
26 |
+
SQUARE_RESIZE_RIGHT : 'Kreisgrösse wird verändert',
|
27 |
+
SQUARE_RESIZE_BOTTOM : 'Kreisgrösse wird verändert',
|
28 |
+
SQUARE_RESIZE_LEFT : 'Kreisgrösse wird verändert',
|
29 |
+
|
30 |
+
POLYGON_DRAW : 'Polygon wird gezeichnet. Für den letzten Kontrollpunkt SHIFT + Klicken.',
|
31 |
+
POLYGON_MOVE : 'Polygon wird bewegt',
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : 'Excanvas nicht korrekt geladen. Versuch Seite neu zu laden.',
|
34 |
+
ERR_INVALID_COORDS : 'Ungültige Koordinaten.'
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/jscripts/lang_en.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//english string resources
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : 'Ready',
|
6 |
+
PREVIEW_MODE : 'Preview mode. Test your image map.',
|
7 |
+
DESIGN_MODE : 'Design mode. Add new shapes or modify existing ones.',
|
8 |
+
|
9 |
+
HINT_ADD : 'Add new area',
|
10 |
+
HINT_DELETE : 'Delete selected area',
|
11 |
+
HINT_PREVIEW : 'Preview image map',
|
12 |
+
HINT_HTML : 'Get image map HTML',
|
13 |
+
HINT_CLIPBOARD : 'Copy to clipboard',
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : 'Drawing rectangle. Hold down SHIFT for square mode.',
|
16 |
+
RECTANGLE_MOVE : 'Moving rectangle',
|
17 |
+
RECTANGLE_RESIZE_TOP : 'Resizing rectangle',
|
18 |
+
RECTANGLE_RESIZE_RIGHT : 'Resizing rectangle',
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : 'Resizing rectangle',
|
20 |
+
RECTANGLE_RESIZE_LEFT : 'Resizing rectangle',
|
21 |
+
|
22 |
+
SQUARE_DRAW : 'Drawing circle',
|
23 |
+
SQUARE2_DRAW : 'Drawing square. Release SHIFT for rectangle mode.',
|
24 |
+
SQUARE_MOVE : 'Moving circle',
|
25 |
+
SQUARE_RESIZE_TOP : 'Resizing circle',
|
26 |
+
SQUARE_RESIZE_RIGHT : 'Resizing circle',
|
27 |
+
SQUARE_RESIZE_BOTTOM : 'Resizing circle',
|
28 |
+
SQUARE_RESIZE_LEFT : 'Resizing circle',
|
29 |
+
|
30 |
+
POLYGON_DRAW : 'Drawing polygon. Use SHIFT + click for the last control point.',
|
31 |
+
POLYGON_MOVE : 'Moving polygon',
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : 'Excanvas not loaded properly. Try to refresh the page.',
|
34 |
+
ERR_INVALID_COORDS : 'Invalid coordinates.'
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/jscripts/lang_es.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Spanish string resources
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : 'Listo',
|
6 |
+
PREVIEW_MODE : 'Modo de previsualización. Prueba las zonas interactivas.',
|
7 |
+
DESIGN_MODE : 'Modo diseño. Añade nuevas zona o modifica las existentes.',
|
8 |
+
|
9 |
+
HINT_ADD : 'Añade nueva zona',
|
10 |
+
HINT_DELETE : 'Borra la zona seleccionada',
|
11 |
+
HINT_PREVIEW : 'Previsualiza el mapa',
|
12 |
+
HINT_HTML : 'Muestra el HTML del mapa',
|
13 |
+
HINT_CLIPBOARD : 'Copiar al portapapeles',
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : 'Dibujando un rectángulo. Pulsa MAYS para cambiar a cuadrado.',
|
16 |
+
RECTANGLE_MOVE : 'Moviendo el rectángulo',
|
17 |
+
RECTANGLE_RESIZE_TOP : 'Redimensionando el rectángulo',
|
18 |
+
RECTANGLE_RESIZE_RIGHT : 'Redimensionando el rectángulo',
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : 'Redimensionando el rectángulo',
|
20 |
+
RECTANGLE_RESIZE_LEFT : 'Redimensionando el rectángulo',
|
21 |
+
|
22 |
+
SQUARE_DRAW : 'Dibujando un círculo',
|
23 |
+
SQUARE2_DRAW : 'Dibujando un cuadrado. Libera MAYS para cambiar a rectángulo.',
|
24 |
+
SQUARE_MOVE : 'Moviendo el círculo',
|
25 |
+
SQUARE_RESIZE_TOP : 'Redimensionando el círculo',
|
26 |
+
SQUARE_RESIZE_RIGHT : 'Redimensionando el círculo',
|
27 |
+
SQUARE_RESIZE_BOTTOM : 'Redimensionando el círculo',
|
28 |
+
SQUARE_RESIZE_LEFT : 'Redimensionando el círculo',
|
29 |
+
|
30 |
+
POLYGON_DRAW : 'Dibujando un polígono. Usa MAYS + click para crear el último punto.',
|
31 |
+
POLYGON_MOVE : 'Moviendo el polígono',
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : 'Excanvas no se ha cargado correctamente. Prueba a refrescar la página.',
|
34 |
+
ERR_INVALID_COORDS : 'Coordenadas incorrectas.'
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/jscripts/lang_fr.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//english string resources - Paul Cazes
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : "Pret",
|
6 |
+
PREVIEW_MODE : "Mode pre-visualisation. Test de l'image",
|
7 |
+
DESIGN_MODE : "Mode design. Ajou de nouvelles formes ou modification des existantes",
|
8 |
+
|
9 |
+
HINT_ADD : "Ajouter une nouvelle zone",
|
10 |
+
HINT_DELETE : "Detruire la zone selectionnee",
|
11 |
+
HINT_PREVIEW : "Pre-visualiser l'image",
|
12 |
+
HINT_HTML : "Obtenir l'image HTML",
|
13 |
+
HINT_CLIPBOARD : "Copier dans le presse papier",
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : "Dessiner un rectangle. Maintenir enfoncer la touche SHIFT pour le mode carre",
|
16 |
+
RECTANGLE_MOVE : "Deplacer le rectangle",
|
17 |
+
RECTANGLE_RESIZE_TOP : "Redimensionner le rectangle",
|
18 |
+
RECTANGLE_RESIZE_RIGHT : "Redimensionner le rectangle",
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : "Redimensionner le rectangle",
|
20 |
+
RECTANGLE_RESIZE_LEFT : "Redimensionner le rectangle",
|
21 |
+
|
22 |
+
SQUARE_DRAW : "Dessiner un cercle",
|
23 |
+
SQUARE2_DRAW : "Dessiner un carre. Relacher la touche SHIFT pour le mode rectangle",
|
24 |
+
SQUARE_MOVE : "Deplacer le carre",
|
25 |
+
SQUARE_RESIZE_TOP : "Redimensionner le carre",
|
26 |
+
SQUARE_RESIZE_RIGHT : "Redimensionner le carre",
|
27 |
+
SQUARE_RESIZE_BOTTOM : "Redimensionner le carre",
|
28 |
+
SQUARE_RESIZE_LEFT : "Redimensionner le carre",
|
29 |
+
|
30 |
+
POLYGON_DRAW : "Dessiner un polygone. Utiliser SHIFT + Click pour le dernier point de controle",
|
31 |
+
POLYGON_MOVE : "Deplacer le polygone",
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : "Erreur de chargement Excanvas. Essayez de rafraichir la page",
|
34 |
+
ERR_INVALID_COORDS : "Coordonnees invalides"
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/jscripts/lang_hu.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//hungarian string resources
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : 'Kész.',
|
6 |
+
PREVIEW_MODE : 'Előnézet.',
|
7 |
+
DESIGN_MODE : 'Tervezés nézet. Rajzoljon új területeket vagy módosítsa a már meglévőket.',
|
8 |
+
|
9 |
+
HINT_ADD : 'Új terület hozzáadása',
|
10 |
+
HINT_DELETE : 'Kiválasztott terület törlése',
|
11 |
+
HINT_PREVIEW : 'Előnézet',
|
12 |
+
HINT_HTML : 'HTML kód megjelenítése',
|
13 |
+
HINT_CLIPBOARD : 'Vágólapra másolás',
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : 'Téglalap rajzolás. Tartsa lenyomva a SHIFT billentyűt négyzet rajzoláshoz.',
|
16 |
+
RECTANGLE_MOVE : 'Téglalap mozgatás',
|
17 |
+
RECTANGLE_RESIZE_TOP : 'Téglalap átméretezés',
|
18 |
+
RECTANGLE_RESIZE_RIGHT : 'Téglalap átméretezés',
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : 'Téglalap átméretezés',
|
20 |
+
RECTANGLE_RESIZE_LEFT : 'Téglalap átméretezés',
|
21 |
+
|
22 |
+
SQUARE_DRAW : 'Kör rajzolás',
|
23 |
+
SQUARE2_DRAW : 'Négyzet rajzolás. Engedje el a SHIFT billentyűt téglalap rajzoláshoz.',
|
24 |
+
SQUARE_MOVE : 'Kör mozgatás',
|
25 |
+
SQUARE_RESIZE_TOP : 'Kör átméretezés',
|
26 |
+
SQUARE_RESIZE_RIGHT : 'Kör átméretezés',
|
27 |
+
SQUARE_RESIZE_BOTTOM : 'Kör átméretezés',
|
28 |
+
SQUARE_RESIZE_LEFT : 'Kör átméretezés',
|
29 |
+
|
30 |
+
POLYGON_DRAW : 'Sokszög rajzolás. SHIFT + kattintás az utolsó pontnál.',
|
31 |
+
POLYGON_MOVE : 'Sokszög mozgatás',
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : 'Az Excanvas nem töltődött be rendesen. Próbálja meg frissíteni az oldalt.',
|
34 |
+
ERR_INVALID_COORDS : 'Érvénytelen koordináták.'
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/jscripts/lang_pt.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//portuguese string resources - Joao Felipe Ferreira
|
2 |
+
|
3 |
+
var imgmapStrings = {
|
4 |
+
|
5 |
+
READY : 'Pronto',
|
6 |
+
PREVIEW_MODE : 'Modo previsão. Teste a sua imagem.',
|
7 |
+
DESIGN_MODE : 'Modo desenho. Adicione novas formas e modifique as existentes.',
|
8 |
+
|
9 |
+
HINT_ADD : 'Adicione área',
|
10 |
+
HINT_DELETE : 'Remova área selecionada',
|
11 |
+
HINT_PREVIEW : 'Previsão de imagem',
|
12 |
+
HINT_HTML : 'Obtenção de imagem em HTML',
|
13 |
+
HINT_CLIPBOARD : 'Copiar para o fundo de trabalho',
|
14 |
+
|
15 |
+
RECTANGLE_DRAW : 'Desenhando um rectângulo. Manter o SHIFT pressionado para o modo quadrado.',
|
16 |
+
RECTANGLE_MOVE : 'Mover rectângulo',
|
17 |
+
RECTANGLE_RESIZE_TOP : 'Redefinir rectangulo',
|
18 |
+
RECTANGLE_RESIZE_RIGHT : 'Redefinir rectangulo',
|
19 |
+
RECTANGLE_RESIZE_BOTTOM : 'Redefinir rectangulo',
|
20 |
+
RECTANGLE_RESIZE_LEFT : 'Redefinir rectangulo',
|
21 |
+
|
22 |
+
SQUARE_DRAW : 'Desenhando círculo',
|
23 |
+
SQUARE2_DRAW : 'Desenhando quadrado. Liberte o SHIFT para o modo rectângulo.',
|
24 |
+
SQUARE_MOVE : 'Movendo o círculo',
|
25 |
+
SQUARE_RESIZE_TOP : 'Redifnir círculo',
|
26 |
+
SQUARE_RESIZE_RIGHT : 'Redifnir círculo',
|
27 |
+
SQUARE_RESIZE_BOTTOM : 'Redifnir círculo',
|
28 |
+
SQUARE_RESIZE_LEFT : 'Redifnir círculo',
|
29 |
+
|
30 |
+
POLYGON_DRAW : 'Desenhar polígono. Use SHIFT + clique para o último ponto de controlo.',
|
31 |
+
POLYGON_MOVE : 'Movendo o polígono',
|
32 |
+
|
33 |
+
ERR_EXCANVAS_LOAD : 'Excanvas não carregada correctamente. Tente refrescar a página.',
|
34 |
+
ERR_INVALID_COORDS : 'Coordenadas inválidas.'
|
35 |
+
|
36 |
+
};
|
37 |
+
//alert('lang loaded');
|
addons/imgmap/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/imgmap/langs/en.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addI18n('en.imgmap', {
|
4 |
+
title : 'Image Map Editor',
|
5 |
+
desc : 'Image Map Editor',
|
6 |
+
remove : 'Remove map'
|
7 |
+
});
|
addons/imgmap/popup.html
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{#imgmap.title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
5 |
+
<!--[if gte IE 6]>
|
6 |
+
<script language="javascript" type="text/javascript" src="jscripts/excanvas.js"></script>
|
7 |
+
<![endif]-->
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/imgmap_packed.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
10 |
+
<link rel="stylesheet" href="css/imgmap.css" type="text/css"/>
|
11 |
+
<meta http-equiv="imagetoolbar" content="no"/>
|
12 |
+
</head>
|
13 |
+
<body id="imgmap" onLoad="delayedLoad()">
|
14 |
+
<form id="img_area_form">
|
15 |
+
<fieldset>
|
16 |
+
<legend>
|
17 |
+
<a onClick="toggleFieldset(this.parentNode.parentNode)">Image map areas</a>
|
18 |
+
</legend>
|
19 |
+
<div style="border-bottom: solid 1px #efefef">
|
20 |
+
<table cellspacing="0" width="100%">
|
21 |
+
<tr>
|
22 |
+
<td width="110">
|
23 |
+
<div id="button_container">
|
24 |
+
<!-- buttons come here -->
|
25 |
+
<img src="images/add.gif" onClick="myimgmap.addNewArea()" alt="Add new area" title="Add new area"/>
|
26 |
+
<img src="images/delete.gif" onClick="myimgmap.removeArea(myimgmap.currentid)" alt="Delete selected area" title="Delete selected area"/>
|
27 |
+
<img src="images/html.gif" onClick="gui_htmlShow()" alt="Get image map HTML" title="Get image map HTML"/>
|
28 |
+
</div>
|
29 |
+
</td>
|
30 |
+
<td>
|
31 |
+
<label for="dd_zoom">Zoom</label>:
|
32 |
+
<select onChange="gui_zoom(this)" id="dd_zoom">
|
33 |
+
<option value='0.25'>25%</option>
|
34 |
+
<option value='0.5'>50%</option>
|
35 |
+
<option value='1' selected="1">100%</option>
|
36 |
+
<option value='2'>200%</option>
|
37 |
+
<option value='3'>300%</option>
|
38 |
+
</select>
|
39 |
+
</td>
|
40 |
+
<td align="right" width="50%">
|
41 |
+
<input type="checkbox" id="bb" onClick="toggleBoundingBox(this)"/><label for="bb">bounding box</label>
|
42 |
+
<select onChange="changelabeling(this)">
|
43 |
+
<option value=''>No labeling</option>
|
44 |
+
<option value='%n' selected='1'>Label with numbers</option>
|
45 |
+
<option value='%a'>Label with alt text</option>
|
46 |
+
<option value='%h'>Label with href</option>
|
47 |
+
<option value='%c'>Label with coords</option>
|
48 |
+
</select>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</div>
|
53 |
+
<div id="form_container" style="clear: both;">
|
54 |
+
<!-- form elements come here -->
|
55 |
+
</div>
|
56 |
+
</fieldset>
|
57 |
+
<fieldset>
|
58 |
+
<legend>
|
59 |
+
<a onClick="toggleFieldset(this.parentNode.parentNode)">Image</a>
|
60 |
+
</legend>
|
61 |
+
<div id="pic_container">
|
62 |
+
</div>
|
63 |
+
</fieldset>
|
64 |
+
<fieldset>
|
65 |
+
<legend>
|
66 |
+
<a onClick="toggleFieldset(this.parentNode.parentNode)">Status</a>
|
67 |
+
</legend>
|
68 |
+
<div id="status_container"></div>
|
69 |
+
</fieldset>
|
70 |
+
<fieldset id="fieldset_html" class="fieldset_off">
|
71 |
+
<legend>
|
72 |
+
<a onClick="toggleFieldset(this.parentNode.parentNode)">Code</a>
|
73 |
+
</legend>
|
74 |
+
<div>
|
75 |
+
<textarea id="html_container" xstyle="float: left; clear: left;"></textarea></div>
|
76 |
+
</fieldset>
|
77 |
+
|
78 |
+
<div class="mceActionPanel">
|
79 |
+
<div style="float: left">
|
80 |
+
<input type="button" id="insert" name="update" value="{#update}" onClick="updateAction();" />
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div style="float: right">
|
84 |
+
<input type="button" id="remove" class="button" style="background-position: 0px 0!important;" name="remove" value="{#imgmap.remove}" onClick="removeAction();" />
|
85 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="cancelAction();" />
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
</form>
|
90 |
+
|
91 |
+
|
92 |
+
<script type="text/javascript">
|
93 |
+
|
94 |
+
function delayedLoad() {
|
95 |
+
//alert(tinymce.isWebKit);
|
96 |
+
// Changed by Josh Lobe to make work in the webkits. Old init follows: tinyMCEPopup.onInit.add(init);
|
97 |
+
if (tinymce.isIE || tinymce.isWebKit) {
|
98 |
+
tinyMCEPopup.onInit.add(init());
|
99 |
+
}
|
100 |
+
else {
|
101 |
+
tinyMCEPopup.onInit.add(init());
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
</script>
|
107 |
+
|
108 |
+
</body>
|
109 |
+
</html>
|
addons/insertdatetime/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111093800000000" remote="130111093800000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111093800000000" remote="130111093800000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/insertdatetime/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{/*title : 'insertdatetime.insertdate_desc',*/title:a.getLang('insertdatetime.insertdate_desc'),cmd:"mceInsertDate"});a.addButton("inserttime",{/*title : 'insertdatetime.inserttime_desc',*/title:a.getLang('insertdatetime.inserttime_desc'),cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
|
addons/insertdatetime/editor_plugin_src.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.InsertDateTime', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
ed.addCommand('mceInsertDate', function() {
|
19 |
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
|
20 |
+
|
21 |
+
ed.execCommand('mceInsertContent', false, str);
|
22 |
+
});
|
23 |
+
|
24 |
+
ed.addCommand('mceInsertTime', function() {
|
25 |
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
|
26 |
+
|
27 |
+
ed.execCommand('mceInsertContent', false, str);
|
28 |
+
});
|
29 |
+
|
30 |
+
ed.addButton('insertdate', {/*title : 'insertdatetime.insertdate_desc',*/title : ed.getLang('insertdatetime.insertdate_desc'), cmd : 'mceInsertDate'});
|
31 |
+
ed.addButton('inserttime', {/*title : 'insertdatetime.inserttime_desc',*/title : ed.getLang('insertdatetime.inserttime_desc'), cmd : 'mceInsertTime'});
|
32 |
+
},
|
33 |
+
|
34 |
+
getInfo : function() {
|
35 |
+
return {
|
36 |
+
longname : 'Insert date/time',
|
37 |
+
author : 'Moxiecode Systems AB',
|
38 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
39 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
|
40 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
41 |
+
};
|
42 |
+
},
|
43 |
+
|
44 |
+
// Private methods
|
45 |
+
|
46 |
+
_getDateTime : function(d, fmt) {
|
47 |
+
var ed = this.editor;
|
48 |
+
|
49 |
+
function addZeros(value, len) {
|
50 |
+
value = "" + value;
|
51 |
+
|
52 |
+
if (value.length < len) {
|
53 |
+
for (var i=0; i<(len-value.length); i++)
|
54 |
+
value = "0" + value;
|
55 |
+
}
|
56 |
+
|
57 |
+
return value;
|
58 |
+
};
|
59 |
+
|
60 |
+
fmt = fmt.replace("%D", "%m/%d/%y");
|
61 |
+
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
62 |
+
fmt = fmt.replace("%Y", "" + d.getFullYear());
|
63 |
+
fmt = fmt.replace("%y", "" + d.getYear());
|
64 |
+
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
|
65 |
+
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
|
66 |
+
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
|
67 |
+
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
|
68 |
+
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
69 |
+
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
70 |
+
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
71 |
+
fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
|
72 |
+
fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
|
73 |
+
fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
|
74 |
+
fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
|
75 |
+
fmt = fmt.replace("%%", "%");
|
76 |
+
|
77 |
+
return fmt;
|
78 |
+
}
|
79 |
+
});
|
80 |
+
|
81 |
+
// Register plugin
|
82 |
+
tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
|
83 |
+
})();
|
addons/jwl_span/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="jwl_span.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186890814875561" remote="130186854600000000" Dst="2" />
|
4 |
+
<file name="span.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/jwl_span/jwl_span.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Span Button plug-in for TinyMCE version 3.x
|
3 |
+
* @author Josh Lobe
|
4 |
+
* @version 1.0
|
5 |
+
* @package Span Button
|
6 |
+
* @link http://www.joshlobe.com/
|
7 |
+
* Span Button plugin for TinyMCE
|
8 |
+
*/
|
9 |
+
(function(){
|
10 |
+
|
11 |
+
//tinymce.PluginManager.requireLangPack('jwlspan');
|
12 |
+
|
13 |
+
tinymce.create('tinymce.plugins.jwlspan', {
|
14 |
+
|
15 |
+
init : function(ed, url){
|
16 |
+
ed.addCommand('jwlSpanButton', function(){
|
17 |
+
jwl_sel_content = tinyMCE.activeEditor.selection.getContent();
|
18 |
+
tinyMCE.activeEditor.selection.setContent('<span>' + jwl_sel_content + '</span>');
|
19 |
+
});
|
20 |
+
ed.addButton('jwlSpan', {
|
21 |
+
title: ed.getLang('jwlspan.title'),
|
22 |
+
//image: url + '/span.png',
|
23 |
+
cmd: 'jwlSpanButton'
|
24 |
+
});
|
25 |
+
//set button to pressed when cursor is within a span tag
|
26 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
27 |
+
cm.setActive('jwlSpan', n.nodeName == 'SPAN');
|
28 |
+
});
|
29 |
+
//ed.addShortcut('alt+ctrl+x', ed.getLang('jwlspan.php'), 'jwlSpanButton');
|
30 |
+
},
|
31 |
+
createControl : function(n, cm){
|
32 |
+
return null;
|
33 |
+
},
|
34 |
+
getInfo : function(){
|
35 |
+
return {
|
36 |
+
longname: 'Tinymce Span Button',
|
37 |
+
author: 'Josh Lobe',
|
38 |
+
authorurl: 'http://joshlobe.com/',
|
39 |
+
infourl: 'http://joshlobe.com/',
|
40 |
+
version: "1.0"
|
41 |
+
};
|
42 |
+
}
|
43 |
+
});
|
44 |
+
tinymce.PluginManager.add('jwlspan', tinymce.plugins.jwlspan);
|
45 |
+
})();
|
46 |
+
|
47 |
+
|
48 |
+
|
addons/jwl_span/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111116600000000" remote="130111116600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/jwl_span/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n("en.jwlspan",{
|
2 |
+
title : "Wrap with <span></span> tags."
|
3 |
+
});
|
addons/jwl_span/span.png
ADDED
Binary file
|
addons/layer/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111122600000000" remote="130111122600000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111122600000000" remote="130111122600000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/layer/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){function a(b){do{if(b.className&&b.className.indexOf("mceItemLayer")!=-1){return b}}while(b=b.parentNode)}tinymce.create("tinymce.plugins.Layer",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceInsertLayer",d._insertLayer,d);b.addCommand("mceMoveForward",function(){d._move(1)});b.addCommand("mceMoveBackward",function(){d._move(-1)});b.addCommand("mceMakeAbsolute",function(){d._toggleAbsolute()});b.addButton("moveforward",{title:b.getLang("layer.forward_desc"),cmd:"mceMoveForward"});b.addButton("movebackward",{title:b.getLang("layer.backward_desc"),cmd:"mceMoveBackward"});b.addButton("absolute",{title:b.getLang("layer.absolute_desc"),cmd:"mceMakeAbsolute"});b.addButton("insertlayer",{title:b.getLang("layer.insertlayer_desc"),cmd:"mceInsertLayer"});b.onInit.add(function(){var e=b.dom;if(tinymce.isIE){b.getDoc().execCommand("2D-Position",false,true)}});b.onMouseUp.add(function(f,h){var g=a(h.target);if(g){f.dom.setAttrib(g,"data-mce-style","")}});b.onMouseDown.add(function(f,j){var h=j.target,i=f.getDoc(),g;if(tinymce.isGecko){if(a(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});b.onNodeChange.add(d._nodeChange,d);b.onVisualAid.add(d._visualAid,d)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(c,b,f){var d,e;d=this._getParentLayer(f);e=c.dom.getParent(f,"DIV,P,IMG");if(!e){b.setDisabled("absolute",1);b.setDisabled("moveforward",1);b.setDisabled("movebackward",1)}else{b.setDisabled("absolute",0);b.setDisabled("moveforward",!d);b.setDisabled("movebackward",!d);b.setActive("absolute",d&&d.style.position.toLowerCase()=="absolute")}},_visualAid:function(b,d,c){var f=b.dom;tinymce.each(f.select("div,p",d),function(g){if(/^(absolute|relative|fixed)$/i.test(g.style.position)){if(c){f.addClass(g,"mceItemVisualAid")}else{f.removeClass(g,"mceItemVisualAid")}f.addClass(g,"mceItemLayer")}})},_move:function(j){var c=this.editor,g,h=[],f=this._getParentLayer(c.selection.getNode()),e=-1,k=-1,b;b=[];tinymce.walk(c.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){b.push(d)}},"childNodes");for(g=0;g<b.length;g++){h[g]=b[g].style.zIndex?parseInt(b[g].style.zIndex):0;if(e<0&&b[g]==f){e=g}}if(j<0){for(g=0;g<h.length;g++){if(h[g]<h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;g<h.length;g++){if(h[g]>h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
|
addons/layer/editor_plugin_src.js
ADDED
@@ -0,0 +1,262 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
function findParentLayer(node) {
|
13 |
+
do {
|
14 |
+
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
|
15 |
+
return node;
|
16 |
+
}
|
17 |
+
} while (node = node.parentNode);
|
18 |
+
};
|
19 |
+
|
20 |
+
tinymce.create('tinymce.plugins.Layer', {
|
21 |
+
init : function(ed, url) {
|
22 |
+
var t = this;
|
23 |
+
|
24 |
+
t.editor = ed;
|
25 |
+
|
26 |
+
// Register commands
|
27 |
+
ed.addCommand('mceInsertLayer', t._insertLayer, t);
|
28 |
+
|
29 |
+
ed.addCommand('mceMoveForward', function() {
|
30 |
+
t._move(1);
|
31 |
+
});
|
32 |
+
|
33 |
+
ed.addCommand('mceMoveBackward', function() {
|
34 |
+
t._move(-1);
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.addCommand('mceMakeAbsolute', function() {
|
38 |
+
t._toggleAbsolute();
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register buttons
|
42 |
+
ed.addButton('moveforward', {title : ed.getLang('layer.forward_desc'), cmd : 'mceMoveForward'});
|
43 |
+
ed.addButton('movebackward', {title : ed.getLang('layer.backward_desc'), cmd : 'mceMoveBackward'});
|
44 |
+
ed.addButton('absolute', {title : ed.getLang('layer.absolute_desc'), cmd : 'mceMakeAbsolute'});
|
45 |
+
ed.addButton('insertlayer', {title : ed.getLang('layer.insertlayer_desc'), cmd : 'mceInsertLayer'});
|
46 |
+
|
47 |
+
ed.onInit.add(function() {
|
48 |
+
var dom = ed.dom;
|
49 |
+
|
50 |
+
if (tinymce.isIE)
|
51 |
+
ed.getDoc().execCommand('2D-Position', false, true);
|
52 |
+
});
|
53 |
+
|
54 |
+
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
|
55 |
+
ed.onMouseUp.add(function(ed, e) {
|
56 |
+
var layer = findParentLayer(e.target);
|
57 |
+
|
58 |
+
if (layer) {
|
59 |
+
ed.dom.setAttrib(layer, 'data-mce-style', '');
|
60 |
+
}
|
61 |
+
});
|
62 |
+
|
63 |
+
// Fixes edit focus issues with layers on Gecko
|
64 |
+
// This will enable designMode while inside a layer and disable it when outside
|
65 |
+
ed.onMouseDown.add(function(ed, e) {
|
66 |
+
var node = e.target, doc = ed.getDoc(), parent;
|
67 |
+
|
68 |
+
if (tinymce.isGecko) {
|
69 |
+
if (findParentLayer(node)) {
|
70 |
+
if (doc.designMode !== 'on') {
|
71 |
+
doc.designMode = 'on';
|
72 |
+
|
73 |
+
// Repaint caret
|
74 |
+
node = doc.body;
|
75 |
+
parent = node.parentNode;
|
76 |
+
parent.removeChild(node);
|
77 |
+
parent.appendChild(node);
|
78 |
+
}
|
79 |
+
} else if (doc.designMode == 'on') {
|
80 |
+
doc.designMode = 'off';
|
81 |
+
}
|
82 |
+
}
|
83 |
+
});
|
84 |
+
|
85 |
+
ed.onNodeChange.add(t._nodeChange, t);
|
86 |
+
ed.onVisualAid.add(t._visualAid, t);
|
87 |
+
},
|
88 |
+
|
89 |
+
getInfo : function() {
|
90 |
+
return {
|
91 |
+
longname : 'Layer',
|
92 |
+
author : 'Moxiecode Systems AB',
|
93 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
94 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
95 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
96 |
+
};
|
97 |
+
},
|
98 |
+
|
99 |
+
// Private methods
|
100 |
+
|
101 |
+
_nodeChange : function(ed, cm, n) {
|
102 |
+
var le, p;
|
103 |
+
|
104 |
+
le = this._getParentLayer(n);
|
105 |
+
p = ed.dom.getParent(n, 'DIV,P,IMG');
|
106 |
+
|
107 |
+
if (!p) {
|
108 |
+
cm.setDisabled('absolute', 1);
|
109 |
+
cm.setDisabled('moveforward', 1);
|
110 |
+
cm.setDisabled('movebackward', 1);
|
111 |
+
} else {
|
112 |
+
cm.setDisabled('absolute', 0);
|
113 |
+
cm.setDisabled('moveforward', !le);
|
114 |
+
cm.setDisabled('movebackward', !le);
|
115 |
+
cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
|
116 |
+
}
|
117 |
+
},
|
118 |
+
|
119 |
+
// Private methods
|
120 |
+
|
121 |
+
_visualAid : function(ed, e, s) {
|
122 |
+
var dom = ed.dom;
|
123 |
+
|
124 |
+
tinymce.each(dom.select('div,p', e), function(e) {
|
125 |
+
if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
|
126 |
+
if (s)
|
127 |
+
dom.addClass(e, 'mceItemVisualAid');
|
128 |
+
else
|
129 |
+
dom.removeClass(e, 'mceItemVisualAid');
|
130 |
+
|
131 |
+
dom.addClass(e, 'mceItemLayer');
|
132 |
+
}
|
133 |
+
});
|
134 |
+
},
|
135 |
+
|
136 |
+
_move : function(d) {
|
137 |
+
var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
|
138 |
+
|
139 |
+
nl = [];
|
140 |
+
tinymce.walk(ed.getBody(), function(n) {
|
141 |
+
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
|
142 |
+
nl.push(n);
|
143 |
+
}, 'childNodes');
|
144 |
+
|
145 |
+
// Find z-indexes
|
146 |
+
for (i=0; i<nl.length; i++) {
|
147 |
+
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
148 |
+
|
149 |
+
if (ci < 0 && nl[i] == le)
|
150 |
+
ci = i;
|
151 |
+
}
|
152 |
+
|
153 |
+
if (d < 0) {
|
154 |
+
// Move back
|
155 |
+
|
156 |
+
// Try find a lower one
|
157 |
+
for (i=0; i<z.length; i++) {
|
158 |
+
if (z[i] < z[ci]) {
|
159 |
+
fi = i;
|
160 |
+
break;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
if (fi > -1) {
|
165 |
+
nl[ci].style.zIndex = z[fi];
|
166 |
+
nl[fi].style.zIndex = z[ci];
|
167 |
+
} else {
|
168 |
+
if (z[ci] > 0)
|
169 |
+
nl[ci].style.zIndex = z[ci] - 1;
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
// Move forward
|
173 |
+
|
174 |
+
// Try find a higher one
|
175 |
+
for (i=0; i<z.length; i++) {
|
176 |
+
if (z[i] > z[ci]) {
|
177 |
+
fi = i;
|
178 |
+
break;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
if (fi > -1) {
|
183 |
+
nl[ci].style.zIndex = z[fi];
|
184 |
+
nl[fi].style.zIndex = z[ci];
|
185 |
+
} else
|
186 |
+
nl[ci].style.zIndex = z[ci] + 1;
|
187 |
+
}
|
188 |
+
|
189 |
+
ed.execCommand('mceRepaint');
|
190 |
+
},
|
191 |
+
|
192 |
+
_getParentLayer : function(n) {
|
193 |
+
return this.editor.dom.getParent(n, function(n) {
|
194 |
+
return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
|
195 |
+
});
|
196 |
+
},
|
197 |
+
|
198 |
+
_insertLayer : function() {
|
199 |
+
var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();
|
200 |
+
|
201 |
+
ed.dom.add(body, 'div', {
|
202 |
+
style : {
|
203 |
+
position : 'absolute',
|
204 |
+
left : p.x,
|
205 |
+
top : (p.y > 20 ? p.y : 20),
|
206 |
+
width : 100,
|
207 |
+
height : 100
|
208 |
+
},
|
209 |
+
'class' : 'mceItemVisualAid mceItemLayer'
|
210 |
+
}, ed.selection.getContent() || ed.getLang('layer.content'));
|
211 |
+
|
212 |
+
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
|
213 |
+
if (tinymce.isIE)
|
214 |
+
dom.setHTML(body, body.innerHTML);
|
215 |
+
},
|
216 |
+
|
217 |
+
_toggleAbsolute : function() {
|
218 |
+
var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
|
219 |
+
|
220 |
+
if (!le)
|
221 |
+
le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
|
222 |
+
|
223 |
+
if (le) {
|
224 |
+
if (le.style.position.toLowerCase() == "absolute") {
|
225 |
+
ed.dom.setStyles(le, {
|
226 |
+
position : '',
|
227 |
+
left : '',
|
228 |
+
top : '',
|
229 |
+
width : '',
|
230 |
+
height : ''
|
231 |
+
});
|
232 |
+
|
233 |
+
ed.dom.removeClass(le, 'mceItemVisualAid');
|
234 |
+
ed.dom.removeClass(le, 'mceItemLayer');
|
235 |
+
} else {
|
236 |
+
if (le.style.left == "")
|
237 |
+
le.style.left = 20 + 'px';
|
238 |
+
|
239 |
+
if (le.style.top == "")
|
240 |
+
le.style.top = 20 + 'px';
|
241 |
+
|
242 |
+
if (le.style.width == "")
|
243 |
+
le.style.width = le.width ? (le.width + 'px') : '100px';
|
244 |
+
|
245 |
+
if (le.style.height == "")
|
246 |
+
le.style.height = le.height ? (le.height + 'px') : '100px';
|
247 |
+
|
248 |
+
le.style.position = "absolute";
|
249 |
+
|
250 |
+
ed.dom.setAttrib(le, 'data-mce-style', '');
|
251 |
+
ed.addVisual(ed.getBody());
|
252 |
+
}
|
253 |
+
|
254 |
+
ed.execCommand('mceRepaint');
|
255 |
+
ed.nodeChanged();
|
256 |
+
}
|
257 |
+
}
|
258 |
+
});
|
259 |
+
|
260 |
+
// Register plugin
|
261 |
+
tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
|
262 |
+
})();
|
addons/linebreak/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186904338249858" remote="130186867800000000" Dst="2" />
|
4 |
+
<file name="linebreak.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/linebreak/editor_plugin.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* LineBreak Button plug-in for TinyMCE version 3.x
|
3 |
+
* @author Josh Lobe
|
4 |
+
* @version 1.0
|
5 |
+
* @package LineBreak Button
|
6 |
+
* @link http://www.joshlobe.com/
|
7 |
+
* LineBreak Button plugin for TinyMCE
|
8 |
+
*/
|
9 |
+
(function(){
|
10 |
+
|
11 |
+
tinymce.PluginManager.requireLangPack('linebreak');
|
12 |
+
|
13 |
+
tinymce.create('tinymce.plugins.linebreak', {
|
14 |
+
|
15 |
+
init : function(ed, url){
|
16 |
+
ed.addCommand('jwlLineBreakButton', function(){
|
17 |
+
|
18 |
+
linebreak_sel_content = tinyMCE.activeEditor.selection.getContent();
|
19 |
+
tinyMCE.activeEditor.selection.setContent('<br class="none" />');
|
20 |
+
});
|
21 |
+
ed.addButton('linebreak', {
|
22 |
+
title: ed.getLang('linebreak.title'),
|
23 |
+
//image: url + '/linebreak.png',
|
24 |
+
cmd: 'jwlLineBreakButton'
|
25 |
+
});
|
26 |
+
//ed.addShortcut('alt+ctrl+l', ed.getLang('linebreak.php'), 'jwlLineBreakButton');
|
27 |
+
},
|
28 |
+
createControl : function(n, cm){
|
29 |
+
return null;
|
30 |
+
},
|
31 |
+
getInfo : function(){
|
32 |
+
return {
|
33 |
+
longname: 'Tinymce LineBreak Button',
|
34 |
+
author: 'Josh Lobe',
|
35 |
+
authorurl: 'http://joshlobe.com/',
|
36 |
+
infourl: 'http://joshlobe.com/',
|
37 |
+
version: "1.0"
|
38 |
+
};
|
39 |
+
}
|
40 |
+
});
|
41 |
+
tinymce.PluginManager.add('linebreak', tinymce.plugins.linebreak);
|
42 |
+
})();
|
43 |
+
|
44 |
+
|
45 |
+
|
addons/linebreak/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111127400000000" remote="130111127400000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/linebreak/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n("en.linebreak",{
|
2 |
+
title : "Insert a linebreak"
|
3 |
+
});
|
addons/linebreak/linebreak.png
ADDED
Binary file
|
addons/loremipsum/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186912198969221" remote="130186876200000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186912017418757" remote="130186875600000000" Dst="2" />
|
5 |
+
<file name="loremipsum.html" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/loremipsum/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){/*tinymce.PluginManager.requireLangPack('loremipsum');*/tinymce.create('tinymce.plugins.LoremIpsum',{init:function(ed,url){ed.addCommand('mceLoremIpsum',function(){ed.windowManager.open({file:url+'/loremipsum.html',width:320+ed.getLang('loremipsum.delta_width',0),height:140+ed.getLang('loremipsum.delta_height',0),inline:1},{plugin_url:url})});ed.addButton('loremipsum',{title:ed.getLang('loremipsum.desc'),cmd:'mceLoremIpsum'/*,image:url+'/img/loremipsum.gif'*/})},createControl:function(n,cm){return null},getInfo:function(){return{longname:'Lorem Ipsum plugin',author:'Jakub Scholz (based on similar plugin from Guszt�v P�lv�lgyi)',authorurl:'http://www.assembla.com/spaces/lorem-ipsum',infourl:'http://www.assembla.com/spaces/lorem-ipsum',version:"0.1.2"}}});tinymce.PluginManager.add('loremipsum',tinymce.plugins.LoremIpsum)})();
|
addons/loremipsum/editor_plugin_src.js
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: editor_plugin_src.js 10 2009-04-30 23:20:50Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 10 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
(function() {
|
13 |
+
// Load plugin specific language pack
|
14 |
+
//tinymce.PluginManager.requireLangPack('loremipsum');
|
15 |
+
|
16 |
+
tinymce.create('tinymce.plugins.LoremIpsum', {
|
17 |
+
/**
|
18 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
19 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
20 |
+
* of the editor instance to intercept that event.
|
21 |
+
*
|
22 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
23 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
24 |
+
*/
|
25 |
+
init : function(ed, url) {
|
26 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
27 |
+
ed.addCommand('mceLoremIpsum', function() {
|
28 |
+
ed.windowManager.open({
|
29 |
+
file : url + '/loremipsum.html',
|
30 |
+
width : 320 + ed.getLang('loremipsum.delta_width', 0),
|
31 |
+
height : 140 + ed.getLang('loremipsum.delta_height', 0),
|
32 |
+
inline : 1
|
33 |
+
}, {
|
34 |
+
plugin_url : url // Plugin absolute URL
|
35 |
+
});
|
36 |
+
});
|
37 |
+
|
38 |
+
// Register LoremIpsum button
|
39 |
+
ed.addButton('loremipsum', {
|
40 |
+
title : ed.getLang('loremipsum.desc'),
|
41 |
+
cmd : 'mceLoremIpsum',
|
42 |
+
//image : url + '/img/loremipsum.gif'
|
43 |
+
});
|
44 |
+
|
45 |
+
},
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Creates control instances based in the incomming name. This method is normally not
|
49 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
50 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
51 |
+
* method can be used to create those.
|
52 |
+
*
|
53 |
+
* @param {String} n Name of the control to create.
|
54 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
55 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
56 |
+
*/
|
57 |
+
createControl : function(n, cm) {
|
58 |
+
return null;
|
59 |
+
},
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Returns information about the plugin as a name/value array.
|
63 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
64 |
+
*
|
65 |
+
* @return {Object} Name/value array containing information about the plugin.
|
66 |
+
*/
|
67 |
+
getInfo : function() {
|
68 |
+
return {
|
69 |
+
longname : 'Lorem Ipsum plugin',
|
70 |
+
author : 'Jakub Scholz (based on similar plugin from Guszt�v P�lv�lgyi)',
|
71 |
+
authorurl : 'http://www.assembla.com/spaces/lorem-ipsum',
|
72 |
+
infourl : 'http://www.assembla.com/spaces/lorem-ipsum',
|
73 |
+
version : "0.1.2"
|
74 |
+
};
|
75 |
+
}
|
76 |
+
});
|
77 |
+
|
78 |
+
// Register plugin
|
79 |
+
tinymce.PluginManager.add('loremipsum', tinymce.plugins.LoremIpsum);
|
80 |
+
})();
|
addons/loremipsum/img/Thumbs.db
ADDED
Binary file
|
addons/loremipsum/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="loremipsum.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="loremipsum.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="loremipsum_de.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/loremipsum/img/loremipsum.gif
ADDED
Binary file
|
addons/loremipsum/img/loremipsum.png
ADDED
Binary file
|
addons/loremipsum/img/loremipsum_de.gif
ADDED
Binary file
|
addons/loremipsum/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="loremipsum.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="loremipsum_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/loremipsum/js/loremipsum.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var arrLoremIpsumTexts=new Array();var arrLoremIpsumLangs=new Array();arrLoremIpsumTexts.push('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.|Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');arrLoremIpsumLangs.push('Latin');arrLoremIpsumTexts.push('Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.|Nam quibusdam, et iis quidem non admodum indoctis, totum hoc displicet philosophari.|Quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur.|Erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant in Graecis legendis operam malle consumere.|Postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.|Contra quos omnis dicendum breviter existimo.|Quamquam philosophiae quidem vituperatoribus satis responsum est eo libro, quo a nobis philosophia defensa et collaudata est, cum esset accusata et vituperata ab Hortensio.|Qui liber cum et tibi probatus videretur et iis, quos ego posse iudicare arbitrarer, plura suscepi veritus ne movere hominum studia viderer, retinere non posse.|Qui autem, si maxime hoc placeat, moderatius tamen id volunt fieri, difficilem quandam temperantiam postulant in eo, quod semel admissum coerceri reprimique non potest, ut propemodum iustioribus utamur illis, qui omnino avocent a philosophia, quam his, qui rebus infinitis modum constituant in reque eo meliore, quo maior sit, \mediocritatem desiderent.|Sive enim ad sapientiam perveniri potest, non paranda nobis solum ea, sed fruenda etiam [sapientia] est; sive hoc difficile est, tamen nec modus est ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum id, quod quaeritur, sit pulcherrimum.|Etenim si delectamur, cum scribimus, quis est tam invidus, qui ab eo nos abducat? sin laboramus, quis est, qui alienae modum statuat industriae?|Nam ut Terentianus Chremes non inhumanus, qui novum vicinum non vult \'fodere aut arare aut aliquid ferre denique\' -- non enim illum ab industria, sed ab inliberali labore deterret --, sic isti curiosi, quos offendit noster minime nobis iniucundus labor.|Iis igitur est difficilius satis facere, qui se Latina scripta dicunt contemnere.|In quibus hoc primum est in quo admirer, cur in gravissimis rebus non delectet eos sermo patrius, cum idem fabellas Latinas ad verbum e Graecis expressas non inviti legant.|Quis enim tam inimicus paene nomini Romano est, qui Ennii Medeam aut Antiopam Pacuvii spernat aut reiciat, quod se isdem Euripidis fabulis delectari dicat, Latinas litteras oderit?|Synephebos ego, inquit, potius Caecilii aut Andriam Terentii quam utramque Menandri legam?|A quibus tantum dissentio, ut, cum Sophocles vel optime scripserit Electram, tamen male conversam Atilii mihi legendam putem, de quo Lucilius: \'ferreum scriptorem\', verum, opinor, scriptorem tamen, ut legendus sit.|Rudem enim esse omnino in nostris poetis aut inertissimae segnitiae est aut fastidii delicatissimi.|Mihi quidem nulli satis eruditi videntur, quibus nostra ignota sunt. an \'Utinam ne in nemore ...\' nihilo minus legimus quam hoc idem Graecum, quae autem de bene beateque vivendo a Platone disputata sunt, haec explicari non placebit Latine?|Quid?|Si nos non interpretum fungimur munere, sed tuemur ea, quae dicta sunt ab iis quos probamus, eisque nostrum iudicium et nostrum scribendi ordinem adiungimus, quid habent, cur Graeca anteponant iis, quae et splendide dicta sint neque sint conversa de Graecis?|Nam si dicent ab illis has res esse tractatas, ne ipsos quidem Graecos est cur tam multos legant, quam legendi sunt.|Quid enim est a Chrysippo praetermissum in Stoicis?|Legimus tamen Diogenem, Antipatrum, Mnesarchum, Panaetium, multos alios in primisque familiarem nostrum Posidonium. quid?|Theophrastus mediocriterne delectat, cum tractat locos ab Aristotele ante tractatos?|Quid?|Epicurei num desistunt de isdem, de quibus et ab Epicuro scriptum est et ab antiquis, ad arbitrium suum scribere?|Quodsi Graeci leguntur a Graecis isdem de rebus alia ratione compositis, quid est, cur nostri a nostris non legantur?');arrLoremIpsumLangs.push('Latin');arrLoremIpsumTexts.push('Gladia was in space again and once again Aurora could be made out as a globe.|D.G. was busy elsewhere and the entire ship had about it a vague but pervasive air of emergency, as though it were on a battle footing, as though it were being pursued or expected pursuit.|Gladia shook her head. She could think clearly; she felt well; but when her mind turned back to that time in the Institute, shortly after Amadiro had left her, a curiously pervasive unreality swept over her.|There was a gap in time.|One moment she had been sitting on the couch, feeling sleepy; the next there were four robots and a woman in the room who had not been there before.|She had fallen asleep, then, but there was no awareness, no memory, that she had done so.|There was a gap of nonexistence.|Thinking back, she had recognized the woman after the fact.|It was Vasilia Aliena--the daughter whom Gladia had replaced in the affections of Han Fastolfe. Gladia had never actually seen Vasilia, though she had viewed her on hyperwave several times.|Gladia always thought of her as a distant and inimical other self.|There was the vague similarity in appearance that others always commented on but that Gladia herself insisted she did not see--and there was the odd, antithetical connection with Fastolfe.');arrLoremIpsumLangs.push('English');arrLoremIpsumTexts.push('Három hónap múlva a Szítának átkeresztelt ûrszondát felbocsátották a Mars belsõ holdjáról, a Phoebusról.|A repülési idõ két hét; a mûszer teljes bekapcsolása csak a befogás elõtti öt percben kezdõdik.|A felvevõgépeket úgy állították be, hogy a tárgy minden oldalról lefényképezhetõ legyen.|Az elsõ képek, melyek tízezer km távolságról érkeztek, leállítottak minden emberi tevékenységet.|Ezer millió tévéképernyõn jelent meg egy parányi, jellegtelen henger, s növekedett másodpercrõl másodpercre.|Mire méretei megkétszerezõdtek, már senki sem gondolhatta, hogy a Ráma természeti tárgy.|Mértanilag olyan szabályos hengeralakot mutatott, hogy akár esztergapadon is készíthették volna: akkorán, melynek csúcsai egymástól ötven km távolságra vannak.|Eltekintve az egyik oldalon látható néhány apró kis szerkezettõl, két vége teljesen sík, húsz kilométer széles volt.|A távolból szinte nevetségesen hasonlított egy közönséges bojlerre.|A Ráma csak nõtt, nõtt, míg végül betöltötte a képernyõt.|Felszíne egyhangú szürkésbarna volt, színtelen, mint a Hold, s egy pontot kivéve tökéletesen sima.|A henger közepe táján azonban kilométernyi széles folt éktelenkedett, mintha egy hajdanában történt ütközéskor behorpadt volna.|Semmi jel nem mutatott arra, hogy ez a folt a legcsekélyebb veszélyt is jelentett volna a Rámára nézve; viszont ez okozta a fénygörbe aprócska változását, mely Stenton felfedezéséhez vezetett.|A többi kamera képei semmi újat nem mutattak.|Ámbár az a görbe, melyet a Ráma kicsiny gravitációs mezõjén a kamerák kijelöltek, életbevágóan fontos információt szolgáltatott - a henger tömegérõl.|Túlságosan könnyûnek bizonyult ahhoz, hogy tömör test lehessen.|Senki sem volt túlságosan meglepve, amikor kiderült, hogy a Ráma nem tömör henger.|Elérkezett végre a régen várt, régen rettegett találkozás.|Az emberiség elsõ, csillagokból érkezõ látogatóját fogadja.');arrLoremIpsumLangs.push('Hungarian');arrLoremIpsumTexts.push('Mútéra norybyd ké týbo, chyčná cakšichytú bádnyřa, muzózy.|Chy dočnéhy no babvikýje nizu.|Vohúzo čitýfanú bál dita, da žarabyp bimú solúmebe hu nebakti feni lisizu livýtí šobachá butike pasif kángokoras.|Nafobim, bóhfage, katélé, jató lí boutídisú nýlíbýb dounudou ne nácahy búkarfevý nýšobónfa.|Bytzusy.|Po sibossicsom šícvo peboťlély doudulo zysi rosypsy pokadmy cafšob sapnešé mípo navupe.|Bíju dědý sozchabe pébepamá fu butkyjí myru zóruz sevú febomsed larazko joky pobymcaj jíle bon fasobry sukpa.|Bekcochy pábem, vo ratreny, rófati ráčnatíhobi nebýsvo bisev zuras cafe plútúha barugavé lí.|Řaleplá, kýku výlesa gotici honoči déhoro bylplufe bastý rulsíf hupený čeroj chyló, tydy roclí.|Núrod nyfu boh farú mupa naló.|Lechoro lé nizuraz núpluny, ňoko bi ga.|Nerab, kyčný zufevý rúza.Nokýte ký.|Bounónú techety pobiru dépypa randi chanajáhe.|Diku kascho dy bešup nycajkau reka byn jí mymýňo míláfa kedo makeča, téjuhe čelýhufo po ból muku výněfocho hárevo sý býsšá, sipbýdje runno ca my bubek.|Berbúj, fozébyndio zuřupbý šovfuju mú kusášez nichabu tytýny huben pyca chora dú duhy zédyďáza býhvisýv vozý mybytfo caltuti cou rúvýťa bimo rukjíno bóz zuke, súčpybylčitý gapebyb, sefsúfca kógehe.|Šamsy plí mejaro bysbylčelý mytý šajfákáj výpá divýva fápé chozu suk, lágaze zobalmonatí chu bonze ný mujévy satkésecho, hočitýbuf bime mavibito vý, vefole jajebelpa bimbehší pýřá rubek tusac rulféšéf čaunatý, dochú diota tasydula vybazde, žá ďarufboň sublécevé rúv zyrahopú chyga sé pýráz leváčitíkat cabú néchá kýtuche bejemý bújó siltehuchá.|Vétómo výnave fo.|Bazhožímý mídezy.|Jašíjmy.|Nědychúma lé sókjéžu ruskúcha cháli miroja lovonaté čelýjéda chečitélý mýpaze suzzu hu bobkapluty chybi lé bekkánu plýbo, kuzavi kubi.Bicchabu mini heví nápe dahúbý běco chude šabek vátó bés suk saber selícak, pažese jasil rúmabyf, músybyl, syhocéhy capkarkál leku šésyvta pojaka nira látý doufávy bó hálobýl.|Balnébopa vívostí rujche chepolo doušekhe fúfechugá lymá níbeč sómvoceo lachy.|Nunito tumu rodbaďtý járusber.|Vítýnatý zabo pozo háhá caknóce chekúnú lavolo netásimy kostýlú čitésiku luca katchechá řisýby robrap kacnétofú býzi fómy nušuzu nýřera cassún vusip zákavá reciti rovrojmo jocobút dačnýkapruz ras dumá ryté béblú rana, lúbystý čnýhe veresýn po, ju lilusuk.|Mareraruf řábka ťaze rokga fatoně natýťalerá nenybil kómyfé dúnúvošej visitvetu véchumy ru nudohu, bebtěto rupe fefeňoza losaď hyzeti peťabodze me rú johy jo my, léméja ply sérhý lyšát, chúduve nacití, rabek, tísebob běrzupy buť rúfunatí balliha, bečnýkosu chuhyřaska cajébok dý páne šensud dývata li, betda zevýleky mebadú puple sazchuroc che, bivúdapý zirunivú bočlazu.|Kuhebic sutlirož fečnýzivy šímtýťa.|Lubuhpla jivý dofuzu, šutzelý kašága kége rolhyle bobrohrovchy vu.|Natéjénú hečájbú dykykau, róky razpa mugabidchu sobnyle céfebekche so batebylche stýčná rabýl rokší myberroj hábílká nýdujé si buky tólá.|Búsajóvi tapa, mamoche doťaléza becerú nymavýpla beknoza dyšob bamčak pu sesovhe, molizý, zepata, sa čelácila.|Stýšeny lébunpo divo chute mórob, nečájsica safmí čnýrub, natý dosé čitýchysy hy bě movýho chevyvý sihýbal.');arrLoremIpsumLangs.push('Česky');arrLoremIpsumTexts.push('Ich bin Blindtext.|Von Geburt an.|Es hat lange gedauert, bis ich begriffen habe, was es bedeutet, ein blinder Text zu sein: Man macht keinen Sinn.|Man wirkt hier und da aus dem Zusammenhang gerissen.|Oft wird man gar nicht erst gelesen.|Aber bin ich deshalb ein schlechter Text?|Ich weiss, dass ich nie die Chance haben werde, im Stern zu erscheinen.|Aber bin ich darum weniger wichtig?|Ich bin blind!|Aber ich bin gerne Text.|Und sollten Sie mich jetzt tatsächlich zu Ende lesen, dann habe ich etwas geschafft, was den meisten "normalen" Texten nicht gelingt.');arrLoremIpsumLangs.push('Deutsch');var arrSentences=new Array();function loremIpsumGimmeSentences(howmany,selText){var ret='';var arrTmp=new Array();for(var i=0;i<howmany;i++){arrTmp.push(arrSentences[selText][0]);arrSentences[selText].push(arrSentences[selText].shift())}ret=arrTmp.join(' ');return ret}var LoremIpsumDialog={init:function(){var f=document.forms[0];var sentences=document.getElementById("sentences");for(var i=0;i<arrLoremIpsumTexts.length;i++){arrSentences.push(arrLoremIpsumTexts[i].split('|'))}for(var i=0;i<arrSentences.length;i++){var tmp=new Array();tmp=(arrSentences[i][0]).split(' ');tmp=tmp.slice(0,3);var tmpText=tmp.join(' ');sentences.options[i]=new Option(arrLoremIpsumLangs[i]+': '+tmpText,i)}},insert:function(){var insertedText='';var sentences=document.getElementById("sentences");var amount=document.getElementById("amount");var formating=document.getElementById("formating");switch(formating.value){case'0':insertedText=loremIpsumGimmeSentences(amount.value,sentences.value);break;case'1':for(var counter=0;counter<amount.value;counter++){countElem=Math.round((Math.random()*5)+3);insertedText+='<p>'+loremIpsumGimmeSentences(countElem,sentences.value)+'</p>'}break;case'2':insertedText+='<ul>';for(var counter=0;counter<amount.value;counter++){countElem=Math.round(Math.random()+1);insertedText+='<li>'+loremIpsumGimmeSentences(countElem,sentences.value)+'</li>'}insertedText+='</ul>';break;case'3':insertedText+='<ol>';for(var counter=0;counter<amount.value;counter++){countElem=Math.round(Math.random()+1);insertedText+='<li>'+loremIpsumGimmeSentences(countElem,sentences.value)+'</li>'}insertedText+='</ol>';break}tinyMCEPopup.editor.execCommand('mceInsertContent',false,insertedText);tinyMCEPopup.close()}};tinyMCEPopup.requireLangPack();tinyMCEPopup.onInit.add(LoremIpsumDialog.init,LoremIpsumDialog);
|
addons/loremipsum/js/loremipsum_src.js
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: loremipsum_src.js 10 2009-04-30 23:20:50Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 10 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
var arrLoremIpsumTexts=new Array();
|
13 |
+
var arrLoremIpsumLangs=new Array();
|
14 |
+
|
15 |
+
arrLoremIpsumTexts.push('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.|Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
|
16 |
+
arrLoremIpsumLangs.push('Latin');
|
17 |
+
|
18 |
+
arrLoremIpsumTexts.push('Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.|Nam quibusdam, et iis quidem non admodum indoctis, totum hoc displicet philosophari.|Quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur.|Erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant in Graecis legendis operam malle consumere.|Postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.|Contra quos omnis dicendum breviter existimo.|Quamquam philosophiae quidem vituperatoribus satis responsum est eo libro, quo a nobis philosophia defensa et collaudata est, cum esset accusata et vituperata ab Hortensio.|Qui liber cum et tibi probatus videretur et iis, quos ego posse iudicare arbitrarer, plura suscepi veritus ne movere hominum studia viderer, retinere non posse.|Qui autem, si maxime hoc placeat, moderatius tamen id volunt fieri, difficilem quandam temperantiam postulant in eo, quod semel admissum coerceri reprimique non potest, ut propemodum iustioribus utamur illis, qui omnino avocent a philosophia, quam his, qui rebus infinitis modum constituant in reque eo meliore, quo maior sit, \mediocritatem desiderent.|Sive enim ad sapientiam perveniri potest, non paranda nobis solum ea, sed fruenda etiam [sapientia] est; sive hoc difficile est, tamen nec modus est ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum id, quod quaeritur, sit pulcherrimum.|Etenim si delectamur, cum scribimus, quis est tam invidus, qui ab eo nos abducat? sin laboramus, quis est, qui alienae modum statuat industriae?|Nam ut Terentianus Chremes non inhumanus, qui novum vicinum non vult \'fodere aut arare aut aliquid ferre denique\' -- non enim illum ab industria, sed ab inliberali labore deterret --, sic isti curiosi, quos offendit noster minime nobis iniucundus labor.|Iis igitur est difficilius satis facere, qui se Latina scripta dicunt contemnere.|In quibus hoc primum est in quo admirer, cur in gravissimis rebus non delectet eos sermo patrius, cum idem fabellas Latinas ad verbum e Graecis expressas non inviti legant.|Quis enim tam inimicus paene nomini Romano est, qui Ennii Medeam aut Antiopam Pacuvii spernat aut reiciat, quod se isdem Euripidis fabulis delectari dicat, Latinas litteras oderit?|Synephebos ego, inquit, potius Caecilii aut Andriam Terentii quam utramque Menandri legam?|A quibus tantum dissentio, ut, cum Sophocles vel optime scripserit Electram, tamen male conversam Atilii mihi legendam putem, de quo Lucilius: \'ferreum scriptorem\', verum, opinor, scriptorem tamen, ut legendus sit.|Rudem enim esse omnino in nostris poetis aut inertissimae segnitiae est aut fastidii delicatissimi.|Mihi quidem nulli satis eruditi videntur, quibus nostra ignota sunt. an \'Utinam ne in nemore ...\' nihilo minus legimus quam hoc idem Graecum, quae autem de bene beateque vivendo a Platone disputata sunt, haec explicari non placebit Latine?|Quid?|Si nos non interpretum fungimur munere, sed tuemur ea, quae dicta sunt ab iis quos probamus, eisque nostrum iudicium et nostrum scribendi ordinem adiungimus, quid habent, cur Graeca anteponant iis, quae et splendide dicta sint neque sint conversa de Graecis?|Nam si dicent ab illis has res esse tractatas, ne ipsos quidem Graecos est cur tam multos legant, quam legendi sunt.|Quid enim est a Chrysippo praetermissum in Stoicis?|Legimus tamen Diogenem, Antipatrum, Mnesarchum, Panaetium, multos alios in primisque familiarem nostrum Posidonium. quid?|Theophrastus mediocriterne delectat, cum tractat locos ab Aristotele ante tractatos?|Quid?|Epicurei num desistunt de isdem, de quibus et ab Epicuro scriptum est et ab antiquis, ad arbitrium suum scribere?|Quodsi Graeci leguntur a Graecis isdem de rebus alia ratione compositis, quid est, cur nostri a nostris non legantur?');
|
19 |
+
arrLoremIpsumLangs.push('Latin');
|
20 |
+
|
21 |
+
arrLoremIpsumTexts.push('Gladia was in space again and once again Aurora could be made out as a globe.|D.G. was busy elsewhere and the entire ship had about it a vague but pervasive air of emergency, as though it were on a battle footing, as though it were being pursued or expected pursuit.|Gladia shook her head. She could think clearly; she felt well; but when her mind turned back to that time in the Institute, shortly after Amadiro had left her, a curiously pervasive unreality swept over her.|There was a gap in time.|One moment she had been sitting on the couch, feeling sleepy; the next there were four robots and a woman in the room who had not been there before.|She had fallen asleep, then, but there was no awareness, no memory, that she had done so.|There was a gap of nonexistence.|Thinking back, she had recognized the woman after the fact.|It was Vasilia Aliena--the daughter whom Gladia had replaced in the affections of Han Fastolfe. Gladia had never actually seen Vasilia, though she had viewed her on hyperwave several times.|Gladia always thought of her as a distant and inimical other self.|There was the vague similarity in appearance that others always commented on but that Gladia herself insisted she did not see--and there was the odd, antithetical connection with Fastolfe.');
|
22 |
+
arrLoremIpsumLangs.push('English');
|
23 |
+
|
24 |
+
arrLoremIpsumTexts.push('Három hónap múlva a Szítának átkeresztelt ûrszondát felbocsátották a Mars belsõ holdjáról, a Phoebusról.|A repülési idõ két hét; a mûszer teljes bekapcsolása csak a befogás elõtti öt percben kezdõdik.|A felvevõgépeket úgy állították be, hogy a tárgy minden oldalról lefényképezhetõ legyen.|Az elsõ képek, melyek tízezer km távolságról érkeztek, leállítottak minden emberi tevékenységet.|Ezer millió tévéképernyõn jelent meg egy parányi, jellegtelen henger, s növekedett másodpercrõl másodpercre.|Mire méretei megkétszerezõdtek, már senki sem gondolhatta, hogy a Ráma természeti tárgy.|Mértanilag olyan szabályos hengeralakot mutatott, hogy akár esztergapadon is készíthették volna: akkorán, melynek csúcsai egymástól ötven km távolságra vannak.|Eltekintve az egyik oldalon látható néhány apró kis szerkezettõl, két vége teljesen sík, húsz kilométer széles volt.|A távolból szinte nevetségesen hasonlított egy közönséges bojlerre.|A Ráma csak nõtt, nõtt, míg végül betöltötte a képernyõt.|Felszíne egyhangú szürkésbarna volt, színtelen, mint a Hold, s egy pontot kivéve tökéletesen sima.|A henger közepe táján azonban kilométernyi széles folt éktelenkedett, mintha egy hajdanában történt ütközéskor behorpadt volna.|Semmi jel nem mutatott arra, hogy ez a folt a legcsekélyebb veszélyt is jelentett volna a Rámára nézve; viszont ez okozta a fénygörbe aprócska változását, mely Stenton felfedezéséhez vezetett.|A többi kamera képei semmi újat nem mutattak.|Ámbár az a görbe, melyet a Ráma kicsiny gravitációs mezõjén a kamerák kijelöltek, életbevágóan fontos információt szolgáltatott - a henger tömegérõl.|Túlságosan könnyûnek bizonyult ahhoz, hogy tömör test lehessen.|Senki sem volt túlságosan meglepve, amikor kiderült, hogy a Ráma nem tömör henger.|Elérkezett végre a régen várt, régen rettegett találkozás.|Az emberiség elsõ, csillagokból érkezõ látogatóját fogadja.');
|
25 |
+
arrLoremIpsumLangs.push('Hungarian');
|
26 |
+
|
27 |
+
arrLoremIpsumTexts.push('Mútéra norybyd ké týbo, chyčná cakšichytú bádnyřa, muzózy.|Chy dočnéhy no babvikýje nizu.|Vohúzo čitýfanú bál dita, da žarabyp bimú solúmebe hu nebakti feni lisizu livýtí šobachá butike pasif kángokoras.|Nafobim, bóhfage, katélé, jató lí boutídisú nýlíbýb dounudou ne nácahy búkarfevý nýšobónfa.|Bytzusy.|Po sibossicsom šícvo peboťlély doudulo zysi rosypsy pokadmy cafšob sapnešé mípo navupe.|Bíju dědý sozchabe pébepamá fu butkyjí myru zóruz sevú febomsed larazko joky pobymcaj jíle bon fasobry sukpa.|Bekcochy pábem, vo ratreny, rófati ráčnatíhobi nebýsvo bisev zuras cafe plútúha barugavé lí.|Řaleplá, kýku výlesa gotici honoči déhoro bylplufe bastý rulsíf hupený čeroj chyló, tydy roclí.|Núrod nyfu boh farú mupa naló.|Lechoro lé nizuraz núpluny, ňoko bi ga.|Nerab, kyčný zufevý rúza.Nokýte ký.|Bounónú techety pobiru dépypa randi chanajáhe.|Diku kascho dy bešup nycajkau reka byn jí mymýňo míláfa kedo makeča, téjuhe čelýhufo po ból muku výněfocho hárevo sý býsšá, sipbýdje runno ca my bubek.|Berbúj, fozébyndio zuřupbý šovfuju mú kusášez nichabu tytýny huben pyca chora dú duhy zédyďáza býhvisýv vozý mybytfo caltuti cou rúvýťa bimo rukjíno bóz zuke, súčpybylčitý gapebyb, sefsúfca kógehe.|Šamsy plí mejaro bysbylčelý mytý šajfákáj výpá divýva fápé chozu suk, lágaze zobalmonatí chu bonze ný mujévy satkésecho, hočitýbuf bime mavibito vý, vefole jajebelpa bimbehší pýřá rubek tusac rulféšéf čaunatý, dochú diota tasydula vybazde, žá ďarufboň sublécevé rúv zyrahopú chyga sé pýráz leváčitíkat cabú néchá kýtuche bejemý bújó siltehuchá.|Vétómo výnave fo.|Bazhožímý mídezy.|Jašíjmy.|Nědychúma lé sókjéžu ruskúcha cháli miroja lovonaté čelýjéda chečitélý mýpaze suzzu hu bobkapluty chybi lé bekkánu plýbo, kuzavi kubi.Bicchabu mini heví nápe dahúbý běco chude šabek vátó bés suk saber selícak, pažese jasil rúmabyf, músybyl, syhocéhy capkarkál leku šésyvta pojaka nira látý doufávy bó hálobýl.|Balnébopa vívostí rujche chepolo doušekhe fúfechugá lymá níbeč sómvoceo lachy.|Nunito tumu rodbaďtý járusber.|Vítýnatý zabo pozo háhá caknóce chekúnú lavolo netásimy kostýlú čitésiku luca katchechá řisýby robrap kacnétofú býzi fómy nušuzu nýřera cassún vusip zákavá reciti rovrojmo jocobút dačnýkapruz ras dumá ryté béblú rana, lúbystý čnýhe veresýn po, ju lilusuk.|Mareraruf řábka ťaze rokga fatoně natýťalerá nenybil kómyfé dúnúvošej visitvetu véchumy ru nudohu, bebtěto rupe fefeňoza losaď hyzeti peťabodze me rú johy jo my, léméja ply sérhý lyšát, chúduve nacití, rabek, tísebob běrzupy buť rúfunatí balliha, bečnýkosu chuhyřaska cajébok dý páne šensud dývata li, betda zevýleky mebadú puple sazchuroc che, bivúdapý zirunivú bočlazu.|Kuhebic sutlirož fečnýzivy šímtýťa.|Lubuhpla jivý dofuzu, šutzelý kašága kége rolhyle bobrohrovchy vu.|Natéjénú hečájbú dykykau, róky razpa mugabidchu sobnyle céfebekche so batebylche stýčná rabýl rokší myberroj hábílká nýdujé si buky tólá.|Búsajóvi tapa, mamoche doťaléza becerú nymavýpla beknoza dyšob bamčak pu sesovhe, molizý, zepata, sa čelácila.|Stýšeny lébunpo divo chute mórob, nečájsica safmí čnýrub, natý dosé čitýchysy hy bě movýho chevyvý sihýbal.');
|
28 |
+
arrLoremIpsumLangs.push('Česky');
|
29 |
+
|
30 |
+
arrLoremIpsumTexts.push('Ich bin Blindtext.|Von Geburt an.|Es hat lange gedauert, bis ich begriffen habe, was es bedeutet, ein blinder Text zu sein: Man macht keinen Sinn.|Man wirkt hier und da aus dem Zusammenhang gerissen.|Oft wird man gar nicht erst gelesen.|Aber bin ich deshalb ein schlechter Text?|Ich weiss, dass ich nie die Chance haben werde, im Stern zu erscheinen.|Aber bin ich darum weniger wichtig?|Ich bin blind!|Aber ich bin gerne Text.|Und sollten Sie mich jetzt tatsächlich zu Ende lesen, dann habe ich etwas geschafft, was den meisten "normalen" Texten nicht gelingt.');
|
31 |
+
arrLoremIpsumLangs.push('Deutsch');
|
32 |
+
|
33 |
+
var arrSentences = new Array();
|
34 |
+
|
35 |
+
function loremIpsumGimmeSentences(howmany, selText) {
|
36 |
+
var ret = '';
|
37 |
+
var arrTmp = new Array();
|
38 |
+
|
39 |
+
//var arrSentences = new Array();
|
40 |
+
//arrSentences.push(arrLoremIpsumTexts[selText].split('|'));
|
41 |
+
|
42 |
+
for (var i=0; i < howmany; i++) {
|
43 |
+
arrTmp.push(arrSentences[selText][0]);
|
44 |
+
arrSentences[selText].push(arrSentences[selText].shift());
|
45 |
+
//make first sentence array element last,
|
46 |
+
//in order to avoid paragraphs and list begin always with the same sentence
|
47 |
+
}
|
48 |
+
ret=arrTmp.join(' ');
|
49 |
+
return ret;
|
50 |
+
}
|
51 |
+
|
52 |
+
var LoremIpsumDialog = {
|
53 |
+
init : function() {
|
54 |
+
var f = document.forms[0];
|
55 |
+
|
56 |
+
var sentences = document.getElementById("sentences");
|
57 |
+
|
58 |
+
for (var i=0; i < arrLoremIpsumTexts.length; i++) {
|
59 |
+
arrSentences.push(arrLoremIpsumTexts[i].split('|'));
|
60 |
+
}//split text to sentences. Sentences limited by '|'
|
61 |
+
|
62 |
+
for (var i=0; i < arrSentences.length; i++) {
|
63 |
+
var tmp=new Array();
|
64 |
+
tmp=(arrSentences[i][0]).split(' ');
|
65 |
+
tmp=tmp.slice(0,3);
|
66 |
+
var tmpText=tmp.join(' ');
|
67 |
+
sentences.options[i]=new Option(arrLoremIpsumLangs[i] + ': ' + tmpText,i);
|
68 |
+
}
|
69 |
+
|
70 |
+
},
|
71 |
+
|
72 |
+
insert : function() {
|
73 |
+
// Insert the contents from the input into the document
|
74 |
+
var insertedText = '';
|
75 |
+
|
76 |
+
var sentences = document.getElementById("sentences");
|
77 |
+
var amount = document.getElementById("amount");
|
78 |
+
var formating = document.getElementById("formating");
|
79 |
+
|
80 |
+
//count=formObj.lorem_count.value;
|
81 |
+
//selectedText=formObj.lorem_select.value;
|
82 |
+
//window.alert("bbb");
|
83 |
+
switch (formating.value) {
|
84 |
+
case '0': //unformatted
|
85 |
+
|
86 |
+
insertedText = loremIpsumGimmeSentences(amount.value, sentences.value);
|
87 |
+
break;
|
88 |
+
case '1': //paragraphs
|
89 |
+
for (var counter = 0; counter < amount.value; counter++) {
|
90 |
+
countElem = Math.round((Math.random() * 5) + 3); //so many sentences in paragraph
|
91 |
+
insertedText += '<p>' + loremIpsumGimmeSentences(countElem, sentences.value) + '</p>';
|
92 |
+
}
|
93 |
+
break;
|
94 |
+
case '2': //list
|
95 |
+
insertedText += '<ul>';
|
96 |
+
for (var counter = 0; counter < amount.value; counter++) {
|
97 |
+
countElem = Math.round(Math.random() + 1); //so many sentences in listelement
|
98 |
+
insertedText += '<li>' + loremIpsumGimmeSentences(countElem, sentences.value) + '</li>';
|
99 |
+
}
|
100 |
+
insertedText+='</ul>';
|
101 |
+
break;
|
102 |
+
case '3': //orderedlist
|
103 |
+
insertedText += '<ol>';
|
104 |
+
for (var counter = 0; counter < amount.value; counter++) {
|
105 |
+
countElem = Math.round(Math.random() + 1); //so many sentences in listelement
|
106 |
+
insertedText += '<li>' + loremIpsumGimmeSentences(countElem, sentences.value) + '</li>';
|
107 |
+
}
|
108 |
+
insertedText += '</ol>';
|
109 |
+
break;
|
110 |
+
}
|
111 |
+
|
112 |
+
tinyMCEPopup.editor.execCommand('mceInsertContent', false, insertedText);
|
113 |
+
tinyMCEPopup.close();
|
114 |
+
}
|
115 |
+
};
|
116 |
+
|
117 |
+
tinyMCEPopup.requireLangPack();
|
118 |
+
tinyMCEPopup.onInit.add(LoremIpsumDialog.init, LoremIpsumDialog);
|
addons/loremipsum/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="ca.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="ca_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="cs.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="cs_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="de.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="de_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
10 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
11 |
+
<file name="es.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
12 |
+
<file name="es_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
13 |
+
</dwsync>
|
addons/loremipsum/langs/ca.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: ca.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author Jordi Llonch
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('ca.loremipsum',{
|
13 |
+
desc : 'Lorem Ipsum'
|
14 |
+
});
|
addons/loremipsum/langs/ca_dlg.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: ca_dlg.js 6 2008-11-02 08:56:05Z llonchj $
|
5 |
+
*
|
6 |
+
* @author Jordi Llonch
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('ca.loremipsum_dlg',{
|
13 |
+
sentences : "Font de text",
|
14 |
+
amount : "Generar",
|
15 |
+
formating : "Format",
|
16 |
+
unformated : "Frase sense format",
|
17 |
+
paragraphs : "Paràgraf <p>",
|
18 |
+
list : "Llista <ul>",
|
19 |
+
orderedlist : "Llista ordenada <ol>"
|
20 |
+
});
|
addons/loremipsum/langs/cs.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: cs.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('cs.loremipsum',{
|
13 |
+
desc : 'Lorem Ipsum'
|
14 |
+
});
|
addons/loremipsum/langs/cs_dlg.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: cs_dlg.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('cs.loremipsum_dlg',{
|
13 |
+
sentences : "Text",
|
14 |
+
amount : "Množství",
|
15 |
+
formating : "Formátování",
|
16 |
+
unformated : "Neformátované věty",
|
17 |
+
paragraphs : "Odstavce <p>",
|
18 |
+
list : "Seznam <ul>",
|
19 |
+
orderedlist : "Číslovaný seznam <ol>"
|
20 |
+
});
|
addons/loremipsum/langs/de.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: de_dlg.js 6 2009-04-27 13:35:00Z cgr $
|
5 |
+
*
|
6 |
+
* @author Cyrill Gross / Mayoris AG
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('de.loremipsum',{
|
13 |
+
desc : 'Lorem Ipsum'
|
14 |
+
});
|
addons/loremipsum/langs/de_dlg.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: de_dlg.js 6 2009-04-27 13:35:00Z cgr $
|
5 |
+
*
|
6 |
+
* @author Cyrill Gross / Mayoris AG
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('de.loremipsum_dlg',{
|
13 |
+
sentences : "Quelltext",
|
14 |
+
amount : "Anzahl Elemente",
|
15 |
+
formating : "Formatierung",
|
16 |
+
unformated : "Unformatiert",
|
17 |
+
paragraphs : "Absätze <p>",
|
18 |
+
list : "Liste <ul>",
|
19 |
+
orderedlist : "Sortierte Liste <ol>"
|
20 |
+
});
|
addons/loremipsum/langs/en.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: en.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('en.loremipsum',{
|
13 |
+
desc : 'Lorem Ipsum'
|
14 |
+
});
|
addons/loremipsum/langs/en_dlg.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: en_dlg.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author JAkub Scholz
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('en.loremipsum_dlg',{
|
13 |
+
sentences : "Source text",
|
14 |
+
amount : "Generated amount",
|
15 |
+
formating : "Formating",
|
16 |
+
unformated : "Unformated sentences",
|
17 |
+
paragraphs : "Paragraphs <p>",
|
18 |
+
list : "List <ul>",
|
19 |
+
orderedlist : "Ordered List <ol>"
|
20 |
+
});
|
addons/loremipsum/langs/es.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: es.js 6 2008-06-18 08:56:05Z scholzj $
|
5 |
+
*
|
6 |
+
* @author Jordi Llonch
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('es.loremipsum',{
|
13 |
+
desc : 'Lorem Ipsum'
|
14 |
+
});
|
addons/loremipsum/langs/es_dlg.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Lorem Ipsum plug-in for TinyMCE version 3.x
|
3 |
+
* -------------------------------------------
|
4 |
+
* $Id: es_dlg.js 6 2008-11-02 08:56:05Z llonchj $
|
5 |
+
*
|
6 |
+
* @author Jordi Llonch
|
7 |
+
* @version $Rev: 6 $
|
8 |
+
* @package LoremIpsum
|
9 |
+
* @link http://www.assembla.com/spaces/lorem-ipsum
|
10 |
+
*/
|
11 |
+
|
12 |
+
tinyMCE.addI18n('es.loremipsum_dlg',{
|
13 |
+
sentences : "Fuente del texto",
|
14 |
+
amount : "Generar",
|
15 |
+
formating : "Formateo",
|
16 |
+
unformated : "Frase sin formato",
|
17 |
+
paragraphs : "Párrafos <p>",
|
18 |
+
list : "Lista <ul>",
|
19 |
+
orderedlist : "Lista ordenada <ol>"
|
20 |
+
});
|
addons/loremipsum/loremipsum.html
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5 |
+
<title>{#loremipsum.desc}</title>
|
6 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
7 |
+
<script type="text/javascript" src="js/loremipsum.js"></script>
|
8 |
+
<base target="_self" />
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
|
12 |
+
<form onsubmit="LoremIpsumDialog.insert();return false;" action="#">
|
13 |
+
<div>
|
14 |
+
<div id="general_panel" class="panel current">
|
15 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
16 |
+
<tr>
|
17 |
+
<td><label for="text">{#loremipsum_dlg.sentences}:</label></td>
|
18 |
+
<td nowrap="nowrap">
|
19 |
+
<select name="sentences" id="sentences" style="width: 175px;">
|
20 |
+
</select>
|
21 |
+
</td>
|
22 |
+
</tr>
|
23 |
+
<tr>
|
24 |
+
<td><label for="amount">{#loremipsum_dlg.amount}:</label></td>
|
25 |
+
<td><input id="amount" name="amount" type="text" size="2" value="5" />
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<td><label for="formating">{#loremipsum_dlg.formating}:</label></td>
|
30 |
+
<td nowrap="nowrap">
|
31 |
+
<select name="formating" id="formating" style="width: 175px;">
|
32 |
+
<option value="0">{#loremipsum_dlg.unformated}</option>
|
33 |
+
<option value="1">{#loremipsum_dlg.paragraphs}</option>
|
34 |
+
<option value="2">{#loremipsum_dlg.list}</option>
|
35 |
+
<option value="3">{#loremipsum_dlg.orderedlist}</option>
|
36 |
+
</select>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
</table>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div class="mceActionPanel">
|
44 |
+
<div style="float: left">
|
45 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div style="float: right">
|
49 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
</form>
|
53 |
+
</body>
|
54 |
+
</html>
|
addons/mailto/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186890509323907" remote="130186854000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186890587721351" remote="130186854000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/mailto/editor_plugin.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
// Load plugin specific language pack
|
3 |
+
//tinymce.PluginManager.requireLangPack('mailto');
|
4 |
+
|
5 |
+
tinymce.create('tinymce.plugins.MailTo', {
|
6 |
+
/**
|
7 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
8 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
9 |
+
* of the editor instance to intercept that event.
|
10 |
+
*
|
11 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
12 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
13 |
+
*/
|
14 |
+
init : function(ed, url) {
|
15 |
+
|
16 |
+
ed.addButton('mailto', {
|
17 |
+
title : ed.getLang('mailto.mailto_desc'),
|
18 |
+
cmd : 'mceMailTo',
|
19 |
+
//image : url + '/images/mailto.gif'
|
20 |
+
});
|
21 |
+
|
22 |
+
ed.addCommand('mceMailTo', function() {
|
23 |
+
var selectedText = ed.selection.getContent({format : 'text'});
|
24 |
+
var MailToLink = "<a href='mailto:" + selectedText + "'>" + selectedText + "</a>"
|
25 |
+
ed.execCommand('mceInsertContent', false, MailToLink);
|
26 |
+
});
|
27 |
+
|
28 |
+
},
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns information about the plugin as a name/value array.
|
32 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
33 |
+
*
|
34 |
+
* @return {Object} Name/value array containing information about the plugin.
|
35 |
+
*/
|
36 |
+
getInfo : function() {
|
37 |
+
return {
|
38 |
+
longname : 'MailTo',
|
39 |
+
author : 'Josh Lobe',
|
40 |
+
authorurl : 'http://joshlobe.com',
|
41 |
+
version : "1.0"
|
42 |
+
};
|
43 |
+
}
|
44 |
+
});
|
45 |
+
|
46 |
+
// Register plugin
|
47 |
+
tinymce.PluginManager.add('mailto', tinymce.plugins.MailTo);
|
48 |
+
})();
|
addons/mailto/editor_plugin_src.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
// Load plugin specific language pack
|
3 |
+
//tinymce.PluginManager.requireLangPack('mailto');
|
4 |
+
|
5 |
+
tinymce.create('tinymce.plugins.MailTo', {
|
6 |
+
/**
|
7 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
8 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
9 |
+
* of the editor instance to intercept that event.
|
10 |
+
*
|
11 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
12 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
13 |
+
*/
|
14 |
+
init : function(ed, url) {
|
15 |
+
|
16 |
+
ed.addButton('mailto', {
|
17 |
+
title : ed.getLang('mailto.mailto_desc'),
|
18 |
+
cmd : 'mceMailTo',
|
19 |
+
//image : url + '/images/mailto.gif'
|
20 |
+
});
|
21 |
+
|
22 |
+
ed.addCommand('mceMailTo', function() {
|
23 |
+
var selectedText = ed.selection.getContent({format : 'text'});
|
24 |
+
var MailToLink = "<a href='mailto:" + selectedText + "'>" + selectedText + "</a>"
|
25 |
+
ed.execCommand('mceInsertContent', false, MailToLink);
|
26 |
+
});
|
27 |
+
|
28 |
+
},
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns information about the plugin as a name/value array.
|
32 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
33 |
+
*
|
34 |
+
* @return {Object} Name/value array containing information about the plugin.
|
35 |
+
*/
|
36 |
+
getInfo : function() {
|
37 |
+
return {
|
38 |
+
longname : 'MailTo',
|
39 |
+
author : 'Josh Lobe',
|
40 |
+
authorurl : 'http://joshlobe.com',
|
41 |
+
version : "1.0"
|
42 |
+
};
|
43 |
+
}
|
44 |
+
});
|
45 |
+
|
46 |
+
// Register plugin
|
47 |
+
tinymce.PluginManager.add('mailto', tinymce.plugins.MailTo);
|
48 |
+
})();
|
49 |
+
|
addons/mailto/images/Thumbs.db
ADDED
Binary file
|
addons/mailto/images/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="mailto.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/mailto/images/mailto.gif
ADDED
Binary file
|
addons/mailto/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="es.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/mailto/langs/en.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.mailto',{
|
2 |
+
mailto_desc:"MailTo",
|
3 |
+
maitlo_alt:"MailTo"
|
4 |
+
});
|
addons/mailto/langs/es.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('es.clear',{
|
2 |
+
clearleft_desc:"Salir de flotante izquierdo",
|
3 |
+
clearright_desc:"Salir de flotante derecho",
|
4 |
+
clearboth_desc:"Salir de ambos flotantes",
|
5 |
+
clear_alt:"Salir de flotante"
|
6 |
+
});
|
addons/media/_notes/dwsync.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111144200000000" remote="130111144200000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111144200000000" remote="130111144200000000" Dst="2" />
|
5 |
+
<file name="media.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="moxieplayer.swf" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
</dwsync>
|
addons/media/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="media.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/media/css/media.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
|
2 |
+
#hspace, #vspace { width: 50px }
|
3 |
+
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
|
4 |
+
#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px }
|
5 |
+
#width, #height { width: 40px }
|
6 |
+
#src, #media_type { width: 250px }
|
7 |
+
#class { width: 120px }
|
8 |
+
#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto }
|
9 |
+
.panel_wrapper div.current { height: 420px; overflow: auto }
|
10 |
+
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
|
11 |
+
.mceAddSelectValue { background-color: #DDDDDD }
|
12 |
+
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
|
13 |
+
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
|
14 |
+
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
|
15 |
+
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
|
16 |
+
#qt_qtsrc { width: 200px }
|
17 |
+
iframe {border: 1px solid gray}
|
addons/media/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m<f.length;m++){k=f[m][0];q={name:k,clsids:tinymce.explode(f[m][1]||""),mimes:tinymce.explode(f[m][2]||""),codebase:f[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;a+=(a?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar;audio=mp3,ogg").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});a=new RegExp("write("+a+")\\(([^)]+)\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(i,s){if(s.name==="img"&&n.dom.hasClass(s.node,"mceItemMedia")){s.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(s,t,i){if(i.nodeName==="IMG"&&i.className.indexOf("mceItemMedia")!==-1){t.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var s,i;i=n.selection.getNode();if(o(i)){s=n.dom.getAttrib(i,"data-mce-json");if(s){s=g.parse(s);tinymce.each(d,function(t){var u=n.dom.getAttrib(i,t);if(u){s[t]=u}});s.type=r.getType(i.className).name.toLowerCase()}}if(!s){s={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:s})});n.addButton("media",{title:n.getLang("media.desc"),cmd:"mceMedia"});n.onNodeChange.add(function(s,i,t){i.setActive("media",o(t))})},convertUrl:function(k,n){var j=this,m=j.editor,l=m.settings,o=l.url_converter,i=l.url_converter_scope||j;if(!k){return k}if(n){return m.documentBaseURI.toAbsolute(k)}return o.call(i,k,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,hspace:m.hspace,vspace:m.vspace,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":g.serialize(m,"'")});n.width=m.width||(m.type=="audio"?"300":"320");n.height=m.height||(m.type=="audio"?"32":"240");return n},dataToHtml:function(i,j){return this.editor.serializer.serialize(this.dataToImg(i,j),{forced_root_block:"",force_absolute:j})},htmlToData:function(k){var j,i,l;l={type:"flash",video:{sources:[]},params:{}};j=this.editor.parser.parse(k);i=j.getAll("img")[0];if(i){l=g.parse(i.attr("data-mce-json"));l.type=this.getType(i.attr("class")).name.toLowerCase();tinymce.each(d,function(m){var n=i.attr(m);if(n){l[m]=n}})}return l},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(z,o){var u=this,p=u.editor,C,H,j,t,I,y,G,w,k,E,s,q,A,D,m,x,l,B,F;function r(i,n){var M,L,N,K,J;J=p.getParam("flash_video_player_url",u.convertUrl(u.url+"/moxieplayer.swf"));if(J){M=p.documentBaseURI;G.params.src=J;if(p.getParam("flash_video_player_absvideourl",true)){i=M.toAbsolute(i||"",true);n=M.toAbsolute(n||"",true)}N="";L=p.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(L,function(P,O){P=P.replace(/\$url/,i||"");P=P.replace(/\$poster/,n||"");if(P.length>0){N+=(N?"&":"")+O+"="+escape(P)}});if(N.length){G.params.flashvars=N}K=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(K,function(P,O){G.params[O]=""+P})}}G=z.attr("data-mce-json");if(!G){return}G=g.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}if(q.name==="Iframe"){x=new b("iframe",1);tinymce.each(d,function(i){var n=z.attr(i);if(i=="class"&&n){n=n.replace(/mceItem.+ ?/g,"")}if(n&&n.length>0){x.attr(i,n)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new b("script",1).attr("type","text/javascript");y=new b("#text",3);y.value="write"+q.name+"("+g.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new b("video",1).attr(tinymce.extend({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A<k.length;A++){if(/\.mp4$/.test(k[A].src)){m=k[A].src}}if(!k[0].type){C.attr("src",k[0].src);k.splice(0,1)}for(A=0;A<k.length;A++){w=new b("source",1).attr(k[A]);w.shortEnded=true;C.append(w)}if(m){r(m,l);q=u.getType("flash")}else{G.params.src=""}}if(q.name==="Audio"&&G.video.sources[0]){F=new b("audio",1).attr(tinymce.extend({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);if(!k[0].type){F.attr("src",k[0].src);k.splice(0,1)}for(A=0;A<k.length;A++){w=new b("source",1).attr(k[A]);w.shortEnded=true;F.append(w)}G.params.src=""}if(q.name==="EmbeddedAudio"){j=new b("embed",1);j.shortEnded=true;j.attr({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B,type:z.attr("type")});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(d,function(i){if(G[i]&&i!="type"){j.attr(i,G[i])}});G.params.src=""}if(G.params.src){if(/\.flv$/i.test(G.params.src)){r(G.params.src,"")}if(o&&o.force_absolute){G.params.src=p.documentBaseURI.toAbsolute(G.params.src)}H=new b("object",1).attr({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B});tinymce.each(d,function(i){var n=G[i];if(i=="class"&&n){n=n.replace(/mceItem.+ ?/g,"")}if(n&&i!="type"){H.attr(i,n)}});for(I in G.params){s=new b("param",1);s.shortEnded=true;y=G.params[I];if(I==="src"&&q.name==="WindowsMedia"){I="url"}s.attr({name:I,value:y});H.append(s)}if(this.editor.getParam("media_strict",true)){H.attr({data:G.params.src,type:q.mimes[0]})}else{H.attr({classid:"clsid:"+q.clsids[0],codebase:q.codebase});j=new b("embed",1);j.shortEnded=true;j.attr({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B,type:q.mimes[0]});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(d,function(i){if(G[i]&&i!="type"){j.attr(i,G[i])}});H.append(j)}if(G.object_html){y=new b("#text",3);y.raw=true;y.value=G.object_html;H.append(y)}if(C){C.append(H)}}if(C){if(G.video_html){y=new b("#text",3);y.raw=true;y.value=G.video_html;C.append(y)}}if(F){if(G.video_html){y=new b("#text",3);y.raw=true;y.value=G.video_html;F.append(y)}}var v=C||F||H||j;if(v){z.replace(v)}else{z.remove()}},objectToImg:function(C){var L,k,F,s,M,N,y,A,x,G,E,t,q,I,B,l,K,o,H=this.lookup,m,z,v=this.editor.settings.url_converter,n=this.editor.settings.url_converter_scope,w,r,D,j;function u(i){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(i)}function J(O,i){return H[(O.attr(i)||"").toLowerCase()]}function p(O){var i=O.replace(/^.*\.([^.]+)$/,"$1");return H[i.toLowerCase()||""]}if(!C.parent){return}if(C.name==="script"){if(C.firstChild){m=a.exec(C.firstChild.value)}if(!m){return}o=m[1];K={video:{},params:g.parse(m[2])};A=K.params.width;x=K.params.height}K=K||{video:{},params:{}};M=new b("img",1);M.attr({src:this.editor.theme.url+"/img/trans.gif"});N=C.name;if(N==="video"||N=="audio"){F=C;L=C.getAll("object")[0];k=C.getAll("embed")[0];A=F.attr("width");x=F.attr("height");y=F.attr("id");K.video={attrs:{},sources:[]};z=K.video.attrs;for(N in F.attributes.map){z[N]=F.attributes.map[N]}B=C.attr("src");if(B){K.video.sources.push({src:v.call(n,B,"src",C.name)})}l=F.getAll("source");for(E=0;E<l.length;E++){B=l[E].remove();K.video.sources.push({src:v.call(n,B.attr("src"),"src","source"),type:B.attr("type"),media:B.attr("media")})}if(z.poster){z.poster=v.call(n,z.poster,"poster",C.name)}}if(C.name==="object"){L=C;k=C.getAll("embed")[0]}if(C.name==="embed"){k=C}if(C.name==="iframe"){s=C;o="Iframe"}if(L){A=A||L.attr("width");x=x||L.attr("height");G=G||L.attr("style");y=y||L.attr("id");w=w||L.attr("hspace");r=r||L.attr("vspace");D=D||L.attr("align");j=j||L.attr("bgcolor");K.name=L.attr("name");I=L.getAll("param");for(E=0;E<I.length;E++){q=I[E];N=q.remove().attr("name");if(!h[N]){K.params[N]=q.attr("value")}}K.params.src=K.params.src||L.attr("data")}if(k){A=A||k.attr("width");x=x||k.attr("height");G=G||k.attr("style");y=y||k.attr("id");w=w||k.attr("hspace");r=r||k.attr("vspace");D=D||k.attr("align");j=j||k.attr("bgcolor");for(N in k.attributes.map){if(!h[N]&&!K.params[N]){K.params[N]=k.attributes.map[N]}}}if(s){A=s.attr("width");x=s.attr("height");G=G||s.attr("style");y=s.attr("id");w=s.attr("hspace");r=s.attr("vspace");D=s.attr("align");j=s.attr("bgcolor");tinymce.each(d,function(i){M.attr(i,s.attr(i))});for(N in s.attributes.map){if(!h[N]&&!K.params[N]){K.params[N]=s.attributes.map[N]}}}if(K.params.movie){K.params.src=K.params.src||K.params.movie;delete K.params.movie}if(K.params.src){K.params.src=v.call(n,K.params.src,"src","object")}if(F){if(C.name==="video"){o=H.video.name}else{if(C.name==="audio"){o=H.audio.name}}}if(L&&!o){o=(J(L,"clsid")||J(L,"classid")||J(L,"type")||{}).name}if(k&&!o){o=(J(k,"type")||p(K.params.src)||{}).name}if(k&&o=="EmbeddedAudio"){K.params.type=k.attr("type")}C.replace(M);if(k){k.remove()}if(L){t=u(L.remove());if(t){K.object_html=t}}if(F){t=u(F.remove());if(t){K.video_html=t}}K.hspace=w;K.vspace=r;K.align=D;K.bgcolor=j;M.attr({id:y,"class":"mceItemMedia mceItem"+(o||"Flash"),style:G,width:A||(C.name=="audio"?"300":"320"),height:x||(C.name=="audio"?"32":"240"),hspace:w,vspace:r,align:D,bgcolor:j,"data-mce-json":g.serialize(K,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
|
addons/media/editor_plugin_src.js
ADDED
@@ -0,0 +1,890 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
|
13 |
+
mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
|
14 |
+
|
15 |
+
// Media types supported by this plugin
|
16 |
+
mediaTypes = [
|
17 |
+
// Type, clsid:s, mime types, codebase
|
18 |
+
["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
19 |
+
["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],
|
20 |
+
["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],
|
21 |
+
["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],
|
22 |
+
["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
23 |
+
["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
|
24 |
+
["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
|
25 |
+
["Iframe"],
|
26 |
+
["Video"],
|
27 |
+
["EmbeddedAudio"],
|
28 |
+
["Audio"]
|
29 |
+
];
|
30 |
+
|
31 |
+
function toArray(obj) {
|
32 |
+
var undef, out, i;
|
33 |
+
|
34 |
+
if (obj && !obj.splice) {
|
35 |
+
out = [];
|
36 |
+
|
37 |
+
for (i = 0; true; i++) {
|
38 |
+
if (obj[i])
|
39 |
+
out[i] = obj[i];
|
40 |
+
else
|
41 |
+
break;
|
42 |
+
}
|
43 |
+
|
44 |
+
return out;
|
45 |
+
}
|
46 |
+
|
47 |
+
return obj;
|
48 |
+
};
|
49 |
+
|
50 |
+
tinymce.create('tinymce.plugins.MediaPlugin', {
|
51 |
+
init : function(ed, url) {
|
52 |
+
var self = this, lookup = {}, i, y, item, name;
|
53 |
+
|
54 |
+
function isMediaImg(node) {
|
55 |
+
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
56 |
+
};
|
57 |
+
|
58 |
+
self.editor = ed;
|
59 |
+
self.url = url;
|
60 |
+
|
61 |
+
// Parse media types into a lookup table
|
62 |
+
scriptRegExp = '';
|
63 |
+
for (i = 0; i < mediaTypes.length; i++) {
|
64 |
+
name = mediaTypes[i][0];
|
65 |
+
|
66 |
+
item = {
|
67 |
+
name : name,
|
68 |
+
clsids : tinymce.explode(mediaTypes[i][1] || ''),
|
69 |
+
mimes : tinymce.explode(mediaTypes[i][2] || ''),
|
70 |
+
codebase : mediaTypes[i][3]
|
71 |
+
};
|
72 |
+
|
73 |
+
for (y = 0; y < item.clsids.length; y++)
|
74 |
+
lookup['clsid:' + item.clsids[y]] = item;
|
75 |
+
|
76 |
+
for (y = 0; y < item.mimes.length; y++)
|
77 |
+
lookup[item.mimes[y]] = item;
|
78 |
+
|
79 |
+
lookup['mceItem' + name] = item;
|
80 |
+
lookup[name.toLowerCase()] = item;
|
81 |
+
|
82 |
+
scriptRegExp += (scriptRegExp ? '|' : '') + name;
|
83 |
+
}
|
84 |
+
|
85 |
+
// Handle the media_types setting
|
86 |
+
tinymce.each(ed.getParam("media_types",
|
87 |
+
"video=mp4,m4v,ogv,webm;" +
|
88 |
+
"silverlight=xap;" +
|
89 |
+
"flash=swf,flv;" +
|
90 |
+
"shockwave=dcr;" +
|
91 |
+
"quicktime=mov,qt,mpg,mpeg;" +
|
92 |
+
"shockwave=dcr;" +
|
93 |
+
"windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
|
94 |
+
"realmedia=rm,ra,ram;" +
|
95 |
+
"java=jar;" +
|
96 |
+
"audio=mp3,ogg"
|
97 |
+
).split(';'), function(item) {
|
98 |
+
var i, extensions, type;
|
99 |
+
|
100 |
+
item = item.split(/=/);
|
101 |
+
extensions = tinymce.explode(item[1].toLowerCase());
|
102 |
+
for (i = 0; i < extensions.length; i++) {
|
103 |
+
type = lookup[item[0].toLowerCase()];
|
104 |
+
|
105 |
+
if (type)
|
106 |
+
lookup[extensions[i]] = type;
|
107 |
+
}
|
108 |
+
});
|
109 |
+
|
110 |
+
scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
|
111 |
+
self.lookup = lookup;
|
112 |
+
|
113 |
+
ed.onPreInit.add(function() {
|
114 |
+
// Allow video elements
|
115 |
+
ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
|
116 |
+
|
117 |
+
// Convert video elements to image placeholder
|
118 |
+
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
119 |
+
var i = nodes.length;
|
120 |
+
|
121 |
+
while (i--)
|
122 |
+
self.objectToImg(nodes[i]);
|
123 |
+
});
|
124 |
+
|
125 |
+
// Convert image placeholders to video elements
|
126 |
+
ed.serializer.addNodeFilter('img', function(nodes, name, args) {
|
127 |
+
var i = nodes.length, node;
|
128 |
+
|
129 |
+
while (i--) {
|
130 |
+
node = nodes[i];
|
131 |
+
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
|
132 |
+
self.imgToObject(node, args);
|
133 |
+
}
|
134 |
+
});
|
135 |
+
});
|
136 |
+
|
137 |
+
ed.onInit.add(function() {
|
138 |
+
// Display "media" instead of "img" in element path
|
139 |
+
if (ed.theme && ed.theme.onResolveName) {
|
140 |
+
ed.theme.onResolveName.add(function(theme, path_object) {
|
141 |
+
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
|
142 |
+
path_object.name = 'media';
|
143 |
+
});
|
144 |
+
}
|
145 |
+
|
146 |
+
// Add contect menu if it's loaded
|
147 |
+
if (ed && ed.plugins.contextmenu) {
|
148 |
+
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
149 |
+
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
|
150 |
+
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
151 |
+
});
|
152 |
+
}
|
153 |
+
});
|
154 |
+
|
155 |
+
// Register commands
|
156 |
+
ed.addCommand('mceMedia', function() {
|
157 |
+
var data, img;
|
158 |
+
|
159 |
+
img = ed.selection.getNode();
|
160 |
+
if (isMediaImg(img)) {
|
161 |
+
data = ed.dom.getAttrib(img, 'data-mce-json');
|
162 |
+
if (data) {
|
163 |
+
data = JSON.parse(data);
|
164 |
+
|
165 |
+
// Add some extra properties to the data object
|
166 |
+
tinymce.each(rootAttributes, function(name) {
|
167 |
+
var value = ed.dom.getAttrib(img, name);
|
168 |
+
|
169 |
+
if (value)
|
170 |
+
data[name] = value;
|
171 |
+
});
|
172 |
+
|
173 |
+
data.type = self.getType(img.className).name.toLowerCase();
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
if (!data) {
|
178 |
+
data = {
|
179 |
+
type : 'flash',
|
180 |
+
video: {sources:[]},
|
181 |
+
params: {}
|
182 |
+
};
|
183 |
+
}
|
184 |
+
|
185 |
+
ed.windowManager.open({
|
186 |
+
file : url + '/media.htm',
|
187 |
+
width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
|
188 |
+
height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
|
189 |
+
inline : 1
|
190 |
+
}, {
|
191 |
+
plugin_url : url,
|
192 |
+
data : data
|
193 |
+
});
|
194 |
+
});
|
195 |
+
|
196 |
+
// Register buttons
|
197 |
+
ed.addButton('media', {title : ed.getLang('media.desc'), cmd : 'mceMedia'});
|
198 |
+
|
199 |
+
// Update media selection status
|
200 |
+
ed.onNodeChange.add(function(ed, cm, node) {
|
201 |
+
cm.setActive('media', isMediaImg(node));
|
202 |
+
});
|
203 |
+
},
|
204 |
+
|
205 |
+
convertUrl : function(url, force_absolute) {
|
206 |
+
var self = this, editor = self.editor, settings = editor.settings,
|
207 |
+
urlConverter = settings.url_converter,
|
208 |
+
urlConverterScope = settings.url_converter_scope || self;
|
209 |
+
|
210 |
+
if (!url)
|
211 |
+
return url;
|
212 |
+
|
213 |
+
if (force_absolute)
|
214 |
+
return editor.documentBaseURI.toAbsolute(url);
|
215 |
+
|
216 |
+
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
217 |
+
},
|
218 |
+
|
219 |
+
getInfo : function() {
|
220 |
+
return {
|
221 |
+
longname : 'Media',
|
222 |
+
author : 'Moxiecode Systems AB',
|
223 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
224 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
|
225 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
226 |
+
};
|
227 |
+
},
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Converts the JSON data object to an img node.
|
231 |
+
*/
|
232 |
+
dataToImg : function(data, force_absolute) {
|
233 |
+
var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
|
234 |
+
|
235 |
+
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
236 |
+
|
237 |
+
attrs = data.video.attrs;
|
238 |
+
if (attrs)
|
239 |
+
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
240 |
+
|
241 |
+
if (attrs)
|
242 |
+
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
243 |
+
|
244 |
+
sources = toArray(data.video.sources);
|
245 |
+
if (sources) {
|
246 |
+
for (i = 0; i < sources.length; i++)
|
247 |
+
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
248 |
+
}
|
249 |
+
|
250 |
+
img = self.editor.dom.create('img', {
|
251 |
+
id : data.id,
|
252 |
+
style : data.style,
|
253 |
+
align : data.align,
|
254 |
+
hspace : data.hspace,
|
255 |
+
vspace : data.vspace,
|
256 |
+
src : self.editor.theme.url + '/img/trans.gif',
|
257 |
+
'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
|
258 |
+
'data-mce-json' : JSON.serialize(data, "'")
|
259 |
+
});
|
260 |
+
|
261 |
+
img.width = data.width || (data.type == 'audio' ? "300" : "320");
|
262 |
+
img.height = data.height || (data.type == 'audio' ? "32" : "240");
|
263 |
+
|
264 |
+
return img;
|
265 |
+
},
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Converts the JSON data object to a HTML string.
|
269 |
+
*/
|
270 |
+
dataToHtml : function(data, force_absolute) {
|
271 |
+
return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
|
272 |
+
},
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Converts the JSON data object to a HTML string.
|
276 |
+
*/
|
277 |
+
htmlToData : function(html) {
|
278 |
+
var fragment, img, data;
|
279 |
+
|
280 |
+
data = {
|
281 |
+
type : 'flash',
|
282 |
+
video: {sources:[]},
|
283 |
+
params: {}
|
284 |
+
};
|
285 |
+
|
286 |
+
fragment = this.editor.parser.parse(html);
|
287 |
+
img = fragment.getAll('img')[0];
|
288 |
+
|
289 |
+
if (img) {
|
290 |
+
data = JSON.parse(img.attr('data-mce-json'));
|
291 |
+
data.type = this.getType(img.attr('class')).name.toLowerCase();
|
292 |
+
|
293 |
+
// Add some extra properties to the data object
|
294 |
+
tinymce.each(rootAttributes, function(name) {
|
295 |
+
var value = img.attr(name);
|
296 |
+
|
297 |
+
if (value)
|
298 |
+
data[name] = value;
|
299 |
+
});
|
300 |
+
}
|
301 |
+
|
302 |
+
return data;
|
303 |
+
},
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Get type item by extension, class, clsid or mime type.
|
307 |
+
*
|
308 |
+
* @method getType
|
309 |
+
* @param {String} value Value to get type item by.
|
310 |
+
* @return {Object} Type item object or undefined.
|
311 |
+
*/
|
312 |
+
getType : function(value) {
|
313 |
+
var i, values, typeItem;
|
314 |
+
|
315 |
+
// Find type by checking the classes
|
316 |
+
values = tinymce.explode(value, ' ');
|
317 |
+
for (i = 0; i < values.length; i++) {
|
318 |
+
typeItem = this.lookup[values[i]];
|
319 |
+
|
320 |
+
if (typeItem)
|
321 |
+
return typeItem;
|
322 |
+
}
|
323 |
+
},
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Converts a tinymce.html.Node image element to video/object/embed.
|
327 |
+
*/
|
328 |
+
imgToObject : function(node, args) {
|
329 |
+
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
|
330 |
+
source, sources, params, param, typeItem, i, item, mp4Source, replacement,
|
331 |
+
posterSrc, style, audio;
|
332 |
+
|
333 |
+
// Adds the flash player
|
334 |
+
function addPlayer(video_src, poster_src) {
|
335 |
+
var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
|
336 |
+
|
337 |
+
flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
|
338 |
+
if (flashPlayer) {
|
339 |
+
baseUri = editor.documentBaseURI;
|
340 |
+
data.params.src = flashPlayer;
|
341 |
+
|
342 |
+
// Convert the movie url to absolute urls
|
343 |
+
if (editor.getParam('flash_video_player_absvideourl', true)) {
|
344 |
+
video_src = baseUri.toAbsolute(video_src || '', true);
|
345 |
+
poster_src = baseUri.toAbsolute(poster_src || '', true);
|
346 |
+
}
|
347 |
+
|
348 |
+
// Generate flash vars
|
349 |
+
flashVarsOutput = '';
|
350 |
+
flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
|
351 |
+
tinymce.each(flashVars, function(value, name) {
|
352 |
+
// Replace $url and $poster variables in flashvars value
|
353 |
+
value = value.replace(/\$url/, video_src || '');
|
354 |
+
value = value.replace(/\$poster/, poster_src || '');
|
355 |
+
|
356 |
+
if (value.length > 0)
|
357 |
+
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
358 |
+
});
|
359 |
+
|
360 |
+
if (flashVarsOutput.length)
|
361 |
+
data.params.flashvars = flashVarsOutput;
|
362 |
+
|
363 |
+
params = editor.getParam('flash_video_player_params', {
|
364 |
+
allowfullscreen: true,
|
365 |
+
allowscriptaccess: true
|
366 |
+
});
|
367 |
+
|
368 |
+
tinymce.each(params, function(value, name) {
|
369 |
+
data.params[name] = "" + value;
|
370 |
+
});
|
371 |
+
}
|
372 |
+
};
|
373 |
+
|
374 |
+
data = node.attr('data-mce-json');
|
375 |
+
if (!data)
|
376 |
+
return;
|
377 |
+
|
378 |
+
data = JSON.parse(data);
|
379 |
+
typeItem = this.getType(node.attr('class'));
|
380 |
+
|
381 |
+
style = node.attr('data-mce-style')
|
382 |
+
if (!style) {
|
383 |
+
style = node.attr('style');
|
384 |
+
|
385 |
+
if (style)
|
386 |
+
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
387 |
+
}
|
388 |
+
|
389 |
+
// Handle iframe
|
390 |
+
if (typeItem.name === 'Iframe') {
|
391 |
+
replacement = new Node('iframe', 1);
|
392 |
+
|
393 |
+
tinymce.each(rootAttributes, function(name) {
|
394 |
+
var value = node.attr(name);
|
395 |
+
|
396 |
+
if (name == 'class' && value)
|
397 |
+
value = value.replace(/mceItem.+ ?/g, '');
|
398 |
+
|
399 |
+
if (value && value.length > 0)
|
400 |
+
replacement.attr(name, value);
|
401 |
+
});
|
402 |
+
|
403 |
+
for (name in data.params)
|
404 |
+
replacement.attr(name, data.params[name]);
|
405 |
+
|
406 |
+
replacement.attr({
|
407 |
+
style: style,
|
408 |
+
src: data.params.src
|
409 |
+
});
|
410 |
+
|
411 |
+
node.replace(replacement);
|
412 |
+
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
// Handle scripts
|
417 |
+
if (this.editor.settings.media_use_script) {
|
418 |
+
replacement = new Node('script', 1).attr('type', 'text/javascript');
|
419 |
+
|
420 |
+
value = new Node('#text', 3);
|
421 |
+
value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
|
422 |
+
width: node.attr('width'),
|
423 |
+
height: node.attr('height')
|
424 |
+
})) + ');';
|
425 |
+
|
426 |
+
replacement.append(value);
|
427 |
+
node.replace(replacement);
|
428 |
+
|
429 |
+
return;
|
430 |
+
}
|
431 |
+
|
432 |
+
// Add HTML5 video element
|
433 |
+
if (typeItem.name === 'Video' && data.video.sources[0]) {
|
434 |
+
// Create new object element
|
435 |
+
video = new Node('video', 1).attr(tinymce.extend({
|
436 |
+
id : node.attr('id'),
|
437 |
+
width: node.attr('width'),
|
438 |
+
height: node.attr('height'),
|
439 |
+
style : style
|
440 |
+
}, data.video.attrs));
|
441 |
+
|
442 |
+
// Get poster source and use that for flash fallback
|
443 |
+
if (data.video.attrs)
|
444 |
+
posterSrc = data.video.attrs.poster;
|
445 |
+
|
446 |
+
sources = data.video.sources = toArray(data.video.sources);
|
447 |
+
for (i = 0; i < sources.length; i++) {
|
448 |
+
if (/\.mp4$/.test(sources[i].src))
|
449 |
+
mp4Source = sources[i].src;
|
450 |
+
}
|
451 |
+
|
452 |
+
if (!sources[0].type) {
|
453 |
+
video.attr('src', sources[0].src);
|
454 |
+
sources.splice(0, 1);
|
455 |
+
}
|
456 |
+
|
457 |
+
for (i = 0; i < sources.length; i++) {
|
458 |
+
source = new Node('source', 1).attr(sources[i]);
|
459 |
+
source.shortEnded = true;
|
460 |
+
video.append(source);
|
461 |
+
}
|
462 |
+
|
463 |
+
// Create flash fallback for video if we have a mp4 source
|
464 |
+
if (mp4Source) {
|
465 |
+
addPlayer(mp4Source, posterSrc);
|
466 |
+
typeItem = self.getType('flash');
|
467 |
+
} else
|
468 |
+
data.params.src = '';
|
469 |
+
}
|
470 |
+
|
471 |
+
// Add HTML5 audio element
|
472 |
+
if (typeItem.name === 'Audio' && data.video.sources[0]) {
|
473 |
+
// Create new object element
|
474 |
+
audio = new Node('audio', 1).attr(tinymce.extend({
|
475 |
+
id : node.attr('id'),
|
476 |
+
width: node.attr('width'),
|
477 |
+
height: node.attr('height'),
|
478 |
+
style : style
|
479 |
+
}, data.video.attrs));
|
480 |
+
|
481 |
+
// Get poster source and use that for flash fallback
|
482 |
+
if (data.video.attrs)
|
483 |
+
posterSrc = data.video.attrs.poster;
|
484 |
+
|
485 |
+
sources = data.video.sources = toArray(data.video.sources);
|
486 |
+
if (!sources[0].type) {
|
487 |
+
audio.attr('src', sources[0].src);
|
488 |
+
sources.splice(0, 1);
|
489 |
+
}
|
490 |
+
|
491 |
+
for (i = 0; i < sources.length; i++) {
|
492 |
+
source = new Node('source', 1).attr(sources[i]);
|
493 |
+
source.shortEnded = true;
|
494 |
+
audio.append(source);
|
495 |
+
}
|
496 |
+
|
497 |
+
data.params.src = '';
|
498 |
+
}
|
499 |
+
|
500 |
+
if (typeItem.name === 'EmbeddedAudio') {
|
501 |
+
embed = new Node('embed', 1);
|
502 |
+
embed.shortEnded = true;
|
503 |
+
embed.attr({
|
504 |
+
id: node.attr('id'),
|
505 |
+
width: node.attr('width'),
|
506 |
+
height: node.attr('height'),
|
507 |
+
style : style,
|
508 |
+
type: node.attr('type')
|
509 |
+
});
|
510 |
+
|
511 |
+
for (name in data.params)
|
512 |
+
embed.attr(name, data.params[name]);
|
513 |
+
|
514 |
+
tinymce.each(rootAttributes, function(name) {
|
515 |
+
if (data[name] && name != 'type')
|
516 |
+
embed.attr(name, data[name]);
|
517 |
+
});
|
518 |
+
|
519 |
+
data.params.src = '';
|
520 |
+
}
|
521 |
+
|
522 |
+
// Do we have a params src then we can generate object
|
523 |
+
if (data.params.src) {
|
524 |
+
// Is flv movie add player for it
|
525 |
+
if (/\.flv$/i.test(data.params.src))
|
526 |
+
addPlayer(data.params.src, '');
|
527 |
+
|
528 |
+
if (args && args.force_absolute)
|
529 |
+
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
530 |
+
|
531 |
+
// Create new object element
|
532 |
+
object = new Node('object', 1).attr({
|
533 |
+
id : node.attr('id'),
|
534 |
+
width: node.attr('width'),
|
535 |
+
height: node.attr('height'),
|
536 |
+
style : style
|
537 |
+
});
|
538 |
+
|
539 |
+
tinymce.each(rootAttributes, function(name) {
|
540 |
+
var value = data[name];
|
541 |
+
|
542 |
+
if (name == 'class' && value)
|
543 |
+
value = value.replace(/mceItem.+ ?/g, '');
|
544 |
+
|
545 |
+
if (value && name != 'type')
|
546 |
+
object.attr(name, value);
|
547 |
+
});
|
548 |
+
|
549 |
+
// Add params
|
550 |
+
for (name in data.params) {
|
551 |
+
param = new Node('param', 1);
|
552 |
+
param.shortEnded = true;
|
553 |
+
value = data.params[name];
|
554 |
+
|
555 |
+
// Windows media needs to use url instead of src for the media URL
|
556 |
+
if (name === 'src' && typeItem.name === 'WindowsMedia')
|
557 |
+
name = 'url';
|
558 |
+
|
559 |
+
param.attr({name: name, value: value});
|
560 |
+
object.append(param);
|
561 |
+
}
|
562 |
+
|
563 |
+
// Setup add type and classid if strict is disabled
|
564 |
+
if (this.editor.getParam('media_strict', true)) {
|
565 |
+
object.attr({
|
566 |
+
data: data.params.src,
|
567 |
+
type: typeItem.mimes[0]
|
568 |
+
});
|
569 |
+
} else {
|
570 |
+
object.attr({
|
571 |
+
classid: "clsid:" + typeItem.clsids[0],
|
572 |
+
codebase: typeItem.codebase
|
573 |
+
});
|
574 |
+
|
575 |
+
embed = new Node('embed', 1);
|
576 |
+
embed.shortEnded = true;
|
577 |
+
embed.attr({
|
578 |
+
id: node.attr('id'),
|
579 |
+
width: node.attr('width'),
|
580 |
+
height: node.attr('height'),
|
581 |
+
style : style,
|
582 |
+
type: typeItem.mimes[0]
|
583 |
+
});
|
584 |
+
|
585 |
+
for (name in data.params)
|
586 |
+
embed.attr(name, data.params[name]);
|
587 |
+
|
588 |
+
tinymce.each(rootAttributes, function(name) {
|
589 |
+
if (data[name] && name != 'type')
|
590 |
+
embed.attr(name, data[name]);
|
591 |
+
});
|
592 |
+
|
593 |
+
object.append(embed);
|
594 |
+
}
|
595 |
+
|
596 |
+
// Insert raw HTML
|
597 |
+
if (data.object_html) {
|
598 |
+
value = new Node('#text', 3);
|
599 |
+
value.raw = true;
|
600 |
+
value.value = data.object_html;
|
601 |
+
object.append(value);
|
602 |
+
}
|
603 |
+
|
604 |
+
// Append object to video element if it exists
|
605 |
+
if (video)
|
606 |
+
video.append(object);
|
607 |
+
}
|
608 |
+
|
609 |
+
if (video) {
|
610 |
+
// Insert raw HTML
|
611 |
+
if (data.video_html) {
|
612 |
+
value = new Node('#text', 3);
|
613 |
+
value.raw = true;
|
614 |
+
value.value = data.video_html;
|
615 |
+
video.append(value);
|
616 |
+
}
|
617 |
+
}
|
618 |
+
|
619 |
+
if (audio) {
|
620 |
+
// Insert raw HTML
|
621 |
+
if (data.video_html) {
|
622 |
+
value = new Node('#text', 3);
|
623 |
+
value.raw = true;
|
624 |
+
value.value = data.video_html;
|
625 |
+
audio.append(value);
|
626 |
+
}
|
627 |
+
}
|
628 |
+
|
629 |
+
var n = video || audio || object || embed;
|
630 |
+
if (n)
|
631 |
+
node.replace(n);
|
632 |
+
else
|
633 |
+
node.remove();
|
634 |
+
},
|
635 |
+
|
636 |
+
/**
|
637 |
+
* Converts a tinymce.html.Node video/object/embed to an img element.
|
638 |
+
*
|
639 |
+
* The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
|
640 |
+
* <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
|
641 |
+
*
|
642 |
+
* The JSON structure will be like this:
|
643 |
+
* {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
|
644 |
+
*/
|
645 |
+
objectToImg : function(node) {
|
646 |
+
var object, embed, video, iframe, img, name, id, width, height, style, i, html,
|
647 |
+
param, params, source, sources, data, type, lookup = this.lookup,
|
648 |
+
matches, attrs, urlConverter = this.editor.settings.url_converter,
|
649 |
+
urlConverterScope = this.editor.settings.url_converter_scope,
|
650 |
+
hspace, vspace, align, bgcolor;
|
651 |
+
|
652 |
+
function getInnerHTML(node) {
|
653 |
+
return new tinymce.html.Serializer({
|
654 |
+
inner: true,
|
655 |
+
validate: false
|
656 |
+
}).serialize(node);
|
657 |
+
};
|
658 |
+
|
659 |
+
function lookupAttribute(o, attr) {
|
660 |
+
return lookup[(o.attr(attr) || '').toLowerCase()];
|
661 |
+
}
|
662 |
+
|
663 |
+
function lookupExtension(src) {
|
664 |
+
var ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
665 |
+
return lookup[ext.toLowerCase() || ''];
|
666 |
+
}
|
667 |
+
|
668 |
+
// If node isn't in document
|
669 |
+
if (!node.parent)
|
670 |
+
return;
|
671 |
+
|
672 |
+
// Handle media scripts
|
673 |
+
if (node.name === 'script') {
|
674 |
+
if (node.firstChild)
|
675 |
+
matches = scriptRegExp.exec(node.firstChild.value);
|
676 |
+
|
677 |
+
if (!matches)
|
678 |
+
return;
|
679 |
+
|
680 |
+
type = matches[1];
|
681 |
+
data = {video : {}, params : JSON.parse(matches[2])};
|
682 |
+
width = data.params.width;
|
683 |
+
height = data.params.height;
|
684 |
+
}
|
685 |
+
|
686 |
+
// Setup data objects
|
687 |
+
data = data || {
|
688 |
+
video : {},
|
689 |
+
params : {}
|
690 |
+
};
|
691 |
+
|
692 |
+
// Setup new image object
|
693 |
+
img = new Node('img', 1);
|
694 |
+
img.attr({
|
695 |
+
src : this.editor.theme.url + '/img/trans.gif'
|
696 |
+
});
|
697 |
+
|
698 |
+
// Video element
|
699 |
+
name = node.name;
|
700 |
+
if (name === 'video' || name == 'audio') {
|
701 |
+
video = node;
|
702 |
+
object = node.getAll('object')[0];
|
703 |
+
embed = node.getAll('embed')[0];
|
704 |
+
width = video.attr('width');
|
705 |
+
height = video.attr('height');
|
706 |
+
id = video.attr('id');
|
707 |
+
data.video = {attrs : {}, sources : []};
|
708 |
+
|
709 |
+
// Get all video attributes
|
710 |
+
attrs = data.video.attrs;
|
711 |
+
for (name in video.attributes.map)
|
712 |
+
attrs[name] = video.attributes.map[name];
|
713 |
+
|
714 |
+
source = node.attr('src');
|
715 |
+
if (source)
|
716 |
+
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
|
717 |
+
|
718 |
+
// Get all sources
|
719 |
+
sources = video.getAll("source");
|
720 |
+
for (i = 0; i < sources.length; i++) {
|
721 |
+
source = sources[i].remove();
|
722 |
+
|
723 |
+
data.video.sources.push({
|
724 |
+
src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
|
725 |
+
type: source.attr('type'),
|
726 |
+
media: source.attr('media')
|
727 |
+
});
|
728 |
+
}
|
729 |
+
|
730 |
+
// Convert the poster URL
|
731 |
+
if (attrs.poster)
|
732 |
+
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
|
733 |
+
}
|
734 |
+
|
735 |
+
// Object element
|
736 |
+
if (node.name === 'object') {
|
737 |
+
object = node;
|
738 |
+
embed = node.getAll('embed')[0];
|
739 |
+
}
|
740 |
+
|
741 |
+
// Embed element
|
742 |
+
if (node.name === 'embed')
|
743 |
+
embed = node;
|
744 |
+
|
745 |
+
// Iframe element
|
746 |
+
if (node.name === 'iframe') {
|
747 |
+
iframe = node;
|
748 |
+
type = 'Iframe';
|
749 |
+
}
|
750 |
+
|
751 |
+
if (object) {
|
752 |
+
// Get width/height
|
753 |
+
width = width || object.attr('width');
|
754 |
+
height = height || object.attr('height');
|
755 |
+
style = style || object.attr('style');
|
756 |
+
id = id || object.attr('id');
|
757 |
+
hspace = hspace || object.attr('hspace');
|
758 |
+
vspace = vspace || object.attr('vspace');
|
759 |
+
align = align || object.attr('align');
|
760 |
+
bgcolor = bgcolor || object.attr('bgcolor');
|
761 |
+
data.name = object.attr('name');
|
762 |
+
|
763 |
+
// Get all object params
|
764 |
+
params = object.getAll("param");
|
765 |
+
for (i = 0; i < params.length; i++) {
|
766 |
+
param = params[i];
|
767 |
+
name = param.remove().attr('name');
|
768 |
+
|
769 |
+
if (!excludedAttrs[name])
|
770 |
+
data.params[name] = param.attr('value');
|
771 |
+
}
|
772 |
+
|
773 |
+
data.params.src = data.params.src || object.attr('data');
|
774 |
+
}
|
775 |
+
|
776 |
+
if (embed) {
|
777 |
+
// Get width/height
|
778 |
+
width = width || embed.attr('width');
|
779 |
+
height = height || embed.attr('height');
|
780 |
+
style = style || embed.attr('style');
|
781 |
+
id = id || embed.attr('id');
|
782 |
+
hspace = hspace || embed.attr('hspace');
|
783 |
+
vspace = vspace || embed.attr('vspace');
|
784 |
+
align = align || embed.attr('align');
|
785 |
+
bgcolor = bgcolor || embed.attr('bgcolor');
|
786 |
+
|
787 |
+
// Get all embed attributes
|
788 |
+
for (name in embed.attributes.map) {
|
789 |
+
if (!excludedAttrs[name] && !data.params[name])
|
790 |
+
data.params[name] = embed.attributes.map[name];
|
791 |
+
}
|
792 |
+
}
|
793 |
+
|
794 |
+
if (iframe) {
|
795 |
+
// Get width/height
|
796 |
+
width = iframe.attr('width');
|
797 |
+
height = iframe.attr('height');
|
798 |
+
style = style || iframe.attr('style');
|
799 |
+
id = iframe.attr('id');
|
800 |
+
hspace = iframe.attr('hspace');
|
801 |
+
vspace = iframe.attr('vspace');
|
802 |
+
align = iframe.attr('align');
|
803 |
+
bgcolor = iframe.attr('bgcolor');
|
804 |
+
|
805 |
+
tinymce.each(rootAttributes, function(name) {
|
806 |
+
img.attr(name, iframe.attr(name));
|
807 |
+
});
|
808 |
+
|
809 |
+
// Get all iframe attributes
|
810 |
+
for (name in iframe.attributes.map) {
|
811 |
+
if (!excludedAttrs[name] && !data.params[name])
|
812 |
+
data.params[name] = iframe.attributes.map[name];
|
813 |
+
}
|
814 |
+
}
|
815 |
+
|
816 |
+
// Use src not movie
|
817 |
+
if (data.params.movie) {
|
818 |
+
data.params.src = data.params.src || data.params.movie;
|
819 |
+
delete data.params.movie;
|
820 |
+
}
|
821 |
+
|
822 |
+
// Convert the URL to relative/absolute depending on configuration
|
823 |
+
if (data.params.src)
|
824 |
+
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
825 |
+
|
826 |
+
if (video) {
|
827 |
+
if (node.name === 'video')
|
828 |
+
type = lookup.video.name;
|
829 |
+
else if (node.name === 'audio')
|
830 |
+
type = lookup.audio.name;
|
831 |
+
}
|
832 |
+
|
833 |
+
if (object && !type)
|
834 |
+
type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
|
835 |
+
|
836 |
+
if (embed && !type)
|
837 |
+
type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
|
838 |
+
|
839 |
+
// for embedded audio we preserve the original specified type
|
840 |
+
if (embed && type == 'EmbeddedAudio') {
|
841 |
+
data.params.type = embed.attr('type');
|
842 |
+
}
|
843 |
+
|
844 |
+
// Replace the video/object/embed element with a placeholder image containing the data
|
845 |
+
node.replace(img);
|
846 |
+
|
847 |
+
// Remove embed
|
848 |
+
if (embed)
|
849 |
+
embed.remove();
|
850 |
+
|
851 |
+
// Serialize the inner HTML of the object element
|
852 |
+
if (object) {
|
853 |
+
html = getInnerHTML(object.remove());
|
854 |
+
|
855 |
+
if (html)
|
856 |
+
data.object_html = html;
|
857 |
+
}
|
858 |
+
|
859 |
+
// Serialize the inner HTML of the video element
|
860 |
+
if (video) {
|
861 |
+
html = getInnerHTML(video.remove());
|
862 |
+
|
863 |
+
if (html)
|
864 |
+
data.video_html = html;
|
865 |
+
}
|
866 |
+
|
867 |
+
data.hspace = hspace;
|
868 |
+
data.vspace = vspace;
|
869 |
+
data.align = align;
|
870 |
+
data.bgcolor = bgcolor;
|
871 |
+
|
872 |
+
// Set width/height of placeholder
|
873 |
+
img.attr({
|
874 |
+
id : id,
|
875 |
+
'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
|
876 |
+
style : style,
|
877 |
+
width : width || (node.name == 'audio' ? "300" : "320"),
|
878 |
+
height : height || (node.name == 'audio' ? "32" : "240"),
|
879 |
+
hspace : hspace,
|
880 |
+
vspace : vspace,
|
881 |
+
align : align,
|
882 |
+
bgcolor : bgcolor,
|
883 |
+
"data-mce-json" : JSON.serialize(data, "'")
|
884 |
+
});
|
885 |
+
}
|
886 |
+
});
|
887 |
+
|
888 |
+
// Register plugin
|
889 |
+
tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
|
890 |
+
})();
|
addons/media/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="embed.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="media.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111146600000000" remote="130111146600000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/media/js/embed.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
|
3 |
+
*/
|
4 |
+
|
5 |
+
function writeFlash(p) {
|
6 |
+
writeEmbed(
|
7 |
+
'D27CDB6E-AE6D-11cf-96B8-444553540000',
|
8 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
9 |
+
'application/x-shockwave-flash',
|
10 |
+
p
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
function writeShockWave(p) {
|
15 |
+
writeEmbed(
|
16 |
+
'166B1BCA-3F9C-11CF-8075-444553540000',
|
17 |
+
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
|
18 |
+
'application/x-director',
|
19 |
+
p
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
function writeQuickTime(p) {
|
24 |
+
writeEmbed(
|
25 |
+
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
26 |
+
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
27 |
+
'video/quicktime',
|
28 |
+
p
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
function writeRealMedia(p) {
|
33 |
+
writeEmbed(
|
34 |
+
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
|
35 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
36 |
+
'audio/x-pn-realaudio-plugin',
|
37 |
+
p
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
function writeWindowsMedia(p) {
|
42 |
+
p.url = p.src;
|
43 |
+
writeEmbed(
|
44 |
+
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
|
45 |
+
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
|
46 |
+
'application/x-mplayer2',
|
47 |
+
p
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
function writeEmbed(cls, cb, mt, p) {
|
52 |
+
var h = '', n;
|
53 |
+
|
54 |
+
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
|
55 |
+
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
|
56 |
+
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
|
57 |
+
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
|
58 |
+
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
|
59 |
+
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
|
60 |
+
h += '>';
|
61 |
+
|
62 |
+
for (n in p)
|
63 |
+
h += '<param name="' + n + '" value="' + p[n] + '">';
|
64 |
+
|
65 |
+
h += '<embed type="' + mt + '"';
|
66 |
+
|
67 |
+
for (n in p)
|
68 |
+
h += n + '="' + p[n] + '" ';
|
69 |
+
|
70 |
+
h += '></embed></object>';
|
71 |
+
|
72 |
+
document.write(h);
|
73 |
+
}
|
addons/media/js/media.js
ADDED
@@ -0,0 +1,466 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
var url;
|
3 |
+
|
4 |
+
/*
|
5 |
+
if (url = tinyMCEPopup.getParam("media_external_list_url"))
|
6 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
7 |
+
*/
|
8 |
+
|
9 |
+
function get(id) {
|
10 |
+
return document.getElementById(id);
|
11 |
+
}
|
12 |
+
|
13 |
+
function clone(obj) {
|
14 |
+
var i, len, copy, attr;
|
15 |
+
|
16 |
+
if (null == obj || "object" != typeof obj)
|
17 |
+
return obj;
|
18 |
+
|
19 |
+
// Handle Array
|
20 |
+
if ('length' in obj) {
|
21 |
+
copy = [];
|
22 |
+
|
23 |
+
for (i = 0, len = obj.length; i < len; ++i) {
|
24 |
+
copy[i] = clone(obj[i]);
|
25 |
+
}
|
26 |
+
|
27 |
+
return copy;
|
28 |
+
}
|
29 |
+
|
30 |
+
// Handle Object
|
31 |
+
copy = {};
|
32 |
+
for (attr in obj) {
|
33 |
+
if (obj.hasOwnProperty(attr))
|
34 |
+
copy[attr] = clone(obj[attr]);
|
35 |
+
}
|
36 |
+
|
37 |
+
return copy;
|
38 |
+
}
|
39 |
+
|
40 |
+
function getVal(id) {
|
41 |
+
var elm = get(id);
|
42 |
+
|
43 |
+
if (elm.nodeName == "SELECT")
|
44 |
+
return elm.options[elm.selectedIndex].value;
|
45 |
+
|
46 |
+
if (elm.type == "checkbox")
|
47 |
+
return elm.checked;
|
48 |
+
|
49 |
+
return elm.value;
|
50 |
+
}
|
51 |
+
|
52 |
+
function setVal(id, value, name) {
|
53 |
+
if (typeof(value) != 'undefined') {
|
54 |
+
var elm = get(id);
|
55 |
+
|
56 |
+
if (elm.nodeName == "SELECT")
|
57 |
+
selectByValue(document.forms[0], id, value);
|
58 |
+
else if (elm.type == "checkbox") {
|
59 |
+
if (typeof(value) == 'string') {
|
60 |
+
value = value.toLowerCase();
|
61 |
+
value = (!name && value === 'true') || (name && value === name.toLowerCase());
|
62 |
+
}
|
63 |
+
elm.checked = !!value;
|
64 |
+
} else
|
65 |
+
elm.value = value;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
window.Media = {
|
70 |
+
init : function() {
|
71 |
+
var html, editor, self = this;
|
72 |
+
|
73 |
+
self.editor = editor = tinyMCEPopup.editor;
|
74 |
+
|
75 |
+
// Setup file browsers and color pickers
|
76 |
+
get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
|
77 |
+
get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
|
78 |
+
get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
79 |
+
get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');
|
80 |
+
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
|
81 |
+
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
|
82 |
+
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
|
83 |
+
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
|
84 |
+
|
85 |
+
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
|
86 |
+
if (html == "")
|
87 |
+
get("linklistrow").style.display = 'none';
|
88 |
+
else
|
89 |
+
get("linklistcontainer").innerHTML = html;
|
90 |
+
|
91 |
+
if (isVisible('filebrowser'))
|
92 |
+
get('src').style.width = '230px';
|
93 |
+
|
94 |
+
if (isVisible('video_filebrowser_altsource1'))
|
95 |
+
get('video_altsource1').style.width = '220px';
|
96 |
+
|
97 |
+
if (isVisible('video_filebrowser_altsource2'))
|
98 |
+
get('video_altsource2').style.width = '220px';
|
99 |
+
|
100 |
+
if (isVisible('audio_filebrowser_altsource1'))
|
101 |
+
get('audio_altsource1').style.width = '220px';
|
102 |
+
|
103 |
+
if (isVisible('audio_filebrowser_altsource2'))
|
104 |
+
get('audio_altsource2').style.width = '220px';
|
105 |
+
|
106 |
+
if (isVisible('filebrowser_poster'))
|
107 |
+
get('video_poster').style.width = '220px';
|
108 |
+
|
109 |
+
editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));
|
110 |
+
|
111 |
+
self.setDefaultDialogSettings(editor);
|
112 |
+
self.data = clone(tinyMCEPopup.getWindowArg('data'));
|
113 |
+
self.dataToForm();
|
114 |
+
self.preview();
|
115 |
+
|
116 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
117 |
+
},
|
118 |
+
|
119 |
+
insert : function() {
|
120 |
+
var editor = tinyMCEPopup.editor;
|
121 |
+
|
122 |
+
this.formToData();
|
123 |
+
editor.execCommand('mceRepaint');
|
124 |
+
tinyMCEPopup.restoreSelection();
|
125 |
+
editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
|
126 |
+
tinyMCEPopup.close();
|
127 |
+
},
|
128 |
+
|
129 |
+
preview : function() {
|
130 |
+
get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
|
131 |
+
},
|
132 |
+
|
133 |
+
moveStates : function(to_form, field) {
|
134 |
+
var data = this.data, editor = this.editor,
|
135 |
+
mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
|
136 |
+
|
137 |
+
defaultStates = {
|
138 |
+
// QuickTime
|
139 |
+
quicktime_autoplay : true,
|
140 |
+
quicktime_controller : true,
|
141 |
+
|
142 |
+
// Flash
|
143 |
+
flash_play : true,
|
144 |
+
flash_loop : true,
|
145 |
+
flash_menu : true,
|
146 |
+
|
147 |
+
// WindowsMedia
|
148 |
+
windowsmedia_autostart : true,
|
149 |
+
windowsmedia_enablecontextmenu : true,
|
150 |
+
windowsmedia_invokeurls : true,
|
151 |
+
|
152 |
+
// RealMedia
|
153 |
+
realmedia_autogotourl : true,
|
154 |
+
realmedia_imagestatus : true
|
155 |
+
};
|
156 |
+
|
157 |
+
function parseQueryParams(str) {
|
158 |
+
var out = {};
|
159 |
+
|
160 |
+
if (str) {
|
161 |
+
tinymce.each(str.split('&'), function(item) {
|
162 |
+
var parts = item.split('=');
|
163 |
+
|
164 |
+
out[unescape(parts[0])] = unescape(parts[1]);
|
165 |
+
});
|
166 |
+
}
|
167 |
+
|
168 |
+
return out;
|
169 |
+
};
|
170 |
+
|
171 |
+
function setOptions(type, names) {
|
172 |
+
var i, name, formItemName, value, list;
|
173 |
+
|
174 |
+
if (type == data.type || type == 'global') {
|
175 |
+
names = tinymce.explode(names);
|
176 |
+
for (i = 0; i < names.length; i++) {
|
177 |
+
name = names[i];
|
178 |
+
formItemName = type == 'global' ? name : type + '_' + name;
|
179 |
+
|
180 |
+
if (type == 'global')
|
181 |
+
list = data;
|
182 |
+
else if (type == 'video' || type == 'audio') {
|
183 |
+
list = data.video.attrs;
|
184 |
+
|
185 |
+
if (!list && !to_form)
|
186 |
+
data.video.attrs = list = {};
|
187 |
+
} else
|
188 |
+
list = data.params;
|
189 |
+
|
190 |
+
if (list) {
|
191 |
+
if (to_form) {
|
192 |
+
setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');
|
193 |
+
} else {
|
194 |
+
delete list[name];
|
195 |
+
|
196 |
+
value = getVal(formItemName);
|
197 |
+
if ((type == 'video' || type == 'audio') && value === true)
|
198 |
+
value = name;
|
199 |
+
|
200 |
+
if (defaultStates[formItemName]) {
|
201 |
+
if (value !== defaultStates[formItemName]) {
|
202 |
+
value = "" + value;
|
203 |
+
list[name] = value;
|
204 |
+
}
|
205 |
+
} else if (value) {
|
206 |
+
value = "" + value;
|
207 |
+
list[name] = value;
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
if (!to_form) {
|
216 |
+
data.type = get('media_type').options[get('media_type').selectedIndex].value;
|
217 |
+
data.width = getVal('width');
|
218 |
+
data.height = getVal('height');
|
219 |
+
|
220 |
+
// Switch type based on extension
|
221 |
+
src = getVal('src');
|
222 |
+
if (field == 'src') {
|
223 |
+
ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
224 |
+
if (typeInfo = mediaPlugin.getType(ext))
|
225 |
+
data.type = typeInfo.name.toLowerCase();
|
226 |
+
|
227 |
+
setVal('media_type', data.type);
|
228 |
+
}
|
229 |
+
|
230 |
+
if (data.type == "video" || data.type == "audio") {
|
231 |
+
if (!data.video.sources)
|
232 |
+
data.video.sources = [];
|
233 |
+
|
234 |
+
data.video.sources[0] = {src: getVal('src')};
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
// Hide all fieldsets and show the one active
|
239 |
+
get('video_options').style.display = 'none';
|
240 |
+
get('audio_options').style.display = 'none';
|
241 |
+
get('flash_options').style.display = 'none';
|
242 |
+
get('quicktime_options').style.display = 'none';
|
243 |
+
get('shockwave_options').style.display = 'none';
|
244 |
+
get('windowsmedia_options').style.display = 'none';
|
245 |
+
get('realmedia_options').style.display = 'none';
|
246 |
+
get('embeddedaudio_options').style.display = 'none';
|
247 |
+
|
248 |
+
if (get(data.type + '_options'))
|
249 |
+
get(data.type + '_options').style.display = 'block';
|
250 |
+
|
251 |
+
setVal('media_type', data.type);
|
252 |
+
|
253 |
+
setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
|
254 |
+
setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
|
255 |
+
setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
|
256 |
+
setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
|
257 |
+
setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
|
258 |
+
setOptions('video', 'poster,autoplay,loop,muted,preload,controls');
|
259 |
+
setOptions('audio', 'autoplay,loop,preload,controls');
|
260 |
+
setOptions('embeddedaudio', 'autoplay,loop,controls');
|
261 |
+
setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
|
262 |
+
|
263 |
+
if (to_form) {
|
264 |
+
if (data.type == 'video') {
|
265 |
+
if (data.video.sources[0])
|
266 |
+
setVal('src', data.video.sources[0].src);
|
267 |
+
|
268 |
+
src = data.video.sources[1];
|
269 |
+
if (src)
|
270 |
+
setVal('video_altsource1', src.src);
|
271 |
+
|
272 |
+
src = data.video.sources[2];
|
273 |
+
if (src)
|
274 |
+
setVal('video_altsource2', src.src);
|
275 |
+
} else if (data.type == 'audio') {
|
276 |
+
if (data.video.sources[0])
|
277 |
+
setVal('src', data.video.sources[0].src);
|
278 |
+
|
279 |
+
src = data.video.sources[1];
|
280 |
+
if (src)
|
281 |
+
setVal('audio_altsource1', src.src);
|
282 |
+
|
283 |
+
src = data.video.sources[2];
|
284 |
+
if (src)
|
285 |
+
setVal('audio_altsource2', src.src);
|
286 |
+
} else {
|
287 |
+
// Check flash vars
|
288 |
+
if (data.type == 'flash') {
|
289 |
+
tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
|
290 |
+
if (value == '$url')
|
291 |
+
data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';
|
292 |
+
});
|
293 |
+
}
|
294 |
+
|
295 |
+
setVal('src', data.params.src);
|
296 |
+
}
|
297 |
+
} else {
|
298 |
+
src = getVal("src");
|
299 |
+
|
300 |
+
// YouTube *NEW*
|
301 |
+
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
302 |
+
data.width = 425;
|
303 |
+
data.height = 350;
|
304 |
+
data.params.frameborder = '0';
|
305 |
+
data.type = 'iframe';
|
306 |
+
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
307 |
+
setVal('src', src);
|
308 |
+
setVal('media_type', data.type);
|
309 |
+
}
|
310 |
+
|
311 |
+
// YouTube
|
312 |
+
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
313 |
+
data.width = 425;
|
314 |
+
data.height = 350;
|
315 |
+
data.params.frameborder = '0';
|
316 |
+
data.type = 'iframe';
|
317 |
+
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
318 |
+
setVal('src', src);
|
319 |
+
setVal('media_type', data.type);
|
320 |
+
}
|
321 |
+
|
322 |
+
// Google video
|
323 |
+
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
324 |
+
data.width = 425;
|
325 |
+
data.height = 326;
|
326 |
+
data.type = 'flash';
|
327 |
+
src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
|
328 |
+
setVal('src', src);
|
329 |
+
setVal('media_type', data.type);
|
330 |
+
}
|
331 |
+
|
332 |
+
if (data.type == 'video') {
|
333 |
+
if (!data.video.sources)
|
334 |
+
data.video.sources = [];
|
335 |
+
|
336 |
+
data.video.sources[0] = {src : src};
|
337 |
+
|
338 |
+
src = getVal("video_altsource1");
|
339 |
+
if (src)
|
340 |
+
data.video.sources[1] = {src : src};
|
341 |
+
|
342 |
+
src = getVal("video_altsource2");
|
343 |
+
if (src)
|
344 |
+
data.video.sources[2] = {src : src};
|
345 |
+
} else if (data.type == 'audio') {
|
346 |
+
if (!data.video.sources)
|
347 |
+
data.video.sources = [];
|
348 |
+
|
349 |
+
data.video.sources[0] = {src : src};
|
350 |
+
|
351 |
+
src = getVal("audio_altsource1");
|
352 |
+
if (src)
|
353 |
+
data.video.sources[1] = {src : src};
|
354 |
+
|
355 |
+
src = getVal("audio_altsource2");
|
356 |
+
if (src)
|
357 |
+
data.video.sources[2] = {src : src};
|
358 |
+
} else
|
359 |
+
data.params.src = src;
|
360 |
+
|
361 |
+
// Set default size
|
362 |
+
setVal('width', data.width || (data.type == 'audio' ? 300 : 320));
|
363 |
+
setVal('height', data.height || (data.type == 'audio' ? 32 : 240));
|
364 |
+
}
|
365 |
+
},
|
366 |
+
|
367 |
+
dataToForm : function() {
|
368 |
+
this.moveStates(true);
|
369 |
+
},
|
370 |
+
|
371 |
+
formToData : function(field) {
|
372 |
+
if (field == "width" || field == "height")
|
373 |
+
this.changeSize(field);
|
374 |
+
|
375 |
+
if (field == 'source') {
|
376 |
+
this.moveStates(false, field);
|
377 |
+
setVal('source', this.editor.plugins.media.dataToHtml(this.data));
|
378 |
+
this.panel = 'source';
|
379 |
+
} else {
|
380 |
+
if (this.panel == 'source') {
|
381 |
+
this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));
|
382 |
+
this.dataToForm();
|
383 |
+
this.panel = '';
|
384 |
+
}
|
385 |
+
|
386 |
+
this.moveStates(false, field);
|
387 |
+
this.preview();
|
388 |
+
}
|
389 |
+
},
|
390 |
+
|
391 |
+
beforeResize : function() {
|
392 |
+
this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
393 |
+
this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
394 |
+
},
|
395 |
+
|
396 |
+
changeSize : function(type) {
|
397 |
+
var width, height, scale, size;
|
398 |
+
|
399 |
+
if (get('constrain').checked) {
|
400 |
+
width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
401 |
+
height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
402 |
+
|
403 |
+
if (type == 'width') {
|
404 |
+
this.height = Math.round((width / this.width) * height);
|
405 |
+
setVal('height', this.height);
|
406 |
+
} else {
|
407 |
+
this.width = Math.round((height / this.height) * width);
|
408 |
+
setVal('width', this.width);
|
409 |
+
}
|
410 |
+
}
|
411 |
+
},
|
412 |
+
|
413 |
+
getMediaListHTML : function() {
|
414 |
+
if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
|
415 |
+
var html = "";
|
416 |
+
|
417 |
+
html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
|
418 |
+
html += '<option value="">---</option>';
|
419 |
+
|
420 |
+
for (var i=0; i<tinyMCEMediaList.length; i++)
|
421 |
+
html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
|
422 |
+
|
423 |
+
html += '</select>';
|
424 |
+
|
425 |
+
return html;
|
426 |
+
}
|
427 |
+
|
428 |
+
return "";
|
429 |
+
},
|
430 |
+
|
431 |
+
getMediaTypeHTML : function(editor) {
|
432 |
+
function option(media_type){
|
433 |
+
return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'
|
434 |
+
}
|
435 |
+
var html = "";
|
436 |
+
html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';
|
437 |
+
html += option("video");
|
438 |
+
html += option("audio");
|
439 |
+
html += option("flash");
|
440 |
+
html += option("quicktime");
|
441 |
+
html += option("shockwave");
|
442 |
+
html += option("windowsmedia");
|
443 |
+
html += option("realmedia");
|
444 |
+
html += option("iframe");
|
445 |
+
|
446 |
+
if (editor.getParam('media_embedded_audio', false)) {
|
447 |
+
html += option('embeddedaudio');
|
448 |
+
}
|
449 |
+
|
450 |
+
html += '</select>';
|
451 |
+
return html;
|
452 |
+
},
|
453 |
+
|
454 |
+
setDefaultDialogSettings : function(editor) {
|
455 |
+
var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});
|
456 |
+
tinymce.each(defaultDialogSettings, function(v, k) {
|
457 |
+
setVal(k, v);
|
458 |
+
});
|
459 |
+
}
|
460 |
+
};
|
461 |
+
|
462 |
+
//tinyMCEPopup.requireLangPack();
|
463 |
+
tinyMCEPopup.onInit.add(function() {
|
464 |
+
Media.init();
|
465 |
+
});
|
466 |
+
})();
|
addons/media/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130100281200000000" remote="130100281200000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/media/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
|
addons/media/media.htm
ADDED
@@ -0,0 +1,922 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#media_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/media.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
8 |
+
<script type="text/javascript" src="../../tinymce/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
10 |
+
<script type="text/javascript" src="../../tinymce/editable_selects.js"></script>
|
11 |
+
<link href="css/media.css" rel="stylesheet" type="text/css" />
|
12 |
+
</head>
|
13 |
+
<body style="display: none" role="application">
|
14 |
+
<form onsubmit="Media.insert();return false;" action="#">
|
15 |
+
<div class="tabs" role="presentation">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
|
18 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
|
19 |
+
<li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</a></span></li>
|
20 |
+
</ul>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<div class="panel_wrapper">
|
24 |
+
<div id="general_panel" class="panel current">
|
25 |
+
<fieldset>
|
26 |
+
<legend>{#media_dlg.general}</legend>
|
27 |
+
|
28 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
29 |
+
<tr>
|
30 |
+
<td><label for="media_type">{#media_dlg.type}</label></td>
|
31 |
+
<td>
|
32 |
+
<select id="media_type"></select>
|
33 |
+
</td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td><label for="src">{#media_dlg.file}</label></td>
|
37 |
+
<td>
|
38 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
39 |
+
<tr>
|
40 |
+
<td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>
|
41 |
+
<td id="filebrowsercontainer"> </td>
|
42 |
+
</tr>
|
43 |
+
</table>
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
<tr id="linklistrow">
|
47 |
+
<td><label for="linklist">{#media_dlg.list}</label></td>
|
48 |
+
<td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<td><label for="width">{#media_dlg.size}</label></td>
|
52 |
+
<td>
|
53 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
54 |
+
<tr>
|
55 |
+
<td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>
|
56 |
+
<td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>
|
57 |
+
<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
|
58 |
+
</tr>
|
59 |
+
</table>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
</table>
|
63 |
+
</fieldset>
|
64 |
+
|
65 |
+
<fieldset>
|
66 |
+
<legend>{#media_dlg.preview}</legend>
|
67 |
+
<div id="prev"></div>
|
68 |
+
</fieldset>
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<div id="advanced_panel" class="panel">
|
72 |
+
<fieldset>
|
73 |
+
<legend>{#media_dlg.advanced}</legend>
|
74 |
+
|
75 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
76 |
+
<tr>
|
77 |
+
<td><label for="id">{#media_dlg.id}</label></td>
|
78 |
+
<td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>
|
79 |
+
<td><label for="name">{#media_dlg.name}</label></td>
|
80 |
+
<td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>
|
81 |
+
</tr>
|
82 |
+
|
83 |
+
<tr>
|
84 |
+
<td><label for="align">{#media_dlg.align}</label></td>
|
85 |
+
<td>
|
86 |
+
<select id="align" name="align" onchange="Media.formToData();">
|
87 |
+
<option value="">{#not_set}</option>
|
88 |
+
<option value="top">{#media_dlg.align_top}</option>
|
89 |
+
<option value="right">{#media_dlg.align_right}</option>
|
90 |
+
<option value="bottom">{#media_dlg.align_bottom}</option>
|
91 |
+
<option value="left">{#media_dlg.align_left}</option>
|
92 |
+
</select>
|
93 |
+
</td>
|
94 |
+
|
95 |
+
<td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
|
96 |
+
<td>
|
97 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
98 |
+
<tr>
|
99 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>
|
100 |
+
<td id="bgcolor_pickcontainer"> </td>
|
101 |
+
</tr>
|
102 |
+
</table>
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td><label for="vspace">{#media_dlg.vspace}</label></td>
|
108 |
+
<td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>
|
109 |
+
<td><label for="hspace">{#media_dlg.hspace}</label></td>
|
110 |
+
<td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>
|
111 |
+
</tr>
|
112 |
+
</table>
|
113 |
+
</fieldset>
|
114 |
+
|
115 |
+
<fieldset id="video_options">
|
116 |
+
<legend>{#media_dlg.html5_video_options}</legend>
|
117 |
+
|
118 |
+
<table role="presentation">
|
119 |
+
<tr>
|
120 |
+
<td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>
|
121 |
+
<td>
|
122 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
123 |
+
<tr>
|
124 |
+
<td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
125 |
+
<td id="video_altsource1_filebrowser"> </td>
|
126 |
+
</tr>
|
127 |
+
</table>
|
128 |
+
</td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>
|
133 |
+
<td>
|
134 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
135 |
+
<tr>
|
136 |
+
<td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
137 |
+
<td id="video_altsource2_filebrowser"> </td>
|
138 |
+
</tr>
|
139 |
+
</table>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
|
143 |
+
<tr>
|
144 |
+
<td><label for="video_poster">{#media_dlg.poster}</label></td>
|
145 |
+
<td>
|
146 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
147 |
+
<tr>
|
148 |
+
<td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>
|
149 |
+
<td id="video_poster_filebrowser"> </td>
|
150 |
+
</tr>
|
151 |
+
</table>
|
152 |
+
</td>
|
153 |
+
</tr>
|
154 |
+
|
155 |
+
<tr>
|
156 |
+
<td><label for="video_preload">{#media_dlg.preload}</label></td>
|
157 |
+
<td>
|
158 |
+
<select id="video_preload" name="video_preload" onchange="Media.formToData();">
|
159 |
+
<option value="none">{#media_dlg.preload_none}</option>
|
160 |
+
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
161 |
+
<option value="auto">{#media_dlg.preload_auto}</option>
|
162 |
+
</select>
|
163 |
+
</td>
|
164 |
+
</tr>
|
165 |
+
</table>
|
166 |
+
|
167 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
168 |
+
<tr>
|
169 |
+
<td>
|
170 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
171 |
+
<tr>
|
172 |
+
<td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>
|
173 |
+
<td><label for="video_autoplay">{#media_dlg.play}</label></td>
|
174 |
+
</tr>
|
175 |
+
</table>
|
176 |
+
</td>
|
177 |
+
|
178 |
+
<td>
|
179 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
180 |
+
<tr>
|
181 |
+
<td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>
|
182 |
+
<td><label for="video_muted">{#media_dlg.mute}</label></td>
|
183 |
+
</tr>
|
184 |
+
</table>
|
185 |
+
</td>
|
186 |
+
|
187 |
+
<td>
|
188 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
189 |
+
<tr>
|
190 |
+
<td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>
|
191 |
+
<td><label for="video_loop">{#media_dlg.loop}</label></td>
|
192 |
+
</tr>
|
193 |
+
</table>
|
194 |
+
</td>
|
195 |
+
|
196 |
+
<td>
|
197 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
198 |
+
<tr>
|
199 |
+
<td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
|
200 |
+
<td><label for="video_controls">{#media_dlg.controls}</label></td>
|
201 |
+
</tr>
|
202 |
+
</table>
|
203 |
+
</td>
|
204 |
+
</tr>
|
205 |
+
</table>
|
206 |
+
</fieldset>
|
207 |
+
|
208 |
+
<fieldset id="embeddedaudio_options">
|
209 |
+
<legend>{#media_dlg.embedded_audio_options}</legend>
|
210 |
+
|
211 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
212 |
+
<tr>
|
213 |
+
<td>
|
214 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
215 |
+
<tr>
|
216 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
217 |
+
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
218 |
+
</tr>
|
219 |
+
</table>
|
220 |
+
</td>
|
221 |
+
|
222 |
+
<td>
|
223 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
224 |
+
<tr>
|
225 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
226 |
+
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
227 |
+
</tr>
|
228 |
+
</table>
|
229 |
+
</td>
|
230 |
+
|
231 |
+
<td>
|
232 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
233 |
+
<tr>
|
234 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
235 |
+
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
236 |
+
</tr>
|
237 |
+
</table>
|
238 |
+
</td>
|
239 |
+
</tr>
|
240 |
+
</table>
|
241 |
+
</fieldset>
|
242 |
+
|
243 |
+
<fieldset id="audio_options">
|
244 |
+
<legend>{#media_dlg.html5_audio_options}</legend>
|
245 |
+
|
246 |
+
<table role="presentation">
|
247 |
+
<tr>
|
248 |
+
<td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>
|
249 |
+
<td>
|
250 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
251 |
+
<tr>
|
252 |
+
<td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
253 |
+
<td id="audio_altsource1_filebrowser"> </td>
|
254 |
+
</tr>
|
255 |
+
</table>
|
256 |
+
</td>
|
257 |
+
</tr>
|
258 |
+
|
259 |
+
<tr>
|
260 |
+
<td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>
|
261 |
+
<td>
|
262 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
263 |
+
<tr>
|
264 |
+
<td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
265 |
+
<td id="audio_altsource2_filebrowser"> </td>
|
266 |
+
</tr>
|
267 |
+
</table>
|
268 |
+
</td>
|
269 |
+
</tr>
|
270 |
+
|
271 |
+
<tr>
|
272 |
+
<td><label for="audio_preload">{#media_dlg.preload}</label></td>
|
273 |
+
<td>
|
274 |
+
<select id="audio_preload" name="audio_preload" onchange="Media.formToData();">
|
275 |
+
<option value="none">{#media_dlg.preload_none}</option>
|
276 |
+
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
277 |
+
<option value="auto">{#media_dlg.preload_auto}</option>
|
278 |
+
</select>
|
279 |
+
</td>
|
280 |
+
</tr>
|
281 |
+
</table>
|
282 |
+
|
283 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
284 |
+
<tr>
|
285 |
+
<td>
|
286 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
287 |
+
<tr>
|
288 |
+
<td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
289 |
+
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
290 |
+
</tr>
|
291 |
+
</table>
|
292 |
+
</td>
|
293 |
+
|
294 |
+
<td>
|
295 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
296 |
+
<tr>
|
297 |
+
<td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
298 |
+
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
299 |
+
</tr>
|
300 |
+
</table>
|
301 |
+
</td>
|
302 |
+
|
303 |
+
<td>
|
304 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
305 |
+
<tr>
|
306 |
+
<td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
307 |
+
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
308 |
+
</tr>
|
309 |
+
</table>
|
310 |
+
</td>
|
311 |
+
</tr>
|
312 |
+
</table>
|
313 |
+
</fieldset>
|
314 |
+
|
315 |
+
<fieldset id="flash_options">
|
316 |
+
<legend>{#media_dlg.flash_options}</legend>
|
317 |
+
|
318 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
319 |
+
<tr>
|
320 |
+
<td><label for="flash_quality">{#media_dlg.quality}</label></td>
|
321 |
+
<td>
|
322 |
+
<select id="flash_quality" name="flash_quality" onchange="Media.formToData();">
|
323 |
+
<option value="">{#not_set}</option>
|
324 |
+
<option value="high">high</option>
|
325 |
+
<option value="low">low</option>
|
326 |
+
<option value="autolow">autolow</option>
|
327 |
+
<option value="autohigh">autohigh</option>
|
328 |
+
<option value="best">best</option>
|
329 |
+
</select>
|
330 |
+
</td>
|
331 |
+
|
332 |
+
<td><label for="flash_scale">{#media_dlg.scale}</label></td>
|
333 |
+
<td>
|
334 |
+
<select id="flash_scale" name="flash_scale" onchange="Media.formToData();">
|
335 |
+
<option value="">{#not_set}</option>
|
336 |
+
<option value="showall">showall</option>
|
337 |
+
<option value="noborder">noborder</option>
|
338 |
+
<option value="exactfit">exactfit</option>
|
339 |
+
<option value="noscale">noscale</option>
|
340 |
+
</select>
|
341 |
+
</td>
|
342 |
+
</tr>
|
343 |
+
|
344 |
+
<tr>
|
345 |
+
<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
|
346 |
+
<td>
|
347 |
+
<select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">
|
348 |
+
<option value="">{#not_set}</option>
|
349 |
+
<option value="window">window</option>
|
350 |
+
<option value="opaque">opaque</option>
|
351 |
+
<option value="transparent">transparent</option>
|
352 |
+
</select>
|
353 |
+
</td>
|
354 |
+
|
355 |
+
<td><label for="flash_salign">{#media_dlg.salign}</label></td>
|
356 |
+
<td>
|
357 |
+
<select id="flash_salign" name="flash_salign" onchange="Media.formToData();">
|
358 |
+
<option value="">{#not_set}</option>
|
359 |
+
<option value="l">{#media_dlg.align_left}</option>
|
360 |
+
<option value="t">{#media_dlg.align_top}</option>
|
361 |
+
<option value="r">{#media_dlg.align_right}</option>
|
362 |
+
<option value="b">{#media_dlg.align_bottom}</option>
|
363 |
+
<option value="tl">{#media_dlg.align_top_left}</option>
|
364 |
+
<option value="tr">{#media_dlg.align_top_right}</option>
|
365 |
+
<option value="bl">{#media_dlg.align_bottom_left}</option>
|
366 |
+
<option value="br">{#media_dlg.align_bottom_right}</option>
|
367 |
+
</select>
|
368 |
+
</td>
|
369 |
+
</tr>
|
370 |
+
|
371 |
+
<tr>
|
372 |
+
<td colspan="2">
|
373 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
374 |
+
<tr>
|
375 |
+
<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>
|
376 |
+
<td><label for="flash_play">{#media_dlg.play}</label></td>
|
377 |
+
</tr>
|
378 |
+
</table>
|
379 |
+
</td>
|
380 |
+
|
381 |
+
<td colspan="2">
|
382 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
383 |
+
<tr>
|
384 |
+
<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>
|
385 |
+
<td><label for="flash_loop">{#media_dlg.loop}</label></td>
|
386 |
+
</tr>
|
387 |
+
</table>
|
388 |
+
</td>
|
389 |
+
</tr>
|
390 |
+
|
391 |
+
<tr>
|
392 |
+
<td colspan="2">
|
393 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
394 |
+
<tr>
|
395 |
+
<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>
|
396 |
+
<td><label for="flash_menu">{#media_dlg.menu}</label></td>
|
397 |
+
</tr>
|
398 |
+
</table>
|
399 |
+
</td>
|
400 |
+
|
401 |
+
<td colspan="2">
|
402 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
403 |
+
<tr>
|
404 |
+
<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>
|
405 |
+
<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
406 |
+
</tr>
|
407 |
+
</table>
|
408 |
+
</td>
|
409 |
+
</tr>
|
410 |
+
</table>
|
411 |
+
|
412 |
+
<table role="presentation">
|
413 |
+
<tr>
|
414 |
+
<td><label for="flash_base">{#media_dlg.base}</label></td>
|
415 |
+
<td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>
|
416 |
+
</tr>
|
417 |
+
|
418 |
+
<tr>
|
419 |
+
<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
|
420 |
+
<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>
|
421 |
+
</tr>
|
422 |
+
</table>
|
423 |
+
</fieldset>
|
424 |
+
|
425 |
+
<fieldset id="quicktime_options">
|
426 |
+
<legend>{#media_dlg.qt_options}</legend>
|
427 |
+
|
428 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
429 |
+
<tr>
|
430 |
+
<td colspan="2">
|
431 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
432 |
+
<tr>
|
433 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>
|
434 |
+
<td><label for="quicktime_loop">{#media_dlg.loop}</label></td>
|
435 |
+
</tr>
|
436 |
+
</table>
|
437 |
+
</td>
|
438 |
+
|
439 |
+
<td colspan="2">
|
440 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
441 |
+
<tr>
|
442 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>
|
443 |
+
<td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>
|
444 |
+
</tr>
|
445 |
+
</table>
|
446 |
+
</td>
|
447 |
+
</tr>
|
448 |
+
|
449 |
+
<tr>
|
450 |
+
<td colspan="2">
|
451 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
452 |
+
<tr>
|
453 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>
|
454 |
+
<td><label for="quicktime_cache">{#media_dlg.cache}</label></td>
|
455 |
+
</tr>
|
456 |
+
</table>
|
457 |
+
</td>
|
458 |
+
|
459 |
+
<td colspan="2">
|
460 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
461 |
+
<tr>
|
462 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>
|
463 |
+
<td><label for="quicktime_controller">{#media_dlg.controller}</label></td>
|
464 |
+
</tr>
|
465 |
+
</table>
|
466 |
+
</td>
|
467 |
+
</tr>
|
468 |
+
|
469 |
+
<tr>
|
470 |
+
<td colspan="2">
|
471 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
472 |
+
<tr>
|
473 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>
|
474 |
+
<td><label for="quicktime_correction">{#media_dlg.correction}</label></td>
|
475 |
+
</tr>
|
476 |
+
</table>
|
477 |
+
</td>
|
478 |
+
|
479 |
+
<td colspan="2">
|
480 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
481 |
+
<tr>
|
482 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>
|
483 |
+
<td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>
|
484 |
+
</tr>
|
485 |
+
</table>
|
486 |
+
</td>
|
487 |
+
</tr>
|
488 |
+
|
489 |
+
<tr>
|
490 |
+
<td colspan="2">
|
491 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
492 |
+
<tr>
|
493 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>
|
494 |
+
<td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>
|
495 |
+
</tr>
|
496 |
+
</table>
|
497 |
+
</td>
|
498 |
+
|
499 |
+
<td colspan="2">
|
500 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
501 |
+
<tr>
|
502 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>
|
503 |
+
<td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>
|
504 |
+
</tr>
|
505 |
+
</table>
|
506 |
+
</td>
|
507 |
+
</tr>
|
508 |
+
|
509 |
+
<tr>
|
510 |
+
<td colspan="2">
|
511 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
512 |
+
<tr>
|
513 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>
|
514 |
+
<td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>
|
515 |
+
</tr>
|
516 |
+
</table>
|
517 |
+
</td>
|
518 |
+
|
519 |
+
<td colspan="2">
|
520 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
521 |
+
<tr>
|
522 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>
|
523 |
+
<td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>
|
524 |
+
</tr>
|
525 |
+
</table>
|
526 |
+
</td>
|
527 |
+
</tr>
|
528 |
+
|
529 |
+
<tr>
|
530 |
+
<td><label for="quicktime_scale">{#media_dlg.scale}</label></td>
|
531 |
+
<td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">
|
532 |
+
<option value="">{#not_set}</option>
|
533 |
+
<option value="tofit">tofit</option>
|
534 |
+
<option value="aspect">aspect</option>
|
535 |
+
</select>
|
536 |
+
</td>
|
537 |
+
|
538 |
+
<td colspan="2"> </td>
|
539 |
+
</tr>
|
540 |
+
|
541 |
+
<tr>
|
542 |
+
<td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>
|
543 |
+
<td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>
|
544 |
+
|
545 |
+
<td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>
|
546 |
+
<td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>
|
547 |
+
</tr>
|
548 |
+
|
549 |
+
<tr>
|
550 |
+
<td><label for="quicktime_target">{#media_dlg.target}</label></td>
|
551 |
+
<td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>
|
552 |
+
|
553 |
+
<td><label for="quicktime_href">{#media_dlg.href}</label></td>
|
554 |
+
<td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>
|
555 |
+
</tr>
|
556 |
+
|
557 |
+
<tr>
|
558 |
+
<td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
|
559 |
+
<td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>
|
560 |
+
|
561 |
+
<td><label for="quicktime_volume">{#media_dlg.volume}</label></td>
|
562 |
+
<td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>
|
563 |
+
</tr>
|
564 |
+
|
565 |
+
<tr>
|
566 |
+
<td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>
|
567 |
+
<td colspan="4">
|
568 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
569 |
+
<tr>
|
570 |
+
<td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>
|
571 |
+
<td id="qtsrcfilebrowsercontainer"> </td>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</td>
|
575 |
+
</tr>
|
576 |
+
</table>
|
577 |
+
</fieldset>
|
578 |
+
|
579 |
+
<fieldset id="windowsmedia_options">
|
580 |
+
<legend>{#media_dlg.wmp_options}</legend>
|
581 |
+
|
582 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
583 |
+
<tr>
|
584 |
+
<td colspan="2">
|
585 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
586 |
+
<tr>
|
587 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>
|
588 |
+
<td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>
|
589 |
+
</tr>
|
590 |
+
</table>
|
591 |
+
</td>
|
592 |
+
|
593 |
+
<td colspan="2">
|
594 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
595 |
+
<tr>
|
596 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>
|
597 |
+
<td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>
|
598 |
+
</tr>
|
599 |
+
</table>
|
600 |
+
</td>
|
601 |
+
</tr>
|
602 |
+
|
603 |
+
<tr>
|
604 |
+
<td colspan="2">
|
605 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
606 |
+
<tr>
|
607 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>
|
608 |
+
<td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>
|
609 |
+
</tr>
|
610 |
+
</table>
|
611 |
+
</td>
|
612 |
+
|
613 |
+
<td colspan="2">
|
614 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
615 |
+
<tr>
|
616 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>
|
617 |
+
<td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>
|
618 |
+
</tr>
|
619 |
+
</table>
|
620 |
+
</td>
|
621 |
+
</tr>
|
622 |
+
|
623 |
+
<tr>
|
624 |
+
<td colspan="2">
|
625 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
626 |
+
<tr>
|
627 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>
|
628 |
+
<td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>
|
629 |
+
</tr>
|
630 |
+
</table>
|
631 |
+
</td>
|
632 |
+
|
633 |
+
<td colspan="2">
|
634 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
635 |
+
<tr>
|
636 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>
|
637 |
+
<td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>
|
638 |
+
</tr>
|
639 |
+
</table>
|
640 |
+
</td>
|
641 |
+
</tr>
|
642 |
+
|
643 |
+
<tr>
|
644 |
+
<td colspan="2">
|
645 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
646 |
+
<tr>
|
647 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>
|
648 |
+
<td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>
|
649 |
+
</tr>
|
650 |
+
</table>
|
651 |
+
</td>
|
652 |
+
|
653 |
+
<td colspan="2">
|
654 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
655 |
+
<tr>
|
656 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>
|
657 |
+
<td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
|
658 |
+
</tr>
|
659 |
+
</table>
|
660 |
+
</td>
|
661 |
+
</tr>
|
662 |
+
|
663 |
+
<tr>
|
664 |
+
<td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>
|
665 |
+
<td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>
|
666 |
+
|
667 |
+
<td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>
|
668 |
+
<td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>
|
669 |
+
</tr>
|
670 |
+
|
671 |
+
<tr>
|
672 |
+
<td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>
|
673 |
+
<td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>
|
674 |
+
|
675 |
+
<td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>
|
676 |
+
<td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>
|
677 |
+
</tr>
|
678 |
+
|
679 |
+
<tr>
|
680 |
+
<td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>
|
681 |
+
<td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>
|
682 |
+
|
683 |
+
<td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>
|
684 |
+
<td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>
|
685 |
+
</tr>
|
686 |
+
|
687 |
+
<tr>
|
688 |
+
<td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>
|
689 |
+
<td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>
|
690 |
+
|
691 |
+
<td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>
|
692 |
+
<td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>
|
693 |
+
</tr>
|
694 |
+
|
695 |
+
<tr>
|
696 |
+
<td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>
|
697 |
+
<td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>
|
698 |
+
|
699 |
+
<td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>
|
700 |
+
<td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>
|
701 |
+
</tr>
|
702 |
+
|
703 |
+
</table>
|
704 |
+
</fieldset>
|
705 |
+
|
706 |
+
<fieldset id="realmedia_options">
|
707 |
+
<legend>{#media_dlg.rmp_options}</legend>
|
708 |
+
|
709 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
710 |
+
<tr>
|
711 |
+
<td colspan="2">
|
712 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
713 |
+
<tr>
|
714 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>
|
715 |
+
<td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>
|
716 |
+
</tr>
|
717 |
+
</table>
|
718 |
+
</td>
|
719 |
+
|
720 |
+
<td colspan="2">
|
721 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
722 |
+
<tr>
|
723 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>
|
724 |
+
<td><label for="realmedia_loop">{#media_dlg.loop}</label></td>
|
725 |
+
</tr>
|
726 |
+
</table>
|
727 |
+
</td>
|
728 |
+
</tr>
|
729 |
+
|
730 |
+
<tr>
|
731 |
+
<td colspan="2">
|
732 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
733 |
+
<tr>
|
734 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>
|
735 |
+
<td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>
|
736 |
+
</tr>
|
737 |
+
</table>
|
738 |
+
</td>
|
739 |
+
|
740 |
+
<td colspan="2">
|
741 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
742 |
+
<tr>
|
743 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>
|
744 |
+
<td><label for="realmedia_center">{#media_dlg.center}</label></td>
|
745 |
+
</tr>
|
746 |
+
</table>
|
747 |
+
</td>
|
748 |
+
</tr>
|
749 |
+
|
750 |
+
<tr>
|
751 |
+
<td colspan="2">
|
752 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
753 |
+
<tr>
|
754 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>
|
755 |
+
<td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>
|
756 |
+
</tr>
|
757 |
+
</table>
|
758 |
+
</td>
|
759 |
+
|
760 |
+
<td colspan="2">
|
761 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
762 |
+
<tr>
|
763 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>
|
764 |
+
<td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>
|
765 |
+
</tr>
|
766 |
+
</table>
|
767 |
+
</td>
|
768 |
+
</tr>
|
769 |
+
|
770 |
+
<tr>
|
771 |
+
<td colspan="2">
|
772 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
773 |
+
<tr>
|
774 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>
|
775 |
+
<td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>
|
776 |
+
</tr>
|
777 |
+
</table>
|
778 |
+
</td>
|
779 |
+
|
780 |
+
<td colspan="2">
|
781 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
782 |
+
<tr>
|
783 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>
|
784 |
+
<td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>
|
785 |
+
</tr>
|
786 |
+
</table>
|
787 |
+
</td>
|
788 |
+
</tr>
|
789 |
+
|
790 |
+
<tr>
|
791 |
+
<td colspan="2">
|
792 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
793 |
+
<tr>
|
794 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>
|
795 |
+
<td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>
|
796 |
+
</tr>
|
797 |
+
</table>
|
798 |
+
</td>
|
799 |
+
|
800 |
+
<td colspan="2">
|
801 |
+
|
802 |
+
</td>
|
803 |
+
</tr>
|
804 |
+
|
805 |
+
<tr>
|
806 |
+
<td><label for="realmedia_console">{#media_dlg.console}</label></td>
|
807 |
+
<td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>
|
808 |
+
|
809 |
+
<td><label for="realmedia_controls">{#media_dlg.controls}</label></td>
|
810 |
+
<td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>
|
811 |
+
</tr>
|
812 |
+
|
813 |
+
<tr>
|
814 |
+
<td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>
|
815 |
+
<td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>
|
816 |
+
|
817 |
+
<td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
|
818 |
+
<td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>
|
819 |
+
</tr>
|
820 |
+
</table>
|
821 |
+
</fieldset>
|
822 |
+
|
823 |
+
<fieldset id="shockwave_options">
|
824 |
+
<legend>{#media_dlg.shockwave_options}</legend>
|
825 |
+
|
826 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
827 |
+
<tr>
|
828 |
+
<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
|
829 |
+
<td>
|
830 |
+
<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">
|
831 |
+
<option value="none">{#not_set}</option>
|
832 |
+
<option value="meet">Meet</option>
|
833 |
+
<option value="fill">Fill</option>
|
834 |
+
<option value="stage">Stage</option>
|
835 |
+
</select>
|
836 |
+
</td>
|
837 |
+
|
838 |
+
<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
|
839 |
+
<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>
|
840 |
+
</tr>
|
841 |
+
|
842 |
+
<tr>
|
843 |
+
<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
|
844 |
+
<td>
|
845 |
+
<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">
|
846 |
+
<option value="none">{#not_set}</option>
|
847 |
+
<option value="left">{#media_dlg.align_left}</option>
|
848 |
+
<option value="center">{#media_dlg.align_center}</option>
|
849 |
+
<option value="right">{#media_dlg.align_right}</option>
|
850 |
+
</select>
|
851 |
+
</td>
|
852 |
+
|
853 |
+
<td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
|
854 |
+
<td>
|
855 |
+
<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">
|
856 |
+
<option value="none">{#not_set}</option>
|
857 |
+
<option value="meet">Meet</option>
|
858 |
+
<option value="fill">Fill</option>
|
859 |
+
<option value="stage">Stage</option>
|
860 |
+
</select>
|
861 |
+
</td>
|
862 |
+
</tr>
|
863 |
+
|
864 |
+
<tr>
|
865 |
+
<td colspan="2">
|
866 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
867 |
+
<tr>
|
868 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>
|
869 |
+
<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
|
870 |
+
</tr>
|
871 |
+
</table>
|
872 |
+
</td>
|
873 |
+
|
874 |
+
<td colspan="2">
|
875 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
876 |
+
<tr>
|
877 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>
|
878 |
+
<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
|
879 |
+
</tr>
|
880 |
+
</table>
|
881 |
+
</td>
|
882 |
+
</tr>
|
883 |
+
|
884 |
+
|
885 |
+
<tr>
|
886 |
+
<td colspan="2">
|
887 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
888 |
+
<tr>
|
889 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>
|
890 |
+
<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
891 |
+
</tr>
|
892 |
+
</table>
|
893 |
+
</td>
|
894 |
+
|
895 |
+
<td colspan="2">
|
896 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
897 |
+
<tr>
|
898 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>
|
899 |
+
<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
|
900 |
+
</tr>
|
901 |
+
</table>
|
902 |
+
</td>
|
903 |
+
</tr>
|
904 |
+
</table>
|
905 |
+
</fieldset>
|
906 |
+
</div>
|
907 |
+
|
908 |
+
<div id="source_panel" class="panel">
|
909 |
+
<fieldset>
|
910 |
+
<legend>{#media_dlg.source}</legend>
|
911 |
+
<textarea id="source" style="width: 99%; height: 390px"></textarea>
|
912 |
+
</fieldset>
|
913 |
+
</div>
|
914 |
+
</div>
|
915 |
+
|
916 |
+
<div class="mceActionPanel">
|
917 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
918 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
919 |
+
</div>
|
920 |
+
</form>
|
921 |
+
</body>
|
922 |
+
</html>
|
addons/media/moxieplayer.swf
ADDED
Binary file
|
addons/nonbreaking/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111161000000000" remote="130111161000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111159200000000" remote="130111159200000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/nonbreaking/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>':" ")});a.addButton("nonbreaking",{title:a.getLang("nonbreaking.nonbreaking_desc"),cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();
|
addons/nonbreaking/editor_plugin_src.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Nonbreaking', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
// Register commands
|
19 |
+
ed.addCommand('mceNonBreaking', function() {
|
20 |
+
ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');
|
21 |
+
});
|
22 |
+
|
23 |
+
// Register buttons
|
24 |
+
ed.addButton('nonbreaking', {title : ed.getLang('nonbreaking.nonbreaking_desc'), cmd : 'mceNonBreaking'});
|
25 |
+
|
26 |
+
if (ed.getParam('nonbreaking_force_tab')) {
|
27 |
+
ed.onKeyDown.add(function(ed, e) {
|
28 |
+
if (e.keyCode == 9) {
|
29 |
+
e.preventDefault();
|
30 |
+
|
31 |
+
ed.execCommand('mceNonBreaking');
|
32 |
+
ed.execCommand('mceNonBreaking');
|
33 |
+
ed.execCommand('mceNonBreaking');
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
37 |
+
},
|
38 |
+
|
39 |
+
getInfo : function() {
|
40 |
+
return {
|
41 |
+
longname : 'Nonbreaking space',
|
42 |
+
author : 'Moxiecode Systems AB',
|
43 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
44 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
|
45 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
46 |
+
};
|
47 |
+
}
|
48 |
+
|
49 |
+
// Private methods
|
50 |
+
});
|
51 |
+
|
52 |
+
// Register plugin
|
53 |
+
tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
|
54 |
+
})();
|
addons/preview/_notes/dwsync.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111165800000000" remote="130111165800000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111165800000000" remote="130111165800000000" Dst="2" />
|
5 |
+
<file name="example.html" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
<file name="preview.html" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
</dwsync>
|
addons/preview/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:a.getLang('preview.preview_desc'),cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})();
|
addons/preview/editor_plugin_src.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Preview', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this, css = tinymce.explode(ed.settings.content_css);
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
// Force absolute CSS urls
|
19 |
+
tinymce.each(css, function(u, k) {
|
20 |
+
css[k] = ed.documentBaseURI.toAbsolute(u);
|
21 |
+
});
|
22 |
+
|
23 |
+
ed.addCommand('mcePreview', function() {
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
|
26 |
+
width : parseInt(ed.getParam("plugin_preview_width", "550")),
|
27 |
+
height : parseInt(ed.getParam("plugin_preview_height", "600")),
|
28 |
+
resizable : "yes",
|
29 |
+
scrollbars : "yes",
|
30 |
+
popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
|
31 |
+
inline : ed.getParam("plugin_preview_inline", 1)
|
32 |
+
}, {
|
33 |
+
base : ed.documentBaseURI.getURI()
|
34 |
+
});
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.addButton('preview', {title : ed.getLang('preview.preview_desc'), cmd : 'mcePreview'});
|
38 |
+
},
|
39 |
+
|
40 |
+
getInfo : function() {
|
41 |
+
return {
|
42 |
+
longname : 'Preview',
|
43 |
+
author : 'Moxiecode Systems AB',
|
44 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
|
46 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
+
};
|
48 |
+
}
|
49 |
+
});
|
50 |
+
|
51 |
+
// Register plugin
|
52 |
+
tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
|
53 |
+
})();
|
addons/preview/example.html
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<script language="javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
4 |
+
<script type="text/javascript" src="jscripts/embed.js"></script>
|
5 |
+
<script type="text/javascript">
|
6 |
+
tinyMCEPopup.onInit.add(function(ed) {
|
7 |
+
var dom = tinyMCEPopup.dom;
|
8 |
+
|
9 |
+
// Load editor content_css
|
10 |
+
tinymce.each(ed.settings.content_css.split(','), function(u) {
|
11 |
+
dom.loadCSS(ed.documentBaseURI.toAbsolute(u));
|
12 |
+
});
|
13 |
+
|
14 |
+
// Place contents inside div container
|
15 |
+
dom.setHTML('content', ed.getContent());
|
16 |
+
});
|
17 |
+
</script>
|
18 |
+
<title>Example of a custom preview page</title>
|
19 |
+
</head>
|
20 |
+
<body>
|
21 |
+
|
22 |
+
Editor contents: <br />
|
23 |
+
<div id="content">
|
24 |
+
<!-- Gets filled with editor contents -->
|
25 |
+
</div>
|
26 |
+
|
27 |
+
</body>
|
28 |
+
</html>
|
addons/preview/jscripts/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="embed.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/preview/jscripts/embed.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
|
3 |
+
*/
|
4 |
+
|
5 |
+
function writeFlash(p) {
|
6 |
+
writeEmbed(
|
7 |
+
'D27CDB6E-AE6D-11cf-96B8-444553540000',
|
8 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
9 |
+
'application/x-shockwave-flash',
|
10 |
+
p
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
function writeShockWave(p) {
|
15 |
+
writeEmbed(
|
16 |
+
'166B1BCA-3F9C-11CF-8075-444553540000',
|
17 |
+
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
|
18 |
+
'application/x-director',
|
19 |
+
p
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
function writeQuickTime(p) {
|
24 |
+
writeEmbed(
|
25 |
+
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
26 |
+
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
27 |
+
'video/quicktime',
|
28 |
+
p
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
function writeRealMedia(p) {
|
33 |
+
writeEmbed(
|
34 |
+
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
|
35 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
36 |
+
'audio/x-pn-realaudio-plugin',
|
37 |
+
p
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
function writeWindowsMedia(p) {
|
42 |
+
p.url = p.src;
|
43 |
+
writeEmbed(
|
44 |
+
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
|
45 |
+
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
|
46 |
+
'application/x-mplayer2',
|
47 |
+
p
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
function writeEmbed(cls, cb, mt, p) {
|
52 |
+
var h = '', n;
|
53 |
+
|
54 |
+
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
|
55 |
+
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
|
56 |
+
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
|
57 |
+
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
|
58 |
+
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
|
59 |
+
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
|
60 |
+
h += '>';
|
61 |
+
|
62 |
+
for (n in p)
|
63 |
+
h += '<param name="' + n + '" value="' + p[n] + '">';
|
64 |
+
|
65 |
+
h += '<embed type="' + mt + '"';
|
66 |
+
|
67 |
+
for (n in p)
|
68 |
+
h += n + '="' + p[n] + '" ';
|
69 |
+
|
70 |
+
h += '></embed></object>';
|
71 |
+
|
72 |
+
document.write(h);
|
73 |
+
}
|
addons/preview/preview.html
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
5 |
+
<script type="text/javascript" src="jscripts/embed.js"></script>
|
6 |
+
<script type="text/javascript"><!--
|
7 |
+
document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');
|
8 |
+
// -->
|
9 |
+
</script>
|
10 |
+
<title>{#preview.preview_desc}</title>
|
11 |
+
</head>
|
12 |
+
<body id="content">
|
13 |
+
<script type="text/javascript">
|
14 |
+
document.write(tinyMCEPopup.editor.getContent());
|
15 |
+
</script>
|
16 |
+
</body>
|
17 |
+
</html>
|
addons/print/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111167600000000" remote="130111167600000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111167600000000" remote="130111167600000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/print/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:a.getLang("print.print_desc"),cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();
|
addons/print/editor_plugin_src.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Print', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
ed.addCommand('mcePrint', function() {
|
15 |
+
ed.getWin().print();
|
16 |
+
});
|
17 |
+
|
18 |
+
ed.addButton('print', {title : ed.getLang('print.print_desc'), cmd : 'mcePrint'});
|
19 |
+
},
|
20 |
+
|
21 |
+
getInfo : function() {
|
22 |
+
return {
|
23 |
+
longname : 'Print',
|
24 |
+
author : 'Moxiecode Systems AB',
|
25 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
26 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
|
27 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
28 |
+
};
|
29 |
+
}
|
30 |
+
});
|
31 |
+
|
32 |
+
// Register plugin
|
33 |
+
tinymce.PluginManager.add('print', tinymce.plugins.Print);
|
34 |
+
})();
|
addons/ptags/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186904222948227" remote="130186867800000000" Dst="2" />
|
4 |
+
<file name="ptags.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="ptags.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/ptags/editor_plugin.js
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Ptags Button plug-in for TinyMCE version 3.x
|
3 |
+
* @author Josh Lobe
|
4 |
+
* @version 1.0
|
5 |
+
* @package Ptags Button
|
6 |
+
* @link http://www.joshlobe.com/
|
7 |
+
* Ptags Button plugin for TinyMCE
|
8 |
+
*/
|
9 |
+
(function(){
|
10 |
+
|
11 |
+
//tinymce.PluginManager.requireLangPack('ptags');
|
12 |
+
|
13 |
+
tinymce.create('tinymce.plugins.ptags', {
|
14 |
+
|
15 |
+
init : function(ed, url){
|
16 |
+
ed.addCommand('jwlPtagsButton', function(){
|
17 |
+
|
18 |
+
ed.windowManager.open({
|
19 |
+
file : url + '/ptags.htm',
|
20 |
+
width : 400,
|
21 |
+
height : 300,
|
22 |
+
inline : 1
|
23 |
+
}, {
|
24 |
+
plugin_url : url, // Plugin absolute URL
|
25 |
+
some_custom_arg : 'custom arg' // Custom argument
|
26 |
+
});
|
27 |
+
|
28 |
+
ptags_sel_content = tinyMCE.activeEditor.selection.getContent();
|
29 |
+
//tinyMCE.activeEditor.selection.setContent('<p class="none">' + ptags_sel_content + '</p>');
|
30 |
+
});
|
31 |
+
ed.addButton('ptags', {
|
32 |
+
title: ed.getLang('ptags.title'),
|
33 |
+
//image: url + '/ptags.png',
|
34 |
+
cmd: 'jwlPtagsButton'
|
35 |
+
});
|
36 |
+
ed.addShortcut('alt+ctrl+p', ed.getLang('ptags.php'), 'jwlPtagsButton');
|
37 |
+
},
|
38 |
+
createControl : function(n, cm){
|
39 |
+
return null;
|
40 |
+
},
|
41 |
+
getInfo : function(){
|
42 |
+
return {
|
43 |
+
longname: 'Tinymce Ptags Button',
|
44 |
+
author: 'Josh Lobe',
|
45 |
+
authorurl: 'http://joshlobe.com/',
|
46 |
+
infourl: 'http://joshlobe.com/',
|
47 |
+
version: "1.0"
|
48 |
+
};
|
49 |
+
}
|
50 |
+
});
|
51 |
+
tinymce.PluginManager.add('ptags', tinymce.plugins.ptags);
|
52 |
+
})();
|
53 |
+
|
54 |
+
|
55 |
+
|
addons/ptags/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="dialog.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/ptags/js/dialog.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var ptagsDialog = {
|
4 |
+
|
5 |
+
insert : function(file, title) {
|
6 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
7 |
+
|
8 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, '');
|
9 |
+
|
10 |
+
tinyMCEPopup.close();
|
11 |
+
}
|
12 |
+
};
|
13 |
+
|
14 |
+
tinyMCEPopup.onInit.add(ptagsDialog.init, ptagsDialog);
|
addons/ptags/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/ptags/langs/en.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n("en.ptags",{
|
2 |
+
title : "Wrap selection with Paragraph tags"
|
3 |
+
|
4 |
+
});
|
addons/ptags/langs/en_dlg.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.ptags_dlg',{
|
2 |
+
|
3 |
+
titleP : "Insert P Tag",
|
4 |
+
noteP : 'You have selected the <strong>p</strong> tag. Your tag may be refined using the options below.<br /><br />Click "Insert" to insert selection.<br /><br /><br />',
|
5 |
+
jwlid : "Enter ID for p tag",
|
6 |
+
jwlclass : "Enter CLASSES for p tag",
|
7 |
+
jwlstyle : "Enter Style Attributes",
|
8 |
+
noteP2 : "(Optional)"
|
9 |
+
|
10 |
+
});
|
addons/ptags/ptags.htm
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php ob_start(); ?>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#ptags_dlg.titleP}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/dialog.js"></script>
|
7 |
+
<link rel="stylesheet" type="text/css" href="css/tagwrap.css" />
|
8 |
+
</head>
|
9 |
+
|
10 |
+
<body>
|
11 |
+
|
12 |
+
<div class="y_logo_contener">
|
13 |
+
</div>
|
14 |
+
<div class="yinstr">
|
15 |
+
<p>{#ptags_dlg.noteP}</p>
|
16 |
+
</div>
|
17 |
+
<form onSubmit="ptags.insert();return false;" action="#" method="post" name="P_tag">
|
18 |
+
<div class="mceActionPanel">
|
19 |
+
<script type="text/javascript" language="javascript">
|
20 |
+
var jwl2_sel_content4 = tinyMCE.activeEditor.selection.getContent();
|
21 |
+
</script>
|
22 |
+
|
23 |
+
{#ptags_dlg.jwlid}<br>
|
24 |
+
<input id="id_value" type="text" name="id" width="200px" value="" /> <em> {#ptags_dlg.noteP2}</em><br><br>
|
25 |
+
{#ptags_dlg.jwlclass}<br>
|
26 |
+
<input id="classes_value" type="text" name="class" width="200px" value="" /> <em> {#ptags_dlg.noteP2}</em><br><br>
|
27 |
+
{#ptags_dlg.jwlstyle}<br>
|
28 |
+
<input id="styles_value" type="text" name="style" width="200px" value="" /> <em> {#ptags_dlg.noteP2}</em>
|
29 |
+
<br /><br />
|
30 |
+
</div>
|
31 |
+
<div class="bottom">
|
32 |
+
<p><!--{#tagwrap_dlg.bottomnote}--></p>
|
33 |
+
<p class="pagelink_hover"><!--{#tagwrap_dlg.bottomnote2}--></p>
|
34 |
+
</div>
|
35 |
+
<script type="text/javascript" language="javascript">
|
36 |
+
function jwl2_pass_form_data () {
|
37 |
+
var name = jwl_id = document.getElementsByName("id")[0].value;
|
38 |
+
var name = jwl_class = document.getElementsByName("class")[0].value;
|
39 |
+
var name = jwl_style = document.getElementsByName("style")[0].value;
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
</script>
|
44 |
+
<div class="mceActionPanel">
|
45 |
+
<div style="float:left;padding-top:5px">
|
46 |
+
<input type="button" id="insert" name="insert" value="{#insert}" onClick="jwl2_pass_form_data();tinyMCE.execCommand('mceInsertContent',false,'<p id=\'' + jwl_id + '\' class=\'none ' + jwl_class + '\' style=\'' + jwl_style + '\'>' + jwl2_sel_content4 + '</p>');tinyMCEPopup.close();" /> <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</form>
|
50 |
+
</body>
|
addons/ptags/ptags.png
ADDED
Binary file
|
addons/searchreplace/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111176000000000" remote="130111176000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111175400000000" remote="130111175400000000" Dst="2" />
|
5 |
+
<file name="searchreplace.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/searchreplace/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="searchreplace.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/searchreplace/css/searchreplace.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.panel_wrapper {height:85px;}
|
2 |
+
.panel_wrapper div.current {height:85px;}
|
3 |
+
|
4 |
+
/* IE */
|
5 |
+
* html .panel_wrapper {height:100px;}
|
6 |
+
* html .panel_wrapper div.current {height:100px;}
|
addons/searchreplace/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:a.getLang("searchreplace.search_desc"),cmd:"mceSearch"});a.addButton("replace",{title:a.getLang("searchreplace.replace_desc"),cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();
|
addons/searchreplace/editor_plugin_src.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.SearchReplacePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
function open(m) {
|
15 |
+
// Keep IE from writing out the f/r character to the editor
|
16 |
+
// instance while initializing a new dialog. See: #3131190
|
17 |
+
window.focus();
|
18 |
+
|
19 |
+
ed.windowManager.open({
|
20 |
+
file : url + '/searchreplace.htm',
|
21 |
+
width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
|
22 |
+
height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
|
23 |
+
inline : 1,
|
24 |
+
auto_focus : 0
|
25 |
+
}, {
|
26 |
+
mode : m,
|
27 |
+
search_string : ed.selection.getContent({format : 'text'}),
|
28 |
+
plugin_url : url
|
29 |
+
});
|
30 |
+
};
|
31 |
+
|
32 |
+
// Register commands
|
33 |
+
ed.addCommand('mceSearch', function() {
|
34 |
+
open('search');
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.addCommand('mceReplace', function() {
|
38 |
+
open('replace');
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register buttons
|
42 |
+
ed.addButton('search', {title : ed.getLang('searchreplace.search_desc'), cmd : 'mceSearch'});
|
43 |
+
ed.addButton('replace', {title : ed.getLang('searchreplace.replace_desc'), cmd : 'mceReplace'});
|
44 |
+
|
45 |
+
ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
|
46 |
+
},
|
47 |
+
|
48 |
+
getInfo : function() {
|
49 |
+
return {
|
50 |
+
longname : 'Search/Replace',
|
51 |
+
author : 'Moxiecode Systems AB',
|
52 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
53 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
|
54 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
55 |
+
};
|
56 |
+
}
|
57 |
+
});
|
58 |
+
|
59 |
+
// Register plugin
|
60 |
+
tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
|
61 |
+
})();
|
addons/searchreplace/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="searchreplace.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111176600000000" remote="130111176600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/searchreplace/js/searchreplace.js
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var SearchReplaceDialog = {
|
4 |
+
init : function(ed) {
|
5 |
+
var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
|
6 |
+
|
7 |
+
t.switchMode(m);
|
8 |
+
|
9 |
+
f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
|
10 |
+
|
11 |
+
// Focus input field
|
12 |
+
f[m + '_panel_searchstring'].focus();
|
13 |
+
|
14 |
+
mcTabs.onChange.add(function(tab_id, panel_id) {
|
15 |
+
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
|
16 |
+
});
|
17 |
+
},
|
18 |
+
|
19 |
+
switchMode : function(m) {
|
20 |
+
var f, lm = this.lastMode;
|
21 |
+
|
22 |
+
if (lm != m) {
|
23 |
+
f = document.forms[0];
|
24 |
+
|
25 |
+
if (lm) {
|
26 |
+
f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
|
27 |
+
f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
|
28 |
+
f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
|
29 |
+
f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
|
30 |
+
}
|
31 |
+
|
32 |
+
mcTabs.displayTab(m + '_tab', m + '_panel');
|
33 |
+
document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
|
34 |
+
document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
|
35 |
+
this.lastMode = m;
|
36 |
+
}
|
37 |
+
},
|
38 |
+
|
39 |
+
searchNext : function(a) {
|
40 |
+
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
|
41 |
+
|
42 |
+
// Get input
|
43 |
+
f = document.forms[0];
|
44 |
+
s = f[m + '_panel_searchstring'].value;
|
45 |
+
b = f[m + '_panel_backwardsu'].checked;
|
46 |
+
ca = f[m + '_panel_casesensitivebox'].checked;
|
47 |
+
rs = f['replace_panel_replacestring'].value;
|
48 |
+
|
49 |
+
if (tinymce.isIE) {
|
50 |
+
r = ed.getDoc().selection.createRange();
|
51 |
+
}
|
52 |
+
|
53 |
+
if (s == '')
|
54 |
+
return;
|
55 |
+
|
56 |
+
function fix() {
|
57 |
+
// Correct Firefox graphics glitches
|
58 |
+
// TODO: Verify if this is actually needed any more, maybe it was for very old FF versions?
|
59 |
+
r = se.getRng().cloneRange();
|
60 |
+
ed.getDoc().execCommand('SelectAll', false, null);
|
61 |
+
se.setRng(r);
|
62 |
+
};
|
63 |
+
|
64 |
+
function replace() {
|
65 |
+
ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE
|
66 |
+
};
|
67 |
+
|
68 |
+
// IE flags
|
69 |
+
if (ca)
|
70 |
+
fl = fl | 4;
|
71 |
+
|
72 |
+
switch (a) {
|
73 |
+
case 'all':
|
74 |
+
// Move caret to beginning of text
|
75 |
+
ed.execCommand('SelectAll');
|
76 |
+
ed.selection.collapse(true);
|
77 |
+
|
78 |
+
if (tinymce.isIE) {
|
79 |
+
ed.focus();
|
80 |
+
r = ed.getDoc().selection.createRange();
|
81 |
+
|
82 |
+
while (r.findText(s, b ? -1 : 1, fl)) {
|
83 |
+
r.scrollIntoView();
|
84 |
+
r.select();
|
85 |
+
replace();
|
86 |
+
fo = 1;
|
87 |
+
|
88 |
+
if (b) {
|
89 |
+
r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
tinyMCEPopup.storeSelection();
|
94 |
+
} else {
|
95 |
+
while (w.find(s, ca, b, false, false, false, false)) {
|
96 |
+
replace();
|
97 |
+
fo = 1;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
if (fo)
|
102 |
+
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
|
103 |
+
else
|
104 |
+
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
105 |
+
|
106 |
+
return;
|
107 |
+
|
108 |
+
case 'current':
|
109 |
+
if (!ed.selection.isCollapsed())
|
110 |
+
replace();
|
111 |
+
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
|
115 |
+
se.collapse(b);
|
116 |
+
r = se.getRng();
|
117 |
+
|
118 |
+
// Whats the point
|
119 |
+
if (!s)
|
120 |
+
return;
|
121 |
+
|
122 |
+
if (tinymce.isIE) {
|
123 |
+
ed.focus();
|
124 |
+
r = ed.getDoc().selection.createRange();
|
125 |
+
|
126 |
+
if (r.findText(s, b ? -1 : 1, fl)) {
|
127 |
+
r.scrollIntoView();
|
128 |
+
r.select();
|
129 |
+
} else
|
130 |
+
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
131 |
+
|
132 |
+
tinyMCEPopup.storeSelection();
|
133 |
+
} else {
|
134 |
+
if (!w.find(s, ca, b, false, false, false, false))
|
135 |
+
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
136 |
+
else
|
137 |
+
fix();
|
138 |
+
}
|
139 |
+
}
|
140 |
+
};
|
141 |
+
|
142 |
+
tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
|
addons/searchreplace/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/searchreplace/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"});
|
addons/searchreplace/searchreplace.htm
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#searchreplace_dlg.replace_title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="js/searchreplace.js"></script>
|
9 |
+
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
|
10 |
+
</head>
|
11 |
+
<body style="display:none;" role="application" aria-labelledby="app_title">
|
12 |
+
<span id="app_title" style="display:none">{#searchreplace_dlg.replace_title}</span>
|
13 |
+
<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
|
14 |
+
<div class="tabs">
|
15 |
+
<ul>
|
16 |
+
<li id="search_tab" aria-controls="search_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
|
17 |
+
<li id="replace_tab" aria-controls="replace_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
|
18 |
+
</ul>
|
19 |
+
</div>
|
20 |
+
|
21 |
+
<div class="panel_wrapper">
|
22 |
+
<div id="search_panel" class="panel">
|
23 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="2">
|
24 |
+
<tr>
|
25 |
+
<td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
|
26 |
+
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" aria-required="true" /></td>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<td colspan="2">
|
30 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">
|
31 |
+
<tr role="group" aria-labelledby="search_panel_backwards_label">
|
32 |
+
<td><label id="search_panel_backwards_label">{#searchreplace_dlg.direction}</label></td>
|
33 |
+
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
|
34 |
+
<td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
|
35 |
+
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
|
36 |
+
<td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
|
37 |
+
</tr>
|
38 |
+
</table>
|
39 |
+
</td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<td colspan="2">
|
43 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
44 |
+
<tr>
|
45 |
+
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
46 |
+
<td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
|
47 |
+
</tr>
|
48 |
+
</table>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<div id="replace_panel" class="panel">
|
55 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="2">
|
56 |
+
<tr>
|
57 |
+
<td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
|
58 |
+
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" aria-required="true" /></td>
|
59 |
+
</tr>
|
60 |
+
<tr>
|
61 |
+
<td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
|
62 |
+
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" aria-required="true" /></td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td colspan="2">
|
66 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">
|
67 |
+
<tr role="group" aria-labelledby="replace_panel_dir_label">
|
68 |
+
<td><label id="replace_panel_dir_label">{#searchreplace_dlg.direction}</label></td>
|
69 |
+
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
|
70 |
+
<td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
|
71 |
+
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
|
72 |
+
<td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
|
73 |
+
</tr>
|
74 |
+
</table>
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<td colspan="2">
|
79 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
80 |
+
<tr>
|
81 |
+
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
82 |
+
<td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
|
83 |
+
</tr>
|
84 |
+
</table>
|
85 |
+
</td>
|
86 |
+
</tr>
|
87 |
+
</table>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<div class="mceActionPanel">
|
93 |
+
<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
|
94 |
+
<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
|
95 |
+
<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
|
96 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
97 |
+
</div>
|
98 |
+
</form>
|
99 |
+
</body>
|
100 |
+
</html>
|
addons/shortcodes/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130186911613741026" remote="130186875600000000" Dst="2" />
|
4 |
+
<file name="shortcodes.php" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/shortcodes/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="shortcodes.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/shortcodes/css/shortcodes.css
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.yinstr{
|
2 |
+
margin:3px 0;
|
3 |
+
padding:0;
|
4 |
+
background-color:#BBBBBB;
|
5 |
+
border:1px solid #BBBBBB;
|
6 |
+
border-radius: 3px 3px 3px 3px;
|
7 |
+
-webkit-border-radius: 3px;
|
8 |
+
-moz-border-radius: 3px;
|
9 |
+
text-align:center;
|
10 |
+
width:220px;
|
11 |
+
display:block;
|
12 |
+
position:relative;
|
13 |
+
}
|
14 |
+
.yinstr p{
|
15 |
+
margin:0;
|
16 |
+
padding:0;
|
17 |
+
font-size:10px;
|
18 |
+
}
|
19 |
+
.y_logo_contener{margin:0;padding:0;float:right;}
|
20 |
+
table{margin:0;padding:0;width:100%;border-collapse: collapse;}
|
21 |
+
table tr td{vertical-align:top;}
|
22 |
+
.youtube-table-child tr td{
|
23 |
+
width:100px;
|
24 |
+
}
|
25 |
+
|
26 |
+
tr .space{height:20px;}
|
addons/shortcodes/editor_plugin_src.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
// tinymce.PluginManager.requireLangPack('shortcodes');
|
3 |
+
|
4 |
+
tinymce.create('tinymce.plugins.ShortcodesPlugin', {
|
5 |
+
|
6 |
+
init : function(ed, url) {
|
7 |
+
|
8 |
+
ed.addCommand('mceShortcodes', function() {
|
9 |
+
ed.windowManager.open({
|
10 |
+
file : url + '/shortcodes.php',
|
11 |
+
width : 320 + ed.getLang('shortcodes.delta_width', 0),
|
12 |
+
height : 600 + ed.getLang('shortcodes.delta_height', 0),
|
13 |
+
inline : 1
|
14 |
+
}, {
|
15 |
+
plugin_url : url,
|
16 |
+
some_custom_arg : 'custom arg'
|
17 |
+
});
|
18 |
+
});
|
19 |
+
|
20 |
+
|
21 |
+
ed.addButton('shortcodes', {
|
22 |
+
title : ed.getLang('shortcodes.desc'),
|
23 |
+
cmd : 'mceShortcodes',
|
24 |
+
//image : url + '/img/shortcodes.gif'
|
25 |
+
});
|
26 |
+
},
|
27 |
+
|
28 |
+
|
29 |
+
createControl : function(n, cm) {
|
30 |
+
return null;
|
31 |
+
},
|
32 |
+
|
33 |
+
|
34 |
+
getInfo : function() {
|
35 |
+
return {
|
36 |
+
longname : 'Shortcodes plugin',
|
37 |
+
author : 'Josh Lobe',
|
38 |
+
authorurl : 'http://joshlobe.com',
|
39 |
+
infourl : 'http://plugins.joshlobe.com',
|
40 |
+
version : "1.0"
|
41 |
+
};
|
42 |
+
}
|
43 |
+
});
|
44 |
+
|
45 |
+
|
46 |
+
tinymce.PluginManager.add('shortcodes', tinymce.plugins.ShortcodesPlugin);
|
47 |
+
})();
|
addons/shortcodes/img/Thumbs.db
ADDED
Binary file
|
addons/shortcodes/img/_notes/dwsync.xml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="shortcodes.gif" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="wordpress-shortcode.png" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
</dwsync>
|
addons/shortcodes/img/shortcodes.gif
ADDED
Binary file
|
addons/shortcodes/img/wordpress-shortcode.png
ADDED
Binary file
|
addons/shortcodes/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="dialog.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111183800000000" remote="130111183800000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/shortcodes/js/dialog.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var ShortcodesDialog = {
|
4 |
+
|
5 |
+
insert : function(file, title) {
|
6 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
7 |
+
|
8 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, '');
|
9 |
+
|
10 |
+
tinyMCEPopup.close();
|
11 |
+
}
|
12 |
+
};
|
13 |
+
|
14 |
+
tinyMCEPopup.onInit.add(ShortcodesDialog.init, ShortcodesDialog);
|
addons/shortcodes/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/shortcodes/langs/en.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.shortcodes',{
|
2 |
+
desc : 'Insert Shortcodes',
|
3 |
+
instr : "Link format for sharing : <br /> http://youtu.be/xxxxxxxx <br /> or <br /> http://www.youtube.com/watch?v=xxxxxxxx"
|
4 |
+
});
|
addons/shortcodes/shortcodes.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php ob_start(); ?>
|
2 |
+
<?php
|
3 |
+
include ('../../includes/tinymce_addon_scripts.php');
|
4 |
+
// Now we can use Wordpress
|
5 |
+
global $shortcode_tags;
|
6 |
+
?>
|
7 |
+
<head>
|
8 |
+
<title>{#shortcodes_dlg.title}</title>
|
9 |
+
<!--
|
10 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
11 |
+
-->
|
12 |
+
<script type="text/javascript" src="js/dialog.js"></script>
|
13 |
+
</head>
|
14 |
+
|
15 |
+
<body>
|
16 |
+
|
17 |
+
<div class="y_logo_contener">
|
18 |
+
<img src="img/wordpress-shortcode.png" width="128" height="128" alt="Youtube" />
|
19 |
+
</div>
|
20 |
+
<div class="yinstr">
|
21 |
+
<p>{#shortcodes_dlg.instr}</p>
|
22 |
+
<p>{#shortcodes_dlg.note}</p>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<form onSubmit="ShortcodesDialog.insert();return false;" action="#" method="post">
|
26 |
+
<div class="mceActionPanel">
|
27 |
+
<script type="text/javascript" language="javascript">
|
28 |
+
var jwl_sel_content2 = tinyMCE.activeEditor.selection.getContent();
|
29 |
+
</script>
|
30 |
+
<?php
|
31 |
+
echo "<div><table id='shortcodes_table'>";
|
32 |
+
foreach($shortcode_tags as $tagname=>$tag) {
|
33 |
+
echo "<tr><td><a href=\"javascript:;\" onClick=\"tinyMCEPopup.close();\" onmousedown=\"tinyMCE.execCommand('mceInsertContent',false,'[".$tagname."]' + jwl_sel_content2 + '[/".$tagname."]');\">[".$tagname,"]</a></td></tr>";
|
34 |
+
}
|
35 |
+
echo "</table></div>";
|
36 |
+
|
37 |
+
?>
|
38 |
+
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div class="mceActionPanel">
|
42 |
+
<div style="float:left;padding-top:5px">
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</form>
|
46 |
+
</body>
|
addons/style/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111188600000000" remote="130111188600000000" Dst="2" />
|
4 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111188600000000" remote="130111188600000000" Dst="2" />
|
5 |
+
<file name="props.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/style/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="props.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/style/css/props.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#text_font {width:250px;}
|
2 |
+
#text_size {width:70px;}
|
3 |
+
.mceAddSelectValue {background:#DDD;}
|
4 |
+
select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}
|
5 |
+
#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}
|
6 |
+
#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}
|
7 |
+
#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}
|
8 |
+
.panel_wrapper div.current {padding-top:10px;height:230px;}
|
9 |
+
.delim {border-left:1px solid gray;}
|
10 |
+
.tdelim {border-bottom:1px solid gray;}
|
11 |
+
#block_display {width:145px;}
|
12 |
+
#list_type {width:115px;}
|
13 |
+
.disabled {background:#EEE;}
|
addons/style/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:a.getLang("style.desc"),cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();
|
addons/style/editor_plugin_src.js
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.StylePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceStyleProps', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/props.htm',
|
18 |
+
width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
|
19 |
+
height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url,
|
23 |
+
style_text : ed.selection.getNode().style.cssText
|
24 |
+
});
|
25 |
+
});
|
26 |
+
|
27 |
+
ed.addCommand('mceSetElementStyle', function(ui, v) {
|
28 |
+
if (e = ed.selection.getNode()) {
|
29 |
+
ed.dom.setAttrib(e, 'style', v);
|
30 |
+
ed.execCommand('mceRepaint');
|
31 |
+
}
|
32 |
+
});
|
33 |
+
|
34 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
35 |
+
cm.setDisabled('styleprops', n.nodeName === 'BODY');
|
36 |
+
});
|
37 |
+
|
38 |
+
// Register buttons
|
39 |
+
ed.addButton('styleprops', {title : ed.getLang('style.desc'), cmd : 'mceStyleProps'});
|
40 |
+
},
|
41 |
+
|
42 |
+
getInfo : function() {
|
43 |
+
return {
|
44 |
+
longname : 'Style',
|
45 |
+
author : 'Moxiecode Systems AB',
|
46 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
47 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
|
48 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
49 |
+
};
|
50 |
+
}
|
51 |
+
});
|
52 |
+
|
53 |
+
// Register plugin
|
54 |
+
tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
|
55 |
+
})();
|
addons/style/js/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="props.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111188600000000" remote="130111188600000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/style/js/props.js
ADDED
@@ -0,0 +1,635 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var defaultFonts = "" +
|
4 |
+
"Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" +
|
5 |
+
"Times New Roman, Times, serif=Times New Roman, Times, serif;" +
|
6 |
+
"Courier New, Courier, mono=Courier New, Courier, mono;" +
|
7 |
+
"Times New Roman, Times, serif=Times New Roman, Times, serif;" +
|
8 |
+
"Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" +
|
9 |
+
"Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" +
|
10 |
+
"Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
|
11 |
+
|
12 |
+
var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
|
13 |
+
var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
|
14 |
+
var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";
|
15 |
+
var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
|
16 |
+
var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
|
17 |
+
var defaultTextStyle = "normal;italic;oblique";
|
18 |
+
var defaultVariant = "normal;small-caps";
|
19 |
+
var defaultLineHeight = "normal";
|
20 |
+
var defaultAttachment = "fixed;scroll";
|
21 |
+
var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
|
22 |
+
var defaultPosH = "left;center;right";
|
23 |
+
var defaultPosV = "top;center;bottom";
|
24 |
+
var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
|
25 |
+
var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
|
26 |
+
var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
|
27 |
+
var defaultBorderWidth = "thin;medium;thick";
|
28 |
+
var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
|
29 |
+
|
30 |
+
function init() {
|
31 |
+
var ce = document.getElementById('container'), h;
|
32 |
+
|
33 |
+
ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
|
34 |
+
|
35 |
+
h = getBrowserHTML('background_image_browser','background_image','image','advimage');
|
36 |
+
document.getElementById("background_image_browser").innerHTML = h;
|
37 |
+
|
38 |
+
document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
|
39 |
+
document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
|
40 |
+
document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
|
41 |
+
document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
|
42 |
+
document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
|
43 |
+
document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
|
44 |
+
|
45 |
+
fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
|
46 |
+
fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
|
47 |
+
fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
|
48 |
+
fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
|
49 |
+
fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
|
50 |
+
fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
|
51 |
+
fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
|
52 |
+
fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
|
53 |
+
fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
|
54 |
+
|
55 |
+
fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
|
56 |
+
fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
|
57 |
+
|
58 |
+
fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
|
59 |
+
fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
|
60 |
+
|
61 |
+
fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
|
62 |
+
fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
|
63 |
+
|
64 |
+
fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
|
65 |
+
fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
|
66 |
+
fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
|
67 |
+
fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
|
68 |
+
fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
|
69 |
+
fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
|
70 |
+
fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
|
71 |
+
fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
|
72 |
+
fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
|
73 |
+
|
74 |
+
fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
|
75 |
+
fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
|
76 |
+
fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
|
77 |
+
fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
|
78 |
+
fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
|
79 |
+
fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
|
80 |
+
fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
|
81 |
+
fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
|
82 |
+
fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
|
83 |
+
fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
|
84 |
+
fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
|
85 |
+
fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
|
86 |
+
|
87 |
+
fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
|
88 |
+
fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
|
89 |
+
fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
|
90 |
+
fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
|
91 |
+
|
92 |
+
fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
|
93 |
+
fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
|
94 |
+
fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
|
95 |
+
fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
|
96 |
+
|
97 |
+
fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
|
98 |
+
fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
|
99 |
+
fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
|
100 |
+
fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
|
101 |
+
|
102 |
+
fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
|
103 |
+
fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
|
104 |
+
|
105 |
+
fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
|
106 |
+
fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
|
107 |
+
|
108 |
+
fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
|
109 |
+
fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
|
110 |
+
fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
|
111 |
+
|
112 |
+
fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
|
113 |
+
fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
|
114 |
+
fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
|
115 |
+
fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
|
116 |
+
|
117 |
+
fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
|
118 |
+
fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
|
119 |
+
fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
|
120 |
+
fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
|
121 |
+
|
122 |
+
TinyMCE_EditableSelects.init();
|
123 |
+
setupFormData();
|
124 |
+
showDisabledControls();
|
125 |
+
}
|
126 |
+
|
127 |
+
function setupFormData() {
|
128 |
+
var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
|
129 |
+
|
130 |
+
// Setup text fields
|
131 |
+
|
132 |
+
selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
|
133 |
+
selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
|
134 |
+
selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
|
135 |
+
selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
|
136 |
+
selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
|
137 |
+
selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
|
138 |
+
selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
|
139 |
+
selectByValue(f, 'text_case', ce.style.textTransform, true, true);
|
140 |
+
selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
|
141 |
+
f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);
|
142 |
+
updateColor('text_color_pick', 'text_color');
|
143 |
+
f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
|
144 |
+
f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
|
145 |
+
f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
|
146 |
+
f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
|
147 |
+
|
148 |
+
// Setup background fields
|
149 |
+
|
150 |
+
f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);
|
151 |
+
updateColor('background_color_pick', 'background_color');
|
152 |
+
f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
153 |
+
selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
|
154 |
+
selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
|
155 |
+
selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
|
156 |
+
selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
|
157 |
+
selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
|
158 |
+
selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
|
159 |
+
|
160 |
+
// Setup block fields
|
161 |
+
|
162 |
+
selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
|
163 |
+
selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
|
164 |
+
selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
|
165 |
+
selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
|
166 |
+
selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
|
167 |
+
selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
|
168 |
+
f.block_text_indent.value = getNum(ce.style.textIndent);
|
169 |
+
selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
|
170 |
+
selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
|
171 |
+
selectByValue(f, 'block_display', ce.style.display, true, true);
|
172 |
+
|
173 |
+
// Setup box fields
|
174 |
+
|
175 |
+
f.box_width.value = getNum(ce.style.width);
|
176 |
+
selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
|
177 |
+
|
178 |
+
f.box_height.value = getNum(ce.style.height);
|
179 |
+
selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
|
180 |
+
selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true);
|
181 |
+
|
182 |
+
selectByValue(f, 'box_clear', ce.style.clear, true, true);
|
183 |
+
|
184 |
+
setupBox(f, ce, 'box_padding', 'padding', '');
|
185 |
+
setupBox(f, ce, 'box_margin', 'margin', '');
|
186 |
+
|
187 |
+
// Setup border fields
|
188 |
+
|
189 |
+
setupBox(f, ce, 'border_style', 'border', 'Style');
|
190 |
+
setupBox(f, ce, 'border_width', 'border', 'Width');
|
191 |
+
setupBox(f, ce, 'border_color', 'border', 'Color');
|
192 |
+
|
193 |
+
updateColor('border_color_top_pick', 'border_color_top');
|
194 |
+
updateColor('border_color_right_pick', 'border_color_right');
|
195 |
+
updateColor('border_color_bottom_pick', 'border_color_bottom');
|
196 |
+
updateColor('border_color_left_pick', 'border_color_left');
|
197 |
+
|
198 |
+
f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);
|
199 |
+
f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);
|
200 |
+
f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);
|
201 |
+
f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);
|
202 |
+
|
203 |
+
// Setup list fields
|
204 |
+
|
205 |
+
selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
|
206 |
+
selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
|
207 |
+
f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
208 |
+
|
209 |
+
// Setup box fields
|
210 |
+
|
211 |
+
selectByValue(f, 'positioning_type', ce.style.position, true, true);
|
212 |
+
selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
|
213 |
+
selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
|
214 |
+
f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
|
215 |
+
|
216 |
+
f.positioning_width.value = getNum(ce.style.width);
|
217 |
+
selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
|
218 |
+
|
219 |
+
f.positioning_height.value = getNum(ce.style.height);
|
220 |
+
selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
|
221 |
+
|
222 |
+
setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
|
223 |
+
|
224 |
+
s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
|
225 |
+
s = s.replace(/,/g, ' ');
|
226 |
+
|
227 |
+
if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
|
228 |
+
f.positioning_clip_top.value = getNum(getVal(s, 0));
|
229 |
+
selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
|
230 |
+
f.positioning_clip_right.value = getNum(getVal(s, 1));
|
231 |
+
selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
|
232 |
+
f.positioning_clip_bottom.value = getNum(getVal(s, 2));
|
233 |
+
selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
|
234 |
+
f.positioning_clip_left.value = getNum(getVal(s, 3));
|
235 |
+
selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
|
236 |
+
} else {
|
237 |
+
f.positioning_clip_top.value = getNum(getVal(s, 0));
|
238 |
+
selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
|
239 |
+
f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
|
240 |
+
}
|
241 |
+
|
242 |
+
// setupBox(f, ce, '', 'border', 'Color');
|
243 |
+
}
|
244 |
+
|
245 |
+
function getMeasurement(s) {
|
246 |
+
return s.replace(/^([0-9.]+)(.*)$/, "$2");
|
247 |
+
}
|
248 |
+
|
249 |
+
function getNum(s) {
|
250 |
+
if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))
|
251 |
+
return s.replace(/[^0-9.]/g, '');
|
252 |
+
|
253 |
+
return s;
|
254 |
+
}
|
255 |
+
|
256 |
+
function inStr(s, n) {
|
257 |
+
return new RegExp(n, 'gi').test(s);
|
258 |
+
}
|
259 |
+
|
260 |
+
function getVal(s, i) {
|
261 |
+
var a = s.split(' ');
|
262 |
+
|
263 |
+
if (a.length > 1)
|
264 |
+
return a[i];
|
265 |
+
|
266 |
+
return "";
|
267 |
+
}
|
268 |
+
|
269 |
+
function setValue(f, n, v) {
|
270 |
+
if (f.elements[n].type == "text")
|
271 |
+
f.elements[n].value = v;
|
272 |
+
else
|
273 |
+
selectByValue(f, n, v, true, true);
|
274 |
+
}
|
275 |
+
|
276 |
+
function setupBox(f, ce, fp, pr, sf, b) {
|
277 |
+
if (typeof(b) == "undefined")
|
278 |
+
b = ['Top', 'Right', 'Bottom', 'Left'];
|
279 |
+
|
280 |
+
if (isSame(ce, pr, sf, b)) {
|
281 |
+
f.elements[fp + "_same"].checked = true;
|
282 |
+
|
283 |
+
setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
|
284 |
+
f.elements[fp + "_top"].disabled = false;
|
285 |
+
|
286 |
+
f.elements[fp + "_right"].value = "";
|
287 |
+
f.elements[fp + "_right"].disabled = true;
|
288 |
+
f.elements[fp + "_bottom"].value = "";
|
289 |
+
f.elements[fp + "_bottom"].disabled = true;
|
290 |
+
f.elements[fp + "_left"].value = "";
|
291 |
+
f.elements[fp + "_left"].disabled = true;
|
292 |
+
|
293 |
+
if (f.elements[fp + "_top_measurement"]) {
|
294 |
+
selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
|
295 |
+
f.elements[fp + "_left_measurement"].disabled = true;
|
296 |
+
f.elements[fp + "_bottom_measurement"].disabled = true;
|
297 |
+
f.elements[fp + "_right_measurement"].disabled = true;
|
298 |
+
}
|
299 |
+
} else {
|
300 |
+
f.elements[fp + "_same"].checked = false;
|
301 |
+
|
302 |
+
setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
|
303 |
+
f.elements[fp + "_top"].disabled = false;
|
304 |
+
|
305 |
+
setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
|
306 |
+
f.elements[fp + "_right"].disabled = false;
|
307 |
+
|
308 |
+
setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
|
309 |
+
f.elements[fp + "_bottom"].disabled = false;
|
310 |
+
|
311 |
+
setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
|
312 |
+
f.elements[fp + "_left"].disabled = false;
|
313 |
+
|
314 |
+
if (f.elements[fp + "_top_measurement"]) {
|
315 |
+
selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
|
316 |
+
selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
|
317 |
+
selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
|
318 |
+
selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
|
319 |
+
f.elements[fp + "_left_measurement"].disabled = false;
|
320 |
+
f.elements[fp + "_bottom_measurement"].disabled = false;
|
321 |
+
f.elements[fp + "_right_measurement"].disabled = false;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
function isSame(e, pr, sf, b) {
|
327 |
+
var a = [], i, x;
|
328 |
+
|
329 |
+
if (typeof(b) == "undefined")
|
330 |
+
b = ['Top', 'Right', 'Bottom', 'Left'];
|
331 |
+
|
332 |
+
if (typeof(sf) == "undefined" || sf == null)
|
333 |
+
sf = "";
|
334 |
+
|
335 |
+
a[0] = e.style[pr + b[0] + sf];
|
336 |
+
a[1] = e.style[pr + b[1] + sf];
|
337 |
+
a[2] = e.style[pr + b[2] + sf];
|
338 |
+
a[3] = e.style[pr + b[3] + sf];
|
339 |
+
|
340 |
+
for (i=0; i<a.length; i++) {
|
341 |
+
if (a[i] == null)
|
342 |
+
return false;
|
343 |
+
|
344 |
+
for (x=0; x<a.length; x++) {
|
345 |
+
if (a[x] != a[i])
|
346 |
+
return false;
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
return true;
|
351 |
+
};
|
352 |
+
|
353 |
+
function hasEqualValues(a) {
|
354 |
+
var i, x;
|
355 |
+
|
356 |
+
for (i=0; i<a.length; i++) {
|
357 |
+
if (a[i] == null)
|
358 |
+
return false;
|
359 |
+
|
360 |
+
for (x=0; x<a.length; x++) {
|
361 |
+
if (a[x] != a[i])
|
362 |
+
return false;
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
return true;
|
367 |
+
}
|
368 |
+
|
369 |
+
function applyAction() {
|
370 |
+
var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;
|
371 |
+
|
372 |
+
generateCSS();
|
373 |
+
|
374 |
+
tinyMCEPopup.restoreSelection();
|
375 |
+
ed.dom.setAttrib(ed.selection.getSelectedBlocks(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
|
376 |
+
}
|
377 |
+
|
378 |
+
function updateAction() {
|
379 |
+
applyAction();
|
380 |
+
tinyMCEPopup.close();
|
381 |
+
}
|
382 |
+
|
383 |
+
function generateCSS() {
|
384 |
+
var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
|
385 |
+
|
386 |
+
ce.style.cssText = "";
|
387 |
+
|
388 |
+
// Build text styles
|
389 |
+
ce.style.fontFamily = f.text_font.value;
|
390 |
+
ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");
|
391 |
+
ce.style.fontStyle = f.text_style.value;
|
392 |
+
ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
|
393 |
+
ce.style.textTransform = f.text_case.value;
|
394 |
+
ce.style.fontWeight = f.text_weight.value;
|
395 |
+
ce.style.fontVariant = f.text_variant.value;
|
396 |
+
ce.style.color = f.text_color.value;
|
397 |
+
|
398 |
+
s = "";
|
399 |
+
s += f.text_underline.checked ? " underline" : "";
|
400 |
+
s += f.text_overline.checked ? " overline" : "";
|
401 |
+
s += f.text_linethrough.checked ? " line-through" : "";
|
402 |
+
s += f.text_blink.checked ? " blink" : "";
|
403 |
+
s = s.length > 0 ? s.substring(1) : s;
|
404 |
+
|
405 |
+
if (f.text_none.checked)
|
406 |
+
s = "none";
|
407 |
+
|
408 |
+
ce.style.textDecoration = s;
|
409 |
+
|
410 |
+
// Build background styles
|
411 |
+
|
412 |
+
ce.style.backgroundColor = f.background_color.value;
|
413 |
+
ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
|
414 |
+
ce.style.backgroundRepeat = f.background_repeat.value;
|
415 |
+
ce.style.backgroundAttachment = f.background_attachment.value;
|
416 |
+
|
417 |
+
if (f.background_hpos.value != "") {
|
418 |
+
s = "";
|
419 |
+
s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
|
420 |
+
s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
|
421 |
+
ce.style.backgroundPosition = s;
|
422 |
+
}
|
423 |
+
|
424 |
+
// Build block styles
|
425 |
+
|
426 |
+
ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
|
427 |
+
ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
|
428 |
+
ce.style.verticalAlign = f.block_vertical_alignment.value;
|
429 |
+
ce.style.textAlign = f.block_text_align.value;
|
430 |
+
ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
|
431 |
+
ce.style.whiteSpace = f.block_whitespace.value;
|
432 |
+
ce.style.display = f.block_display.value;
|
433 |
+
|
434 |
+
// Build box styles
|
435 |
+
|
436 |
+
ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
|
437 |
+
ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
|
438 |
+
ce.style.styleFloat = f.box_float.value;
|
439 |
+
ce.style.cssFloat = f.box_float.value;
|
440 |
+
|
441 |
+
ce.style.clear = f.box_clear.value;
|
442 |
+
|
443 |
+
if (!f.box_padding_same.checked) {
|
444 |
+
ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
|
445 |
+
ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
|
446 |
+
ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
|
447 |
+
ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
|
448 |
+
} else
|
449 |
+
ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
|
450 |
+
|
451 |
+
if (!f.box_margin_same.checked) {
|
452 |
+
ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
|
453 |
+
ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
|
454 |
+
ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
|
455 |
+
ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
|
456 |
+
} else
|
457 |
+
ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
|
458 |
+
|
459 |
+
// Build border styles
|
460 |
+
|
461 |
+
if (!f.border_style_same.checked) {
|
462 |
+
ce.style.borderTopStyle = f.border_style_top.value;
|
463 |
+
ce.style.borderRightStyle = f.border_style_right.value;
|
464 |
+
ce.style.borderBottomStyle = f.border_style_bottom.value;
|
465 |
+
ce.style.borderLeftStyle = f.border_style_left.value;
|
466 |
+
} else
|
467 |
+
ce.style.borderStyle = f.border_style_top.value;
|
468 |
+
|
469 |
+
if (!f.border_width_same.checked) {
|
470 |
+
ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
|
471 |
+
ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
|
472 |
+
ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
|
473 |
+
ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
|
474 |
+
} else
|
475 |
+
ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
|
476 |
+
|
477 |
+
if (!f.border_color_same.checked) {
|
478 |
+
ce.style.borderTopColor = f.border_color_top.value;
|
479 |
+
ce.style.borderRightColor = f.border_color_right.value;
|
480 |
+
ce.style.borderBottomColor = f.border_color_bottom.value;
|
481 |
+
ce.style.borderLeftColor = f.border_color_left.value;
|
482 |
+
} else
|
483 |
+
ce.style.borderColor = f.border_color_top.value;
|
484 |
+
|
485 |
+
// Build list styles
|
486 |
+
|
487 |
+
ce.style.listStyleType = f.list_type.value;
|
488 |
+
ce.style.listStylePosition = f.list_position.value;
|
489 |
+
ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
|
490 |
+
|
491 |
+
// Build positioning styles
|
492 |
+
|
493 |
+
ce.style.position = f.positioning_type.value;
|
494 |
+
ce.style.visibility = f.positioning_visibility.value;
|
495 |
+
|
496 |
+
if (ce.style.width == "")
|
497 |
+
ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
|
498 |
+
|
499 |
+
if (ce.style.height == "")
|
500 |
+
ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
|
501 |
+
|
502 |
+
ce.style.zIndex = f.positioning_zindex.value;
|
503 |
+
ce.style.overflow = f.positioning_overflow.value;
|
504 |
+
|
505 |
+
if (!f.positioning_placement_same.checked) {
|
506 |
+
ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
|
507 |
+
ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
|
508 |
+
ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
|
509 |
+
ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
|
510 |
+
} else {
|
511 |
+
s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
|
512 |
+
ce.style.top = s;
|
513 |
+
ce.style.right = s;
|
514 |
+
ce.style.bottom = s;
|
515 |
+
ce.style.left = s;
|
516 |
+
}
|
517 |
+
|
518 |
+
if (!f.positioning_clip_same.checked) {
|
519 |
+
s = "rect(";
|
520 |
+
s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
|
521 |
+
s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
|
522 |
+
s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
|
523 |
+
s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
|
524 |
+
s += ")";
|
525 |
+
|
526 |
+
if (s != "rect(auto auto auto auto)")
|
527 |
+
ce.style.clip = s;
|
528 |
+
} else {
|
529 |
+
s = "rect(";
|
530 |
+
t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
|
531 |
+
s += t + " ";
|
532 |
+
s += t + " ";
|
533 |
+
s += t + " ";
|
534 |
+
s += t + ")";
|
535 |
+
|
536 |
+
if (s != "rect(auto auto auto auto)")
|
537 |
+
ce.style.clip = s;
|
538 |
+
}
|
539 |
+
|
540 |
+
ce.style.cssText = ce.style.cssText;
|
541 |
+
}
|
542 |
+
|
543 |
+
function isNum(s) {
|
544 |
+
return new RegExp('[0-9]+', 'g').test(s);
|
545 |
+
}
|
546 |
+
|
547 |
+
function showDisabledControls() {
|
548 |
+
var f = document.forms, i, a;
|
549 |
+
|
550 |
+
for (i=0; i<f.length; i++) {
|
551 |
+
for (a=0; a<f[i].elements.length; a++) {
|
552 |
+
if (f[i].elements[a].disabled)
|
553 |
+
tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");
|
554 |
+
else
|
555 |
+
tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");
|
556 |
+
}
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
function fillSelect(f, s, param, dval, sep, em) {
|
561 |
+
var i, ar, p, se;
|
562 |
+
|
563 |
+
f = document.forms[f];
|
564 |
+
sep = typeof(sep) == "undefined" ? ";" : sep;
|
565 |
+
|
566 |
+
if (em)
|
567 |
+
addSelectValue(f, s, "", "");
|
568 |
+
|
569 |
+
ar = tinyMCEPopup.getParam(param, dval).split(sep);
|
570 |
+
for (i=0; i<ar.length; i++) {
|
571 |
+
se = false;
|
572 |
+
|
573 |
+
if (ar[i].charAt(0) == '+') {
|
574 |
+
ar[i] = ar[i].substring(1);
|
575 |
+
se = true;
|
576 |
+
}
|
577 |
+
|
578 |
+
p = ar[i].split('=');
|
579 |
+
|
580 |
+
if (p.length > 1) {
|
581 |
+
addSelectValue(f, s, p[0], p[1]);
|
582 |
+
|
583 |
+
if (se)
|
584 |
+
selectByValue(f, s, p[1]);
|
585 |
+
} else {
|
586 |
+
addSelectValue(f, s, p[0], p[0]);
|
587 |
+
|
588 |
+
if (se)
|
589 |
+
selectByValue(f, s, p[0]);
|
590 |
+
}
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
+
function toggleSame(ce, pre) {
|
595 |
+
var el = document.forms[0].elements, i;
|
596 |
+
|
597 |
+
if (ce.checked) {
|
598 |
+
el[pre + "_top"].disabled = false;
|
599 |
+
el[pre + "_right"].disabled = true;
|
600 |
+
el[pre + "_bottom"].disabled = true;
|
601 |
+
el[pre + "_left"].disabled = true;
|
602 |
+
|
603 |
+
if (el[pre + "_top_measurement"]) {
|
604 |
+
el[pre + "_top_measurement"].disabled = false;
|
605 |
+
el[pre + "_right_measurement"].disabled = true;
|
606 |
+
el[pre + "_bottom_measurement"].disabled = true;
|
607 |
+
el[pre + "_left_measurement"].disabled = true;
|
608 |
+
}
|
609 |
+
} else {
|
610 |
+
el[pre + "_top"].disabled = false;
|
611 |
+
el[pre + "_right"].disabled = false;
|
612 |
+
el[pre + "_bottom"].disabled = false;
|
613 |
+
el[pre + "_left"].disabled = false;
|
614 |
+
|
615 |
+
if (el[pre + "_top_measurement"]) {
|
616 |
+
el[pre + "_top_measurement"].disabled = false;
|
617 |
+
el[pre + "_right_measurement"].disabled = false;
|
618 |
+
el[pre + "_bottom_measurement"].disabled = false;
|
619 |
+
el[pre + "_left_measurement"].disabled = false;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
|
623 |
+
showDisabledControls();
|
624 |
+
}
|
625 |
+
|
626 |
+
function synch(fr, to) {
|
627 |
+
var f = document.forms[0];
|
628 |
+
|
629 |
+
f.elements[to].value = f.elements[fr].value;
|
630 |
+
|
631 |
+
if (f.elements[fr + "_measurement"])
|
632 |
+
selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
|
633 |
+
}
|
634 |
+
|
635 |
+
tinyMCEPopup.onInit.add(init);
|
addons/style/langs/_notes/dwsync.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="en_dlg.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
</dwsync>
|
addons/style/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
|
addons/style/props.htm
ADDED
@@ -0,0 +1,840 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#style_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/editable_selects.js"></script>
|
8 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
9 |
+
<script type="text/javascript" src="js/props.js"></script>
|
10 |
+
<link href="css/props.css" rel="stylesheet" type="text/css" />
|
11 |
+
</head>
|
12 |
+
|
13 |
+
<body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
+
<span id="app_title" style="display:none">{#style_dlg.title}</span>
|
15 |
+
<form onsubmit="updateAction();return false;" action="#">
|
16 |
+
<div class="tabs">
|
17 |
+
<ul>
|
18 |
+
<li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
|
19 |
+
<li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
|
20 |
+
<li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
|
21 |
+
<li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
|
22 |
+
<li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
|
23 |
+
<li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
|
24 |
+
<li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
|
25 |
+
</ul>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div class="panel_wrapper">
|
29 |
+
<div id="text_panel" class="panel current">
|
30 |
+
<fieldset>
|
31 |
+
<legend>{#style_dlg.text}</legend>
|
32 |
+
<table role="presentation" border="0" width="100%">
|
33 |
+
<tr>
|
34 |
+
<td><label for="text_font">{#style_dlg.text_font}</label></td>
|
35 |
+
<td colspan="3">
|
36 |
+
<select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td><label for="text_size">{#style_dlg.text_size}</label></td>
|
41 |
+
<td>
|
42 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
43 |
+
<tr>
|
44 |
+
<td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
|
45 |
+
<td> </td>
|
46 |
+
<td>
|
47 |
+
<label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
|
48 |
+
<select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</td>
|
53 |
+
<td><label for="text_weight">{#style_dlg.text_weight}</label></td>
|
54 |
+
<td>
|
55 |
+
<select id="text_weight" name="text_weight"></select>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<td><label for="text_style">{#style_dlg.text_style}</label></td>
|
60 |
+
<td>
|
61 |
+
<select id="text_style" name="text_style" class="mceEditableSelect"></select>
|
62 |
+
</td>
|
63 |
+
<td><label for="text_variant">{#style_dlg.text_variant}</label></td>
|
64 |
+
<td>
|
65 |
+
<select id="text_variant" name="text_variant"></select>
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
<tr>
|
69 |
+
<td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
|
70 |
+
<td>
|
71 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
72 |
+
<tr>
|
73 |
+
<td>
|
74 |
+
<select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
|
75 |
+
</td>
|
76 |
+
<td> </td>
|
77 |
+
<td>
|
78 |
+
<label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
|
79 |
+
<select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
</table>
|
83 |
+
</td>
|
84 |
+
<td><label for="text_case">{#style_dlg.text_case}</label></td>
|
85 |
+
<td>
|
86 |
+
<select id="text_case" name="text_case"></select>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
<tr>
|
90 |
+
<td><label for="text_color">{#style_dlg.text_color}</label></td>
|
91 |
+
<td colspan="2">
|
92 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
93 |
+
<tr>
|
94 |
+
<td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
|
95 |
+
<td id="text_color_pickcontainer"> </td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
<tr>
|
101 |
+
<td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
|
102 |
+
<td colspan="2">
|
103 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
104 |
+
<tr>
|
105 |
+
<td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
|
106 |
+
<td><label for="text_underline">{#style_dlg.text_underline}</label></td>
|
107 |
+
</tr>
|
108 |
+
<tr>
|
109 |
+
<td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
|
110 |
+
<td><label for="text_overline">{#style_dlg.text_overline}</label></td>
|
111 |
+
</tr>
|
112 |
+
<tr>
|
113 |
+
<td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
|
114 |
+
<td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
|
115 |
+
</tr>
|
116 |
+
<tr>
|
117 |
+
<td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
|
118 |
+
<td><label for="text_blink">{#style_dlg.text_blink}</label></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td>
|
122 |
+
<td><label for="text_none">{#style_dlg.text_none}</label></td>
|
123 |
+
</tr>
|
124 |
+
</table>
|
125 |
+
</td>
|
126 |
+
</tr>
|
127 |
+
</table>
|
128 |
+
</fieldset>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<div id="background_panel" class="panel">
|
132 |
+
<fieldset>
|
133 |
+
<legend>{#style_dlg.background}</legend>
|
134 |
+
<table role="presentation" border="0">
|
135 |
+
<tr>
|
136 |
+
<td><label for="background_color">{#style_dlg.background_color}</label></td>
|
137 |
+
<td>
|
138 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
139 |
+
<tr>
|
140 |
+
<td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
|
141 |
+
<td id="background_color_pickcontainer"> </td>
|
142 |
+
</tr>
|
143 |
+
</table>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
|
147 |
+
<tr>
|
148 |
+
<td><label for="background_image">{#style_dlg.background_image}</label></td>
|
149 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
150 |
+
<tr>
|
151 |
+
<td><input id="background_image" name="background_image" type="text" /></td>
|
152 |
+
<td id="background_image_browser"> </td>
|
153 |
+
</tr>
|
154 |
+
</table>
|
155 |
+
</td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
|
160 |
+
<td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
|
165 |
+
<td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
|
166 |
+
</tr>
|
167 |
+
|
168 |
+
<tr>
|
169 |
+
<td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
|
170 |
+
<td>
|
171 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
172 |
+
<tr>
|
173 |
+
<td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
|
174 |
+
<td> </td>
|
175 |
+
<td>
|
176 |
+
<label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
|
177 |
+
<select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
|
178 |
+
</td>
|
179 |
+
</tr>
|
180 |
+
</table>
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<tr>
|
185 |
+
<td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
|
186 |
+
<td>
|
187 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
188 |
+
<tr>
|
189 |
+
<td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
|
190 |
+
<td> </td>
|
191 |
+
<td>
|
192 |
+
|
193 |
+
<label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
|
194 |
+
<select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
|
195 |
+
</tr>
|
196 |
+
</table>
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
</table>
|
200 |
+
</fieldset>
|
201 |
+
</div>
|
202 |
+
|
203 |
+
<div id="block_panel" class="panel">
|
204 |
+
<fieldset>
|
205 |
+
<legend>{#style_dlg.block}</legend>
|
206 |
+
<table role="presentation" border="0">
|
207 |
+
<tr>
|
208 |
+
<td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
|
209 |
+
<td>
|
210 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
211 |
+
<tr>
|
212 |
+
<td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
|
213 |
+
<td> </td>
|
214 |
+
<td>
|
215 |
+
<label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
|
216 |
+
<select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
|
217 |
+
</td>
|
218 |
+
</tr>
|
219 |
+
</table>
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
+
|
223 |
+
<tr>
|
224 |
+
<td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
|
225 |
+
<td>
|
226 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
227 |
+
<tr>
|
228 |
+
<td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
|
229 |
+
<td> </td>
|
230 |
+
<td>
|
231 |
+
<label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
|
232 |
+
<select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
|
233 |
+
</td>
|
234 |
+
</tr>
|
235 |
+
</table>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
|
239 |
+
<tr>
|
240 |
+
<td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
|
241 |
+
<td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
|
242 |
+
</tr>
|
243 |
+
|
244 |
+
<tr>
|
245 |
+
<td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
|
246 |
+
<td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
|
247 |
+
</tr>
|
248 |
+
|
249 |
+
<tr>
|
250 |
+
<td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
|
251 |
+
<td>
|
252 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
253 |
+
<tr>
|
254 |
+
<td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
|
255 |
+
<td> </td>
|
256 |
+
<td>
|
257 |
+
<label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
|
258 |
+
|
259 |
+
<select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
|
260 |
+
</td>
|
261 |
+
</tr>
|
262 |
+
</table>
|
263 |
+
</td>
|
264 |
+
</tr>
|
265 |
+
|
266 |
+
<tr>
|
267 |
+
<td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
|
268 |
+
<td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
|
269 |
+
</tr>
|
270 |
+
|
271 |
+
<tr>
|
272 |
+
<td><label for="block_display">{#style_dlg.block_display}</label></td>
|
273 |
+
<td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
|
274 |
+
</tr>
|
275 |
+
</table>
|
276 |
+
</fieldset>
|
277 |
+
</div>
|
278 |
+
|
279 |
+
<div id="box_panel" class="panel">
|
280 |
+
<fieldset>
|
281 |
+
<legend>{#style_dlg.box}</legend>
|
282 |
+
<table role="presentation" border="0">
|
283 |
+
<tr>
|
284 |
+
<td><label for="box_width">{#style_dlg.box_width}</label></td>
|
285 |
+
<td>
|
286 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
287 |
+
<tr>
|
288 |
+
<td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
|
289 |
+
<td> </td>
|
290 |
+
<td>
|
291 |
+
<label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
|
292 |
+
<select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
|
293 |
+
</td>
|
294 |
+
</tr>
|
295 |
+
</table>
|
296 |
+
</td>
|
297 |
+
<td> <label for="box_float">{#style_dlg.box_float}</label></td>
|
298 |
+
<td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
|
299 |
+
</tr>
|
300 |
+
|
301 |
+
<tr>
|
302 |
+
<td><label for="box_height">{#style_dlg.box_height}</label></td>
|
303 |
+
<td>
|
304 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
305 |
+
<tr>
|
306 |
+
<td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
|
307 |
+
<td> </td>
|
308 |
+
<td>
|
309 |
+
<label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
|
310 |
+
<select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
|
311 |
+
</td>
|
312 |
+
</tr>
|
313 |
+
</table>
|
314 |
+
</td>
|
315 |
+
<td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
|
316 |
+
<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
|
317 |
+
</tr>
|
318 |
+
</table>
|
319 |
+
</fieldset>
|
320 |
+
|
321 |
+
<div style="float: left; width: 49%">
|
322 |
+
<fieldset>
|
323 |
+
<legend>{#style_dlg.padding}</legend>
|
324 |
+
|
325 |
+
<table role="presentation" border="0">
|
326 |
+
<tr>
|
327 |
+
<td> </td>
|
328 |
+
<td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
|
329 |
+
</tr>
|
330 |
+
<tr>
|
331 |
+
<td><label for="box_padding_top">{#style_dlg.top}</label></td>
|
332 |
+
<td>
|
333 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
334 |
+
<tr>
|
335 |
+
<td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
|
336 |
+
<td> </td>
|
337 |
+
<td>
|
338 |
+
<label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
|
339 |
+
<select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
|
340 |
+
</td>
|
341 |
+
</tr>
|
342 |
+
</table>
|
343 |
+
</td>
|
344 |
+
</tr>
|
345 |
+
<tr>
|
346 |
+
<td><label for="box_padding_right">{#style_dlg.right}</label></td>
|
347 |
+
<td>
|
348 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
349 |
+
<tr>
|
350 |
+
<td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
|
351 |
+
<td> </td>
|
352 |
+
<td>
|
353 |
+
<label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
|
354 |
+
<select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
|
355 |
+
</td>
|
356 |
+
</tr>
|
357 |
+
</table>
|
358 |
+
</td>
|
359 |
+
</tr>
|
360 |
+
<tr>
|
361 |
+
<td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
|
362 |
+
<td>
|
363 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
364 |
+
<tr>
|
365 |
+
<td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
366 |
+
<td> </td>
|
367 |
+
<td>
|
368 |
+
<label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
|
369 |
+
<select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
|
370 |
+
</td>
|
371 |
+
</tr>
|
372 |
+
</table>
|
373 |
+
</td>
|
374 |
+
</tr>
|
375 |
+
<tr>
|
376 |
+
<td><label for="box_padding_left">{#style_dlg.left}</label></td>
|
377 |
+
<td>
|
378 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
379 |
+
<tr>
|
380 |
+
<td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
|
381 |
+
<td> </td>
|
382 |
+
<td>
|
383 |
+
<label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
|
384 |
+
<select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
|
385 |
+
</td>
|
386 |
+
</tr>
|
387 |
+
</table>
|
388 |
+
</td>
|
389 |
+
</tr>
|
390 |
+
</table>
|
391 |
+
</fieldset>
|
392 |
+
</div>
|
393 |
+
|
394 |
+
<div style="float: right; width: 49%">
|
395 |
+
<fieldset>
|
396 |
+
<legend>{#style_dlg.margin}</legend>
|
397 |
+
|
398 |
+
<table role="presentation" border="0">
|
399 |
+
<tr>
|
400 |
+
<td> </td>
|
401 |
+
<td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
|
402 |
+
</tr>
|
403 |
+
<tr>
|
404 |
+
<td><label for="box_margin_top">{#style_dlg.top}</label></td>
|
405 |
+
<td>
|
406 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
407 |
+
<tr>
|
408 |
+
<td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
|
409 |
+
<td> </td>
|
410 |
+
<td>
|
411 |
+
<label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
|
412 |
+
<select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
|
413 |
+
</td>
|
414 |
+
</tr>
|
415 |
+
</table>
|
416 |
+
</td>
|
417 |
+
</tr>
|
418 |
+
<tr>
|
419 |
+
<td><label for="box_margin_right">{#style_dlg.right}</label></td>
|
420 |
+
<td>
|
421 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
422 |
+
<tr>
|
423 |
+
<td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
|
424 |
+
<td> </td>
|
425 |
+
<td>
|
426 |
+
<label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
|
427 |
+
<select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
|
428 |
+
</td>
|
429 |
+
</tr>
|
430 |
+
</table>
|
431 |
+
</td>
|
432 |
+
</tr>
|
433 |
+
<tr>
|
434 |
+
<td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
|
435 |
+
<td>
|
436 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
437 |
+
<tr>
|
438 |
+
<td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
439 |
+
<td> </td>
|
440 |
+
<td>
|
441 |
+
<label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
|
442 |
+
<select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
|
443 |
+
</td>
|
444 |
+
</tr>
|
445 |
+
</table>
|
446 |
+
</td>
|
447 |
+
</tr>
|
448 |
+
<tr>
|
449 |
+
<td><label for="box_margin_left">{#style_dlg.left}</label></td>
|
450 |
+
<td>
|
451 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
452 |
+
<tr>
|
453 |
+
<td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
|
454 |
+
<td> </td>
|
455 |
+
<td>
|
456 |
+
<label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
|
457 |
+
<select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
|
458 |
+
</td>
|
459 |
+
</tr>
|
460 |
+
</table>
|
461 |
+
</td>
|
462 |
+
</tr>
|
463 |
+
</table>
|
464 |
+
</fieldset>
|
465 |
+
</div>
|
466 |
+
<br style="clear: both" />
|
467 |
+
</div>
|
468 |
+
|
469 |
+
<div id="border_panel" class="panel">
|
470 |
+
<fieldset>
|
471 |
+
<legend>{#style_dlg.border}</legend>
|
472 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
|
473 |
+
<tr>
|
474 |
+
<td class="tdelim"> </td>
|
475 |
+
<td class="tdelim delim"> </td>
|
476 |
+
<td class="tdelim">{#style_dlg.style}</td>
|
477 |
+
<td class="tdelim delim"> </td>
|
478 |
+
<td class="tdelim">{#style_dlg.width}</td>
|
479 |
+
<td class="tdelim delim"> </td>
|
480 |
+
<td class="tdelim">{#style_dlg.color}</td>
|
481 |
+
</tr>
|
482 |
+
|
483 |
+
<tr>
|
484 |
+
<td> </td>
|
485 |
+
<td class="delim"> </td>
|
486 |
+
<td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
|
487 |
+
<td class="delim"> </td>
|
488 |
+
<td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
|
489 |
+
<td class="delim"> </td>
|
490 |
+
<td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
|
491 |
+
</tr>
|
492 |
+
|
493 |
+
<tr>
|
494 |
+
<td>{#style_dlg.top}</td>
|
495 |
+
<td class="delim"> </td>
|
496 |
+
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
|
497 |
+
<td class="delim"> </td>
|
498 |
+
<td>
|
499 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
500 |
+
<tr>
|
501 |
+
<td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
|
502 |
+
<td> </td>
|
503 |
+
<td>
|
504 |
+
<label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
|
505 |
+
<select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
|
506 |
+
</td>
|
507 |
+
</tr>
|
508 |
+
</table>
|
509 |
+
</td>
|
510 |
+
<td class="delim"> </td>
|
511 |
+
<td>
|
512 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
513 |
+
<tr>
|
514 |
+
<td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
|
515 |
+
<td id="border_color_top_pickcontainer"> </td>
|
516 |
+
</tr>
|
517 |
+
</table>
|
518 |
+
</td>
|
519 |
+
</tr>
|
520 |
+
|
521 |
+
<tr>
|
522 |
+
<td>{#style_dlg.right}</td>
|
523 |
+
<td class="delim"> </td>
|
524 |
+
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
525 |
+
<td class="delim"> </td>
|
526 |
+
<td>
|
527 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
528 |
+
<tr>
|
529 |
+
<td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
530 |
+
<td> </td>
|
531 |
+
<td>
|
532 |
+
<label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
|
533 |
+
<select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
|
534 |
+
</td>
|
535 |
+
</tr>
|
536 |
+
</table>
|
537 |
+
</td>
|
538 |
+
<td class="delim"> </td>
|
539 |
+
<td>
|
540 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
541 |
+
<tr>
|
542 |
+
<td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
|
543 |
+
<td id="border_color_right_pickcontainer"> </td>
|
544 |
+
</tr>
|
545 |
+
</table>
|
546 |
+
</td>
|
547 |
+
</tr>
|
548 |
+
|
549 |
+
<tr>
|
550 |
+
<td>{#style_dlg.bottom}</td>
|
551 |
+
<td class="delim"> </td>
|
552 |
+
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
553 |
+
<td class="delim"> </td>
|
554 |
+
<td>
|
555 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
556 |
+
<tr>
|
557 |
+
<td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
558 |
+
<td> </td>
|
559 |
+
<td>
|
560 |
+
<label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
|
561 |
+
<select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
|
562 |
+
</td>
|
563 |
+
</tr>
|
564 |
+
</table>
|
565 |
+
</td>
|
566 |
+
<td class="delim"> </td>
|
567 |
+
<td>
|
568 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
569 |
+
<tr>
|
570 |
+
<td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
|
571 |
+
<td id="border_color_bottom_pickcontainer"> </td>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</td>
|
575 |
+
</tr>
|
576 |
+
|
577 |
+
<tr>
|
578 |
+
<td>{#style_dlg.left}</td>
|
579 |
+
<td class="delim"> </td>
|
580 |
+
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
581 |
+
<td class="delim"> </td>
|
582 |
+
<td>
|
583 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
584 |
+
<tr>
|
585 |
+
<td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
586 |
+
<td> </td>
|
587 |
+
<td>
|
588 |
+
<label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
|
589 |
+
<select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
|
590 |
+
</td>
|
591 |
+
</tr>
|
592 |
+
</table>
|
593 |
+
</td>
|
594 |
+
<td class="delim"> </td>
|
595 |
+
<td>
|
596 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
597 |
+
<tr>
|
598 |
+
<td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
|
599 |
+
<td id="border_color_left_pickcontainer"> </td>
|
600 |
+
</tr>
|
601 |
+
</table>
|
602 |
+
</td>
|
603 |
+
</tr>
|
604 |
+
</table>
|
605 |
+
</fieldset>
|
606 |
+
</div>
|
607 |
+
|
608 |
+
<div id="list_panel" class="panel">
|
609 |
+
<fieldset>
|
610 |
+
<legend>{#style_dlg.list}</legend>
|
611 |
+
<table role="presentation" border="0">
|
612 |
+
<tr>
|
613 |
+
<td><label for="list_type">{#style_dlg.list_type}</label></td>
|
614 |
+
<td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
|
615 |
+
</tr>
|
616 |
+
|
617 |
+
<tr>
|
618 |
+
<td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
|
619 |
+
<td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
|
620 |
+
</tr>
|
621 |
+
|
622 |
+
<tr>
|
623 |
+
<td><label for="list_position">{#style_dlg.position}</label></td>
|
624 |
+
<td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
|
625 |
+
</tr>
|
626 |
+
</table>
|
627 |
+
</fieldset>
|
628 |
+
</div>
|
629 |
+
|
630 |
+
<div id="positioning_panel" class="panel">
|
631 |
+
<fieldset>
|
632 |
+
<legend>{#style_dlg.position}</legend>
|
633 |
+
<table role="presentation" border="0">
|
634 |
+
<tr>
|
635 |
+
<td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
|
636 |
+
<td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
|
637 |
+
<td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
|
638 |
+
<td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
|
639 |
+
</tr>
|
640 |
+
|
641 |
+
<tr>
|
642 |
+
<td><label for="positioning_width">{#style_dlg.width}</label></td>
|
643 |
+
<td>
|
644 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
645 |
+
<tr>
|
646 |
+
<td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
|
647 |
+
<td> </td>
|
648 |
+
<td>
|
649 |
+
<label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
|
650 |
+
<select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
|
651 |
+
</td>
|
652 |
+
</tr>
|
653 |
+
</table>
|
654 |
+
</td>
|
655 |
+
<td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
|
656 |
+
<td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
|
657 |
+
</tr>
|
658 |
+
|
659 |
+
<tr>
|
660 |
+
<td><label for="positioning_height">{#style_dlg.height}</label></td>
|
661 |
+
<td>
|
662 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
663 |
+
<tr>
|
664 |
+
<td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
|
665 |
+
<td> </td>
|
666 |
+
<td>
|
667 |
+
<label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
|
668 |
+
<select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
|
669 |
+
</td>
|
670 |
+
</tr>
|
671 |
+
</table>
|
672 |
+
</td>
|
673 |
+
<td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
|
674 |
+
<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
|
675 |
+
</tr>
|
676 |
+
</table>
|
677 |
+
</fieldset>
|
678 |
+
|
679 |
+
<div style="float: left; width: 49%">
|
680 |
+
<fieldset>
|
681 |
+
<legend>{#style_dlg.placement}</legend>
|
682 |
+
|
683 |
+
<table role="presentation" border="0">
|
684 |
+
<tr>
|
685 |
+
<td> </td>
|
686 |
+
<td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
|
687 |
+
</tr>
|
688 |
+
<tr>
|
689 |
+
<td>{#style_dlg.top}</td>
|
690 |
+
<td>
|
691 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
692 |
+
<tr>
|
693 |
+
<td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
|
694 |
+
<td> </td>
|
695 |
+
<td>
|
696 |
+
<label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
|
697 |
+
<select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
|
698 |
+
</td>
|
699 |
+
</tr>
|
700 |
+
</table>
|
701 |
+
</td>
|
702 |
+
</tr>
|
703 |
+
<tr>
|
704 |
+
<td>{#style_dlg.right}</td>
|
705 |
+
<td>
|
706 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
707 |
+
<tr>
|
708 |
+
<td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
|
709 |
+
<td> </td>
|
710 |
+
<td>
|
711 |
+
<label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
|
712 |
+
<select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
|
713 |
+
</td>
|
714 |
+
</tr>
|
715 |
+
</table>
|
716 |
+
</td>
|
717 |
+
</tr>
|
718 |
+
<tr>
|
719 |
+
<td>{#style_dlg.bottom}</td>
|
720 |
+
<td>
|
721 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
722 |
+
<tr>
|
723 |
+
<td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
|
724 |
+
<td> </td>
|
725 |
+
<td>
|
726 |
+
<label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
|
727 |
+
<select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
|
728 |
+
</td>
|
729 |
+
</tr>
|
730 |
+
</table>
|
731 |
+
</td>
|
732 |
+
</tr>
|
733 |
+
<tr>
|
734 |
+
<td>{#style_dlg.left}</td>
|
735 |
+
<td>
|
736 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
737 |
+
<tr>
|
738 |
+
<td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
|
739 |
+
<td> </td>
|
740 |
+
<td>
|
741 |
+
<label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
|
742 |
+
<select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
|
743 |
+
</td>
|
744 |
+
</tr>
|
745 |
+
</table>
|
746 |
+
</td>
|
747 |
+
</tr>
|
748 |
+
</table>
|
749 |
+
</fieldset>
|
750 |
+
</div>
|
751 |
+
|
752 |
+
<div style="float: right; width: 49%">
|
753 |
+
<fieldset>
|
754 |
+
<legend>{#style_dlg.clip}</legend>
|
755 |
+
|
756 |
+
<table role="presentation" border="0">
|
757 |
+
<tr>
|
758 |
+
<td> </td>
|
759 |
+
<td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
|
760 |
+
</tr>
|
761 |
+
<tr>
|
762 |
+
<td>{#style_dlg.top}</td>
|
763 |
+
<td>
|
764 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
765 |
+
<tr>
|
766 |
+
<td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
|
767 |
+
<td> </td>
|
768 |
+
<td>
|
769 |
+
<label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
|
770 |
+
<select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
|
771 |
+
</td>
|
772 |
+
</tr>
|
773 |
+
</table>
|
774 |
+
</td>
|
775 |
+
</tr>
|
776 |
+
<tr>
|
777 |
+
<td>{#style_dlg.right}</td>
|
778 |
+
<td>
|
779 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
780 |
+
<tr>
|
781 |
+
<td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
|
782 |
+
<td> </td>
|
783 |
+
<td>
|
784 |
+
<label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
|
785 |
+
<select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
|
786 |
+
</td>
|
787 |
+
</tr>
|
788 |
+
</table>
|
789 |
+
</td>
|
790 |
+
</tr>
|
791 |
+
<tr>
|
792 |
+
<td>{#style_dlg.bottom}</td>
|
793 |
+
<td>
|
794 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
795 |
+
<tr>
|
796 |
+
<td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
|
797 |
+
<td> </td>
|
798 |
+
<td>
|
799 |
+
<label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
|
800 |
+
<select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
|
801 |
+
</td>
|
802 |
+
</tr>
|
803 |
+
</table>
|
804 |
+
</td>
|
805 |
+
</tr>
|
806 |
+
<tr>
|
807 |
+
<td>{#style_dlg.left}</td>
|
808 |
+
<td>
|
809 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
810 |
+
<tr>
|
811 |
+
<td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
|
812 |
+
<td> </td>
|
813 |
+
<td>
|
814 |
+
<label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
|
815 |
+
<select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
|
816 |
+
</td>
|
817 |
+
</tr>
|
818 |
+
</table>
|
819 |
+
</td>
|
820 |
+
</tr>
|
821 |
+
</table>
|
822 |
+
</fieldset>
|
823 |
+
</div>
|
824 |
+
<br style="clear: both" />
|
825 |
+
</div>
|
826 |
+
</div>
|
827 |
+
|
828 |
+
<div class="mceActionPanel">
|
829 |
+
<input type="submit" id="insert" name="insert" value="{#update}" />
|
830 |
+
<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
|
831 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
|
832 |
+
</div>
|
833 |
+
</form>
|
834 |
+
|
835 |
+
<div style="display: none">
|
836 |
+
<div id="container"></div>
|
837 |
+
</div>
|
838 |
+
|
839 |
+
</body>
|
840 |
+
</html>
|
addons/table/_notes/dwsync.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="cell.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="editor_plugin.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111222800000000" remote="130111222800000000" Dst="2" />
|
5 |
+
<file name="editor_plugin_src.js" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130111213200000000" remote="130111213200000000" Dst="2" />
|
6 |
+
<file name="merge_cells.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
7 |
+
<file name="row.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
8 |
+
<file name="table.htm" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
9 |
+
</dwsync>
|
addons/table/cell.htm
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#table_dlg.cell_title}</title>
|
5 |
+
<script type="text/javascript" src="../../tinymce/tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../tinymce/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../tinymce/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="../../tinymce/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="../../tinymce/editable_selects.js"></script>
|
10 |
+
<script type="text/javascript" src="js/cell.js"></script>
|
11 |
+
<link href="css/cell.css" rel="stylesheet" type="text/css" />
|
12 |
+
</head>
|
13 |
+
<body id="tablecell" style="display: none" role="application">
|
14 |
+
<form onsubmit="updateAction();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
|
18 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{#table_dlg.general_props}</legend>
|
26 |
+
|
27 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
28 |
+
<tr>
|
29 |
+
<td><label for="align">{#table_dlg.align}</label></td>
|
30 |
+
<td>
|
31 |
+
<select id="align" name="align" class="mceFocus">
|
32 |
+
<option value="">{#not_set}</option>
|
33 |
+
<option value="center">{#table_dlg.align_middle}</option>
|
34 |
+
<option value="left">{#table_dlg.align_left}</option>
|
35 |
+
<option value="right">{#table_dlg.align_right}</option>
|
36 |
+
</select>
|
37 |
+
</td>
|
38 |
+
|
39 |
+
<td><label for="celltype">{#table_dlg.cell_type}</label></td>
|
40 |
+
<td>
|
41 |
+
<select id="celltype" name="celltype">
|
42 |
+
<option value="td">{#table_dlg.td}</option>
|
43 |
+
<option value="th">{#table_dlg.th}</option>
|
44 |
+
</select>
|
45 |
+
</td>
|
46 |
+
</tr>
|
47 |
+
|
48 |
+
<tr>
|
49 |
+
<td><label for="valign">{#table_dlg.valign}</label></td>
|
50 |
+
<td>
|
51 |
+
<select id="valign" name="valign">
|
52 |
+
<option value="">{#not_set}</option>
|
53 |
+
<option value="top">{#table_dlg.align_top}</option>
|
54 |
+
<option value="middle">{#table_dlg.align_middle}</option>
|
55 |
+
<option value="bottom">{#table_dlg.align_bottom}</option>
|
56 |
+
</select>
|
57 |
+
</td>
|
58 |
+
|
59 |
+
<td><label for="scope">{#table_dlg.scope}</label></td>
|
60 |
+
<td>
|
61 |
+
<select id="scope" name="scope">
|
62 |
+
<option value="">{#not_set}</option>
|
63 |
+
<option value="col">{#table.col}</option>
|
64 |
+
<option value="row">{#table.row}</option>
|
65 |
+
<option value="rowgroup">{#table_dlg.rowgroup}</option>
|
66 |
+
<option value="colgroup">{#table_dlg.colgroup}</option>
|
67 |
+
</select>
|
68 |
+
</td>
|
69 |
+
|
70 |
+
</tr>
|
71 |
+
|
72 |
+
<tr>
|
73 |
+
<td><label for="width">{#table_dlg.width}</label></td>
|
74 |
+
<td><input id="width" name="width" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
|
75 |
+
|
76 |
+
<td><label for="height">{#table_dlg.height}</label></td>
|
77 |
+
<td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
|
78 |
+
</tr>
|
79 |
+
|
80 |
+
<tr id="styleSelectRow">
|
81 |
+
<td><label for="class">{#class_name}</label></td>
|
82 |
+
<td colspan="3">
|
83 |
+
<select id="class" name="class" class="mceEditableSelect">
|
84 |
+
<option value="" selected="selected">{#not_set}</option>
|
85 |
+
</select>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
</table>
|
89 |
+
</fieldset>
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<div id="advanced_panel" class="panel">
|
93 |
+
<fieldset>
|
94 |
+
<legend>{#table_dlg.advanced_props}</legend>
|
95 |
+
|
96 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
97 |
+
<tr>
|
98 |
+
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
99 |
+
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
100 |
+
</tr>
|
101 |
+
|
102 |
+
<tr>
|
103 |
+
<td><label for="style">{#table_dlg.style}</label></td>
|
104 |
+
<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
|
105 |
+
</tr>
|
106 |
+
|
107 |
+
<tr>
|
108 |
+
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
109 |
+
<td>
|
110 |
+
<select id="dir" name="dir" style="width: 200px">
|
111 |
+
<option value="">{#not_set}</option>
|
112 |
+
<option value="ltr">{#table_dlg.ltr}</option>
|
113 |
+
<option value="rtl">{#table_dlg.rtl}</option>
|
114 |
+
</select>
|
115 |
+
</td>
|
116 |
+
</tr>
|
117 |
+
|
118 |
+
<tr>
|
119 |
+
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
120 |
+
<td>
|
121 |
+
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
122 |
+
</td>
|
123 |
+
</tr>
|
124 |
+
|
125 |
+
<tr>
|
126 |
+
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
127 |
+
<td>
|
128 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
129 |
+
<tr>
|
130 |
+
<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
|
131 |
+
<td id="backgroundimagebrowsercontainer"> </td>
|
132 |
+
</tr>
|
133 |
+
</table>
|
134 |
+
</td>
|
135 |
+
</tr>
|
136 |
+
|
137 |
+
<tr role="group" aria-labelledby="bordercolor_label">
|
138 |
+
<td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
|
139 |
+
<td>
|
140 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
141 |
+
<tr>
|
142 |
+
<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
|
143 |
+
<td id="bordercolor_pickcontainer"> </td>
|
144 |
+
</tr>
|
145 |
+
</table>
|
146 |
+
</td>
|
147 |
+
</tr>
|
148 |
+
|
149 |
+
<tr role="group" aria-labelledby="bgcolor_label">
|
150 |
+
<td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
|
151 |
+
<td>
|
152 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
153 |
+
<tr>
|
154 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
|
155 |
+
<td id="bgcolor_pickcontainer"> </td>
|
156 |
+
</tr>
|
157 |
+
</table>
|
158 |
+
</td>
|
159 |
+
</tr>
|
160 |
+
</table>
|
161 |
+
</fieldset>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
|
165 |
+
<div class="mceActionPanel">
|
166 |
+
<div>
|
167 |
+
<select id="action" name="action">
|
168 |
+
<option value="cell">{#table_dlg.cell_cell}</option>
|
169 |
+
<option value="row">{#table_dlg.cell_row}</option>
|
170 |
+
<option value="col">{#table_dlg.cell_col}</option>
|
171 |
+
<option value="all">{#table_dlg.cell_all}</option>
|
172 |
+
</select>
|
173 |
+
</div>
|
174 |
+
|
175 |
+
<input type="submit" id="insert" name="insert" value="{#update}" />
|
176 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
177 |
+
</div>
|
178 |
+
</form>
|
179 |
+
</body>
|
180 |
+
</html>
|
addons/table/css/_notes/dwsync.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
2 |
+
<dwsync>
|
3 |
+
<file name="cell.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
4 |
+
<file name="row.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
5 |
+
<file name="table.css" server="ftp.joshlobe.com/public_html/testsite/wp-content/plugins/ultimate-tinymce/" local="130107219000000000" remote="130107219000000000" Dst="2" />
|
6 |
+
</dwsync>
|
addons/table/css/cell.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for cell dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 200px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#action {
|
12 |
+
margin-bottom: 3px;
|
13 |
+
}
|
14 |
+
|
15 |
+
#class {
|
16 |
+
width: 150px;
|
17 |
+
}
|
addons/table/css/row.css
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for row dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 200px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#action {
|
12 |
+
margin-bottom: 3px;
|
13 |
+
}
|
14 |
+
|
15 |
+
#rowtype,#align,#valign,#class,#height {
|
16 |
+
width: 150px;
|
17 |
+
}
|
18 |
+
|
19 |
+
#height {
|
20 |
+
width: 50px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.col2 {
|
24 |
+
padding-left: 20px;
|
25 |
+
}
|
addons/table/css/table.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for table dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 245px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#class {
|
12 |
+
width: 150px;
|
13 |
+
}
|
addons/table/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?" ":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}})}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:g.getLang(n[1]),cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){return S&&S[R?"lastChild":"firstChild"]}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'<br mce_bogus="1" />')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSp
|