Commit e04f49c0359e7db4a00aa0ecc9b8301605306546
- Diff rendering mode:
- inline
- side by side
|   | |||
| 7 | 7 | = "#{yield :title} - " if yield :title | |
| 8 | 8 | = settings.blog_name | |
| 9 | 9 | = auto_discovery_link_tag :atom, formatted_posts_url(:atom), :title => 'Posts feed' | |
| 10 | = stylesheet_link_tag 'compiled/screen.css', 'jquery.wysiwyg', :media => 'screen, projection' | ||
| 10 | = stylesheet_link_tag 'compiled/screen.css', :media => 'screen, projection' | ||
| 11 | 11 | = stylesheet_link_tag 'compiled/print.css', :media => 'print' | |
| 12 | 12 | = javascript_include_tag 'jquery-1.2.6.min', 'jquery.livequery.min', 'lowpro.jquery' | |
| 13 | = javascript_include_tag '/javascripts/wymeditor/jquery.wymeditor.pack.js', 'application' | ||
| 13 | = javascript_include_tag 'application' | ||
| 14 | 14 | %body | |
| 15 | 15 | .container | |
| 16 | 16 |
|   | |||
| 1 | $(function() { | ||
| 2 | $('#page_body, #post_body').wymeditor({ | ||
| 3 | skinPath: "/javascripts/wymeditor/skins/default/", | ||
| 4 | skin: 'mini', | ||
| 5 | boxHtml: "<div class='wym_box'>" | ||
| 6 | + "<div class='wym_area_top'>" | ||
| 7 | + WYMeditor.TOOLS | ||
| 8 | + WYMeditor.CONTAINERS | ||
| 9 | + "</div>" | ||
| 10 | + "<div class='wym_area_main'>" | ||
| 11 | + WYMeditor.HTML | ||
| 12 | + WYMeditor.IFRAME | ||
| 13 | + WYMeditor.STATUS | ||
| 14 | + "</div>" | ||
| 15 | + "</div>", | ||
| 16 | toolsItems: [ | ||
| 17 | {'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}, | ||
| 18 | {'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}, | ||
| 19 | {'name': 'Superscript', 'title': 'Superscript', | ||
| 20 | 'css': 'wym_tools_superscript'}, | ||
| 21 | {'name': 'Subscript', 'title': 'Subscript', | ||
| 22 | 'css': 'wym_tools_subscript'}, | ||
| 23 | {'name': 'InsertOrderedList', 'title': 'Ordered_List', | ||
| 24 | 'css': 'wym_tools_ordered_list'}, | ||
| 25 | {'name': 'InsertUnorderedList', 'title': 'Unordered_List', | ||
| 26 | 'css': 'wym_tools_unordered_list'}, | ||
| 27 | {'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}, | ||
| 28 | {'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}, | ||
| 29 | {'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}, | ||
| 30 | {'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}, | ||
| 31 | {'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}, | ||
| 32 | {'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}, | ||
| 33 | {'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}, | ||
| 34 | {'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}, | ||
| 35 | ], | ||
| 36 | containersItems: [ | ||
| 37 | {'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}, | ||
| 38 | {'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}, | ||
| 39 | {'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}, | ||
| 40 | {'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}, | ||
| 41 | {'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}, | ||
| 42 | {'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'} | ||
| 43 | ], | ||
| 44 | containersHtml: "<div class='wym_containers wym_section'>" | ||
| 45 | + "<h2>{Containers}</h2>" | ||
| 46 | + "<ul>" | ||
| 47 | + WYMeditor.CONTAINERS_ITEMS | ||
| 48 | + "</ul>" | ||
| 49 | + "</div>", | ||
| 50 | |||
| 51 | |||
| 52 | }); | ||
| 53 | }); |
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * wymeditor.css | ||
| 12 | * Main editor css file. | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 17 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 18 | */ | ||
| 19 | |||
| 20 | /* VISUAL FEEDBACK */ | ||
| 21 | |||
| 22 | /* basic */ | ||
| 23 | /* body { background: #e1e8f1;} */ | ||
| 24 | |||
| 25 | /* make HTML blocs visible */ | ||
| 26 | p, | ||
| 27 | h1, | ||
| 28 | h2, | ||
| 29 | h3, | ||
| 30 | h4, | ||
| 31 | h5, | ||
| 32 | h6, | ||
| 33 | ul, | ||
| 34 | ol, | ||
| 35 | table, | ||
| 36 | blockquote, | ||
| 37 | pre { background: #FFFFFF no-repeat right; } | ||
| 38 | /* padding:8px 5px 5px; */ | ||
| 39 | /* margin:10px; } */ | ||
| 40 | td { background: #F0F4F8; } | ||
| 41 | th { background: #ffffcc; } | ||
| 42 | ul, | ||
| 43 | ol { border-left:20px solid #B9C4D0; padding:0px 5px; } | ||
| 44 | caption { background: #E4E4B0; padding: 5px; font-weight: bold; } | ||
| 45 | table { font-size: 12px; width: 500px; } | ||
| 46 | td { width: 25%; } | ||
| 47 | blockquote { margin-left: 30px; } | ||
| 48 | pre { background-color:transparent; border: 1px solid white; } | ||
| 49 | |||
| 50 | /* Gecko min height fix */ | ||
| 51 | /* p { min-height: 1em; } [>min-height is needed under Firefox, because empty parargraphs <] */ | ||
| 52 | /* *+html p { min-height: auto; } [> but we have to remove it under IE7 because it triggers the 'haslayout' mode <] */ | ||
| 53 | /* td { height: 1.6em; } */ | ||
| 54 | |||
| 55 | /* labels */ | ||
| 56 | p { background-image: url(lbl-p.png); } | ||
| 57 | h1 { background-image: url(lbl-h1.png); } | ||
| 58 | h2 { background-image: url(lbl-h2.png); } | ||
| 59 | h3 { background-image: url(lbl-h3.png); } | ||
| 60 | h4 { background-image: url(lbl-h4.png); } | ||
| 61 | h5 { background-image: url(lbl-h5.png); } | ||
| 62 | h6 { background-image: url(lbl-h6.png); } | ||
| 63 | blockquote{ background-image: url(lbl-blockquote.png); } | ||
| 64 | pre { background-image: url(lbl-pre.png); } | ||
| 65 | |||
| 66 | /* specific HTML elements */ | ||
| 67 | /* caption { text-align: left; } */ | ||
| 68 | /* img { margin-right: 5px; */ | ||
| 69 | /* border-style: solid; */ | ||
| 70 | /* border-color: gray; */ | ||
| 71 | /* border-width: 0; } */ | ||
| 72 | /* a img { border-width: 1px; border-color: blue; } */ | ||
| 73 | /* acronym { border: 1px solid gray; } */ | ||
| 74 | |||
| 75 | /* visual feedback for non-valid nesting of elements*/ | ||
| 76 | h1 h1, h1 h2, h1 h3, h1 h4, h1 h5, h1 h6, h1 p, h1 pre, h1 address, | ||
| 77 | h2 h1, h2 h2, h2 h3, h2 h4, h2 h5, h2 h6, h2 p, h2 pre, h2 address, | ||
| 78 | h3 h1, h3 h2, h3 h3, h3 h4, h3 h5, h3 h6, h3 p, h3 pre, h3 address, | ||
| 79 | h4 h1, h4 h2, h4 h3, h4 h4, h4 h5, h4 h6, h4 p, h4 pre, h4 address, | ||
| 80 | h5 h1, h5 h2, h5 h3, h5 h4, h5 h5, h5 h6, h5 p, h5 pre, h5 address, | ||
| 81 | h6 h1, h6 h2, h6 h3, h6 h4, h6 h4, h6 h6, h6 p, h6 pre, h6 address, | ||
| 82 | p h1, p h2, p h3, p h4, p h5, p h6, p pre, p address, | ||
| 83 | pre h1, pre h2, pre h3, pre h4, pre h5, pre h6, pre p, pre pre, pre address, | ||
| 84 | address h1, address h2, address h3, address h4, address h5, address h6, | ||
| 85 | address p, address pre, address address | ||
| 86 | { background-color: #ff9999 !important; | ||
| 87 | border: 1px solid red !important; | ||
| 88 | font-size: 12px !important; | ||
| 89 | font-weight: normal; } |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * wymeditor.css | ||
| 12 | * Main editor css file. | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 17 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 18 | */ | ||
| 19 | |||
| 20 | /* VISUAL FEEDBACK */ | ||
| 21 | |||
| 22 | /* basic */ | ||
| 23 | body { background: #e1e8f1;} | ||
| 24 | |||
| 25 | /* make HTML blocs visible */ | ||
| 26 | p, | ||
| 27 | h1, | ||
| 28 | h2, | ||
| 29 | h3, | ||
| 30 | h4, | ||
| 31 | h5, | ||
| 32 | h6, | ||
| 33 | ul, | ||
| 34 | ol, | ||
| 35 | table, | ||
| 36 | blockquote, | ||
| 37 | pre { background: #FFFFFF no-repeat 2px 2px; | ||
| 38 | padding:8px 5px 5px; | ||
| 39 | margin:10px; } | ||
| 40 | td { background: #F0F4F8; } | ||
| 41 | th { background: #ffffcc; } | ||
| 42 | ul, | ||
| 43 | ol { border-left:20px solid #B9C4D0; padding:0px 5px; } | ||
| 44 | caption { background: #E4E4B0; padding: 5px; font-weight: bold; } | ||
| 45 | table { font-size: 12px; width: 500px; } | ||
| 46 | td { width: 25%; } | ||
| 47 | blockquote { margin-left: 30px; } | ||
| 48 | pre { background-color:transparent; border: 1px solid white; } | ||
| 49 | |||
| 50 | /* Gecko min height fix */ | ||
| 51 | p { min-height: 1em; } /*min-height is needed under Firefox, because empty parargraphs */ | ||
| 52 | *+html p { min-height: auto; } /* but we have to remove it under IE7 because it triggers the 'haslayout' mode */ | ||
| 53 | td { height: 1.6em; } | ||
| 54 | |||
| 55 | /* labels */ | ||
| 56 | p { background-image: url(lbl-p.png); } | ||
| 57 | h1 { background-image: url(lbl-h1.png); } | ||
| 58 | h2 { background-image: url(lbl-h2.png); } | ||
| 59 | h3 { background-image: url(lbl-h3.png); } | ||
| 60 | h4 { background-image: url(lbl-h4.png); } | ||
| 61 | h5 { background-image: url(lbl-h5.png); } | ||
| 62 | h6 { background-image: url(lbl-h6.png); } | ||
| 63 | blockquote{ background-image: url(lbl-blockquote.png); } | ||
| 64 | pre { background-image: url(lbl-pre.png); } | ||
| 65 | |||
| 66 | /* specific HTML elements */ | ||
| 67 | caption { text-align: left; } | ||
| 68 | img { margin-right: 5px; | ||
| 69 | border-style: solid; | ||
| 70 | border-color: gray; | ||
| 71 | border-width: 0; } | ||
| 72 | a img { border-width: 1px; border-color: blue; } | ||
| 73 | acronym { border: 1px solid gray; } | ||
| 74 | |||
| 75 | /* visual feedback for non-valid nesting of elements*/ | ||
| 76 | h1 h1, h1 h2, h1 h3, h1 h4, h1 h5, h1 h6, h1 p, h1 pre, h1 address, | ||
| 77 | h2 h1, h2 h2, h2 h3, h2 h4, h2 h5, h2 h6, h2 p, h2 pre, h2 address, | ||
| 78 | h3 h1, h3 h2, h3 h3, h3 h4, h3 h5, h3 h6, h3 p, h3 pre, h3 address, | ||
| 79 | h4 h1, h4 h2, h4 h3, h4 h4, h4 h5, h4 h6, h4 p, h4 pre, h4 address, | ||
| 80 | h5 h1, h5 h2, h5 h3, h5 h4, h5 h5, h5 h6, h5 p, h5 pre, h5 address, | ||
| 81 | h6 h1, h6 h2, h6 h3, h6 h4, h6 h4, h6 h6, h6 p, h6 pre, h6 address, | ||
| 82 | p h1, p h2, p h3, p h4, p h5, p h6, p pre, p address, | ||
| 83 | pre h1, pre h2, pre h3, pre h4, pre h5, pre h6, pre p, pre pre, pre address, | ||
| 84 | address h1, address h2, address h3, address h4, address h5, address h6, | ||
| 85 | address p, address pre, address address | ||
| 86 | { background-color: #ff9999 !important; | ||
| 87 | border: 1px solid red !important; | ||
| 88 | font-size: 12px !important; | ||
| 89 | font-weight: normal; } |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * wymeditor.css | ||
| 12 | * Main editor css file. | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 17 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 18 | */ | ||
| 19 | |||
| 20 | /* VISUAL FEEDBACK */ | ||
| 21 | |||
| 22 | /* basic */ | ||
| 23 | /* body { background: #e1e8f1;} */ | ||
| 24 | |||
| 25 | /* make HTML blocs visible */ | ||
| 26 | p, | ||
| 27 | h1, | ||
| 28 | h2, | ||
| 29 | h3, | ||
| 30 | h4, | ||
| 31 | h5, | ||
| 32 | h6, | ||
| 33 | ul, | ||
| 34 | ol, | ||
| 35 | table, | ||
| 36 | blockquote, | ||
| 37 | pre { background: #FFFFFF no-repeat 100% 2px; } | ||
| 38 | /* padding:8px 5px 5px; */ | ||
| 39 | /* margin:10px; } */ | ||
| 40 | /* td { background: #F0F4F8; } */ | ||
| 41 | /* th { background: #ffffcc; } */ | ||
| 42 | /* ul, */ | ||
| 43 | /* ol { border-left:20px solid #B9C4D0; padding:0px 5px; } */ | ||
| 44 | /* caption { background: #E4E4B0; padding: 5px; font-weight: bold; } */ | ||
| 45 | /* table { font-size: 12px; width: 500px; } */ | ||
| 46 | /* td { width: 25%; } */ | ||
| 47 | /* blockquote { margin-left: 30px; } */ | ||
| 48 | /* pre { background-color:transparent; border: 1px solid white; } */ | ||
| 49 | |||
| 50 | /* Gecko min height fix */ | ||
| 51 | /* p { min-height: 1em; } [>min-height is needed under Firefox, because empty parargraphs <] */ | ||
| 52 | /* *+html p { min-height: auto; } [> but we have to remove it under IE7 because it triggers the 'haslayout' mode <] */ | ||
| 53 | /* td { height: 1.6em; } */ | ||
| 54 | |||
| 55 | /* labels */ | ||
| 56 | p { background-image: url(lbl-p.png); } | ||
| 57 | h1 { background-image: url(lbl-h1.png); } | ||
| 58 | h2 { background-image: url(lbl-h2.png); } | ||
| 59 | h3 { background-image: url(lbl-h3.png); } | ||
| 60 | h4 { background-image: url(lbl-h4.png); } | ||
| 61 | h5 { background-image: url(lbl-h5.png); } | ||
| 62 | h6 { background-image: url(lbl-h6.png); } | ||
| 63 | blockquote{ background-image: url(lbl-blockquote.png); margin-top: -14px; margin-right: 10px; padding-top: 1px } | ||
| 64 | pre { background-image: url(lbl-pre.png); } | ||
| 65 | |||
| 66 | /* specific HTML elements */ | ||
| 67 | caption { text-align: left; } | ||
| 68 | img { margin-right: 5px; | ||
| 69 | border-style: solid; | ||
| 70 | border-color: gray; | ||
| 71 | border-width: 0; } | ||
| 72 | a img { border-width: 1px; border-color: blue; } | ||
| 73 | acronym { border: 1px solid gray; } | ||
| 74 | |||
| 75 | /* visual feedback for non-valid nesting of elements*/ | ||
| 76 | h1 h1, h1 h2, h1 h3, h1 h4, h1 h5, h1 h6, h1 p, h1 pre, h1 address, | ||
| 77 | h2 h1, h2 h2, h2 h3, h2 h4, h2 h5, h2 h6, h2 p, h2 pre, h2 address, | ||
| 78 | h3 h1, h3 h2, h3 h3, h3 h4, h3 h5, h3 h6, h3 p, h3 pre, h3 address, | ||
| 79 | h4 h1, h4 h2, h4 h3, h4 h4, h4 h5, h4 h6, h4 p, h4 pre, h4 address, | ||
| 80 | h5 h1, h5 h2, h5 h3, h5 h4, h5 h5, h5 h6, h5 p, h5 pre, h5 address, | ||
| 81 | h6 h1, h6 h2, h6 h3, h6 h4, h6 h4, h6 h6, h6 p, h6 pre, h6 address, | ||
| 82 | p h1, p h2, p h3, p h4, p h5, p h6, p pre, p address, | ||
| 83 | pre h1, pre h2, pre h3, pre h4, pre h5, pre h6, pre p, pre pre, pre address, | ||
| 84 | address h1, address h2, address h3, address h4, address h5, address h6, | ||
| 85 | address p, address pre, address address | ||
| 86 | { background-color: #ff9999 !important; | ||
| 87 | border: 1px solid red !important; | ||
| 88 | font-size: 12px !important; | ||
| 89 | font-weight: normal; } |
|   | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <!-- | ||
| 3 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 4 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 5 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 6 | * and GPL (GPL-license.txt) licenses. | ||
| 7 | * | ||
| 8 | * For further information visit: | ||
| 9 | * http://www.wymeditor.org/ | ||
| 10 | * | ||
| 11 | * File Name: | ||
| 12 | * wymiframe.html | ||
| 13 | * Iframe used by designMode. | ||
| 14 | * See the documentation for more info. | ||
| 15 | * | ||
| 16 | * File Authors: | ||
| 17 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 18 | --> | ||
| 19 | <html> | ||
| 20 | <head> | ||
| 21 | <title>WYMeditor iframe</title> | ||
| 22 | <link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/compiled/screen.css" /> | ||
| 23 | </head> | ||
| 24 | <body class="wym_iframe"></body> | ||
| 25 | </html> |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File: jquery.wymeditor.js | ||
| 11 | * | ||
| 12 | * Main JS file with core classes and functions. | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * About: authors | ||
| 16 | * | ||
| 17 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 18 | * Volker Mische (vmx a-t gmx dotde) | ||
| 19 | * Scott Lewis (lewiscot a-t gmail dotcom) | ||
| 20 | * Bermi Ferrer (wymeditor a-t bermi dotorg) | ||
| 21 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 22 | * Jonatan Lundin (jonatan.lundin _at_ gmail.com) | ||
| 23 | */ | ||
| 24 | |||
| 25 | /* | ||
| 26 | Namespace: WYMeditor | ||
| 27 | Global WYMeditor namespace. | ||
| 28 | */ | ||
| 29 | if(!WYMeditor) var WYMeditor = {}; | ||
| 30 | |||
| 31 | jQuery.extend(WYMeditor, { | ||
| 32 | |||
| 33 | /* | ||
| 34 | Constants: Global WYMeditor constants. | ||
| 35 | |||
| 36 | VERSION - Defines WYMeditor version. | ||
| 37 | INSTANCES - An array of loaded WYMeditor.editor instances. | ||
| 38 | STRINGS - An array of loaded WYMeditor language pairs/values. | ||
| 39 | SKINS - An array of loaded WYMeditor skins. | ||
| 40 | NAME - The "name" attribute. | ||
| 41 | INDEX - A string replaced by the instance index. | ||
| 42 | WYM_INDEX - A string used to get/set the instance index. | ||
| 43 | BASE_PATH - A string replaced by WYMeditor's base path. | ||
| 44 | SKIN_PATH - A string replaced by WYMeditor's skin path. | ||
| 45 | WYM_PATH - A string replaced by WYMeditor's main JS file path. | ||
| 46 | SKINS_DEFAULT_PATH - The skins default base path. | ||
| 47 | SKINS_DEFAULT_CSS - The skins default CSS file. | ||
| 48 | LANG_DEFAULT_PATH - The language files default path. | ||
| 49 | IFRAME_BASE_PATH - A string replaced by the designmode iframe's base path. | ||
| 50 | IFRAME_DEFAULT - The iframe's default base path. | ||
| 51 | JQUERY_PATH - A string replaced by the computed jQuery path. | ||
| 52 | DIRECTION - A string replaced by the text direction (rtl or ltr). | ||
| 53 | LOGO - A string replaced by WYMeditor logo. | ||
| 54 | TOOLS - A string replaced by the toolbar's HTML. | ||
| 55 | TOOLS_ITEMS - A string replaced by the toolbar items. | ||
| 56 | TOOL_NAME - A string replaced by a toolbar item's name. | ||
| 57 | TOOL_TITLE - A string replaced by a toolbar item's title. | ||
| 58 | TOOL_CLASS - A string replaced by a toolbar item's class. | ||
| 59 | CLASSES - A string replaced by the classes panel's HTML. | ||
| 60 | CLASSES_ITEMS - A string replaced by the classes items. | ||
| 61 | CLASS_NAME - A string replaced by a class item's name. | ||
| 62 | CLASS_TITLE - A string replaced by a class item's title. | ||
| 63 | CONTAINERS - A string replaced by the containers panel's HTML. | ||
| 64 | CONTAINERS_ITEMS - A string replaced by the containers items. | ||
| 65 | CONTAINER_NAME - A string replaced by a container item's name. | ||
| 66 | CONTAINER_TITLE - A string replaced by a container item's title. | ||
| 67 | CONTAINER_CLASS - A string replaced by a container item's class. | ||
| 68 | HTML - A string replaced by the HTML view panel's HTML. | ||
| 69 | IFRAME - A string replaced by the designmode iframe. | ||
| 70 | STATUS - A string replaced by the status panel's HTML. | ||
| 71 | DIALOG_TITLE - A string replaced by a dialog's title. | ||
| 72 | DIALOG_BODY - A string replaced by a dialog's HTML body. | ||
| 73 | BODY - The BODY element. | ||
| 74 | STRING - The "string" type. | ||
| 75 | BODY,DIV,P, | ||
| 76 | H1,H2,H3,H4,H5,H6, | ||
| 77 | PRE,BLOCKQUOTE, | ||
| 78 | A,BR,IMG, | ||
| 79 | TABLE,TD,TH, | ||
| 80 | UL,OL,LI - HTML elements string representation. | ||
| 81 | CLASS,HREF,SRC, | ||
| 82 | TITLE,ALT - HTML attributes string representation. | ||
| 83 | DIALOG_LINK - A link dialog type. | ||
| 84 | DIALOG_IMAGE - An image dialog type. | ||
| 85 | DIALOG_TABLE - A table dialog type. | ||
| 86 | DIALOG_PASTE - A 'Paste from Word' dialog type. | ||
| 87 | BOLD - Command: (un)set selection to <strong>. | ||
| 88 | ITALIC - Command: (un)set selection to <em>. | ||
| 89 | CREATE_LINK - Command: open the link dialog or (un)set link. | ||
| 90 | INSERT_IMAGE - Command: open the image dialog or insert an image. | ||
| 91 | INSERT_TABLE - Command: open the table dialog. | ||
| 92 | PASTE - Command: open the paste dialog. | ||
| 93 | INDENT - Command: nest a list item. | ||
| 94 | OUTDENT - Command: unnest a list item. | ||
| 95 | TOGGLE_HTML - Command: display/hide the HTML view. | ||
| 96 | FORMAT_BLOCK - Command: set a block element to another type. | ||
| 97 | PREVIEW - Command: open the preview dialog. | ||
| 98 | UNLINK - Command: unset a link. | ||
| 99 | INSERT_UNORDEREDLIST- Command: insert an unordered list. | ||
| 100 | INSERT_ORDEREDLIST - Command: insert an ordered list. | ||
| 101 | MAIN_CONTAINERS - An array of the main HTML containers used in WYMeditor. | ||
| 102 | BLOCKS - An array of the HTML block elements. | ||
| 103 | KEY - Standard key codes. | ||
| 104 | NODE - Node types. | ||
| 105 | |||
| 106 | */ | ||
| 107 | |||
| 108 | VERSION : "0.5-a2", | ||
| 109 | INSTANCES : [], | ||
| 110 | STRINGS : [], | ||
| 111 | SKINS : [], | ||
| 112 | NAME : "name", | ||
| 113 | INDEX : "{Wym_Index}", | ||
| 114 | WYM_INDEX : "wym_index", | ||
| 115 | BASE_PATH : "{Wym_Base_Path}", | ||
| 116 | CSS_PATH : "{Wym_Css_Path}", | ||
| 117 | WYM_PATH : "{Wym_Wym_Path}", | ||
| 118 | SKINS_DEFAULT_PATH : "skins/", | ||
| 119 | SKINS_DEFAULT_CSS : "skin.css", | ||
| 120 | SKINS_DEFAULT_JS : "skin.js", | ||
| 121 | LANG_DEFAULT_PATH : "lang/", | ||
| 122 | IFRAME_BASE_PATH : "{Wym_Iframe_Base_Path}", | ||
| 123 | IFRAME_DEFAULT : "iframe/default/", | ||
| 124 | JQUERY_PATH : "{Wym_Jquery_Path}", | ||
| 125 | DIRECTION : "{Wym_Direction}", | ||
| 126 | LOGO : "{Wym_Logo}", | ||
| 127 | TOOLS : "{Wym_Tools}", | ||
| 128 | TOOLS_ITEMS : "{Wym_Tools_Items}", | ||
| 129 | TOOL_NAME : "{Wym_Tool_Name}", | ||
| 130 | TOOL_TITLE : "{Wym_Tool_Title}", | ||
| 131 | TOOL_CLASS : "{Wym_Tool_Class}", | ||
| 132 | CLASSES : "{Wym_Classes}", | ||
| 133 | CLASSES_ITEMS : "{Wym_Classes_Items}", | ||
| 134 | CLASS_NAME : "{Wym_Class_Name}", | ||
| 135 | CLASS_TITLE : "{Wym_Class_Title}", | ||
| 136 | CONTAINERS : "{Wym_Containers}", | ||
| 137 | CONTAINERS_ITEMS : "{Wym_Containers_Items}", | ||
| 138 | CONTAINER_NAME : "{Wym_Container_Name}", | ||
| 139 | CONTAINER_TITLE : "{Wym_Containers_Title}", | ||
| 140 | CONTAINER_CLASS : "{Wym_Container_Class}", | ||
| 141 | HTML : "{Wym_Html}", | ||
| 142 | IFRAME : "{Wym_Iframe}", | ||
| 143 | STATUS : "{Wym_Status}", | ||
| 144 | DIALOG_TITLE : "{Wym_Dialog_Title}", | ||
| 145 | DIALOG_BODY : "{Wym_Dialog_Body}", | ||
| 146 | STRING : "string", | ||
| 147 | BODY : "body", | ||
| 148 | DIV : "div", | ||
| 149 | P : "p", | ||
| 150 | H1 : "h1", | ||
| 151 | H2 : "h2", | ||
| 152 | H3 : "h3", | ||
| 153 | H4 : "h4", | ||
| 154 | H5 : "h5", | ||
| 155 | H6 : "h6", | ||
| 156 | PRE : "pre", | ||
| 157 | BLOCKQUOTE : "blockquote", | ||
| 158 | A : "a", | ||
| 159 | BR : "br", | ||
| 160 | IMG : "img", | ||
| 161 | TABLE : "table", | ||
| 162 | TD : "td", | ||
| 163 | TH : "th", | ||
| 164 | UL : "ul", | ||
| 165 | OL : "ol", | ||
| 166 | LI : "li", | ||
| 167 | CLASS : "class", | ||
| 168 | HREF : "href", | ||
| 169 | SRC : "src", | ||
| 170 | TITLE : "title", | ||
| 171 | ALT : "alt", | ||
| 172 | DIALOG_LINK : "Link", | ||
| 173 | DIALOG_IMAGE : "Image", | ||
| 174 | DIALOG_TABLE : "Table", | ||
| 175 | DIALOG_PASTE : "Paste_From_Word", | ||
| 176 | BOLD : "Bold", | ||
| 177 | ITALIC : "Italic", | ||
| 178 | CREATE_LINK : "CreateLink", | ||
| 179 | INSERT_IMAGE : "InsertImage", | ||
| 180 | INSERT_TABLE : "InsertTable", | ||
| 181 | INSERT_HTML : "InsertHTML", | ||
| 182 | PASTE : "Paste", | ||
| 183 | INDENT : "Indent", | ||
| 184 | OUTDENT : "Outdent", | ||
| 185 | TOGGLE_HTML : "ToggleHtml", | ||
| 186 | FORMAT_BLOCK : "FormatBlock", | ||
| 187 | PREVIEW : "Preview", | ||
| 188 | |||
| 189 | UNLINK : "Unlink", | ||
| 190 | INSERT_UNORDEREDLIST : "InsertUnorderedList", | ||
| 191 | INSERT_ORDEREDLIST : "InsertOrderedList", | ||
| 192 | |||
| 193 | MAIN_CONTAINERS : new Array("p","h1","h2","h3","h4","h5","h6","pre","blockquote"), | ||
| 194 | |||
| 195 | BLOCKS : new Array("address", "blockquote", "div", "dl", | ||
| 196 | "fieldset", "form", "h1", "h2", "h3", "h4", "h5", "h6", "hr", | ||
| 197 | "noscript", "ol", "p", "pre", "table", "ul", "dd", "dt", | ||
| 198 | "li", "tbody", "td", "tfoot", "th", "thead", "tr"), | ||
| 199 | |||
| 200 | KEY : { | ||
| 201 | BACKSPACE: 8, | ||
| 202 | ENTER: 13, | ||
| 203 | END: 35, | ||
| 204 | HOME: 36, | ||
| 205 | LEFT: 37, | ||
| 206 | UP: 38, | ||
| 207 | RIGHT: 39, | ||
| 208 | DOWN: 40, | ||
| 209 | CURSOR: new Array(37, 38, 39, 40), | ||
| 210 | DELETE: 46 | ||
| 211 | }, | ||
| 212 | |||
| 213 | NODE : { | ||
| 214 | ELEMENT: 1, | ||
| 215 | ATTRIBUTE: 2, | ||
| 216 | TEXT: 3 | ||
| 217 | }, | ||
| 218 | |||
| 219 | /* | ||
| 220 | Class: WYMeditor.editor | ||
| 221 | WYMeditor editor main class, instanciated for each editor occurrence. | ||
| 222 | */ | ||
| 223 | |||
| 224 | editor : function(elem, options) { | ||
| 225 | |||
| 226 | /* | ||
| 227 | Constructor: WYMeditor.editor | ||
| 228 | |||
| 229 | Initializes main values (index, elements, paths, ...) | ||
| 230 | and call WYMeditor.editor.init which initializes the editor. | ||
| 231 | |||
| 232 | Parameters: | ||
| 233 | |||
| 234 | elem - The HTML element to be replaced by the editor. | ||
| 235 | options - The hash of options. | ||
| 236 | |||
| 237 | Returns: | ||
| 238 | |||
| 239 | Nothing. | ||
| 240 | |||
| 241 | See Also: | ||
| 242 | |||
| 243 | <WYMeditor.editor.init> | ||
| 244 | */ | ||
| 245 | |||
| 246 | //store the instance in the INSTANCES array and store the index | ||
| 247 | this._index = WYMeditor.INSTANCES.push(this) - 1; | ||
| 248 | //store the element replaced by the editor | ||
| 249 | this._element = elem; | ||
| 250 | //store the options | ||
| 251 | this._options = options; | ||
| 252 | //store the element's inner value | ||
| 253 | this._html = jQuery(elem).val(); | ||
| 254 | |||
| 255 | //store the HTML option, if any | ||
| 256 | if(this._options.html) this._html = this._options.html; | ||
| 257 | //get or compute the base path (where the main JS file is located) | ||
| 258 | this._options.basePath = this._options.basePath | ||
| 259 | || this.computeBasePath(); | ||
| 260 | //get or set the skin path (where the skin files are located) | ||
| 261 | this._options.skinPath = this._options.skinPath | ||
| 262 | || this._options.basePath + WYMeditor.SKINS_DEFAULT_PATH | ||
| 263 | + this._options.skin + '/'; | ||
| 264 | //get or compute the main JS file location | ||
| 265 | this._options.wymPath = this._options.wymPath | ||
| 266 | || this.computeWymPath(); | ||
| 267 | //get or set the language files path | ||
| 268 | this._options.langPath = this._options.langPath | ||
| 269 | || this._options.basePath + WYMeditor.LANG_DEFAULT_PATH; | ||
| 270 | //get or set the designmode iframe's base path | ||
| 271 | this._options.iframeBasePath = this._options.iframeBasePath | ||
| 272 | || this._options.basePath + WYMeditor.IFRAME_DEFAULT; | ||
| 273 | //get or compute the jQuery JS file location | ||
| 274 | this._options.jQueryPath = this._options.jQueryPath | ||
| 275 | || this.computeJqueryPath(); | ||
| 276 | |||
| 277 | //initialize the editor instance | ||
| 278 | this.init(); | ||
| 279 | |||
| 280 | } | ||
| 281 | |||
| 282 | }); | ||
| 283 | |||
| 284 | |||
| 285 | /********** JQUERY **********/ | ||
| 286 | |||
| 287 | /** | ||
| 288 | * Replace an HTML element by WYMeditor | ||
| 289 | * | ||
| 290 | * @example jQuery(".wymeditor").wymeditor( | ||
| 291 | * { | ||
| 292 | * | ||
| 293 | * } | ||
| 294 | * ); | ||
| 295 | * @desc Example description here | ||
| 296 | * | ||
| 297 | * @name WYMeditor | ||
| 298 | * @description WYMeditor is a web-based WYSIWYM XHTML editor | ||
| 299 | * @param Hash hash A hash of parameters | ||
| 300 | * @option Integer iExample Description here | ||
| 301 | * @option String sExample Description here | ||
| 302 | * | ||
| 303 | * @type jQuery | ||
| 304 | * @cat Plugins/WYMeditor | ||
| 305 | * @author Jean-Francois Hovinne | ||
| 306 | */ | ||
| 307 | jQuery.fn.wymeditor = function(options) { | ||
| 308 | |||
| 309 | options = jQuery.extend({ | ||
| 310 | |||
| 311 | html: "", | ||
| 312 | |||
| 313 | basePath: false, | ||
| 314 | |||
| 315 | skinPath: false, | ||
| 316 | |||
| 317 | wymPath: false, | ||
| 318 | |||
| 319 | iframeBasePath: false, | ||
| 320 | |||
| 321 | jQueryPath: false, | ||
| 322 | |||
| 323 | styles: false, | ||
| 324 | |||
| 325 | stylesheet: false, | ||
| 326 | |||
| 327 | skin: "default", | ||
| 328 | initSkin: true, | ||
| 329 | loadSkin: true, | ||
| 330 | |||
| 331 | lang: "en", | ||
| 332 | |||
| 333 | direction: "ltr", | ||
| 334 | |||
| 335 | boxHtml: "<div class='wym_box'>" | ||
| 336 | + "<div class='wym_area_top'>" | ||
| 337 | + WYMeditor.TOOLS | ||
| 338 | + "</div>" | ||
| 339 | + "<div class='wym_area_left'></div>" | ||
| 340 | + "<div class='wym_area_right'>" | ||
| 341 | + WYMeditor.CONTAINERS | ||
| 342 | + WYMeditor.CLASSES | ||
| 343 | + "</div>" | ||
| 344 | + "<div class='wym_area_main'>" | ||
| 345 | + WYMeditor.HTML | ||
| 346 | + WYMeditor.IFRAME | ||
| 347 | + WYMeditor.STATUS | ||
| 348 | + "</div>" | ||
| 349 | + "<div class='wym_area_bottom'>" | ||
| 350 | + WYMeditor.LOGO | ||
| 351 | + "</div>" | ||
| 352 | + "</div>", | ||
| 353 | |||
| 354 | logoHtml: "<a class='wym_wymeditor_link' " | ||
| 355 | + "href='http://www.wymeditor.org/'>WYMeditor</a>", | ||
| 356 | |||
| 357 | iframeHtml:"<div class='wym_iframe wym_section'>" | ||
| 358 | + "<iframe " | ||
| 359 | + "src='" | ||
| 360 | + WYMeditor.IFRAME_BASE_PATH | ||
| 361 | + "wymiframe.html' " | ||
| 362 | + "onload='this.contentWindow.parent.WYMeditor.INSTANCES[" | ||
| 363 | + WYMeditor.INDEX + "].initIframe(this)'" | ||
| 364 | + "></iframe>" | ||
| 365 | + "</div>", | ||
| 366 | |||
| 367 | editorStyles: [], | ||
| 368 | |||
| 369 | toolsHtml: "<div class='wym_tools wym_section'>" | ||
| 370 | + "<h2>{Tools}</h2>" | ||
| 371 | + "<ul>" | ||
| 372 | + WYMeditor.TOOLS_ITEMS | ||
| 373 | + "</ul>" | ||
| 374 | + "</div>", | ||
| 375 | |||
| 376 | toolsItemHtml: "<li class='" | ||
| 377 | + WYMeditor.TOOL_CLASS | ||
| 378 | + "'><a href='#' name='" | ||
| 379 | + WYMeditor.TOOL_NAME | ||
| 380 | + "' title='" | ||
| 381 | + WYMeditor.TOOL_TITLE | ||
| 382 | + "'>" | ||
| 383 | + WYMeditor.TOOL_TITLE | ||
| 384 | + "</a></li>", | ||
| 385 | |||
| 386 | toolsItems: [ | ||
| 387 | {'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}, | ||
| 388 | {'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}, | ||
| 389 | {'name': 'Superscript', 'title': 'Superscript', | ||
| 390 | 'css': 'wym_tools_superscript'}, | ||
| 391 | {'name': 'Subscript', 'title': 'Subscript', | ||
| 392 | 'css': 'wym_tools_subscript'}, | ||
| 393 | {'name': 'InsertOrderedList', 'title': 'Ordered_List', | ||
| 394 | 'css': 'wym_tools_ordered_list'}, | ||
| 395 | {'name': 'InsertUnorderedList', 'title': 'Unordered_List', | ||
| 396 | 'css': 'wym_tools_unordered_list'}, | ||
| 397 | {'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}, | ||
| 398 | {'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}, | ||
| 399 | {'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}, | ||
| 400 | {'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}, | ||
| 401 | {'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}, | ||
| 402 | {'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}, | ||
| 403 | {'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}, | ||
| 404 | {'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'}, | ||
| 405 | {'name': 'Paste', 'title': 'Paste_From_Word', | ||
| 406 | 'css': 'wym_tools_paste'}, | ||
| 407 | {'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}, | ||
| 408 | {'name': 'Preview', 'title': 'Preview', 'css': 'wym_tools_preview'} | ||
| 409 | ], | ||
| 410 | |||
| 411 | containersHtml: "<div class='wym_containers wym_section'>" | ||
| 412 | + "<h2>{Containers}</h2>" | ||
| 413 | + "<ul>" | ||
| 414 | + WYMeditor.CONTAINERS_ITEMS | ||
| 415 | + "</ul>" | ||
| 416 | + "</div>", | ||
| 417 | |||
| 418 | containersItemHtml:"<li class='" | ||
| 419 | + WYMeditor.CONTAINER_CLASS | ||
| 420 | + "'>" | ||
| 421 | + "<a href='#' name='" | ||
| 422 | + WYMeditor.CONTAINER_NAME | ||
| 423 | + "'>" | ||
| 424 | + WYMeditor.CONTAINER_TITLE | ||
| 425 | + "</a></li>", | ||
| 426 | |||
| 427 | containersItems: [ | ||
| 428 | {'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}, | ||
| 429 | {'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}, | ||
| 430 | {'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}, | ||
| 431 | {'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}, | ||
| 432 | {'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}, | ||
| 433 | {'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}, | ||
| 434 | {'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}, | ||
| 435 | {'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}, | ||
| 436 | {'name': 'BLOCKQUOTE', 'title': 'Blockquote', | ||
| 437 | 'css': 'wym_containers_blockquote'}, | ||
| 438 | {'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'} | ||
| 439 | ], | ||
| 440 | |||
| 441 | classesHtml: "<div class='wym_classes wym_section'>" | ||
| 442 | + "<h2>{Classes}</h2><ul>" | ||
| 443 | + WYMeditor.CLASSES_ITEMS | ||
| 444 | + "</ul></div>", | ||
| 445 | |||
| 446 | classesItemHtml: "<li><a href='#' name='" | ||
| 447 | + WYMeditor.CLASS_NAME | ||
| 448 | + "'>" | ||
| 449 | + WYMeditor.CLASS_TITLE | ||
| 450 | + "</a></li>", | ||
| 451 | |||
| 452 | classesItems: [], | ||
| 453 | |||
| 454 | statusHtml: "<div class='wym_status wym_section'>" | ||
| 455 | + "<h2>{Status}</h2>" | ||
| 456 | + "</div>", | ||
| 457 | |||
| 458 | htmlHtml: "<div class='wym_html wym_section'>" | ||
| 459 | + "<h2>{Source_Code}</h2>" | ||
| 460 | + "<textarea class='wym_html_val'></textarea>" | ||
| 461 | + "</div>", | ||
| 462 | |||
| 463 | boxSelector: ".wym_box", | ||
| 464 | toolsSelector: ".wym_tools", | ||
| 465 | toolsListSelector: " ul", | ||
| 466 | containersSelector:".wym_containers", | ||
| 467 | classesSelector: ".wym_classes", | ||
| 468 | htmlSelector: ".wym_html", | ||
| 469 | iframeSelector: ".wym_iframe iframe", | ||
| 470 | iframeBodySelector:".wym_iframe", | ||
| 471 | statusSelector: ".wym_status", | ||
| 472 | toolSelector: ".wym_tools a", | ||
| 473 | containerSelector: ".wym_containers a", | ||
| 474 | classSelector: ".wym_classes a", | ||
| 475 | htmlValSelector: ".wym_html_val", | ||
| 476 | |||
| 477 | hrefSelector: ".wym_href", | ||
| 478 | srcSelector: ".wym_src", | ||
| 479 | titleSelector: ".wym_title", | ||
| 480 | altSelector: ".wym_alt", | ||
| 481 | textSelector: ".wym_text", | ||
| 482 | |||
| 483 | rowsSelector: ".wym_rows", | ||
| 484 | colsSelector: ".wym_cols", | ||
| 485 | captionSelector: ".wym_caption", | ||
| 486 | summarySelector: ".wym_summary", | ||
| 487 | |||
| 488 | submitSelector: ".wym_submit", | ||
| 489 | cancelSelector: ".wym_cancel", | ||
| 490 | previewSelector: "", | ||
| 491 | |||
| 492 | dialogTypeSelector: ".wym_dialog_type", | ||
| 493 | dialogLinkSelector: ".wym_dialog_link", | ||
| 494 | dialogImageSelector: ".wym_dialog_image", | ||
| 495 | dialogTableSelector: ".wym_dialog_table", | ||
| 496 | dialogPasteSelector: ".wym_dialog_paste", | ||
| 497 | dialogPreviewSelector: ".wym_dialog_preview", | ||
| 498 | |||
| 499 | updateSelector: ".wymupdate", | ||
| 500 | updateEvent: "click", | ||
| 501 | |||
| 502 | dialogFeatures: "menubar=no,titlebar=no,toolbar=no,resizable=no" | ||
| 503 | + ",width=560,height=300,top=0,left=0", | ||
| 504 | |||
| 505 | dialogHtml: "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'" | ||
| 506 | + " 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>" | ||
| 507 | + "<html dir='" | ||
| 508 | + WYMeditor.DIRECTION | ||
| 509 | + "'><head>" | ||
| 510 | + "<link rel='stylesheet' type='text/css' media='screen'" | ||
| 511 | + " href='" | ||
| 512 | + WYMeditor.CSS_PATH | ||
| 513 | + "' />" | ||
| 514 | + "<title>" | ||
| 515 | + WYMeditor.DIALOG_TITLE | ||
| 516 | + "</title>" | ||
| 517 | + "<script type='text/javascript'" | ||
| 518 | + " src='" | ||
| 519 | + WYMeditor.JQUERY_PATH | ||
| 520 | + "'></script>" | ||
| 521 | + "<script type='text/javascript'" | ||
| 522 | + " src='" | ||
| 523 | + WYMeditor.WYM_PATH | ||
| 524 | + "'></script>" | ||
| 525 | + "</head>" | ||
| 526 | + WYMeditor.DIALOG_BODY | ||
| 527 | + "</html>", | ||
| 528 | |||
| 529 | dialogLinkHtml: "<body class='wym_dialog wym_dialog_link'" | ||
| 530 | + " onload='WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")'" | ||
| 531 | + ">" | ||
| 532 | + "<form>" | ||
| 533 | + "<fieldset>" | ||
| 534 | + "<input type='hidden' class='wym_dialog_type' value='" | ||
| 535 | + WYMeditor.DIALOG_LINK | ||
| 536 | + "' />" | ||
| 537 | + "<legend>{Link}</legend>" | ||
| 538 | + "<div class='row'>" | ||
| 539 | + "<label>{URL}</label>" | ||
| 540 | + "<input type='text' class='wym_href' value='' size='40' />" | ||
| 541 | + "</div>" | ||
| 542 | + "<div class='row'>" | ||
| 543 | + "<label>{Title}</label>" | ||
| 544 | + "<input type='text' class='wym_title' value='' size='40' />" | ||
| 545 | + "</div>" | ||
| 546 | + "<div class='row row-indent'>" | ||
| 547 | + "<input class='wym_submit' type='button'" | ||
| 548 | + " value='{Submit}' />" | ||
| 549 | + "<input class='wym_cancel' type='button'" | ||
| 550 | + "value='{Cancel}' />" | ||
| 551 | + "</div>" | ||
| 552 | + "</fieldset>" | ||
| 553 | + "</form>" | ||
| 554 | + "</body>", | ||
| 555 | |||
| 556 | dialogImageHtml: "<body class='wym_dialog wym_dialog_image'" | ||
| 557 | + " onload='WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")'" | ||
| 558 | + ">" | ||
| 559 | + "<form>" | ||
| 560 | + "<fieldset>" | ||
| 561 | + "<input type='hidden' class='wym_dialog_type' value='" | ||
| 562 | + WYMeditor.DIALOG_IMAGE | ||
| 563 | + "' />" | ||
| 564 | + "<legend>{Image}</legend>" | ||
| 565 | + "<div class='row'>" | ||
| 566 | + "<label>{URL}</label>" | ||
| 567 | + "<input type='text' class='wym_src' value='' size='40' />" | ||
| 568 | + "</div>" | ||
| 569 | + "<div class='row'>" | ||
| 570 | + "<label>{Alternative_Text}</label>" | ||
| 571 | + "<input type='text' class='wym_alt' value='' size='40' />" | ||
| 572 | + "</div>" | ||
| 573 | + "<div class='row'>" | ||
| 574 | + "<label>{Title}</label>" | ||
| 575 | + "<input type='text' class='wym_title' value='' size='40' />" | ||
| 576 | + "</div>" | ||
| 577 | + "<div class='row row-indent'>" | ||
| 578 | + "<input class='wym_submit' type='button'" | ||
| 579 | + " value='{Submit}' />" | ||
| 580 | + "<input class='wym_cancel' type='button'" | ||
| 581 | + "value='{Cancel}' />" | ||
| 582 | + "</div>" | ||
| 583 | + "</fieldset>" | ||
| 584 | + "</form>" | ||
| 585 | + "</body>", | ||
| 586 | |||
| 587 | dialogTableHtml: "<body class='wym_dialog wym_dialog_table'" | ||
| 588 | + " onload='WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")'" | ||
| 589 | + ">" | ||
| 590 | + "<form>" | ||
| 591 | + "<fieldset>" | ||
| 592 | + "<input type='hidden' class='wym_dialog_type' value='" | ||
| 593 | + WYMeditor.DIALOG_TABLE | ||
| 594 | + "' />" | ||
| 595 | + "<legend>{Table}</legend>" | ||
| 596 | + "<div class='row'>" | ||
| 597 | + "<label>{Caption}</label>" | ||
| 598 | + "<input type='text' class='wym_caption' value='' size='40' />" | ||
| 599 | + "</div>" | ||
| 600 | + "<div class='row'>" | ||
| 601 | + "<label>{Summary}</label>" | ||
| 602 | + "<input type='text' class='wym_summary' value='' size='40' />" | ||
| 603 | + "</div>" | ||
| 604 | + "<div class='row'>" | ||
| 605 | + "<label>{Number_Of_Rows}</label>" | ||
| 606 | + "<input type='text' class='wym_rows' value='3' size='3' />" | ||
| 607 | + "</div>" | ||
| 608 | + "<div class='row'>" | ||
| 609 | + "<label>{Number_Of_Cols}</label>" | ||
| 610 | + "<input type='text' class='wym_cols' value='2' size='3' />" | ||
| 611 | + "</div>" | ||
| 612 | + "<div class='row row-indent'>" | ||
| 613 | + "<input class='wym_submit' type='button'" | ||
| 614 | + " value='{Submit}' />" | ||
| 615 | + "<input class='wym_cancel' type='button'" | ||
| 616 | + "value='{Cancel}' />" | ||
| 617 | + "</div>" | ||
| 618 | + "</fieldset>" | ||
| 619 | + "</form>" | ||
| 620 | + "</body>", | ||
| 621 | |||
| 622 | dialogPasteHtml: "<body class='wym_dialog wym_dialog_paste'" | ||
| 623 | + " onload='WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")'" | ||
| 624 | + ">" | ||
| 625 | + "<form>" | ||
| 626 | + "<input type='hidden' class='wym_dialog_type' value='" | ||
| 627 | + WYMeditor.DIALOG_PASTE | ||
| 628 | + "' />" | ||
| 629 | + "<fieldset>" | ||
| 630 | + "<legend>{Paste_From_Word}</legend>" | ||
| 631 | + "<div class='row'>" | ||
| 632 | + "<textarea class='wym_text' rows='10' cols='50'></textarea>" | ||
| 633 | + "</div>" | ||
| 634 | + "<div class='row'>" | ||
| 635 | + "<input class='wym_submit' type='button'" | ||
| 636 | + " value='{Submit}' />" | ||
| 637 | + "<input class='wym_cancel' type='button'" | ||
| 638 | + "value='{Cancel}' />" | ||
| 639 | + "</div>" | ||
| 640 | + "</fieldset>" | ||
| 641 | + "</form>" | ||
| 642 | + "</body>", | ||
| 643 | |||
| 644 | dialogPreviewHtml: "<body class='wym_dialog wym_dialog_preview'" | ||
| 645 | + " onload='WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")'" | ||
| 646 | + "></body>", | ||
| 647 | |||
| 648 | dialogStyles: [], | ||
| 649 | |||
| 650 | stringDelimiterLeft: "{", | ||
| 651 | stringDelimiterRight:"}", | ||
| 652 | |||
| 653 | preInit: null, | ||
| 654 | preBind: null, | ||
| 655 | postInit: null, | ||
| 656 | |||
| 657 | preInitDialog: null, | ||
| 658 | postInitDialog: null | ||
| 659 | |||
| 660 | }, options); | ||
| 661 | |||
| 662 | return this.each(function() { | ||
| 663 | |||
| 664 | new WYMeditor.editor(jQuery(this),options); | ||
| 665 | }); | ||
| 666 | }; | ||
| 667 | |||
| 668 | /* @name extend | ||
| 669 | * @description Returns the WYMeditor instance based on its index | ||
| 670 | */ | ||
| 671 | jQuery.extend({ | ||
| 672 | wymeditors: function(i) { | ||
| 673 | return (WYMeditor.INSTANCES[i]); | ||
| 674 | } | ||
| 675 | }); | ||
| 676 | |||
| 677 | |||
| 678 | /********** WYMeditor **********/ | ||
| 679 | |||
| 680 | /* @name Wymeditor | ||
| 681 | * @description WYMeditor class | ||
| 682 | */ | ||
| 683 | |||
| 684 | /* @name init | ||
| 685 | * @description Initializes a WYMeditor instance | ||
| 686 | */ | ||
| 687 | WYMeditor.editor.prototype.init = function() { | ||
| 688 | |||
| 689 | //load subclass - browser specific | ||
| 690 | //unsupported browsers: do nothing | ||
| 691 | if (jQuery.browser.msie) { | ||
| 692 | var WymClass = new WYMeditor.WymClassExplorer(this); | ||
| 693 | } | ||
| 694 | else if (jQuery.browser.mozilla) { | ||
| 695 | var WymClass = new WYMeditor.WymClassMozilla(this); | ||
| 696 | } | ||
| 697 | else if (jQuery.browser.opera) { | ||
| 698 | var WymClass = new WYMeditor.WymClassOpera(this); | ||
| 699 | } | ||
| 700 | else if (jQuery.browser.safari) { | ||
| 701 | var WymClass = new WYMeditor.WymClassSafari(this); | ||
| 702 | } | ||
| 703 | |||
| 704 | if(WymClass) { | ||
| 705 | |||
| 706 | if(jQuery.isFunction(this._options.preInit)) this._options.preInit(this); | ||
| 707 | |||
| 708 | var SaxListener = new WYMeditor.XhtmlSaxListener(); | ||
| 709 | jQuery.extend(SaxListener, WymClass); | ||
| 710 | this.parser = new WYMeditor.XhtmlParser(SaxListener); | ||
| 711 | |||
| 712 | if(this._options.styles || this._options.stylesheet){ | ||
| 713 | this.configureEditorUsingRawCss(); | ||
| 714 | } | ||
| 715 | |||
| 716 | this.helper = new WYMeditor.XmlHelper(); | ||
| 717 | |||
| 718 | //extend the Wymeditor object | ||
| 719 | //don't use jQuery.extend since 1.1.4 | ||
| 720 | //jQuery.extend(this, WymClass); | ||
| 721 | for (var prop in WymClass) { this[prop] = WymClass[prop]; } | ||
| 722 | |||
| 723 | //load wymbox | ||
| 724 | this._box = jQuery(this._element).hide().after(this._options.boxHtml).next(); | ||
| 725 | |||
| 726 | //store the instance index in the wymbox element | ||
| 727 | jQuery(this._box).data(WYMeditor.WYM_INDEX, this._index); | ||
| 728 | |||
| 729 | var h = WYMeditor.Helper; | ||
| 730 | |||
| 731 | //construct the iframe | ||
| 732 | var iframeHtml = this._options.iframeHtml; | ||
| 733 | iframeHtml = h.replaceAll(iframeHtml, WYMeditor.INDEX, this._index); | ||
| 734 | iframeHtml = h.replaceAll(iframeHtml, WYMeditor.IFRAME_BASE_PATH, this._options.iframeBasePath); | ||
| 735 | |||
| 736 | //construct wymbox | ||
| 737 | var boxHtml = jQuery(this._box).html(); | ||
| 738 | |||
| 739 | boxHtml = h.replaceAll(boxHtml, WYMeditor.LOGO, this._options.logoHtml); | ||
| 740 | boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS, this._options.toolsHtml); | ||
| 741 | boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS,this._options.containersHtml); | ||
| 742 | boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES, this._options.classesHtml); | ||
| 743 | boxHtml = h.replaceAll(boxHtml, WYMeditor.HTML, this._options.htmlHtml); | ||
| 744 | boxHtml = h.replaceAll(boxHtml, WYMeditor.IFRAME, iframeHtml); | ||
| 745 | boxHtml = h.replaceAll(boxHtml, WYMeditor.STATUS, this._options.statusHtml); | ||
| 746 | |||
| 747 | //construct tools list | ||
| 748 | var aTools = eval(this._options.toolsItems); | ||
| 749 | var sTools = ""; | ||
| 750 | |||
| 751 | for(var i = 0; i < aTools.length; i++) { | ||
| 752 | var oTool = aTools[i]; | ||
| 753 | if(oTool.name && oTool.title) | ||
| 754 | var sTool = this._options.toolsItemHtml; | ||
| 755 | var sTool = h.replaceAll(sTool, WYMeditor.TOOL_NAME, oTool.name); | ||
| 756 | sTool = h.replaceAll(sTool, WYMeditor.TOOL_TITLE, this._options.stringDelimiterLeft | ||
| 757 | + oTool.title | ||
| 758 | + this._options.stringDelimiterRight); | ||
| 759 | sTool = h.replaceAll(sTool, WYMeditor.TOOL_CLASS, oTool.css); | ||
| 760 | sTools += sTool; | ||
| 761 | } | ||
| 762 | |||
| 763 | boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS_ITEMS, sTools); | ||
| 764 | |||
| 765 | //construct classes list | ||
| 766 | var aClasses = eval(this._options.classesItems); | ||
| 767 | var sClasses = ""; | ||
| 768 | |||
| 769 | for(var i = 0; i < aClasses.length; i++) { | ||
| 770 | var oClass = aClasses[i]; | ||
| 771 | if(oClass.name && oClass.title) | ||
| 772 | var sClass = this._options.classesItemHtml; | ||
| 773 | sClass = h.replaceAll(sClass, WYMeditor.CLASS_NAME, oClass.name); | ||
| 774 | sClass = h.replaceAll(sClass, WYMeditor.CLASS_TITLE, oClass.title); | ||
| 775 | sClasses += sClass; | ||
| 776 | } | ||
| 777 | |||
| 778 | boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES_ITEMS, sClasses); | ||
| 779 | |||
| 780 | //construct containers list | ||
| 781 | var aContainers = eval(this._options.containersItems); | ||
| 782 | var sContainers = ""; | ||
| 783 | |||
| 784 | for(var i = 0; i < aContainers.length; i++) { | ||
| 785 | var oContainer = aContainers[i]; | ||
| 786 | if(oContainer.name && oContainer.title) | ||
| 787 | var sContainer = this._options.containersItemHtml; | ||
| 788 | sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_NAME, oContainer.name); | ||
| 789 | sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_TITLE, | ||
| 790 | this._options.stringDelimiterLeft | ||
| 791 | + oContainer.title | ||
| 792 | + this._options.stringDelimiterRight); | ||
| 793 | sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_CLASS, oContainer.css); | ||
| 794 | sContainers += sContainer; | ||
| 795 | } | ||
| 796 | |||
| 797 | boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS_ITEMS, sContainers); | ||
| 798 | |||
| 799 | //l10n | ||
| 800 | boxHtml = this.replaceStrings(boxHtml); | ||
| 801 | |||
| 802 | //load html in wymbox | ||
| 803 | jQuery(this._box).html(boxHtml); | ||
| 804 | |||
| 805 | //hide the html value | ||
| 806 | jQuery(this._box).find(this._options.htmlSelector).hide(); | ||
| 807 | |||
| 808 | //enable the skin | ||
| 809 | this.loadSkin(); | ||
| 810 | |||
| 811 | } | ||
| 812 | }; | ||
| 813 | |||
| 814 | WYMeditor.editor.prototype.bindEvents = function() { | ||
| 815 | |||
| 816 | //copy the instance | ||
| 817 | var wym = this; | ||
| 818 | |||
| 819 | //handle click event on tools buttons | ||
| 820 | jQuery(this._box).find(this._options.toolSelector).click(function() { | ||
| 821 | wym.exec(jQuery(this).attr(WYMeditor.NAME)); | ||
| 822 | return(false); | ||
| 823 | }); | ||
| 824 | |||
| 825 | //handle click event on containers buttons | ||
| 826 | jQuery(this._box).find(this._options.containerSelector).click(function() { | ||
| 827 | wym.container(jQuery(this).attr(WYMeditor.NAME)); | ||
| 828 | return(false); | ||
| 829 | }); | ||
| 830 | |||
| 831 | //handle keyup event on html value: set the editor value | ||
| 832 | jQuery(this._box).find(this._options.htmlValSelector).keyup(function() { | ||
| 833 | jQuery(wym._doc.body).html(jQuery(this).val()); | ||
| 834 | }); | ||
| 835 | |||
| 836 | //handle click event on classes buttons | ||
| 837 | jQuery(this._box).find(this._options.classSelector).click(function() { | ||
| 838 | |||
| 839 | var aClasses = eval(wym._options.classesItems); | ||
| 840 | var sName = jQuery(this).attr(WYMeditor.NAME); | ||
| 841 | |||
| 842 | var oClass = WYMeditor.Helper.findByName(aClasses, sName); | ||
| 843 | |||
| 844 | if(oClass) { | ||
| 845 | var jqexpr = oClass.expr; | ||
| 846 | wym.toggleClass(sName, jqexpr); | ||
| 847 | } | ||
| 848 | return(false); | ||
| 849 | }); | ||
| 850 | |||
| 851 | //handle event on update element | ||
| 852 | jQuery(this._options.updateSelector) | ||
| 853 | .bind(this._options.updateEvent, function() { | ||
| 854 | wym.update(); | ||
| 855 | }); | ||
| 856 | }; | ||
| 857 | |||
| 858 | WYMeditor.editor.prototype.ready = function() { | ||
| 859 | return(this._doc != null); | ||
| 860 | }; | ||
| 861 | |||
| 862 | |||
| 863 | /********** METHODS **********/ | ||
| 864 | |||
| 865 | /* @name box | ||
| 866 | * @description Returns the WYMeditor container | ||
| 867 | */ | ||
| 868 | WYMeditor.editor.prototype.box = function() { | ||
| 869 | return(this._box); | ||
| 870 | }; | ||
| 871 | |||
| 872 | /* @name html | ||
| 873 | * @description Get/Set the html value | ||
| 874 | */ | ||
| 875 | WYMeditor.editor.prototype.html = function(html) { | ||
| 876 | |||
| 877 | if(typeof html === 'string') jQuery(this._doc.body).html(html); | ||
| 878 | else return(jQuery(this._doc.body).html()); | ||
| 879 | }; | ||
| 880 | |||
| 881 | /* @name xhtml | ||
| 882 | * @description Cleans up the HTML | ||
| 883 | */ | ||
| 884 | WYMeditor.editor.prototype.xhtml = function() { | ||
| 885 | return this.parser.parse(this.html()); | ||
| 886 | }; | ||
| 887 | |||
| 888 | /* @name exec | ||
| 889 | * @description Executes a button command | ||
| 890 | */ | ||
| 891 | WYMeditor.editor.prototype.exec = function(cmd) { | ||
| 892 | |||
| 893 | //base function for execCommand | ||
| 894 | //open a dialog or exec | ||
| 895 | switch(cmd) { | ||
| 896 | case WYMeditor.CREATE_LINK: | ||
| 897 | var container = this.container(); | ||
| 898 | if(container || this._selected_image) this.dialog(WYMeditor.DIALOG_LINK); | ||
| 899 | break; | ||
| 900 | |||
| 901 | case WYMeditor.INSERT_IMAGE: | ||
| 902 | this.dialog(WYMeditor.DIALOG_IMAGE); | ||
| 903 | break; | ||
| 904 | |||
| 905 | case WYMeditor.INSERT_TABLE: | ||
| 906 | this.dialog(WYMeditor.DIALOG_TABLE); | ||
| 907 | break; | ||
| 908 | |||
| 909 | case WYMeditor.PASTE: | ||
| 910 | this.dialog(WYMeditor.DIALOG_PASTE); | ||
| 911 | break; | ||
| 912 | |||
| 913 | case WYMeditor.TOGGLE_HTML: | ||
| 914 | this.update(); | ||
| 915 | this.toggleHtml(); | ||
| 916 | break; | ||
| 917 | |||
| 918 | case WYMeditor.PREVIEW: | ||
| 919 | this.dialog(WYMeditor.PREVIEW); | ||
| 920 | break; | ||
| 921 | |||
| 922 | default: | ||
| 923 | this._exec(cmd); | ||
| 924 | break; | ||
| 925 | } | ||
| 926 | }; | ||
| 927 | |||
| 928 | /* @name container | ||
| 929 | * @description Get/Set the selected container | ||
| 930 | */ | ||
| 931 | WYMeditor.editor.prototype.container = function(sType) { | ||
| 932 | |||
| 933 | if(sType) { | ||
| 934 | |||
| 935 | var container = null; | ||
| 936 | |||
| 937 | if(sType.toLowerCase() == WYMeditor.TH) { | ||
| 938 | |||
| 939 | container = this.container(); | ||
| 940 | |||
| 941 | //find the TD or TH container | ||
| 942 | switch(container.tagName.toLowerCase()) { | ||
| 943 | |||
| 944 | case WYMeditor.TD: case WYMeditor.TH: | ||
| 945 | break; | ||
| 946 | default: | ||
| 947 | var aTypes = new Array(WYMeditor.TD,WYMeditor.TH); | ||
| 948 | container = this.findUp(this.container(), aTypes); | ||
| 949 | break; | ||
| 950 | } | ||
| 951 | |||
| 952 | //if it exists, switch | ||
| 953 | if(container!=null) { | ||
| 954 | |||
| 955 | sType = (container.tagName.toLowerCase() == WYMeditor.TD)? WYMeditor.TH: WYMeditor.TD; | ||
| 956 | this.switchTo(container,sType); | ||
| 957 | this.update(); | ||
| 958 | } | ||
| 959 | } else { | ||
| 960 | |||
| 961 | //set the container type | ||
| 962 | var aTypes=new Array(WYMeditor.P,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5, | ||
| 963 | WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE); | ||
| 964 | container = this.findUp(this.container(), aTypes); | ||
| 965 | |||
| 966 | if(container) { | ||
| 967 | |||
| 968 | var newNode = null; | ||
| 969 | |||
| 970 | //blockquotes must contain a block level element | ||
| 971 | if(sType.toLowerCase() == WYMeditor.BLOCKQUOTE) { | ||
| 972 | |||
| 973 | var blockquote = this.findUp(this.container(), WYMeditor.BLOCKQUOTE); | ||
| 974 | |||
| 975 | if(blockquote == null) { | ||
| 976 | |||
| 977 | newNode = this._doc.createElement(sType); | ||
| 978 | container.parentNode.insertBefore(newNode,container); | ||
| 979 | newNode.appendChild(container); | ||
| 980 | this.setFocusToNode(newNode.firstChild); | ||
| 981 | |||
| 982 | } else { | ||
| 983 | |||
| 984 | var nodes = blockquote.childNodes; | ||
| 985 | var lgt = nodes.length; | ||
| 986 | var firstNode = null; | ||
| 987 | |||
| 988 | if(lgt > 0) firstNode = nodes.item(0); | ||
| 989 | for(var x=0; x<lgt; x++) { | ||
| 990 | blockquote.parentNode.insertBefore(nodes.item(0),blockquote); | ||
| 991 | } | ||
| 992 | blockquote.parentNode.removeChild(blockquote); | ||
| 993 | if(firstNode) this.setFocusToNode(firstNode); | ||
| 994 | } | ||
| 995 | } | ||
| 996 | |||
| 997 | else this.switchTo(container,sType); | ||
| 998 | |||
| 999 | this.update(); | ||
| 1000 | } | ||
| 1001 | } | ||
| 1002 | } | ||
| 1003 | else return(this.selected()); | ||
| 1004 | }; | ||
| 1005 | |||
| 1006 | /* @name toggleClass | ||
| 1007 | * @description Toggles class on selected element, or one of its parents | ||
| 1008 | */ | ||
| 1009 | WYMeditor.editor.prototype.toggleClass = function(sClass, jqexpr) { | ||
| 1010 | |||
| 1011 | var container = (this._selected_image | ||
| 1012 | ? this._selected_image | ||
| 1013 | : jQuery(this.selected())); | ||
| 1014 | container = jQuery(container).parentsOrSelf(jqexpr); | ||
| 1015 | jQuery(container).toggleClass(sClass); | ||
| 1016 | |||
| 1017 | if(!jQuery(container).attr(WYMeditor.CLASS)) jQuery(container).removeAttr(this._class); | ||
| 1018 | |||
| 1019 | }; | ||
| 1020 | |||
| 1021 | /* @name findUp | ||
| 1022 | * @description Returns the first parent or self container, based on its type | ||
| 1023 | */ | ||
| 1024 | WYMeditor.editor.prototype.findUp = function(node, filter) { | ||
| 1025 | |||
| 1026 | //filter is a string or an array of strings | ||
| 1027 | |||
| 1028 | if(node) { | ||
| 1029 | |||
| 1030 | var tagname = node.tagName.toLowerCase(); | ||
| 1031 | |||
| 1032 | if(typeof(filter) == WYMeditor.STRING) { | ||
| 1033 | |||
| 1034 | while(tagname != filter && tagname != WYMeditor.BODY) { | ||
| 1035 | |||
| 1036 | node = node.parentNode; | ||
| 1037 | tagname = node.tagName.toLowerCase(); | ||
| 1038 | } | ||
| 1039 | |||
| 1040 | } else { | ||
| 1041 | |||
| 1042 | var bFound = false; | ||
| 1043 | |||
| 1044 | while(!bFound && tagname != WYMeditor.BODY) { | ||
| 1045 | for(var i = 0; i < filter.length; i++) { | ||
| 1046 | if(tagname == filter[i]) { | ||
| 1047 | bFound = true; | ||
| 1048 | break; | ||
| 1049 | } | ||
| 1050 | } | ||
| 1051 | if(!bFound) { | ||
| 1052 | node = node.parentNode; | ||
| 1053 | tagname = node.tagName.toLowerCase(); | ||
| 1054 | } | ||
| 1055 | } | ||
| 1056 | } | ||
| 1057 | |||
| 1058 | if(tagname != WYMeditor.BODY) return(node); | ||
| 1059 | else return(null); | ||
| 1060 | |||
| 1061 | } else return(null); | ||
| 1062 | }; | ||
| 1063 | |||
| 1064 | /* @name switchTo | ||
| 1065 | * @description Switch the node's type | ||
| 1066 | */ | ||
| 1067 | WYMeditor.editor.prototype.switchTo = function(node,sType) { | ||
| 1068 | |||
| 1069 | var newNode = this._doc.createElement(sType); | ||
| 1070 | var html = jQuery(node).html(); | ||
| 1071 | node.parentNode.replaceChild(newNode,node); | ||
| 1072 | jQuery(newNode).html(html); | ||
| 1073 | this.setFocusToNode(newNode); | ||
| 1074 | }; | ||
| 1075 | |||
| 1076 | WYMeditor.editor.prototype.replaceStrings = function(sVal) { | ||
| 1077 | //check if the language file has already been loaded | ||
| 1078 | //if not, get it via a synchronous ajax call | ||
| 1079 | if(!WYMeditor.STRINGS[this._options.lang]) | ||
| 1080 | eval(jQuery.ajax({url:this._options.langPath | ||
| 1081 | + this._options.lang + '.js', async:false}).responseText); | ||
| 1082 | |||
| 1083 | //replace all the strings in sVal and return it | ||
| 1084 | for (var key in WYMeditor.STRINGS[this._options.lang]) { | ||
| 1085 | sVal = WYMeditor.Helper.replaceAll(sVal, this._options.stringDelimiterLeft + key | ||
| 1086 | + this._options.stringDelimiterRight, | ||
| 1087 | WYMeditor.STRINGS[this._options.lang][key]); | ||
| 1088 | }; | ||
| 1089 | return(sVal); | ||
| 1090 | }; | ||
| 1091 | |||
| 1092 | WYMeditor.editor.prototype.encloseString = function(sVal) { | ||
| 1093 | |||
| 1094 | return(this._options.stringDelimiterLeft | ||
| 1095 | + sVal | ||
| 1096 | + this._options.stringDelimiterRight); | ||
| 1097 | }; | ||
| 1098 | |||
| 1099 | /* @name status | ||
| 1100 | * @description Prints a status message | ||
| 1101 | */ | ||
| 1102 | WYMeditor.editor.prototype.status = function(sMessage) { | ||
| 1103 | |||
| 1104 | //print status message | ||
| 1105 | jQuery(this._box).find(this._options.statusSelector).html(sMessage); | ||
| 1106 | }; | ||
| 1107 | |||
| 1108 | /* @name update | ||
| 1109 | * @description Updates the element and textarea values | ||
| 1110 | */ | ||
| 1111 | WYMeditor.editor.prototype.update = function() { | ||
| 1112 | |||
| 1113 | var html = this.xhtml(); | ||
| 1114 | jQuery(this._element).val(html); | ||
| 1115 | jQuery(this._box).find(this._options.htmlValSelector).val(html); | ||
| 1116 | }; | ||
| 1117 | |||
| 1118 | /* @name dialog | ||
| 1119 | * @description Opens a dialog box | ||
| 1120 | */ | ||
| 1121 | WYMeditor.editor.prototype.dialog = function(sType) { | ||
| 1122 | |||
| 1123 | var wDialog = window.open( | ||
| 1124 | '', | ||
| 1125 | 'dialog', | ||
| 1126 | this._wym._options.dialogFeatures); | ||
| 1127 | |||
| 1128 | if(wDialog) { | ||
| 1129 | |||
| 1130 | var sBodyHtml = ""; | ||
| 1131 | |||
| 1132 | switch(sType) { | ||
| 1133 | |||
| 1134 | case(WYMeditor.DIALOG_LINK): | ||
| 1135 | sBodyHtml = this._options.dialogLinkHtml; | ||
| 1136 | break; | ||
| 1137 | case(WYMeditor.DIALOG_IMAGE): | ||
| 1138 | sBodyHtml = this._options.dialogImageHtml; | ||
| 1139 | break; | ||
| 1140 | case(WYMeditor.DIALOG_TABLE): | ||
| 1141 | sBodyHtml = this._options.dialogTableHtml; | ||
| 1142 | break; | ||
| 1143 | case(WYMeditor.DIALOG_PASTE): | ||
| 1144 | sBodyHtml = this._options.dialogPasteHtml; | ||
| 1145 | break; | ||
| 1146 | case(WYMeditor.PREVIEW): | ||
| 1147 | sBodyHtml = this._options.dialogPreviewHtml; | ||
| 1148 | break; | ||
| 1149 | } | ||
| 1150 | |||
| 1151 | var h = WYMeditor.Helper; | ||
| 1152 | |||
| 1153 | //construct the dialog | ||
| 1154 | var dialogHtml = this._options.dialogHtml; | ||
| 1155 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.BASE_PATH, this._options.basePath); | ||
| 1156 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.DIRECTION, this._options.direction); | ||
| 1157 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.CSS_PATH, this._options.skinPath + WYMeditor.SKINS_DEFAULT_CSS); | ||
| 1158 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.WYM_PATH, this._options.wymPath); | ||
| 1159 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.JQUERY_PATH, this._options.jQueryPath); | ||
| 1160 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.DIALOG_TITLE, this.encloseString(sType)); | ||
| 1161 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.DIALOG_BODY, sBodyHtml); | ||
| 1162 | dialogHtml = h.replaceAll(dialogHtml, WYMeditor.INDEX, this._index); | ||
| 1163 | |||
| 1164 | dialogHtml = this.replaceStrings(dialogHtml); | ||
| 1165 | |||
| 1166 | var doc = wDialog.document; | ||
| 1167 | doc.write(dialogHtml); | ||
| 1168 | doc.close(); | ||
| 1169 | } | ||
| 1170 | }; | ||
| 1171 | |||
| 1172 | /* @name toggleHtml | ||
| 1173 | * @description Shows/Hides the HTML | ||
| 1174 | */ | ||
| 1175 | WYMeditor.editor.prototype.toggleHtml = function() { | ||
| 1176 | jQuery(this._box).find(this._options.htmlSelector).toggle(); | ||
| 1177 | }; | ||
| 1178 | |||
| 1179 | WYMeditor.editor.prototype.uniqueStamp = function() { | ||
| 1180 | var now = new Date(); | ||
| 1181 | return("wym-" + now.getTime()); | ||
| 1182 | }; | ||
| 1183 | |||
| 1184 | WYMeditor.editor.prototype.paste = function(sData) { | ||
| 1185 | |||
| 1186 | var sTmp; | ||
| 1187 | var container = this.selected(); | ||
| 1188 | |||
| 1189 | //split the data, using double newlines as the separator | ||
| 1190 | var aP = sData.split(this._newLine + this._newLine); | ||
| 1191 | var rExp = new RegExp(this._newLine, "g"); | ||
| 1192 | |||
| 1193 | //add a P for each item | ||
| 1194 | if(container && container.tagName.toLowerCase() != WYMeditor.BODY) { | ||
| 1195 | for(x = aP.length - 1; x >= 0; x--) { | ||
| 1196 | sTmp = aP[x]; | ||
| 1197 | //simple newlines are replaced by a break | ||
| 1198 | sTmp = sTmp.replace(rExp, "<br />"); | ||
| 1199 | jQuery(container).after("<p>" + sTmp + "</p>"); | ||
| 1200 | } | ||
| 1201 | } else { | ||
| 1202 | for(x = 0; x < aP.length; x++) { | ||
| 1203 | sTmp = aP[x]; | ||
| 1204 | //simple newlines are replaced by a break | ||
| 1205 | sTmp = sTmp.replace(rExp, "<br />"); | ||
| 1206 | jQuery(this._doc.body).append("<p>" + sTmp + "</p>"); | ||
| 1207 | } | ||
| 1208 | |||
| 1209 | } | ||
| 1210 | }; | ||
| 1211 | |||
| 1212 | WYMeditor.editor.prototype.insert = function(html) { | ||
| 1213 | // Do we have a selection? | ||
| 1214 | if (this._iframe.contentWindow.getSelection().focusNode != null) { | ||
| 1215 | // Overwrite selection with provided html | ||
| 1216 | this._exec( WYMeditor.INSERT_HTML, html); | ||
| 1217 | } else { | ||
| 1218 | // Fall back to the internal paste function if there's no selection | ||
| 1219 | this.paste(html) | ||
| 1220 | } | ||
| 1221 | }; | ||
| 1222 | |||
| 1223 | WYMeditor.editor.prototype.addCssRules = function(doc, aCss) { | ||
| 1224 | var styles = doc.styleSheets[0]; | ||
| 1225 | if(styles) { | ||
| 1226 | for(var i = 0; i < aCss.length; i++) { | ||
| 1227 | var oCss = aCss[i]; | ||
| 1228 | if(oCss.name && oCss.css) this.addCssRule(styles, oCss); | ||
| 1229 | } | ||
| 1230 | } | ||
| 1231 | }; | ||
| 1232 | |||
| 1233 | /********** CONFIGURATION **********/ | ||
| 1234 | |||
| 1235 | WYMeditor.editor.prototype.computeBasePath = function() { | ||
| 1236 | return jQuery(jQuery.grep(jQuery('script'), function(s){ | ||
| 1237 | return (s.src && s.src.match(/jquery\.wymeditor(\.pack){0,1}\.js(\?.*)?$/ )) | ||
| 1238 | })).attr('src').replace(/jquery\.wymeditor(\.pack){0,1}\.js(\?.*)?$/, ''); | ||
| 1239 | }; | ||
| 1240 | |||
| 1241 | WYMeditor.editor.prototype.computeWymPath = function() { | ||
| 1242 | return jQuery(jQuery.grep(jQuery('script'), function(s){ | ||
| 1243 | return (s.src && s.src.match(/jquery\.wymeditor(\.pack){0,1}\.js(\?.*)?$/ )) | ||
| 1244 | })).attr('src'); | ||
| 1245 | }; | ||
| 1246 | |||
| 1247 | WYMeditor.editor.prototype.computeJqueryPath = function() { | ||
| 1248 | return jQuery(jQuery.grep(jQuery('script'), function(s){ | ||
| 1249 | return (s.src && s.src.match(/jquery(-(.*)){0,1}(\.pack){0,1}\.js(\?.*)?$/ )) | ||
| 1250 | })).attr('src'); | ||
| 1251 | }; | ||
| 1252 | |||
| 1253 | WYMeditor.editor.prototype.computeCssPath = function() { | ||
| 1254 | return jQuery(jQuery.grep(jQuery('link'), function(s){ | ||
| 1255 | return (s.href && s.href.match(/wymeditor\/skins\/(.*)screen\.css(\?.*)?$/ )) | ||
| 1256 | })).attr('href'); | ||
| 1257 | }; | ||
| 1258 | |||
| 1259 | WYMeditor.editor.prototype.configureEditorUsingRawCss = function() { | ||
| 1260 | |||
| 1261 | var CssParser = new WYMeditor.WymCssParser(); | ||
| 1262 | if(this._options.stylesheet){ | ||
| 1263 | CssParser.parse(jQuery.ajax({url: this._options.stylesheet,async:false}).responseText); | ||
| 1264 | }else{ | ||
| 1265 | CssParser.parse(this._options.styles, false); | ||
| 1266 | } | ||
| 1267 | |||
| 1268 | if(this._options.classesItems.length == 0) { | ||
| 1269 | this._options.classesItems = CssParser.css_settings.classesItems; | ||
| 1270 | } | ||
| 1271 | if(this._options.editorStyles.length == 0) { | ||
| 1272 | this._options.editorStyles = CssParser.css_settings.editorStyles; | ||
| 1273 | } | ||
| 1274 | if(this._options.dialogStyles.length == 0) { | ||
| 1275 | this._options.dialogStyles = CssParser.css_settings.dialogStyles; | ||
| 1276 | } | ||
| 1277 | }; | ||
| 1278 | |||
| 1279 | /********** EVENTS **********/ | ||
| 1280 | |||
| 1281 | WYMeditor.editor.prototype.listen = function() { | ||
| 1282 | |||
| 1283 | //don't use jQuery.find() on the iframe body | ||
| 1284 | //because of MSIE + jQuery + expando issue (#JQ1143) | ||
| 1285 | //jQuery(this._doc.body).find("*").bind("mouseup", this.mouseup); | ||
| 1286 | |||
| 1287 | jQuery(this._doc.body).bind("mousedown", this.mousedown); | ||
| 1288 | var images = this._doc.body.getElementsByTagName("img"); | ||
| 1289 | for(var i=0; i < images.length; i++) { | ||
| 1290 | jQuery(images[i]).bind("mousedown", this.mousedown); | ||
| 1291 | } | ||
| 1292 | }; | ||
| 1293 | |||
| 1294 | WYMeditor.editor.prototype.mousedown = function(evt) { | ||
| 1295 | |||
| 1296 | var wym = WYMeditor.INSTANCES[this.ownerDocument.title]; | ||
| 1297 | wym._selected_image = (this.tagName.toLowerCase() == WYMeditor.IMG) ? this : null; | ||
| 1298 | evt.stopPropagation(); | ||
| 1299 | }; | ||
| 1300 | |||
| 1301 | /********** SKINS **********/ | ||
| 1302 | |||
| 1303 | /* | ||
| 1304 | * Function: WYMeditor.loadCss | ||
| 1305 | * Loads a stylesheet in the document. | ||
| 1306 | * | ||
| 1307 | * Parameters: | ||
| 1308 | * href - The CSS path. | ||
| 1309 | */ | ||
| 1310 | WYMeditor.loadCss = function(href) { | ||
| 1311 | |||
| 1312 | var link = document.createElement('link'); | ||
| 1313 | link.rel = 'stylesheet'; | ||
| 1314 | link.href = href; | ||
| 1315 | |||
| 1316 | var head = jQuery('head').get(0); | ||
| 1317 | head.appendChild(link); | ||
| 1318 | }; | ||
| 1319 | |||
| 1320 | /* | ||
| 1321 | * Function: WYMeditor.editor.loadSkin | ||
| 1322 | * Loads the skin CSS and initialization script (if needed). | ||
| 1323 | */ | ||
| 1324 | WYMeditor.editor.prototype.loadSkin = function() { | ||
| 1325 | |||
| 1326 | //does the user want to automatically load the CSS (default: yes)? | ||
| 1327 | //we also test if it hasn't been already loaded by another instance | ||
| 1328 | //see below for a better (second) test | ||
| 1329 | if(this._options.loadSkin && !WYMeditor.SKINS[this._options.skin]) { | ||
| 1330 | |||
| 1331 | //check if it hasn't been already loaded | ||
| 1332 | //so we don't load it more than once | ||
| 1333 | //(we check the existing <link> elements) | ||
| 1334 | |||
| 1335 | var found = false; | ||
| 1336 | var rExp = new RegExp(this._options.skin | ||
| 1337 | + '\/' + WYMeditor.SKINS_DEFAULT_CSS + '$'); | ||
| 1338 | |||
| 1339 | jQuery('link').each( function() { | ||
| 1340 | if(this.href.match(rExp)) found = true; | ||
| 1341 | }); | ||
| 1342 | |||
| 1343 | //load it, using the skin path | ||
| 1344 | if(!found) WYMeditor.loadCss( this._options.skinPath | ||
| 1345 | + WYMeditor.SKINS_DEFAULT_CSS ); | ||
| 1346 | } | ||
| 1347 | |||
| 1348 | //put the classname (ex. wym_skin_default) on wym_box | ||
| 1349 | jQuery(this._box).addClass( "wym_skin_" + this._options.skin ); | ||
| 1350 | |||
| 1351 | //does the user want to use some JS to initialize the skin (default: yes)? | ||
| 1352 | //also check if it hasn't already been loaded by another instance | ||
| 1353 | if(this._options.initSkin && !WYMeditor.SKINS[this._options.skin]) { | ||
| 1354 | |||
| 1355 | eval(jQuery.ajax({url:this._options.skinPath | ||
| 1356 | + WYMeditor.SKINS_DEFAULT_JS, async:false}).responseText); | ||
| 1357 | } | ||
| 1358 | |||
| 1359 | //init the skin, if needed | ||
| 1360 | if(WYMeditor.SKINS[this._options.skin] | ||
| 1361 | && WYMeditor.SKINS[this._options.skin].init) | ||
| 1362 | WYMeditor.SKINS[this._options.skin].init(this); | ||
| 1363 | |||
| 1364 | }; | ||
| 1365 | |||
| 1366 | |||
| 1367 | /********** DIALOGS **********/ | ||
| 1368 | |||
| 1369 | WYMeditor.INIT_DIALOG = function(index) { | ||
| 1370 | |||
| 1371 | var wym = window.opener.WYMeditor.INSTANCES[index]; | ||
| 1372 | var doc = window.document; | ||
| 1373 | var selected = wym.selected(); | ||
| 1374 | var dialogType = jQuery(wym._options.dialogTypeSelector).val(); | ||
| 1375 | var sStamp = wym.uniqueStamp(); | ||
| 1376 | |||
| 1377 | switch(dialogType) { | ||
| 1378 | |||
| 1379 | case WYMeditor.DIALOG_LINK: | ||
| 1380 | //ensure that we select the link to populate the fields | ||
| 1381 | if(selected && selected.tagName && selected.tagName.toLowerCase != WYMeditor.A) | ||
| 1382 | selected = jQuery(selected).parentsOrSelf(WYMeditor.A); | ||
| 1383 | |||
| 1384 | //fix MSIE selection if link image has been clicked | ||
| 1385 | if(!selected && wym._selected_image) | ||
| 1386 | selected = jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A); | ||
| 1387 | break; | ||
| 1388 | |||
| 1389 | } | ||
| 1390 | |||
| 1391 | //pre-init functions | ||
| 1392 | if(jQuery.isFunction(wym._options.preInitDialog)) | ||
| 1393 | wym._options.preInitDialog(wym,window); | ||
| 1394 | |||
| 1395 | //add css rules from options | ||
| 1396 | var styles = doc.styleSheets[0]; | ||
| 1397 | var aCss = eval(wym._options.dialogStyles); | ||
| 1398 | |||
| 1399 | wym.addCssRules(doc, aCss); | ||
| 1400 | |||
| 1401 | //auto populate fields if selected container (e.g. A) | ||
| 1402 | if(selected) { | ||
| 1403 | jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF)); | ||
| 1404 | jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC)); | ||
| 1405 | jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE)); | ||
| 1406 | jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT)); | ||
| 1407 | } | ||
| 1408 | |||
| 1409 | //auto populate image fields if selected image | ||
| 1410 | if(wym._selected_image) { | ||
| 1411 | jQuery(wym._options.dialogImageSelector + " " + wym._options.srcSelector) | ||
| 1412 | .val(jQuery(wym._selected_image).attr(WYMeditor.SRC)); | ||
| 1413 | jQuery(wym._options.dialogImageSelector + " " + wym._options.titleSelector) | ||
| 1414 | .val(jQuery(wym._selected_image).attr(WYMeditor.TITLE)); | ||
| 1415 | jQuery(wym._options.dialogImageSelector + " " + wym._options.altSelector) | ||
| 1416 | .val(jQuery(wym._selected_image).attr(WYMeditor.ALT)); | ||
| 1417 | } | ||
| 1418 | |||
| 1419 | jQuery(wym._options.dialogLinkSelector + " " | ||
| 1420 | + wym._options.submitSelector).click(function() { | ||
| 1421 | |||
| 1422 | var sUrl = jQuery(wym._options.hrefSelector).val(); | ||
| 1423 | if(sUrl.length > 0) { | ||
| 1424 | |||
| 1425 | wym._exec(WYMeditor.CREATE_LINK, sStamp); | ||
| 1426 | |||
| 1427 | jQuery("a[@href=" + sStamp + "]", wym._doc.body) | ||
| 1428 | .attr(WYMeditor.HREF, sUrl) | ||
| 1429 | .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val()); | ||
| 1430 | |||
| 1431 | } | ||
| 1432 | window.close(); | ||
| 1433 | }); | ||
| 1434 | |||
| 1435 | jQuery(wym._options.dialogImageSelector + " " | ||
| 1436 | + wym._options.submitSelector).click(function() { | ||
| 1437 | |||
| 1438 | var sUrl = jQuery(wym._options.srcSelector).val(); | ||
| 1439 | if(sUrl.length > 0) { | ||
| 1440 | |||
| 1441 | wym._exec(WYMeditor.INSERT_IMAGE, sStamp); | ||
| 1442 | |||
| 1443 | jQuery("img[@src=" + sStamp + "]", wym._doc.body) | ||
| 1444 | .attr(WYMeditor.SRC, sUrl) | ||
| 1445 | .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val()) | ||
| 1446 | .attr(WYMeditor.ALT, jQuery(wym._options.altSelector).val()); | ||
| 1447 | } | ||
| 1448 | window.close(); | ||
| 1449 | }); | ||
| 1450 | |||
| 1451 | jQuery(wym._options.dialogTableSelector + " " | ||
| 1452 | + wym._options.submitSelector).click(function() { | ||
| 1453 | |||
| 1454 | var iRows = jQuery(wym._options.rowsSelector).val(); | ||
| 1455 | var iCols = jQuery(wym._options.colsSelector).val(); | ||
| 1456 | |||
| 1457 | if(iRows > 0 && iCols > 0) { | ||
| 1458 | |||
| 1459 | var table = wym._doc.createElement(WYMeditor.TABLE); | ||
| 1460 | var newRow = null; | ||
| 1461 | var newCol = null; | ||
| 1462 | |||
| 1463 | var sCaption = jQuery(wym._options.captionSelector).val(); | ||
| 1464 | |||
| 1465 | //we create the caption | ||
| 1466 | var newCaption = table.createCaption(); | ||
| 1467 | newCaption.innerHTML = sCaption; | ||
| 1468 | |||
| 1469 | //we create the rows and cells | ||
| 1470 | for(x=0; x<iRows; x++) { | ||
| 1471 | newRow = table.insertRow(x); | ||
| 1472 | for(y=0; y<iCols; y++) {newRow.insertCell(y);} | ||
| 1473 | } | ||
| 1474 | |||
| 1475 | //set the summary attr | ||
| 1476 | jQuery(table).attr('summary', | ||
| 1477 | jQuery(wym._options.summarySelector).val()); | ||
| 1478 | |||
| 1479 | //append the table after the selected container | ||
| 1480 | var node = jQuery(wym.findUp(wym.container(), | ||
| 1481 | WYMeditor.MAIN_CONTAINERS)).get(0); | ||
| 1482 | if(!node || !node.parentNode) jQuery(wym._doc.body).append(table); | ||
| 1483 | else jQuery(node).after(table); | ||
| 1484 | } | ||
| 1485 | window.close(); | ||
| 1486 | }); | ||
| 1487 | |||
| 1488 | jQuery(wym._options.dialogPasteSelector + " " | ||
| 1489 | + wym._options.submitSelector).click(function() { | ||
| 1490 | |||
| 1491 | var sText = jQuery(wym._options.textSelector).val(); | ||
| 1492 | wym.paste(sText); | ||
| 1493 | window.close(); | ||
| 1494 | }); | ||
| 1495 | |||
| 1496 | jQuery(wym._options.dialogPreviewSelector + " " | ||
| 1497 | + wym._options.previewSelector) | ||
| 1498 | .html(wym.xhtml()); | ||
| 1499 | |||
| 1500 | //cancel button | ||
| 1501 | jQuery(wym._options.cancelSelector).mousedown(function() { | ||
| 1502 | window.close(); | ||
| 1503 | }); | ||
| 1504 | |||
| 1505 | //pre-init functions | ||
| 1506 | if(jQuery.isFunction(wym._options.postInitDialog)) | ||
| 1507 | wym._options.postInitDialog(wym,window); | ||
| 1508 | |||
| 1509 | }; | ||
| 1510 | |||
| 1511 | /********** XHTML LEXER/PARSER **********/ | ||
| 1512 | |||
| 1513 | /* | ||
| 1514 | * @name xml | ||
| 1515 | * @description Use these methods to generate XML and XHTML compliant tags and | ||
| 1516 | * escape tag attributes correctly | ||
| 1517 | * @author Bermi Ferrer - http://bermi.org | ||
| 1518 | * @author David Heinemeier Hansson http://loudthinking.com | ||
| 1519 | */ | ||
| 1520 | WYMeditor.XmlHelper = function() | ||
| 1521 | { | ||
| 1522 | this._entitiesDiv = document.createElement('div'); | ||
| 1523 | return this; | ||
| 1524 | }; | ||
| 1525 | |||
| 1526 | |||
| 1527 | /* | ||
| 1528 | * @name tag | ||
| 1529 | * @description | ||
| 1530 | * Returns an empty HTML tag of type *name* which by default is XHTML | ||
| 1531 | * compliant. Setting *open* to true will create an open tag compatible | ||
| 1532 | * with HTML 4.0 and below. Add HTML attributes by passing an attributes | ||
| 1533 | * array to *options*. For attributes with no value like (disabled and | ||
| 1534 | * readonly), give it a value of true in the *options* array. | ||
| 1535 | * | ||
| 1536 | * Examples: | ||
| 1537 | * | ||
| 1538 | * this.tag('br') | ||
| 1539 | * # => <br /> | ||
| 1540 | * this.tag ('br', false, true) | ||
| 1541 | * # => <br> | ||
| 1542 | * this.tag ('input', jQuery({type:'text',disabled:true }) ) | ||
| 1543 | * # => <input type="text" disabled="disabled" /> | ||
| 1544 | */ | ||
| 1545 | WYMeditor.XmlHelper.prototype.tag = function(name, options, open) | ||
| 1546 | { | ||
| 1547 | options = options || false; | ||
| 1548 | open = open || false; | ||
| 1549 | return '<'+name+(options ? this.tagOptions(options) : '')+(open ? '>' : ' />'); | ||
| 1550 | }; | ||
| 1551 | |||
| 1552 | /* | ||
| 1553 | * @name contentTag | ||
| 1554 | * @description | ||
| 1555 | * Returns a XML block tag of type *name* surrounding the *content*. Add | ||
| 1556 | * XML attributes by passing an attributes array to *options*. For attributes | ||
| 1557 | * with no value like (disabled and readonly), give it a value of true in | ||
| 1558 | * the *options* array. You can use symbols or strings for the attribute names. | ||
| 1559 | * | ||
| 1560 | * this.contentTag ('p', 'Hello world!' ) | ||
| 1561 | * # => <p>Hello world!</p> | ||
| 1562 | * this.contentTag('div', this.contentTag('p', "Hello world!"), jQuery({class : "strong"})) | ||
| 1563 | * # => <div class="strong"><p>Hello world!</p></div> | ||
| 1564 | * this.contentTag("select", options, jQuery({multiple : true})) | ||
| 1565 | * # => <select multiple="multiple">...options...</select> | ||
| 1566 | */ | ||
| 1567 | WYMeditor.XmlHelper.prototype.contentTag = function(name, content, options) | ||
| 1568 | { | ||
| 1569 | options = options || false; | ||
| 1570 | return '<'+name+(options ? this.tagOptions(options) : '')+'>'+content+'</'+name+'>'; | ||
| 1571 | }; | ||
| 1572 | |||
| 1573 | /* | ||
| 1574 | * @name cdataSection | ||
| 1575 | * @description | ||
| 1576 | * Returns a CDATA section for the given +content+. CDATA sections | ||
| 1577 | * are used to escape blocks of text containing characters which would | ||
| 1578 | * otherwise be recognized as markup. CDATA sections begin with the string | ||
| 1579 | * <tt><![CDATA[</tt> and } with (and may not contain) the string | ||
| 1580 | * <tt>]]></tt>. | ||
| 1581 | */ | ||
| 1582 | WYMeditor.XmlHelper.prototype.cdataSection = function(content) | ||
| 1583 | { | ||
| 1584 | return '<![CDATA['+content+']]>'; | ||
| 1585 | }; | ||
| 1586 | |||
| 1587 | |||
| 1588 | /* | ||
| 1589 | * @name escapeOnce | ||
| 1590 | * @description | ||
| 1591 | * Returns the escaped +xml+ without affecting existing escaped entities. | ||
| 1592 | * | ||
| 1593 | * this.escapeOnce( "1 > 2 & 3") | ||
| 1594 | * # => "1 > 2 & 3" | ||
| 1595 | */ | ||
| 1596 | WYMeditor.XmlHelper.prototype.escapeOnce = function(xml) | ||
| 1597 | { | ||
| 1598 | return this._fixDoubleEscape(this.escapeEntities(xml)); | ||
| 1599 | }; | ||
| 1600 | |||
| 1601 | /* | ||
| 1602 | * @name _fixDoubleEscape | ||
| 1603 | * @description | ||
| 1604 | * Fix double-escaped entities, such as &amp;, &#123;, etc. | ||
| 1605 | */ | ||
| 1606 | WYMeditor.XmlHelper.prototype._fixDoubleEscape = function(escaped) | ||
| 1607 | { | ||
| 1608 | return escaped.replace(/&([a-z]+|(#\d+));/ig, "&$1;"); | ||
| 1609 | }; | ||
| 1610 | |||
| 1611 | /* | ||
| 1612 | * @name tagOptions | ||
| 1613 | * @description | ||
| 1614 | * Takes an array like the one generated by Tag.parseAttributes | ||
| 1615 | * [["src", "http://www.editam.com/?a=b&c=d&f=g"], ["title", "Editam, <Simplified> CMS"]] | ||
| 1616 | * or an object like {src:"http://www.editam.com/?a=b&c=d&f=g", title:"Editam, <Simplified> CMS"} | ||
| 1617 | * and returns a string properly escaped like | ||
| 1618 | * ' src = "http://www.editam.com/?a=b&c=d&f=g" title = "Editam, <Simplified> CMS"' | ||
| 1619 | * which is valid for strict XHTML | ||
| 1620 | */ | ||
| 1621 | WYMeditor.XmlHelper.prototype.tagOptions = function(options) | ||
| 1622 | { | ||
| 1623 | var xml = this; | ||
| 1624 | xml._formated_options = ''; | ||
| 1625 | |||
| 1626 | for (var key in options) { | ||
| 1627 | var formated_options = ''; | ||
| 1628 | var value = options[key]; | ||
| 1629 | if(typeof value != 'function' && value.length > 0) { | ||
| 1630 | |||
| 1631 | if(parseInt(key) == key && typeof value == 'object'){ | ||
| 1632 | key = value.shift(); | ||
| 1633 | value = value.pop(); | ||
| 1634 | } | ||
| 1635 | if(key != '' && value != ''){ | ||
| 1636 | xml._formated_options += ' '+key+'="'+xml.escapeOnce(value)+'"'; | ||
| 1637 | } | ||
| 1638 | } | ||
| 1639 | } | ||
| 1640 | return xml._formated_options; | ||
| 1641 | }; | ||
| 1642 | |||
| 1643 | /* | ||
| 1644 | * @name escapeEntities | ||
| 1645 | * @description | ||
| 1646 | * Escapes XML/HTML entities <, >, & and ". If seccond parameter is set to false it | ||
| 1647 | * will not escape ". If set to true it will also escape ' | ||
| 1648 | */ | ||
| 1649 | WYMeditor.XmlHelper.prototype.escapeEntities = function(string, escape_quotes) | ||
| 1650 | { | ||
| 1651 | this._entitiesDiv.innerHTML = string; | ||
| 1652 | this._entitiesDiv.textContent = string; | ||
| 1653 | var result = this._entitiesDiv.innerHTML; | ||
| 1654 | if(typeof escape_quotes == 'undefined'){ | ||
| 1655 | if(escape_quotes != false) result = result.replace('"', '"'); | ||
| 1656 | if(escape_quotes == true) result = result.replace('"', '''); | ||
| 1657 | } | ||
| 1658 | return result; | ||
| 1659 | }; | ||
| 1660 | |||
| 1661 | /* | ||
| 1662 | * Parses a string conatining tag attributes and values an returns an array formated like | ||
| 1663 | * [["src", "http://www.editam.com"], ["title", "Editam, Simplified CMS"]] | ||
| 1664 | */ | ||
| 1665 | WYMeditor.XmlHelper.prototype.parseAttributes = function(tag_attributes) | ||
| 1666 | { | ||
| 1667 | // Use a compounded regex to match single quoted, double quoted and unquoted attribute pairs | ||
| 1668 | var result = []; | ||
| 1669 | var matches = tag_attributes.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g); | ||
| 1670 | if(matches.toString() != tag_attributes){ | ||
| 1671 | for (var k in matches) { | ||
| 1672 | var v = matches[k]; | ||
| 1673 | if(typeof v != 'function' && v.length != 0){ | ||
| 1674 | var re = new RegExp('(\\w+)\\s*'+v); | ||
| 1675 | if(match = tag_attributes.match(re) ){ | ||
| 1676 | var value = v.replace(/^[\s=]+/, ""); | ||
| 1677 | var delimiter = value.charAt(0); | ||
| 1678 | delimiter = delimiter == '"' ? '"' : (delimiter=="'"?"'":''); | ||
| 1679 | if(delimiter != ''){ | ||
| 1680 | value = delimiter == '"' ? value.replace(/^"|"+$/g, '') : value.replace(/^'|'+$/g, ''); | ||
| 1681 | } | ||
| 1682 | tag_attributes = tag_attributes.replace(match[0],''); | ||
| 1683 | result.push([match[1] , value]); | ||
| 1684 | } | ||
| 1685 | } | ||
| 1686 | } | ||
| 1687 | } | ||
| 1688 | return result; | ||
| 1689 | }; | ||
| 1690 | |||
| 1691 | /** | ||
| 1692 | * XhtmlValidator for validating tag attributes | ||
| 1693 | * | ||
| 1694 | * @author Bermi Ferrer - http://bermi.org | ||
| 1695 | */ | ||
| 1696 | WYMeditor.XhtmlValidator = { | ||
| 1697 | "_attributes": | ||
| 1698 | { | ||
| 1699 | "core": | ||
| 1700 | { | ||
| 1701 | "except":[ | ||
| 1702 | "base", | ||
| 1703 | "head", | ||
| 1704 | "html", | ||
| 1705 | "meta", | ||
| 1706 | "param", | ||
| 1707 | "script", | ||
| 1708 | "style", | ||
| 1709 | "title" | ||
| 1710 | ], | ||
| 1711 | "attributes":[ | ||
| 1712 | "class", | ||
| 1713 | "id", | ||
| 1714 | "style", | ||
| 1715 | "title", | ||
| 1716 | "accesskey", | ||
| 1717 | "tabindex" | ||
| 1718 | ] | ||
| 1719 | }, | ||
| 1720 | "language": | ||
| 1721 | { | ||
| 1722 | "except":[ | ||
| 1723 | "base", | ||
| 1724 | "br", | ||
| 1725 | "hr", | ||
| 1726 | "iframe", | ||
| 1727 | "param", | ||
| 1728 | "script" | ||
| 1729 | ], | ||
| 1730 | "attributes": | ||
| 1731 | { | ||
| 1732 | "dir":[ | ||
| 1733 | "ltr", | ||
| 1734 | "rtl" | ||
| 1735 | ], | ||
| 1736 | "0":"lang", | ||
| 1737 | "1":"xml:lang" | ||
| 1738 | } | ||
| 1739 | }, | ||
| 1740 | "keyboard": | ||
| 1741 | { | ||
| 1742 | "attributes": | ||
| 1743 | { | ||
| 1744 | "accesskey":/^(\w){1}$/, | ||
| 1745 | "tabindex":/^(\d)+$/ | ||
| 1746 | } | ||
| 1747 | } | ||
| 1748 | }, | ||
| 1749 | "_events": | ||
| 1750 | { | ||
| 1751 | "window": | ||
| 1752 | { | ||
| 1753 | "only":[ | ||
| 1754 | "body" | ||
| 1755 | ], | ||
| 1756 | "attributes":[ | ||
| 1757 | "onload", | ||
| 1758 | "onunload" | ||
| 1759 | ] | ||
| 1760 | }, | ||
| 1761 | "form": | ||
| 1762 | { | ||
| 1763 | "only":[ | ||
| 1764 | "form", | ||
| 1765 | "input", | ||
| 1766 | "textarea", | ||
| 1767 | "select", | ||
| 1768 | "a", | ||
| 1769 | "label", | ||
| 1770 | "button" | ||
| 1771 | ], | ||
| 1772 | "attributes":[ | ||
| 1773 | "onchange", | ||
| 1774 | "onsubmit", | ||
| 1775 | "onreset", | ||
| 1776 | "onselect", | ||
| 1777 | "onblur", | ||
| 1778 | "onfocus" | ||
| 1779 | ] | ||
| 1780 | }, | ||
| 1781 | "keyboard": | ||
| 1782 | { | ||
| 1783 | "except":[ | ||
| 1784 | "base", | ||
| 1785 | "bdo", | ||
| 1786 | "br", | ||
| 1787 | "frame", | ||
| 1788 | "frameset", | ||
| 1789 | "head", | ||
| 1790 | "html", | ||
| 1791 | "iframe", | ||
| 1792 | "meta", | ||
| 1793 | "param", | ||
| 1794 | "script", | ||
| 1795 | "style", | ||
| 1796 | "title" | ||
| 1797 | ], | ||
| 1798 | "attributes":[ | ||
| 1799 | "onkeydown", | ||
| 1800 | "onkeypress", | ||
| 1801 | "onkeyup" | ||
| 1802 | ] | ||
| 1803 | }, | ||
| 1804 | "mouse": | ||
| 1805 | { | ||
| 1806 | "except":[ | ||
| 1807 | "base", | ||
| 1808 | "bdo", | ||
| 1809 | "br", | ||
| 1810 | "head", | ||
| 1811 | "html", | ||
| 1812 | "meta", | ||
| 1813 | "param", | ||
| 1814 | "script", | ||
| 1815 | "style", | ||
| 1816 | "title" | ||
| 1817 | ], | ||
| 1818 | "attributes":[ | ||
| 1819 | "onclick", | ||
| 1820 | "ondblclick", | ||
| 1821 | "onmousedown", | ||
| 1822 | "onmousemove", | ||
| 1823 | "onmouseover", | ||
| 1824 | "onmouseout", | ||
| 1825 | "onmouseup" | ||
| 1826 | ] | ||
| 1827 | } | ||
| 1828 | }, | ||
| 1829 | "_tags": | ||
| 1830 | { | ||
| 1831 | "a": | ||
| 1832 | { | ||
| 1833 | "attributes": | ||
| 1834 | { | ||
| 1835 | "0":"charset", | ||
| 1836 | "1":"coords", | ||
| 1837 | "2":"href", | ||
| 1838 | "3":"hreflang", | ||
| 1839 | "4":"name", | ||
| 1840 | "rel":/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/, | ||
| 1841 | "rev":/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/, | ||
| 1842 | "shape":/^(rect|rectangle|circ|circle|poly|polygon)$/, | ||
| 1843 | "5":"type" | ||
| 1844 | } | ||
| 1845 | }, | ||
| 1846 | "0":"abbr", | ||
| 1847 | "1":"acronym", | ||
| 1848 | "2":"address", | ||
| 1849 | "area": | ||
| 1850 | { | ||
| 1851 | "attributes": | ||
| 1852 | { | ||
| 1853 | "0":"alt", | ||
| 1854 | "1":"coords", | ||
| 1855 | "2":"href", | ||
| 1856 | "nohref":/^(true|false)$/, | ||
| 1857 | "shape":/^(rect|rectangle|circ|circle|poly|polygon)$/ | ||
| 1858 | }, | ||
| 1859 | "required":[ | ||
| 1860 | "alt" | ||
| 1861 | ] | ||
| 1862 | }, | ||
| 1863 | "3":"b", | ||
| 1864 | "base": | ||
| 1865 | { | ||
| 1866 | "attributes":[ | ||
| 1867 | "href" | ||
| 1868 | ], | ||
| 1869 | "required":[ | ||
| 1870 | "href" | ||
| 1871 | ] | ||
| 1872 | }, | ||
| 1873 | "bdo": | ||
| 1874 | { | ||
| 1875 | "attributes": | ||
| 1876 | { | ||
| 1877 | "dir":/^(ltr|rtl)$/ | ||
| 1878 | }, | ||
| 1879 | "required":[ | ||
| 1880 | "dir" | ||
| 1881 | ] | ||
| 1882 | }, | ||
| 1883 | "4":"big", | ||
| 1884 | "blockquote": | ||
| 1885 | { | ||
| 1886 | "attributes":[ | ||
| 1887 | "cite" | ||
| 1888 | ] | ||
| 1889 | }, | ||
| 1890 | "5":"body", | ||
| 1891 | "6":"br", | ||
| 1892 | "button": | ||
| 1893 | { | ||
| 1894 | "attributes": | ||
| 1895 | { | ||
| 1896 | "disabled":/^(disabled)$/, | ||
| 1897 | "type":/^(button|reset|submit)$/, | ||
| 1898 | "0":"value" | ||
| 1899 | }, | ||
| 1900 | "inside":"form" | ||
| 1901 | }, | ||
| 1902 | "7":"caption", | ||
| 1903 | "8":"cite", | ||
| 1904 | "9":"code", | ||
| 1905 | "col": | ||
| 1906 | { | ||
| 1907 | "attributes": | ||
| 1908 | { | ||
| 1909 | "align":/^(right|left|center|justify)$/, | ||
| 1910 | "0":"char", | ||
| 1911 | "1":"charoff", | ||
| 1912 | "span":/^(\d)+$/, | ||
| 1913 | "valign":/^(top|middle|bottom|baseline)$/, | ||
| 1914 | "2":"width" | ||
| 1915 | }, | ||
| 1916 | "inside":"colgroup" | ||
| 1917 | }, | ||
| 1918 | "colgroup": | ||
| 1919 | { | ||
| 1920 | "attributes": | ||
| 1921 | { | ||
| 1922 | "align":/^(right|left|center|justify)$/, | ||
| 1923 | "0":"char", | ||
| 1924 | "1":"charoff", | ||
| 1925 | "span":/^(\d)+$/, | ||
| 1926 | "valign":/^(top|middle|bottom|baseline)$/, | ||
| 1927 | "2":"width" | ||
| 1928 | } | ||
| 1929 | }, | ||
| 1930 | "10":"dd", | ||
| 1931 | "del": | ||
| 1932 | { | ||
| 1933 | "attributes": | ||
| 1934 | { | ||
| 1935 | "0":"cite", | ||
| 1936 | "datetime":/^([0-9]){8}/ | ||
| 1937 | } | ||
| 1938 | }, | ||
| 1939 | "11":"div", | ||
| 1940 | "12":"dfn", | ||
| 1941 | "13":"dl", | ||
| 1942 | "14":"dt", | ||
| 1943 | "15":"em", | ||
| 1944 | "fieldset": | ||
| 1945 | { | ||
| 1946 | "inside":"form" | ||
| 1947 | }, | ||
| 1948 | "form": | ||
| 1949 | { | ||
| 1950 | "attributes": | ||
| 1951 | { | ||
| 1952 | "0":"action", | ||
| 1953 | "1":"accept", | ||
| 1954 | "2":"accept-charset", | ||
| 1955 | "3":"enctype", | ||
| 1956 | "method":/^(get|post)$/ | ||
| 1957 | }, | ||
| 1958 | "required":[ | ||
| 1959 | "action" | ||
| 1960 | ] | ||
| 1961 | }, | ||
| 1962 | "head": | ||
| 1963 | { | ||
| 1964 | "attributes":[ | ||
| 1965 | "profile" | ||
| 1966 | ] | ||
| 1967 | }, | ||
| 1968 | "16":"h1", | ||
| 1969 | "17":"h2", | ||
| 1970 | "18":"h3", | ||
| 1971 | "19":"h4", | ||
| 1972 | "20":"h5", | ||
| 1973 | "21":"h6", | ||
| 1974 | "22":"hr", | ||
| 1975 | "html": | ||
| 1976 | { | ||
| 1977 | "attributes":[ | ||
| 1978 | "xmlns" | ||
| 1979 | ] | ||
| 1980 | }, | ||
| 1981 | "23":"i", | ||
| 1982 | "img": | ||
| 1983 | { | ||
| 1984 | "attributes":[ | ||
| 1985 | "alt", | ||
| 1986 | "src", | ||
| 1987 | "height", | ||
| 1988 | "ismap", | ||
| 1989 | "longdesc", | ||
| 1990 | "usemap", | ||
| 1991 | "width" | ||
| 1992 | ], | ||
| 1993 | "required":[ | ||
| 1994 | "alt", | ||
| 1995 | "src" | ||
| 1996 | ] | ||
| 1997 | }, | ||
| 1998 | "input": | ||
| 1999 | { | ||
| 2000 | "attributes": | ||
| 2001 | { | ||
| 2002 | "0":"accept", | ||
| 2003 | "1":"alt", | ||
| 2004 | "checked":/^(checked)$/, | ||
| 2005 | "disabled":/^(disabled)$/, | ||
| 2006 | "maxlength":/^(\d)+$/, | ||
| 2007 | "2":"name", | ||
| 2008 | "readonly":/^(readonly)$/, | ||
| 2009 | "size":/^(\d)+$/, | ||
| 2010 | "3":"src", | ||
| 2011 | "type":/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/, | ||
| 2012 | "4":"value" | ||
| 2013 | }, | ||
| 2014 | "inside":"form" | ||
| 2015 | }, | ||
| 2016 | "ins": | ||
| 2017 | { | ||
| 2018 | "attributes": | ||
| 2019 | { | ||
| 2020 | "0":"cite", | ||
| 2021 | "datetime":/^([0-9]){8}/ | ||
| 2022 | } | ||
| 2023 | }, | ||
| 2024 | "24":"kbd", | ||
| 2025 | "label": | ||
| 2026 | { | ||
| 2027 | "attributes":[ | ||
| 2028 | "for" | ||
| 2029 | ], | ||
| 2030 | "inside":"form" | ||
| 2031 | }, | ||
| 2032 | "25":"legend", | ||
| 2033 | "26":"li", | ||
| 2034 | "link": | ||
| 2035 | { | ||
| 2036 | "attributes": | ||
| 2037 | { | ||
| 2038 | "0":"charset", | ||
| 2039 | "1":"href", | ||
| 2040 | "2":"hreflang", | ||
| 2041 | "media":/^(all|braille|print|projection|screen|speech|,|;| )+$/i, | ||
| 2042 | //next comment line required by Opera! | ||
| 2043 | /*"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,*/ | ||
| 2044 | "rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i, | ||
| 2045 | "rev":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i, | ||
| 2046 | "3":"type" | ||
| 2047 | }, | ||
| 2048 | "inside":"head" | ||
| 2049 | }, | ||
| 2050 | "map": | ||
| 2051 | { | ||
| 2052 | "attributes":[ | ||
| 2053 | "id", | ||
| 2054 | "name" | ||
| 2055 | ], | ||
| 2056 | "required":[ | ||
| 2057 | "id" | ||
| 2058 | ] | ||
| 2059 | }, | ||
| 2060 | "meta": | ||
| 2061 | { | ||
| 2062 | "attributes": | ||
| 2063 | { | ||
| 2064 | "0":"content", | ||
| 2065 | "http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i, | ||
| 2066 | "1":"name", | ||
| 2067 | "2":"scheme" | ||
| 2068 | }, | ||
| 2069 | "required":[ | ||
| 2070 | "content" | ||
| 2071 | ] | ||
| 2072 | }, | ||
| 2073 | "27":"noscript", | ||
| 2074 | "object": | ||
| 2075 | { | ||
| 2076 | "attributes":[ | ||
| 2077 | "archive", | ||
| 2078 | "classid", | ||
| 2079 | "codebase", | ||
| 2080 | "codetype", | ||
| 2081 | "data", | ||
| 2082 | "declare", | ||
| 2083 | "height", | ||
| 2084 | "name", | ||
| 2085 | "standby", | ||
| 2086 | "type", | ||
| 2087 | "usemap", | ||
| 2088 | "width" | ||
| 2089 | ] | ||
| 2090 | }, | ||
| 2091 | "28":"ol", | ||
| 2092 | "optgroup": | ||
| 2093 | { | ||
| 2094 | "attributes": | ||
| 2095 | { | ||
| 2096 | "0":"label", | ||
| 2097 | "disabled": /^(disabled)$/ | ||
| 2098 | }, | ||
| 2099 | "required":[ | ||
| 2100 | "label" | ||
| 2101 | ] | ||
| 2102 | }, | ||
| 2103 | "option": | ||
| 2104 | { | ||
| 2105 | "attributes": | ||
| 2106 | { | ||
| 2107 | "0":"label", | ||
| 2108 | "disabled":/^(disabled)$/, | ||
| 2109 | "selected":/^(selected)$/, | ||
| 2110 | "1":"value" | ||
| 2111 | }, | ||
| 2112 | "inside":"select" | ||
| 2113 | }, | ||
| 2114 | "29":"p", | ||
| 2115 | "param": | ||
| 2116 | { | ||
| 2117 | "attributes": | ||
| 2118 | { | ||
| 2119 | "0":"type", | ||
| 2120 | "valuetype":/^(data|ref|object)$/, | ||
| 2121 | "1":"valuetype", | ||
| 2122 | "2":"value" | ||
| 2123 | }, | ||
| 2124 | "required":[ | ||
| 2125 | "name" | ||
| 2126 | ] | ||
| 2127 | }, | ||
| 2128 | "30":"pre", | ||
| 2129 | "q": | ||
| 2130 | { | ||
| 2131 | "attributes":[ | ||
| 2132 | "cite" | ||
| 2133 | ] | ||
| 2134 | }, | ||
| 2135 | "31":"samp", | ||
| 2136 | "script": | ||
| 2137 | { | ||
| 2138 | "attributes": | ||
| 2139 | { | ||
| 2140 | "type":/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/, | ||
| 2141 | "0":"charset", | ||
| 2142 | "defer":/^(defer)$/, | ||
| 2143 | "1":"src" | ||
| 2144 | }, | ||
| 2145 | "required":[ | ||
| 2146 | "type" | ||
| 2147 | ] | ||
| 2148 | }, | ||
| 2149 | "select": | ||
| 2150 | { | ||
| 2151 | "attributes": | ||
| 2152 | { | ||
| 2153 | "disabled":/^(disabled)$/, | ||
| 2154 | "multiple":/^(multiple)$/, | ||
| 2155 | "0":"name", | ||
| 2156 | "1":"size" | ||
| 2157 | }, | ||
| 2158 | "inside":"form" | ||
| 2159 | }, | ||
| 2160 | "32":"small", | ||
| 2161 | "33":"span", | ||
| 2162 | "34":"strong", | ||
| 2163 | "style": | ||
| 2164 | { | ||
| 2165 | "attributes": | ||
| 2166 | { | ||
| 2167 | "0":"type", | ||
| 2168 | "media":/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/ | ||
| 2169 | }, | ||
| 2170 | "required":[ | ||
| 2171 | "type" | ||
| 2172 | ] | ||
| 2173 | }, | ||
| 2174 | "35":"sub", | ||
| 2175 | "36":"sup", | ||
| 2176 | "table": | ||
| 2177 | { | ||
| 2178 | "attributes": | ||
| 2179 | { | ||
| 2180 | "0":"border", | ||
| 2181 | "1":"cellpadding", | ||
| 2182 | "2":"cellspacing", | ||
| 2183 | "frame":/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/, | ||
| 2184 | "rules":/^(none|groups|rows|cols|all)$/, | ||
| 2185 | "3":"summary", | ||
| 2186 | "4":"width" | ||
| 2187 | } | ||
| 2188 | }, | ||
| 2189 | "tbody": | ||
| 2190 | { | ||
| 2191 | "attributes": | ||
| 2192 | { | ||
| 2193 | "align":/^(right|left|center|justify)$/, | ||
| 2194 | "0":"char", | ||
| 2195 | "1":"charoff", | ||
| 2196 | "valign":/^(top|middle|bottom|baseline)$/ | ||
| 2197 | } | ||
| 2198 | }, | ||
| 2199 | "td": | ||
| 2200 | { | ||
| 2201 | "attributes": | ||
| 2202 | { | ||
| 2203 | "0":"abbr", | ||
| 2204 | "align":/^(left|right|center|justify|char)$/, | ||
| 2205 | "1":"axis", | ||
| 2206 | "2":"char", | ||
| 2207 | "3":"charoff", | ||
| 2208 | "colspan":/^(\d)+$/, | ||
| 2209 | "4":"headers", | ||
| 2210 | "rowspan":/^(\d)+$/, | ||
| 2211 | "scope":/^(col|colgroup|row|rowgroup)$/, | ||
| 2212 | "valign":/^(top|middle|bottom|baseline)$/ | ||
| 2213 | } | ||
| 2214 | }, | ||
| 2215 | "textarea": | ||
| 2216 | { | ||
| 2217 | "attributes":[ | ||
| 2218 | "cols", | ||
| 2219 | "rows", | ||
| 2220 | "disabled", | ||
| 2221 | "name", | ||
| 2222 | "readonly" | ||
| 2223 | ], | ||
| 2224 | "required":[ | ||
| 2225 | "cols", | ||
| 2226 | "rows" | ||
| 2227 | ], | ||
| 2228 | "inside":"form" | ||
| 2229 | }, | ||
| 2230 | "tfoot": | ||
| 2231 | { | ||
| 2232 | "attributes": | ||
| 2233 | { | ||
| 2234 | "align":/^(right|left|center|justify)$/, | ||
| 2235 | "0":"char", | ||
| 2236 | "1":"charoff", | ||
| 2237 | "valign":/^(top|middle|bottom)$/, | ||
| 2238 | "2":"baseline" | ||
| 2239 | } | ||
| 2240 | }, | ||
| 2241 | "th": | ||
| 2242 | { | ||
| 2243 | "attributes": | ||
| 2244 | { | ||
| 2245 | "0":"abbr", | ||
| 2246 | "align":/^(left|right|center|justify|char)$/, | ||
| 2247 | "1":"axis", | ||
| 2248 | "2":"char", | ||
| 2249 | "3":"charoff", | ||
| 2250 | "colspan":/^(\d)+$/, | ||
| 2251 | "4":"headers", | ||
| 2252 | "rowspan":/^(\d)+$/, | ||
| 2253 | "scope":/^(col|colgroup|row|rowgroup)$/, | ||
| 2254 | "valign":/^(top|middle|bottom|baseline)$/ | ||
| 2255 | } | ||
| 2256 | }, | ||
| 2257 | "thead": | ||
| 2258 | { | ||
| 2259 | "attributes": | ||
| 2260 | { | ||
| 2261 | "align":/^(right|left|center|justify)$/, | ||
| 2262 | "0":"char", | ||
| 2263 | "1":"charoff", | ||
| 2264 | "valign":/^(top|middle|bottom|baseline)$/ | ||
| 2265 | } | ||
| 2266 | }, | ||
| 2267 | "37":"title", | ||
| 2268 | "tr": | ||
| 2269 | { | ||
| 2270 | "attributes": | ||
| 2271 | { | ||
| 2272 | "align":/^(right|left|center|justify|char)$/, | ||
| 2273 | "0":"char", | ||
| 2274 | "1":"charoff", | ||
| 2275 | "valign":/^(top|middle|bottom|baseline)$/ | ||
| 2276 | } | ||
| 2277 | }, | ||
| 2278 | "38":"tt", | ||
| 2279 | "39":"ul", | ||
| 2280 | "40":"var" | ||
| 2281 | }, | ||
| 2282 | |||
| 2283 | // Temporary skiped attributes | ||
| 2284 | skiped_attributes : [], | ||
| 2285 | skiped_attribute_values : [], | ||
| 2286 | |||
| 2287 | getValidTagAttributes: function(tag, attributes) | ||
| 2288 | { | ||
| 2289 | var valid_attributes = {}; | ||
| 2290 | var possible_attributes = this.getPossibleTagAttributes(tag); | ||
| 2291 | for(var attribute in attributes) { | ||
| 2292 | var value = attributes[attribute]; | ||
| 2293 | var h = WYMeditor.Helper; | ||
| 2294 | if(!h.contains(this.skiped_attributes, attribute) && !h.contains(this.skiped_attribute_values, value)){ | ||
| 2295 | if (typeof value != 'function' && h.contains(possible_attributes, attribute)) { | ||
| 2296 | if (this.doesAttributeNeedsValidation(tag, attribute)) { | ||
| 2297 | if(this.validateAttribute(tag, attribute, value)){ | ||
| 2298 | valid_attributes[attribute] = value; | ||
| 2299 | } | ||
| 2300 | }else{ | ||
| 2301 | valid_attributes[attribute] = value; | ||
| 2302 | } | ||
| 2303 | } | ||
| 2304 | } | ||
| 2305 | } | ||
| 2306 | return valid_attributes; | ||
| 2307 | }, | ||
| 2308 | getUniqueAttributesAndEventsForTag : function(tag) | ||
| 2309 | { | ||
| 2310 | var result = []; | ||
| 2311 | |||
| 2312 | if (this._tags[tag] && this._tags[tag]['attributes']) { | ||
| 2313 | for (k in this._tags[tag]['attributes']) { | ||
| 2314 | result.push(parseInt(k) == k ? this._tags[tag]['attributes'][k] : k); | ||
| 2315 | } | ||
| 2316 | } | ||
| 2317 | return result; | ||
| 2318 | }, | ||
| 2319 | getDefaultAttributesAndEventsForTags : function() | ||
| 2320 | { | ||
| 2321 | var result = []; | ||
| 2322 | for (var key in this._events){ | ||
| 2323 | result.push(this._events[key]); | ||
| 2324 | } | ||
| 2325 | for (var key in this._attributes){ | ||
| 2326 | result.push(this._attributes[key]); | ||
| 2327 | } | ||
| 2328 | return result; | ||
| 2329 | }, | ||
| 2330 | isValidTag : function(tag) | ||
| 2331 | { | ||
| 2332 | if(this._tags[tag]){ | ||
| 2333 | return true; | ||
| 2334 | } | ||
| 2335 | for(var key in this._tags){ | ||
| 2336 | if(this._tags[key] == tag){ | ||
| 2337 | return true; | ||
| 2338 | } | ||
| 2339 | } | ||
| 2340 | return false; | ||
| 2341 | }, | ||
| 2342 | getDefaultAttributesAndEventsForTag : function(tag) | ||
| 2343 | { | ||
| 2344 | var default_attributes = []; | ||
| 2345 | if (this.isValidTag(tag)) { | ||
| 2346 | var default_attributes_and_events = this.getDefaultAttributesAndEventsForTags(); | ||
| 2347 | |||
| 2348 | for(var key in default_attributes_and_events) { | ||
| 2349 | var defaults = default_attributes_and_events[key]; | ||
| 2350 | if(typeof defaults == 'object'){ | ||
| 2351 | var h = WYMeditor.Helper; | ||
| 2352 | if ((defaults['except'] && h.contains(defaults['except'], tag)) || (defaults['only'] && !h.contains(defaults['only'], tag))) { | ||
| 2353 | continue; | ||
| 2354 | } | ||
| 2355 | |||
| 2356 | var tag_defaults = defaults['attributes'] ? defaults['attributes'] : defaults['events']; | ||
| 2357 | for(var k in tag_defaults) { | ||
| 2358 | default_attributes.push(typeof tag_defaults[k] != 'string' ? k : tag_defaults[k]); | ||
| 2359 | } | ||
| 2360 | } | ||
| 2361 | } | ||
| 2362 | } | ||
| 2363 | return default_attributes; | ||
| 2364 | }, | ||
| 2365 | doesAttributeNeedsValidation: function(tag, attribute) | ||
| 2366 | { | ||
| 2367 | return this._tags[tag] && ((this._tags[tag]['attributes'] && this._tags[tag]['attributes'][attribute]) || (this._tags[tag]['required'] && | ||
| 2368 | WYMeditor.Helper.contains(this._tags[tag]['required'], attribute))); | ||
| 2369 | }, | ||
| 2370 | validateAttribute : function(tag, attribute, value) | ||
| 2371 | { | ||
| 2372 | if ( this._tags[tag] && | ||
| 2373 | (this._tags[tag]['attributes'] && this._tags[tag]['attributes'][attribute] && value.length > 0 && !value.match(this._tags[tag]['attributes'][attribute])) || // invalid format | ||
| 2374 | (this._tags[tag] && this._tags[tag]['required'] && WYMeditor.Helper.contains(this._tags[tag]['required'], attribute) && value.length == 0) // required attribute | ||
| 2375 | ) { | ||
| 2376 | return false; | ||
| 2377 | } | ||
| 2378 | return typeof this._tags[tag] != 'undefined'; | ||
| 2379 | }, | ||
| 2380 | getPossibleTagAttributes : function(tag) | ||
| 2381 | { | ||
| 2382 | if (!this._possible_tag_attributes) { | ||
| 2383 | this._possible_tag_attributes = {}; | ||
| 2384 | } | ||
| 2385 | if (!this._possible_tag_attributes[tag]) { | ||
| 2386 | this._possible_tag_attributes[tag] = this.getUniqueAttributesAndEventsForTag(tag).concat(this.getDefaultAttributesAndEventsForTag(tag)); | ||
| 2387 | } | ||
| 2388 | return this._possible_tag_attributes[tag]; | ||
| 2389 | } | ||
| 2390 | }; | ||
| 2391 | |||
| 2392 | |||
| 2393 | /** | ||
| 2394 | * Compounded regular expression. Any of | ||
| 2395 | * the contained patterns could match and | ||
| 2396 | * when one does, it's label is returned. | ||
| 2397 | * | ||
| 2398 | * Constructor. Starts with no patterns. | ||
| 2399 | * @param boolean case True for case sensitive, false | ||
| 2400 | * for insensitive. | ||
| 2401 | * @access public | ||
| 2402 | * @author Marcus Baker (http://lastcraft.com) | ||
| 2403 | * @author Bermi Ferrer (http://bermi.org) | ||
| 2404 | */ | ||
| 2405 | WYMeditor.ParallelRegex = function(case_sensitive) | ||
| 2406 | { | ||
| 2407 | this._case = case_sensitive; | ||
| 2408 | this._patterns = []; | ||
| 2409 | this._labels = []; | ||
| 2410 | this._regex = null; | ||
| 2411 | return this; | ||
| 2412 | }; | ||
| 2413 | |||
| 2414 | |||
| 2415 | /** | ||
| 2416 | * Adds a pattern with an optional label. | ||
| 2417 | * @param string pattern Perl style regex, but ( and ) | ||
| 2418 | * lose the usual meaning. | ||
| 2419 | * @param string label Label of regex to be returned | ||
| 2420 | * on a match. | ||
| 2421 | * @access public | ||
| 2422 | */ | ||
| 2423 | WYMeditor.ParallelRegex.prototype.addPattern = function(pattern, label) | ||
| 2424 | { | ||
| 2425 | label = label || true; | ||
| 2426 | var count = this._patterns.length; | ||
| 2427 | this._patterns[count] = pattern; | ||
| 2428 | this._labels[count] = label; | ||
| 2429 | this._regex = null; | ||
| 2430 | }; | ||
| 2431 | |||
| 2432 | /** | ||
| 2433 | * Attempts to match all patterns at once against | ||
| 2434 | * a string. | ||
| 2435 | * @param string subject String to match against. | ||
| 2436 | * | ||
| 2437 | * @return boolean True on success. | ||
| 2438 | * @return string match First matched portion of | ||
| 2439 | * subject. | ||
| 2440 | * @access public | ||
| 2441 | */ | ||
| 2442 | WYMeditor.ParallelRegex.prototype.match = function(subject) | ||
| 2443 | { | ||
| 2444 | if (this._patterns.length == 0) { | ||
| 2445 | return [false, '']; | ||
| 2446 | } | ||
| 2447 | var matches = subject.match(this._getCompoundedRegex()); | ||
| 2448 | |||
| 2449 | if(!matches){ | ||
| 2450 | return [false, '']; | ||
| 2451 | } | ||
| 2452 | var match = matches[0]; | ||
| 2453 | for (var i = 1; i < matches.length; i++) { | ||
| 2454 | if (matches[i]) { | ||
| 2455 | return [this._labels[i-1], match]; | ||
| 2456 | } | ||
| 2457 | } | ||
| 2458 | return [true, matches[0]]; | ||
| 2459 | }; | ||
| 2460 | |||
| 2461 | /** | ||
| 2462 | * Compounds the patterns into a single | ||
| 2463 | * regular expression separated with the | ||
| 2464 | * "or" operator. Caches the regex. | ||
| 2465 | * Will automatically escape (, ) and / tokens. | ||
| 2466 | * @param array patterns List of patterns in order. | ||
| 2467 | * @access private | ||
| 2468 | */ | ||
| 2469 | WYMeditor.ParallelRegex.prototype._getCompoundedRegex = function() | ||
| 2470 | { | ||
| 2471 | if (this._regex == null) { | ||
| 2472 | for (var i = 0, count = this._patterns.length; i < count; i++) { | ||
| 2473 | this._patterns[i] = '(' + this._untokenizeRegex(this._tokenizeRegex(this._patterns[i]).replace(/([\/\(\)])/g,'\\$1')) + ')'; | ||
| 2474 | } | ||
| 2475 | this._regex = new RegExp(this._patterns.join("|") ,this._getPerlMatchingFlags()); | ||
| 2476 | } | ||
| 2477 | return this._regex; | ||
| 2478 | }; | ||
| 2479 | |||
| 2480 | /** | ||
| 2481 | * Escape lookahead/lookbehind blocks | ||
| 2482 | */ | ||
| 2483 | WYMeditor.ParallelRegex.prototype._tokenizeRegex = function(regex) | ||
| 2484 | { | ||
| 2485 | return regex. | ||
| 2486 | replace(/\(\?(i|m|s|x|U)\)/, '~~~~~~Tk1\$1~~~~~~'). | ||
| 2487 | replace(/\(\?(\-[i|m|s|x|U])\)/, '~~~~~~Tk2\$1~~~~~~'). | ||
| 2488 | replace(/\(\?\=(.*)\)/, '~~~~~~Tk3\$1~~~~~~'). | ||
| 2489 | replace(/\(\?\!(.*)\)/, '~~~~~~Tk4\$1~~~~~~'). | ||
| 2490 | replace(/\(\?\<\=(.*)\)/, '~~~~~~Tk5\$1~~~~~~'). | ||
| 2491 | replace(/\(\?\<\!(.*)\)/, '~~~~~~Tk6\$1~~~~~~'). | ||
| 2492 | replace(/\(\?\:(.*)\)/, '~~~~~~Tk7\$1~~~~~~'); | ||
| 2493 | }; | ||
| 2494 | |||
| 2495 | /** | ||
| 2496 | * Unscape lookahead/lookbehind blocks | ||
| 2497 | */ | ||
| 2498 | WYMeditor.ParallelRegex.prototype._untokenizeRegex = function(regex) | ||
| 2499 | { | ||
| 2500 | return regex. | ||
| 2501 | replace(/~~~~~~Tk1(.{1})~~~~~~/, "(?\$1)"). | ||
| 2502 | replace(/~~~~~~Tk2(.{2})~~~~~~/, "(?\$1)"). | ||
| 2503 | replace(/~~~~~~Tk3(.*)~~~~~~/, "(?=\$1)"). | ||
| 2504 | replace(/~~~~~~Tk4(.*)~~~~~~/, "(?!\$1)"). | ||
| 2505 | replace(/~~~~~~Tk5(.*)~~~~~~/, "(?<=\$1)"). | ||
| 2506 | replace(/~~~~~~Tk6(.*)~~~~~~/, "(?<!\$1)"). | ||
| 2507 | replace(/~~~~~~Tk7(.*)~~~~~~/, "(?:\$1)"); | ||
| 2508 | }; | ||
| 2509 | |||
| 2510 | |||
| 2511 | /** | ||
| 2512 | * Accessor for perl regex mode flags to use. | ||
| 2513 | * @return string Perl regex flags. | ||
| 2514 | * @access private | ||
| 2515 | */ | ||
| 2516 | WYMeditor.ParallelRegex.prototype._getPerlMatchingFlags = function() | ||
| 2517 | { | ||
| 2518 | return (this._case ? "m" : "mi"); | ||
| 2519 | }; | ||
| 2520 | |||
| 2521 | |||
| 2522 | |||
| 2523 | /** | ||
| 2524 | * States for a stack machine. | ||
| 2525 | * | ||
| 2526 | * Constructor. Starts in named state. | ||
| 2527 | * @param string start Starting state name. | ||
| 2528 | * @access public | ||
| 2529 | * @author Marcus Baker (http://lastcraft.com) | ||
| 2530 | * @author Bermi Ferrer (http://bermi.org) | ||
| 2531 | */ | ||
| 2532 | WYMeditor.StateStack = function(start) | ||
| 2533 | { | ||
| 2534 | this._stack = [start]; | ||
| 2535 | return this; | ||
| 2536 | }; | ||
| 2537 | |||
| 2538 | /** | ||
| 2539 | * Accessor for current state. | ||
| 2540 | * @return string State. | ||
| 2541 | * @access public | ||
| 2542 | */ | ||
| 2543 | WYMeditor.StateStack.prototype.getCurrent = function() | ||
| 2544 | { | ||
| 2545 | return this._stack[this._stack.length - 1]; | ||
| 2546 | }; | ||
| 2547 | |||
| 2548 | /** | ||
| 2549 | * Adds a state to the stack and sets it | ||
| 2550 | * to be the current state. | ||
| 2551 | * @param string state New state. | ||
| 2552 | * @access public | ||
| 2553 | */ | ||
| 2554 | WYMeditor.StateStack.prototype.enter = function(state) | ||
| 2555 | { | ||
| 2556 | this._stack.push(state); | ||
| 2557 | }; | ||
| 2558 | |||
| 2559 | /** | ||
| 2560 | * Leaves the current state and reverts | ||
| 2561 | * to the previous one. | ||
| 2562 | * @return boolean False if we drop off | ||
| 2563 | * the bottom of the list. | ||
| 2564 | * @access public | ||
| 2565 | */ | ||
| 2566 | WYMeditor.StateStack.prototype.leave = function() | ||
| 2567 | { | ||
| 2568 | if (this._stack.length == 1) { | ||
| 2569 | return false; | ||
| 2570 | } | ||
| 2571 | this._stack.pop(); | ||
| 2572 | return true; | ||
| 2573 | }; | ||
| 2574 | |||
| 2575 | |||
| 2576 | // GLOBALS | ||
| 2577 | WYMeditor.LEXER_ENTER = 1; | ||
| 2578 | WYMeditor.LEXER_MATCHED = 2; | ||
| 2579 | WYMeditor.LEXER_UNMATCHED = 3; | ||
| 2580 | WYMeditor.LEXER_EXIT = 4; | ||
| 2581 | WYMeditor.LEXER_SPECIAL = 5; | ||
| 2582 | |||
| 2583 | |||
| 2584 | /** | ||
| 2585 | * Accepts text and breaks it into tokens. | ||
| 2586 | * Some optimisation to make the sure the | ||
| 2587 | * content is only scanned by the PHP regex | ||
| 2588 | * parser once. Lexer modes must not start | ||
| 2589 | * with leading underscores. | ||
| 2590 | * | ||
| 2591 | * Sets up the lexer in case insensitive matching | ||
| 2592 | * by default. | ||
| 2593 | * @param Parser parser Handling strategy by reference. | ||
| 2594 | * @param string start Starting handler. | ||
| 2595 | * @param boolean case True for case sensitive. | ||
| 2596 | * @access public | ||
| 2597 | * @author Marcus Baker (http://lastcraft.com) | ||
| 2598 | * @author Bermi Ferrer (http://bermi.org) | ||
| 2599 | */ | ||
| 2600 | WYMeditor.Lexer = function(parser, start, case_sensitive) | ||
| 2601 | { | ||
| 2602 | start = start || 'accept'; | ||
| 2603 | this._case = case_sensitive || false; | ||
| 2604 | this._regexes = {}; | ||
| 2605 | this._parser = parser; | ||
| 2606 | this._mode = new WYMeditor.StateStack(start); | ||
| 2607 | this._mode_handlers = {}; | ||
| 2608 | this._mode_handlers[start] = start; | ||
| 2609 | return this; | ||
| 2610 | }; | ||
| 2611 | |||
| 2612 | /** | ||
| 2613 | * Adds a token search pattern for a particular | ||
| 2614 | * parsing mode. The pattern does not change the | ||
| 2615 | * current mode. | ||
| 2616 | * @param string pattern Perl style regex, but ( and ) | ||
| 2617 | * lose the usual meaning. | ||
| 2618 | * @param string mode Should only apply this | ||
| 2619 | * pattern when dealing with | ||
| 2620 | * this type of input. | ||
| 2621 | * @access public | ||
| 2622 | */ | ||
| 2623 | WYMeditor.Lexer.prototype.addPattern = function(pattern, mode) | ||
| 2624 | { | ||
| 2625 | var mode = mode || "accept"; | ||
| 2626 | if (typeof this._regexes[mode] == 'undefined') { | ||
| 2627 | this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); | ||
| 2628 | } | ||
| 2629 | this._regexes[mode].addPattern(pattern); | ||
| 2630 | if (typeof this._mode_handlers[mode] == 'undefined') { | ||
| 2631 | this._mode_handlers[mode] = mode; | ||
| 2632 | } | ||
| 2633 | }; | ||
| 2634 | |||
| 2635 | /** | ||
| 2636 | * Adds a pattern that will enter a new parsing | ||
| 2637 | * mode. Useful for entering parenthesis, strings, | ||
| 2638 | * tags, etc. | ||
| 2639 | * @param string pattern Perl style regex, but ( and ) | ||
| 2640 | * lose the usual meaning. | ||
| 2641 | * @param string mode Should only apply this | ||
| 2642 | * pattern when dealing with | ||
| 2643 | * this type of input. | ||
| 2644 | * @param string new_mode Change parsing to this new | ||
| 2645 | * nested mode. | ||
| 2646 | * @access public | ||
| 2647 | */ | ||
| 2648 | WYMeditor.Lexer.prototype.addEntryPattern = function(pattern, mode, new_mode) | ||
| 2649 | { | ||
| 2650 | if (typeof this._regexes[mode] == 'undefined') { | ||
| 2651 | this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); | ||
| 2652 | } | ||
| 2653 | this._regexes[mode].addPattern(pattern, new_mode); | ||
| 2654 | if (typeof this._mode_handlers[new_mode] == 'undefined') { | ||
| 2655 | this._mode_handlers[new_mode] = new_mode; | ||
| 2656 | } | ||
| 2657 | }; | ||
| 2658 | |||
| 2659 | /** | ||
| 2660 | * Adds a pattern that will exit the current mode | ||
| 2661 | * and re-enter the previous one. | ||
| 2662 | * @param string pattern Perl style regex, but ( and ) | ||
| 2663 | * lose the usual meaning. | ||
| 2664 | * @param string mode Mode to leave. | ||
| 2665 | * @access public | ||
| 2666 | */ | ||
| 2667 | WYMeditor.Lexer.prototype.addExitPattern = function(pattern, mode) | ||
| 2668 | { | ||
| 2669 | if (typeof this._regexes[mode] == 'undefined') { | ||
| 2670 | this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); | ||
| 2671 | } | ||
| 2672 | this._regexes[mode].addPattern(pattern, "__exit"); | ||
| 2673 | if (typeof this._mode_handlers[mode] == 'undefined') { | ||
| 2674 | this._mode_handlers[mode] = mode; | ||
| 2675 | } | ||
| 2676 | }; | ||
| 2677 | |||
| 2678 | /** | ||
| 2679 | * Adds a pattern that has a special mode. Acts as an entry | ||
| 2680 | * and exit pattern in one go, effectively calling a special | ||
| 2681 | * parser handler for this token only. | ||
| 2682 | * @param string pattern Perl style regex, but ( and ) | ||
| 2683 | * lose the usual meaning. | ||
| 2684 | * @param string mode Should only apply this | ||
| 2685 | * pattern when dealing with | ||
| 2686 | * this type of input. | ||
| 2687 | * @param string special Use this mode for this one token. | ||
| 2688 | * @access public | ||
| 2689 | */ | ||
| 2690 | WYMeditor.Lexer.prototype.addSpecialPattern = function(pattern, mode, special) | ||
| 2691 | { | ||
| 2692 | if (typeof this._regexes[mode] == 'undefined') { | ||
| 2693 | this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); | ||
| 2694 | } | ||
| 2695 | this._regexes[mode].addPattern(pattern, '_'+special); | ||
| 2696 | if (typeof this._mode_handlers[special] == 'undefined') { | ||
| 2697 | this._mode_handlers[special] = special; | ||
| 2698 | } | ||
| 2699 | }; | ||
| 2700 | |||
| 2701 | /** | ||
| 2702 | * Adds a mapping from a mode to another handler. | ||
| 2703 | * @param string mode Mode to be remapped. | ||
| 2704 | * @param string handler New target handler. | ||
| 2705 | * @access public | ||
| 2706 | */ | ||
| 2707 | WYMeditor.Lexer.prototype.mapHandler = function(mode, handler) | ||
| 2708 | { | ||
| 2709 | this._mode_handlers[mode] = handler; | ||
| 2710 | }; | ||
| 2711 | |||
| 2712 | /** | ||
| 2713 | * Splits the page text into tokens. Will fail | ||
| 2714 | * if the handlers report an error or if no | ||
| 2715 | * content is consumed. If successful then each | ||
| 2716 | * unparsed and parsed token invokes a call to the | ||
| 2717 | * held listener. | ||
| 2718 | * @param string raw Raw HTML text. | ||
| 2719 | * @return boolean True on success, else false. | ||
| 2720 | * @access public | ||
| 2721 | */ | ||
| 2722 | WYMeditor.Lexer.prototype.parse = function(raw) | ||
| 2723 | { | ||
| 2724 | if (typeof this._parser == 'undefined') { | ||
| 2725 | return false; | ||
| 2726 | } | ||
| 2727 | |||
| 2728 | var length = raw.length; | ||
| 2729 | var parsed; | ||
| 2730 | while (typeof (parsed = this._reduce(raw)) == 'object') { | ||
| 2731 | var raw = parsed[0]; | ||
| 2732 | var unmatched = parsed[1]; | ||
| 2733 | var matched = parsed[2]; | ||
| 2734 | var mode = parsed[3]; | ||
| 2735 | |||
| 2736 | if (! this._dispatchTokens(unmatched, matched, mode)) { | ||
| 2737 | return false; | ||
| 2738 | } | ||
| 2739 | |||
| 2740 | if (raw == '') { | ||
| 2741 | return true; | ||
| 2742 | } | ||
| 2743 | if (raw.length == length) { | ||
| 2744 | return false; | ||
| 2745 | } | ||
| 2746 | length = raw.length; | ||
| 2747 | } | ||
| 2748 | if (! parsed ) { | ||
| 2749 | return false; | ||
| 2750 | } | ||
| 2751 | |||
| 2752 | return this._invokeParser(raw, WYMeditor.LEXER_UNMATCHED); | ||
| 2753 | }; | ||
| 2754 | |||
| 2755 | /** | ||
| 2756 | * Sends the matched token and any leading unmatched | ||
| 2757 | * text to the parser changing the lexer to a new | ||
| 2758 | * mode if one is listed. | ||
| 2759 | * @param string unmatched Unmatched leading portion. | ||
| 2760 | * @param string matched Actual token match. | ||
| 2761 | * @param string mode Mode after match. A boolean | ||
| 2762 | * false mode causes no change. | ||
| 2763 | * @return boolean False if there was any error | ||
| 2764 | * from the parser. | ||
| 2765 | * @access private | ||
| 2766 | */ | ||
| 2767 | WYMeditor.Lexer.prototype._dispatchTokens = function(unmatched, matched, mode) | ||
| 2768 | { | ||
| 2769 | mode = mode || false; | ||
| 2770 | |||
| 2771 | if (! this._invokeParser(unmatched, WYMeditor.LEXER_UNMATCHED)) { | ||
| 2772 | return false; | ||
| 2773 | } | ||
| 2774 | |||
| 2775 | if (typeof mode == 'boolean') { | ||
| 2776 | return this._invokeParser(matched, WYMeditor.LEXER_MATCHED); | ||
| 2777 | } | ||
| 2778 | if (this._isModeEnd(mode)) { | ||
| 2779 | if (! this._invokeParser(matched, WYMeditor.LEXER_EXIT)) { | ||
| 2780 | return false; | ||
| 2781 | } | ||
| 2782 | return this._mode.leave(); | ||
| 2783 | } | ||
| 2784 | if (this._isSpecialMode(mode)) { | ||
| 2785 | this._mode.enter(this._decodeSpecial(mode)); | ||
| 2786 | if (! this._invokeParser(matched, WYMeditor.LEXER_SPECIAL)) { | ||
| 2787 | return false; | ||
| 2788 | } | ||
| 2789 | return this._mode.leave(); | ||
| 2790 | } | ||
| 2791 | this._mode.enter(mode); | ||
| 2792 | |||
| 2793 | return this._invokeParser(matched, WYMeditor.LEXER_ENTER); | ||
| 2794 | }; | ||
| 2795 | |||
| 2796 | /** | ||
| 2797 | * Tests to see if the new mode is actually to leave | ||
| 2798 | * the current mode and pop an item from the matching | ||
| 2799 | * mode stack. | ||
| 2800 | * @param string mode Mode to test. | ||
| 2801 | * @return boolean True if this is the exit mode. | ||
| 2802 | * @access private | ||
| 2803 | */ | ||
| 2804 | WYMeditor.Lexer.prototype._isModeEnd = function(mode) | ||
| 2805 | { | ||
| 2806 | return (mode === "__exit"); | ||
| 2807 | }; | ||
| 2808 | |||
| 2809 | /** | ||
| 2810 | * Test to see if the mode is one where this mode | ||
| 2811 | * is entered for this token only and automatically | ||
| 2812 | * leaves immediately afterwoods. | ||
| 2813 | * @param string mode Mode to test. | ||
| 2814 | * @return boolean True if this is the exit mode. | ||
| 2815 | * @access private | ||
| 2816 | */ | ||
| 2817 | WYMeditor.Lexer.prototype._isSpecialMode = function(mode) | ||
| 2818 | { | ||
| 2819 | return (mode.substring(0,1) == "_"); | ||
| 2820 | }; | ||
| 2821 | |||
| 2822 | /** | ||
| 2823 | * Strips the magic underscore marking single token | ||
| 2824 | * modes. | ||
| 2825 | * @param string mode Mode to decode. | ||
| 2826 | * @return string Underlying mode name. | ||
| 2827 | * @access private | ||
| 2828 | */ | ||
| 2829 | WYMeditor.Lexer.prototype._decodeSpecial = function(mode) | ||
| 2830 | { | ||
| 2831 | return mode.substring(1); | ||
| 2832 | }; | ||
| 2833 | |||
| 2834 | /** | ||
| 2835 | * Calls the parser method named after the current | ||
| 2836 | * mode. Empty content will be ignored. The lexer | ||
| 2837 | * has a parser handler for each mode in the lexer. | ||
| 2838 | * @param string content Text parsed. | ||
| 2839 | * @param boolean is_match Token is recognised rather | ||
| 2840 | * than unparsed data. | ||
| 2841 | * @access private | ||
| 2842 | */ | ||
| 2843 | WYMeditor.Lexer.prototype._invokeParser = function(content, is_match) | ||
| 2844 | { | ||
| 2845 | |||
| 2846 | if (!/ +/.test(content) && ((content === '') || (content == false))) { | ||
| 2847 | return true; | ||
| 2848 | } | ||
| 2849 | var current = this._mode.getCurrent(); | ||
| 2850 | var handler = this._mode_handlers[current]; | ||
| 2851 | var result; | ||
| 2852 | eval('result = this._parser.' + handler + '(content, is_match);'); | ||
| 2853 | return result; | ||
| 2854 | }; | ||
| 2855 | |||
| 2856 | /** | ||
| 2857 | * Tries to match a chunk of text and if successful | ||
| 2858 | * removes the recognised chunk and any leading | ||
| 2859 | * unparsed data. Empty strings will not be matched. | ||
| 2860 | * @param string raw The subject to parse. This is the | ||
| 2861 | * content that will be eaten. | ||
| 2862 | * @return array/boolean Three item list of unparsed | ||
| 2863 | * content followed by the | ||
| 2864 | * recognised token and finally the | ||
| 2865 | * action the parser is to take. | ||
| 2866 | * True if no match, false if there | ||
| 2867 | * is a parsing error. | ||
| 2868 | * @access private | ||
| 2869 | */ | ||
| 2870 | WYMeditor.Lexer.prototype._reduce = function(raw) | ||
| 2871 | { | ||
| 2872 | var matched = this._regexes[this._mode.getCurrent()].match(raw); | ||
| 2873 | var match = matched[1]; | ||
| 2874 | var action = matched[0]; | ||
| 2875 | if (action) { | ||
| 2876 | var unparsed_character_count = raw.indexOf(match); | ||
| 2877 | var unparsed = raw.substr(0, unparsed_character_count); | ||
| 2878 | raw = raw.substring(unparsed_character_count + match.length); | ||
| 2879 | return [raw, unparsed, match, action]; | ||
| 2880 | } | ||
| 2881 | return true; | ||
| 2882 | }; | ||
| 2883 | |||
| 2884 | |||
| 2885 | |||
| 2886 | /** | ||
| 2887 | * This are the rules for breaking the XHTML code into events | ||
| 2888 | * handled by the provided parser. | ||
| 2889 | * | ||
| 2890 | * @author Marcus Baker (http://lastcraft.com) | ||
| 2891 | * @author Bermi Ferrer (http://bermi.org) | ||
| 2892 | */ | ||
| 2893 | WYMeditor.XhtmlLexer = function(parser) | ||
| 2894 | { | ||
| 2895 | jQuery.extend(this, new WYMeditor.Lexer(parser, 'Text')); | ||
| 2896 | |||
| 2897 | this.mapHandler('Text', 'Text'); | ||
| 2898 | |||
| 2899 | this.addTokens(); | ||
| 2900 | |||
| 2901 | this.init(); | ||
| 2902 | |||
| 2903 | return this; | ||
| 2904 | }; | ||
| 2905 | |||
| 2906 | |||
| 2907 | WYMeditor.XhtmlLexer.prototype.init = function() | ||
| 2908 | { | ||
| 2909 | }; | ||
| 2910 | |||
| 2911 | WYMeditor.XhtmlLexer.prototype.addTokens = function() | ||
| 2912 | { | ||
| 2913 | this.addCommentTokens('Text'); | ||
| 2914 | this.addScriptTokens('Text'); | ||
| 2915 | this.addCssTokens('Text'); | ||
| 2916 | this.addTagTokens('Text'); | ||
| 2917 | }; | ||
| 2918 | |||
| 2919 | WYMeditor.XhtmlLexer.prototype.addCommentTokens = function(scope) | ||
| 2920 | { | ||
| 2921 | this.addEntryPattern("<!--", scope, 'Comment'); | ||
| 2922 | this.addExitPattern("-->", 'Comment'); | ||
| 2923 | }; | ||
| 2924 | |||
| 2925 | WYMeditor.XhtmlLexer.prototype.addScriptTokens = function(scope) | ||
| 2926 | { | ||
| 2927 | this.addEntryPattern("<script", scope, 'Script'); | ||
| 2928 | this.addExitPattern("</script>", 'Script'); | ||
| 2929 | }; | ||
| 2930 | |||
| 2931 | WYMeditor.XhtmlLexer.prototype.addCssTokens = function(scope) | ||
| 2932 | { | ||
| 2933 | this.addEntryPattern("<style", scope, 'Css'); | ||
| 2934 | this.addExitPattern("</style>", 'Css'); | ||
| 2935 | }; | ||
| 2936 | |||
| 2937 | WYMeditor.XhtmlLexer.prototype.addTagTokens = function(scope) | ||
| 2938 | { | ||
| 2939 | this.addSpecialPattern("<\\s*[a-z0-9:\-]+\\s*>", scope, 'OpeningTag'); | ||
| 2940 | this.addEntryPattern("<[a-z0-9:\-]+"+'[\\\/ \\\>]+', scope, 'OpeningTag'); | ||
| 2941 | this.addInTagDeclarationTokens('OpeningTag'); | ||
| 2942 | |||
| 2943 | this.addSpecialPattern("</\\s*[a-z0-9:\-]+\\s*>", scope, 'ClosingTag'); | ||
| 2944 | |||
| 2945 | }; | ||
| 2946 | |||
| 2947 | WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens = function(scope) | ||
| 2948 | { | ||
| 2949 | this.addSpecialPattern('\\s+', scope, 'Ignore'); | ||
| 2950 | |||
| 2951 | this.addAttributeTokens(scope); | ||
| 2952 | |||
| 2953 | this.addExitPattern('/>', scope); | ||
| 2954 | this.addExitPattern('>', scope); | ||
| 2955 | |||
| 2956 | }; | ||
| 2957 | |||
| 2958 | WYMeditor.XhtmlLexer.prototype.addAttributeTokens = function(scope) | ||
| 2959 | { | ||
| 2960 | this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?=\=)\\s*", scope, 'TagAttributes'); | ||
| 2961 | |||
| 2962 | this.addEntryPattern('=\\s*"', scope, 'DoubleQuotedAttribute'); | ||
| 2963 | this.addPattern("\\\\\"", 'DoubleQuotedAttribute'); | ||
| 2964 | this.addExitPattern('"', 'DoubleQuotedAttribute'); | ||
| 2965 | |||
| 2966 | this.addEntryPattern("=\\s*'", scope, 'SingleQuotedAttribute'); | ||
| 2967 | this.addPattern("\\\\'", 'SingleQuotedAttribute'); | ||
| 2968 | this.addExitPattern("'", 'SingleQuotedAttribute'); | ||
| 2969 | |||
| 2970 | this.addSpecialPattern('=\\s*[^>\\s]*', scope, 'UnquotedAttribute'); | ||
| 2971 | }; | ||
| 2972 | |||
| 2973 | |||
| 2974 | |||
| 2975 | /** | ||
| 2976 | * XHTML Parser. | ||
| 2977 | * | ||
| 2978 | * This XHTML parser will trigger the events available on on | ||
| 2979 | * current SaxListener | ||
| 2980 | * | ||
| 2981 | * @author Bermi Ferrer (http://bermi.org) | ||
| 2982 | */ | ||
| 2983 | WYMeditor.XhtmlParser = function(Listener, mode) | ||
| 2984 | { | ||
| 2985 | var mode = mode || 'Text'; | ||
| 2986 | this._Lexer = new WYMeditor.XhtmlLexer(this); | ||
| 2987 | this._Listener = Listener; | ||
| 2988 | this._mode = mode; | ||
| 2989 | this._matches = []; | ||
| 2990 | this._last_match = ''; | ||
| 2991 | this._current_match = ''; | ||
| 2992 | |||
| 2993 | return this; | ||
| 2994 | }; | ||
| 2995 | |||
| 2996 | WYMeditor.XhtmlParser.prototype.parse = function(raw) | ||
| 2997 | { | ||
| 2998 | this._Lexer.parse(this.beforeParsing(raw)); | ||
| 2999 | return this.afterParsing(this._Listener.getResult()); | ||
| 3000 | }; | ||
| 3001 | |||
| 3002 | WYMeditor.XhtmlParser.prototype.beforeParsing = function(raw) | ||
| 3003 | { | ||
| 3004 | if(raw.match(/class="MsoNormal"/) || raw.match(/ns = "urn:schemas-microsoft-com/)){ | ||
| 3005 | // Usefull for cleaning up content pasted from other sources (MSWord) | ||
| 3006 | this._Listener.avoidStylingTagsAndAttributes(); | ||
| 3007 | } | ||
| 3008 | return this._Listener.beforeParsing(raw); | ||
| 3009 | }; | ||
| 3010 | |||
| 3011 | WYMeditor.XhtmlParser.prototype.afterParsing = function(parsed) | ||
| 3012 | { | ||
| 3013 | if(this._Listener._avoiding_tags_implicitly){ | ||
| 3014 | this._Listener.allowStylingTagsAndAttributes(); | ||
| 3015 | } | ||
| 3016 | return this._Listener.afterParsing(parsed); | ||
| 3017 | }; | ||
| 3018 | |||
| 3019 | |||
| 3020 | WYMeditor.XhtmlParser.prototype.Ignore = function(match, state) | ||
| 3021 | { | ||
| 3022 | return true; | ||
| 3023 | }; | ||
| 3024 | |||
| 3025 | WYMeditor.XhtmlParser.prototype.Text = function(text) | ||
| 3026 | { | ||
| 3027 | this._Listener.addContent(text); | ||
| 3028 | return true; | ||
| 3029 | }; | ||
| 3030 | |||
| 3031 | WYMeditor.XhtmlParser.prototype.Comment = function(match, status) | ||
| 3032 | { | ||
| 3033 | return this._addNonTagBlock(match, status, 'addComment'); | ||
| 3034 | }; | ||
| 3035 | |||
| 3036 | WYMeditor.XhtmlParser.prototype.Script = function(match, status) | ||
| 3037 | { | ||
| 3038 | return this._addNonTagBlock(match, status, 'addScript'); | ||
| 3039 | }; | ||
| 3040 | |||
| 3041 | WYMeditor.XhtmlParser.prototype.Css = function(match, status) | ||
| 3042 | { | ||
| 3043 | return this._addNonTagBlock(match, status, 'addCss'); | ||
| 3044 | }; | ||
| 3045 | |||
| 3046 | WYMeditor.XhtmlParser.prototype._addNonTagBlock = function(match, state, type) | ||
| 3047 | { | ||
| 3048 | switch (state){ | ||
| 3049 | case WYMeditor.LEXER_ENTER: | ||
| 3050 | this._non_tag = match; | ||
| 3051 | break; | ||
| 3052 | case WYMeditor.LEXER_UNMATCHED: | ||
| 3053 | this._non_tag += match; | ||
| 3054 | break; | ||
| 3055 | case WYMeditor.LEXER_EXIT: | ||
| 3056 | switch(type) { | ||
| 3057 | case 'addComment': | ||
| 3058 | this._Listener.addComment(this._non_tag+match); | ||
| 3059 | break; | ||
| 3060 | case 'addScript': | ||
| 3061 | this._Listener.addScript(this._non_tag+match); | ||
| 3062 | break; | ||
| 3063 | case 'addCss': | ||
| 3064 | this._Listener.addCss(this._non_tag+match); | ||
| 3065 | break; | ||
| 3066 | } | ||
| 3067 | } | ||
| 3068 | return true; | ||
| 3069 | }; | ||
| 3070 | |||
| 3071 | WYMeditor.XhtmlParser.prototype.OpeningTag = function(match, state) | ||
| 3072 | { | ||
| 3073 | switch (state){ | ||
| 3074 | case WYMeditor.LEXER_ENTER: | ||
| 3075 | this._tag = this.normalizeTag(match); | ||
| 3076 | this._tag_attributes = {}; | ||
| 3077 | break; | ||
| 3078 | case WYMeditor.LEXER_SPECIAL: | ||
| 3079 | this._callOpenTagListener(this.normalizeTag(match)); | ||
| 3080 | break; | ||
| 3081 | case WYMeditor.LEXER_EXIT: | ||
| 3082 | this._callOpenTagListener(this._tag, this._tag_attributes); | ||
| 3083 | } | ||
| 3084 | return true; | ||
| 3085 | }; | ||
| 3086 | |||
| 3087 | WYMeditor.XhtmlParser.prototype.ClosingTag = function(match, state) | ||
| 3088 | { | ||
| 3089 | this._callCloseTagListener(this.normalizeTag(match)); | ||
| 3090 | return true; | ||
| 3091 | }; | ||
| 3092 | |||
| 3093 | WYMeditor.XhtmlParser.prototype._callOpenTagListener = function(tag, attributes) | ||
| 3094 | { | ||
| 3095 | var attributes = attributes || {}; | ||
| 3096 | this.autoCloseUnclosedBeforeNewOpening(tag); | ||
| 3097 | |||
| 3098 | if(this._Listener.isBlockTag(tag)){ | ||
| 3099 | this._Listener._tag_stack.push(tag); | ||
| 3100 | this._Listener.fixNestingBeforeOpeningBlockTag(tag, attributes); | ||
| 3101 | this._Listener.openBlockTag(tag, attributes); | ||
| 3102 | this._increaseOpenTagCounter(tag); | ||
| 3103 | }else if(this._Listener.isInlineTag(tag)){ | ||
| 3104 | this._Listener.inlineTag(tag, attributes); | ||
| 3105 | }else{ | ||
| 3106 | this._Listener.openUnknownTag(tag, attributes); | ||
| 3107 | this._increaseOpenTagCounter(tag); | ||
| 3108 | } | ||
| 3109 | this._Listener.last_tag = tag; | ||
| 3110 | this._Listener.last_tag_opened = true; | ||
| 3111 | this._Listener.last_tag_attributes = attributes; | ||
| 3112 | }; | ||
| 3113 | |||
| 3114 | WYMeditor.XhtmlParser.prototype._callCloseTagListener = function(tag) | ||
| 3115 | { | ||
| 3116 | if(this._decreaseOpenTagCounter(tag)){ | ||
| 3117 | this.autoCloseUnclosedBeforeTagClosing(tag); | ||
| 3118 | |||
| 3119 | if(this._Listener.isBlockTag(tag)){ | ||
| 3120 | var expected_tag = this._Listener._tag_stack.pop(); | ||
| 3121 | if(expected_tag == false){ | ||
| 3122 | return; | ||
| 3123 | }else if(expected_tag != tag){ | ||
| 3124 | tag = expected_tag; | ||
| 3125 | } | ||
| 3126 | this._Listener.closeBlockTag(tag); | ||
| 3127 | }else{ | ||
| 3128 | this._Listener.closeUnknownTag(tag); | ||
| 3129 | } | ||
| 3130 | }else{ | ||
| 3131 | this._Listener.closeUnopenedTag(tag); | ||
| 3132 | } | ||
| 3133 | this._Listener.last_tag = tag; | ||
| 3134 | this._Listener.last_tag_opened = false; | ||
| 3135 | }; | ||
| 3136 | |||
| 3137 | WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter = function(tag) | ||
| 3138 | { | ||
| 3139 | this._Listener._open_tags[tag] = this._Listener._open_tags[tag] || 0; | ||
| 3140 | this._Listener._open_tags[tag]++; | ||
| 3141 | }; | ||
| 3142 | |||
| 3143 | WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter = function(tag) | ||
| 3144 | { | ||
| 3145 | if(this._Listener._open_tags[tag]){ | ||
| 3146 | this._Listener._open_tags[tag]--; | ||
| 3147 | if(this._Listener._open_tags[tag] == 0){ | ||
| 3148 | this._Listener._open_tags[tag] = undefined; | ||
| 3149 | } | ||
| 3150 | return true; | ||
| 3151 | } | ||
| 3152 | return false; | ||
| 3153 | }; | ||
| 3154 | |||
| 3155 | WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening = function(new_tag) | ||
| 3156 | { | ||
| 3157 | this._autoCloseUnclosed(new_tag, false); | ||
| 3158 | }; | ||
| 3159 | |||
| 3160 | WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing = function(tag) | ||
| 3161 | { | ||
| 3162 | this._autoCloseUnclosed(tag, true); | ||
| 3163 | }; | ||
| 3164 | |||
| 3165 | WYMeditor.XhtmlParser.prototype._autoCloseUnclosed = function(new_tag, closing) | ||
| 3166 | { | ||
| 3167 | var closing = closing || false; | ||
| 3168 | if(this._Listener._open_tags){ | ||
| 3169 | for (var tag in this._Listener._open_tags) { | ||
| 3170 | var counter = this._Listener._open_tags[tag]; | ||
| 3171 | if(counter > 0 && this._Listener.shouldCloseTagAutomatically(tag, new_tag, closing)){ | ||
| 3172 | this._callCloseTagListener(tag, true); | ||
| 3173 | } | ||
| 3174 | } | ||
| 3175 | } | ||
| 3176 | }; | ||
| 3177 | |||
| 3178 | WYMeditor.XhtmlParser.prototype.getTagReplacements = function() | ||
| 3179 | { | ||
| 3180 | return this._Listener.getTagReplacements(); | ||
| 3181 | }; | ||
| 3182 | |||
| 3183 | WYMeditor.XhtmlParser.prototype.normalizeTag = function(tag) | ||
| 3184 | { | ||
| 3185 | tag = tag.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,'').toLowerCase(); | ||
| 3186 | var tags = this._Listener.getTagReplacements(); | ||
| 3187 | if(tags[tag]){ | ||
| 3188 | return tags[tag]; | ||
| 3189 | } | ||
| 3190 | return tag; | ||
| 3191 | }; | ||
| 3192 | |||
| 3193 | WYMeditor.XhtmlParser.prototype.TagAttributes = function(match, state) | ||
| 3194 | { | ||
| 3195 | if(WYMeditor.LEXER_SPECIAL == state){ | ||
| 3196 | this._current_attribute = match; | ||
| 3197 | } | ||
| 3198 | return true; | ||
| 3199 | }; | ||
| 3200 | |||
| 3201 | WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute = function(match, state) | ||
| 3202 | { | ||
| 3203 | if(WYMeditor.LEXER_UNMATCHED == state){ | ||
| 3204 | this._tag_attributes[this._current_attribute] = match; | ||
| 3205 | } | ||
| 3206 | return true; | ||
| 3207 | }; | ||
| 3208 | |||
| 3209 | WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute = function(match, state) | ||
| 3210 | { | ||
| 3211 | if(WYMeditor.LEXER_UNMATCHED == state){ | ||
| 3212 | this._tag_attributes[this._current_attribute] = match; | ||
| 3213 | } | ||
| 3214 | return true; | ||
| 3215 | }; | ||
| 3216 | |||
| 3217 | WYMeditor.XhtmlParser.prototype.UnquotedAttribute = function(match, state) | ||
| 3218 | { | ||
| 3219 | this._tag_attributes[this._current_attribute] = match.replace(/^=/,''); | ||
| 3220 | return true; | ||
| 3221 | }; | ||
| 3222 | |||
| 3223 | |||
| 3224 | |||
| 3225 | /** | ||
| 3226 | * XHTML Sax parser. | ||
| 3227 | * | ||
| 3228 | * @author Bermi Ferrer (http://bermi.org) | ||
| 3229 | */ | ||
| 3230 | WYMeditor.XhtmlSaxListener = function() | ||
| 3231 | { | ||
| 3232 | this.output = ''; | ||
| 3233 | this.helper = new WYMeditor.XmlHelper(); | ||
| 3234 | this._open_tags = {}; | ||
| 3235 | this.validator = WYMeditor.XhtmlValidator; | ||
| 3236 | this._tag_stack = []; | ||
| 3237 | this.avoided_tags = []; | ||
| 3238 | |||
| 3239 | this.entities = { | ||
| 3240 | ' ':' ','¡':'¡','¢':'¢', | ||
| 3241 | '£':'£','¤':'¤','¥':'¥', | ||
| 3242 | '¦':'¦','§':'§','¨':'¨', | ||
| 3243 | '©':'©','ª':'ª','«':'«', | ||
| 3244 | '¬':'¬','­':'­','®':'®', | ||
| 3245 | '¯':'¯','°':'°','±':'±', | ||
| 3246 | '²':'²','³':'³','´':'´', | ||
| 3247 | 'µ':'µ','¶':'¶','·':'·', | ||
| 3248 | '¸':'¸','¹':'¹','º':'º', | ||
| 3249 | '»':'»','¼':'¼','½':'½', | ||
| 3250 | '¾':'¾','¿':'¿','À':'À', | ||
| 3251 | 'Á':'Á','Â':'Â','Ã':'Ã', | ||
| 3252 | 'Ä':'Ä','Å':'Å','Æ':'Æ', | ||
| 3253 | 'Ç':'Ç','È':'È','É':'É', | ||
| 3254 | 'Ê':'Ê','Ë':'Ë','Ì':'Ì', | ||
| 3255 | 'Í':'Í','Î':'Î','Ï':'Ï', | ||
| 3256 | 'Ð':'Ð','Ñ':'Ñ','Ò':'Ò', | ||
| 3257 | 'Ó':'Ó','Ô':'Ô','Õ':'Õ', | ||
| 3258 | 'Ö':'Ö','×':'×','Ø':'Ø', | ||
| 3259 | 'Ù':'Ù','Ú':'Ú','Û':'Û', | ||
| 3260 | 'Ü':'Ü','Ý':'Ý','Þ':'Þ', | ||
| 3261 | 'ß':'ß','à':'à','á':'á', | ||
| 3262 | 'â':'â','ã':'ã','ä':'ä', | ||
| 3263 | 'å':'å','æ':'æ','ç':'ç', | ||
| 3264 | 'è':'è','é':'é','ê':'ê', | ||
| 3265 | 'ë':'ë','ì':'ì','í':'í', | ||
| 3266 | 'î':'î','ï':'ï','ð':'ð', | ||
| 3267 | 'ñ':'ñ','ò':'ò','ó':'ó', | ||
| 3268 | 'ô':'ô','õ':'õ','ö':'ö', | ||
| 3269 | '÷':'÷','ø':'ø','ù':'ù', | ||
| 3270 | 'ú':'ú','û':'û','ü':'ü', | ||
| 3271 | 'ý':'ý','þ':'þ','ÿ':'ÿ', | ||
| 3272 | 'Œ':'Œ','œ':'œ','Š':'Š', | ||
| 3273 | 'š':'š','Ÿ':'Ÿ','ƒ':'ƒ', | ||
| 3274 | 'ˆ':'ˆ','˜':'˜','Α':'Α', | ||
| 3275 | 'Β':'Β','Γ':'Γ','Δ':'Δ', | ||
| 3276 | 'Ε':'Ε','Ζ':'Ζ','Η':'Η', | ||
| 3277 | 'Θ':'Θ','Ι':'Ι','Κ':'Κ', | ||
| 3278 | 'Λ':'Λ','Μ':'Μ','Ν':'Ν', | ||
| 3279 | 'Ξ':'Ξ','Ο':'Ο','Π':'Π', | ||
| 3280 | 'Ρ':'Ρ','Σ':'Σ','Τ':'Τ', | ||
| 3281 | 'Υ':'Υ','Φ':'Φ','Χ':'Χ', | ||
| 3282 | 'Ψ':'Ψ','Ω':'Ω','α':'α', | ||
| 3283 | 'β':'β','γ':'γ','δ':'δ', | ||
| 3284 | 'ε':'ε','ζ':'ζ','η':'η', | ||
| 3285 | 'θ':'θ','ι':'ι','κ':'κ', | ||
| 3286 | 'λ':'λ','μ':'μ','ν':'ν', | ||
| 3287 | 'ξ':'ξ','ο':'ο','π':'π', | ||
| 3288 | 'ρ':'ρ','ς':'ς','σ':'σ', | ||
| 3289 | 'τ':'τ','υ':'υ','φ':'φ', | ||
| 3290 | 'χ':'χ','ψ':'ψ','ω':'ω', | ||
| 3291 | 'ϑ':'ϑ','ϒ':'ϒ','ϖ':'ϖ', | ||
| 3292 | ' ':' ',' ':' ',' ':' ', | ||
| 3293 | '‌':'‌','‍':'‍','‎':'‎', | ||
| 3294 | '‏':'‏','–':'–','—':'—', | ||
| 3295 | '‘':'‘','’':'’','‚':'‚', | ||
| 3296 | '“':'“','”':'”','„':'„', | ||
| 3297 | '†':'†','‡':'‡','•':'•', | ||
| 3298 | '…':'…','‰':'‰','′':'′', | ||
| 3299 | '″':'″','‹':'‹','›':'›', | ||
| 3300 | '‾':'‾','⁄':'⁄','€':'€', | ||
| 3301 | 'ℑ':'ℑ','℘':'℘','ℜ':'ℜ', | ||
| 3302 | '™':'™','ℵ':'ℵ','←':'←', | ||
| 3303 | '↑':'↑','→':'→','↓':'↓', | ||
| 3304 | '↔':'↔','↵':'↵','⇐':'⇐', | ||
| 3305 | '⇑':'⇑','⇒':'⇒','⇓':'⇓', | ||
| 3306 | '⇔':'⇔','∀':'∀','∂':'∂', | ||
| 3307 | '∃':'∃','∅':'∅','∇':'∇', | ||
| 3308 | '∈':'∈','∉':'∉','∋':'∋', | ||
| 3309 | '∏':'∏','∑':'∑','−':'−', | ||
| 3310 | '∗':'∗','√':'√','∝':'∝', | ||
| 3311 | '∞':'∞','∠':'∠','∧':'∧', | ||
| 3312 | '∨':'∨','∩':'∩','∪':'∪', | ||
| 3313 | '∫':'∫','∴':'∴','∼':'∼', | ||
| 3314 | '≅':'≅','≈':'≈','≠':'≠', | ||
| 3315 | '≡':'≡','≤':'≤','≥':'≥', | ||
| 3316 | '⊂':'⊂','⊃':'⊃','⊄':'⊄', | ||
| 3317 | '⊆':'⊆','⊇':'⊇','⊕':'⊕', | ||
| 3318 | '⊗':'⊗','⊥':'⊥','⋅':'⋅', | ||
| 3319 | '⌈':'⌈','⌉':'⌉','⌊':'⌊', | ||
| 3320 | '⌋':'⌋','⟨':'〈','⟩':'〉', | ||
| 3321 | '◊':'◊','♠':'♠','♣':'♣', | ||
| 3322 | '♥':'♥','♦':'♦'}; | ||
| 3323 | |||
| 3324 | this.block_tags = ["a", "abbr", "acronym", "address", "area", "b", | ||
| 3325 | "base", "bdo", "big", "blockquote", "body", "button", | ||
| 3326 | "caption", "cite", "code", "col", "colgroup", "dd", "del", "div", | ||
| 3327 | "dfn", "dl", "dt", "em", "fieldset", "form", "head", "h1", "h2", | ||
| 3328 | "h3", "h4", "h5", "h6", "html", "i", "ins", | ||
| 3329 | "kbd", "label", "legend", "li", "map", "noscript", | ||
| 3330 | "object", "ol", "optgroup", "option", "p", "param", "pre", "q", | ||
| 3331 | "samp", "script", "select", "small", "span", "strong", "style", | ||
| 3332 | "sub", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", | ||
| 3333 | "thead", "title", "tr", "tt", "ul", "var", "extends"]; | ||
| 3334 | |||
| 3335 | |||
| 3336 | this.inline_tags = ["br", "hr", "img", "input"]; | ||
| 3337 | |||
| 3338 | return this; | ||
| 3339 | }; | ||
| 3340 | |||
| 3341 | WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically = function(tag, now_on_tag, closing) | ||
| 3342 | { | ||
| 3343 | var closing = closing || false; | ||
| 3344 | if(tag == 'td'){ | ||
| 3345 | if((closing && now_on_tag == 'tr') || (!closing && now_on_tag == 'td')){ | ||
| 3346 | return true; | ||
| 3347 | } | ||
| 3348 | } | ||
| 3349 | if(tag == 'option'){ | ||
| 3350 | if((closing && now_on_tag == 'select') || (!closing && now_on_tag == 'option')){ | ||
| 3351 | return true; | ||
| 3352 | } | ||
| 3353 | } | ||
| 3354 | return false; | ||
| 3355 | }; | ||
| 3356 | |||
| 3357 | WYMeditor.XhtmlSaxListener.prototype.beforeParsing = function(raw) | ||
| 3358 | { | ||
| 3359 | this.output = ''; | ||
| 3360 | return raw; | ||
| 3361 | }; | ||
| 3362 | |||
| 3363 | WYMeditor.XhtmlSaxListener.prototype.afterParsing = function(xhtml) | ||
| 3364 | { | ||
| 3365 | xhtml = this.replaceNamedEntities(xhtml); | ||
| 3366 | xhtml = this.joinRepeatedEntities(xhtml); | ||
| 3367 | xhtml = this.removeEmptyTags(xhtml); | ||
| 3368 | return xhtml; | ||
| 3369 | }; | ||
| 3370 | |||
| 3371 | WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities = function(xhtml) | ||
| 3372 | { | ||
| 3373 | for (var entity in this.entities) { | ||
| 3374 | xhtml = xhtml.replace(entity, this.entities[entity]); | ||
| 3375 | } | ||
| 3376 | return xhtml; | ||
| 3377 | }; | ||
| 3378 | |||
| 3379 | WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities = function(xhtml) | ||
| 3380 | { | ||
| 3381 | var tags = 'em|strong|sub|sup|acronym|pre|del|blockquote|address'; | ||
| 3382 | return xhtml.replace(new RegExp('<\/('+tags+')><\\1>' ,''),''). | ||
| 3383 | replace(new RegExp('(\s*<('+tags+')>\s*){2}(.*)(\s*<\/\\2>\s*){2}' ,''),'<\$2>\$3<\$2>'); | ||
| 3384 | }; | ||
| 3385 | |||
| 3386 | WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags = function(xhtml) | ||
| 3387 | { | ||
| 3388 | return xhtml.replace(new RegExp('<('+this.block_tags.join("|")+')>(<br \/>| | |\\s)*<\/\\1>' ,'g'),''); | ||
| 3389 | }; | ||
| 3390 | |||
| 3391 | WYMeditor.XhtmlSaxListener.prototype.getResult = function() | ||
| 3392 | { | ||
| 3393 | return this.output; | ||
| 3394 | }; | ||
| 3395 | |||
| 3396 | WYMeditor.XhtmlSaxListener.prototype.getTagReplacements = function() | ||
| 3397 | { | ||
| 3398 | return {'b':'strong', 'i':'em'}; | ||
| 3399 | }; | ||
| 3400 | |||
| 3401 | WYMeditor.XhtmlSaxListener.prototype.addContent = function(text) | ||
| 3402 | { | ||
| 3403 | this.output += text; | ||
| 3404 | }; | ||
| 3405 | |||
| 3406 | WYMeditor.XhtmlSaxListener.prototype.addComment = function(text) | ||
| 3407 | { | ||
| 3408 | if(this.remove_comments){ | ||
| 3409 | this.output += text; | ||
| 3410 | } | ||
| 3411 | }; | ||
| 3412 | |||
| 3413 | WYMeditor.XhtmlSaxListener.prototype.addScript = function(text) | ||
| 3414 | { | ||
| 3415 | if(!this.remove_scripts){ | ||
| 3416 | this.output += text; | ||
| 3417 | } | ||
| 3418 | }; | ||
| 3419 | |||
| 3420 | WYMeditor.XhtmlSaxListener.prototype.addCss = function(text) | ||
| 3421 | { | ||
| 3422 | if(!this.remove_embeded_styles){ | ||
| 3423 | this.output += text; | ||
| 3424 | } | ||
| 3425 | }; | ||
| 3426 | |||
| 3427 | WYMeditor.XhtmlSaxListener.prototype.openBlockTag = function(tag, attributes) | ||
| 3428 | { | ||
| 3429 | this.output += this.helper.tag(tag, this.validator.getValidTagAttributes(tag, attributes), true); | ||
| 3430 | }; | ||
| 3431 | |||
| 3432 | WYMeditor.XhtmlSaxListener.prototype.inlineTag = function(tag, attributes) | ||
| 3433 | { | ||
| 3434 | this.output += this.helper.tag(tag, this.validator.getValidTagAttributes(tag, attributes)); | ||
| 3435 | }; | ||
| 3436 | |||
| 3437 | WYMeditor.XhtmlSaxListener.prototype.openUnknownTag = function(tag, attributes) | ||
| 3438 | { | ||
| 3439 | //this.output += this.helper.tag(tag, attributes, true); | ||
| 3440 | }; | ||
| 3441 | |||
| 3442 | WYMeditor.XhtmlSaxListener.prototype.closeBlockTag = function(tag) | ||
| 3443 | { | ||
| 3444 | this.output = this.output.replace(/<br \/>$/, '')+this._getClosingTagContent('before', tag)+"</"+tag+">"+this._getClosingTagContent('after', tag); | ||
| 3445 | }; | ||
| 3446 | |||
| 3447 | WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag = function(tag) | ||
| 3448 | { | ||
| 3449 | //this.output += "</"+tag+">"; | ||
| 3450 | }; | ||
| 3451 | |||
| 3452 | WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag = function(tag) | ||
| 3453 | { | ||
| 3454 | this.output += "</"+tag+">"; | ||
| 3455 | }; | ||
| 3456 | |||
| 3457 | WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes = function() | ||
| 3458 | { | ||
| 3459 | this.avoided_tags = ['div','span']; | ||
| 3460 | this.validator.skiped_attributes = ['style']; | ||
| 3461 | this.validator.skiped_attribute_values = ['MsoNormal','main1']; // MS Word attributes for class | ||
| 3462 | this._avoiding_tags_implicitly = true; | ||
| 3463 | }; | ||
| 3464 | |||
| 3465 | WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes = function() | ||
| 3466 | { | ||
| 3467 | this.avoided_tags = []; | ||
| 3468 | this.validator.skiped_attributes = []; | ||
| 3469 | this.validator.skiped_attribute_values = []; | ||
| 3470 | this._avoiding_tags_implicitly = false; | ||
| 3471 | }; | ||
| 3472 | |||
| 3473 | WYMeditor.XhtmlSaxListener.prototype.isBlockTag = function(tag) | ||
| 3474 | { | ||
| 3475 | return !WYMeditor.Helper.contains(this.avoided_tags, tag) && WYMeditor.Helper.contains(this.block_tags, tag); | ||
| 3476 | }; | ||
| 3477 | |||
| 3478 | WYMeditor.XhtmlSaxListener.prototype.isInlineTag = function(tag) | ||
| 3479 | { | ||
| 3480 | return !WYMeditor.Helper.contains(this.avoided_tags, tag) && WYMeditor.Helper.contains(this.inline_tags, tag); | ||
| 3481 | }; | ||
| 3482 | |||
| 3483 | WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag = function(tag, content) | ||
| 3484 | { | ||
| 3485 | this._insertContentWhenClosingTag('after', tag, content); | ||
| 3486 | }; | ||
| 3487 | |||
| 3488 | WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag = function(tag, content) | ||
| 3489 | { | ||
| 3490 | this._insertContentWhenClosingTag('before', tag, content); | ||
| 3491 | }; | ||
| 3492 | |||
| 3493 | WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag = function(tag, attributes) | ||
| 3494 | { | ||
| 3495 | if(tag != 'li' && (tag == 'ul' || tag == 'ol') && this.last_tag && !this.last_tag_opened && this.last_tag == 'li'){ | ||
| 3496 | this.output = this.output.replace(/<\/li>$/, ''); | ||
| 3497 | this.insertContentAfterClosingTag(tag, '</li>'); | ||
| 3498 | } | ||
| 3499 | }; | ||
| 3500 | |||
| 3501 | WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag = function(position, tag, content) | ||
| 3502 | { | ||
| 3503 | if(!this['_insert_'+position+'_closing']){ | ||
| 3504 | this['_insert_'+position+'_closing'] = []; | ||
| 3505 | } | ||
| 3506 | if(!this['_insert_'+position+'_closing'][tag]){ | ||
| 3507 | this['_insert_'+position+'_closing'][tag] = []; | ||
| 3508 | } | ||
| 3509 | this['_insert_'+position+'_closing'][tag].push(content); | ||
| 3510 | }; | ||
| 3511 | |||
| 3512 | WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent = function(position, tag) | ||
| 3513 | { | ||
| 3514 | if( this['_insert_'+position+'_closing'] && | ||
| 3515 | this['_insert_'+position+'_closing'][tag] && | ||
| 3516 | this['_insert_'+position+'_closing'][tag].length > 0){ | ||
| 3517 | return this['_insert_'+position+'_closing'][tag].pop(); | ||
| 3518 | } | ||
| 3519 | return ''; | ||
| 3520 | }; | ||
| 3521 | |||
| 3522 | |||
| 3523 | /********** CSS PARSER **********/ | ||
| 3524 | |||
| 3525 | |||
| 3526 | WYMeditor.WymCssLexer = function(parser, only_wym_blocks) | ||
| 3527 | { | ||
| 3528 | var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? true : only_wym_blocks); | ||
| 3529 | |||
| 3530 | jQuery.extend(this, new WYMeditor.Lexer(parser, (only_wym_blocks?'Ignore':'WymCss'))); | ||
| 3531 | |||
| 3532 | this.mapHandler('WymCss', 'Ignore'); | ||
| 3533 | |||
| 3534 | if(only_wym_blocks == true){ | ||
| 3535 | this.addEntryPattern("/\\\x2a[<\\s]*WYMeditor[>\\s]*\\\x2a/", 'Ignore', 'WymCss'); | ||
| 3536 | this.addExitPattern("/\\\x2a[<\/\\s]*WYMeditor[>\\s]*\\\x2a/", 'WymCss'); | ||
| 3537 | } | ||
| 3538 | |||
| 3539 | this.addSpecialPattern("\\\x2e[a-z-_0-9]+[\\sa-z]*", 'WymCss', 'WymCssStyleDeclaration'); | ||
| 3540 | |||
| 3541 | this.addEntryPattern("/\\\x2a", 'WymCss', 'WymCssComment'); | ||
| 3542 | this.addExitPattern("\\\x2a/", 'WymCssComment'); | ||
| 3543 | |||
| 3544 | this.addEntryPattern("\x7b", 'WymCss', 'WymCssStyle'); | ||
| 3545 | this.addExitPattern("\x7d", 'WymCssStyle'); | ||
| 3546 | |||
| 3547 | this.addEntryPattern("/\\\x2a", 'WymCssStyle', 'WymCssFeddbackStyle'); | ||
| 3548 | this.addExitPattern("\\\x2a/", 'WymCssFeddbackStyle'); | ||
| 3549 | |||
| 3550 | return this; | ||
| 3551 | }; | ||
| 3552 | |||
| 3553 | WYMeditor.WymCssParser = function() | ||
| 3554 | { | ||
| 3555 | this._in_style = false; | ||
| 3556 | this._has_title = false; | ||
| 3557 | this.only_wym_blocks = true; | ||
| 3558 | this.css_settings = {'classesItems':[], 'editorStyles':[], 'dialogStyles':[]}; | ||
| 3559 | return this; | ||
| 3560 | }; | ||
| 3561 | |||
| 3562 | WYMeditor.WymCssParser.prototype.parse = function(raw, only_wym_blocks) | ||
| 3563 | { | ||
| 3564 | var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? this.only_wym_blocks : only_wym_blocks); | ||
| 3565 | this._Lexer = new WYMeditor.WymCssLexer(this, only_wym_blocks); | ||
| 3566 | this._Lexer.parse(raw); | ||
| 3567 | }; | ||
| 3568 | |||
| 3569 | WYMeditor.WymCssParser.prototype.Ignore = function(match, state) | ||
| 3570 | { | ||
| 3571 | return true; | ||
| 3572 | }; | ||
| 3573 | |||
| 3574 | WYMeditor.WymCssParser.prototype.WymCssComment = function(text, status) | ||
| 3575 | { | ||
| 3576 | if(text.match(/end[a-z0-9\s]*wym[a-z0-9\s]*/mi)){ | ||
| 3577 | return false; | ||
| 3578 | } | ||
| 3579 | if(status == WYMeditor.LEXER_UNMATCHED){ | ||
| 3580 | if(!this._in_style){ | ||
| 3581 | this._has_title = true; | ||
| 3582 | this._current_item = {'title':WYMeditor.Helper.trim(text)}; | ||
| 3583 | }else{ | ||
| 3584 | if(this._current_item[this._current_element]){ | ||
| 3585 | if(!this._current_item[this._current_element].expressions){ | ||
| 3586 | this._current_item[this._current_element].expressions = [text]; | ||
| 3587 | }else{ | ||
| 3588 | this._current_item[this._current_element].expressions.push(text); | ||
| 3589 | } | ||
| 3590 | } | ||
| 3591 | } | ||
| 3592 | this._in_style = true; | ||
| 3593 | } | ||
| 3594 | return true; | ||
| 3595 | }; | ||
| 3596 | |||
| 3597 | WYMeditor.WymCssParser.prototype.WymCssStyle = function(match, status) | ||
| 3598 | { | ||
| 3599 | if(status == WYMeditor.LEXER_UNMATCHED){ | ||
| 3600 | match = WYMeditor.Helper.trim(match); | ||
| 3601 | if(match != ''){ | ||
| 3602 | this._current_item[this._current_element].style = match; | ||
| 3603 | } | ||
| 3604 | }else if (status == WYMeditor.LEXER_EXIT){ | ||
| 3605 | this._in_style = false; | ||
| 3606 | this._has_title = false; | ||
| 3607 | this.addStyleSetting(this._current_item); | ||
| 3608 | } | ||
| 3609 | return true; | ||
| 3610 | }; | ||
| 3611 | |||
| 3612 | WYMeditor.WymCssParser.prototype.WymCssFeddbackStyle = function(match, status) | ||
| 3613 | { | ||
| 3614 | if(status == WYMeditor.LEXER_UNMATCHED){ | ||
| 3615 | this._current_item[this._current_element].feedback_style = match.replace(/^([\s\/\*]*)|([\s\/\*]*)$/gm,''); | ||
| 3616 | } | ||
| 3617 | return true; | ||
| 3618 | }; | ||
| 3619 | |||
| 3620 | WYMeditor.WymCssParser.prototype.WymCssStyleDeclaration = function(match) | ||
| 3621 | { | ||
| 3622 | match = match.replace(/^([\s\.]*)|([\s\.*]*)$/gm, ''); | ||
| 3623 | |||
| 3624 | var tag = ''; | ||
| 3625 | if(match.indexOf(' ') > 0){ | ||
| 3626 | var parts = match.split(' '); | ||
| 3627 | this._current_element = parts[0]; | ||
| 3628 | var tag = parts[1]; | ||
| 3629 | }else{ | ||
| 3630 | this._current_element = match; | ||
| 3631 | } | ||
| 3632 | |||
| 3633 | if(!this._has_title){ | ||
| 3634 | this._current_item = {'title':(!tag?'':tag.toUpperCase()+': ')+this._current_element}; | ||
| 3635 | this._has_title = true; | ||
| 3636 | } | ||
| 3637 | |||
| 3638 | if(!this._current_item[this._current_element]){ | ||
| 3639 | this._current_item[this._current_element] = {'name':this._current_element}; | ||
| 3640 | } | ||
| 3641 | if(tag){ | ||
| 3642 | if(!this._current_item[this._current_element].tags){ | ||
| 3643 | this._current_item[this._current_element].tags = [tag]; | ||
| 3644 | }else{ | ||
| 3645 | this._current_item[this._current_element].tags.push(tag); | ||
| 3646 | } | ||
| 3647 | } | ||
| 3648 | return true; | ||
| 3649 | }; | ||
| 3650 | |||
| 3651 | WYMeditor.WymCssParser.prototype.addStyleSetting = function(style_details) | ||
| 3652 | { | ||
| 3653 | for (var name in style_details){ | ||
| 3654 | var details = style_details[name]; | ||
| 3655 | if(typeof details == 'object' && name != 'title'){ | ||
| 3656 | |||
| 3657 | this.css_settings.classesItems.push({ | ||
| 3658 | 'name': WYMeditor.Helper.trim(details.name), | ||
| 3659 | 'title': style_details.title, | ||
| 3660 | 'expr' : WYMeditor.Helper.trim((details.expressions||details.tags).join(', ')) | ||
| 3661 | }); | ||
| 3662 | if(details.feedback_style){ | ||
| 3663 | this.css_settings.editorStyles.push({ | ||
| 3664 | 'name': '.'+ WYMeditor.Helper.trim(details.name), | ||
| 3665 | 'css': details.feedback_style | ||
| 3666 | }); | ||
| 3667 | } | ||
| 3668 | if(details.style){ | ||
| 3669 | this.css_settings.dialogStyles.push({ | ||
| 3670 | 'name': '.'+ WYMeditor.Helper.trim(details.name), | ||
| 3671 | 'css': details.style | ||
| 3672 | }); | ||
| 3673 | } | ||
| 3674 | } | ||
| 3675 | } | ||
| 3676 | }; | ||
| 3677 | |||
| 3678 | /********** HELPERS **********/ | ||
| 3679 | |||
| 3680 | // Returns true if it is a text node with whitespaces only | ||
| 3681 | jQuery.fn.isPhantomNode = function() { | ||
| 3682 | if (this[0].nodeType == 3) | ||
| 3683 | return !(/[^\t\n\r ]/.test(this[0].data)); | ||
| 3684 | |||
| 3685 | return false; | ||
| 3686 | }; | ||
| 3687 | |||
| 3688 | WYMeditor.isPhantomNode = function(n) { | ||
| 3689 | if (n.nodeType == 3) | ||
| 3690 | return !(/[^\t\n\r ]/.test(n.data)); | ||
| 3691 | |||
| 3692 | return false; | ||
| 3693 | }; | ||
| 3694 | |||
| 3695 | WYMeditor.isPhantomString = function(str) { | ||
| 3696 | return !(/[^\t\n\r ]/.test(str)); | ||
| 3697 | }; | ||
| 3698 | |||
| 3699 | // Returns the Parents or the node itself | ||
| 3700 | // jqexpr = a jQuery expression | ||
| 3701 | jQuery.fn.parentsOrSelf = function(jqexpr) { | ||
| 3702 | var n = this; | ||
| 3703 | |||
| 3704 | if (n[0].nodeType == 3) | ||
| 3705 | n = n.parents().slice(0,1); | ||
| 3706 | |||
| 3707 | // if (n.is(jqexpr)) // XXX should work, but doesn't (probably a jQuery bug) | ||
| 3708 | if (n.filter(jqexpr).size() == 1) | ||
| 3709 | return n; | ||
| 3710 | else | ||
| 3711 | return n.parents(jqexpr).slice(0,1); | ||
| 3712 | }; | ||
| 3713 | |||
| 3714 | // String & array helpers | ||
| 3715 | |||
| 3716 | WYMeditor.Helper = { | ||
| 3717 | |||
| 3718 | //replace all instances of 'old' by 'rep' in 'str' string | ||
| 3719 | replaceAll: function(str, old, rep) { | ||
| 3720 | var rExp = new RegExp(old, "g"); | ||
| 3721 | return(str.replace(rExp, rep)); | ||
| 3722 | }, | ||
| 3723 | |||
| 3724 | //insert 'inserted' at position 'pos' in 'str' string | ||
| 3725 | insertAt: function(str, inserted, pos) { | ||
| 3726 | return(str.substr(0,pos) + inserted + str.substring(pos)); | ||
| 3727 | }, | ||
| 3728 | |||
| 3729 | //trim 'str' string | ||
| 3730 | trim: function(str) { | ||
| 3731 | return str.replace(/^(\s*)|(\s*)$/gm,''); | ||
| 3732 | }, | ||
| 3733 | |||
| 3734 | //return true if 'arr' array contains 'elem', or false | ||
| 3735 | contains: function(arr, elem) { | ||
| 3736 | for (var i = 0; i < arr.length; i++) { | ||
| 3737 | if (arr[i] === elem) return true; | ||
| 3738 | } | ||
| 3739 | return false; | ||
| 3740 | }, | ||
| 3741 | |||
| 3742 | //return 'item' position in 'arr' array, or -1 | ||
| 3743 | indexOf: function(arr, item) { | ||
| 3744 | var ret=-1; | ||
| 3745 | for(var i = 0; i < arr.length; i++) { | ||
| 3746 | if (arr[i] == item) { | ||
| 3747 | ret = i; | ||
| 3748 | break; | ||
| 3749 | } | ||
| 3750 | } | ||
| 3751 | return(ret); | ||
| 3752 | }, | ||
| 3753 | |||
| 3754 | //return 'item' object in 'arr' array, checking its 'name' property, or null | ||
| 3755 | findByName: function(arr, name) { | ||
| 3756 | for(var i = 0; i < arr.length; i++) { | ||
| 3757 | var item = arr[i]; | ||
| 3758 | if(item.name == name) return(item); | ||
| 3759 | } | ||
| 3760 | return(null); | ||
| 3761 | } | ||
| 3762 | }; | ||
| 3763 | |||
| 3764 | |||
| 3765 | /* | ||
| 3766 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3767 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 3768 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 3769 | * and GPL (GPL-license.txt) licenses. | ||
| 3770 | * | ||
| 3771 | * For further information visit: | ||
| 3772 | * http://www.wymeditor.org/ | ||
| 3773 | * | ||
| 3774 | * File Name: | ||
| 3775 | * jquery.wymeditor.explorer.js | ||
| 3776 | * MSIE specific class and functions. | ||
| 3777 | * See the documentation for more info. | ||
| 3778 | * | ||
| 3779 | * File Authors: | ||
| 3780 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 3781 | * Bermi Ferrer (wymeditor a-t bermi dotorg) | ||
| 3782 | * Frédéric Palluel-Lafleur (fpalluel a-t gmail dotcom) | ||
| 3783 | * Jonatan Lundin (jonatan.lundin _at_ gmail.com) | ||
| 3784 | */ | ||
| 3785 | |||
| 3786 | WYMeditor.WymClassExplorer = function(wym) { | ||
| 3787 | |||
| 3788 | this._wym = wym; | ||
| 3789 | this._class = "className"; | ||
| 3790 | this._newLine = "\r\n"; | ||
| 3791 | }; | ||
| 3792 | |||
| 3793 | WYMeditor.WymClassExplorer.prototype.initIframe = function(iframe) { | ||
| 3794 | |||
| 3795 | //This function is executed twice, though it is called once! | ||
| 3796 | //But MSIE needs that, otherwise designMode won't work. | ||
| 3797 | //Weird. | ||
| 3798 | |||
| 3799 | this._iframe = iframe; | ||
| 3800 | this._doc = iframe.contentWindow.document; | ||
| 3801 | |||
| 3802 | //add css rules from options | ||
| 3803 | var styles = this._doc.styleSheets[0]; | ||
| 3804 | var aCss = eval(this._options.editorStyles); | ||
| 3805 | |||
| 3806 | this.addCssRules(this._doc, aCss); | ||
| 3807 | |||
| 3808 | this._doc.title = this._wym._index; | ||
| 3809 | |||
| 3810 | //set the text direction | ||
| 3811 | jQuery('html', this._doc).attr('dir', this._options.direction); | ||
| 3812 | |||
| 3813 | //init html value | ||
| 3814 | jQuery(this._doc.body).html(this._wym._html); | ||
| 3815 | |||
| 3816 | //handle events | ||
| 3817 | var wym = this; | ||
| 3818 | |||
| 3819 | this._doc.body.onfocus = function() | ||
| 3820 | {wym._doc.designMode = "on"; wym._doc = iframe.contentWindow.document;}; | ||
| 3821 | this._doc.onbeforedeactivate = function() {wym.saveCaret();}; | ||
| 3822 | this._doc.onkeyup = function() { | ||
| 3823 | wym.saveCaret(); | ||
| 3824 | wym.keyup(); | ||
| 3825 | }; | ||
| 3826 | this._doc.onclick = function() {wym.saveCaret();}; | ||
| 3827 | |||
| 3828 | this._doc.body.onbeforepaste = function() { | ||
| 3829 | wym._iframe.contentWindow.event.returnValue = false; | ||
| 3830 | }; | ||
| 3831 | |||
| 3832 | this._doc.body.onpaste = function() { | ||
| 3833 | wym._iframe.contentWindow.event.returnValue = false; | ||
| 3834 | wym.paste(window.clipboardData.getData("Text")); | ||
| 3835 | }; | ||
| 3836 | |||
| 3837 | //callback can't be executed twice, so we check | ||
| 3838 | if(this._initialized) { | ||
| 3839 | |||
| 3840 | //pre-bind functions | ||
| 3841 | if(jQuery.isFunction(this._options.preBind)) this._options.preBind(this); | ||
| 3842 | |||
| 3843 | //bind external events | ||
| 3844 | this._wym.bindEvents(); | ||
| 3845 | |||
| 3846 | //post-init functions | ||
| 3847 | if(jQuery.isFunction(this._options.postInit)) this._options.postInit(this); | ||
| 3848 | |||
| 3849 | //add event listeners to doc elements, e.g. images | ||
| 3850 | this.listen(); | ||
| 3851 | } | ||
| 3852 | |||
| 3853 | this._initialized = true; | ||
| 3854 | |||
| 3855 | //init designMode | ||
| 3856 | this._doc.designMode="on"; | ||
| 3857 | try{ | ||
| 3858 | // (bermi's note) noticed when running unit tests on IE6 | ||
| 3859 | // Is this really needed, it trigger an unexisting property on IE6 | ||
| 3860 | this._doc = iframe.contentWindow.document; | ||
| 3861 | }catch(e){} | ||
| 3862 | }; | ||
| 3863 | |||
| 3864 | WYMeditor.WymClassExplorer.prototype._exec = function(cmd,param) { | ||
| 3865 | |||
| 3866 | switch(cmd) { | ||
| 3867 | |||
| 3868 | case WYMeditor.INDENT: case WYMeditor.OUTDENT: | ||
| 3869 | |||
| 3870 | var container = this.findUp(this.container(), WYMeditor.LI); | ||
| 3871 | if(container) | ||
| 3872 | this._doc.execCommand(cmd); | ||
| 3873 | break; | ||
| 3874 | default: | ||
| 3875 | if(param) this._doc.execCommand(cmd,false,param); | ||
| 3876 | else this._doc.execCommand(cmd); | ||
| 3877 | break; | ||
| 3878 | } | ||
| 3879 | |||
| 3880 | this.listen(); | ||
| 3881 | }; | ||
| 3882 | |||
| 3883 | WYMeditor.WymClassExplorer.prototype.selected = function() { | ||
| 3884 | |||
| 3885 | var caretPos = this._iframe.contentWindow.document.caretPos; | ||
| 3886 | if(caretPos!=null) { | ||
| 3887 | if(caretPos.parentElement!=undefined) | ||
| 3888 | return(caretPos.parentElement()); | ||
| 3889 | } | ||
| 3890 | }; | ||
| 3891 | |||
| 3892 | WYMeditor.WymClassExplorer.prototype.saveCaret = function() { | ||
| 3893 | |||
| 3894 | this._doc.caretPos = this._doc.selection.createRange(); | ||
| 3895 | }; | ||
| 3896 | |||
| 3897 | WYMeditor.WymClassExplorer.prototype.addCssRule = function(styles, oCss) { | ||
| 3898 | |||
| 3899 | styles.addRule(oCss.name, oCss.css); | ||
| 3900 | }; | ||
| 3901 | |||
| 3902 | WYMeditor.WymClassExplorer.prototype.insert = function(html) { | ||
| 3903 | |||
| 3904 | // Get the current selection | ||
| 3905 | var range = this._doc.selection.createRange(); | ||
| 3906 | |||
| 3907 | // Check if the current selection is inside the editor | ||
| 3908 | if ( jQuery(range.parentElement()).parents( this._options.iframeBodySelector ).is('*') ) { | ||
| 3909 | try { | ||
| 3910 | // Overwrite selection with provided html | ||
| 3911 | range.pasteHTML(html); | ||
| 3912 | } catch (e) { } | ||
| 3913 | } else { | ||
| 3914 | // Fall back to the internal paste function if there's no selection | ||
| 3915 | this.paste(html); | ||
| 3916 | } | ||
| 3917 | }; | ||
| 3918 | |||
| 3919 | //keyup handler | ||
| 3920 | WYMeditor.WymClassExplorer.prototype.keyup = function() { | ||
| 3921 | this._selected_image = null; | ||
| 3922 | }; | ||
| 3923 | |||
| 3924 | WYMeditor.WymClassExplorer.prototype.setFocusToNode = function(node) { | ||
| 3925 | var range = this._doc.selection.createRange(); | ||
| 3926 | range.moveToElementText(node); | ||
| 3927 | range.collapse(false); | ||
| 3928 | range.move('character',-1); | ||
| 3929 | range.select(); | ||
| 3930 | node.focus(); | ||
| 3931 | }; | ||
| 3932 | |||
| 3933 | /* | ||
| 3934 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3935 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 3936 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 3937 | * and GPL (GPL-license.txt) licenses. | ||
| 3938 | * | ||
| 3939 | * For further information visit: | ||
| 3940 | * http://www.wymeditor.org/ | ||
| 3941 | * | ||
| 3942 | * File Name: | ||
| 3943 | * jquery.wymeditor.mozilla.js | ||
| 3944 | * Gecko specific class and functions. | ||
| 3945 | * See the documentation for more info. | ||
| 3946 | * | ||
| 3947 | * File Authors: | ||
| 3948 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 3949 | * Volker Mische (vmx a-t gmx dotde) | ||
| 3950 | * Bermi Ferrer (wymeditor a-t bermi dotorg) | ||
| 3951 | * Frédéric Palluel-Lafleur (fpalluel a-t gmail dotcom) | ||
| 3952 | */ | ||
| 3953 | |||
| 3954 | WYMeditor.WymClassMozilla = function(wym) { | ||
| 3955 | |||
| 3956 | this._wym = wym; | ||
| 3957 | this._class = "class"; | ||
| 3958 | this._newLine = "\n"; | ||
| 3959 | }; | ||
| 3960 | |||
| 3961 | WYMeditor.WymClassMozilla.prototype.initIframe = function(iframe) { | ||
| 3962 | |||
| 3963 | this._iframe = iframe; | ||
| 3964 | this._doc = iframe.contentDocument; | ||
| 3965 | |||
| 3966 | //add css rules from options | ||
| 3967 | |||
| 3968 | var styles = this._doc.styleSheets[0]; | ||
| 3969 | var aCss = eval(this._options.editorStyles); | ||
| 3970 | |||
| 3971 | this.addCssRules(this._doc, aCss); | ||
| 3972 | |||
| 3973 | this._doc.title = this._wym._index; | ||
| 3974 | |||
| 3975 | //set the text direction | ||
| 3976 | jQuery('html', this._doc).attr('dir', this._options.direction); | ||
| 3977 | |||
| 3978 | //init html value | ||
| 3979 | this.html(this._wym._html); | ||
| 3980 | |||
| 3981 | //init designMode | ||
| 3982 | this.enableDesignMode(); | ||
| 3983 | |||
| 3984 | //pre-bind functions | ||
| 3985 | if(jQuery.isFunction(this._options.preBind)) this._options.preBind(this); | ||
| 3986 | |||
| 3987 | //bind external events | ||
| 3988 | this._wym.bindEvents(); | ||
| 3989 | |||
| 3990 | //bind editor keydown events | ||
| 3991 | jQuery(this._doc).bind("keydown", this.keydown); | ||
| 3992 | |||
| 3993 | //bind editor keyup events | ||
| 3994 | jQuery(this._doc).bind("keyup", this.keyup); | ||
| 3995 | |||
| 3996 | //bind editor focus events (used to reset designmode - Gecko bug) | ||
| 3997 | jQuery(this._doc).bind("focus", this.enableDesignMode); | ||
| 3998 | |||
| 3999 | //post-init functions | ||
| 4000 | if(jQuery.isFunction(this._options.postInit)) this._options.postInit(this); | ||
| 4001 | |||
| 4002 | //add event listeners to doc elements, e.g. images | ||
| 4003 | this.listen(); | ||
| 4004 | }; | ||
| 4005 | |||
| 4006 | /* @name html | ||
| 4007 | * @description Get/Set the html value | ||
| 4008 | */ | ||
| 4009 | WYMeditor.WymClassMozilla.prototype.html = function(html) { | ||
| 4010 | |||
| 4011 | if(typeof html === 'string') { | ||
| 4012 | |||
| 4013 | //disable designMode | ||
| 4014 | try { this._doc.designMode = "off"; } catch(e) { }; | ||
| 4015 | |||
| 4016 | //replace em by i and strong by bold | ||
| 4017 | //(designMode issue) | ||
| 4018 | html = html.replace(/<em([^>]*)>/gi, "<i$1>") | ||
| 4019 | .replace(/<\/em>/gi, "</i>") | ||
| 4020 | .replace(/<strong([^>]*)>/gi, "<b$1>") | ||
| 4021 | .replace(/<\/strong>/gi, "</b>"); | ||
| 4022 | |||
| 4023 | //update the html body | ||
| 4024 | jQuery(this._doc.body).html(html); | ||
| 4025 | |||
| 4026 | //re-init designMode | ||
| 4027 | this.enableDesignMode(); | ||
| 4028 | } | ||
| 4029 | else return(jQuery(this._doc.body).html()); | ||
| 4030 | }; | ||
| 4031 | |||
| 4032 | WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) { | ||
| 4033 | |||
| 4034 | if(!this.selected()) return(false); | ||
| 4035 | |||
| 4036 | switch(cmd) { | ||
| 4037 | |||
| 4038 | case WYMeditor.INDENT: case WYMeditor.OUTDENT: | ||
| 4039 | |||
| 4040 | var focusNode = this.selected(); | ||
| 4041 | var sel = this._iframe.contentWindow.getSelection(); | ||
| 4042 | var anchorNode = sel.anchorNode; | ||
| 4043 | if(anchorNode.nodeName == "#text") anchorNode = anchorNode.parentNode; | ||
| 4044 | |||
| 4045 | focusNode = this.findUp(focusNode, WYMeditor.BLOCKS); | ||
| 4046 | anchorNode = this.findUp(anchorNode, WYMeditor.BLOCKS); | ||
| 4047 | |||
| 4048 | if(focusNode && focusNode == anchorNode | ||
| 4049 | && focusNode.tagName.toLowerCase() == WYMeditor.LI) { | ||
| 4050 | |||
| 4051 | var ancestor = focusNode.parentNode.parentNode; | ||
| 4052 | |||
| 4053 | if(focusNode.parentNode.childNodes.length>1 | ||
| 4054 | || ancestor.tagName.toLowerCase() == WYMeditor.OL | ||
| 4055 | || ancestor.tagName.toLowerCase() == WYMeditor.UL) | ||
| 4056 | this._doc.execCommand(cmd,'',null); | ||
| 4057 | } | ||
| 4058 | |||
| 4059 | break; | ||
| 4060 | |||
| 4061 | default: | ||
| 4062 | |||
| 4063 | if(param) this._doc.execCommand(cmd,'',param); | ||
| 4064 | else this._doc.execCommand(cmd,'',null); | ||
| 4065 | } | ||
| 4066 | |||
| 4067 | //set to P if parent = BODY | ||
| 4068 | var container = this.selected(); | ||
| 4069 | if(container.tagName.toLowerCase() == WYMeditor.BODY) | ||
| 4070 | this._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); | ||
| 4071 | |||
| 4072 | //add event handlers on doc elements | ||
| 4073 | |||
| 4074 | this.listen(); | ||
| 4075 | }; | ||
| 4076 | |||
| 4077 | /* @name selected | ||
| 4078 | * @description Returns the selected container | ||
| 4079 | */ | ||
| 4080 | WYMeditor.WymClassMozilla.prototype.selected = function() { | ||
| 4081 | |||
| 4082 | var sel = this._iframe.contentWindow.getSelection(); | ||
| 4083 | var node = sel.focusNode; | ||
| 4084 | if(node) { | ||
| 4085 | if(node.nodeName == "#text") return(node.parentNode); | ||
| 4086 | else return(node); | ||
| 4087 | } else return(null); | ||
| 4088 | }; | ||
| 4089 | |||
| 4090 | WYMeditor.WymClassMozilla.prototype.addCssRule = function(styles, oCss) { | ||
| 4091 | |||
| 4092 | styles.insertRule(oCss.name + " {" + oCss.css + "}", | ||
| 4093 | styles.cssRules.length); | ||
| 4094 | }; | ||
| 4095 | |||
| 4096 | |||
| 4097 | //keydown handler, mainly used for keyboard shortcuts | ||
| 4098 | WYMeditor.WymClassMozilla.prototype.keydown = function(evt) { | ||
| 4099 | |||
| 4100 | //'this' is the doc | ||
| 4101 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4102 | |||
| 4103 | if(evt.ctrlKey){ | ||
| 4104 | if(evt.keyCode == 66){ | ||
| 4105 | //CTRL+b => STRONG | ||
| 4106 | wym._exec(WYMeditor.BOLD); | ||
| 4107 | return false; | ||
| 4108 | } | ||
| 4109 | if(evt.keyCode == 73){ | ||
| 4110 | //CTRL+i => EMPHASIS | ||
| 4111 | wym._exec(WYMeditor.ITALIC); | ||
| 4112 | return false; | ||
| 4113 | } | ||
| 4114 | } | ||
| 4115 | }; | ||
| 4116 | |||
| 4117 | //keyup handler, mainly used for cleanups | ||
| 4118 | WYMeditor.WymClassMozilla.prototype.keyup = function(evt) { | ||
| 4119 | |||
| 4120 | //'this' is the doc | ||
| 4121 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4122 | |||
| 4123 | wym._selected_image = null; | ||
| 4124 | var container = null; | ||
| 4125 | |||
| 4126 | if(evt.keyCode == 13 && !evt.shiftKey) { | ||
| 4127 | |||
| 4128 | //RETURN key | ||
| 4129 | //cleanup <br><br> between paragraphs | ||
| 4130 | jQuery(wym._doc.body).children(WYMeditor.BR).remove(); | ||
| 4131 | |||
| 4132 | //fix PRE bug #73 | ||
| 4133 | container = wym.selected(); | ||
| 4134 | if(container && container.tagName.toLowerCase() == WYMeditor.PRE) | ||
| 4135 | wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //create P after PRE | ||
| 4136 | } | ||
| 4137 | |||
| 4138 | else if(evt.keyCode != 8 | ||
| 4139 | && evt.keyCode != 17 | ||
| 4140 | && evt.keyCode != 46 | ||
| 4141 | && evt.keyCode != 224 | ||
| 4142 | && !evt.metaKey | ||
| 4143 | && !evt.ctrlKey) { | ||
| 4144 | |||
| 4145 | //NOT BACKSPACE, NOT DELETE, NOT CTRL, NOT COMMAND | ||
| 4146 | //text nodes replaced by P | ||
| 4147 | |||
| 4148 | container = wym.selected(); | ||
| 4149 | var name = container.tagName.toLowerCase(); | ||
| 4150 | |||
| 4151 | //fix forbidden main containers | ||
| 4152 | if( | ||
| 4153 | name == "strong" || | ||
| 4154 | name == "b" || | ||
| 4155 | name == "em" || | ||
| 4156 | name == "i" || | ||
| 4157 | name == "sub" || | ||
| 4158 | name == "sup" || | ||
| 4159 | name == "a" | ||
| 4160 | |||
| 4161 | ) name = container.parentNode.tagName.toLowerCase(); | ||
| 4162 | |||
| 4163 | if(name == WYMeditor.BODY) wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); | ||
| 4164 | } | ||
| 4165 | }; | ||
| 4166 | |||
| 4167 | WYMeditor.WymClassMozilla.prototype.enableDesignMode = function() { | ||
| 4168 | if(this.designMode == "off") { | ||
| 4169 | try { | ||
| 4170 | this.designMode = "on"; | ||
| 4171 | this.execCommand("styleWithCSS", '', false); | ||
| 4172 | } catch(e) { } | ||
| 4173 | } | ||
| 4174 | }; | ||
| 4175 | |||
| 4176 | WYMeditor.WymClassMozilla.prototype.setFocusToNode = function(node) { | ||
| 4177 | var range = document.createRange(); | ||
| 4178 | range.selectNode(node); | ||
| 4179 | var selected = this._iframe.contentWindow.getSelection(); | ||
| 4180 | selected.addRange(range); | ||
| 4181 | selected.collapse(node, node.childNodes.length); | ||
| 4182 | this._iframe.contentWindow.focus(); | ||
| 4183 | }; | ||
| 4184 | |||
| 4185 | WYMeditor.WymClassMozilla.prototype.openBlockTag = function(tag, attributes) | ||
| 4186 | { | ||
| 4187 | var attributes = this.validator.getValidTagAttributes(tag, attributes); | ||
| 4188 | |||
| 4189 | // Handle Mozilla styled spans | ||
| 4190 | if(tag == 'span' && attributes.style){ | ||
| 4191 | var new_tag = this.getTagForStyle(attributes.style); | ||
| 4192 | if(new_tag){ | ||
| 4193 | this._tag_stack.pop(); | ||
| 4194 | var tag = new_tag; | ||
| 4195 | this._tag_stack.push(new_tag); | ||
| 4196 | attributes.style = ''; | ||
| 4197 | }else{ | ||
| 4198 | return; | ||
| 4199 | } | ||
| 4200 | } | ||
| 4201 | |||
| 4202 | this.output += this.helper.tag(tag, attributes, true); | ||
| 4203 | }; | ||
| 4204 | |||
| 4205 | WYMeditor.WymClassMozilla.prototype.getTagForStyle = function(style) { | ||
| 4206 | |||
| 4207 | if(/bold/.test(style)) return 'strong'; | ||
| 4208 | if(/italic/.test(style)) return 'em'; | ||
| 4209 | if(/sub/.test(style)) return 'sub'; | ||
| 4210 | if(/sub/.test(style)) return 'super'; | ||
| 4211 | return false; | ||
| 4212 | }; | ||
| 4213 | |||
| 4214 | /* | ||
| 4215 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 4216 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4217 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 4218 | * and GPL (GPL-license.txt) licenses. | ||
| 4219 | * | ||
| 4220 | * For further information visit: | ||
| 4221 | * http://www.wymeditor.org/ | ||
| 4222 | * | ||
| 4223 | * File Name: | ||
| 4224 | * jquery.wymeditor.opera.js | ||
| 4225 | * Opera specific class and functions. | ||
| 4226 | * See the documentation for more info. | ||
| 4227 | * | ||
| 4228 | * File Authors: | ||
| 4229 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 4230 | */ | ||
| 4231 | |||
| 4232 | WYMeditor.WymClassOpera = function(wym) { | ||
| 4233 | |||
| 4234 | this._wym = wym; | ||
| 4235 | this._class = "class"; | ||
| 4236 | this._newLine = "\r\n"; | ||
| 4237 | }; | ||
| 4238 | |||
| 4239 | WYMeditor.WymClassOpera.prototype.initIframe = function(iframe) { | ||
| 4240 | |||
| 4241 | this._iframe = iframe; | ||
| 4242 | this._doc = iframe.contentWindow.document; | ||
| 4243 | |||
| 4244 | //add css rules from options | ||
| 4245 | var styles = this._doc.styleSheets[0]; | ||
| 4246 | var aCss = eval(this._options.editorStyles); | ||
| 4247 | |||
| 4248 | this.addCssRules(this._doc, aCss); | ||
| 4249 | |||
| 4250 | this._doc.title = this._wym._index; | ||
| 4251 | |||
| 4252 | //set the text direction | ||
| 4253 | jQuery('html', this._doc).attr('dir', this._options.direction); | ||
| 4254 | |||
| 4255 | //init designMode | ||
| 4256 | this._doc.designMode = "on"; | ||
| 4257 | |||
| 4258 | //init html value | ||
| 4259 | this.html(this._wym._html); | ||
| 4260 | |||
| 4261 | //pre-bind functions | ||
| 4262 | if(jQuery.isFunction(this._options.preBind)) this._options.preBind(this); | ||
| 4263 | |||
| 4264 | //bind external events | ||
| 4265 | this._wym.bindEvents(); | ||
| 4266 | |||
| 4267 | //bind editor keydown events | ||
| 4268 | jQuery(this._doc).bind("keydown", this.keydown); | ||
| 4269 | |||
| 4270 | //bind editor events | ||
| 4271 | jQuery(this._doc).bind("keyup", this.keyup); | ||
| 4272 | |||
| 4273 | //post-init functions | ||
| 4274 | if(jQuery.isFunction(this._options.postInit)) this._options.postInit(this); | ||
| 4275 | |||
| 4276 | //add event listeners to doc elements, e.g. images | ||
| 4277 | this.listen(); | ||
| 4278 | }; | ||
| 4279 | |||
| 4280 | WYMeditor.WymClassOpera.prototype._exec = function(cmd,param) { | ||
| 4281 | |||
| 4282 | if(param) this._doc.execCommand(cmd,false,param); | ||
| 4283 | else this._doc.execCommand(cmd); | ||
| 4284 | |||
| 4285 | this.listen(); | ||
| 4286 | }; | ||
| 4287 | |||
| 4288 | WYMeditor.WymClassOpera.prototype.selected = function() { | ||
| 4289 | |||
| 4290 | var sel=this._iframe.contentWindow.getSelection(); | ||
| 4291 | var node=sel.focusNode; | ||
| 4292 | if(node) { | ||
| 4293 | if(node.nodeName=="#text")return(node.parentNode); | ||
| 4294 | else return(node); | ||
| 4295 | } else return(null); | ||
| 4296 | }; | ||
| 4297 | |||
| 4298 | WYMeditor.WymClassOpera.prototype.addCssRule = function(styles, oCss) { | ||
| 4299 | |||
| 4300 | styles.insertRule(oCss.name + " {" + oCss.css + "}", | ||
| 4301 | styles.cssRules.length); | ||
| 4302 | }; | ||
| 4303 | |||
| 4304 | //keydown handler | ||
| 4305 | WYMeditor.WymClassOpera.prototype.keydown = function(evt) { | ||
| 4306 | |||
| 4307 | //'this' is the doc | ||
| 4308 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4309 | var sel = wym._iframe.contentWindow.getSelection(); | ||
| 4310 | startNode = sel.getRangeAt(0).startContainer; | ||
| 4311 | |||
| 4312 | //Get a P instead of no container | ||
| 4313 | if(!jQuery(startNode).parentsOrSelf( | ||
| 4314 | WYMeditor.MAIN_CONTAINERS.join(","))[0] | ||
| 4315 | && !jQuery(startNode).parentsOrSelf('li') | ||
| 4316 | && evt.keyCode != WYMeditor.KEY.ENTER | ||
| 4317 | && evt.keyCode != WYMeditor.KEY.LEFT | ||
| 4318 | && evt.keyCode != WYMeditor.KEY.UP | ||
| 4319 | && evt.keyCode != WYMeditor.KEY.RIGHT | ||
| 4320 | && evt.keyCode != WYMeditor.KEY.DOWN | ||
| 4321 | && evt.keyCode != WYMeditor.KEY.BACKSPACE | ||
| 4322 | && evt.keyCode != WYMeditor.KEY.DELETE) | ||
| 4323 | wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); | ||
| 4324 | |||
| 4325 | }; | ||
| 4326 | |||
| 4327 | //keyup handler | ||
| 4328 | WYMeditor.WymClassOpera.prototype.keyup = function(evt) { | ||
| 4329 | |||
| 4330 | //'this' is the doc | ||
| 4331 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4332 | wym._selected_image = null; | ||
| 4333 | }; | ||
| 4334 | |||
| 4335 | // TODO: implement me | ||
| 4336 | WYMeditor.WymClassOpera.prototype.setFocusToNode = function(node) { | ||
| 4337 | |||
| 4338 | }; | ||
| 4339 | |||
| 4340 | /* | ||
| 4341 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 4342 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4343 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 4344 | * and GPL (GPL-license.txt) licenses. | ||
| 4345 | * | ||
| 4346 | * For further information visit: | ||
| 4347 | * http://www.wymeditor.org/ | ||
| 4348 | * | ||
| 4349 | * File Name: | ||
| 4350 | * jquery.wymeditor.safari.js | ||
| 4351 | * Safari specific class and functions. | ||
| 4352 | * See the documentation for more info. | ||
| 4353 | * | ||
| 4354 | * File Authors: | ||
| 4355 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 4356 | * Scott Lewis (lewiscot a-t gmail dotcom) | ||
| 4357 | */ | ||
| 4358 | |||
| 4359 | WYMeditor.WymClassSafari = function(wym) { | ||
| 4360 | |||
| 4361 | this._wym = wym; | ||
| 4362 | this._class = "class"; | ||
| 4363 | this._newLine = "\n"; | ||
| 4364 | }; | ||
| 4365 | |||
| 4366 | WYMeditor.WymClassSafari.prototype.initIframe = function(iframe) { | ||
| 4367 | |||
| 4368 | this._iframe = iframe; | ||
| 4369 | this._doc = iframe.contentDocument; | ||
| 4370 | |||
| 4371 | //add css rules from options | ||
| 4372 | |||
| 4373 | var styles = this._doc.styleSheets[0]; | ||
| 4374 | var aCss = eval(this._options.editorStyles); | ||
| 4375 | |||
| 4376 | this.addCssRules(this._doc, aCss); | ||
| 4377 | |||
| 4378 | this._doc.title = this._wym._index; | ||
| 4379 | |||
| 4380 | //set the text direction | ||
| 4381 | jQuery('html', this._doc).attr('dir', this._options.direction); | ||
| 4382 | |||
| 4383 | //init designMode | ||
| 4384 | this._doc.designMode = "on"; | ||
| 4385 | |||
| 4386 | //init html value | ||
| 4387 | this.html(this._wym._html); | ||
| 4388 | |||
| 4389 | //pre-bind functions | ||
| 4390 | if(jQuery.isFunction(this._options.preBind)) this._options.preBind(this); | ||
| 4391 | |||
| 4392 | //bind external events | ||
| 4393 | this._wym.bindEvents(); | ||
| 4394 | |||
| 4395 | //bind editor keydown events | ||
| 4396 | jQuery(this._doc).bind("keydown", this.keydown); | ||
| 4397 | |||
| 4398 | //bind editor keyup events | ||
| 4399 | jQuery(this._doc).bind("keyup", this.keyup); | ||
| 4400 | |||
| 4401 | //post-init functions | ||
| 4402 | if(jQuery.isFunction(this._options.postInit)) this._options.postInit(this); | ||
| 4403 | |||
| 4404 | //add event listeners to doc elements, e.g. images | ||
| 4405 | this.listen(); | ||
| 4406 | }; | ||
| 4407 | |||
| 4408 | WYMeditor.WymClassSafari.prototype._exec = function(cmd,param) { | ||
| 4409 | |||
| 4410 | if(!this.selected()) return(false); | ||
| 4411 | |||
| 4412 | switch(cmd) { | ||
| 4413 | |||
| 4414 | case WYMeditor.INDENT: case WYMeditor.OUTDENT: | ||
| 4415 | |||
| 4416 | var focusNode = this.selected(); | ||
| 4417 | var sel = this._iframe.contentWindow.getSelection(); | ||
| 4418 | var anchorNode = sel.anchorNode; | ||
| 4419 | if(anchorNode.nodeName == "#text") anchorNode = anchorNode.parentNode; | ||
| 4420 | |||
| 4421 | focusNode = this.findUp(focusNode, WYMeditor.BLOCKS); | ||
| 4422 | anchorNode = this.findUp(anchorNode, WYMeditor.BLOCKS); | ||
| 4423 | |||
| 4424 | if(focusNode && focusNode == anchorNode | ||
| 4425 | && focusNode.tagName.toLowerCase() == WYMeditor.LI) { | ||
| 4426 | |||
| 4427 | var ancestor = focusNode.parentNode.parentNode; | ||
| 4428 | |||
| 4429 | if(focusNode.parentNode.childNodes.length>1 | ||
| 4430 | || ancestor.tagName.toLowerCase() == WYMeditor.OL | ||
| 4431 | || ancestor.tagName.toLowerCase() == WYMeditor.UL) | ||
| 4432 | this._doc.execCommand(cmd,'',null); | ||
| 4433 | } | ||
| 4434 | |||
| 4435 | break; | ||
| 4436 | |||
| 4437 | case WYMeditor.INSERT_ORDEREDLIST: case WYMeditor.INSERT_UNORDEREDLIST: | ||
| 4438 | |||
| 4439 | this._doc.execCommand(cmd,'',null); | ||
| 4440 | |||
| 4441 | //Safari creates lists in e.g. paragraphs. | ||
| 4442 | //Find the container, and remove it. | ||
| 4443 | var focusNode = this.selected(); | ||
| 4444 | var container = this.findUp(focusNode, WYMeditor.MAIN_CONTAINERS); | ||
| 4445 | if(container) jQuery(container).replaceWith(jQuery(container).html()); | ||
| 4446 | |||
| 4447 | break; | ||
| 4448 | |||
| 4449 | default: | ||
| 4450 | |||
| 4451 | if(param) this._doc.execCommand(cmd,'',param); | ||
| 4452 | else this._doc.execCommand(cmd,'',null); | ||
| 4453 | } | ||
| 4454 | |||
| 4455 | //set to P if parent = BODY | ||
| 4456 | var container = this.selected(); | ||
| 4457 | if(container && container.tagName.toLowerCase() == WYMeditor.BODY) | ||
| 4458 | this._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); | ||
| 4459 | |||
| 4460 | //add event handlers on doc elements | ||
| 4461 | this.listen(); | ||
| 4462 | }; | ||
| 4463 | |||
| 4464 | /* @name selected | ||
| 4465 | * @description Returns the selected container | ||
| 4466 | */ | ||
| 4467 | WYMeditor.WymClassSafari.prototype.selected = function() { | ||
| 4468 | |||
| 4469 | var sel = this._iframe.contentWindow.getSelection(); | ||
| 4470 | var node = sel.focusNode; | ||
| 4471 | if(node) { | ||
| 4472 | if(node.nodeName == "#text") return(node.parentNode); | ||
| 4473 | else return(node); | ||
| 4474 | } else return(null); | ||
| 4475 | }; | ||
| 4476 | |||
| 4477 | WYMeditor.WymClassSafari.prototype.addCssRule = function(styles, oCss) { | ||
| 4478 | |||
| 4479 | styles.insertRule(oCss.name + " {" + oCss.css + "}", | ||
| 4480 | styles.cssRules.length); | ||
| 4481 | }; | ||
| 4482 | |||
| 4483 | |||
| 4484 | //keydown handler, mainly used for keyboard shortcuts | ||
| 4485 | WYMeditor.WymClassSafari.prototype.keydown = function(evt) { | ||
| 4486 | |||
| 4487 | //'this' is the doc | ||
| 4488 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4489 | |||
| 4490 | if(evt.ctrlKey){ | ||
| 4491 | if(evt.keyCode == 66){ | ||
| 4492 | //CTRL+b => STRONG | ||
| 4493 | wym._exec(WYMeditor.BOLD); | ||
| 4494 | return false; | ||
| 4495 | } | ||
| 4496 | if(evt.keyCode == 73){ | ||
| 4497 | //CTRL+i => EMPHASIS | ||
| 4498 | wym._exec(WYMeditor.ITALIC); | ||
| 4499 | return false; | ||
| 4500 | } | ||
| 4501 | } | ||
| 4502 | }; | ||
| 4503 | |||
| 4504 | //keyup handler, mainly used for cleanups | ||
| 4505 | WYMeditor.WymClassSafari.prototype.keyup = function(evt) { | ||
| 4506 | |||
| 4507 | //'this' is the doc | ||
| 4508 | var wym = WYMeditor.INSTANCES[this.title]; | ||
| 4509 | |||
| 4510 | wym._selected_image = null; | ||
| 4511 | var container = null; | ||
| 4512 | |||
| 4513 | if(evt.keyCode == 13 && !evt.shiftKey) { | ||
| 4514 | |||
| 4515 | //RETURN key | ||
| 4516 | //cleanup <br><br> between paragraphs | ||
| 4517 | jQuery(wym._doc.body).children(WYMeditor.BR).remove(); | ||
| 4518 | |||
| 4519 | //fix PRE bug #73 | ||
| 4520 | container = wym.selected(); | ||
| 4521 | if(container && container.tagName.toLowerCase() == WYMeditor.PRE) | ||
| 4522 | wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //create P after PRE | ||
| 4523 | } | ||
| 4524 | |||
| 4525 | //fix #112 | ||
| 4526 | if(evt.keyCode == 13 && evt.shiftKey) { | ||
| 4527 | wym._exec('InsertLineBreak'); | ||
| 4528 | } | ||
| 4529 | |||
| 4530 | if(evt.keyCode != 8 | ||
| 4531 | && evt.keyCode != 17 | ||
| 4532 | && evt.keyCode != 46 | ||
| 4533 | && evt.keyCode != 224 | ||
| 4534 | && !evt.metaKey | ||
| 4535 | && !evt.ctrlKey) { | ||
| 4536 | |||
| 4537 | //NOT BACKSPACE, NOT DELETE, NOT CTRL, NOT COMMAND | ||
| 4538 | //text nodes replaced by P | ||
| 4539 | |||
| 4540 | container = wym.selected(); | ||
| 4541 | var name = container.tagName.toLowerCase(); | ||
| 4542 | |||
| 4543 | //fix forbidden main containers | ||
| 4544 | if( | ||
| 4545 | name == "strong" || | ||
| 4546 | name == "b" || | ||
| 4547 | name == "em" || | ||
| 4548 | name == "i" || | ||
| 4549 | name == "sub" || | ||
| 4550 | name == "sup" || | ||
| 4551 | name == "a" || | ||
| 4552 | name == "span" //fix #110 | ||
| 4553 | |||
| 4554 | ) name = container.parentNode.tagName.toLowerCase(); | ||
| 4555 | |||
| 4556 | if(name == WYMeditor.BODY || name == WYMeditor.DIV) wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //fix #110 for DIV | ||
| 4557 | } | ||
| 4558 | }; | ||
| 4559 | |||
| 4560 | //TODO | ||
| 4561 | WYMeditor.WymClassSafari.prototype.setFocusToNode = function(node) { | ||
| 4562 | /*var range = document.createRange(); | ||
| 4563 | range.selectNode(node); | ||
| 4564 | var selected = this._iframe.contentWindow.getSelection(); | ||
| 4565 | selected.addRange(range); | ||
| 4566 | selected.collapse(node, node.childNodes.length); | ||
| 4567 | this._iframe.contentWindow.focus();*/ | ||
| 4568 | }; | ||
| 4569 | |||
| 4570 | WYMeditor.WymClassSafari.prototype.openBlockTag = function(tag, attributes) | ||
| 4571 | { | ||
| 4572 | var attributes = this.validator.getValidTagAttributes(tag, attributes); | ||
| 4573 | |||
| 4574 | // Handle Safari styled spans | ||
| 4575 | if(tag == 'span' && attributes.style) { | ||
| 4576 | var new_tag = this.getTagForStyle(attributes.style); | ||
| 4577 | if(new_tag){ | ||
| 4578 | this._tag_stack.pop(); | ||
| 4579 | var tag = new_tag; | ||
| 4580 | this._tag_stack.push(new_tag); | ||
| 4581 | attributes.style = ''; | ||
| 4582 | } else { | ||
| 4583 | return; | ||
| 4584 | } | ||
| 4585 | } | ||
| 4586 | |||
| 4587 | this.output += this.helper.tag(tag, attributes, true); | ||
| 4588 | }; | ||
| 4589 | |||
| 4590 | WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) { | ||
| 4591 | |||
| 4592 | if(/bold/.test(style)) return 'strong'; | ||
| 4593 | if(/italic/.test(style)) return 'em'; | ||
| 4594 | if(/sub/.test(style)) return 'sub'; | ||
| 4595 | if(/super/.test(style)) return 'sup'; | ||
| 4596 | return false; | ||
| 4597 | }; | ||
| 4598 | |||
| 4599 | /* @name xhtml | ||
| 4600 | * @description Cleans up the HTML | ||
| 4601 | */ | ||
| 4602 | WYMeditor.editor.prototype.xhtml = function() { | ||
| 4603 | jQuery('.Apple-style-span', this._doc.body).removeClass('Apple-style-span'); | ||
| 4604 | return this.parser.parse(this.html()); | ||
| 4605 | }; |
|   | |||
| 1 | eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(!f)l f={};D.4S(f,{r5:"0.5-a2",2v:[],7A:[],5a:[],7F:"F",3L:"{r4}",dV:"r3",dn:"{r2}",9f:"{r1}",9e:"{r0}",eA:"dc/",7p:"2W.1a",d5:"2W.js",ez:"3C/",9P:"{qZ}",ey:"1I/4m/",9d:"{qY}",9g:"{qX}",9O:"{qW}",9N:"{qV}",9F:"{qU}",9H:"{qT}",7G:"{qS}",9G:"{qR}",9L:"{qQ}",9B:"{qP}",9D:"{qO}",9C:"{qN}",9M:"{qM}",9v:"{qL}",9y:"{qK}",9x:"{qJ}",9w:"{qI}",7H:"{qH}",9K:"{qG}",9J:"{qF}",9c:"{qE}",9b:"{qD}",dx:"4p",3q:"1g",ab:"N",P:"p",9s:"h1",9r:"h2",9q:"h3",9p:"h4",9o:"h5",9n:"h6",5k:"4T",5Z:"2q",A:"a",7O:"br",da:"5A",cX:"3g",61:"4U",5f:"6E",7T:"2D",7U:"ol",6d:"li",dy:"J",8Y:"1N",7n:"1S",5S:"M",7m:"53",5V:"9X",7z:"9W",7y:"9U",7x:"9S",7Q:"ex",7P:"ew",8Z:"ep",8X:"eo",dC:"el",dh:"qC",dB:"ek",6f:"a6",6e:"a5",dA:"ej",3N:"qB",7w:"a3",qA:"a4",af:"es",ag:"et",6b:1f 60("p","h1","h2","h3","h4","h5","h6","4T","2q"),5n:1f 60("6z","2q","N","dl","2Q","1K","h1","h2","h3","h4","h5","h6","hr","8o","ol","p","4T","3g","2D","dd","dt","li","8n","4U","8m","6E","8l","6D"),3R:{aj:8,ao:13,qz:35,qy:36,an:37,am:38,al:39,ak:40,qx:1f 60(37,38,39,40),ai:46},qw:{qv:1,qu:2,qt:3},1h:j(5s,1O){c.3Q=f.2v.1W(c)-1;c.9i=5s;c.B=1O;c.4J=D(5s).1C();if(c.B.O)c.4J=c.B.O;c.B.4E=c.B.4E||c.dg();c.B.5b=c.B.5b||c.B.4E+f.eA+c.B.2W+\'/\';c.B.7v=c.B.7v||c.df();c.B.9j=c.B.9j||c.B.4E+f.ez;c.B.7I=c.B.7I||c.B.4E+f.ey;c.B.7u=c.B.7u||c.de();c.4X()}});D.fn.5d=j(1O){1O=D.4S({O:"",4E:I,5b:I,7v:I,7I:I,7u:I,1y:I,3m:I,2W:"4m",d6:R,7q:R,3C:"en",4K:"8P",1q:"<N J=\'ei\'>"+"<N J=\'qs\'>"+f.9N+"</N>"+"<N J=\'qr\'></N>"+"<N J=\'qq\'>"+f.9M+f.9L+"</N>"+"<N J=\'qp\'>"+f.7H+f.9K+f.9J+"</N>"+"<N J=\'qo\'>"+f.9O+"</N>"+"</N>",dU:"<a J=\'qn\' "+"1N=\'8N://ee.5d.ed/\'>f</a>",4h:"<N J=\'a1 5i\'>"+"<1I "+"1S=\'"+f.9P+"qm.O\' "+"4C=\'c.1T.ql.f.2v["+f.3L+"].5p(c)\'"+"></1I>"+"</N>",3b:[],dT:"<N J=\'a0 5i\'>"+"<h2>{qk}</h2>"+"<2D>"+f.9F+"</2D>"+"</N>",dN:"<li J=\'"+f.9G+"\'><a 1N=\'#\' F=\'"+f.9H+"\' M=\'"+f.7G+"\'>"+f.7G+"</a></li>",dO:[{\'F\':\'ex\',\'M\':\'qj\',\'1a\':\'qi\'},{\'F\':\'ew\',\'M\':\'qh\',\'1a\':\'qg\'},{\'F\':\'ev\',\'M\':\'ev\',\'1a\':\'qf\'},{\'F\':\'eu\',\'M\':\'eu\',\'1a\':\'qe\'},{\'F\':\'et\',\'M\':\'qd\',\'1a\':\'qc\'},{\'F\':\'es\',\'M\':\'qb\',\'1a\':\'qa\'},{\'F\':\'a6\',\'M\':\'a6\',\'1a\':\'q9\'},{\'F\':\'a5\',\'M\':\'a5\',\'1a\':\'q8\'},{\'F\':\'er\',\'M\':\'er\',\'1a\':\'q7\'},{\'F\':\'eq\',\'M\':\'eq\',\'1a\':\'q6\'},{\'F\':\'ep\',\'M\':\'9X\',\'1a\':\'q5\'},{\'F\':\'a4\',\'M\':\'a4\',\'1a\':\'q4\'},{\'F\':\'eo\',\'M\':\'9W\',\'1a\':\'q3\'},{\'F\':\'el\',\'M\':\'9U\',\'1a\':\'q2\'},{\'F\':\'ek\',\'M\':\'9S\',\'1a\':\'q1\'},{\'F\':\'ej\',\'M\':\'7H\',\'1a\':\'q0\'},{\'F\':\'a3\',\'M\':\'a3\',\'1a\':\'pZ\'}],dS:"<N J=\'9Z 5i\'>"+"<h2>{pY}</h2>"+"<2D>"+f.9v+"</2D>"+"</N>",dK:"<li J=\'"+f.9w+"\'>"+"<a 1N=\'#\' F=\'"+f.9y+"\'>"+f.9x+"</a></li>",dL:[{\'F\':\'P\',\'M\':\'pX\',\'1a\':\'pW\'},{\'F\':\'9s\',\'M\':\'pV\',\'1a\':\'pU\'},{\'F\':\'9r\',\'M\':\'pT\',\'1a\':\'pS\'},{\'F\':\'9q\',\'M\':\'pR\',\'1a\':\'pQ\'},{\'F\':\'9p\',\'M\':\'pP\',\'1a\':\'pO\'},{\'F\':\'9o\',\'M\':\'pN\',\'1a\':\'pM\'},{\'F\':\'9n\',\'M\':\'pL\',\'1a\':\'pK\'},{\'F\':\'5k\',\'M\':\'pJ\',\'1a\':\'pI\'},{\'F\':\'5Z\',\'M\':\'pH\',\'1a\':\'pG\'},{\'F\':\'5f\',\'M\':\'pF\',\'1a\':\'pE\'}],dR:"<N J=\'9Y 5i\'>"+"<h2>{pD}</h2><2D>"+f.9B+"</2D></N>",dM:"<li><a 1N=\'#\' F=\'"+f.9D+"\'>"+f.9C+"</a></li>",3T:[],dP:"<N J=\'eg 5i\'>"+"<h2>{pC}</h2>"+"</N>",dQ:"<N J=\'eh 5i\'>"+"<h2>{pB}</h2>"+"<4z J=\'ef\'></4z>"+"</N>",pA:".ei",pz:".a0",py:" 2D",px:".9Z",pw:".9Y",98:".eh",pv:".a1 1I",ar:".a1",dw:".eg",dI:".a0 a",dH:".9Z a",dG:".9Y a",9h:".ef",90:".e9",7o:".e6",5R:".9V",7l:".e5",cQ:".dX",cZ:".e0",cY:".dZ",cW:".e2",cT:".e1",5Q:".65",cM:".64",cN:"",d4:".67",d1:".ea",5U:".e8",d0:".e3",cR:".dY",cO:".dW",dF:".pu",dE:"49",du:"pt=no,ps=no,pr=no,pq=no"+",51=pp,8M=po,3F=0,3G=0",1D:"<!pn O pm \'-//pl//ec pk 1.0 pj//ph\'"+" \'8N://ee.pg.ed/pf/eb/ec/eb-pe.pd\'>"+"<O 3P=\'"+f.9g+"\'><2P>"+"<3J 7i=\'3m\' 1d=\'1b/1a\' 8K=\'71\'"+" 1N=\'"+f.9f+"\' />"+"<M>"+f.9c+"</M>"+"<2f 1d=\'1b/8L\'"+" 1S=\'"+f.9d+"\'></2f>"+"<2f 1d=\'1b/8L\'"+" 1S=\'"+f.9e+"\'></2f>"+"</2P>"+f.9b+"</O>",ds:"<1g J=\'63 ea\'"+" 4C=\'f.59("+f.3L+")\'"+">"+"<1K>"+"<2Q>"+"<1v 1d=\'5N\' J=\'67\' Q=\'"+f.5V+"\' />"+"<3h>{9X}</3h>"+"<N J=\'1M\'>"+"<1o>{e7}</1o>"+"<1v 1d=\'1b\' J=\'e9\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{e4}</1o>"+"<1v 1d=\'1b\' J=\'9V\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M 1M-9T\'>"+"<1v J=\'65\' 1d=\'2r\'"+" Q=\'{7L}\' />"+"<1v J=\'64\' 1d=\'2r\'"+"Q=\'{7K}\' />"+"</N>"+"</2Q>"+"</1K>"+"</1g>",dr:"<1g J=\'63 e8\'"+" 4C=\'f.59("+f.3L+")\'"+">"+"<1K>"+"<2Q>"+"<1v 1d=\'5N\' J=\'67\' Q=\'"+f.7z+"\' />"+"<3h>{9W}</3h>"+"<N J=\'1M\'>"+"<1o>{e7}</1o>"+"<1v 1d=\'1b\' J=\'e6\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{pc}</1o>"+"<1v 1d=\'1b\' J=\'e5\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{e4}</1o>"+"<1v 1d=\'1b\' J=\'9V\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M 1M-9T\'>"+"<1v J=\'65\' 1d=\'2r\'"+" Q=\'{7L}\' />"+"<1v J=\'64\' 1d=\'2r\'"+"Q=\'{7K}\' />"+"</N>"+"</2Q>"+"</1K>"+"</1g>",dq:"<1g J=\'63 e3\'"+" 4C=\'f.59("+f.3L+")\'"+">"+"<1K>"+"<2Q>"+"<1v 1d=\'5N\' J=\'67\' Q=\'"+f.7y+"\' />"+"<3h>{9U}</3h>"+"<N J=\'1M\'>"+"<1o>{pb}</1o>"+"<1v 1d=\'1b\' J=\'e2\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{pa}</1o>"+"<1v 1d=\'1b\' J=\'e1\' Q=\'\' 2B=\'40\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{p9}</1o>"+"<1v 1d=\'1b\' J=\'e0\' Q=\'3\' 2B=\'3\' />"+"</N>"+"<N J=\'1M\'>"+"<1o>{p8}</1o>"+"<1v 1d=\'1b\' J=\'dZ\' Q=\'2\' 2B=\'3\' />"+"</N>"+"<N J=\'1M 1M-9T\'>"+"<1v J=\'65\' 1d=\'2r\'"+" Q=\'{7L}\' />"+"<1v J=\'64\' 1d=\'2r\'"+"Q=\'{7K}\' />"+"</N>"+"</2Q>"+"</1K>"+"</1g>",dp:"<1g J=\'63 dY\'"+" 4C=\'f.59("+f.3L+")\'"+">"+"<1K>"+"<1v 1d=\'5N\' J=\'67\' Q=\'"+f.7x+"\' />"+"<2Q>"+"<3h>{9S}</3h>"+"<N J=\'1M\'>"+"<4z J=\'dX\' 6Z=\'10\' 70=\'50\'></4z>"+"</N>"+"<N J=\'1M\'>"+"<1v J=\'65\' 1d=\'2r\'"+" Q=\'{7L}\' />"+"<1v J=\'64\' 1d=\'2r\'"+"Q=\'{7K}\' />"+"</N>"+"</2Q>"+"</1K>"+"</1g>",do:"<1g J=\'63 dW\'"+" 4C=\'f.59("+f.3L+")\'"+"></1g>",4u:[],5Y:"{",5X:"}",9R:1e,3u:1e,3t:1e,91:1e,8T:1e},1O);o c.d8(j(){1f f.1h(D(c),1O)})};D.4S({p7:j(i){o(f.2v[i])}});f.1h.u.4X=j(){if(D.7J.p6){l 4i=1f f.3d(c)}T if(D.7J.p5){l 4i=1f f.2o(c)}T if(D.7J.p4){l 4i=1f f.3v(c)}T if(D.7J.p3){l 4i=1f f.2H(c)}if(4i){if(D.2J(c.B.9R))c.B.9R(c);l 9Q=1f f.1n();D.4S(9Q,4i);c.3o=1f f.1p(9Q);if(c.B.1y||c.B.3m){c.db()}c.4G=1f f.2S();1j(l 6I in 4i){c[6I]=4i[6I]}c.2l=D(c.9i).dJ().5x(c.B.1q).5M();D(c.2l).5t(f.dV,c.3Q);l h=f.1J;l 4h=c.B.4h;4h=h.1l(4h,f.3L,c.3Q);4h=h.1l(4h,f.9P,c.B.7I);l 1q=D(c.2l).O();1q=h.1l(1q,f.9O,c.B.dU);1q=h.1l(1q,f.9N,c.B.dT);1q=h.1l(1q,f.9M,c.B.dS);1q=h.1l(1q,f.9L,c.B.dR);1q=h.1l(1q,f.7H,c.B.dQ);1q=h.1l(1q,f.9K,4h);1q=h.1l(1q,f.9J,c.B.dP);l 9I=2y(c.B.dO);l 9E="";1j(l i=0;i<9I.W;i++){l 5h=9I[i];if(5h.F&&5h.M)l 4g=c.B.dN;l 4g=h.1l(4g,f.9H,5h.F);4g=h.1l(4g,f.7G,c.B.5Y+5h.M+c.B.5X);4g=h.1l(4g,f.9G,5h.1a);9E+=4g}1q=h.1l(1q,f.9F,9E);l 62=2y(c.B.3T);l 9A="";1j(l i=0;i<62.W;i++){l 4e=62[i];if(4e.F&&4e.M)l 4d=c.B.dM;4d=h.1l(4d,f.9D,4e.F);4d=h.1l(4d,f.9C,4e.M);9A+=4d}1q=h.1l(1q,f.9B,9A);l 9z=2y(c.B.dL);l 9u="";1j(l i=0;i<9z.W;i++){l 5g=9z[i];if(5g.F&&5g.M)l 4f=c.B.dK;4f=h.1l(4f,f.9y,5g.F);4f=h.1l(4f,f.9x,c.B.5Y+5g.M+c.B.5X);4f=h.1l(4f,f.9w,5g.1a);9u+=4f}1q=h.1l(1q,f.9v,9u);1q=c.9a(1q);D(c.2l).O(1q);D(c.2l).4b(c.B.98).dJ();c.7q()}};f.1h.u.5o=j(){l E=c;D(c.2l).4b(c.B.dI).49(j(){E.dD(D(c).1s(f.7F));o(I)});D(c.2l).4b(c.B.dH).49(j(){E.L(D(c).1s(f.7F));o(I)});D(c.2l).4b(c.B.9h).2w(j(){D(E.H.1g).O(D(c).1C())});D(c.2l).4b(c.B.dG).49(j(){l 62=2y(E.B.3T);l 9t=D(c).1s(f.7F);l 4e=f.1J.az(62,9t);if(4e){l 4t=4e.aG;E.9l(9t,4t)}o(I)});D(c.B.dF).3a(c.B.dE,j(){E.5W()})};f.1h.u.p2=j(){o(c.H!=1e)};f.1h.u.cf=j(){o(c.2l)};f.1h.u.O=j(O){if(1t O===\'4p\')D(c.H.1g).O(O);T o(D(c.H.1g).O())};f.1h.u.1F=j(){o c.3o.3n(c.O())};f.1h.u.dD=j(1A){2Z(1A){1i f.8Z:l L=c.L();if(L||c.2h)c.4F(f.5V);1m;1i f.8X:c.4F(f.7z);1m;1i f.dC:c.4F(f.7y);1m;1i f.dB:c.4F(f.7x);1m;1i f.dA:c.5W();c.dk();1m;1i f.7w:c.4F(f.7w);1m;4m:c.1G(1A);1m}};f.1h.u.L=j(2s){if(2s){l L=1e;if(2s.1r()==f.5f){L=c.L();2Z(L.1w.1r()){1i f.61:1i f.5f:1m;4m:l 7E=1f 60(f.61,f.5f);L=c.2I(c.L(),7E);1m}if(L!=1e){2s=(L.1w.1r()==f.61)?f.5f:f.61;c.9k(L,2s);c.5W()}}T{l 7E=1f 60(f.P,f.9s,f.9r,f.9q,f.9p,f.9o,f.9n,f.5k,f.5Z);L=c.2I(c.L(),7E);if(L){l 3M=1e;if(2s.1r()==f.5Z){l 2q=c.2I(c.L(),f.5Z);if(2q==1e){3M=c.H.5P(2s);L.1H.dz(3M,L);3M.d9(L);c.4l(3M.p1)}T{l 7D=2q.6c;l 9m=7D.W;l 7C=1e;if(9m>0)7C=7D.4q(0);1j(l x=0;x<9m;x++){2q.1H.dz(7D.4q(0),2q)}2q.1H.p0(2q);if(7C)c.4l(7C)}}T c.9k(L,2s);c.5W()}}}T o(c.1c())};f.1h.u.9l=j(4d,4t){l L=(c.2h?c.2h:D(c.1c()));L=D(L).4N(4t);D(L).9l(4d);if(!D(L).1s(f.dy))D(L).oZ(c.5q)};f.1h.u.2I=j(V,4Q){if(V){l 4c=V.1w.1r();if(1t(4Q)==f.dx){8C(4c!=4Q&&4c!=f.3q){V=V.1H;4c=V.1w.1r()}}T{l 7B=I;8C(!7B&&4c!=f.3q){1j(l i=0;i<4Q.W;i++){if(4c==4Q[i]){7B=R;1m}}if(!7B){V=V.1H;4c=V.1w.1r()}}}if(4c!=f.3q)o(V);T o(1e)}T o(1e)};f.1h.u.9k=j(V,2s){l 3M=c.H.5P(2s);l O=D(V).O();V.1H.oY(3M,V);D(3M).O(O);c.4l(3M)};f.1h.u.9a=j(5e){if(!f.7A[c.B.3C])2y(D.95({94:c.B.9j+c.B.3C+\'.js\',93:I}).92);1j(l 1R in f.7A[c.B.3C]){5e=f.1J.1l(5e,c.B.5Y+1R+c.B.5X,f.7A[c.B.3C][1R])};o(5e)};f.1h.u.dm=j(5e){o(c.B.5Y+5e+c.B.5X)};f.1h.u.2j=j(dv){D(c.2l).4b(c.B.dw).O(dv)};f.1h.u.5W=j(){l O=c.1F();D(c.9i).1C(O);D(c.2l).4b(c.B.9h).1C(O)};f.1h.u.4F=j(2s){l 99=2z.5O(\'\',\'4F\',c.1U.B.du);if(99){l 4D="";2Z(2s){1i(f.5V):4D=c.B.ds;1m;1i(f.7z):4D=c.B.dr;1m;1i(f.7y):4D=c.B.dq;1m;1i(f.7x):4D=c.B.dp;1m;1i(f.7w):4D=c.B.do;1m}l h=f.1J;l 1D=c.B.1D;1D=h.1l(1D,f.dn,c.B.4E);1D=h.1l(1D,f.9g,c.B.4K);1D=h.1l(1D,f.9f,c.B.5b+f.7p);1D=h.1l(1D,f.9e,c.B.7v);1D=h.1l(1D,f.9d,c.B.7u);1D=h.1l(1D,f.9c,c.dm(2s));1D=h.1l(1D,f.9b,4D);1D=h.1l(1D,f.3L,c.3Q);1D=c.9a(1D);l 4a=99.3c;4a.oX(1D);4a.56()}};f.1h.u.dk=j(){D(c.2l).4b(c.B.98).oW()};f.1h.u.d3=j(){l dj=1f oV();o("E-"+dj.oU())};f.1h.u.5r=j(di){l 3K;l L=c.1c();l aP=di.86(c.4o+c.4o);l 4s=1f 3S(c.4o,"g");if(L&&L.1w.1r()!=f.3q){1j(x=aP.W-1;x>=0;x--){3K=aP[x];3K=3K.X(4s,"<br />");D(L).5x("<p>"+3K+"</p>")}}T{1j(x=0;x<aP.W;x++){3K=aP[x];3K=3K.X(4s,"<br />");D(c.H.1g).cS("<p>"+3K+"</p>")}}};f.1h.u.as=j(O){if(c.1Y.1T.3O().1z!=1e){c.1G(f.dh,O)}T{c.5r(O)}};f.1h.u.4L=j(4a,2n){l 1y=4a.4M[0];if(1y){1j(l i=0;i<2n.W;i++){l 1X=2n[i];if(1X.F&&1X.1a)c.5l(1y,1X)}}};f.1h.u.dg=j(){o D(D.7r(D(\'2f\'),j(s){o(s.1S&&s.1S.K(/7t\\.5d(\\.7s){0,1}\\.js(\\?.*)?$/))})).1s(\'1S\').X(/7t\\.5d(\\.7s){0,1}\\.js(\\?.*)?$/,\'\')};f.1h.u.df=j(){o D(D.7r(D(\'2f\'),j(s){o(s.1S&&s.1S.K(/7t\\.5d(\\.7s){0,1}\\.js(\\?.*)?$/))})).1s(\'1S\')};f.1h.u.de=j(){o D(D.7r(D(\'2f\'),j(s){o(s.1S&&s.1S.K(/7t(-(.*)){0,1}(\\.7s){0,1}\\.js(\\?.*)?$/))})).1s(\'1S\')};f.1h.u.oT=j(){o D(D.7r(D(\'3J\'),j(s){o(s.1N&&s.1N.K(/5d\\/dc\\/(.*)71\\.1a(\\?.*)?$/))})).1s(\'1N\')};f.1h.u.db=j(){l 5c=1f f.3y();if(c.B.3m){5c.3n(D.95({94:c.B.3m,93:I}).92)}T{5c.3n(c.B.1y,I)}if(c.B.3T.W==0){c.B.3T=5c.4v.3T}if(c.B.3b.W==0){c.B.3b=5c.4v.3b}if(c.B.4u.W==0){c.B.4u=5c.4v.4u}};f.1h.u.3s=j(){D(c.H.1g).3a("57",c.57);l 97=c.H.1g.oS("5A");1j(l i=0;i<97.W;i++){D(97[i]).3a("57",c.57)}};f.1h.u.57=j(Z){l E=f.2v[c.oR.M];E.2h=(c.1w.1r()==f.da)?c:1e;Z.oQ()};f.d7=j(1N){l 3J=3c.5P(\'3J\');3J.7i=\'3m\';3J.1N=1N;l 2P=D(\'2P\').8O(0);2P.d9(3J)};f.1h.u.7q=j(){if(c.B.7q&&!f.5a[c.B.2W]){l 96=I;l 4s=1f 3S(c.B.2W+\'\\/\'+f.7p+\'$\');D(\'3J\').d8(j(){if(c.1N.K(4s))96=R});if(!96)f.d7(c.B.5b+f.7p)}D(c.2l).oP("oO"+c.B.2W);if(c.B.d6&&!f.5a[c.B.2W]){2y(D.95({94:c.B.5b+f.d5,93:I}).92)}if(f.5a[c.B.2W]&&f.5a[c.B.2W].4X)f.5a[c.B.2W].4X(c)};f.59=j(52){l E=2z.oN.f.2v[52];l 4a=2z.3c;l 1c=E.1c();l d2=D(E.B.d4).1C();l 5T=E.d3();2Z(d2){1i f.5V:if(1c&&1c.1w&&1c.1w.1r!=f.A)1c=D(1c).4N(f.A);if(!1c&&E.2h)1c=D(E.2h).4N(f.A);1m}if(D.2J(E.B.91))E.B.91(E,2z);l 1y=4a.4M[0];l 2n=2y(E.B.4u);E.4L(4a,2n);if(1c){D(E.B.90).1C(D(1c).1s(f.8Y));D(E.B.7o).1C(D(1c).1s(f.7n));D(E.B.5R).1C(D(1c).1s(f.5S));D(E.B.7l).1C(D(1c).1s(f.7m))}if(E.2h){D(E.B.5U+" "+E.B.7o).1C(D(E.2h).1s(f.7n));D(E.B.5U+" "+E.B.5R).1C(D(E.2h).1s(f.5S));D(E.B.5U+" "+E.B.7l).1C(D(E.2h).1s(f.7m))}D(E.B.d1+" "+E.B.5Q).49(j(){l 58=D(E.B.90).1C();if(58.W>0){E.1G(f.8Z,5T);D("a[@1N="+5T+"]",E.H.1g).1s(f.8Y,58).1s(f.5S,D(E.B.5R).1C())}2z.56()});D(E.B.5U+" "+E.B.5Q).49(j(){l 58=D(E.B.7o).1C();if(58.W>0){E.1G(f.8X,5T);D("5A[@1S="+5T+"]",E.H.1g).1s(f.7n,58).1s(f.5S,D(E.B.5R).1C()).1s(f.7m,D(E.B.7l).1C())}2z.56()});D(E.B.d0+" "+E.B.5Q).49(j(){l 8W=D(E.B.cZ).1C();l 8V=D(E.B.cY).1C();if(8W>0&&8V>0){l 3g=E.H.5P(f.cX);l 8U=1e;l oM=1e;l cU=D(E.B.cW).1C();l cV=3g.oL();cV.8Q=cU;1j(x=0;x<8W;x++){8U=3g.oK(x);1j(y=0;y<8V;y++){8U.oJ(y)}}D(3g).1s(\'cd\',D(E.B.cT).1C());l V=D(E.2I(E.L(),f.6b)).8O(0);if(!V||!V.1H)D(E.H.1g).cS(3g);T D(V).5x(3g)}2z.56()});D(E.B.cR+" "+E.B.5Q).49(j(){l cP=D(E.B.cQ).1C();E.5r(cP);2z.56()});D(E.B.cO+" "+E.B.cN).O(E.1F());D(E.B.cM).57(j(){2z.56()});if(D.2J(E.B.8T))E.B.8T(E,2z)};f.2S=j(){c.7k=3c.5P(\'N\');o c};f.2S.u.C=j(F,1O,5O){1O=1O||I;5O=5O||I;o\'<\'+F+(1O?c.8S(1O):\'\')+(5O?\'>\':\' />\')};f.2S.u.oI=j(F,1Q,1O){1O=1O||I;o\'<\'+F+(1O?c.8S(1O):\'\')+\'>\'+1Q+\'</\'+F+\'>\'};f.2S.u.oH=j(1Q){o\'<![oG[\'+1Q+\']]>\'};f.2S.u.cJ=j(3I){o c.cL(c.cI(3I))};f.2S.u.cL=j(cK){o cK.X(/&oF;([a-z]+|(#\\d+));/ig,"&$1;")};f.2S.u.8S=j(1O){l 3I=c;3I.8R=\'\';1j(l 1R in 1O){l oE=\'\';l Q=1O[1R];if(1t Q!=\'j\'&&Q.W>0){if(c6(1R)==1R&&1t Q==\'4w\'){1R=Q.oD();Q=Q.4H()}if(1R!=\'\'&&Q!=\'\'){3I.8R+=\' \'+1R+\'="\'+3I.cJ(Q)+\'"\'}}}o 3I.8R};f.2S.u.cI=j(4p,7j){c.7k.8Q=4p;c.7k.oC=4p;l 1L=c.7k.8Q;if(1t 7j==\'2c\'){if(7j!=I)1L=1L.X(\'"\',\'&oB;\');if(7j==R)1L=1L.X(\'"\',\'&#oA;\')}o 1L};f.2S.u.oz=j(54){l 1L=[];l 3l=54.86(/((=\\s*")(")("))|((=\\s*\\\')(\\\')(\\\'))|((=\\s*[^>\\s]*))/g);if(3l.oy()!=54){1j(l k in 3l){l v=3l[k];if(1t v!=\'j\'&&v.W!=0){l cH=1f 3S(\'(\\\\w+)\\\\s*\'+v);if(K=54.K(cH)){l Q=v.X(/^[\\s=]+/,"");l 55=Q.ox(0);55=55==\'"\'?\'"\':(55=="\'"?"\'":\'\');if(55!=\'\'){Q=55==\'"\'?Q.X(/^"|"+$/g,\'\'):Q.X(/^\'|\'+$/g,\'\')}54=54.X(K[0],\'\');1L.1W([K[1],Q])}}}}o 1L};f.bk={"8G":{"ow":{"4Z":["4W","2P","O","74","1P","2f","1k","M"],"G":["J","id","1k","M","cG","cF"]},"ov":{"4Z":["4W","br","hr","1I","1P","2f"],"G":{"3P":["8P","cv"],"0":"3C","1":"3I:3C"}},"cE":{"G":{"cG":/^(\\w){1}$/,"cF":/^(\\d)+$/}}},"8H":{"2z":{"6X":["1g"],"G":["4C","ou"]},"1K":{"6X":["1K","1v","4z","4O","a","1o","2r"],"G":["ot","os","oq","op","oo","ay"]},"cE":{"4Z":["4W","6G","br","cg","om","2P","O","1I","74","1P","2f","1k","M"],"G":["ok","oj","ax"]},"oi":{"4Z":["4W","6G","br","2P","O","74","1P","2f","1k","M"],"G":["aw","oh","og","of","oe","od","oc"]}},"1E":{"a":{"G":{"0":"72","1":"cC","2":"1N","3":"cq","4":"F","7i":/^(7h|cD|3m|2F|5M|79|7d|52|7b|7c|7e|78|77|7g|7a|7f||76|75)+$/,"cp":/^(7h|cD|3m|2F|5M|79|7d|52|7b|7c|7e|78|77|7g|7a|7f||76|75)+$/,"cB":/^(cA|cz|8p|cy|cx|cw)$/,"5":"1d"}},"0":"6H","1":"8i","2":"6z","bh":{"G":{"0":"53","1":"cC","2":"1N","ob":/^(R|I)$/,"cB":/^(cA|cz|8p|cy|cx|cw)$/},"2b":["53"]},"3":"b","4W":{"G":["1N"],"2b":["1N"]},"6G":{"G":{"3P":/^(8P|cv)$/},"2b":["3P"]},"4":"bg","2q":{"G":["4V"]},"5":"1g","6":"br","2r":{"G":{"2V":/^(2V)$/,"1d":/^(2r|ct|cs)$/,"0":"Q"},"3H":"1K"},"7":"bf","8":"4V","9":"be","6F":{"G":{"48":/^(47|3G|45|44)$/,"0":"2U","1":"43","2X":/^(\\d)+$/,"42":/^(3F|41|3Z|3Y)$/,"2":"51"},"3H":"5B"},"5B":{"G":{"48":/^(47|3G|45|44)$/,"0":"2U","1":"43","2X":/^(\\d)+$/,"42":/^(3F|41|3Z|3Y)$/,"2":"51"}},"10":"dd","8h":{"G":{"0":"4V","cr":/^([0-9]){8}/}},"11":"N","12":"bd","13":"dl","14":"dt","15":"em","2Q":{"3H":"1K"},"1K":{"G":{"0":"5E","1":"5H","2":"5H-72","3":"oa","o9":/^(8O|o8)$/},"2b":["5E"]},"2P":{"G":["o7"]},"16":"h1","17":"h2","18":"h3","19":"h4","20":"h5","21":"h6","22":"hr","O":{"G":["o6"]},"23":"i","5A":{"G":["53","1S","8M","o5","o4","cn","51"],"2b":["53","1S"]},"1v":{"G":{"0":"5H","1":"53","cu":/^(cu)$/,"2V":/^(2V)$/,"o3":/^(\\d)+$/,"2":"F","8I":/^(8I)$/,"2B":/^(\\d)+$/,"3":"1S","1d":/^(2r|o2|o1|5N|bj|o0|nZ|ct|cs|1b)$/,"4":"Q"},"3H":"1K"},"bc":{"G":{"0":"4V","cr":/^([0-9]){8}/}},"24":"bb","1o":{"G":["1j"],"3H":"1K"},"25":"3h","26":"li","3J":{"G":{"0":"72","1":"1N","2":"cq","8K":/^(8J|ch|ci|cj|71|nY|,|;|)+$/i,"7i":/^(7h|7g|7f|7e|7d|7c|7b|7a|co|52|5M|79|78|2F|3m|77||76|75)+$/i,"cp":/^(7h|7g|7f|7e|7d|7c|7b|7a|co|52|5M|79|78|2F|3m|77||76|75)+$/i,"3":"1d"},"3H":"2P"},"ba":{"G":["id","F"],"2b":["id"]},"74":{"G":{"0":"1Q","8N-bi":/^(1Q\\-1d|nX|nW|nV\\-nU)$/i,"1":"F","2":"nT"},"2b":["1Q"]},"27":"8o","4w":{"G":["nS","nR","nQ","nP","5t","nO","8M","F","nN","1d","cn","51"]},"28":"ol","b9":{"G":{"0":"1o","2V":/^(2V)$/},"2b":["1o"]},"6C":{"G":{"0":"1o","2V":/^(2V)$/,"1c":/^(1c)$/,"1":"Q"},"3H":"4O"},"29":"p","1P":{"G":{"0":"1d","cm":/^(5t|nM|4w)$/,"1":"cm","2":"Q"},"2b":["F"]},"30":"4T","q":{"G":["4V"]},"31":"b8","2f":{"G":{"1d":/^(1b\\/nL|1b\\/8L|1b\\/nK|1b\\/nJ|1b\\/nI|1b\\/3I)$/,"0":"72","cl":/^(cl)$/,"1":"1S"},"2b":["1d"]},"4O":{"G":{"2V":/^(2V)$/,"ck":/^(ck)$/,"0":"F","1":"2B"},"3H":"1K"},"32":"b7","33":"2X","34":"2Y","1k":{"G":{"0":"1d","8K":/^(71|nH|nG|cj|nF|ci|ch|nE|8J)$/},"2b":["1d"]},"35":"2G","36":"4j","3g":{"G":{"0":"ce","1":"nD","2":"nC","cg":/^(nB|nA|nz|ny|nx|nw|nv|cf|ce)$/,"nt":/^(nr|nq|6Z|70|8J)$/,"3":"cd","4":"51"}},"8n":{"G":{"48":/^(47|3G|45|44)$/,"0":"2U","1":"43","42":/^(3F|41|3Z|3Y)$/}},"4U":{"G":{"0":"6H","48":/^(3G|47|45|44|2U)$/,"1":"cc","2":"2U","3":"43","cb":/^(\\d)+$/,"4":"ca","c9":/^(\\d)+$/,"1B":/^(6F|5B|1M|c8)$/,"42":/^(3F|41|3Z|3Y)$/}},"4z":{"G":["70","6Z","2V","F","8I"],"2b":["70","6Z"],"3H":"1K"},"8m":{"G":{"48":/^(47|3G|45|44)$/,"0":"2U","1":"43","42":/^(3F|41|3Z)$/,"2":"3Y"}},"6E":{"G":{"0":"6H","48":/^(3G|47|45|44|2U)$/,"1":"cc","2":"2U","3":"43","cb":/^(\\d)+$/,"4":"ca","c9":/^(\\d)+$/,"1B":/^(6F|5B|1M|c8)$/,"42":/^(3F|41|3Z|3Y)$/}},"8l":{"G":{"48":/^(47|3G|45|44)$/,"0":"2U","1":"43","42":/^(3F|41|3Z|3Y)$/}},"37":"M","6D":{"G":{"48":/^(47|3G|45|44|2U)$/,"0":"2U","1":"43","42":/^(3F|41|3Z|3Y)$/}},"38":"b6","39":"2D","40":"l"},6u:[],6t:[],5j:j(C,G){l 6Y={};l c7=c.c1(C);1j(l 2g in G){l Q=G[2g];l h=f.1J;if(!h.2A(c.6u,2g)&&!h.2A(c.6t,Q)){if(1t Q!=\'j\'&&h.2A(c7,2g)){if(c.c3(C,2g)){if(c.c2(C,2g,Q)){6Y[2g]=Q}}T{6Y[2g]=Q}}}}o 6Y},c0:j(C){l 1L=[];if(c.1E[C]&&c.1E[C][\'G\']){1j(k in c.1E[C][\'G\']){1L.1W(c6(k)==k?c.1E[C][\'G\'][k]:k)}}o 1L},c4:j(){l 1L=[];1j(l 1R in c.8H){1L.1W(c.8H[1R])}1j(l 1R in c.8G){1L.1W(c.8G[1R])}o 1L},c5:j(C){if(c.1E[C]){o R}1j(l 1R in c.1E){if(c.1E[1R]==C){o R}}o I},bZ:j(C){l 8E=[];if(c.c5(C)){l 8F=c.c4();1j(l 1R in 8F){l 3E=8F[1R];if(1t 3E==\'4w\'){l h=f.1J;if((3E[\'4Z\']&&h.2A(3E[\'4Z\'],C))||(3E[\'6X\']&&!h.2A(3E[\'6X\'],C))){np}l 6W=3E[\'G\']?3E[\'G\']:3E[\'nn\'];1j(l k in 6W){8E.1W(1t 6W[k]!=\'4p\'?k:6W[k])}}}}o 8E},c3:j(C,2g){o c.1E[C]&&((c.1E[C][\'G\']&&c.1E[C][\'G\'][2g])||(c.1E[C][\'2b\']&&f.1J.2A(c.1E[C][\'2b\'],2g)))},c2:j(C,2g,Q){if(c.1E[C]&&(c.1E[C][\'G\']&&c.1E[C][\'G\'][2g]&&Q.W>0&&!Q.K(c.1E[C][\'G\'][2g]))||(c.1E[C]&&c.1E[C][\'2b\']&&f.1J.2A(c.1E[C][\'2b\'],2g)&&Q.W==0)){o I}o 1t c.1E[C]!=\'2c\'},c1:j(C){if(!c.5L){c.5L={}}if(!c.5L[C]){c.5L[C]=c.c0(C).nm(c.bZ(C))}o c.5L[C]}};f.2T=j(6U){c.4B=6U;c.3X=[];c.8D=[];c.5J=1e;o c};f.2T.u.3W=j(3k,1o){1o=1o||R;l 5K=c.3X.W;c.3X[5K]=3k;c.8D[5K]=1o;c.5J=1e};f.2T.u.K=j(bY){if(c.3X.W==0){o[I,\'\']}l 3l=bY.K(c.bX());if(!3l){o[I,\'\']}l K=3l[0];1j(l i=1;i<3l.W;i++){if(3l[i]){o[c.8D[i-1],K]}}o[R,3l[0]]};f.2T.u.bX=j(){if(c.5J==1e){1j(l i=0,5K=c.3X.W;i<5K;i++){c.3X[i]=\'(\'+c.bV(c.bW(c.3X[i]).X(/([\\/\\(\\)])/g,\'\\\\$1\'))+\')\'}c.5J=1f 3S(c.3X.6g("|"),c.bN())}o c.5J};f.2T.u.bW=j(6V){o 6V.X(/\\(\\?(i|m|s|x|U)\\)/,\'~~~~~~bU\\$1~~~~~~\').X(/\\(\\?(\\-[i|m|s|x|U])\\)/,\'~~~~~~bT\\$1~~~~~~\').X(/\\(\\?\\=(.*)\\)/,\'~~~~~~bS\\$1~~~~~~\').X(/\\(\\?\\!(.*)\\)/,\'~~~~~~bR\\$1~~~~~~\').X(/\\(\\?\\<\\=(.*)\\)/,\'~~~~~~bQ\\$1~~~~~~\').X(/\\(\\?\\<\\!(.*)\\)/,\'~~~~~~bP\\$1~~~~~~\').X(/\\(\\?\\:(.*)\\)/,\'~~~~~~bO\\$1~~~~~~\')};f.2T.u.bV=j(6V){o 6V.X(/~~~~~~bU(.{1})~~~~~~/,"(?\\$1)").X(/~~~~~~bT(.{2})~~~~~~/,"(?\\$1)").X(/~~~~~~bS(.*)~~~~~~/,"(?=\\$1)").X(/~~~~~~bR(.*)~~~~~~/,"(?!\\$1)").X(/~~~~~~bQ(.*)~~~~~~/,"(?<=\\$1)").X(/~~~~~~bP(.*)~~~~~~/,"(?<!\\$1)").X(/~~~~~~bO(.*)~~~~~~/,"(?:\\$1)")};f.2T.u.bN=j(){o(c.4B?"m":"mi")};f.5I=j(2F){c.4Y=[2F];o c};f.5I.u.8y=j(){o c.4Y[c.4Y.W-1]};f.5I.u.8A=j(2a){c.4Y.1W(2a)};f.5I.u.8B=j(){if(c.4Y.W==1){o I}c.4Y.4H();o R};f.6P=1;f.bL=2;f.3z=3;f.5v=4;f.6M=5;f.2e=j(3o,2F,6U){2F=2F||\'5H\';c.4B=6U||I;c.2k={};c.8z=3o;c.3V=1f f.5I(2F);c.2E={};c.2E[2F]=2F;o c};f.2e.u.3W=j(3k,S){l S=S||"5H";if(1t c.2k[S]==\'2c\'){c.2k[S]=1f f.2T(c.4B)}c.2k[S].3W(3k);if(1t c.2E[S]==\'2c\'){c.2E[S]=S}};f.2e.u.2M=j(3k,S,5G){if(1t c.2k[S]==\'2c\'){c.2k[S]=1f f.2T(c.4B)}c.2k[S].3W(3k,5G);if(1t c.2E[5G]==\'2c\'){c.2E[5G]=5G}};f.2e.u.2C=j(3k,S){if(1t c.2k[S]==\'2c\'){c.2k[S]=1f f.2T(c.4B)}c.2k[S].3W(3k,"bJ");if(1t c.2E[S]==\'2c\'){c.2E[S]=S}};f.2e.u.4y=j(3k,S,5F){if(1t c.2k[S]==\'2c\'){c.2k[S]=1f f.2T(c.4B)}c.2k[S].3W(3k,\'bH\'+5F);if(1t c.2E[5F]==\'2c\'){c.2E[5F]=5F}};f.2e.u.8a=j(S,6S){c.2E[S]=6S};f.2e.u.3n=j(1u){if(1t c.8z==\'2c\'){o I}l W=1u.W;l 3D;8C(1t(3D=c.bD(1u))==\'4w\'){l 1u=3D[0];l 6T=3D[1];l 3j=3D[2];l S=3D[3];if(!c.bM(6T,3j,S)){o I}if(1u==\'\'){o R}if(1u.W==W){o I}W=1u.W}if(!3D){o I}o c.4A(1u,f.3z)};f.2e.u.bM=j(6T,3j,S){S=S||I;if(!c.4A(6T,f.3z)){o I}if(1t S==\'nl\'){o c.4A(3j,f.bL)}if(c.bK(S)){if(!c.4A(3j,f.5v)){o I}o c.3V.8B()}if(c.bI(S)){c.3V.8A(c.bG(S));if(!c.4A(3j,f.6M)){o I}o c.3V.8B()}c.3V.8A(S);o c.4A(3j,f.6P)};f.2e.u.bK=j(S){o(S==="bJ")};f.2e.u.bI=j(S){o(S.6m(0,1)=="bH")};f.2e.u.bG=j(S){o S.6m(1)};f.2e.u.4A=j(1Q,bE){if(!/ +/.2t(1Q)&&((1Q===\'\')||(1Q==I))){o R}l bF=c.3V.8y();l 6S=c.2E[bF];l 1L;2y(\'1L = c.8z.\'+6S+\'(1Q, bE);\');o 1L};f.2e.u.bD=j(1u){l 3j=c.2k[c.3V.8y()].K(1u);l K=3j[1];l 5E=3j[0];if(5E){l 8x=1u.81(K);l bC=1u.aB(0,8x);1u=1u.6m(8x+K.W);o[1u,bC,K,5E]}o R};f.3i=j(3o){D.4S(c,1f f.2e(3o,\'3e\'));c.8a(\'3e\',\'3e\');c.bB();c.4X();o c};f.3i.u.4X=j(){};f.3i.u.bB=j(){c.bA(\'3e\');c.bz(\'3e\');c.by(\'3e\');c.bx(\'3e\')};f.3i.u.bA=j(1B){c.2M("<!--",1B,\'8w\');c.2C("-->",\'8w\')};f.3i.u.bz=j(1B){c.2M("<2f",1B,\'8v\');c.2C("</2f>",\'8v\')};f.3i.u.by=j(1B){c.2M("<1k",1B,\'8u\');c.2C("</1k>",\'8u\')};f.3i.u.bx=j(1B){c.4y("<\\\\s*[a-5w-9:\\-]+\\\\s*>",1B,\'6Q\');c.2M("<[a-5w-9:\\-]+"+\'[\\\\\\/ \\\\\\>]+\',1B,\'6Q\');c.bw(\'6Q\');c.4y("</\\\\s*[a-5w-9:\\-]+\\\\s*>",1B,\'bs\')};f.3i.u.bw=j(1B){c.4y(\'\\\\s+\',1B,\'4R\');c.bv(1B);c.2C(\'/>\',1B);c.2C(\'>\',1B)};f.3i.u.bv=j(1B){c.4y("\\\\s*[a-z-89-9]*:?[a-z-89-9]+\\\\s*(?=\\=)\\\\s*",1B,\'bm\');c.2M(\'=\\\\s*"\',1B,\'6L\');c.3W("\\\\\\\\\\"",\'6L\');c.2C(\'"\',\'6L\');c.2M("=\\\\s*\'",1B,\'6K\');c.3W("\\\\\\\\\'",\'6K\');c.2C("\'",\'6K\');c.4y(\'=\\\\s*[^>\\\\s]*\',1B,\'bl\')};f.1p=j(bu,S){l S=S||\'3e\';c.6r=1f f.3i(c);c.Y=bu;c.3V=S;c.nk=[];c.nj=\'\';c.nh=\'\';o c};f.1p.u.3n=j(1u){c.6r.3n(c.6B(1u));o c.6A(c.Y.aZ())};f.1p.u.6B=j(1u){if(1u.K(/J="aR"/)||1u.K(/ns = "ng:nf-nd-nc/)){c.Y.aS()}o c.Y.6B(1u)};f.1p.u.6A=j(3D){if(c.Y.8g){c.Y.aQ()}o c.Y.6A(3D)};f.1p.u.4R=j(K,2a){o R};f.1p.u.3e=j(1b){c.Y.aY(1b);o R};f.1p.u.8w=j(K,2j){o c.6R(K,2j,\'6x\')};f.1p.u.8v=j(K,2j){o c.6R(K,2j,\'6w\')};f.1p.u.8u=j(K,2j){o c.6R(K,2j,\'6v\')};f.1p.u.6R=j(K,2a,1d){2Z(2a){1i f.6P:c.5D=K;1m;1i f.3z:c.5D+=K;1m;1i f.5v:2Z(1d){1i\'6x\':c.Y.6x(c.5D+K);1m;1i\'6w\':c.Y.6w(c.5D+K);1m;1i\'6v\':c.Y.6v(c.5D+K);1m}}o R};f.1p.u.6Q=j(K,2a){2Z(2a){1i f.6P:c.bt=c.6N(K);c.5C={};1m;1i f.6M:c.8t(c.6N(K));1m;1i f.5v:c.8t(c.bt,c.5C)}o R};f.1p.u.bs=j(K,2a){c.8q(c.6N(K));o R};f.1p.u.8t=j(C,G){l G=G||{};c.bp(C);if(c.Y.8f(C)){c.Y.4k.1W(C);c.Y.aL(C,G);c.Y.69(C,G);c.8s(C)}T if(c.Y.aO(C)){c.Y.aX(C,G)}T{c.Y.aW(C,G);c.8s(C)}c.Y.6s=C;c.Y.8d=R;c.Y.nb=G};f.1p.u.8q=j(C){if(c.bq(C)){c.bo(C);if(c.Y.8f(C)){l 6O=c.Y.4k.4H();if(6O==I){o}T if(6O!=C){C=6O}c.Y.aV(C)}T{c.Y.aU(C)}}T{c.Y.aT(C)}c.Y.6s=C;c.Y.8d=I};f.1p.u.8s=j(C){c.Y.2R[C]=c.Y.2R[C]||0;c.Y.2R[C]++};f.1p.u.bq=j(C){if(c.Y.2R[C]){c.Y.2R[C]--;if(c.Y.2R[C]==0){c.Y.2R[C]=2c}o R}o I};f.1p.u.bp=j(2u){c.8r(2u,I)};f.1p.u.bo=j(C){c.8r(C,R)};f.1p.u.8r=j(2u,2O){l 2O=2O||I;if(c.Y.2R){1j(l C in c.Y.2R){l bn=c.Y.2R[C];if(bn>0&&c.Y.b5(C,2u,2O)){c.8q(C,R)}}}};f.1p.u.6y=j(){o c.Y.6y()};f.1p.u.6N=j(C){C=C.X(/^([\\s<\\/>]*)|([\\s<\\/>]*)$/gm,\'\').1r();l 3f=c.Y.6y();if(3f[C]){o 3f[C]}o C};f.1p.u.bm=j(K,2a){if(f.6M==2a){c.6J=K}o R};f.1p.u.6L=j(K,2a){if(f.3z==2a){c.5C[c.6J]=K}o R};f.1p.u.6K=j(K,2a){if(f.3z==2a){c.5C[c.6J]=K}o R};f.1p.u.bl=j(K,2a){c.5C[c.6J]=K.X(/^=/,\'\');o R};f.1n=j(){c.1V=\'\';c.4G=1f f.2S();c.2R={};c.3p=f.bk;c.4k=[];c.5y=[];c.8k={\'&b0;\':\'&#b1;\',\'&na;\':\'&#n9;\',\'&n8;\':\'&#n7;\',\'&n6;\':\'&#n5;\',\'&n4;\':\'&#n3;\',\'&n2;\':\'&#n1;\',\'&n0;\':\'&#mZ;\',\'&mY;\':\'&#mX;\',\'&mW;\':\'&#mV;\',\'&mU;\':\'&#mT;\',\'&mS;\':\'&#mR;\',\'&mQ;\':\'&#mP;\',\'&mO;\':\'&#mN;\',\'&mM;\':\'&#mL;\',\'&mK;\':\'&#mJ;\',\'&mI;\':\'&#mH;\',\'&mG;\':\'&#mF;\',\'&mE;\':\'&#mD;\',\'&mC;\':\'&#mB;\',\'&mA;\':\'&#mz;\',\'&my;\':\'&#mx;\',\'&mw;\':\'&#mv;\',\'&mt;\':\'&#ms;\',\'&mr;\':\'&#mq;\',\'∓\':\'&#mo;\',\'&mn;\':\'&#mm;\',\'&ml;\':\'&#mk;\',\'&mj;\':\'&#mh;\',\'&mg;\':\'&#mf;\',\'&me;\':\'&#md;\',\'&mc;\':\'&#mb;\',\'&ma;\':\'&#m9;\',\'&m8;\':\'&#m7;\',\'&m6;\':\'&#m5;\',\'&m4;\':\'&#m3;\',\'&m2;\':\'&#m1;\',\'&m0;\':\'&#lZ;\',\'&lY;\':\'&#lX;\',\'&lW;\':\'&#lV;\',\'&lU;\':\'&#lT;\',\'&lS;\':\'&#lR;\',\'&lQ;\':\'&#lP;\',\'&lO;\':\'&#lN;\',\'&lM;\':\'&#lL;\',\'&lK;\':\'&#lJ;\',\'&lI;\':\'&#lH;\',\'&lG;\':\'&#lF;\',\'≦\':\'&#lD;\',\'&lC;\':\'&#lB;\',\'&lA;\':\'&#lz;\',\'&ly;\':\'&#lx;\',\'&lw;\':\'&#lv;\',\'&lu;\':\'&#lt;\',\'&ls;\':\'&#lr;\',\'&lq;\':\'&#lp;\',\'&lo;\':\'&#ln;\',\'&lm;\':\'&#ll;\',\'&lk;\':\'&#lj;\',\'&lh;\':\'&#lg;\',\'&lf;\':\'&#ld;\',\'&lc;\':\'&#lb;\',\'&la;\':\'&#l9;\',\'&l8;\':\'&#l7;\',\'&l6;\':\'&#l5;\',\'&l4;\':\'M;\',\'&l3;\':\'&#l2;\',\'&l1;\':\'&#l0;\',\'&kZ;\':\'&#kY;\',\'&kX;\':\'&#kW;\',\'&kV;\':\'&#kU;\',\'&kT;\':\'&#kS;\',\'&kR;\':\'&#kQ;\',\'&kP;\':\'&#kO;\',\'&kN;\':\'&#kM;\',\'&kL;\':\'&#kK;\',\'&kJ;\':\'&#kI;\',\'&kH;\':\'&#kG;\',\'&kF;\':\'&#kE;\',\'&kD;\':\'&#kC;\',\'&kB;\':\'&#kA;\',\'&kz;\':\'&#ky;\',\'&kx;\':\'&#kw;\',\'&kv;\':\'&#ku;\',\'&kt;\':\'&#ks;\',\'&kr;\':\'&#kq;\',\'&kp;\':\'&#ko;\',\'&kn;\':\'&#km;\',\'&kl;\':\'&#kk;\',\'&kj;\':\'&#ki;\',\'&kh;\':\'&#kg;\',\'&kf;\':\'&#ke;\',\'&kd;\':\'&#kc;\',\'&kb;\':\'&#ka;\',\'&k9;\':\'&#k8;\',\'&k7;\':\'&#k6;\',\'&k5;\':\'&#k4;\',\'&k3;\':\'&#k2;\',\'&k1;\':\'&#k0;\',\'&jZ;\':\'&#jY;\',\'&jX;\':\'&#jW;\',\'&jV;\':\'&#jU;\',\'&jT;\':\'&#jS;\',\'&8p;\':\'&#jR;\',\'&jQ;\':\'&#jP;\',\'&jO;\':\'&#jN;\',\'&jM;\':\'&#jL;\',\'&jK;\':\'&#jJ;\',\'&jI;\':\'&#jH;\',\'&jG;\':\'&#jF;\',\'&jE;\':\'&#jD;\',\'&jC;\':\'&#jB;\',\'&jA;\':\'&#jz;\',\'&jy;\':\'&#jx;\',\'&jw;\':\'&#jv;\',\'&ju;\':\'&#jt;\',\'&jr;\':\'&#jq;\',\'&jp;\':\'&#jo;\',\'&jn;\':\'&#jm;\',\'&jl;\':\'&#jk;\',\'&jj;\':\'&#ji;\',\'&jh;\':\'&#jg;\',\'&jf;\':\'&#je;\',\'&jd;\':\'&#jc;\',\'&jb;\':\'&#ja;\',\'&j9;\':\'&#j8;\',\'&j7;\':\'&#j6;\',\'&j5;\':\'&#j4;\',\'&j3;\':\'&#j2;\',\'&j1;\':\'&#j0;\',\'&iZ;\':\'&#iY;\',\'&iX;\':\'&#iW;\',\'&iV;\':\'&#iU;\',\'&iT;\':\'&#iS;\',\'&iR;\':\'&#iQ;\',\'&iP;\':\'&#iO;\',\'&iN;\':\'&#iM;\',\'&iL;\':\'&#iK;\',\'&iJ;\':\'&#iI;\',\'&iH;\':\'&#iG;\',\'μ\':\'&#iF;\',\'ν\':\'&#iE;\',\'&iD;\':\'&#iC;\',\'&iB;\':\'&#iA;\',\'π\':\'&#iz;\',\'&iy;\':\'&#ix;\',\'&iw;\':\'&#iv;\',\'&iu;\':\'&#it;\',\'&ir;\':\'&#iq;\',\'&ip;\':\'&#io;\',\'&im;\':\'&#il;\',\'&ik;\':\'&#ij;\',\'ⅈ\':\'&#ih;\',\'&ie;\':\'&#ic;\',\'&ib;\':\'&#ia;\',\'&i9;\':\'&#i8;\',\'&i7;\':\'&#i6;\',\'&i5;\':\'&#i4;\',\'&i3;\':\'&#i2;\',\'&i1;\':\'&#i0;\',\'&hZ;\':\'&#hY;\',\'&hX;\':\'&#hW;\',\'&hV;\':\'&#hU;\',\'&hT;\':\'&#hS;\',\'&hR;\':\'&#hQ;\',\'&hP;\':\'&#hO;\',\'&hN;\':\'&#hM;\',\'&hL;\':\'&#hK;\',\'&hJ;\':\'&#hI;\',\'&hH;\':\'&#hG;\',\'&hF;\':\'&#hE;\',\'&hD;\':\'&#hC;\',\'&hB;\':\'&#hA;\',\'&hz;\':\'&#hy;\',\'&hx;\':\'&#hw;\',\'&hv;\':\'&#hu;\',\'&ht;\':\'&#hs;\',\'&hq;\':\'&#hp;\',\'&ho;\':\'&#hn;\',\'&hm;\':\'&#hl;\',\'&hk;\':\'&#hj;\',\'&hi;\':\'&#hh;\',\'&hg;\':\'&#hf;\',\'&he;\':\'&#hd;\',\'&bj;\':\'&#hc;\',\'&hb;\':\'&#ha;\',\'&h9;\':\'&#h8;\',\'&h7;\':\'&#h0;\',\'&gZ;\':\'&#gY;\',\'&gX;\':\'&#gW;\',\'&gV;\':\'&#gU;\',\'&gT;\':\'&#gS;\',\'&gR;\':\'&#gQ;\',\'&gP;\':\'&#gO;\',\'&gN;\':\'&#gM;\',\'&gL;\':\'&#gK;\',\'&gJ;\':\'&#gI;\',\'&gH;\':\'&#gG;\',\'&gF;\':\'&#gE;\',\'&gD;\':\'&#gC;\',\'&gB;\':\'&#gA;\',\'&gz;\':\'&#gy;\',\'&gx;\':\'&#gw;\',\'&gv;\':\'&#gu;\',\'>\':\'&#gs;\',\'&gr;\':\'&#gq;\',\'&gp;\':\'&#go;\',\'∋\':\'&#gn;\',\'≷\':\'&#gk;\',\'&gj;\':\'&#gh;\',\'≫\':\'&#gf;\',\'&gd;\':\'&#gc;\',\'&gb;\':\'&#ga;\',\'&6I;\':\'&#g9;\',\'&g8;\':\'&#g7;\',\'&g6;\':\'&#g5;\',\'&g4;\':\'&#g3;\',\'∨\':\'&#g2;\',\'&g1;\':\'&#g0;\',\'&fZ;\':\'&#fY;\',\'&fX;\':\'&#fW;\',\'&fV;\':\'&#fU;\',\'&fT;\':\'&#fS;\',\'&fR;\':\'&#fQ;\',\'&fP;\':\'&#fO;\',\'≠\':\'&#fN;\',\'&bi;\':\'&#fM;\',\'≤\':\'&#fL;\',\'≥\':\'&#fK;\',\'&2G;\':\'&#fJ;\',\'&4j;\':\'&#fI;\',\'&fH;\':\'&#fG;\',\'&fF;\':\'&#fE;\',\'&fD;\':\'&#fC;\',\'&fB;\':\'&#fA;\',\'&fz;\':\'&#fy;\',\'&fx;\':\'&#fw;\',\'&fv;\':\'&#fu;\',\'&ft;\':\'&#fs;\',\'&fr;\':\'&#fq;\',\'&fp;\':\'&#fo;\',\'&fm;\':\'&#fl;\',\'&3C;\':\'&#fk;\',\'&fj;\':\'&#fi;\',\'&fh;\':\'&#fg;\',\'&ff;\':\'&#fe;\',\'&fd;\':\'&#fc;\',\'&fb;\':\'&#fa;\',\'&f9;\':\'&#f8;\'};c.8e=["a","6H","8i","6z","bh","b","4W","6G","bg","2q","1g","2r","bf","4V","be","6F","5B","dd","8h","N","bd","dl","dt","em","2Q","1K","2P","h1","h2","h3","h4","h5","h6","O","i","bc","bb","1o","3h","li","ba","8o","4w","ol","b9","6C","p","1P","4T","q","b8","2f","4O","b7","2X","2Y","1k","2G","4j","3g","8n","4U","4z","8m","6E","8l","M","6D","b6","2D","l","f7"];c.aN=["br","hr","5A","1v"];o c};f.1n.u.b5=j(C,5z,2O){l 2O=2O||I;if(C==\'4U\'){if((2O&&5z==\'6D\')||(!2O&&5z==\'4U\')){o R}}if(C==\'6C\'){if((2O&&5z==\'4O\')||(!2O&&5z==\'6C\')){o R}}o I};f.1n.u.6B=j(1u){c.1V=\'\';o 1u};f.1n.u.6A=j(1F){1F=c.b4(1F);1F=c.b3(1F);1F=c.b2(1F);o 1F};f.1n.u.b4=j(1F){1j(l 8j in c.8k){1F=1F.X(8j,c.8k[8j])}o 1F};f.1n.u.b3=j(1F){l 3f=\'em|2Y|2G|4j|8i|4T|8h|2q|6z\';o 1F.X(1f 3S(\'<\\/(\'+3f+\')><\\\\1>\',\'\'),\'\').X(1f 3S(\'(\\s*<(\'+3f+\')>\\s*){2}(.*)(\\s*<\\/\\\\2>\\s*){2}\',\'\'),\'<\\$2>\\$3<\\$2>\')};f.1n.u.b2=j(1F){o 1F.X(1f 3S(\'<(\'+c.8e.6g("|")+\')>(<br \\/>|&#b1;|&b0;|\\\\s)*<\\/\\\\1>\',\'g\'),\'\')};f.1n.u.aZ=j(){o c.1V};f.1n.u.6y=j(){o{\'b\':\'2Y\',\'i\':\'em\'}};f.1n.u.aY=j(1b){c.1V+=1b};f.1n.u.6x=j(1b){if(c.f6){c.1V+=1b}};f.1n.u.6w=j(1b){if(!c.f5){c.1V+=1b}};f.1n.u.6v=j(1b){if(!c.f4){c.1V+=1b}};f.1n.u.69=j(C,G){c.1V+=c.4G.C(C,c.3p.5j(C,G),R)};f.1n.u.aX=j(C,G){c.1V+=c.4G.C(C,c.3p.5j(C,G))};f.1n.u.aW=j(C,G){};f.1n.u.aV=j(C){c.1V=c.1V.X(/<br \\/>$/,\'\')+c.8b(\'aM\',C)+"</"+C+">"+c.8b(\'5x\',C)};f.1n.u.aU=j(C){};f.1n.u.aT=j(C){c.1V+="</"+C+">"};f.1n.u.aS=j(){c.5y=[\'N\',\'2X\'];c.3p.6u=[\'1k\'];c.3p.6t=[\'aR\',\'f3\'];c.8g=R};f.1n.u.aQ=j(){c.5y=[];c.3p.6u=[];c.3p.6t=[];c.8g=I};f.1n.u.8f=j(C){o!f.1J.2A(c.5y,C)&&f.1J.2A(c.8e,C)};f.1n.u.aO=j(C){o!f.1J.2A(c.5y,C)&&f.1J.2A(c.aN,C)};f.1n.u.aK=j(C,1Q){c.8c(\'5x\',C,1Q)};f.1n.u.f2=j(C,1Q){c.8c(\'aM\',C,1Q)};f.1n.u.aL=j(C,G){if(C!=\'li\'&&(C==\'2D\'||C==\'ol\')&&c.6s&&!c.8d&&c.6s==\'li\'){c.1V=c.1V.X(/<\\/li>$/,\'\');c.aK(C,\'</li>\')}};f.1n.u.8c=j(2N,C,1Q){if(!c[\'3B\'+2N+\'3A\']){c[\'3B\'+2N+\'3A\']=[]}if(!c[\'3B\'+2N+\'3A\'][C]){c[\'3B\'+2N+\'3A\'][C]=[]}c[\'3B\'+2N+\'3A\'][C].1W(1Q)};f.1n.u.8b=j(2N,C){if(c[\'3B\'+2N+\'3A\']&&c[\'3B\'+2N+\'3A\'][C]&&c[\'3B\'+2N+\'3A\'][C].W>0){o c[\'3B\'+2N+\'3A\'][C].4H()}o\'\'};f.aJ=j(3o,2p){l 2p=(1t 2p==\'2c\'?R:2p);D.4S(c,1f f.2e(3o,(2p?\'4R\':\'4x\')));c.8a(\'4x\',\'4R\');if(2p==R){c.2M("/\\\\\\3U[<\\\\s]*f[>\\\\s]*\\\\\\3U/",\'4R\',\'4x\');c.2C("/\\\\\\3U[<\\/\\\\s]*f[>\\\\s]*\\\\\\3U/",\'4x\')}c.4y("\\\\\\f1[a-z-89-9]+[\\\\f0-z]*",\'4x\',\'aI\');c.2M("/\\\\\\3U",\'4x\',\'88\');c.2C("\\\\\\3U/",\'88\');c.2M("\\eZ",\'4x\',\'6q\');c.2C("\\eY",\'6q\');c.2M("/\\\\\\3U",\'6q\',\'87\');c.2C("\\\\\\3U/",\'87\');o c};f.3y=j(){c.6p=I;c.5u=I;c.2p=R;c.4v={\'3T\':[],\'3b\':[],\'4u\':[]};o c};f.3y.u.3n=j(1u,2p){l 2p=(1t 2p==\'2c\'?c.2p:2p);c.6r=1f f.aJ(c,2p);c.6r.3n(1u)};f.3y.u.4R=j(K,2a){o R};f.3y.u.88=j(1b,2j){if(1b.K(/eX[a-5w-9\\s]*E[a-5w-9\\s]*/mi)){o I}if(2j==f.3z){if(!c.6p){c.5u=R;c.2i={\'M\':f.1J.4r(1b)}}T{if(c.2i[c.2d]){if(!c.2i[c.2d].6n){c.2i[c.2d].6n=[1b]}T{c.2i[c.2d].6n.1W(1b)}}}c.6p=R}o R};f.3y.u.6q=j(K,2j){if(2j==f.3z){K=f.1J.4r(K);if(K!=\'\'){c.2i[c.2d].1k=K}}T if(2j==f.5v){c.6p=I;c.5u=I;c.aH(c.2i)}o R};f.3y.u.87=j(K,2j){if(2j==f.3z){c.2i[c.2d].84=K.X(/^([\\s\\/\\*]*)|([\\s\\/\\*]*)$/gm,\'\')}o R};f.3y.u.aI=j(K){K=K.X(/^([\\s\\.]*)|([\\s\\.*]*)$/gm,\'\');l C=\'\';if(K.81(\' \')>0){l 85=K.86(\' \');c.2d=85[0];l C=85[1]}T{c.2d=K}if(!c.5u){c.2i={\'M\':(!C?\'\':C.eW()+\': \')+c.2d};c.5u=R}if(!c.2i[c.2d]){c.2i[c.2d]={\'F\':c.2d}}if(C){if(!c.2i[c.2d].3f){c.2i[c.2d].3f=[C]}T{c.2i[c.2d].3f.1W(C)}}o R};f.3y.u.aH=j(6o){1j(l F in 6o){l 2L=6o[F];if(1t 2L==\'4w\'&&F!=\'M\'){c.4v.3T.1W({\'F\':f.1J.4r(2L.F),\'M\':6o.M,\'aG\':f.1J.4r((2L.6n||2L.3f).6g(\', \'))});if(2L.84){c.4v.3b.1W({\'F\':\'.\'+f.1J.4r(2L.F),\'1a\':2L.84})}if(2L.1k){c.4v.4u.1W({\'F\':\'.\'+f.1J.4r(2L.F),\'1a\':2L.1k})}}}};D.fn.aF=j(){if(c[0].83==3)o!(/[^\\t\\n\\r ]/.2t(c[0].5t));o I};f.aF=j(n){if(n.83==3)o!(/[^\\t\\n\\r ]/.2t(n.5t));o I};f.eV=j(3x){o!(/[^\\t\\n\\r ]/.2t(3x))};D.fn.4N=j(4t){l n=c;if(n[0].83==3)n=n.7Y().aE(0,1);if(n.4Q(4t).2B()==1)o n;T o n.7Y(4t).aE(0,1)};f.1J={1l:j(3x,aD,aC){l 4s=1f 3S(aD,"g");o(3x.X(4s,aC))},eU:j(3x,aA,82){o(3x.aB(0,82)+aA+3x.6m(82))},4r:j(3x){o 3x.X(/^(\\s*)|(\\s*)$/gm,\'\')},2A:j(3w,5s){1j(l i=0;i<3w.W;i++){if(3w[i]===5s)o R}o I},81:j(3w,4q){l 80=-1;1j(l i=0;i<3w.W;i++){if(3w[i]==4q){80=i;1m}}o(80)},az:j(3w,F){1j(l i=0;i<3w.W;i++){l 4q=3w[i];if(4q.F==F)o(4q)}o(1e)}};f.3d=j(E){c.1U=E;c.5q="eT";c.4o="\\r\\n"};f.3d.u.5p=j(1I){c.1Y=1I;c.H=1I.1T.3c;l 1y=c.H.4M[0];l 2n=2y(c.B.3b);c.4L(c.H,2n);c.H.M=c.1U.3Q;D(\'O\',c.H).1s(\'3P\',c.B.4K);D(c.H.1g).O(c.1U.4J);l E=c;c.H.1g.ay=j(){E.H.4n="on";E.H=1I.1T.3c};c.H.eS=j(){E.6l()};c.H.ax=j(){E.6l();E.2w()};c.H.aw=j(){E.6l()};c.H.1g.eR=j(){E.1Y.1T.av.au=I};c.H.1g.eQ=j(){E.1Y.1T.av.au=I;E.5r(2z.eP.eO("3e"))};if(c.at){if(D.2J(c.B.3u))c.B.3u(c);c.1U.5o();if(D.2J(c.B.3t))c.B.3t(c);c.3s()}c.at=R;c.H.4n="on";6j{c.H=1I.1T.3c}6i(e){}};f.3d.u.1G=j(1A,1P){2Z(1A){1i f.6f:1i f.6e:l L=c.2I(c.L(),f.6d);if(L)c.H.2m(1A);1m;4m:if(1P)c.H.2m(1A,I,1P);T c.H.2m(1A);1m}c.3s()};f.3d.u.1c=j(){l 4P=c.1Y.1T.3c.4P;if(4P!=1e){if(4P.7Z!=2c)o(4P.7Z())}};f.3d.u.6l=j(){c.H.4P=c.H.7X.6h()};f.3d.u.5l=j(1y,1X){1y.eN(1X.F,1X.1a)};f.3d.u.as=j(O){l 2K=c.H.7X.6h();if(D(2K.7Z()).7Y(c.B.ar).is(\'*\')){6j{2K.eM(O)}6i(e){}}T{c.5r(O)}};f.3d.u.2w=j(){c.2h=1e};f.3d.u.4l=j(V){l 2K=c.H.7X.6h();2K.eL(V);2K.ap(I);2K.eK(\'eJ\',-1);2K.4O();V.7W()};f.2o=j(E){c.1U=E;c.5q="J";c.4o="\\n"};f.2o.u.5p=j(1I){c.1Y=1I;c.H=1I.ah;l 1y=c.H.4M[0];l 2n=2y(c.B.3b);c.4L(c.H,2n);c.H.M=c.1U.3Q;D(\'O\',c.H).1s(\'3P\',c.B.4K);c.O(c.1U.4J);c.6k();if(D.2J(c.B.3u))c.B.3u(c);c.1U.5o();D(c.H).3a("3r",c.3r);D(c.H).3a("2w",c.2w);D(c.H).3a("7W",c.6k);if(D.2J(c.B.3t))c.B.3t(c);c.3s()};f.2o.u.O=j(O){if(1t O===\'4p\'){6j{c.H.4n="aq"}6i(e){};O=O.X(/<em([^>]*)>/gi,"<i$1>").X(/<\\/em>/gi,"</i>").X(/<2Y([^>]*)>/gi,"<b$1>").X(/<\\/2Y>/gi,"</b>");D(c.H.1g).O(O);c.6k()}T o(D(c.H.1g).O())};f.2o.u.1G=j(1A,1P){if(!c.1c())o(I);2Z(1A){1i f.6f:1i f.6e:l 1z=c.1c();l 2x=c.1Y.1T.3O();l 1Z=2x.1Z;if(1Z.5m=="#1b")1Z=1Z.1H;1z=c.2I(1z,f.5n);1Z=c.2I(1Z,f.5n);if(1z&&1z==1Z&&1z.1w.1r()==f.6d){l 4I=1z.1H.1H;if(1z.1H.6c.W>1||4I.1w.1r()==f.7U||4I.1w.1r()==f.7T)c.H.2m(1A,\'\',1e)}1m;4m:if(1P)c.H.2m(1A,\'\',1P);T c.H.2m(1A,\'\',1e)}l L=c.1c();if(L.1w.1r()==f.3q)c.1G(f.3N,f.P);c.3s()};f.2o.u.1c=j(){l 2x=c.1Y.1T.3O();l V=2x.1z;if(V){if(V.5m=="#1b")o(V.1H);T o(V)}T o(1e)};f.2o.u.5l=j(1y,1X){1y.7S(1X.F+" {"+1X.1a+"}",1y.7R.W)};f.2o.u.3r=j(Z){l E=f.2v[c.M];if(Z.6a){if(Z.1x==66){E.1G(f.7Q);o I}if(Z.1x==73){E.1G(f.7P);o I}}};f.2o.u.2w=j(Z){l E=f.2v[c.M];E.2h=1e;l L=1e;if(Z.1x==13&&!Z.7N){D(E.H.1g).ae(f.7O).ad();L=E.1c();if(L&&L.1w.1r()==f.5k)E.1G(f.3N,f.P);}T if(Z.1x!=8&&Z.1x!=17&&Z.1x!=46&&Z.1x!=7M&&!Z.ac&&!Z.6a){L=E.1c();l F=L.1w.1r();if(F=="2Y"||F=="b"||F=="em"||F=="i"||F=="2G"||F=="4j"||F=="a")F=L.1H.1w.1r();if(F==f.3q)E.1G(f.3N,f.P)}};f.2o.u.6k=j(){if(c.4n=="aq"){6j{c.4n="on";c.2m("eI",\'\',I)}6i(e){}}};f.2o.u.4l=j(V){l 2K=3c.6h();2K.eH(V);l 1c=c.1Y.1T.3O();1c.eG(2K);1c.ap(V,V.6c.W);c.1Y.1T.7W()};f.2o.u.69=j(C,G){l G=c.3p.5j(C,G);if(C==\'2X\'&&G.1k){l 2u=c.68(G.1k);if(2u){c.4k.4H();l C=2u;c.4k.1W(2u);G.1k=\'\'}T{o}}c.1V+=c.4G.C(C,G,R)};f.2o.u.68=j(1k){if(/aa/.2t(1k))o\'2Y\';if(/a9/.2t(1k))o\'em\';if(/2G/.2t(1k))o\'2G\';if(/2G/.2t(1k))o\'a8\';o I};f.3v=j(E){c.1U=E;c.5q="J";c.4o="\\r\\n"};f.3v.u.5p=j(1I){c.1Y=1I;c.H=1I.1T.3c;l 1y=c.H.4M[0];l 2n=2y(c.B.3b);c.4L(c.H,2n);c.H.M=c.1U.3Q;D(\'O\',c.H).1s(\'3P\',c.B.4K);c.H.4n="on";c.O(c.1U.4J);if(D.2J(c.B.3u))c.B.3u(c);c.1U.5o();D(c.H).3a("3r",c.3r);D(c.H).3a("2w",c.2w);if(D.2J(c.B.3t))c.B.3t(c);c.3s()};f.3v.u.1G=j(1A,1P){if(1P)c.H.2m(1A,I,1P);T c.H.2m(1A);c.3s()};f.3v.u.1c=j(){l 2x=c.1Y.1T.3O();l V=2x.1z;if(V){if(V.5m=="#1b")o(V.1H);T o(V)}T o(1e)};f.3v.u.5l=j(1y,1X){1y.7S(1X.F+" {"+1X.1a+"}",1y.7R.W)};f.3v.u.3r=j(Z){l E=f.2v[c.M];l 2x=E.1Y.1T.3O();7V=2x.eF(0).eE;if(!D(7V).4N(f.6b.6g(","))[0]&&!D(7V).4N(\'li\')&&Z.1x!=f.3R.ao&&Z.1x!=f.3R.an&&Z.1x!=f.3R.am&&Z.1x!=f.3R.al&&Z.1x!=f.3R.ak&&Z.1x!=f.3R.aj&&Z.1x!=f.3R.ai)E.1G(f.3N,f.P)};f.3v.u.2w=j(Z){l E=f.2v[c.M];E.2h=1e};f.3v.u.4l=j(V){};f.2H=j(E){c.1U=E;c.5q="J";c.4o="\\n"};f.2H.u.5p=j(1I){c.1Y=1I;c.H=1I.ah;l 1y=c.H.4M[0];l 2n=2y(c.B.3b);c.4L(c.H,2n);c.H.M=c.1U.3Q;D(\'O\',c.H).1s(\'3P\',c.B.4K);c.H.4n="on";c.O(c.1U.4J);if(D.2J(c.B.3u))c.B.3u(c);c.1U.5o();D(c.H).3a("3r",c.3r);D(c.H).3a("2w",c.2w);if(D.2J(c.B.3t))c.B.3t(c);c.3s()};f.2H.u.1G=j(1A,1P){if(!c.1c())o(I);2Z(1A){1i f.6f:1i f.6e:l 1z=c.1c();l 2x=c.1Y.1T.3O();l 1Z=2x.1Z;if(1Z.5m=="#1b")1Z=1Z.1H;1z=c.2I(1z,f.5n);1Z=c.2I(1Z,f.5n);if(1z&&1z==1Z&&1z.1w.1r()==f.6d){l 4I=1z.1H.1H;if(1z.1H.6c.W>1||4I.1w.1r()==f.7U||4I.1w.1r()==f.7T)c.H.2m(1A,\'\',1e)}1m;1i f.ag:1i f.af:c.H.2m(1A,\'\',1e);l 1z=c.1c();l L=c.2I(1z,f.6b);if(L)D(L).eD(D(L).O());1m;4m:if(1P)c.H.2m(1A,\'\',1P);T c.H.2m(1A,\'\',1e)}l L=c.1c();if(L&&L.1w.1r()==f.3q)c.1G(f.3N,f.P);c.3s()};f.2H.u.1c=j(){l 2x=c.1Y.1T.3O();l V=2x.1z;if(V){if(V.5m=="#1b")o(V.1H);T o(V)}T o(1e)};f.2H.u.5l=j(1y,1X){1y.7S(1X.F+" {"+1X.1a+"}",1y.7R.W)};f.2H.u.3r=j(Z){l E=f.2v[c.M];if(Z.6a){if(Z.1x==66){E.1G(f.7Q);o I}if(Z.1x==73){E.1G(f.7P);o I}}};f.2H.u.2w=j(Z){l E=f.2v[c.M];E.2h=1e;l L=1e;if(Z.1x==13&&!Z.7N){D(E.H.1g).ae(f.7O).ad();L=E.1c();if(L&&L.1w.1r()==f.5k)E.1G(f.3N,f.P);}if(Z.1x==13&&Z.7N){E.1G(\'eC\')}if(Z.1x!=8&&Z.1x!=17&&Z.1x!=46&&Z.1x!=7M&&!Z.ac&&!Z.6a){L=E.1c();l F=L.1w.1r();if(F=="2Y"||F=="b"||F=="em"||F=="i"||F=="2G"||F=="4j"||F=="a"||F=="2X")F=L.1H.1w.1r();if(F==f.3q||F==f.ab)E.1G(f.3N,f.P);}};f.2H.u.4l=j(V){};f.2H.u.69=j(C,G){l G=c.3p.5j(C,G);if(C==\'2X\'&&G.1k){l 2u=c.68(G.1k);if(2u){c.4k.4H();l C=2u;c.4k.1W(2u);G.1k=\'\'}T{o}}c.1V+=c.4G.C(C,G,R)};f.2H.u.68=j(1k){if(/aa/.2t(1k))o\'2Y\';if(/a9/.2t(1k))o\'em\';if(/2G/.2t(1k))o\'2G\';if(/a8/.2t(1k))o\'4j\';o I};f.1h.u.1F=j(){D(\'.a7-1k-2X\',c.H.1g).eB(\'a7-1k-2X\');o c.3o.3n(c.O())};',62,1680,'||||||||||||this|||WYMeditor||||function||var|||return||||||prototype|||||||_options|tag|jQuery|wym|name|attributes|_doc|false|class|match|container|title|div|html||value|true|mode|else||node|length|replace|_Listener|evt|||||||||||css|text|selected|type|null|new|body|editor|case|for|style|replaceAll|break|XhtmlSaxListener|label|XhtmlParser|boxHtml|toLowerCase|attr|typeof|raw|input|tagName|keyCode|styles|focusNode|cmd|scope|val|dialogHtml|_tags|xhtml|_exec|parentNode|iframe|Helper|form|result|row|href|options|param|content|key|src|contentWindow|_wym|output|push|oCss|_iframe|anchorNode|||||||||||state|required|undefined|_current_element|Lexer|script|attribute|_selected_image|_current_item|status|_regexes|_box|execCommand|aCss|WymClassMozilla|only_wym_blocks|blockquote|button|sType|test|new_tag|INSTANCES|keyup|sel|eval|window|contains|size|addExitPattern|ul|_mode_handlers|start|sub|WymClassSafari|findUp|isFunction|range|details|addEntryPattern|position|closing|head|fieldset|_open_tags|XmlHelper|ParallelRegex|char|disabled|skin|span|strong|switch|||||||||||bind|editorStyles|document|WymClassExplorer|Text|tags|table|legend|XhtmlLexer|matched|pattern|matches|stylesheet|parse|parser|validator|BODY|keydown|listen|postInit|preBind|WymClassOpera|arr|str|WymCssParser|LEXER_UNMATCHED|_closing|_insert_|lang|parsed|defaults|top|left|inside|xml|link|sTmp|INDEX|newNode|FORMAT_BLOCK|getSelection|dir|_index|KEY|RegExp|classesItems|x2a|_mode|addPattern|_patterns|baseline|bottom||middle|valign|charoff|justify|center||right|align|click|doc|find|tagname|sClass|oClass|sContainer|sTool|iframeHtml|WymClass|sup|_tag_stack|setFocusToNode|default|designMode|_newLine|string|item|trim|rExp|jqexpr|dialogStyles|css_settings|object|WymCss|addSpecialPattern|textarea|_invokeParser|_case|onload|sBodyHtml|basePath|dialog|helper|pop|ancestor|_html|direction|addCssRules|styleSheets|parentsOrSelf|select|caretPos|filter|Ignore|extend|pre|td|cite|base|init|_stack|except||width|index|alt|tag_attributes|delimiter|close|mousedown|sUrl|INIT_DIALOG|SKINS|skinPath|CssParser|wymeditor|sVal|TH|oContainer|oTool|wym_section|getValidTagAttributes|PRE|addCssRule|nodeName|BLOCKS|bindEvents|initIframe|_class|paste|elem|data|_has_title|LEXER_EXIT|z0|after|avoided_tags|now_on_tag|img|colgroup|_tag_attributes|_non_tag|action|special|new_mode|accept|StateStack|_regex|count|_possible_tag_attributes|next|hidden|open|createElement|submitSelector|titleSelector|TITLE|sStamp|dialogImageSelector|DIALOG_LINK|update|stringDelimiterRight|stringDelimiterLeft|BLOCKQUOTE|Array|TD|aClasses|wym_dialog|wym_cancel|wym_submit||wym_dialog_type|getTagForStyle|openBlockTag|ctrlKey|MAIN_CONTAINERS|childNodes|LI|OUTDENT|INDENT|join|createRange|catch|try|enableDesignMode|saveCaret|substring|expressions|style_details|_in_style|WymCssStyle|_Lexer|last_tag|skiped_attribute_values|skiped_attributes|addCss|addScript|addComment|getTagReplacements|address|afterParsing|beforeParsing|option|tr|th|col|bdo|abbr|prop|_current_attribute|SingleQuotedAttribute|DoubleQuotedAttribute|LEXER_SPECIAL|normalizeTag|expected_tag|LEXER_ENTER|OpeningTag|_addNonTagBlock|handler|unmatched|case_sensitive|regex|tag_defaults|only|valid_attributes|rows|cols|screen|charset||meta|icon|shortcut|subsection|section|prev|help|glossary|copyright|contents|chapter|bookmark|appendix|alternate|rel|escape_quotes|_entitiesDiv|altSelector|ALT|SRC|srcSelector|SKINS_DEFAULT_CSS|loadSkin|grep|pack|jquery|jQueryPath|wymPath|PREVIEW|DIALOG_PASTE|DIALOG_TABLE|DIALOG_IMAGE|STRINGS|bFound|firstNode|nodes|aTypes|NAME|TOOL_TITLE|HTML|iframeBasePath|browser|Cancel|Submit|224|shiftKey|BR|ITALIC|BOLD|cssRules|insertRule|UL|OL|startNode|focus|selection|parents|parentElement|ret|indexOf|pos|nodeType|feedback_style|parts|split|WymCssFeddbackStyle|WymCssComment|_0|mapHandler|_getClosingTagContent|_insertContentWhenClosingTag|last_tag_opened|block_tags|isBlockTag|_avoiding_tags_implicitly|del|acronym|entity|entities|thead|tfoot|tbody|noscript|circ|_callCloseTagListener|_autoCloseUnclosed|_increaseOpenTagCounter|_callOpenTagListener|Css|Script|Comment|unparsed_character_count|getCurrent|_parser|enter|leave|while|_labels|default_attributes|default_attributes_and_events|_attributes|_events|readonly|all|media|javascript|height|http|get|ltr|innerHTML|_formated_options|tagOptions|postInitDialog|newRow|iCols|iRows|INSERT_IMAGE|HREF|CREATE_LINK|hrefSelector|preInitDialog|responseText|async|url|ajax|found|images|htmlSelector|wDialog|replaceStrings|DIALOG_BODY|DIALOG_TITLE|JQUERY_PATH|WYM_PATH|CSS_PATH|DIRECTION|htmlValSelector|_element|langPath|switchTo|toggleClass|lgt|H6|H5|H4|H3|H2|H1|sName|sContainers|CONTAINERS_ITEMS|CONTAINER_CLASS|CONTAINER_TITLE|CONTAINER_NAME|aContainers|sClasses|CLASSES_ITEMS|CLASS_TITLE|CLASS_NAME|sTools|TOOLS_ITEMS|TOOL_CLASS|TOOL_NAME|aTools|STATUS|IFRAME|CLASSES|CONTAINERS|TOOLS|LOGO|IFRAME_BASE_PATH|SaxListener|preInit|Paste_From_Word|indent|Table|wym_title|Image|Link|wym_classes|wym_containers|wym_tools|wym_iframe||Preview|Unlink|Outdent|Indent|Apple|super|italic|bold|DIV|metaKey|remove|children|INSERT_UNORDEREDLIST|INSERT_ORDEREDLIST|contentDocument|DELETE|BACKSPACE|DOWN|RIGHT|UP|LEFT|ENTER|collapse|off|iframeBodySelector|insert|_initialized|returnValue|event|onclick|onkeyup|onfocus|findByName|inserted|substr|rep|old|slice|isPhantomNode|expr|addStyleSetting|WymCssStyleDeclaration|WymCssLexer|insertContentAfterClosingTag|fixNestingBeforeOpeningBlockTag|before|inline_tags|isInlineTag||allowStylingTagsAndAttributes|MsoNormal|avoidStylingTagsAndAttributes|closeUnopenedTag|closeUnknownTag|closeBlockTag|openUnknownTag|inlineTag|addContent|getResult|nbsp|160|removeEmptyTags|joinRepeatedEntities|replaceNamedEntities|shouldCloseTagAutomatically|tt|small|samp|optgroup|map|kbd|ins|dfn|code|caption|big|area|equiv|image|XhtmlValidator|UnquotedAttribute|TagAttributes|counter|autoCloseUnclosedBeforeTagClosing|autoCloseUnclosedBeforeNewOpening|_decreaseOpenTagCounter||ClosingTag|_tag|Listener|addAttributeTokens|addInTagDeclarationTokens|addTagTokens|addCssTokens|addScriptTokens|addCommentTokens|addTokens|unparsed|_reduce|is_match|current|_decodeSpecial|_|_isSpecialMode|__exit|_isModeEnd|LEXER_MATCHED|_dispatchTokens|_getPerlMatchingFlags|Tk7|Tk6|Tk5|Tk4|Tk3|Tk2|Tk1|_untokenizeRegex|_tokenizeRegex|_getCompoundedRegex|subject|getDefaultAttributesAndEventsForTag|getUniqueAttributesAndEventsForTag|getPossibleTagAttributes|validateAttribute|doesAttributeNeedsValidation|getDefaultAttributesAndEventsForTags|isValidTag|parseInt|possible_attributes|rowgroup|rowspan|headers|colspan|axis|summary|border|box|frame|braille|print|projection|multiple|defer|valuetype|usemap|home|rev|hreflang|datetime|submit|reset|checked|rtl|polygon|poly|circle|rectangle|rect|shape|coords|designates|keyboard|tabindex|accesskey|re|escapeEntities|escapeOnce|escaped|_fixDoubleEscape|cancelSelector|previewSelector|dialogPreviewSelector|sText|textSelector|dialogPasteSelector|append|summarySelector|sCaption|newCaption|captionSelector|TABLE|colsSelector|rowsSelector|dialogTableSelector|dialogLinkSelector|dialogType|uniqueStamp|dialogTypeSelector|SKINS_DEFAULT_JS|initSkin|loadCss|each|appendChild|IMG|configureEditorUsingRawCss|skins||computeJqueryPath|computeWymPath|computeBasePath|INSERT_HTML|sData|now|toggleHtml||encloseString|BASE_PATH|dialogPreviewHtml|dialogPasteHtml|dialogTableHtml|dialogImageHtml|dialogLinkHtml||dialogFeatures|sMessage|statusSelector|STRING|CLASS|insertBefore|TOGGLE_HTML|PASTE|INSERT_TABLE|exec|updateEvent|updateSelector|classSelector|containerSelector|toolSelector|hide|containersItemHtml|containersItems|classesItemHtml|toolsItemHtml|toolsItems|statusHtml|htmlHtml|classesHtml|containersHtml|toolsHtml|logoHtml|WYM_INDEX|wym_dialog_preview|wym_text|wym_dialog_paste|wym_cols|wym_rows|wym_summary|wym_caption|wym_dialog_table|Title|wym_alt|wym_src|URL|wym_dialog_image|wym_href|wym_dialog_link|xhtml1|DTD|org|www|wym_html_val|wym_status|wym_html|wym_box|ToggleHtml|Paste|InsertTable|||InsertImage|CreateLink|Redo|Undo|InsertUnorderedList|InsertOrderedList|Subscript|Superscript|Italic|Bold|IFRAME_DEFAULT|LANG_DEFAULT_PATH|SKINS_DEFAULT_PATH|removeClass|InsertLineBreak|replaceWith|startContainer|getRangeAt|addRange|selectNode|styleWithCSS|character|move|moveToElementText|pasteHTML|addRule|getData|clipboardData|onpaste|onbeforepaste|onbeforedeactivate|className|insertAt|isPhantomString|toUpperCase|end|x7d|x7b|sa|x2e|insertContentBeforeClosingTag|main1|remove_embeded_styles|remove_scripts|remove_comments|extends|9830|diams|9829|hearts|9827|clubs|9824|spades|9674|loz|9002|rang|9001|8971|rfloor||8970|lfloor|8969|rceil|8968|lceil|8901|sdot|8869|perp|8855|otimes|8853|oplus|8839|supe|8838|sube|8836|nsub|8835|8834|8805|8804|8801|8800|8776|asymp|8773|cong|8764|sim|8756|there4|8747|int|8746|cup|8745|cap|8744|8743|and|8736|ang|8734|infin|8733|8730|radic|8727|lowast||8722|minus|8721||sum|8719|prod||8715|8713|notin|8712|isin|8711|nabla|8709|empty|8707|exist|8706|part|8704|forall|8660|hArr|8659|dArr|8658|rArr|8657|uArr|8656|lArr|8629|crarr|8596|harr|8595|darr|8594|rarr|8593|uarr|8592|larr|8501|alefsym|8482|||||||trade|8476|real|8472|weierp|8465|8364|euro|8260|frasl|8254|oline|8250|rsaquo|8249|lsaquo|8243|Prime|8242|prime||8240|permil|8230|hellip|8226|bull|8225|Dagger|8224|dagger|8222|bdquo|8221|rdquo|8220|ldquo|8218|sbquo|8217|rsquo|8216|lsquo|8212|mdash|8211|ndash|8207|rlm|8206|lrm|8205|zwj|8204|zwnj|8201|thinsp|8195|emsp|8194|ensp|982|piv|978|upsih|977|thetasym|969||omega|||968|psi|967|chi|966|phi||965|upsilon|964|tau||963|sigma|962|sigmaf|961|rho|960|959|omicron|958|xi|957|956|955|lambda|954|kappa|953|iota|952|theta|951|eta|950|zeta|949|epsilon|948|delta|947|gamma|946|beta|945|alpha|937|Omega|936|Psi|935|Chi|934|Phi|933|Upsilon|932|Tau|931|Sigma|929|Rho|928|Pi|927|Omicron|926|Xi|925|Nu|924|Mu||923|Lambda|922|Kappa|921|Iota|920|Theta|919|Eta|918|Zeta|917|Epsilon|916|Delta|915|Gamma|914|Beta|913|Alpha|732|tilde|710|402|fnof|376|Yuml|353|scaron|352|Scaron|339|oelig|338|OElig|255|yuml|254|thorn|253|yacute|252|uuml|251|ucirc|250|uacute|249|ugrave|248|oslash|247|divide|246|ouml|245|otilde|244|ocirc|243|oacute|242|ograve|241|ntilde|240|eth|239|iuml|238|icirc|237|iacute|236|igrave|235|euml|234|ecirc|233|eacute|232|egrave|231|ccedil|230|aelig|229|aring|228|auml|227|atilde|226|acirc|225|aacute|agrave|223|szlig|222|THORN|221|Yacute|220|Uuml|219||Ucirc|218|Uacute||217|Ugrave|216|Oslash|215|times|214|Ouml|213|Otilde|212|Ocirc|211|Oacute|210|Ograve|209|Ntilde|208|ETH|207|Iuml|206|Icirc|205|Iacute|204|Igrave|203|Euml|202|Ecirc|201|Eacute|200|Egrave|199|Ccedil|198|AElig|197|Aring|196|Auml|195|Atilde|194|Acirc|193|Aacute|192|Agrave|191|iquest|190|frac34|189|frac12|188|frac14|187||raquo|186|ordm|185|sup1|184|cedil|183|middot|182|para||181|micro|180|acute|179|sup3|178|sup2|177|plusmn|176|deg|175|macr|174|reg|173|shy|172|not|171|laquo|170|ordf|169|copy|168|uml|167|sect|166|brvbar|165|yen|164|curren|163|pound|162|cent|161|iexcl|last_tag_attributes|com|microsoft||schemas|urn|_current_match||_last_match|_matches|boolean|concat|events||continue|groups|none||rules||vsides|rhs|lhs|hsides|below|above|void|cellspacing|cellpadding|aural|handheld|tv|tty|vbs|vbscript|jscript|ecmascript|ref|standby|declare|codetype|codebase|classid|archive|scheme|cookie|set|refresh|expires|speech|radio|password|file|checkbox|maxlength|longdesc|ismap|xmlns|profile|post|method|enctype|nohref|onmouseup|onmouseout|onmouseover|onmousemove|onmousedown|ondblclick|mouse|onkeypress|onkeydown||frameset||onblur|onselect|onreset||onsubmit|onchange|onunload|language|core|charAt|toString|parseAttributes|039|quot|textContent|shift|formated_options|amp|CDATA|cdataSection|contentTag|insertCell|insertRow|createCaption|newCol|opener|wym_skin_|addClass|stopPropagation|ownerDocument|getElementsByTagName|computeCssPath|getTime|Date|toggle|write|replaceChild|removeAttr|removeChild|firstChild|ready|safari|opera|mozilla|msie|wymeditors|Number_Of_Cols|Number_Of_Rows|Summary|Caption|Alternative_Text|dtd|strict|TR|w3|EN||Strict|XHTML|W3C|PUBLIC|DOCTYPE|300|560|resizable|toolbar|titlebar|menubar|wymupdate|iframeSelector|classesSelector|containersSelector|toolsListSelector|toolsSelector|boxSelector|Source_Code|Status|Classes|wym_containers_th|Table_Header|wym_containers_blockquote|Blockquote|wym_containers_pre|Preformatted|wym_containers_h6|Heading_6|wym_containers_h5|Heading_5|wym_containers_h4|Heading_4|wym_containers_h3|Heading_3|wym_containers_h2|Heading_2|wym_containers_h1|Heading_1|wym_containers_p|Paragraph|Containers|wym_tools_preview|wym_tools_html|wym_tools_paste|wym_tools_table|wym_tools_image|wym_tools_unlink|wym_tools_link|wym_tools_redo|wym_tools_undo|wym_tools_outdent|wym_tools_indent|wym_tools_unordered_list|Unordered_List|wym_tools_ordered_list|Ordered_List|wym_tools_subscript|wym_tools_superscript|wym_tools_emphasis|Emphasis|wym_tools_strong|Strong|Tools|parent|wymiframe|wym_wymeditor_link|wym_area_bottom|wym_area_main|wym_area_right|wym_area_left|wym_area_top|TEXT|ATTRIBUTE|ELEMENT|NODE|CURSOR|HOME|END|UNLINK|FormatBlock|InsertHTML|Wym_Dialog_Body|Wym_Dialog_Title|Wym_Status|Wym_Iframe|Wym_Html|Wym_Container_Class|Wym_Containers_Title|Wym_Container_Name|Wym_Containers_Items|Wym_Containers|Wym_Class_Title|Wym_Class_Name|Wym_Classes_Items|Wym_Classes|Wym_Tool_Class|Wym_Tool_Title|Wym_Tool_Name|Wym_Tools_Items|Wym_Tools|Wym_Logo|Wym_Direction|Wym_Jquery_Path|Wym_Iframe_Base_Path|Wym_Wym_Path|Wym_Css_Path|Wym_Base_Path|wym_index|Wym_Index|VERSION'.split('|'),0,{})) |
|   | |||
| 1 | WYMeditor.STRINGS['ca'] = { | ||
| 2 | Strong: 'Ressaltar', | ||
| 3 | Emphasis: 'Emfatitzar', | ||
| 4 | Superscript: 'Superindex', | ||
| 5 | Subscript: 'Subindex', | ||
| 6 | Ordered_List: 'Llistat ordenat', | ||
| 7 | Unordered_List: 'Llistat sense ordenar', | ||
| 8 | Indent: 'Indentat', | ||
| 9 | Outdent: 'Sense indentar', | ||
| 10 | Undo: 'Desfer', | ||
| 11 | Redo: 'Refer', | ||
| 12 | Link: 'Enllaçar', | ||
| 13 | Unlink: 'Eliminar enllaç', | ||
| 14 | Image: 'Imatge', | ||
| 15 | Table: 'Taula', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paràgraf', | ||
| 18 | Heading_1: 'Capçalera 1', | ||
| 19 | Heading_2: 'Capçalera 2', | ||
| 20 | Heading_3: 'Capçalera 3', | ||
| 21 | Heading_4: 'Capçalera 4', | ||
| 22 | Heading_5: 'Capçalera 5', | ||
| 23 | Heading_6: 'Capçalera 6', | ||
| 24 | Preformatted: 'Pre-formatejat', | ||
| 25 | Blockquote: 'Cita', | ||
| 26 | Table_Header: 'Capçalera de la taula', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Títol', | ||
| 29 | Alternative_Text: 'Text alternatiu', | ||
| 30 | Caption: 'Llegenda', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Nombre de files', | ||
| 33 | Number_Of_Cols: 'Nombre de columnes', | ||
| 34 | Submit: 'Enviar', | ||
| 35 | Cancel: 'Cancel·lar', | ||
| 36 | Choose: 'Triar', | ||
| 37 | Preview: 'Vista prèvia', | ||
| 38 | Paste_From_Word: 'Pegar des de Word', | ||
| 39 | Tools: 'Eines', | ||
| 40 | Containers: 'Contenidors', | ||
| 41 | Classes: 'Classes', | ||
| 42 | Status: 'Estat', | ||
| 43 | Source_Code: 'Codi font' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['de'] = { | ||
| 2 | Strong: 'Fett', | ||
| 3 | Emphasis: 'Kursiv', | ||
| 4 | Superscript: 'Text hochstellen', | ||
| 5 | Subscript: 'Text tiefstellen', | ||
| 6 | Ordered_List: 'Geordnete Liste einfügen', | ||
| 7 | Unordered_List: 'Ungeordnete Liste einfügen', | ||
| 8 | Indent: 'Einzug erhöhen', | ||
| 9 | Outdent: 'Einzug vermindern', | ||
| 10 | Undo: 'Befehle rückgängig machen', | ||
| 11 | Redo: 'Befehle wiederherstellen', | ||
| 12 | Link: 'Hyperlink einfügen', | ||
| 13 | Unlink: 'Hyperlink entfernen', | ||
| 14 | Image: 'Bild einfügen', | ||
| 15 | Table: 'Tabelle einfügen', | ||
| 16 | HTML: 'HTML anzeigen/verstecken', | ||
| 17 | Paragraph: 'Absatz', | ||
| 18 | Heading_1: 'Überschrift 1', | ||
| 19 | Heading_2: 'Überschrift 2', | ||
| 20 | Heading_3: 'Überschrift 3', | ||
| 21 | Heading_4: 'Überschrift 4', | ||
| 22 | Heading_5: 'Überschrift 5', | ||
| 23 | Heading_6: 'Überschrift 6', | ||
| 24 | Preformatted: 'Vorformatiert', | ||
| 25 | Blockquote: 'Zitat', | ||
| 26 | Table_Header: 'Tabellenüberschrift', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Titel', | ||
| 29 | Alternative_Text: 'Alternativer Text', | ||
| 30 | Caption: 'Tabellenüberschrift', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Anzahl Zeilen', | ||
| 33 | Number_Of_Cols: 'Anzahl Spalten', | ||
| 34 | Submit: 'Absenden', | ||
| 35 | Cancel: 'Abbrechen', | ||
| 36 | Choose: 'Auswählen', | ||
| 37 | Preview: 'Vorschau', | ||
| 38 | Paste_From_Word: 'Aus Word einfügen', | ||
| 39 | Tools: 'Werkzeuge', | ||
| 40 | Containers: 'Inhaltstyp', | ||
| 41 | Classes: 'Klassen', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Quellcode' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['en'] = { | ||
| 2 | Strong: 'Strong', | ||
| 3 | Emphasis: 'Emphasis', | ||
| 4 | Superscript: 'Superscript', | ||
| 5 | Subscript: 'Subscript', | ||
| 6 | Ordered_List: 'Ordered List', | ||
| 7 | Unordered_List: 'Unordered List', | ||
| 8 | Indent: 'Indent', | ||
| 9 | Outdent: 'Outdent', | ||
| 10 | Undo: 'Undo', | ||
| 11 | Redo: 'Redo', | ||
| 12 | Link: 'Link', | ||
| 13 | Unlink: 'Unlink', | ||
| 14 | Image: 'Image', | ||
| 15 | Table: 'Table', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paragraph', | ||
| 18 | Heading_1: 'Heading 1', | ||
| 19 | Heading_2: 'Heading 2', | ||
| 20 | Heading_3: 'Heading 3', | ||
| 21 | Heading_4: 'Heading 4', | ||
| 22 | Heading_5: 'Heading 5', | ||
| 23 | Heading_6: 'Heading 6', | ||
| 24 | Preformatted: 'Preformatted', | ||
| 25 | Blockquote: 'Blockquote', | ||
| 26 | Table_Header: 'Table Header', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Title', | ||
| 29 | Alternative_Text: 'Alternative text', | ||
| 30 | Caption: 'Caption', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Number of rows', | ||
| 33 | Number_Of_Cols: 'Number of cols', | ||
| 34 | Submit: 'Submit', | ||
| 35 | Cancel: 'Cancel', | ||
| 36 | Choose: 'Choose', | ||
| 37 | Preview: 'Preview', | ||
| 38 | Paste_From_Word: 'Paste from Word', | ||
| 39 | Tools: 'Tools', | ||
| 40 | Containers: 'Format', | ||
| 41 | Classes: 'Classes', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Source code' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['es'] = { | ||
| 2 | Strong: 'Resaltar', | ||
| 3 | Emphasis: 'Enfatizar', | ||
| 4 | Superscript: 'Superindice', | ||
| 5 | Subscript: 'Subindice', | ||
| 6 | Ordered_List: 'Lista ordenada', | ||
| 7 | Unordered_List: 'Lista sin ordenar', | ||
| 8 | Indent: 'Indentado', | ||
| 9 | Outdent: 'Sin indentar', | ||
| 10 | Undo: 'Deshacer', | ||
| 11 | Redo: 'Rehacer', | ||
| 12 | Link: 'Enlazar', | ||
| 13 | Unlink: 'Eliminar enlace', | ||
| 14 | Image: 'Imagen', | ||
| 15 | Table: 'Tabla', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Párrafo', | ||
| 18 | Heading_1: 'Cabecera 1', | ||
| 19 | Heading_2: 'Cabecera 2', | ||
| 20 | Heading_3: 'Cabecera 3', | ||
| 21 | Heading_4: 'Cabecera 4', | ||
| 22 | Heading_5: 'Cabecera 5', | ||
| 23 | Heading_6: 'Cabecera 6', | ||
| 24 | Preformatted: 'Preformateado', | ||
| 25 | Blockquote: 'Cita', | ||
| 26 | Table_Header: 'Cabecera de la tabla', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Título', | ||
| 29 | Alternative_Text: 'Texto alternativo', | ||
| 30 | Caption: 'Leyenda', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Número de filas', | ||
| 33 | Number_Of_Cols: 'Número de columnas', | ||
| 34 | Submit: 'Enviar', | ||
| 35 | Cancel: 'Cancelar', | ||
| 36 | Choose: 'Seleccionar', | ||
| 37 | Preview: 'Vista previa', | ||
| 38 | Paste_From_Word: 'Pegar desde Word', | ||
| 39 | Tools: 'Herramientas', | ||
| 40 | Containers: 'Contenedores', | ||
| 41 | Classes: 'Clases', | ||
| 42 | Status: 'Estado', | ||
| 43 | Source_Code: 'Código fuente' | ||
| 44 | }; |
|   | |||
| 1 | //Translation To Persian: Ghassem Tofighi (http://ght.ir) | ||
| 2 | WYMeditor.STRINGS['fa'] = { | ||
| 3 | Strong: 'پررنگ',//Strong | ||
| 4 | Emphasis: 'ایتالیک',//Emphasis | ||
| 5 | Superscript: 'بالانويس ',//Superscript | ||
| 6 | Subscript: 'زيرنويس',//Subscript | ||
| 7 | Ordered_List: 'لیست مرتب',//Ordered List | ||
| 8 | Unordered_List: 'لیست نامرتب',//Unordered List | ||
| 9 | Indent: 'افزودن دندانه',//Indent | ||
| 10 | Outdent: 'کاهش دندانه',//Outdent | ||
| 11 | Undo: 'واگردانی',//Undo | ||
| 12 | Redo: 'تکرار',//Redo | ||
| 13 | Link: 'ساختن پیوند',//Link | ||
| 14 | Unlink: 'برداشتن پیوند',//Unlink | ||
| 15 | Image: 'تصویر',//Image | ||
| 16 | Table: 'جدول',//Table | ||
| 17 | HTML: 'HTML',//HTML | ||
| 18 | Paragraph: 'پاراگراف',//Paragraph | ||
| 19 | Heading_1: 'سرتیتر ۱',//Heading 1 | ||
| 20 | Heading_2: 'سرتیتر ۲',//Heading 2 | ||
| 21 | Heading_3: 'سرتیتر ۳',//Heading 3 | ||
| 22 | Heading_4: 'سرتیتر ۴',//Heading 4 | ||
| 23 | Heading_5: 'سرتیتر ۵',//Heading 5 | ||
| 24 | Heading_6: 'سرتیتر ۶',//Heading 6 | ||
| 25 | Preformatted: 'قالب آماده',//Preformatted | ||
| 26 | Blockquote: 'نقل قول',//Blockquote | ||
| 27 | Table_Header: 'سرجدول',//Table Header | ||
| 28 | URL: 'آدرس اینترنتی',//URL | ||
| 29 | Title: 'عنوان',//Title | ||
| 30 | Alternative_Text: 'متن جایگزین',//Alternative text | ||
| 31 | Caption: 'عنوان',//Caption | ||
| 32 | Summary: 'Summary', | ||
| 33 | Number_Of_Rows: 'تعداد سطرها',//Number of rows | ||
| 34 | Number_Of_Cols: 'تعداد ستونها',//Number of cols | ||
| 35 | Submit: 'فرستادن',//Submit | ||
| 36 | Cancel: 'لغو',//Cancel | ||
| 37 | Choose: 'انتخاب',//Choose | ||
| 38 | Preview: 'پیشنمایش',//Preview | ||
| 39 | Paste_From_Word: 'انتقال از ورد',//Paste from Word | ||
| 40 | Tools: 'ابزار',//Tools | ||
| 41 | Containers: 'قالبها',//Containers | ||
| 42 | Classes: 'کلاسها',//Classes | ||
| 43 | Status: 'وضعیت',//Status | ||
| 44 | Source_Code: 'کد مبدأ'//Source code | ||
| 45 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['fr'] = { | ||
| 2 | Strong: 'Mise en évidence', | ||
| 3 | Emphasis: 'Emphase', | ||
| 4 | Superscript: 'Exposant', | ||
| 5 | Subscript: 'Indice', | ||
| 6 | Ordered_List: 'Liste Ordonnée', | ||
| 7 | Unordered_List: 'Liste Non-Ordonnée', | ||
| 8 | Indent: 'Imbriqué', | ||
| 9 | Outdent: 'Non-imbriqué', | ||
| 10 | Undo: 'Annuler', | ||
| 11 | Redo: 'Rétablir', | ||
| 12 | Link: 'Lien', | ||
| 13 | Unlink: 'Supprimer le Lien', | ||
| 14 | Image: 'Image', | ||
| 15 | Table: 'Tableau', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paragraphe', | ||
| 18 | Heading_1: 'Titre 1', | ||
| 19 | Heading_2: 'Titre 2', | ||
| 20 | Heading_3: 'Titre 3', | ||
| 21 | Heading_4: 'Titre 4', | ||
| 22 | Heading_5: 'Titre 5', | ||
| 23 | Heading_6: 'Titre 6', | ||
| 24 | Preformatted: 'Pré-formatté', | ||
| 25 | Blockquote: 'Citation', | ||
| 26 | Table_Header: 'Cellule de titre', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Titre', | ||
| 29 | Alternative_Text: 'Texte alternatif', | ||
| 30 | Caption: 'Légende', | ||
| 31 | Summary: 'Résumé', | ||
| 32 | Number_Of_Rows: 'Nombre de lignes', | ||
| 33 | Number_Of_Cols: 'Nombre de colonnes', | ||
| 34 | Submit: 'Envoyer', | ||
| 35 | Cancel: 'Annuler', | ||
| 36 | Choose: 'Choisir', | ||
| 37 | Preview: 'Prévisualisation', | ||
| 38 | Paste_From_Word: 'Copier depuis Word', | ||
| 39 | Tools: 'Outils', | ||
| 40 | Containers: 'Type de texte', | ||
| 41 | Classes: 'Type de contenu', | ||
| 42 | Status: 'Infos', | ||
| 43 | Source_Code: 'Code source' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['he'] = { | ||
| 2 | Strong: 'חזק', | ||
| 3 | Emphasis: 'מובלט', | ||
| 4 | Superscript: 'כתב עילי', | ||
| 5 | Subscript: 'כתב תחתי', | ||
| 6 | Ordered_List: 'רשימה ממוספרת', | ||
| 7 | Unordered_List: 'רשימה לא ממוספרת', | ||
| 8 | Indent: 'הזחה פנימה', | ||
| 9 | Outdent: 'הזחה החוצה', | ||
| 10 | Undo: 'בטל פעולה', | ||
| 11 | Redo: 'בצע מחדש פעולה', | ||
| 12 | Link: 'קישור', | ||
| 13 | Unlink: 'בטל קישור', | ||
| 14 | Image: 'תמונה', | ||
| 15 | Table: 'טבלה', | ||
| 16 | HTML: 'קוד HTML', | ||
| 17 | Paragraph: 'פסקה', | ||
| 18 | Heading_1: 'כותרת 1 ; תג <h1>', | ||
| 19 | Heading_2: 'כותרת 2 ; תג <h2>', | ||
| 20 | Heading_3: 'כותרת 3 ; תג <h3>', | ||
| 21 | Heading_4: 'כותרת 4 ; תג <h4>', | ||
| 22 | Heading_5: 'כותרת 5 ; תג <h5>', | ||
| 23 | Heading_6: 'כותרת 6 ; תג <h6>', | ||
| 24 | Preformatted: 'משמר רווחים', | ||
| 25 | Blockquote: 'ציטוט', | ||
| 26 | Table_Header: 'כותרת טבלה', | ||
| 27 | URL: 'קישור (URL)', | ||
| 28 | Title: 'כותרת', | ||
| 29 | Alternative_Text: 'טקסט חלופי', | ||
| 30 | Caption: 'כותרת', | ||
| 31 | Summary: 'סיכום', | ||
| 32 | Number_Of_Rows: 'מספר שורות', | ||
| 33 | Number_Of_Cols: 'מספר טורים', | ||
| 34 | Submit: 'שלח', | ||
| 35 | Cancel: 'בטל', | ||
| 36 | Choose: 'בחר', | ||
| 37 | Preview: 'תצוגה מקדימה', | ||
| 38 | Paste_From_Word: 'העתק מ-Word', | ||
| 39 | Tools: 'כלים', | ||
| 40 | Containers: 'מיכלים', | ||
| 41 | Classes: 'מחלקות', | ||
| 42 | Status: 'מצב', | ||
| 43 | Source_Code: 'קוד מקור' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['hu'] = { | ||
| 2 | Strong: 'Félkövér', | ||
| 3 | Emphasis: 'Kiemelt', | ||
| 4 | Superscript: 'Felső index', | ||
| 5 | Subscript: 'Alsó index', | ||
| 6 | Ordered_List: 'Rendezett lista', | ||
| 7 | Unordered_List: 'Rendezetlen lista', | ||
| 8 | Indent: 'Bekezdés', | ||
| 9 | Outdent: 'Bekezdés törlése', | ||
| 10 | Undo: 'Visszavon', | ||
| 11 | Redo: 'Visszaállít', | ||
| 12 | Link: 'Link', | ||
| 13 | Unlink: 'Link törlése', | ||
| 14 | Image: 'Kép', | ||
| 15 | Table: 'Tábla', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Bekezdés', | ||
| 18 | Heading_1: 'Címsor 1', | ||
| 19 | Heading_2: 'Címsor 2', | ||
| 20 | Heading_3: 'Címsor 3', | ||
| 21 | Heading_4: 'Címsor 4', | ||
| 22 | Heading_5: 'Címsor 5', | ||
| 23 | Heading_6: 'Címsor 6', | ||
| 24 | Preformatted: 'Előformázott', | ||
| 25 | Blockquote: 'Idézet', | ||
| 26 | Table_Header: 'Tábla Fejléc', | ||
| 27 | URL: 'Webcím', | ||
| 28 | Title: 'Megnevezés', | ||
| 29 | Alternative_Text: 'Alternatív szöveg', | ||
| 30 | Caption: 'Fejléc', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Sorok száma', | ||
| 33 | Number_Of_Cols: 'Oszlopok száma', | ||
| 34 | Submit: 'Elküld', | ||
| 35 | Cancel: 'Mégsem', | ||
| 36 | Choose: 'Választ', | ||
| 37 | Preview: 'Előnézet', | ||
| 38 | Paste_From_Word: 'Másolás Word-ból', | ||
| 39 | Tools: 'Eszközök', | ||
| 40 | Containers: 'Tartalmak', | ||
| 41 | Classes: 'Osztályok', | ||
| 42 | Status: 'Állapot', | ||
| 43 | Source_Code: 'Forráskód' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['it'] = { | ||
| 2 | Strong: 'Grassetto', | ||
| 3 | Emphasis: 'Corsetto', | ||
| 4 | Superscript: 'Apice', | ||
| 5 | Subscript: 'Pedice', | ||
| 6 | Ordered_List: 'Lista Ordinata', | ||
| 7 | Unordered_List: 'Lista Puntata', | ||
| 8 | Indent: 'Indenta', | ||
| 9 | Outdent: 'Caccia', | ||
| 10 | Undo: 'Indietro', | ||
| 11 | Redo: 'Avanti', | ||
| 12 | Link: 'Inserisci Link', | ||
| 13 | Unlink: 'Togli Link', | ||
| 14 | Image: 'Inserisci Immagine', | ||
| 15 | Table: 'Inserisci Tabella', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paragrafo', | ||
| 18 | Heading_1: 'Heading 1', | ||
| 19 | Heading_2: 'Heading 2', | ||
| 20 | Heading_3: 'Heading 3', | ||
| 21 | Heading_4: 'Heading 4', | ||
| 22 | Heading_5: 'Heading 5', | ||
| 23 | Heading_6: 'Heading 6', | ||
| 24 | Preformatted: 'Preformattato', | ||
| 25 | Blockquote: 'Blockquote', | ||
| 26 | Table_Header: 'Header Tabella', | ||
| 27 | URL: 'Indirizzo', | ||
| 28 | Title: 'Titolo', | ||
| 29 | Alternative_Text: 'Testo Alternativo', | ||
| 30 | Caption: 'Caption', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Numero di Righe', | ||
| 33 | Number_Of_Cols: 'Numero di Colonne', | ||
| 34 | Submit: 'Invia', | ||
| 35 | Cancel: 'Cancella', | ||
| 36 | Choose: 'Scegli', | ||
| 37 | Preview: 'Anteprima', | ||
| 38 | Paste_From_Word: 'Incolla', | ||
| 39 | Tools: 'Tools', | ||
| 40 | Containers: 'Contenitori', | ||
| 41 | Classes: 'Classi', | ||
| 42 | Status: 'Stato', | ||
| 43 | Source_Code: 'Codice Sorgente' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['nb'] = { | ||
| 2 | Strong: 'Fet', | ||
| 3 | Emphasis: 'Uthevet', | ||
| 4 | Superscript: 'Opphøyet', | ||
| 5 | Subscript: 'Nedsenket', | ||
| 6 | Ordered_List: 'Nummerert liste', | ||
| 7 | Unordered_List: 'Punktliste', | ||
| 8 | Indent: 'Rykk inn', | ||
| 9 | Outdent: 'Rykk ut', | ||
| 10 | Undo: 'Angre', | ||
| 11 | Redo: 'Gjenta', | ||
| 12 | Link: 'Lenke', | ||
| 13 | Unlink: 'Ta bort lenken', | ||
| 14 | Image: 'Bilde', | ||
| 15 | Table: 'Tabell', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Avsnitt', | ||
| 18 | Heading_1: 'Overskrift 1', | ||
| 19 | Heading_2: 'Overskrift 2', | ||
| 20 | Heading_3: 'Overskrift 3', | ||
| 21 | Heading_4: 'Overskrift 4', | ||
| 22 | Heading_5: 'Overskrift 5', | ||
| 23 | Heading_6: 'Overskrift 6', | ||
| 24 | Preformatted: 'Preformatert', | ||
| 25 | Blockquote: 'Sitat', | ||
| 26 | Table_Header: 'Tabelloverskrift', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Tittel', | ||
| 29 | Alternative_Text: 'Alternativ tekst', | ||
| 30 | Caption: 'Overskrift', | ||
| 31 | Summary: 'Sammendrag', | ||
| 32 | Number_Of_Rows: 'Antall rader', | ||
| 33 | Number_Of_Cols: 'Antall kolonner', | ||
| 34 | Submit: 'Ok', | ||
| 35 | Cancel: 'Avbryt', | ||
| 36 | Choose: 'Velg', | ||
| 37 | Preview: 'Forhåndsvis', | ||
| 38 | Paste_From_Word: 'Lim inn fra Word', | ||
| 39 | Tools: 'Verktøy', | ||
| 40 | Containers: 'Formatering', | ||
| 41 | Classes: 'Klasser', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Kildekode' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['nl'] = { | ||
| 2 | Strong: 'Sterk benadrukken', | ||
| 3 | Emphasis: 'Benadrukken', | ||
| 4 | Superscript: 'Bovenschrift', | ||
| 5 | Subscript: 'Onderschrift', | ||
| 6 | Ordered_List: 'Geordende lijst', | ||
| 7 | Unordered_List: 'Ongeordende lijst', | ||
| 8 | Indent: 'Inspringen', | ||
| 9 | Outdent: 'Terugspringen', | ||
| 10 | Undo: 'Ongedaan maken', | ||
| 11 | Redo: 'Opnieuw uitvoeren', | ||
| 12 | Link: 'Linken', | ||
| 13 | Unlink: 'Ontlinken', | ||
| 14 | Image: 'Afbeelding', | ||
| 15 | Table: 'Tabel', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paragraaf', | ||
| 18 | Heading_1: 'Kop 1', | ||
| 19 | Heading_2: 'Kop 2', | ||
| 20 | Heading_3: 'Kop 3', | ||
| 21 | Heading_4: 'Kop 4', | ||
| 22 | Heading_5: 'Kop 5', | ||
| 23 | Heading_6: 'Kop 6', | ||
| 24 | Preformatted: 'Voorgeformatteerd', | ||
| 25 | Blockquote: 'Citaat', | ||
| 26 | Table_Header: 'Tabel-kop', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Titel', | ||
| 29 | Alternative_Text: 'Alternatieve tekst', | ||
| 30 | Caption: 'Bijschrift', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Aantal rijen', | ||
| 33 | Number_Of_Cols: 'Aantal kolommen', | ||
| 34 | Submit: 'Versturen', | ||
| 35 | Cancel: 'Annuleren', | ||
| 36 | Choose: 'Kiezen', | ||
| 37 | Preview: 'Voorbeeld bekijken', | ||
| 38 | Paste_From_Word: 'Plakken uit Word', | ||
| 39 | Tools: 'Hulpmiddelen', | ||
| 40 | Containers: 'Teksttypes', | ||
| 41 | Classes: 'Klassen', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Broncode' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['nn'] = { | ||
| 2 | Strong: 'Feit', | ||
| 3 | Emphasis: 'Utheva', | ||
| 4 | Superscript: 'Opphøgd', | ||
| 5 | Subscript: 'Nedsenka', | ||
| 6 | Ordered_List: 'Nummerert liste', | ||
| 7 | Unordered_List: 'Punktliste', | ||
| 8 | Indent: 'Rykk inn', | ||
| 9 | Outdent: 'Rykk ut', | ||
| 10 | Undo: 'Angre', | ||
| 11 | Redo: 'Gjentaka', | ||
| 12 | Link: 'Lenkje', | ||
| 13 | Unlink: 'Ta bort lenkja', | ||
| 14 | Image: 'Bilete', | ||
| 15 | Table: 'Tabell', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Avsnitt', | ||
| 18 | Heading_1: 'Overskrift 1', | ||
| 19 | Heading_2: 'Overskrift 2', | ||
| 20 | Heading_3: 'Overskrift 3', | ||
| 21 | Heading_4: 'Overskrift 4', | ||
| 22 | Heading_5: 'Overskrift 5', | ||
| 23 | Heading_6: 'Overskrift 6', | ||
| 24 | Preformatted: 'Preformatert', | ||
| 25 | Blockquote: 'Sitat', | ||
| 26 | Table_Header: 'Tabelloverskrift', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Tittel', | ||
| 29 | Alternative_Text: 'Alternativ tekst', | ||
| 30 | Caption: 'Overskrift', | ||
| 31 | Summary: 'Samandrag', | ||
| 32 | Number_Of_Rows: 'Tal på rader', | ||
| 33 | Number_Of_Cols: 'Tal på kolonnar', | ||
| 34 | Submit: 'Ok', | ||
| 35 | Cancel: 'Avbryt', | ||
| 36 | Choose: 'Vel', | ||
| 37 | Preview: 'Førehandsvis', | ||
| 38 | Paste_From_Word: 'Lim inn frå Word', | ||
| 39 | Tools: 'Verkty', | ||
| 40 | Containers: 'Formatering', | ||
| 41 | Classes: 'Klassar', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Kjeldekode' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['pl'] = { | ||
| 2 | Strong: 'Nacisk', | ||
| 3 | Emphasis: 'Emfaza', | ||
| 4 | Superscript: 'Indeks górny', | ||
| 5 | Subscript: 'Indeks dolny', | ||
| 6 | Ordered_List: 'Lista numerowana', | ||
| 7 | Unordered_List: 'Lista wypunktowana', | ||
| 8 | Indent: 'Zwiększ wcięcie', | ||
| 9 | Outdent: 'Zmniejsz wcięcie', | ||
| 10 | Undo: 'Cofnij', | ||
| 11 | Redo: 'Ponów', | ||
| 12 | Link: 'Wstaw link', | ||
| 13 | Unlink: 'Usuń link', | ||
| 14 | Image: 'Obraz', | ||
| 15 | Table: 'Tabela', | ||
| 16 | HTML: 'Źródło HTML', | ||
| 17 | Paragraph: 'Akapit', | ||
| 18 | Heading_1: 'Nagłówek 1', | ||
| 19 | Heading_2: 'Nagłówek 2', | ||
| 20 | Heading_3: 'Nagłówek 3', | ||
| 21 | Heading_4: 'Nagłówek 4', | ||
| 22 | Heading_5: 'Nagłówek 5', | ||
| 23 | Heading_6: 'Nagłówek 6', | ||
| 24 | Preformatted: 'Preformatowany', | ||
| 25 | Blockquote: 'Cytat blokowy', | ||
| 26 | Table_Header: 'Nagłówek tabeli', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Tytuł', | ||
| 29 | Alternative_Text: 'Tekst alternatywny', | ||
| 30 | Caption: 'Tytuł tabeli', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Liczba wierszy', | ||
| 33 | Number_Of_Cols: 'Liczba kolumn', | ||
| 34 | Submit: 'Wyślij', | ||
| 35 | Cancel: 'Anuluj', | ||
| 36 | Choose: 'Wybierz', | ||
| 37 | Preview: 'Podgląd', | ||
| 38 | Paste_From_Word: 'Wklej z Worda', | ||
| 39 | Tools: 'Narzędzia', | ||
| 40 | Containers: 'Format', | ||
| 41 | Classes: 'Styl', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Kod źródłowy' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['pt-br'] = { | ||
| 2 | Strong: 'Resaltar', | ||
| 3 | Emphasis: 'Enfatizar', | ||
| 4 | Superscript: 'Sobre escrito', | ||
| 5 | Subscript: 'Sub escrito ', | ||
| 6 | Ordered_List: 'Lista ordenada', | ||
| 7 | Unordered_List: 'Lista desordenada', | ||
| 8 | Indent: 'Indentado', | ||
| 9 | Outdent: 'Desidentar', | ||
| 10 | Undo: 'Desfazer', | ||
| 11 | Redo: 'Refazer', | ||
| 12 | Link: 'Link', | ||
| 13 | Unlink: 'Remover Link', | ||
| 14 | Image: 'Imagem', | ||
| 15 | Table: 'Tabela', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Parágrafo', | ||
| 18 | Heading_1: 'Título 1', | ||
| 19 | Heading_2: 'Título 2', | ||
| 20 | Heading_3: 'Título 3', | ||
| 21 | Heading_4: 'Título 4', | ||
| 22 | Heading_5: 'Título 5', | ||
| 23 | Heading_6: 'Título 6', | ||
| 24 | Preformatted: 'Preformatado', | ||
| 25 | Blockquote: 'Citação', | ||
| 26 | Table_Header: 'Título de tabela', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Título', | ||
| 29 | Alternative_Text: 'Texto alternativo', | ||
| 30 | Caption: 'Legenda', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Número de linhas', | ||
| 33 | Number_Of_Cols: 'Número de colunas', | ||
| 34 | Submit: 'Enviar', | ||
| 35 | Cancel: 'Cancelar', | ||
| 36 | Choose: 'Selecionar', | ||
| 37 | Preview: 'Previsualizar', | ||
| 38 | Paste_From_Word: 'Copiar do Word', | ||
| 39 | Tools: 'Ferramentas', | ||
| 40 | Containers: 'Conteneiners', | ||
| 41 | Classes: 'Classes', | ||
| 42 | Status: 'Estado', | ||
| 43 | Source_Code: 'Código fonte' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['pt'] = { | ||
| 2 | Strong: 'Negrito', | ||
| 3 | Emphasis: 'Itálico', | ||
| 4 | Superscript: 'Sobrescrito', | ||
| 5 | Subscript: 'Subsescrito', | ||
| 6 | Ordered_List: 'Lista Numerada', | ||
| 7 | Unordered_List: 'Lista Marcada', | ||
| 8 | Indent: 'Aumentar Indentaçã', | ||
| 9 | Outdent: 'Diminuir Indentaçã', | ||
| 10 | Undo: 'Desfazer', | ||
| 11 | Redo: 'Restaurar', | ||
| 12 | Link: 'Link', | ||
| 13 | Unlink: 'Tirar link', | ||
| 14 | Image: 'Imagem', | ||
| 15 | Table: 'Tabela', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Parágrafo', | ||
| 18 | Heading_1: 'Título 1', | ||
| 19 | Heading_2: 'Título 2', | ||
| 20 | Heading_3: 'Título 3', | ||
| 21 | Heading_4: 'Título 4', | ||
| 22 | Heading_5: 'Título 5', | ||
| 23 | Heading_6: 'Título 6', | ||
| 24 | Preformatted: 'Pré-formatado', | ||
| 25 | Blockquote: 'Citação', | ||
| 26 | Table_Header: 'Cabeçalho Tabela', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Título', | ||
| 29 | Alternative_Text: 'Texto Alterativo', | ||
| 30 | Caption: 'Título Tabela', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Número de Linhas', | ||
| 33 | Number_Of_Cols: 'Número de Colunas', | ||
| 34 | Submit: 'Enviar', | ||
| 35 | Cancel: 'Cancelar', | ||
| 36 | Choose: 'Escolha', | ||
| 37 | Preview: 'Prever', | ||
| 38 | Paste_From_Word: 'Colar do Word', | ||
| 39 | Tools: 'Ferramentas', | ||
| 40 | Containers: 'Containers', | ||
| 41 | Classes: 'Classes', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Código Fonte' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['ru'] = { | ||
| 2 | Strong: 'Жирный', | ||
| 3 | Emphasis: 'Наклонный', | ||
| 4 | Superscript: 'Надстрочный', | ||
| 5 | Subscript: 'Подстрочный', | ||
| 6 | Ordered_List: 'Нумерованый список', | ||
| 7 | Unordered_List: 'Ненумерованый список', | ||
| 8 | Indent: 'Увеличить отступ', | ||
| 9 | Outdent: 'Уменьшить отступ', | ||
| 10 | Undo: 'Отменить', | ||
| 11 | Redo: 'Повторить', | ||
| 12 | Link: 'Ссылка', | ||
| 13 | Unlink: 'Удалить ссылку', | ||
| 14 | Image: 'Изображение', | ||
| 15 | Table: 'Таблица', | ||
| 16 | HTML: 'Править HTML', | ||
| 17 | Paragraph: 'Параграф', | ||
| 18 | Heading_1: 'Заголовок 1', | ||
| 19 | Heading_2: 'Заголовок 2', | ||
| 20 | Heading_3: 'Заголовок 3', | ||
| 21 | Heading_4: 'Заголовок 4', | ||
| 22 | Heading_5: 'Заголовок 5', | ||
| 23 | Heading_6: 'Заголовок 6', | ||
| 24 | Preformatted: 'Preformatted', | ||
| 25 | Blockquote: 'Цитата', | ||
| 26 | Table_Header: 'Заголовок таблицы', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Заголовок', | ||
| 29 | Alternative_Text: 'Альтернативный текст', | ||
| 30 | Caption: 'Надпись', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Кол-во строк', | ||
| 33 | Number_Of_Cols: 'Кол-во столбцов', | ||
| 34 | Submit: 'Отправить', | ||
| 35 | Cancel: 'Отмена', | ||
| 36 | Choose: 'Выбор', | ||
| 37 | Preview: 'Просмотр', | ||
| 38 | Paste_From_Word: 'Вставить из Word', | ||
| 39 | Tools: 'Инструменты', | ||
| 40 | Containers: 'Контейнеры', | ||
| 41 | Classes: 'Классы', | ||
| 42 | Status: 'Статус', | ||
| 43 | Source_Code: 'Исходный код' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['sv'] = { | ||
| 2 | Strong: 'Viktigt', | ||
| 3 | Emphasis: 'Betoning', | ||
| 4 | Superscript: 'Upphöjt', | ||
| 5 | Subscript: 'Nedsänkt', | ||
| 6 | Ordered_List: 'Nummerlista', | ||
| 7 | Unordered_List: 'Punktlista', | ||
| 8 | Indent: 'Indrag', | ||
| 9 | Outdent: 'Utdrag', | ||
| 10 | Undo: 'Ångra', | ||
| 11 | Redo: 'Gör om', | ||
| 12 | Link: 'Länk', | ||
| 13 | Unlink: 'Ta bort länk', | ||
| 14 | Image: 'Bild', | ||
| 15 | Table: 'Tabell', | ||
| 16 | HTML: 'HTML', | ||
| 17 | Paragraph: 'Paragraf', | ||
| 18 | Heading_1: 'Rubrik 1', | ||
| 19 | Heading_2: 'Rubrik 2', | ||
| 20 | Heading_3: 'Rubrik 3', | ||
| 21 | Heading_4: 'Rubrik 4', | ||
| 22 | Heading_5: 'Rubrik 5', | ||
| 23 | Heading_6: 'Rubrik 6', | ||
| 24 | Preformatted: 'Förformaterad', | ||
| 25 | Blockquote: 'Blockcitat', | ||
| 26 | Table_Header: 'Tabellrubrik', | ||
| 27 | URL: 'URL', | ||
| 28 | Title: 'Titel', | ||
| 29 | Alternative_Text: 'Alternativ text', | ||
| 30 | Caption: 'Överskrift', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: 'Antal rader', | ||
| 33 | Number_Of_Cols: 'Antal kolumner', | ||
| 34 | Submit: 'Skicka', | ||
| 35 | Cancel: 'Avbryt', | ||
| 36 | Choose: 'Välj', | ||
| 37 | Preview: 'Förhandsgranska', | ||
| 38 | Paste_From_Word: 'Klistra in från Word', | ||
| 39 | Tools: 'Verktyg', | ||
| 40 | Containers: 'Formatering', | ||
| 41 | Classes: 'Klasser', | ||
| 42 | Status: 'Status', | ||
| 43 | Source_Code: 'Källkod' | ||
| 44 | }; |
|   | |||
| 1 | WYMeditor.STRINGS['zh_cn'] = { | ||
| 2 | Strong: '加粗', | ||
| 3 | Emphasis: '斜体', | ||
| 4 | Superscript: '上标', | ||
| 5 | Subscript: '下标', | ||
| 6 | Ordered_List: '有序列表', | ||
| 7 | Unordered_List: '无序列表', | ||
| 8 | Indent: '增加缩进', | ||
| 9 | Outdent: '减少缩进', | ||
| 10 | Undo: '撤消', | ||
| 11 | Redo: '重做', | ||
| 12 | Link: '链接', | ||
| 13 | Unlink: '取消链接', | ||
| 14 | Image: '图片', | ||
| 15 | Table: '表格', | ||
| 16 | HTML: 'HTML源代码', | ||
| 17 | Paragraph: '段落', | ||
| 18 | Heading_1: '标题 1', | ||
| 19 | Heading_2: '标题 2', | ||
| 20 | Heading_3: '标题 3', | ||
| 21 | Heading_4: '标题 4', | ||
| 22 | Heading_5: '标题 5', | ||
| 23 | Heading_6: '标题 6', | ||
| 24 | Preformatted: '原始文本', | ||
| 25 | Blockquote: '引语', | ||
| 26 | Table_Header: '表头', | ||
| 27 | URL: '地址', | ||
| 28 | Title: '提示文字', | ||
| 29 | Alternative_Text: '失效文字', | ||
| 30 | Caption: '标题', | ||
| 31 | Summary: 'Summary', | ||
| 32 | Number_Of_Rows: '行数', | ||
| 33 | Number_Of_Cols: '列数', | ||
| 34 | Submit: '提交', | ||
| 35 | Cancel: '放弃', | ||
| 36 | Choose: '选择', | ||
| 37 | Preview: '预览', | ||
| 38 | Paste_From_Word: '从Word粘贴纯文本', | ||
| 39 | Tools: '工具', | ||
| 40 | Containers: '容器', | ||
| 41 | Classes: '预定义样式', | ||
| 42 | Status: '状态', | ||
| 43 | Source_Code: '源代码', | ||
| 44 | Attachment: '附件', | ||
| 45 | NewParagraph: '新段落' | ||
| 46 | }; |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * jquery.wymeditor.hovertools.js | ||
| 12 | * hovertools plugin for WYMeditor | ||
| 13 | * | ||
| 14 | * File Authors: | ||
| 15 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 16 | */ | ||
| 17 | |||
| 18 | //Extend WYMeditor | ||
| 19 | WYMeditor.editor.prototype.hovertools = function() { | ||
| 20 | |||
| 21 | var wym = this; | ||
| 22 | |||
| 23 | //bind events on buttons | ||
| 24 | jQuery(this._box).find(this._options.toolSelector).hover( | ||
| 25 | function() { | ||
| 26 | wym.status(jQuery(this).html()); | ||
| 27 | }, | ||
| 28 | function() { | ||
| 29 | wym.status(' '); | ||
| 30 | } | ||
| 31 | ); | ||
| 32 | |||
| 33 | //classes: add/remove a style attr to matching elems | ||
| 34 | //while mouseover/mouseout | ||
| 35 | jQuery(this._box).find(this._options.classSelector).hover( | ||
| 36 | function() { | ||
| 37 | var aClasses = eval(wym._options.classesItems); | ||
| 38 | var sName = jQuery(this).attr(WYMeditor.NAME); | ||
| 39 | var oClass = WYMeditor.Helper.findByName(aClasses, sName); | ||
| 40 | |||
| 41 | if(oClass){ | ||
| 42 | jqexpr = oClass.expr; | ||
| 43 | //don't use jQuery.find() on the iframe body | ||
| 44 | //because of MSIE + jQuery + expando issue (#JQ1143) | ||
| 45 | if(!jQuery.browser.msie) | ||
| 46 | jQuery(wym._doc).find(jqexpr).css('background-color','#cfc'); | ||
| 47 | } | ||
| 48 | }, | ||
| 49 | function() { | ||
| 50 | //don't use jQuery.find() on the iframe body | ||
| 51 | //because of MSIE + jQuery + expando issue (#JQ1143) | ||
| 52 | if(!jQuery.browser.msie) | ||
| 53 | jQuery(wym._doc).find('*').removeAttr('style'); | ||
| 54 | } | ||
| 55 | ); | ||
| 56 | |||
| 57 | }; |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * jquery.wymeditor.resizable.js | ||
| 12 | * resize plugin for WYMeditor | ||
| 13 | * | ||
| 14 | * File Authors: | ||
| 15 | * Peter Eschler (peschler _at_ gmail.com) | ||
| 16 | * | ||
| 17 | * Version: | ||
| 18 | * 0.3 | ||
| 19 | * | ||
| 20 | * Changelog: | ||
| 21 | * | ||
| 22 | * 0.3 | ||
| 23 | * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh). | ||
| 24 | * | ||
| 25 | * 0.2 | ||
| 26 | * - Added full support for all jQueryUI resizable plugin options. | ||
| 27 | * - Refactored and documented code. | ||
| 28 | * 0.1 | ||
| 29 | * - Initial release. | ||
| 30 | */ | ||
| 31 | |||
| 32 | /** | ||
| 33 | * The resizable plugin makes the wymeditor box vertically resizable. | ||
| 34 | * It it based on the ui.resizable.js plugin of the jQuery UI library. | ||
| 35 | * | ||
| 36 | * The WYMeditor resizable plugin supports all parameters of the jQueryUI | ||
| 37 | * resizable plugin. The parameters are passed like this: | ||
| 38 | * | ||
| 39 | * wym.resizable({ handles: "s,e", | ||
| 40 | * maxHeight: 600 }); | ||
| 41 | * | ||
| 42 | * @param options options for the plugin | ||
| 43 | */ | ||
| 44 | WYMeditor.editor.prototype.resizable = function(options) { | ||
| 45 | |||
| 46 | var wym = this; | ||
| 47 | var iframe = jQuery(wym._box).find('iframe'); | ||
| 48 | var iframeOriginalSize = {}; | ||
| 49 | |||
| 50 | // Define some default options | ||
| 51 | var default_options = { | ||
| 52 | start: function(e, ui) { | ||
| 53 | iframeOriginalSize = { | ||
| 54 | width: jQuery(iframe).width(), | ||
| 55 | height: jQuery(iframe).height() | ||
| 56 | } | ||
| 57 | }, | ||
| 58 | |||
| 59 | // resize is called by the jQuery resizable plugin whenever the | ||
| 60 | // client area was resized. | ||
| 61 | resize: function(e, ui) { | ||
| 62 | var diff = ui.size.height - ui.originalSize.height; | ||
| 63 | jQuery(iframe).height( iframeOriginalSize.height + diff ); | ||
| 64 | |||
| 65 | // If the plugin has horizontal resizing disabled we need to | ||
| 66 | // adjust the "width" attribute of the area css, because the | ||
| 67 | // resizing will set a fixed width (which breaks liquid layout | ||
| 68 | // of the wymeditor area). | ||
| 69 | if( !ui.options.handles['w'] && !ui.options.handles['e'] ) { | ||
| 70 | ui.size.width = "inherit"; | ||
| 71 | } | ||
| 72 | }, | ||
| 73 | handles: "s,e,se", | ||
| 74 | minHeight: 250, | ||
| 75 | maxHeight: 600 | ||
| 76 | }; | ||
| 77 | |||
| 78 | // Merge given options with default options. Given options override | ||
| 79 | // default ones. | ||
| 80 | var final_options = jQuery.extend(default_options, options); | ||
| 81 | |||
| 82 | // Get the jQuery path from the editor, stripping away the jQuery file. | ||
| 83 | // see http://www.oreilly.com/catalog/regex/chapter/ch04.html | ||
| 84 | // The match result array contains the path and the filename. | ||
| 85 | var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; | ||
| 86 | |||
| 87 | // Make an array of the external JavaScript files required by the plugin. | ||
| 88 | var jQueryPlugins = [jQueryPath + '/jquery.ui.js', | ||
| 89 | jQueryPath + '/jquery.ui.resizable.js']; | ||
| 90 | |||
| 91 | // First get the jQuery UI base file | ||
| 92 | $.getScript(jQueryPlugins[0]); | ||
| 93 | |||
| 94 | // Get the jQuery UI resizeable plugin and then init the wymeditor resize | ||
| 95 | // plugin. It is import to do the initialisation after loading the | ||
| 96 | // necessary jQuery UI files has finished, otherwise the "resizable" method | ||
| 97 | // would not be available. | ||
| 98 | $.getScript(jQueryPlugins[1], function() { | ||
| 99 | jQuery(wym._box).resizable(final_options); | ||
| 100 | }); | ||
| 101 | |||
| 102 | }; |
|   | |||
| 1 | |||
| 2 | |||
| 3 | resizable plugin for WYMeditor | ||
| 4 | ############################## | ||
| 5 | |||
| 6 | The ``resizable`` plugin for WYMeditor_ enables vertical resizing of the | ||
| 7 | editor area. The plugin is based on the jQuery UI library. | ||
| 8 | |||
| 9 | Requirements | ||
| 10 | ============ | ||
| 11 | The following packages are required for using the WYMeditor ``resizable`` | ||
| 12 | plugin: | ||
| 13 | |||
| 14 | * jQuery (tested with jQuery ``jquery-1.2.4a.js`` from ``jquery.ui`` package) | ||
| 15 | * WYMeditor SVN trunk (Revision: 482) | ||
| 16 | * jQuery-UI (tested with ``jquery.ui-1.5b2``) | ||
| 17 | |||
| 18 | It should be possible to use this plugin with ``WYMeditor-0.4`` but I have not | ||
| 19 | tried. | ||
| 20 | |||
| 21 | Download | ||
| 22 | ======== | ||
| 23 | You can download the WYMeditor ``resizable`` plugin here: | ||
| 24 | |||
| 25 | * wymeditor-resizable-plugin-0.2.tgz_ | ||
| 26 | * wymeditor-resizable-plugin-0.1.tgz_ | ||
| 27 | |||
| 28 | See the Changelog_ for more infos about the releases. | ||
| 29 | |||
| 30 | .. _wymeditor-resizable-plugin-0.2.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.2.tgz | ||
| 31 | .. _wymeditor-resizable-plugin-0.1.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.1.tgz | ||
| 32 | |||
| 33 | Installation | ||
| 34 | ============ | ||
| 35 | Just extract the downloaded archive into your WYMeditor's ``plugin`` | ||
| 36 | directory. | ||
| 37 | |||
| 38 | Usage | ||
| 39 | ===== | ||
| 40 | For general instructions on WYMeditor plugins please refer to the `WYMeditor | ||
| 41 | plugin page`_. | ||
| 42 | |||
| 43 | To use the ``resizable`` plugin simply include the plugin's JavaScript file in | ||
| 44 | your code. You **do not** need to include the jQuery UI files - this is done | ||
| 45 | automatically by the plugin (see `Internals`_):: | ||
| 46 | |||
| 47 | <script type="text/javascript" | ||
| 48 | src="/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js"> | ||
| 49 | </script> | ||
| 50 | |||
| 51 | Make sure to adjust the ``src`` attribute to your needs, then initialize the | ||
| 52 | plugin in WYMeditor's ``postInit`` function:: | ||
| 53 | |||
| 54 | wymeditor({postInit: function(wym) { | ||
| 55 | wym.hovertools(); // other plugins... | ||
| 56 | wym.resizable({handles: "s,e", | ||
| 57 | maxHeight: 600}); | ||
| 58 | } | ||
| 59 | }) | ||
| 60 | |||
| 61 | The ``resizable`` plugin takes exactly one parameter, which is an object literal | ||
| 62 | containing the options of the plugin. The WYMeditor ``resizable`` plugin | ||
| 63 | supports all options of the jQuery UI ``resizable`` plugin. These are the | ||
| 64 | default values used by the plugin:: | ||
| 65 | |||
| 66 | handles: "s,e,se", | ||
| 67 | minHeight: 250, | ||
| 68 | maxHeight: 600 | ||
| 69 | |||
| 70 | See the `jQuery UI resizable plugin docs`_ for a list of all options. | ||
| 71 | |||
| 72 | That's it! You are now able to resize the WYMeditor vertically, horizontally or | ||
| 73 | both, depending on your options. | ||
| 74 | |||
| 75 | .. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables | ||
| 76 | |||
| 77 | Internals | ||
| 78 | ========= | ||
| 79 | The plugin takes care of loading the necessary jQuery UI files (``base`` and | ||
| 80 | ``resizable``) from the same path the jQuery library was loaded. Here's how | ||
| 81 | it's done:: | ||
| 82 | |||
| 83 | // Get the jQuery path from the editor, stripping away the jQuery file. | ||
| 84 | // see http://www.oreilly.com/catalog/regex/chapter/ch04.html | ||
| 85 | // The match result array contains the path and the filename. | ||
| 86 | var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; | ||
| 87 | |||
| 88 | // Make an array of the external JavaScript files required by the plugin. | ||
| 89 | var jQueryPlugins = [jQueryPath + '/ui.base.js', | ||
| 90 | jQueryPath + '/ui.resizable.js']; | ||
| 91 | |||
| 92 | // First get the jQuery UI base file | ||
| 93 | $.getScript(jQueryPlugins[0]); | ||
| 94 | |||
| 95 | // Get the jQuery UI resizeable plugin and then init the wymeditor resizable | ||
| 96 | // plugin. It is import to do the initialisation after loading the | ||
| 97 | // necessary jQuery UI files has finished, otherwise the "resizable" method | ||
| 98 | // would not be available. | ||
| 99 | $.getScript(jQueryPlugins[1], function() { | ||
| 100 | jQuery(wym._box).resizable(final_options); | ||
| 101 | }); | ||
| 102 | |||
| 103 | An alternative approach would be to use an AJAX queue when getting the script | ||
| 104 | files to ensure that all jQuery files are loaded before the initialisation code | ||
| 105 | of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does | ||
| 106 | that. | ||
| 107 | |||
| 108 | .. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue | ||
| 109 | |||
| 110 | Changelog | ||
| 111 | ========= | ||
| 112 | |||
| 113 | 0.2 | ||
| 114 | --- | ||
| 115 | - Added full support for all jQuery UI resizable plugin options. | ||
| 116 | - Refactored and documented code. | ||
| 117 | - Now contains a packed version (775 bytes). | ||
| 118 | |||
| 119 | 0.1 | ||
| 120 | --- | ||
| 121 | - Initial release. | ||
| 122 | |||
| 123 | .. _WYMeditor: http://www.wymeditor.org/ | ||
| 124 | .. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins |
|   | |||
| 1 | WYMeditor : what you see is What You Mean web-based editor | ||
| 2 | Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 3 | Dual licensed under the MIT (MIT-license.txt) | ||
| 4 | and GPL (GPL-license.txt) licenses. | ||
| 5 | |||
| 6 | For further information visit: | ||
| 7 | http://www.wymeditor.org/ | ||
| 8 | |||
| 9 | File Name: | ||
| 10 | README - HTML Tidy plugin for WYMeditor | ||
| 11 | |||
| 12 | File Authors: | ||
| 13 | Jean-François Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 14 | |||
| 15 | Credits: | ||
| 16 | 'HTML Tidy' by Dave Ragget - http://tidy.sourceforge.net/ | ||
| 17 | Icon 'wand' by Mark James - http://famfamfam.com/ | ||
| 18 | |||
| 19 | WYMeditor documentation is available online at http://www.wymeditor.org/ |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * jquery.wymeditor.tidy.js | ||
| 12 | * HTML Tidy plugin for WYMeditor | ||
| 13 | * | ||
| 14 | * File Authors: | ||
| 15 | * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) | ||
| 16 | */ | ||
| 17 | |||
| 18 | //Extend WYMeditor | ||
| 19 | WYMeditor.editor.prototype.tidy = function(options) { | ||
| 20 | var tidy = new WymTidy(options, this); | ||
| 21 | return(tidy); | ||
| 22 | }; | ||
| 23 | |||
| 24 | //WymTidy constructor | ||
| 25 | function WymTidy(options, wym) { | ||
| 26 | |||
| 27 | options = jQuery.extend({ | ||
| 28 | |||
| 29 | sUrl: "wymeditor/plugins/tidy/tidy.php", | ||
| 30 | sButtonHtml: "<li class='wym_tools_tidy'>" | ||
| 31 | + "<a name='CleanUp' href='#'" | ||
| 32 | + " style='background-image:" | ||
| 33 | + " url(wymeditor/plugins/tidy/wand.png)'>" | ||
| 34 | + "Clean up HTML" | ||
| 35 | + "</a></li>", | ||
| 36 | |||
| 37 | sButtonSelector: "li.wym_tools_tidy a" | ||
| 38 | |||
| 39 | }, options); | ||
| 40 | |||
| 41 | this._options = options; | ||
| 42 | this._wym = wym; | ||
| 43 | |||
| 44 | }; | ||
| 45 | |||
| 46 | //WymTidy initialization | ||
| 47 | WymTidy.prototype.init = function() { | ||
| 48 | |||
| 49 | var tidy = this; | ||
| 50 | |||
| 51 | jQuery(this._wym._box).find( | ||
| 52 | this._wym._options.toolsSelector + this._wym._options.toolsListSelector) | ||
| 53 | .append(this._options.sButtonHtml); | ||
| 54 | |||
| 55 | //handle click event | ||
| 56 | jQuery(this._wym._box).find(this._options.sButtonSelector).click(function() { | ||
| 57 | tidy.cleanup(); | ||
| 58 | return(false); | ||
| 59 | }); | ||
| 60 | |||
| 61 | }; | ||
| 62 | |||
| 63 | //WymTidy cleanup | ||
| 64 | WymTidy.prototype.cleanup = function() { | ||
| 65 | |||
| 66 | var wym = this._wym; | ||
| 67 | var html = "<html><body>" + wym.xhtml() + "</body></html>"; | ||
| 68 | |||
| 69 | jQuery.post(this._options.sUrl, { html: html}, function(data) { | ||
| 70 | |||
| 71 | if(data.length > 0 && data != '0') { | ||
| 72 | if(data.indexOf("<?php") == 0) { | ||
| 73 | wym.status("Ooops... Is PHP installed?"); | ||
| 74 | } else { | ||
| 75 | wym.html(data); | ||
| 76 | wym.status("HTML has been cleaned up."); | ||
| 77 | } | ||
| 78 | } else { | ||
| 79 | wym.status("An error occurred."); | ||
| 80 | } | ||
| 81 | }); | ||
| 82 | }; |
|   | |||
| 1 | <?php | ||
| 2 | |||
| 3 | if (get_magic_quotes_gpc()) $html = stripslashes($_REQUEST['html']); | ||
| 4 | else $html = $_REQUEST['html']; | ||
| 5 | |||
| 6 | if(strlen($html) > 0) { | ||
| 7 | |||
| 8 | // Specify configuration | ||
| 9 | $config = array( | ||
| 10 | 'bare' => true, | ||
| 11 | 'clean' => true, | ||
| 12 | 'doctype' => 'strict', | ||
| 13 | 'drop-empty-paras' => true, | ||
| 14 | 'drop-font-tags' => true, | ||
| 15 | 'drop-proprietary-attributes' => true, | ||
| 16 | 'enclose-block-text' => true, | ||
| 17 | 'indent' => false, | ||
| 18 | 'join-classes' => true, | ||
| 19 | 'join-styles' => true, | ||
| 20 | 'logical-emphasis' => true, | ||
| 21 | 'output-xhtml' => true, | ||
| 22 | 'show-body-only' => true, | ||
| 23 | 'wrap' => 0); | ||
| 24 | |||
| 25 | // Tidy | ||
| 26 | $tidy = new tidy; | ||
| 27 | $tidy->parseString($html, $config, 'utf8'); | ||
| 28 | $tidy->cleanRepair(); | ||
| 29 | |||
| 30 | // Output | ||
| 31 | echo $tidy; | ||
| 32 | } else { | ||
| 33 | |||
| 34 | echo ('0'); | ||
| 35 | } | ||
| 36 | ?> |
Binary files differ
Binary files differ
Binary files differ
Binary files differ
Binary files differ
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * skin.css | ||
| 12 | * main stylesheet for the default WYMeditor skin | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 17 | */ | ||
| 18 | |||
| 19 | /*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ | ||
| 20 | .wym_skin_default p, .wym_skin_default h2, .wym_skin_default h3, | ||
| 21 | .wym_skin_default ul, .wym_skin_default li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } | ||
| 22 | |||
| 23 | |||
| 24 | /*HIDDEN BY DEFAULT*/ | ||
| 25 | .wym_skin_default .wym_area_left { display: none; } | ||
| 26 | .wym_skin_default .wym_area_right { display: block; } | ||
| 27 | |||
| 28 | |||
| 29 | /*TYPO*/ | ||
| 30 | .wym_skin_default { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } | ||
| 31 | .wym_skin_default h2 { font-size: 110%; /* = 11px */} | ||
| 32 | .wym_skin_default h3 { font-size: 100%; /* = 10px */} | ||
| 33 | .wym_skin_default li { font-size: 100%; /* = 10px */} | ||
| 34 | |||
| 35 | |||
| 36 | /*WYM_BOX*/ | ||
| 37 | .wym_skin_default { border: 1px solid gray; background: #f2f2f2; padding: 5px} | ||
| 38 | |||
| 39 | /*auto-clear the wym_box*/ | ||
| 40 | .wym_skin_default:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 41 | * html .wym_skin_default { height: 1%;} | ||
| 42 | |||
| 43 | |||
| 44 | /*WYM_HTML*/ | ||
| 45 | .wym_skin_default .wym_html { width: 98%;} | ||
| 46 | .wym_skin_default .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } | ||
| 47 | |||
| 48 | |||
| 49 | /*WYM_IFRAME*/ | ||
| 50 | .wym_skin_default .wym_iframe { width: 98%;} | ||
| 51 | .wym_skin_default .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } | ||
| 52 | |||
| 53 | |||
| 54 | /*AREAS*/ | ||
| 55 | .wym_skin_default .wym_area_left { width: 150px; float: left;} | ||
| 56 | .wym_skin_default .wym_area_right { width: 150px; float: right;} | ||
| 57 | .wym_skin_default .wym_area_bottom { height: 1%; clear: both;} | ||
| 58 | * html .wym_skin_default .wym_area_main { height: 1%;} | ||
| 59 | * html .wym_skin_default .wym_area_top { height: 1%;} | ||
| 60 | *+html .wym_skin_default .wym_area_top { height: 1%;} | ||
| 61 | |||
| 62 | /*SECTIONS SYSTEM*/ | ||
| 63 | |||
| 64 | /*common defaults for all sections*/ | ||
| 65 | .wym_skin_default .wym_section { margin-bottom: 5px; } | ||
| 66 | .wym_skin_default .wym_section h2, | ||
| 67 | .wym_skin_default .wym_section h3 { padding: 1px 3px; margin: 0; } | ||
| 68 | .wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } | ||
| 69 | .wym_skin_default .wym_section a:hover { background-color: yellow; } | ||
| 70 | /*hide section titles by default*/ | ||
| 71 | .wym_skin_default .wym_section h2 { display: none; } | ||
| 72 | /*disable any margin-collapse*/ | ||
| 73 | .wym_skin_default .wym_section { padding-top: 1px; padding-bottom: 1px; } | ||
| 74 | /*auto-clear sections*/ | ||
| 75 | .wym_skin_default .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 76 | * html .wym_skin_default .wym_section ul { height: 1%;} | ||
| 77 | |||
| 78 | /*option: add this class to a section to make it render as a panel*/ | ||
| 79 | .wym_skin_default .wym_panel { } | ||
| 80 | .wym_skin_default .wym_panel h2 { display: block; } | ||
| 81 | |||
| 82 | /*option: add this class to a section to make it render as a dropdown menu*/ | ||
| 83 | .wym_skin_default .wym_dropdown h2 { display: block; } | ||
| 84 | .wym_skin_default .wym_dropdown ul { display: none; position: absolute; background: white; } | ||
| 85 | .wym_skin_default .wym_dropdown:hover ul, | ||
| 86 | .wym_skin_default .wym_dropdown.hover ul { display: block; } | ||
| 87 | |||
| 88 | /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ | ||
| 89 | .wym_skin_default .wym_buttons li { float:left;} | ||
| 90 | .wym_skin_default .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } | ||
| 91 | /*image replacements*/ | ||
| 92 | .wym_skin_default .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} | ||
| 93 | .wym_skin_default .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} | ||
| 94 | .wym_skin_default .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} | ||
| 95 | .wym_skin_default .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} | ||
| 96 | .wym_skin_default .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} | ||
| 97 | .wym_skin_default .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} | ||
| 98 | .wym_skin_default .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} | ||
| 99 | .wym_skin_default .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} | ||
| 100 | .wym_skin_default .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} | ||
| 101 | .wym_skin_default .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} | ||
| 102 | .wym_skin_default .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} | ||
| 103 | .wym_skin_default .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} | ||
| 104 | .wym_skin_default .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} | ||
| 105 | .wym_skin_default .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} | ||
| 106 | .wym_skin_default .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} | ||
| 107 | .wym_skin_default .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} | ||
| 108 | .wym_skin_default .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} | ||
| 109 | .wym_skin_default .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} | ||
| 110 | |||
| 111 | /*DECORATION*/ | ||
| 112 | .wym_skin_default .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} | ||
| 113 | .wym_skin_default .wym_section h2 span { color: gray;} | ||
| 114 | .wym_skin_default .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} | ||
| 115 | .wym_skin_default .wym_panel ul { margin: 2px 0 5px; } | ||
| 116 | .wym_skin_default .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } | ||
| 117 | .wym_skin_default .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} | ||
| 118 | |||
| 119 | /*DIALOGS*/ | ||
| 120 | .wym_dialog div.row { margin-bottom: 5px;} | ||
| 121 | .wym_dialog div.row input { margin-right: 5px;} | ||
| 122 | .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } | ||
| 123 | .wym_dialog div.row-indent { padding-left: 160px; } | ||
| 124 | /*autoclearing*/ | ||
| 125 | .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 126 | .wym_dialog div.row { display: inline-block; } | ||
| 127 | /* Hides from IE-mac \*/ | ||
| 128 | * html .wym_dialog div.row { height: 1%; } | ||
| 129 | .wym_dialog div.row { display: block; } | ||
| 130 | /* End hide from IE-mac */ | ||
| 131 | |||
| 132 | /*WYMEDITOR_LINK*/ | ||
| 133 | a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } |
|   | |||
| 1 | WYMeditor.SKINS['default'] = { | ||
| 2 | |||
| 3 | init: function(wym) { | ||
| 4 | |||
| 5 | // render following sections as panels | ||
| 6 | // jQuery(wym._box).find(wym._options.classesSelector) | ||
| 7 | // .addClass("wym_panel"); | ||
| 8 | |||
| 9 | // render following sections as buttons | ||
| 10 | // jQuery(wym._box).find(wym._options.toolsSelector) | ||
| 11 | // .addClass("wym_buttons"); | ||
| 12 | |||
| 13 | // render following sections as dropdown menus | ||
| 14 | // jQuery(wym._box).find(wym._options.containersSelector) | ||
| 15 | // .addClass("wym_dropdown") | ||
| 16 | // .find(WYMeditor.H2) | ||
| 17 | // .append("<span> ></span>"); | ||
| 18 | |||
| 19 | // auto add some margin to the main area sides if left area | ||
| 20 | // or right area are not empty (if they contain sections) | ||
| 21 | // jQuery(wym._box).find("div.wym_area_right ul") | ||
| 22 | // .parents("div.wym_area_right").show() | ||
| 23 | // .parents(wym._options.boxSelector) | ||
| 24 | // .find("div.wym_area_main") | ||
| 25 | // .css({"margin-right": "155px"}); | ||
| 26 | |||
| 27 | // jQuery(wym._box).find("div.wym_area_left ul") | ||
| 28 | // .parents("div.wym_area_left").show() | ||
| 29 | // .parents(wym._options.boxSelector) | ||
| 30 | // .find("div.wym_area_main") | ||
| 31 | // .css({"margin-left": "155px"}); | ||
| 32 | |||
| 33 | //make hover work under IE < 7 | ||
| 34 | // jQuery(wym._box).find(".wym_section").hover(function(){ | ||
| 35 | // jQuery(this).addClass("hover"); | ||
| 36 | // },function(){ | ||
| 37 | // jQuery(this).removeClass("hover"); | ||
| 38 | // }); | ||
| 39 | jQuery(wym._box).find(wym._options.toolsSelector + ', ' + wym._options.containersSelector) | ||
| 40 | .addClass("wym_dropdown") | ||
| 41 | .selectify(); | ||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | } | ||
| 46 | }; |
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * skin.css | ||
| 12 | * main stylesheet for the mini WYMeditor skin | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 17 | */ | ||
| 18 | |||
| 19 | /*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ | ||
| 20 | .wym_skin_mini p, .wym_skin_mini h2, .wym_skin_mini h3, | ||
| 21 | .wym_skin_mini ul, .wym_skin_mini li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } | ||
| 22 | |||
| 23 | /*TYPO*/ | ||
| 24 | .wym_skin_mini { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } | ||
| 25 | .wym_skin_mini h2 { font-size: 160%; /* = 11px */} | ||
| 26 | .wym_skin_mini h3 { font-size: 100%; /* = 10px */} | ||
| 27 | .wym_skin_mini li { font-size: 130%; /* = 10px */} | ||
| 28 | |||
| 29 | |||
| 30 | /*WYM_BOX*/ | ||
| 31 | /*auto-clear the wym_box*/ | ||
| 32 | .wym_skin_mini:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 33 | * html .wym_skin_mini { height: 1%;} | ||
| 34 | |||
| 35 | |||
| 36 | /*WYM_HTML*/ | ||
| 37 | .wym_skin_mini .wym_html { width: 467px;} | ||
| 38 | .wym_skin_mini .wym_html textarea { width: 467px; height: 200px; border: solid gray; border-width: 1px 0 0 0; background: white; } | ||
| 39 | |||
| 40 | |||
| 41 | /*WYM_IFRAME*/ | ||
| 42 | .wym_skin_mini .wym_iframe iframe { width: 467px; height: 400px; border: solid gray; border-width: 1px 0 0 0; background: white; overflow-y: scroll } | ||
| 43 | |||
| 44 | |||
| 45 | /*AREAS*/ | ||
| 46 | .wym_skin_mini .wym_area_top { width: 467px; float: left} | ||
| 47 | .wym_skin_mini .wym_area_top div { float: left } | ||
| 48 | .wym_skin_mini .wym_area_right { width: 88px; height: 10px; float: left; padding: 4px 0 0 5px; margin: 0px} | ||
| 49 | |||
| 50 | /*SECTIONS SYSTEM*/ | ||
| 51 | |||
| 52 | /*common defaults for all sections*/ | ||
| 53 | .wym_skin_mini .wym_section { margin-bottom: 5px; } | ||
| 54 | .wym_skin_mini .wym_section h2, | ||
| 55 | .wym_skin_mini .wym_section h3 { padding: 1px 3px; margin: 0; } | ||
| 56 | .wym_skin_mini .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } | ||
| 57 | .wym_skin_mini .wym_section a:hover { background-color: yellow; } | ||
| 58 | /*hide section titles by default*/ | ||
| 59 | .wym_skin_mini .wym_section h2 { display: none; } | ||
| 60 | /*disable any margin-collapse*/ | ||
| 61 | .wym_skin_mini .wym_section { padding-top: 1px; padding-bottom: 1px; } | ||
| 62 | /*auto-clear sections*/ | ||
| 63 | .wym_skin_mini .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 64 | * html .wym_skin_mini .wym_section ul { height: 1%;} | ||
| 65 | |||
| 66 | /*option: add this class to a section to make it render as a panel*/ | ||
| 67 | .wym_skin_mini .wym_panel { } | ||
| 68 | .wym_skin_mini .wym_panel h2 { display: inline; } | ||
| 69 | |||
| 70 | /*option: add this class to a section to make it render as a dropdown menu*/ | ||
| 71 | .wym_skin_mini .wym_dropdown h2 { display: block; margin: 3px 0 0 3px } | ||
| 72 | .wym_skin_mini .wym_dropdown ul { display: none; position: absolute; background: white; border: 0px solid #A2ABC0; padding: 5px 5px 5px 5px; width: 110px} | ||
| 73 | .wym_skin_mini .wym_dropdown:hover ul, | ||
| 74 | .wym_skin_mini .wym_dropdown.hover ul { display: block; } | ||
| 75 | |||
| 76 | /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ | ||
| 77 | .wym_skin_mini .wym_buttons li { float:left;} | ||
| 78 | .wym_skin_mini .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } | ||
| 79 | /*image replacements*/ | ||
| 80 | .wym_skin_mini .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} | ||
| 81 | .wym_skin_mini .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} | ||
| 82 | .wym_skin_mini .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} | ||
| 83 | .wym_skin_mini .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} | ||
| 84 | .wym_skin_mini .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} | ||
| 85 | .wym_skin_mini .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} | ||
| 86 | .wym_skin_mini .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} | ||
| 87 | .wym_skin_mini .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} | ||
| 88 | .wym_skin_mini .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} | ||
| 89 | .wym_skin_mini .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} | ||
| 90 | .wym_skin_mini .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} | ||
| 91 | .wym_skin_mini .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} | ||
| 92 | .wym_skin_mini .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} | ||
| 93 | .wym_skin_mini .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} | ||
| 94 | .wym_skin_mini .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} | ||
| 95 | .wym_skin_mini .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} | ||
| 96 | .wym_skin_mini .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} | ||
| 97 | .wym_skin_mini .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} | ||
| 98 | |||
| 99 | /*DECORATION*/ | ||
| 100 | .wym_skin_mini .wym_panel ul { margin: 2px 0 5px; } | ||
| 101 | |||
| 102 | /*DIALOGS*/ | ||
| 103 | .wym_dialog div.row { margin-bottom: 5px;} | ||
| 104 | .wym_dialog div.row input { margin-right: 5px;} | ||
| 105 | .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } | ||
| 106 | .wym_dialog div.row-indent { padding-left: 160px; } | ||
| 107 | /*autoclearing*/ | ||
| 108 | .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 109 | .wym_dialog div.row { display: inline-block; } | ||
| 110 | /* Hides from IE-mac \*/ | ||
| 111 | * html .wym_dialog div.row { height: 1%; } | ||
| 112 | .wym_dialog div.row { display: block; } | ||
| 113 | /* End hide from IE-mac */ | ||
| 114 | |||
| 115 | /*WYMEDITOR_LINK*/ | ||
| 116 | a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } |
|   | |||
| 1 | WYMeditor.SKINS['mini'] = { | ||
| 2 | |||
| 3 | init: function(wym) { | ||
| 4 | |||
| 5 | //render following sections as panels | ||
| 6 | // jQuery(wym._box).find(wym._options.classesSelector) | ||
| 7 | // .addClass("wym_panel"); | ||
| 8 | |||
| 9 | //render following sections as buttons | ||
| 10 | jQuery(wym._box).find(wym._options.toolsSelector) | ||
| 11 | .addClass("wym_buttons"); | ||
| 12 | |||
| 13 | //render following sections as dropdown menus | ||
| 14 | jQuery(wym._box).find(wym._options.containersSelector) | ||
| 15 | // .addClass('wym_buttons'); | ||
| 16 | .addClass("wym_dropdown") | ||
| 17 | .find(WYMeditor.H2) | ||
| 18 | .append("<span> ></span>"); | ||
| 19 | |||
| 20 | //make hover work under IE < 7 | ||
| 21 | jQuery(wym._box).find(".wym_section").hover(function(){ | ||
| 22 | jQuery(this).addClass("hover"); | ||
| 23 | },function(){ | ||
| 24 | jQuery(this).removeClass("hover"); | ||
| 25 | }); | ||
| 26 | } | ||
| 27 | }; |
Binary files differ
Binary files differ
Binary files differ
Binary files differ
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * skin.css | ||
| 12 | * main stylesheet for the minimal WYMeditor skin | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Jean-Francois Hovinne | ||
| 17 | * Scott Lewis (see Silver skin) | ||
| 18 | */ | ||
| 19 | |||
| 20 | /* Set iframe */ | ||
| 21 | .wym_skin_minimal div.wym_iframe iframe { | ||
| 22 | width: 90%; | ||
| 23 | height: 200px; | ||
| 24 | } | ||
| 25 | |||
| 26 | /* Hide h2 by default */ | ||
| 27 | .wym_skin_minimal h2 { | ||
| 28 | display: none; | ||
| 29 | } | ||
| 30 | |||
| 31 | /* Show specific h2 */ | ||
| 32 | .wym_skin_minimal div.wym_tools h2, | ||
| 33 | .wym_skin_minimal div.wym_containers h2, | ||
| 34 | .wym_skin_minimal div.wym_classes h2 { | ||
| 35 | display: block; | ||
| 36 | } | ||
| 37 | |||
| 38 | .wym_skin_minimal div.wym_section ul { | ||
| 39 | margin: 0; | ||
| 40 | } | ||
| 41 | |||
| 42 | .wym_skin_minimal div.wym_section ul li { | ||
| 43 | float: left; | ||
| 44 | list-style-type: none; | ||
| 45 | margin-right: 5px; | ||
| 46 | } | ||
| 47 | |||
| 48 | .wym_skin_minimal div.wym_area_top, | ||
| 49 | .wym_skin_minimal div.wym_area_right, | ||
| 50 | .wym_skin_minimal div.wym_containers, | ||
| 51 | .wym_skin_minimal div.wym_classes { | ||
| 52 | float: left; | ||
| 53 | } | ||
| 54 | |||
| 55 | .wym_skin_minimal div.wym_area_main { | ||
| 56 | clear: both; | ||
| 57 | } | ||
| 58 | |||
| 59 | .wym_skin_minimal div.wym_html { | ||
| 60 | width: 90%; | ||
| 61 | } | ||
| 62 | |||
| 63 | .wym_skin_minimal textarea.wym_html_val { | ||
| 64 | width: 100%; | ||
| 65 | height: 100px; | ||
| 66 | } | ||
| 67 | |||
| 68 | /* DROPDOWNS (see Silver skin) */ | ||
| 69 | .wym_skin_minimal div.wym_dropdown { | ||
| 70 | cursor: pointer; | ||
| 71 | margin: 0px 4px 10px 0px; | ||
| 72 | padding: 0px; | ||
| 73 | z-index: 1001; | ||
| 74 | display: block; | ||
| 75 | } | ||
| 76 | |||
| 77 | .wym_skin_minimal div.wym_dropdown ul { | ||
| 78 | display: none; | ||
| 79 | width: 124px; | ||
| 80 | padding: 0px; | ||
| 81 | margin: 0px; | ||
| 82 | list-style-type: none; | ||
| 83 | list-style-image: none; | ||
| 84 | z-index: 1002; | ||
| 85 | position: absolute; | ||
| 86 | border-top: 1px solid #AAA; | ||
| 87 | } | ||
| 88 | |||
| 89 | .wym_skin_minimal div.wym_dropdown ul li { | ||
| 90 | width: 146px; | ||
| 91 | height: 20px; | ||
| 92 | padding: 0px; | ||
| 93 | margin: 0px; | ||
| 94 | border: 1px solid #777; | ||
| 95 | border-top: none; | ||
| 96 | background: #EEE; | ||
| 97 | list-style-image: none; | ||
| 98 | } | ||
| 99 | |||
| 100 | .wym_skin_minimal div.wym_dropdown h2 { | ||
| 101 | width: 138px; | ||
| 102 | height: 16px; | ||
| 103 | color: #000; | ||
| 104 | background-image: url(images/bg.selector.silver.gif); | ||
| 105 | background-position: 0px -18px; | ||
| 106 | background-repeat: no-repeat; | ||
| 107 | border: none; | ||
| 108 | font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; | ||
| 109 | font-size: 12px; | ||
| 110 | font-weight: bold; | ||
| 111 | padding: 2px 0px 0px 10px; | ||
| 112 | margin: 0px; | ||
| 113 | } | ||
| 114 | |||
| 115 | .wym_skin_minimal div.wym_dropdown a { | ||
| 116 | text-decoration: none; | ||
| 117 | font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; | ||
| 118 | font-size: 12px; | ||
| 119 | padding: 5px 0px 0px 10px; | ||
| 120 | display: block; | ||
| 121 | width: 136px; | ||
| 122 | height: 15px; | ||
| 123 | color: #000; | ||
| 124 | text-align: left; | ||
| 125 | margin-left: 0px; | ||
| 126 | } | ||
| 127 | |||
| 128 | .wym_skin_minimal div.wym_dropdown a:hover { | ||
| 129 | background: #BBB; | ||
| 130 | border-bottom: none; | ||
| 131 | } |
|   | |||
| 1 | jQuery.fn.selectify = function() { | ||
| 2 | return this.each(function() { | ||
| 3 | jQuery(this).hover( | ||
| 4 | function() { | ||
| 5 | jQuery("h2", this).css("background-position", "0px -18px"); | ||
| 6 | jQuery("ul", this).fadeIn("fast"); | ||
| 7 | }, | ||
| 8 | function() { | ||
| 9 | jQuery("h2", this).css("background-position", ""); | ||
| 10 | jQuery("ul", this).fadeOut("fast"); | ||
| 11 | } | ||
| 12 | ); | ||
| 13 | }); | ||
| 14 | }; | ||
| 15 | |||
| 16 | WYMeditor.SKINS['minimal'] = { | ||
| 17 | //placeholder for the skin JS, if needed | ||
| 18 | |||
| 19 | //init the skin | ||
| 20 | //wym is the WYMeditor.editor instance | ||
| 21 | init: function(wym) { | ||
| 22 | |||
| 23 | //render following sections as dropdown menus | ||
| 24 | jQuery(wym._box).find(wym._options.toolsSelector + ', ' + wym._options.containersSelector + ', ' + wym._options.classesSelector) | ||
| 25 | .addClass("wym_dropdown") | ||
| 26 | .selectify(); | ||
| 27 | |||
| 28 | |||
| 29 | } | ||
| 30 | }; |
|   | |||
| 1 | GNU GENERAL PUBLIC LICENSE | ||
| 2 | Version 3, 29 June 2007 | ||
| 3 | |||
| 4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
| 5 | Everyone is permitted to copy and distribute verbatim copies | ||
| 6 | of this license document, but changing it is not allowed. | ||
| 7 | |||
| 8 | Preamble | ||
| 9 | |||
| 10 | The GNU General Public License is a free, copyleft license for | ||
| 11 | software and other kinds of works. | ||
| 12 | |||
| 13 | The licenses for most software and other practical works are designed | ||
| 14 | to take away your freedom to share and change the works. By contrast, | ||
| 15 | the GNU General Public License is intended to guarantee your freedom to | ||
| 16 | share and change all versions of a program--to make sure it remains free | ||
| 17 | software for all its users. We, the Free Software Foundation, use the | ||
| 18 | GNU General Public License for most of our software; it applies also to | ||
| 19 | any other work released this way by its authors. You can apply it to | ||
| 20 | your programs, too. | ||
| 21 | |||
| 22 | When we speak of free software, we are referring to freedom, not | ||
| 23 | price. Our General Public Licenses are designed to make sure that you | ||
| 24 | have the freedom to distribute copies of free software (and charge for | ||
| 25 | them if you wish), that you receive source code or can get it if you | ||
| 26 | want it, that you can change the software or use pieces of it in new | ||
| 27 | free programs, and that you know you can do these things. | ||
| 28 | |||
| 29 | To protect your rights, we need to prevent others from denying you | ||
| 30 | these rights or asking you to surrender the rights. Therefore, you have | ||
| 31 | certain responsibilities if you distribute copies of the software, or if | ||
| 32 | you modify it: responsibilities to respect the freedom of others. | ||
| 33 | |||
| 34 | For example, if you distribute copies of such a program, whether | ||
| 35 | gratis or for a fee, you must pass on to the recipients the same | ||
| 36 | freedoms that you received. You must make sure that they, too, receive | ||
| 37 | or can get the source code. And you must show them these terms so they | ||
| 38 | know their rights. | ||
| 39 | |||
| 40 | Developers that use the GNU GPL protect your rights with two steps: | ||
| 41 | (1) assert copyright on the software, and (2) offer you this License | ||
| 42 | giving you legal permission to copy, distribute and/or modify it. | ||
| 43 | |||
| 44 | For the developers' and authors' protection, the GPL clearly explains | ||
| 45 | that there is no warranty for this free software. For both users' and | ||
| 46 | authors' sake, the GPL requires that modified versions be marked as | ||
| 47 | changed, so that their problems will not be attributed erroneously to | ||
| 48 | authors of previous versions. | ||
| 49 | |||
| 50 | Some devices are designed to deny users access to install or run | ||
| 51 | modified versions of the software inside them, although the manufacturer | ||
| 52 | can do so. This is fundamentally incompatible with the aim of | ||
| 53 | protecting users' freedom to change the software. The systematic | ||
| 54 | pattern of such abuse occurs in the area of products for individuals to | ||
| 55 | use, which is precisely where it is most unacceptable. Therefore, we | ||
| 56 | have designed this version of the GPL to prohibit the practice for those | ||
| 57 | products. If such problems arise substantially in other domains, we | ||
| 58 | stand ready to extend this provision to those domains in future versions | ||
| 59 | of the GPL, as needed to protect the freedom of users. | ||
| 60 | |||
| 61 | Finally, every program is threatened constantly by software patents. | ||
| 62 | States should not allow patents to restrict development and use of | ||
| 63 | software on general-purpose computers, but in those that do, we wish to | ||
| 64 | avoid the special danger that patents applied to a free program could | ||
| 65 | make it effectively proprietary. To prevent this, the GPL assures that | ||
| 66 | patents cannot be used to render the program non-free. | ||
| 67 | |||
| 68 | The precise terms and conditions for copying, distribution and | ||
| 69 | modification follow. | ||
| 70 | |||
| 71 | TERMS AND CONDITIONS | ||
| 72 | |||
| 73 | 0. Definitions. | ||
| 74 | |||
| 75 | "This License" refers to version 3 of the GNU General Public License. | ||
| 76 | |||
| 77 | "Copyright" also means copyright-like laws that apply to other kinds of | ||
| 78 | works, such as semiconductor masks. | ||
| 79 | |||
| 80 | "The Program" refers to any copyrightable work licensed under this | ||
| 81 | License. Each licensee is addressed as "you". "Licensees" and | ||
| 82 | "recipients" may be individuals or organizations. | ||
| 83 | |||
| 84 | To "modify" a work means to copy from or adapt all or part of the work | ||
| 85 | in a fashion requiring copyright permission, other than the making of an | ||
| 86 | exact copy. The resulting work is called a "modified version" of the | ||
| 87 | earlier work or a work "based on" the earlier work. | ||
| 88 | |||
| 89 | A "covered work" means either the unmodified Program or a work based | ||
| 90 | on the Program. | ||
| 91 | |||
| 92 | To "propagate" a work means to do anything with it that, without | ||
| 93 | permission, would make you directly or secondarily liable for | ||
| 94 | infringement under applicable copyright law, except executing it on a | ||
| 95 | computer or modifying a private copy. Propagation includes copying, | ||
| 96 | distribution (with or without modification), making available to the | ||
| 97 | public, and in some countries other activities as well. | ||
| 98 | |||
| 99 | To "convey" a work means any kind of propagation that enables other | ||
| 100 | parties to make or receive copies. Mere interaction with a user through | ||
| 101 | a computer network, with no transfer of a copy, is not conveying. | ||
| 102 | |||
| 103 | An interactive user interface displays "Appropriate Legal Notices" | ||
| 104 | to the extent that it includes a convenient and prominently visible | ||
| 105 | feature that (1) displays an appropriate copyright notice, and (2) | ||
| 106 | tells the user that there is no warranty for the work (except to the | ||
| 107 | extent that warranties are provided), that licensees may convey the | ||
| 108 | work under this License, and how to view a copy of this License. If | ||
| 109 | the interface presents a list of user commands or options, such as a | ||
| 110 | menu, a prominent item in the list meets this criterion. | ||
| 111 | |||
| 112 | 1. Source Code. | ||
| 113 | |||
| 114 | The "source code" for a work means the preferred form of the work | ||
| 115 | for making modifications to it. "Object code" means any non-source | ||
| 116 | form of a work. | ||
| 117 | |||
| 118 | A "Standard Interface" means an interface that either is an official | ||
| 119 | standard defined by a recognized standards body, or, in the case of | ||
| 120 | interfaces specified for a particular programming language, one that | ||
| 121 | is widely used among developers working in that language. | ||
| 122 | |||
| 123 | The "System Libraries" of an executable work include anything, other | ||
| 124 | than the work as a whole, that (a) is included in the normal form of | ||
| 125 | packaging a Major Component, but which is not part of that Major | ||
| 126 | Component, and (b) serves only to enable use of the work with that | ||
| 127 | Major Component, or to implement a Standard Interface for which an | ||
| 128 | implementation is available to the public in source code form. A | ||
| 129 | "Major Component", in this context, means a major essential component | ||
| 130 | (kernel, window system, and so on) of the specific operating system | ||
| 131 | (if any) on which the executable work runs, or a compiler used to | ||
| 132 | produce the work, or an object code interpreter used to run it. | ||
| 133 | |||
| 134 | The "Corresponding Source" for a work in object code form means all | ||
| 135 | the source code needed to generate, install, and (for an executable | ||
| 136 | work) run the object code and to modify the work, including scripts to | ||
| 137 | control those activities. However, it does not include the work's | ||
| 138 | System Libraries, or general-purpose tools or generally available free | ||
| 139 | programs which are used unmodified in performing those activities but | ||
| 140 | which are not part of the work. For example, Corresponding Source | ||
| 141 | includes interface definition files associated with source files for | ||
| 142 | the work, and the source code for shared libraries and dynamically | ||
| 143 | linked subprograms that the work is specifically designed to require, | ||
| 144 | such as by intimate data communication or control flow between those | ||
| 145 | subprograms and other parts of the work. | ||
| 146 | |||
| 147 | The Corresponding Source need not include anything that users | ||
| 148 | can regenerate automatically from other parts of the Corresponding | ||
| 149 | Source. | ||
| 150 | |||
| 151 | The Corresponding Source for a work in source code form is that | ||
| 152 | same work. | ||
| 153 | |||
| 154 | 2. Basic Permissions. | ||
| 155 | |||
| 156 | All rights granted under this License are granted for the term of | ||
| 157 | copyright on the Program, and are irrevocable provided the stated | ||
| 158 | conditions are met. This License explicitly affirms your unlimited | ||
| 159 | permission to run the unmodified Program. The output from running a | ||
| 160 | covered work is covered by this License only if the output, given its | ||
| 161 | content, constitutes a covered work. This License acknowledges your | ||
| 162 | rights of fair use or other equivalent, as provided by copyright law. | ||
| 163 | |||
| 164 | You may make, run and propagate covered works that you do not | ||
| 165 | convey, without conditions so long as your license otherwise remains | ||
| 166 | in force. You may convey covered works to others for the sole purpose | ||
| 167 | of having them make modifications exclusively for you, or provide you | ||
| 168 | with facilities for running those works, provided that you comply with | ||
| 169 | the terms of this License in conveying all material for which you do | ||
| 170 | not control copyright. Those thus making or running the covered works | ||
| 171 | for you must do so exclusively on your behalf, under your direction | ||
| 172 | and control, on terms that prohibit them from making any copies of | ||
| 173 | your copyrighted material outside their relationship with you. | ||
| 174 | |||
| 175 | Conveying under any other circumstances is permitted solely under | ||
| 176 | the conditions stated below. Sublicensing is not allowed; section 10 | ||
| 177 | makes it unnecessary. | ||
| 178 | |||
| 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | ||
| 180 | |||
| 181 | No covered work shall be deemed part of an effective technological | ||
| 182 | measure under any applicable law fulfilling obligations under article | ||
| 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | ||
| 184 | similar laws prohibiting or restricting circumvention of such | ||
| 185 | measures. | ||
| 186 | |||
| 187 | When you convey a covered work, you waive any legal power to forbid | ||
| 188 | circumvention of technological measures to the extent such circumvention | ||
| 189 | is effected by exercising rights under this License with respect to | ||
| 190 | the covered work, and you disclaim any intention to limit operation or | ||
| 191 | modification of the work as a means of enforcing, against the work's | ||
| 192 | users, your or third parties' legal rights to forbid circumvention of | ||
| 193 | technological measures. | ||
| 194 | |||
| 195 | 4. Conveying Verbatim Copies. | ||
| 196 | |||
| 197 | You may convey verbatim copies of the Program's source code as you | ||
| 198 | receive it, in any medium, provided that you conspicuously and | ||
| 199 | appropriately publish on each copy an appropriate copyright notice; | ||
| 200 | keep intact all notices stating that this License and any | ||
| 201 | non-permissive terms added in accord with section 7 apply to the code; | ||
| 202 | keep intact all notices of the absence of any warranty; and give all | ||
| 203 | recipients a copy of this License along with the Program. | ||
| 204 | |||
| 205 | You may charge any price or no price for each copy that you convey, | ||
| 206 | and you may offer support or warranty protection for a fee. | ||
| 207 | |||
| 208 | 5. Conveying Modified Source Versions. | ||
| 209 | |||
| 210 | You may convey a work based on the Program, or the modifications to | ||
| 211 | produce it from the Program, in the form of source code under the | ||
| 212 | terms of section 4, provided that you also meet all of these conditions: | ||
| 213 | |||
| 214 | a) The work must carry prominent notices stating that you modified | ||
| 215 | it, and giving a relevant date. | ||
| 216 | |||
| 217 | b) The work must carry prominent notices stating that it is | ||
| 218 | released under this License and any conditions added under section | ||
| 219 | 7. This requirement modifies the requirement in section 4 to | ||
| 220 | "keep intact all notices". | ||
| 221 | |||
| 222 | c) You must license the entire work, as a whole, under this | ||
| 223 | License to anyone who comes into possession of a copy. This | ||
| 224 | License will therefore apply, along with any applicable section 7 | ||
| 225 | additional terms, to the whole of the work, and all its parts, | ||
| 226 | regardless of how they are packaged. This License gives no | ||
| 227 | permission to license the work in any other way, but it does not | ||
| 228 | invalidate such permission if you have separately received it. | ||
| 229 | |||
| 230 | d) If the work has interactive user interfaces, each must display | ||
| 231 | Appropriate Legal Notices; however, if the Program has interactive | ||
| 232 | interfaces that do not display Appropriate Legal Notices, your | ||
| 233 | work need not make them do so. | ||
| 234 | |||
| 235 | A compilation of a covered work with other separate and independent | ||
| 236 | works, which are not by their nature extensions of the covered work, | ||
| 237 | and which are not combined with it such as to form a larger program, | ||
| 238 | in or on a volume of a storage or distribution medium, is called an | ||
| 239 | "aggregate" if the compilation and its resulting copyright are not | ||
| 240 | used to limit the access or legal rights of the compilation's users | ||
| 241 | beyond what the individual works permit. Inclusion of a covered work | ||
| 242 | in an aggregate does not cause this License to apply to the other | ||
| 243 | parts of the aggregate. | ||
| 244 | |||
| 245 | 6. Conveying Non-Source Forms. | ||
| 246 | |||
| 247 | You may convey a covered work in object code form under the terms | ||
| 248 | of sections 4 and 5, provided that you also convey the | ||
| 249 | machine-readable Corresponding Source under the terms of this License, | ||
| 250 | in one of these ways: | ||
| 251 | |||
| 252 | a) Convey the object code in, or embodied in, a physical product | ||
| 253 | (including a physical distribution medium), accompanied by the | ||
| 254 | Corresponding Source fixed on a durable physical medium | ||
| 255 | customarily used for software interchange. | ||
| 256 | |||
| 257 | b) Convey the object code in, or embodied in, a physical product | ||
| 258 | (including a physical distribution medium), accompanied by a | ||
| 259 | written offer, valid for at least three years and valid for as | ||
| 260 | long as you offer spare parts or customer support for that product | ||
| 261 | model, to give anyone who possesses the object code either (1) a | ||
| 262 | copy of the Corresponding Source for all the software in the | ||
| 263 | product that is covered by this License, on a durable physical | ||
| 264 | medium customarily used for software interchange, for a price no | ||
| 265 | more than your reasonable cost of physically performing this | ||
| 266 | conveying of source, or (2) access to copy the | ||
| 267 | Corresponding Source from a network server at no charge. | ||
| 268 | |||
| 269 | c) Convey individual copies of the object code with a copy of the | ||
| 270 | written offer to provide the Corresponding Source. This | ||
| 271 | alternative is allowed only occasionally and noncommercially, and | ||
| 272 | only if you received the object code with such an offer, in accord | ||
| 273 | with subsection 6b. | ||
| 274 | |||
| 275 | d) Convey the object code by offering access from a designated | ||
| 276 | place (gratis or for a charge), and offer equivalent access to the | ||
| 277 | Corresponding Source in the same way through the same place at no | ||
| 278 | further charge. You need not require recipients to copy the | ||
| 279 | Corresponding Source along with the object code. If the place to | ||
| 280 | copy the object code is a network server, the Corresponding Source | ||
| 281 | may be on a different server (operated by you or a third party) | ||
| 282 | that supports equivalent copying facilities, provided you maintain | ||
| 283 | clear directions next to the object code saying where to find the | ||
| 284 | Corresponding Source. Regardless of what server hosts the | ||
| 285 | Corresponding Source, you remain obligated to ensure that it is | ||
| 286 | available for as long as needed to satisfy these requirements. | ||
| 287 | |||
| 288 | e) Convey the object code using peer-to-peer transmission, provided | ||
| 289 | you inform other peers where the object code and Corresponding | ||
| 290 | Source of the work are being offered to the general public at no | ||
| 291 | charge under subsection 6d. | ||
| 292 | |||
| 293 | A separable portion of the object code, whose source code is excluded | ||
| 294 | from the Corresponding Source as a System Library, need not be | ||
| 295 | included in conveying the object code work. | ||
| 296 | |||
| 297 | A "User Product" is either (1) a "consumer product", which means any | ||
| 298 | tangible personal property which is normally used for personal, family, | ||
| 299 | or household purposes, or (2) anything designed or sold for incorporation | ||
| 300 | into a dwelling. In determining whether a product is a consumer product, | ||
| 301 | doubtful cases shall be resolved in favor of coverage. For a particular | ||
| 302 | product received by a particular user, "normally used" refers to a | ||
| 303 | typical or common use of that class of product, regardless of the status | ||
| 304 | of the particular user or of the way in which the particular user | ||
| 305 | actually uses, or expects or is expected to use, the product. A product | ||
| 306 | is a consumer product regardless of whether the product has substantial | ||
| 307 | commercial, industrial or non-consumer uses, unless such uses represent | ||
| 308 | the only significant mode of use of the product. | ||
| 309 | |||
| 310 | "Installation Information" for a User Product means any methods, | ||
| 311 | procedures, authorization keys, or other information required to install | ||
| 312 | and execute modified versions of a covered work in that User Product from | ||
| 313 | a modified version of its Corresponding Source. The information must | ||
| 314 | suffice to ensure that the continued functioning of the modified object | ||
| 315 | code is in no case prevented or interfered with solely because | ||
| 316 | modification has been made. | ||
| 317 | |||
| 318 | If you convey an object code work under this section in, or with, or | ||
| 319 | specifically for use in, a User Product, and the conveying occurs as | ||
| 320 | part of a transaction in which the right of possession and use of the | ||
| 321 | User Product is transferred to the recipient in perpetuity or for a | ||
| 322 | fixed term (regardless of how the transaction is characterized), the | ||
| 323 | Corresponding Source conveyed under this section must be accompanied | ||
| 324 | by the Installation Information. But this requirement does not apply | ||
| 325 | if neither you nor any third party retains the ability to install | ||
| 326 | modified object code on the User Product (for example, the work has | ||
| 327 | been installed in ROM). | ||
| 328 | |||
| 329 | The requirement to provide Installation Information does not include a | ||
| 330 | requirement to continue to provide support service, warranty, or updates | ||
| 331 | for a work that has been modified or installed by the recipient, or for | ||
| 332 | the User Product in which it has been modified or installed. Access to a | ||
| 333 | network may be denied when the modification itself materially and | ||
| 334 | adversely affects the operation of the network or violates the rules and | ||
| 335 | protocols for communication across the network. | ||
| 336 | |||
| 337 | Corresponding Source conveyed, and Installation Information provided, | ||
| 338 | in accord with this section must be in a format that is publicly | ||
| 339 | documented (and with an implementation available to the public in | ||
| 340 | source code form), and must require no special password or key for | ||
| 341 | unpacking, reading or copying. | ||
| 342 | |||
| 343 | 7. Additional Terms. | ||
| 344 | |||
| 345 | "Additional permissions" are terms that supplement the terms of this | ||
| 346 | License by making exceptions from one or more of its conditions. | ||
| 347 | Additional permissions that are applicable to the entire Program shall | ||
| 348 | be treated as though they were included in this License, to the extent | ||
| 349 | that they are valid under applicable law. If additional permissions | ||
| 350 | apply only to part of the Program, that part may be used separately | ||
| 351 | under those permissions, but the entire Program remains governed by | ||
| 352 | this License without regard to the additional permissions. | ||
| 353 | |||
| 354 | When you convey a copy of a covered work, you may at your option | ||
| 355 | remove any additional permissions from that copy, or from any part of | ||
| 356 | it. (Additional permissions may be written to require their own | ||
| 357 | removal in certain cases when you modify the work.) You may place | ||
| 358 | additional permissions on material, added by you to a covered work, | ||
| 359 | for which you have or can give appropriate copyright permission. | ||
| 360 | |||
| 361 | Notwithstanding any other provision of this License, for material you | ||
| 362 | add to a covered work, you may (if authorized by the copyright holders of | ||
| 363 | that material) supplement the terms of this License with terms: | ||
| 364 | |||
| 365 | a) Disclaiming warranty or limiting liability differently from the | ||
| 366 | terms of sections 15 and 16 of this License; or | ||
| 367 | |||
| 368 | b) Requiring preservation of specified reasonable legal notices or | ||
| 369 | author attributions in that material or in the Appropriate Legal | ||
| 370 | Notices displayed by works containing it; or | ||
| 371 | |||
| 372 | c) Prohibiting misrepresentation of the origin of that material, or | ||
| 373 | requiring that modified versions of such material be marked in | ||
| 374 | reasonable ways as different from the original version; or | ||
| 375 | |||
| 376 | d) Limiting the use for publicity purposes of names of licensors or | ||
| 377 | authors of the material; or | ||
| 378 | |||
| 379 | e) Declining to grant rights under trademark law for use of some | ||
| 380 | trade names, trademarks, or service marks; or | ||
| 381 | |||
| 382 | f) Requiring indemnification of licensors and authors of that | ||
| 383 | material by anyone who conveys the material (or modified versions of | ||
| 384 | it) with contractual assumptions of liability to the recipient, for | ||
| 385 | any liability that these contractual assumptions directly impose on | ||
| 386 | those licensors and authors. | ||
| 387 | |||
| 388 | All other non-permissive additional terms are considered "further | ||
| 389 | restrictions" within the meaning of section 10. If the Program as you | ||
| 390 | received it, or any part of it, contains a notice stating that it is | ||
| 391 | governed by this License along with a term that is a further | ||
| 392 | restriction, you may remove that term. If a license document contains | ||
| 393 | a further restriction but permits relicensing or conveying under this | ||
| 394 | License, you may add to a covered work material governed by the terms | ||
| 395 | of that license document, provided that the further restriction does | ||
| 396 | not survive such relicensing or conveying. | ||
| 397 | |||
| 398 | If you add terms to a covered work in accord with this section, you | ||
| 399 | must place, in the relevant source files, a statement of the | ||
| 400 | additional terms that apply to those files, or a notice indicating | ||
| 401 | where to find the applicable terms. | ||
| 402 | |||
| 403 | Additional terms, permissive or non-permissive, may be stated in the | ||
| 404 | form of a separately written license, or stated as exceptions; | ||
| 405 | the above requirements apply either way. | ||
| 406 | |||
| 407 | 8. Termination. | ||
| 408 | |||
| 409 | You may not propagate or modify a covered work except as expressly | ||
| 410 | provided under this License. Any attempt otherwise to propagate or | ||
| 411 | modify it is void, and will automatically terminate your rights under | ||
| 412 | this License (including any patent licenses granted under the third | ||
| 413 | paragraph of section 11). | ||
| 414 | |||
| 415 | However, if you cease all violation of this License, then your | ||
| 416 | license from a particular copyright holder is reinstated (a) | ||
| 417 | provisionally, unless and until the copyright holder explicitly and | ||
| 418 | finally terminates your license, and (b) permanently, if the copyright | ||
| 419 | holder fails to notify you of the violation by some reasonable means | ||
| 420 | prior to 60 days after the cessation. | ||
| 421 | |||
| 422 | Moreover, your license from a particular copyright holder is | ||
| 423 | reinstated permanently if the copyright holder notifies you of the | ||
| 424 | violation by some reasonable means, this is the first time you have | ||
| 425 | received notice of violation of this License (for any work) from that | ||
| 426 | copyright holder, and you cure the violation prior to 30 days after | ||
| 427 | your receipt of the notice. | ||
| 428 | |||
| 429 | Termination of your rights under this section does not terminate the | ||
| 430 | licenses of parties who have received copies or rights from you under | ||
| 431 | this License. If your rights have been terminated and not permanently | ||
| 432 | reinstated, you do not qualify to receive new licenses for the same | ||
| 433 | material under section 10. | ||
| 434 | |||
| 435 | 9. Acceptance Not Required for Having Copies. | ||
| 436 | |||
| 437 | You are not required to accept this License in order to receive or | ||
| 438 | run a copy of the Program. Ancillary propagation of a covered work | ||
| 439 | occurring solely as a consequence of using peer-to-peer transmission | ||
| 440 | to receive a copy likewise does not require acceptance. However, | ||
| 441 | nothing other than this License grants you permission to propagate or | ||
| 442 | modify any covered work. These actions infringe copyright if you do | ||
| 443 | not accept this License. Therefore, by modifying or propagating a | ||
| 444 | covered work, you indicate your acceptance of this License to do so. | ||
| 445 | |||
| 446 | 10. Automatic Licensing of Downstream Recipients. | ||
| 447 | |||
| 448 | Each time you convey a covered work, the recipient automatically | ||
| 449 | receives a license from the original licensors, to run, modify and | ||
| 450 | propagate that work, subject to this License. You are not responsible | ||
| 451 | for enforcing compliance by third parties with this License. | ||
| 452 | |||
| 453 | An "entity transaction" is a transaction transferring control of an | ||
| 454 | organization, or substantially all assets of one, or subdividing an | ||
| 455 | organization, or merging organizations. If propagation of a covered | ||
| 456 | work results from an entity transaction, each party to that | ||
| 457 | transaction who receives a copy of the work also receives whatever | ||
| 458 | licenses to the work the party's predecessor in interest had or could | ||
| 459 | give under the previous paragraph, plus a right to possession of the | ||
| 460 | Corresponding Source of the work from the predecessor in interest, if | ||
| 461 | the predecessor has it or can get it with reasonable efforts. | ||
| 462 | |||
| 463 | You may not impose any further restrictions on the exercise of the | ||
| 464 | rights granted or affirmed under this License. For example, you may | ||
| 465 | not impose a license fee, royalty, or other charge for exercise of | ||
| 466 | rights granted under this License, and you may not initiate litigation | ||
| 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | ||
| 468 | any patent claim is infringed by making, using, selling, offering for | ||
| 469 | sale, or importing the Program or any portion of it. | ||
| 470 | |||
| 471 | 11. Patents. | ||
| 472 | |||
| 473 | A "contributor" is a copyright holder who authorizes use under this | ||
| 474 | License of the Program or a work on which the Program is based. The | ||
| 475 | work thus licensed is called the contributor's "contributor version". | ||
| 476 | |||
| 477 | A contributor's "essential patent claims" are all patent claims | ||
| 478 | owned or controlled by the contributor, whether already acquired or | ||
| 479 | hereafter acquired, that would be infringed by some manner, permitted | ||
| 480 | by this License, of making, using, or selling its contributor version, | ||
| 481 | but do not include claims that would be infringed only as a | ||
| 482 | consequence of further modification of the contributor version. For | ||
| 483 | purposes of this definition, "control" includes the right to grant | ||
| 484 | patent sublicenses in a manner consistent with the requirements of | ||
| 485 | this License. | ||
| 486 | |||
| 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | ||
| 488 | patent license under the contributor's essential patent claims, to | ||
| 489 | make, use, sell, offer for sale, import and otherwise run, modify and | ||
| 490 | propagate the contents of its contributor version. | ||
| 491 | |||
| 492 | In the following three paragraphs, a "patent license" is any express | ||
| 493 | agreement or commitment, however denominated, not to enforce a patent | ||
| 494 | (such as an express permission to practice a patent or covenant not to | ||
| 495 | sue for patent infringement). To "grant" such a patent license to a | ||
| 496 | party means to make such an agreement or commitment not to enforce a | ||
| 497 | patent against the party. | ||
| 498 | |||
| 499 | If you convey a covered work, knowingly relying on a patent license, | ||
| 500 | and the Corresponding Source of the work is not available for anyone | ||
| 501 | to copy, free of charge and under the terms of this License, through a | ||
| 502 | publicly available network server or other readily accessible means, | ||
| 503 | then you must either (1) cause the Corresponding Source to be so | ||
| 504 | available, or (2) arrange to deprive yourself of the benefit of the | ||
| 505 | patent license for this particular work, or (3) arrange, in a manner | ||
| 506 | consistent with the requirements of this License, to extend the patent | ||
| 507 | license to downstream recipients. "Knowingly relying" means you have | ||
| 508 | actual knowledge that, but for the patent license, your conveying the | ||
| 509 | covered work in a country, or your recipient's use of the covered work | ||
| 510 | in a country, would infringe one or more identifiable patents in that | ||
| 511 | country that you have reason to believe are valid. | ||
| 512 | |||
| 513 | If, pursuant to or in connection with a single transaction or | ||
| 514 | arrangement, you convey, or propagate by procuring conveyance of, a | ||
| 515 | covered work, and grant a patent license to some of the parties | ||
| 516 | receiving the covered work authorizing them to use, propagate, modify | ||
| 517 | or convey a specific copy of the covered work, then the patent license | ||
| 518 | you grant is automatically extended to all recipients of the covered | ||
| 519 | work and works based on it. | ||
| 520 | |||
| 521 | A patent license is "discriminatory" if it does not include within | ||
| 522 | the scope of its coverage, prohibits the exercise of, or is | ||
| 523 | conditioned on the non-exercise of one or more of the rights that are | ||
| 524 | specifically granted under this License. You may not convey a covered | ||
| 525 | work if you are a party to an arrangement with a third party that is | ||
| 526 | in the business of distributing software, under which you make payment | ||
| 527 | to the third party based on the extent of your activity of conveying | ||
| 528 | the work, and under which the third party grants, to any of the | ||
| 529 | parties who would receive the covered work from you, a discriminatory | ||
| 530 | patent license (a) in connection with copies of the covered work | ||
| 531 | conveyed by you (or copies made from those copies), or (b) primarily | ||
| 532 | for and in connection with specific products or compilations that | ||
| 533 | contain the covered work, unless you entered into that arrangement, | ||
| 534 | or that patent license was granted, prior to 28 March 2007. | ||
| 535 | |||
| 536 | Nothing in this License shall be construed as excluding or limiting | ||
| 537 | any implied license or other defenses to infringement that may | ||
| 538 | otherwise be available to you under applicable patent law. | ||
| 539 | |||
| 540 | 12. No Surrender of Others' Freedom. | ||
| 541 | |||
| 542 | If conditions are imposed on you (whether by court order, agreement or | ||
| 543 | otherwise) that contradict the conditions of this License, they do not | ||
| 544 | excuse you from the conditions of this License. If you cannot convey a | ||
| 545 | covered work so as to satisfy simultaneously your obligations under this | ||
| 546 | License and any other pertinent obligations, then as a consequence you may | ||
| 547 | not convey it at all. For example, if you agree to terms that obligate you | ||
| 548 | to collect a royalty for further conveying from those to whom you convey | ||
| 549 | the Program, the only way you could satisfy both those terms and this | ||
| 550 | License would be to refrain entirely from conveying the Program. | ||
| 551 | |||
| 552 | 13. Use with the GNU Affero General Public License. | ||
| 553 | |||
| 554 | Notwithstanding any other provision of this License, you have | ||
| 555 | permission to link or combine any covered work with a work licensed | ||
| 556 | under version 3 of the GNU Affero General Public License into a single | ||
| 557 | combined work, and to convey the resulting work. The terms of this | ||
| 558 | License will continue to apply to the part which is the covered work, | ||
| 559 | but the special requirements of the GNU Affero General Public License, | ||
| 560 | section 13, concerning interaction through a network will apply to the | ||
| 561 | combination as such. | ||
| 562 | |||
| 563 | 14. Revised Versions of this License. | ||
| 564 | |||
| 565 | The Free Software Foundation may publish revised and/or new versions of | ||
| 566 | the GNU General Public License from time to time. Such new versions will | ||
| 567 | be similar in spirit to the present version, but may differ in detail to | ||
| 568 | address new problems or concerns. | ||
| 569 | |||
| 570 | Each version is given a distinguishing version number. If the | ||
| 571 | Program specifies that a certain numbered version of the GNU General | ||
| 572 | Public License "or any later version" applies to it, you have the | ||
| 573 | option of following the terms and conditions either of that numbered | ||
| 574 | version or of any later version published by the Free Software | ||
| 575 | Foundation. If the Program does not specify a version number of the | ||
| 576 | GNU General Public License, you may choose any version ever published | ||
| 577 | by the Free Software Foundation. | ||
| 578 | |||
| 579 | If the Program specifies that a proxy can decide which future | ||
| 580 | versions of the GNU General Public License can be used, that proxy's | ||
| 581 | public statement of acceptance of a version permanently authorizes you | ||
| 582 | to choose that version for the Program. | ||
| 583 | |||
| 584 | Later license versions may give you additional or different | ||
| 585 | permissions. However, no additional obligations are imposed on any | ||
| 586 | author or copyright holder as a result of your choosing to follow a | ||
| 587 | later version. | ||
| 588 | |||
| 589 | 15. Disclaimer of Warranty. | ||
| 590 | |||
| 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | ||
| 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | ||
| 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | ||
| 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | ||
| 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | ||
| 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | ||
| 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
| 599 | |||
| 600 | 16. Limitation of Liability. | ||
| 601 | |||
| 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | ||
| 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | ||
| 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | ||
| 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | ||
| 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | ||
| 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | ||
| 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||
| 610 | SUCH DAMAGES. | ||
| 611 | |||
| 612 | 17. Interpretation of Sections 15 and 16. | ||
| 613 | |||
| 614 | If the disclaimer of warranty and limitation of liability provided | ||
| 615 | above cannot be given local legal effect according to their terms, | ||
| 616 | reviewing courts shall apply local law that most closely approximates | ||
| 617 | an absolute waiver of all civil liability in connection with the | ||
| 618 | Program, unless a warranty or assumption of liability accompanies a | ||
| 619 | copy of the Program in return for a fee. | ||
| 620 | |||
| 621 | END OF TERMS AND CONDITIONS | ||
| 622 | |||
| 623 | How to Apply These Terms to Your New Programs | ||
| 624 | |||
| 625 | If you develop a new program, and you want it to be of the greatest | ||
| 626 | possible use to the public, the best way to achieve this is to make it | ||
| 627 | free software which everyone can redistribute and change under these terms. | ||
| 628 | |||
| 629 | To do so, attach the following notices to the program. It is safest | ||
| 630 | to attach them to the start of each source file to most effectively | ||
| 631 | state the exclusion of warranty; and each file should have at least | ||
| 632 | the "copyright" line and a pointer to where the full notice is found. | ||
| 633 | |||
| 634 | <one line to give the program's name and a brief idea of what it does.> | ||
| 635 | Copyright (C) <year> <name of author> | ||
| 636 | |||
| 637 | This program is free software: you can redistribute it and/or modify | ||
| 638 | it under the terms of the GNU General Public License as published by | ||
| 639 | the Free Software Foundation, either version 3 of the License, or | ||
| 640 | (at your option) any later version. | ||
| 641 | |||
| 642 | This program is distributed in the hope that it will be useful, | ||
| 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 645 | GNU General Public License for more details. | ||
| 646 | |||
| 647 | You should have received a copy of the GNU General Public License | ||
| 648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 649 | |||
| 650 | Also add information on how to contact you by electronic and paper mail. | ||
| 651 | |||
| 652 | If the program does terminal interaction, make it output a short | ||
| 653 | notice like this when it starts in an interactive mode: | ||
| 654 | |||
| 655 | <program> Copyright (C) <year> <name of author> | ||
| 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
| 657 | This is free software, and you are welcome to redistribute it | ||
| 658 | under certain conditions; type `show c' for details. | ||
| 659 | |||
| 660 | The hypothetical commands `show w' and `show c' should show the appropriate | ||
| 661 | parts of the General Public License. Of course, your program's commands | ||
| 662 | might be different; for a GUI interface, you would use an "about box". | ||
| 663 | |||
| 664 | You should also get your employer (if you work as a programmer) or school, | ||
| 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | ||
| 666 | For more information on this, and how to apply and follow the GNU GPL, see | ||
| 667 | <http://www.gnu.org/licenses/>. | ||
| 668 | |||
| 669 | The GNU General Public License does not permit incorporating your program | ||
| 670 | into proprietary programs. If your program is a subroutine library, you | ||
| 671 | may consider it more useful to permit linking proprietary applications with | ||
| 672 | the library. If this is what you want to do, use the GNU Lesser General | ||
| 673 | Public License instead of this License. But first, please read | ||
| 674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. |
|   | |||
| 1 | /** | ||
| 2 | * @version Alpha 0.1 2008-05-10 23:28:43 $ | ||
| 3 | * @package Silver skin for WYMeditor | ||
| 4 | * @copyright Copyright (C) 2008 Scott Edwin Lewis. All rights reserved. | ||
| 5 | * @license GNU/GPL, see COPYING | ||
| 6 | * Silver skin for WYMeditor is free software and is licensed under the | ||
| 7 | * GNU General Public License. See COPYING for copyright notices and details. | ||
| 8 | */ | ||
| 9 | |||
| 10 | Adds custom buttons and color palette to the WYMeditor XHTML Editor. | ||
| 11 | |||
| 12 | INSTALLATION: | ||
| 13 | |||
| 14 | 1. Copy the entire /silver/ directory to /wymeditor/skins/ | ||
| 15 | 2. Initialize the WYMeditor 'skin' option as below: | ||
| 16 | |||
| 17 | <script type="text/javascript"> | ||
| 18 | jQuery(function() { | ||
| 19 | |||
| 20 | jQuery('.wymeditor').wymeditor({ | ||
| 21 | skin: 'silver' | ||
| 22 | }); | ||
| 23 | |||
| 24 | }); | ||
| 25 | </script> | ||
| 26 | |||
| 27 | That's it. You're done. |
Binary files differ
Binary files differ
Binary files differ
Binary files differ
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * screen.css | ||
| 12 | * main stylesheet for the default WYMeditor skin | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 17 | * Scott Edwin Lewis | ||
| 18 | */ | ||
| 19 | |||
| 20 | /*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ | ||
| 21 | .wym_skin_silver p, .wym_skin_silver h2, .wym_skin_silver h3, | ||
| 22 | .wym_skin_silver ul, .wym_skin_silver li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } | ||
| 23 | |||
| 24 | |||
| 25 | /*HIDDEN BY DEFAULT*/ | ||
| 26 | .wym_skin_silver .wym_area_left { display: none; } | ||
| 27 | .wym_skin_silver .wym_area_right { display: block; } | ||
| 28 | |||
| 29 | |||
| 30 | /*TYPO*/ | ||
| 31 | .wym_skin_silver { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } | ||
| 32 | .wym_skin_silver h2 { font-size: 110%; /* = 11px */} | ||
| 33 | .wym_skin_silver h3 { font-size: 100%; /* = 10px */} | ||
| 34 | .wym_skin_silver li { font-size: 100%; /* = 10px */} | ||
| 35 | |||
| 36 | |||
| 37 | /*WYM_BOX*/ | ||
| 38 | .wym_skin_silver { border: 1px solid gray; background: #f2f2f2; padding: 0px; margin: 0px;} | ||
| 39 | |||
| 40 | /*auto-clear the wym_box*/ | ||
| 41 | .wym_skin_silver:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 42 | * html .wym_skin_silver { height: 1%;} | ||
| 43 | |||
| 44 | |||
| 45 | /*WYM_HTML*/ | ||
| 46 | .wym_skin_silver .wym_html { width: 98%;} | ||
| 47 | .wym_skin_silver .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } | ||
| 48 | |||
| 49 | |||
| 50 | /*WYM_IFRAME*/ | ||
| 51 | .wym_skin_silver .wym_iframe { width: 98%;} | ||
| 52 | .wym_skin_silver .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } | ||
| 53 | |||
| 54 | |||
| 55 | /*AREAS*/ | ||
| 56 | .wym_skin_silver .wym_area_left { width: 150px; float: left;} | ||
| 57 | .wym_skin_silver .wym_area_right { width: 150px; float: right;} | ||
| 58 | .wym_skin_silver .wym_area_bottom { height: 1%; clear: both;} | ||
| 59 | * html .wym_skin_silver .wym_area_main { height: 1%;} | ||
| 60 | * html .wym_skin_silver .wym_area_top { height: 1%;} | ||
| 61 | *+html .wym_skin_silver .wym_area_top { height: 1%;} | ||
| 62 | |||
| 63 | /*SECTIONS SYSTEM*/ | ||
| 64 | |||
| 65 | /*common defaults for all sections*/ | ||
| 66 | .wym_skin_silver .wym_section { margin-bottom: 5px; } | ||
| 67 | .wym_skin_silver .wym_section h2, | ||
| 68 | .wym_skin_silver .wym_section h3 { padding: 1px 3px; margin: 0; cursor: pointer; } | ||
| 69 | .wym_skin_silver .wym_section a { padding: 5px 0px 0px 10px; display: block; text-decoration: none; color: black; } | ||
| 70 | .wym_skin_silver .wym_section a:hover { /*background-color: #DDD;*/} | ||
| 71 | /*hide section titles by default*/ | ||
| 72 | .wym_skin_silver .wym_section h2 { display: none; } | ||
| 73 | /*disable any margin-collapse*/ | ||
| 74 | .wym_skin_silver .wym_section { padding-top: 1px; padding-bottom: 1px; } | ||
| 75 | /*auto-clear sections*/ | ||
| 76 | .wym_skin_silver .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; padding: 0px; } | ||
| 77 | * html .wym_skin_silver .wym_section ul { height: 1%;} | ||
| 78 | .wym_skin_silver .wym_section li {} | ||
| 79 | |||
| 80 | /*option: add this class to a section to make it render as a panel*/ | ||
| 81 | .wym_skin_silver .wym_panel { } | ||
| 82 | .wym_skin_silver .wym_panel h2 { display: block; font-size: 11px; } | ||
| 83 | |||
| 84 | /*option: add this class to a section to make it render as a dropdown menu*/ | ||
| 85 | .wym_skin_silver .wym_dropdown h2 { display: block; font-size: 11px;} | ||
| 86 | .wym_skin_silver .wym_dropdown ul { position: absolute; background: white; padding: 0px;} | ||
| 87 | .wym_skin_silver .wym_dropdown:hover ul, | ||
| 88 | .wym_skin_silver .wym_dropdown.hover ul { cursor: pointer;} | ||
| 89 | .wym_skin_silver .wym_dropdown ul li a {/*border-bottom: 1px solid #AAA;*/} | ||
| 90 | |||
| 91 | /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ | ||
| 92 | .wym_skin_silver .wym_buttons li { float:left;} | ||
| 93 | .wym_skin_silver .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px; text-decoration: none !important; border: 1px solid #666; } | ||
| 94 | .wym_skin_silver .wym_buttons a:hover { text-decoration: none !important; border: 1px solid #000;} | ||
| 95 | /*image replacements*/ | ||
| 96 | .wym_skin_silver .wym_buttons li a { background: url(images/icons.silver.gif) no-repeat; text-indent: -9999px;} | ||
| 97 | .wym_skin_silver .wym_buttons li.wym_tools_strong a { background-position: 0 -384px;} | ||
| 98 | .wym_skin_silver .wym_buttons li.wym_tools_emphasis a { background-position: 0 -24px;} | ||
| 99 | .wym_skin_silver .wym_buttons li.wym_tools_superscript a { background-position: 0 -432px;} | ||
| 100 | .wym_skin_silver .wym_buttons li.wym_tools_subscript a { background-position: 0 -456px;} | ||
| 101 | .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} | ||
| 102 | .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} | ||
| 103 | .wym_skin_silver .wym_buttons li.wym_tools_indent a { background-position: 0 -600px;} | ||
| 104 | .wym_skin_silver .wym_buttons li.wym_tools_outdent a { background-position: 0 -624px;} | ||
| 105 | .wym_skin_silver .wym_buttons li.wym_tools_undo a { background-position: 0 -504px;} | ||
| 106 | .wym_skin_silver .wym_buttons li.wym_tools_redo a { background-position: 0 -528px;} | ||
| 107 | .wym_skin_silver .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} | ||
| 108 | .wym_skin_silver .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} | ||
| 109 | .wym_skin_silver .wym_buttons li.wym_tools_image a { background-position: 0 -120px;} | ||
| 110 | .wym_skin_silver .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} | ||
| 111 | .wym_skin_silver .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} | ||
| 112 | .wym_skin_silver .wym_buttons li.wym_tools_html a { background-position: 0 -192px;} | ||
| 113 | .wym_skin_silver .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} | ||
| 114 | .wym_skin_silver .wym_buttons li.wym_tools_gadget a { background-position: 0 -576px;} | ||
| 115 | |||
| 116 | .wym_skin_silver .wym_buttons li.wym_tools_strong a:hover { background-position: -24px -384px;} | ||
| 117 | .wym_skin_silver .wym_buttons li.wym_tools_emphasis a:hover { background-position: -24px -24px;} | ||
| 118 | .wym_skin_silver .wym_buttons li.wym_tools_superscript a:hover { background-position: -24px -432px;} | ||
| 119 | .wym_skin_silver .wym_buttons li.wym_tools_subscript a:hover { background-position: -24px -456px;} | ||
| 120 | .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a:hover { background-position: -24px -48px;} | ||
| 121 | .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a:hover{ background-position: -24px -72px;} | ||
| 122 | .wym_skin_silver .wym_buttons li.wym_tools_indent a:hover { background-position: -24px -600px;} | ||
| 123 | .wym_skin_silver .wym_buttons li.wym_tools_outdent a:hover { background-position: -24px -624px;} | ||
| 124 | .wym_skin_silver .wym_buttons li.wym_tools_undo a:hover { background-position: -24px -504px;} | ||
| 125 | .wym_skin_silver .wym_buttons li.wym_tools_redo a:hover { background-position: -24px -528px;} | ||
| 126 | .wym_skin_silver .wym_buttons li.wym_tools_link a:hover { background-position: -24px -96px;} | ||
| 127 | .wym_skin_silver .wym_buttons li.wym_tools_unlink a:hover { background-position: -24px -168px;} | ||
| 128 | .wym_skin_silver .wym_buttons li.wym_tools_image a:hover { background-position: -24px -120px;} | ||
| 129 | .wym_skin_silver .wym_buttons li.wym_tools_table a:hover { background-position: -24px -144px;} | ||
| 130 | .wym_skin_silver .wym_buttons li.wym_tools_paste a:hover { background-position: -24px -552px;} | ||
| 131 | .wym_skin_silver .wym_buttons li.wym_tools_html a:hover { background-position: -24px -192px;} | ||
| 132 | .wym_skin_silver .wym_buttons li.wym_tools_preview a:hover { background-position: -24px -408px;} | ||
| 133 | .wym_skin_silver .wym_buttons li.wym_tools_gadget a:hover { background-position: -24px -576px;} | ||
| 134 | |||
| 135 | /*DECORATION*/ | ||
| 136 | .wym_skin_silver .wym_section h2 { background: #ddd; border: none;} | ||
| 137 | .wym_skin_silver .wym_section h2 span { color: gray;} | ||
| 138 | .wym_skin_silver .wym_panel { padding: 0; border: solid gray; border-width: 0px;} | ||
| 139 | .wym_skin_silver .wym_panel ul { margin: 2px 0 5px; } | ||
| 140 | .wym_skin_silver .wym_dropdown { padding: 0; border: none; } | ||
| 141 | .wym_skin_silver .wym_dropdown ul { border: none; margin-left: -1px; padding: 0px;} | ||
| 142 | |||
| 143 | /*DIALOGS*/ | ||
| 144 | .wym_dialog div.row { margin-bottom: 5px;} | ||
| 145 | .wym_dialog div.row input { margin-right: 5px;} | ||
| 146 | .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } | ||
| 147 | .wym_dialog div.row-indent { padding-left: 160px; } | ||
| 148 | /*autoclearing*/ | ||
| 149 | .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 150 | .wym_dialog div.row { display: inline-block; } | ||
| 151 | /* Hides from IE-mac \*/ | ||
| 152 | * html .wym_dialog div.row { height: 1%; } | ||
| 153 | .wym_dialog div.row { display: block; } | ||
| 154 | /* End hide from IE-mac */ | ||
| 155 | |||
| 156 | /*WYMEDITOR_LINK*/ | ||
| 157 | a.wym_wymeditor_link | ||
| 158 | { | ||
| 159 | text-indent: -9999px; | ||
| 160 | float: right; | ||
| 161 | display: block; | ||
| 162 | width: 50px; | ||
| 163 | height: 15px; | ||
| 164 | background: url(../wymeditor_icon.png); | ||
| 165 | background-position: 1px 1px; | ||
| 166 | background-repeat: no-repeat; | ||
| 167 | overflow: hidden; | ||
| 168 | text-decoration: none; | ||
| 169 | padding: 1px !important; | ||
| 170 | border: 1px solid #333 !important; | ||
| 171 | background-color: #FFF !important; | ||
| 172 | } | ||
| 173 | |||
| 174 | .wym_box | ||
| 175 | { | ||
| 176 | padding: 0px !important; | ||
| 177 | margin: 0px; | ||
| 178 | } | ||
| 179 | .wym_inner | ||
| 180 | { | ||
| 181 | border-left: 1px solid #FFF; | ||
| 182 | border-top: 1px solid #FFF; | ||
| 183 | border-right: 1px solid #FFF; | ||
| 184 | border-bottom: 1px solid #FFF; | ||
| 185 | padding: 5px; | ||
| 186 | background-color: #B8C1C4; | ||
| 187 | height: auto; | ||
| 188 | } | ||
| 189 | |||
| 190 | .clear {clear: both;} | ||
| 191 | |||
| 192 | div.wym_dropdown | ||
| 193 | { | ||
| 194 | cursor: pointer; | ||
| 195 | width: 138px !important; | ||
| 196 | margin: 0px 4px 10px 0px !important; | ||
| 197 | padding: 0px; | ||
| 198 | z-index: 1001; | ||
| 199 | display: block; | ||
| 200 | border: 1px solid red; | ||
| 201 | } | ||
| 202 | |||
| 203 | div.wym_dropdown ul | ||
| 204 | { | ||
| 205 | display: none; | ||
| 206 | width: 124px; | ||
| 207 | padding: 0px !important; | ||
| 208 | margin: 0px !important; | ||
| 209 | list-style-type: none; | ||
| 210 | list-style-image: none; | ||
| 211 | z-index: 1002; | ||
| 212 | position: absolute; | ||
| 213 | border-top: 1px solid #AAA; | ||
| 214 | } | ||
| 215 | |||
| 216 | div.wym_dropdown ul li | ||
| 217 | { | ||
| 218 | width: 146px; | ||
| 219 | height: 20px; | ||
| 220 | padding: 0px !important; | ||
| 221 | margin: 0px; | ||
| 222 | border: 1px solid #777; | ||
| 223 | border-top: none; | ||
| 224 | background: #DDD; | ||
| 225 | list-style-image: none; | ||
| 226 | } | ||
| 227 | |||
| 228 | div.wym_dropdown h2 | ||
| 229 | { | ||
| 230 | width: 138px; | ||
| 231 | height: 16px; | ||
| 232 | color: #000 !important; | ||
| 233 | background-image: url(images/bg.selector.silver.gif) !important; | ||
| 234 | background-position: 0px -18px; | ||
| 235 | background-repeat: no-repeat; | ||
| 236 | border: none; | ||
| 237 | font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; | ||
| 238 | font-size: 12px !important; | ||
| 239 | font-weight: bold !important; | ||
| 240 | padding: 2px 0px 0px 10px !important; | ||
| 241 | margin: 0px !important; | ||
| 242 | } | ||
| 243 | |||
| 244 | .wym_skin_silver .wym_panel h2 | ||
| 245 | { | ||
| 246 | width: 138px; | ||
| 247 | height: 16px; | ||
| 248 | color: #000 !important; | ||
| 249 | background-image: url(images/bg.header.gif) !important; | ||
| 250 | background-position: 0px 0px; | ||
| 251 | background-repeat: no-repeat; | ||
| 252 | border: none; | ||
| 253 | font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; | ||
| 254 | font-size: 12px !important; | ||
| 255 | font-weight: bold !important; | ||
| 256 | padding: 2px 0px 0px 10px !important; | ||
| 257 | margin: 0px !important; | ||
| 258 | } | ||
| 259 | |||
| 260 | .wym_skin_silver .wym_panel ul | ||
| 261 | { | ||
| 262 | margin-top: 0px !important; | ||
| 263 | } | ||
| 264 | |||
| 265 | .wym_skin_silver .wym_panel ul li | ||
| 266 | { | ||
| 267 | width: 146px; | ||
| 268 | height: 20px; | ||
| 269 | padding: 0px !important; | ||
| 270 | margin: 0px; | ||
| 271 | border: 1px solid #777; | ||
| 272 | border-top: none; | ||
| 273 | background: #DDD; | ||
| 274 | list-style-image: none; | ||
| 275 | } | ||
| 276 | |||
| 277 | .wym_skin_silver .wym_panel a, | ||
| 278 | div.wym_dropdown a | ||
| 279 | { | ||
| 280 | text-decoration: none; | ||
| 281 | font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; | ||
| 282 | font-size: 12px; | ||
| 283 | padding: 5px 0px 0px 10px !important; | ||
| 284 | display: block; | ||
| 285 | width: 136px; | ||
| 286 | height: 15px; | ||
| 287 | color: #000; | ||
| 288 | text-align: left !important; | ||
| 289 | margin-left: 0px !important; | ||
| 290 | } | ||
| 291 | |||
| 292 | div.wym_dropdown a:hover, | ||
| 293 | .wym_skin_silver .wym_panel a:hover | ||
| 294 | { | ||
| 295 | background: #BBB; | ||
| 296 | border-bottom: none !important; | ||
| 297 | } |
|   | |||
| 1 | /* This file is part of the Silver skin for WYMeditor by Scott Edwin Lewis */ | ||
| 2 | |||
| 3 | jQuery.fn.selectify = function() { | ||
| 4 | return this.each(function() { | ||
| 5 | jQuery(this).hover( | ||
| 6 | function() { | ||
| 7 | jQuery("h2", this).css("background-position", "0px -18px"); | ||
| 8 | jQuery("ul", this).fadeIn("fast"); | ||
| 9 | }, | ||
| 10 | function() { | ||
| 11 | jQuery("h2", this).css("background-position", ""); | ||
| 12 | jQuery("ul", this).fadeOut("fast"); | ||
| 13 | } | ||
| 14 | ); | ||
| 15 | }); | ||
| 16 | }; | ||
| 17 | |||
| 18 | WYMeditor.SKINS['silver'] = { | ||
| 19 | |||
| 20 | init: function(wym) { | ||
| 21 | |||
| 22 | //add some elements to improve the rendering | ||
| 23 | jQuery(wym._box) | ||
| 24 | .append('<div class="clear"></div>') | ||
| 25 | .wrapInner('<div class="wym_inner"></div>'); | ||
| 26 | |||
| 27 | //render following sections as panels | ||
| 28 | jQuery(wym._box).find(wym._options.classesSelector) | ||
| 29 | .addClass("wym_panel"); | ||
| 30 | |||
| 31 | //render following sections as buttons | ||
| 32 | jQuery(wym._box).find(wym._options.toolsSelector) | ||
| 33 | .addClass("wym_buttons"); | ||
| 34 | |||
| 35 | //render following sections as dropdown menus | ||
| 36 | jQuery(wym._box).find(wym._options.containersSelector) | ||
| 37 | .addClass("wym_dropdown") | ||
| 38 | .selectify(); | ||
| 39 | |||
| 40 | // auto add some margin to the main area sides if left area | ||
| 41 | // or right area are not empty (if they contain sections) | ||
| 42 | jQuery(wym._box).find("div.wym_area_right ul") | ||
| 43 | .parents("div.wym_area_right").show() | ||
| 44 | .parents(wym._options.boxSelector) | ||
| 45 | .find("div.wym_area_main") | ||
| 46 | .css({"margin-right": "155px"}); | ||
| 47 | |||
| 48 | jQuery(wym._box).find("div.wym_area_left ul") | ||
| 49 | .parents("div.wym_area_left").show() | ||
| 50 | .parents(wym._options.boxSelector) | ||
| 51 | .find("div.wym_area_main") | ||
| 52 | .css({"margin-left": "155px"}); | ||
| 53 | |||
| 54 | //make hover work under IE < 7 | ||
| 55 | jQuery(wym._box).find(".wym_section").hover(function(){ | ||
| 56 | jQuery(this).addClass("hover"); | ||
| 57 | },function(){ | ||
| 58 | jQuery(this).removeClass("hover"); | ||
| 59 | }); | ||
| 60 | } | ||
| 61 | }; |
Binary files differ
|   | |||
| 1 | /* | ||
| 2 | * WYMeditor : what you see is What You Mean web-based editor | ||
| 3 | * Copyright (c) 2008 Jean-Francois Hovinne, http://www.wymeditor.org/ | ||
| 4 | * Dual licensed under the MIT (MIT-license.txt) | ||
| 5 | * and GPL (GPL-license.txt) licenses. | ||
| 6 | * | ||
| 7 | * For further information visit: | ||
| 8 | * http://www.wymeditor.org/ | ||
| 9 | * | ||
| 10 | * File Name: | ||
| 11 | * screen.css | ||
| 12 | * main stylesheet for the WYMeditor skin | ||
| 13 | * See the documentation for more info. | ||
| 14 | * | ||
| 15 | * File Authors: | ||
| 16 | * Daniel Reszka (d.reszka a-t wymeditor dotorg) | ||
| 17 | * Jean-Francois Hovinne | ||
| 18 | */ | ||
| 19 | |||
| 20 | /*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ | ||
| 21 | .wym_skin_twopanels p, .wym_skin_twopanels h2, .wym_skin_twopanels h3, | ||
| 22 | .wym_skin_twopanels ul, .wym_skin_twopanels li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } | ||
| 23 | |||
| 24 | |||
| 25 | /*HIDDEN BY DEFAULT*/ | ||
| 26 | .wym_skin_twopanels .wym_area_left { display: block; } | ||
| 27 | .wym_skin_twopanels .wym_area_right { display: block; } | ||
| 28 | |||
| 29 | |||
| 30 | /*TYPO*/ | ||
| 31 | .wym_skin_twopanels { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } | ||
| 32 | .wym_skin_twopanels h2 { font-size: 110%; /* = 11px */} | ||
| 33 | .wym_skin_twopanels h3 { font-size: 100%; /* = 10px */} | ||
| 34 | .wym_skin_twopanels li { font-size: 100%; /* = 10px */} | ||
| 35 | |||
| 36 | |||
| 37 | /*WYM_BOX*/ | ||
| 38 | .wym_skin_twopanels { border: 1px solid gray; background: #f2f2f2; padding: 5px} | ||
| 39 | |||
| 40 | /*auto-clear the wym_box*/ | ||
| 41 | .wym_skin_twopanels:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 42 | * html .wym_skin_twopanels { height: 1%;} | ||
| 43 | |||
| 44 | |||
| 45 | /*WYM_HTML*/ | ||
| 46 | .wym_skin_twopanels .wym_html { width: 98%;} | ||
| 47 | .wym_skin_twopanels .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } | ||
| 48 | |||
| 49 | |||
| 50 | /*WYM_IFRAME*/ | ||
| 51 | .wym_skin_twopanels .wym_iframe { width: 98%;} | ||
| 52 | .wym_skin_twopanels .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } | ||
| 53 | |||
| 54 | |||
| 55 | /*AREAS*/ | ||
| 56 | .wym_skin_twopanels .wym_area_left { width: 100px; float: left;} | ||
| 57 | .wym_skin_twopanels .wym_area_right { width: 150px; float: right;} | ||
| 58 | .wym_skin_twopanels .wym_area_bottom { height: 1%; clear: both;} | ||
| 59 | * html .wym_skin_twopanels .wym_area_main { height: 1%;} | ||
| 60 | * html .wym_skin_twopanels .wym_area_top { height: 1%;} | ||
| 61 | *+html .wym_skin_twopanels .wym_area_top { height: 1%;} | ||
| 62 | |||
| 63 | /*SECTIONS SYSTEM*/ | ||
| 64 | |||
| 65 | /*common defaults for all sections*/ | ||
| 66 | .wym_skin_twopanels .wym_section { margin-bottom: 5px; } | ||
| 67 | .wym_skin_twopanels .wym_section h2, | ||
| 68 | .wym_skin_twopanels .wym_section h3 { padding: 1px 3px; margin: 0; } | ||
| 69 | .wym_skin_twopanels .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } | ||
| 70 | .wym_skin_twopanels .wym_section a:hover { background-color: yellow; } | ||
| 71 | /*hide section titles by default*/ | ||
| 72 | .wym_skin_twopanels .wym_section h2 { display: none; } | ||
| 73 | /*disable any margin-collapse*/ | ||
| 74 | .wym_skin_twopanels .wym_section { padding-top: 1px; padding-bottom: 1px; } | ||
| 75 | /*auto-clear sections*/ | ||
| 76 | .wym_skin_twopanels .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 77 | * html .wym_skin_twopanels .wym_section ul { height: 1%;} | ||
| 78 | |||
| 79 | /*option: add this class to a section to make it render as a panel*/ | ||
| 80 | .wym_skin_twopanels .wym_panel { } | ||
| 81 | .wym_skin_twopanels .wym_panel h2 { display: block; } | ||
| 82 | |||
| 83 | /*option: add this class to a section to make it render as a dropdown menu*/ | ||
| 84 | .wym_skin_twopanels .wym_dropdown h2 { display: block; } | ||
| 85 | .wym_skin_twopanels .wym_dropdown ul { display: none; position: absolute; background: white; } | ||
| 86 | .wym_skin_twopanels .wym_dropdown:hover ul, | ||
| 87 | .wym_skin_twopanels .wym_dropdown.hover ul { display: block; } | ||
| 88 | |||
| 89 | /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ | ||
| 90 | .wym_skin_twopanels .wym_buttons li { float:left;} | ||
| 91 | .wym_skin_twopanels .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } | ||
| 92 | /*image replacements*/ | ||
| 93 | .wym_skin_twopanels .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} | ||
| 94 | .wym_skin_twopanels .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} | ||
| 95 | .wym_skin_twopanels .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} | ||
| 96 | .wym_skin_twopanels .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} | ||
| 97 | .wym_skin_twopanels .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} | ||
| 98 | .wym_skin_twopanels .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} | ||
| 99 | .wym_skin_twopanels .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} | ||
| 100 | .wym_skin_twopanels .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} | ||
| 101 | .wym_skin_twopanels .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} | ||
| 102 | .wym_skin_twopanels .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} | ||
| 103 | .wym_skin_twopanels .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} | ||
| 104 | .wym_skin_twopanels .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} | ||
| 105 | .wym_skin_twopanels .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} | ||
| 106 | .wym_skin_twopanels .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} | ||
| 107 | .wym_skin_twopanels .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} | ||
| 108 | .wym_skin_twopanels .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} | ||
| 109 | .wym_skin_twopanels .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} | ||
| 110 | .wym_skin_twopanels .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} | ||
| 111 | |||
| 112 | /*DECORATION*/ | ||
| 113 | .wym_skin_twopanels .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} | ||
| 114 | .wym_skin_twopanels .wym_section h2 span { color: gray;} | ||
| 115 | .wym_skin_twopanels .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} | ||
| 116 | .wym_skin_twopanels .wym_panel ul { margin: 2px 0 5px; } | ||
| 117 | .wym_skin_twopanels .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } | ||
| 118 | .wym_skin_twopanels .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} | ||
| 119 | |||
| 120 | /*DIALOGS*/ | ||
| 121 | .wym_dialog div.row { margin-bottom: 5px;} | ||
| 122 | .wym_dialog div.row input { margin-right: 5px;} | ||
| 123 | .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } | ||
| 124 | .wym_dialog div.row-indent { padding-left: 160px; } | ||
| 125 | /*autoclearing*/ | ||
| 126 | .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } | ||
| 127 | .wym_dialog div.row { display: inline-block; } | ||
| 128 | /* Hides from IE-mac \*/ | ||
| 129 | * html .wym_dialog div.row { height: 1%; } | ||
| 130 | .wym_dialog div.row { display: block; } | ||
| 131 | /* End hide from IE-mac */ | ||
| 132 | |||
| 133 | /*WYMEDITOR_LINK*/ | ||
| 134 | a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } |
|   | |||
| 1 | WYMeditor.SKINS['twopanels'] = { | ||
| 2 | |||
| 3 | init: function(wym) { | ||
| 4 | |||
| 5 | //move the containers panel to the left area | ||
| 6 | jQuery(wym._box).find(wym._options.containersSelector) | ||
| 7 | .appendTo("div.wym_area_left"); | ||
| 8 | |||
| 9 | //render following sections as panels | ||
| 10 | jQuery(wym._box).find(wym._options.classesSelector + ', ' | ||
| 11 | + wym._options.containersSelector) | ||
| 12 | .addClass("wym_panel"); | ||
| 13 | |||
| 14 | //render following sections as buttons | ||
| 15 | jQuery(wym._box).find(wym._options.toolsSelector) | ||
| 16 | .addClass("wym_buttons"); | ||
| 17 | |||
| 18 | // auto add some margin to the main area sides if left area | ||
| 19 | // or right area are not empty (if they contain sections) | ||
| 20 | jQuery(wym._box).find("div.wym_area_right ul") | ||
| 21 | .parents("div.wym_area_right").show() | ||
| 22 | .parents(wym._options.boxSelector) | ||
| 23 | .find("div.wym_area_main") | ||
| 24 | .css({"margin-right": "155px"}); | ||
| 25 | |||
| 26 | jQuery(wym._box).find("div.wym_area_left ul") | ||
| 27 | .parents("div.wym_area_left").show() | ||
| 28 | .parents(wym._options.boxSelector) | ||
| 29 | .find("div.wym_area_main") | ||
| 30 | .css({"margin-left": "115px"}); | ||
| 31 | |||
| 32 | //make hover work under IE < 7 | ||
| 33 | jQuery(wym._box).find(".wym_section").hover(function(){ | ||
| 34 | jQuery(this).addClass("hover"); | ||
| 35 | },function(){ | ||
| 36 | jQuery(this).removeClass("hover"); | ||
| 37 | }); | ||
| 38 | } | ||
| 39 | }; |
Binary files differ

