From aca28de01e7327a45ce025303fc2acc5c3813406 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 9 Jun 2018 19:25:33 +0200 Subject: Use WYMeditor as the article text editor. WYMeditor produces much better XHTML than Trumbowyg. --- .../wymeditor/iframe/pretty/development.html | 149 ++++ .../journal/wymeditor/iframe/pretty/icon.png | Bin 0 -> 484 bytes .../journal/wymeditor/iframe/pretty/visitor1.eot | Bin 0 -> 27750 bytes .../journal/wymeditor/iframe/pretty/visitor1.ttf | Bin 0 -> 27552 bytes .../journal/wymeditor/iframe/pretty/visitor1.woff | Bin 0 -> 9296 bytes .../journal/wymeditor/iframe/pretty/wymiframe.css | 395 +++++++++++ .../journal/wymeditor/iframe/pretty/wymiframe.html | 26 + .../wymeditor/iframe/pretty/wymiframe.ie.css | 21 + .../journal/wymeditor/jquery.wymeditor.min.js | 18 + .../plugins/fullscreen/icon_fullscreen.gif | Bin 0 -> 509 bytes .../fullscreen/jquery.wymeditor.fullscreen.js | 126 ++++ .../plugins/list/jquery.wymeditor.list.js | 44 ++ .../plugins/rdfa/jquery.wymeditor.rdfa.js | 192 ++++++ .../plugins/table/jquery.wymeditor.table.js | 761 +++++++++++++++++++++ .../plugins/table/table_delete_column.png | Bin 0 -> 744 bytes .../wymeditor/plugins/table/table_delete_row.png | Bin 0 -> 683 bytes .../plugins/table/table_insert_column.png | Bin 0 -> 720 bytes .../wymeditor/plugins/table/table_insert_row.png | Bin 0 -> 667 bytes .../wymeditor/plugins/table/table_join_row.png | Bin 0 -> 685 bytes static-files/journal/wymeditor/popup.html | 1 + .../journal/wymeditor/skins/seamless/icons.png | Bin 0 -> 3651 bytes .../journal/wymeditor/skins/seamless/skin.css | 306 +++++++++ .../journal/wymeditor/skins/wymeditor_icon.png | Bin 0 -> 1028 bytes 23 files changed, 2039 insertions(+) create mode 100644 static-files/journal/wymeditor/iframe/pretty/development.html create mode 100644 static-files/journal/wymeditor/iframe/pretty/icon.png create mode 100644 static-files/journal/wymeditor/iframe/pretty/visitor1.eot create mode 100644 static-files/journal/wymeditor/iframe/pretty/visitor1.ttf create mode 100644 static-files/journal/wymeditor/iframe/pretty/visitor1.woff create mode 100644 static-files/journal/wymeditor/iframe/pretty/wymiframe.css create mode 100644 static-files/journal/wymeditor/iframe/pretty/wymiframe.html create mode 100644 static-files/journal/wymeditor/iframe/pretty/wymiframe.ie.css create mode 100644 static-files/journal/wymeditor/jquery.wymeditor.min.js create mode 100644 static-files/journal/wymeditor/plugins/fullscreen/icon_fullscreen.gif create mode 100644 static-files/journal/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js create mode 100644 static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js create mode 100644 static-files/journal/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js create mode 100644 static-files/journal/wymeditor/plugins/table/jquery.wymeditor.table.js create mode 100644 static-files/journal/wymeditor/plugins/table/table_delete_column.png create mode 100644 static-files/journal/wymeditor/plugins/table/table_delete_row.png create mode 100644 static-files/journal/wymeditor/plugins/table/table_insert_column.png create mode 100644 static-files/journal/wymeditor/plugins/table/table_insert_row.png create mode 100644 static-files/journal/wymeditor/plugins/table/table_join_row.png create mode 100644 static-files/journal/wymeditor/popup.html create mode 100644 static-files/journal/wymeditor/skins/seamless/icons.png create mode 100644 static-files/journal/wymeditor/skins/seamless/skin.css create mode 100644 static-files/journal/wymeditor/skins/wymeditor_icon.png (limited to 'static-files/journal/wymeditor') diff --git a/static-files/journal/wymeditor/iframe/pretty/development.html b/static-files/journal/wymeditor/iframe/pretty/development.html new file mode 100644 index 0000000..d4b8988 --- /dev/null +++ b/static-files/journal/wymeditor/iframe/pretty/development.html @@ -0,0 +1,149 @@ + + + + +WYMeditor: Pretty development + + + + + +

Paragraph <p> • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum metus tellus, ultrices ac tristique vitae, laoreet et ante. Aliquam elit velit, porta sed volutpat vitae, sodales in dolor. Vestibulum eros odio, gravida et bibendum et, accumsan imperdiet eros. In at mauris nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent ultrices interdum velit, sit amet lacinia massa varius in. Sed vulputate dapibus nulla, et tincidunt urna faucibus eu.

+

Paragraph <p> with class "some" • Nullam bibendum rhoncus ullamcorper. Aliquam vitae ullamcorper metus. Phasellus vitae ipsum tortor, accumsan cursus nunc.

+

Heading 1 <h1>

+

Heading 1 <h1> with class "first"

+

Heading 2 <h2>

+

Heading 2 <h2> with class "other"

+

Linked Heading 2 <h2>

+

Heading 3 <h3>

+

Heading 4 <h4>

+
Heading 5 <h5>
+
Heading 6 <h6>
+
Division, section <div> • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
Division, section <div> with class "messages error" • Vivamus metus orci, consectetur a consectetur sed, malesuada sed ligula. Nunc nibh quam, tempor sagittis rhoncus quis, placerat a elit.
+
Address <address> • Suspendisse laoreet pellentesque nibh id gravida.
+
Quoted section <blockquote> • Donec vulputate pretium egestas. Vivamus faucibus ultrices elit, sit amet dignissim mauris semper at. Mauris laoreet nisi sed dolor volutpat sagittis. Proin euismod varius nisl ut interdum. Maecenas tempor, ipsum placerat suscipit malesuada, sem ipsum ullamcorper purus, eu eleifend tortor ante ac arcu.
+

Nested paragraph in quoted section • Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

+
Preformatted text <pre> • 
+    Proin hendrerit felis 
+     vitae urna bibendum commodo. 
+      Cras non augue vitae metus ullamcorper porttitor at et nisl. 
+       Quisque dui lacus, vestibulum at placerat vitae, dignissim ac erat.
+ +

Inline elements: strong, em, a href, span, abbr, q, cite, kbd, samp, var, dfn, code, del, ins, sup, sub • Lorem ipsum + important text <strong> and <b> • dolor sit amet, consectetur + emphasized text <em> and <i> • adipiscing elit. Vestibulum + hyperlink <a href> • metus tellus, ultrices ac + generic inline container <span> • tristique vitae, laoreet et ante. Sodales + abbreviation <abbr> • ALIQUAM elit velit, + short quotation <q> • Vestibulum eros odio, gravida et bibendum et, + title of a work <cite> • accumsan imperdiet eros. In at mauris + keyboard input <kbd> • vitae sodales in dolor. Cum sociis + sample output from a computer program <samp> • natoque penatibus et magnis dis + variable <var> • parturient montes, nascetur + definition term <dfn> • ridiculus mus. Praesent + computer code <code> • torqueo jumentum dolus esca suscipit, + deleted text <del> • ultrices velit, sit amet + inserted text <ins> • acinia massa varius in. Sed vulputate dapibus nulla, et + supscript text <sup> • tincidunt urna faucibus eu. Neo damnum aliquam + subscript text <sub> • consequat. Abdo genitus luptatum virtus singularis distineo validus ea. Gravis + important text <strong> with class "myinlineclass" • oppeto huic incassum. Vulputate hos singularis veniam zelus singularis utinam vulputate sino quidne. Nutus neque quidem. Natu interdico melior.Oppeto vulpes meus jugis ut iriure valde consectetuer abigo. Aptent bene ideo commoveo quadrum abbas. Vereor macto neo probo ille. Esse vulpes sino virtus rusticus brevitas mos. Cui ad vulputate et vero zelus feugiat os olim obruo. Facilisi quadrum proprius gravis velit humo nunc wisi imputo antehabeo.Valde dolore tation facilisi ullamcorper gemino gemino cui qui paratus. Camur in capto euismod. Brevitas vero iriure letalis valde oppeto plaga ullamcorper adipiscing inhibeo. +

+ +

Ordered List

+
    +
  1. Nullam ullamcorper porta sem quis aliquet. Integer sed metus justo.
  2. +
  3. Lorem ipsum dolor sit amet consectetuer.
  4. +
  5. Neo damnum aliquam consequat. Abdo genitus luptatum virtus singularis distineo validus ea. Gravis oppeto huic incassum torqueo jumentum dolus esca suscipit. Vulputate hos singularis veniam zelus singularis utinam vulputate sino quidne. Nutus neque quidem. Natu interdico melior.Oppeto vulpes meus jugis ut iriure valde consectetuer abigo. Aptent bene ideo commoveo quadrum abbas. Vereor macto neo probo ille.
  6. +
  7. Pellentesque dui mauris, mattis id lobortis porttitor, laoreet eu dui. Vestibulum eget ligula mauris, iaculis euismod sapien.

    Donec quis justo lorem.

  8. +
  9. Condimentum quis.
  10. +
  11. Congue Quisque augue elit dolor. +
      +
    1. Sed at tempus enim.
    2. +
    3. Aliquam accumsan lorem eu dui tempus vel pellentesque magna hendrerit.
    4. +
    5. Donec eleifend sodales lorem at varius. Pellentesque condimentum dui scelerisque eros consectetur blandit. Etiam posuere placerat arcu ut cursus. Mauris dui ligula, porta ut tincidunt quis, ornare ut dolor. Sed sed mollis felis. Suspendisse laoreet pellentesque nibh id gravida. Pellentesque dui mauris, mattis id lobortis porttitor, laoreet eu dui. Vestibulum eget ligula mauris, iaculis euismod sapien. Donec quis justo lorem.
    6. +
    +
  12. +
  13. Congue Quisque augue elit dolor nibh.
  14. +
  15. Vestibulum feugiat tempor gravida.
  16. +
  17. Donec vulputate pretium egestas.
  18. +
  19. Vivamus faucibus ultrices elit, sit amet dignissim mauris semper at.
  20. +
  21. Mauris laoreet nisi sed dolor volutpat sagittis.
  22. +
+ +

Unordered List

+ + + +

Definition List

+
+
Cras
+
Phasellus convallis interdum dictum.
+
Suspendisse lectus eros, vestibulum et sagittis eu, fringilla ac urna. Phasellus ullamcorper faucibus sapien, nec rhoncus orci gravida id. Quisque elementum leo at leo facilisis euismod. Nunc sit amet elit vitae arcu fermentum adipiscing eu at mauris.
+
Aenean volutpat urna a risus congue fermentum.
+
Curabitur id nunc ante, nec tincidunt odio. Nulla facilisi. In hac habitasse platea dictumst. Curabitur suscipit luctus aliquet. Pellentesque quis risus dolor.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Caption • Table with border 1.
thead th • Aliquamthead th • Quisquethead th • Nunc
tbody tr td • Curabitur suscipit luctus aliquet.tbody tr td • Nunc orci lorem, rhoncus eu elementum id, lacinia eget lorem. Nulla in neque viverra metus iaculis posuere. tbody tr td • Proin id leo condimentum ipsum commodo consequat.
Neo damnum aliquam consequat.Neo damnum aliquam consequat.Neo damnum aliquam consequat.
Neo damnum aliquam consequat.Neo damnum aliquam consequat. Neo damnum aliquam consequat.Neo damnum aliquam consequat. Neo damnum aliquam consequat. Neo damnum aliquam consequat
+ + + diff --git a/static-files/journal/wymeditor/iframe/pretty/icon.png b/static-files/journal/wymeditor/iframe/pretty/icon.png new file mode 100644 index 0000000..bfa2e9e Binary files /dev/null and b/static-files/journal/wymeditor/iframe/pretty/icon.png differ diff --git a/static-files/journal/wymeditor/iframe/pretty/visitor1.eot b/static-files/journal/wymeditor/iframe/pretty/visitor1.eot new file mode 100644 index 0000000..0a3c867 Binary files /dev/null and b/static-files/journal/wymeditor/iframe/pretty/visitor1.eot differ diff --git a/static-files/journal/wymeditor/iframe/pretty/visitor1.ttf b/static-files/journal/wymeditor/iframe/pretty/visitor1.ttf new file mode 100644 index 0000000..04ce123 Binary files /dev/null and b/static-files/journal/wymeditor/iframe/pretty/visitor1.ttf differ diff --git a/static-files/journal/wymeditor/iframe/pretty/visitor1.woff b/static-files/journal/wymeditor/iframe/pretty/visitor1.woff new file mode 100644 index 0000000..1533555 Binary files /dev/null and b/static-files/journal/wymeditor/iframe/pretty/visitor1.woff differ diff --git a/static-files/journal/wymeditor/iframe/pretty/wymiframe.css b/static-files/journal/wymeditor/iframe/pretty/wymiframe.css new file mode 100644 index 0000000..5120b73 --- /dev/null +++ b/static-files/journal/wymeditor/iframe/pretty/wymiframe.css @@ -0,0 +1,395 @@ +/* + * WYMeditor : what you see is What You Mean web-based editor + * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ + * Dual licensed under the MIT (MIT-license.txt) + * and GPL (GPL-license.txt) licenses. + * + * For further information visit: + * http://www.wymeditor.org/ + * + * File Name: + * wymeditor.css + * Main editor css file. + * See the documentation for more info. + * + * File Authors: + * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) + * Daniel Reszka (d.reszka a-t wymeditor dotorg) + * Gyuris Gellért (bubu a-t ujevangelizacio dothu) +*/ + +/* VISUAL FEEDBACK */ +@font-face { + font-family: "Visitor"; + src: url("visitor1.woff") format("woff"), + url("visitor1.ttf") format("truetype"); + font-weight: normal; + font-style: normal; +} + +/* basic */ + body { background: #e1e8f1;} + +/* make HTML blocs visible */ + div, + p, + h1, + h2, + h3, + h4, + h5, + h6, + ul, + ol, + table, + address, + blockquote, + pre { background: #FFFFFF; + padding:8px 5px 5px; + margin:10px; } + ul, + ol, + dl { background: #B9C4D0; + margin: 10px; + padding: 0 0 0 10px; + list-style-position: outside; + min-height: 1.6em; } + ul ul, + ul ol, + ol ol, + ol ul { margin: 5px 0 0 -5px } + ul > li ul, + ul > li ol, + ol > li ul, + ol > li ol { border-top: 4px solid #B9C4D0 } + li > p:first-child, + li > div:first-child { margin-top: 0 } + li > p:last-child, + li > div:last-child { margin-bottom: 0 } + li, + dd, + dt { background: white; + margin: 0px 0 4px 20px; + padding: 8px 0 0 5px; } + dt { margin-bottom: 0 } + dd + dt { margin-top: 4px; } + dd { margin: 2px 0 0 4em } + td { background: #F0F4F8; width: 25%; } + th { background: #ffffcc; } + caption { background: #E4E4B0; padding: 5px; font-weight: bold; } + table { font-size: 12px; width: 500px; } + blockquote { margin-left: 30px; } + pre { background-color:transparent; border: 1px solid white; } + +/* Gecko min height fix */ + td { height: 1.6em; } + +/* specific HTML elements */ + caption { text-align: left; } + img { border-style: solid; + border-color: gray; + border-width: 0; } + a img { border-width: 1px; border-color: blue; } + acronym { border: 1px solid gray; } + span { /*background-color: #eef;*/ } + +/* visual feedback for non-valid nesting of elements*/ + h1 h1, h1 h2, h1 h3, h1 h4, h1 h5, h1 h6, h1 p, h1 pre, h1 address, + h2 h1, h2 h2, h2 h3, h2 h4, h2 h5, h2 h6, h2 p, h2 pre, h2 address, + h3 h1, h3 h2, h3 h3, h3 h4, h3 h5, h3 h6, h3 p, h3 pre, h3 address, + h4 h1, h4 h2, h4 h3, h4 h4, h4 h5, h4 h6, h4 p, h4 pre, h4 address, + h5 h1, h5 h2, h5 h3, h5 h4, h5 h5, h5 h6, h5 p, h5 pre, h5 address, + h6 h1, h6 h2, h6 h3, h6 h4, h6 h4, h6 h6, h6 p, h6 pre, h6 address, + p h1, p h2, p h3, p h4, p h5, p h6, p pre, p address, + pre h1, pre h2, pre h3, pre h4, pre h5, pre h6, pre p, pre pre, pre address, + address h1, address h2, address h3, address h4, address h5, address h6, + address p, address pre, address address + { background-color: #ff9999 !important; + border: 1px solid red !important; + font-size: 12px !important; + font-weight: normal; } + +/* Spacer BRs shouldn't add much whitespace */ +br { height: 5px; line-height: 5px; } + +/* labels: block elements; IE9 support ::before: http://stackoverflow.com/questions/7157405/are-css3-after-and-before-pseudo-elements-rendered-by-ie9 */ +div, p, ol, ul, dl, li, dt, dd, h1, h2, h3, h4, h5, h6, blockquote, +pre, address { + position: relative; +} +div::before, +p::before, +ol::before, +ul::before, +dl::before, +li::before, +dt::before, +dd::before, +h1::before, +h2::before, +h3::before, +h4::before, +h5::before, +h6::before, +blockquote::before, +pre::before, +address::before { + position: absolute; + left: -1px; + top: -1px; + padding: 0px 3px; + font: 10px/10px "Visitor", monospace; + color: silver; + background: rgba(255,255,255,0.5); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: default; + white-space: nowrap; +} +div:hover::before, +p:hover::before, +ol:hover::before, +ul:hover::before, +dl:hover::before, +li:hover::before, +dt:hover::before, +dd:hover::before, +h1:hover::before, +h2:hover::before, +h3:hover::before, +h4:hover::before, +h5:hover::before, +h6:hover::before, +blockquote:hover::before, +pre:hover::before, +address:hover::before { + color: rgb(65,105,225); + background: rgba(255,255,255,0.); + outline: 1px solid rgba(65,105,225,0.9); +} +div::before { content: "document division" } /* official names: https://developer.mozilla.org/en/HTML/Element */ +div[class]::before { content: "document division type \"" attr(class) "\"" } +body.short div::before { content: "div" } +body.short div[class]::before { content: "div." attr(class) } +p::before { content: "paragraph" } +p[class]::before { content: "paragraph type \"" attr(class) "\"" } +body.short p::before { content: "p" } +body.short p[class]::before { content: "p." attr(class) } +ol::before { content: "ordered list" } +ol[class]::before { content: "ordered list type \"" attr(class) "\"" } +body.short ol::before { content: "ol" } +body.short ol[class]::before { content: "ol." attr(class) } +ul::before { content: "unordered list" } +ul[class]::before { content: "unordered list type \"" attr(class) "\"" } +body.short ul::before { content: "ul" } +body.short ul[class]::before { content: "ul." attr(class) } +dl::before { content: "definition list" } +dl[class]::before { content: "definition list type \"" attr(class) "\"" } +body.short dl::before { content: "dl" } +body.short dl[class]::before { content: "dl." attr(class) } +li::before { content: "list item" } +li[class]::before { content: "list item type \"" attr(class) "\"" } +body.short li::before { content: "li" } +body.short li[class]::before { content: "li." attr(class) } +dt::before { content: "definition term" } +dt[class]::before { content: "definition term type \"" attr(class) "\"" } +body.short dt::before { content: "dt" } +body.short dt[class]::before { content: "dt." attr(class) } +dd::before { content: "definition description" } +dd[class]::before { content: "definition description type \"" attr(class) "\"" } +body.short dd::before { content: "dd" } +body.short dd[class]::before { content: "dd." attr(class) } +h1::before { content: "heading 1" } +h1[class]::before { content: "heading 1 type \"" attr(class) "\"" } +body.short h1::before { content: "h1" } +body.short h1[class]::before { content: "h1." attr(class) } +h2::before { content: "heading 2" } +h2[class]::before { content: "heading 2 type \"" attr(class) "\"" } +body.short h2::before { content: "h2" } +body.short h2[class]::before { content: "h2." attr(class) } +h3::before { content: "heading 3" } +h3[class]::before { content: "heading 3 type \"" attr(class) "\"" } +body.short h3::before { content: "h3" } +body.short h3[class]::before { content: "h3." attr(class) } +h4::before { content: "heading 4" } +h4[class]::before { content: "heading 4 type \"" attr(class) "\"" } +body.short h4::before { content: "h4" } +body.short h4[class]::before { content: "h4." attr(class) } +h5::before { content: "heading 5" } +h5[class]::before { content: "heading 5 type \"" attr(class) "\"" } +body.short h5::before { content: "h5" } +body.short h5[class]::before { content: "h5." attr(class) } +h6::before { content: "heading 6" } +h6[class]::before { content: "heading 6 type \"" attr(class) "\"" } +body.short h6::before { content: "h6" } +body.short h6[class]::before { content: "h6." attr(class) } +blockquote::before { content: "block quotation" } +blockquote[class]::before { content: "block quotation type \"" attr(class) "\"" } +body.short blockquote::before { content: "blockquote" } +body.short blockquote[class]::before { content: "blockquote." attr(class) } +pre::before { content: "preformatted text" } +pre[class]::before { content: "preformatted text type \"" attr(class) "\"" } +body.short pre::before { content: "pre" } +body.short pre[class]::before { content: "pre." attr(class) } +address::before { content: "address or contact information" } +address[class]::before { content: "address or contact information type \"" attr(class) "\"" } +body.short address::before { content: "address" } +body.short ddress[class]::before { content: "address." attr(class) } + +ul[class]:not(:empty)::before, body:not(.short) ul:not(:empty)::before, +ol[class]:not(:empty)::before, body:not(.short) ol:not(:empty)::before, +dl[class]:not(:empty)::before, body:not(.short) dl:not(:empty)::before { + transform: rotate(90deg); + -ms-transform: rotate(90deg); /* IE 9 */ + -webkit-transform: rotate(90deg); /* Safari and Chrome */ + -o-transform: rotate(90deg); /* Opera 11+ */ + -moz-transform: rotate(90deg); /* Firefox */ + transform-origin: bottom left; + -ms-transform-origin: bottom left; + -webkit-transform-origin: bottom left; + -o-transform-origin: bottom left; + -moz-transform-origin: bottom left; + top: -11px; +} + +/* labels: inline elements */ +span, strong, b, em, i, a, abbr, acronym, kbd, q, cite, samp, var, del, +ins, dfn, code, sup, sub { + position: relative; +} +span:hover::before, +strong:hover::before, +b:hover::before, +em:hover::before, +i:hover::before, +a:hover::before, +abbr:hover::before, +acronym:hover::before, +kbd:hover::before, +/*q:hover::before(2), now is not working http://www.w3.org/TR/css3-content/#inserting0 */ +cite:hover::before, +samp:hover::before, +var:hover::before, +del:hover::before, +ins:hover::before, +dfn:hover::before, +code:hover::before, +sup:hover::before, +sub:hover::before { + position: absolute; + top: -8px; + left: -2px; + padding: 0px 3px; + font: 10px/10px "Visitor", monospace; + hyphens: none; /* chrome: a-href */ + color: rgb(65,105,225); + background: rgba(255,255,255,0.9); + outline: 1px solid rgba(65,105,225,0.9); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: default; + white-space: nowrap; +} +span:hover::before { content: "text span" } +span[class]:hover::before { content: "text span type \"" attr(class) "\"" } +body.short span:hover::before { content: "span" } +body.short span[class]:hover::before { content: "span." attr(class) } +strong:hover::before, +b:hover::before { content: "strong emphasis" } +strong[class]:hover::before, +b[class]:hover::before { content: "strong emphasis type \"" attr(class) "\"" } +body.short strong:hover::before, +body.short b:hover::before { content: "strong" } +body.short strong[class]:hover::before, +body.short b[class]:hover::before { content: "strong." attr(class) } +em:hover::before, +i:hover::before { content: "emphasis" } +em[class]:hover::before, +i[class]:hover::before { content: "emphasis type \"" attr(class) "\"" } +body.short em:hover::before, +body.short i:hover::before { content: "em" } +body.short em[class]:hover::before, +body.short i[class]:hover::before { content: "em." attr(class) } +a[href]:hover::before { content: "hyperlink" } +a[href][class]:hover::before { content: "hyperlink type \"" attr(class) "\"" } +body.short a[href]:hover::before { content: "a-href" } +body.short a[href][class]:hover::before { content: "a-href." attr(class) } +abbr:hover::before { content: "abbreviation" } +abbr[class]:hover::before { content: "abbreviation type \"" attr(class) "\"" } +body.short abbr:hover::before { content: "abbr" } +body.short abbr[class]:hover::before { content: "abbr." attr(class) } +acronym:hover::before { content: "acronym" } +acronym[class]:hover::before { content: "acronym type \"" attr(class) "\"" } +body.short acronym:hover::before { content: "acronym" } +body.short acronym[class]:hover::before { content: "acronym." attr(class) } +kbd:hover::before { content: "keyboard input" } +kbd[class]:hover::before { content: "keyboard input type \"" attr(class) "\"" } +body.short kbd:hover::before { content: "kbd" } +body.short kbd[class]:hover::before { content: "kbd." attr(class)} +/* q:hover::before(2) { content: "quotation" } +q[class]:hover::before(2) { content: "quotation type \"" attr(class) "\"" } +body.short q:hover::before(2) { content: "q" } +body.short q[class]:hover::before(2) { content: "q." attr(class) } */ +cite:hover::before { content: "work title" } +cite[class]:hover::before { content: "work title type \"" attr(class) "\""} +body.short cite:hover::before { content: "cite" } +body.short cite[class]:hover::before { content: "cite." attr(class) } +samp:hover::before { content: "sample text" } +samp[class]:hover::before { content: "sample text type \"" attr(class) "\"" } +body.short samp:hover::before { content: "samp" } +body.short samp[class]:hover::before { content: "samp." attr(class) } +var:hover::before { content: "variable" } +var[class]:hover::before { content: "variable type \"" attr(class) "\"" } +body.short var:hover::before { content: "var" } +body.short var[class]:hover::before { content: "var." attr(class) } +del:hover::before { content: "deleted text" } +del[class]:hover::before { content: "deleted text type \"" attr(class) "\"" } +body.short del:hover::before { content: "del" } +body.short del[class]:hover::before { content: "del." attr(class) } +ins:hover::before { content: "inserted text" } +ins[class]:hover::before { content: "inserted text type \"" attr(class) "\"" } +body.short ins:hover::before { content: "ins" } +body.short ins[class]:hover::before { content: "ins." attr(class) } +dfn:hover::before { content: "definition" } +dfn[class]:hover::before { content: "definition type \"" attr(class) "\"" } +body.short dfn:hover::before { content: "dfn" } +body.short dfn[class]:hover::before { content: "dfn." attr(class) } +code:hover::before { content: "code fragment" } +code[class]:hover::before { content: "code fragment type \"" attr(class) "\"" } +body.short code:hover::before { content: "code" } +body.short code[class]:hover::before { content: "code." attr(class) } +sup:hover::before { content: "superscript" } +sup[class]:hover::before { content: "superscript type \"" attr(class) "\"" } +body.short sup:hover::before { content: "sup" } +body.short sup[class]:hover::before { content: "sup." attr(class) } +sub:hover::before { content: "subscript" } +sub[class]:hover::before { content: "subscript type \"" attr(class) "\""} +body.short sub:hover::before { content: "sub" } +body.short sub[class]:hover::before { content: "sub." attr(class) } + +span:hover, +strong:hover, b:hover, +em:hover, i:hover, +a[href]:hover, +abbr:hover, +acronym:hover, +kbd:hover, +q:hover, +cite:hover, +samp:hover, +var:hover, +del:hover, +ins:hover, +dfn:hover, +code:hover, +sup:hover, +sub:hover { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAgSURBVAiZY3DMfPj/////DDDMxIAGMAQYHTMf/kcWAADRgQ4R3lkO7wAAAABJRU5ErkJggg==) bottom left no-repeat, + url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAgSURBVAiZY/z//z8DDDhlPfrPxIAGMAQYHTMf/kcWAABxJAgb2YLYKgAAAABJRU5ErkJggg==) bottom right no-repeat } diff --git a/static-files/journal/wymeditor/iframe/pretty/wymiframe.html b/static-files/journal/wymeditor/iframe/pretty/wymiframe.html new file mode 100644 index 0000000..21bfbb5 --- /dev/null +++ b/static-files/journal/wymeditor/iframe/pretty/wymiframe.html @@ -0,0 +1,26 @@ + + + + +WYMeditor iframe + + + + + diff --git a/static-files/journal/wymeditor/iframe/pretty/wymiframe.ie.css b/static-files/journal/wymeditor/iframe/pretty/wymiframe.ie.css new file mode 100644 index 0000000..0be2da2 --- /dev/null +++ b/static-files/journal/wymeditor/iframe/pretty/wymiframe.ie.css @@ -0,0 +1,21 @@ +/* + * WYMeditor : what you see is What You Mean web-based editor + * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ + * Dual licensed under the MIT (MIT-license.txt) + * and GPL (GPL-license.txt) licenses. + * + * For further information visit: + * http://www.wymeditor.org/ + * + * File Name: + * wymeditor.ie.css + * Main editor css file, IE support. + * See the documentation for more info. + * + * File Authors: + * Gyuris Gellért (bubu a-t ujevangelizacio dothu) +*/ + +/* VISUAL FEEDBACK */ +ul, ol, dl { min-height: auto; line-height: 0px } +li, dt, dd { line-height: 20px; } diff --git a/static-files/journal/wymeditor/jquery.wymeditor.min.js b/static-files/journal/wymeditor/jquery.wymeditor.min.js new file mode 100644 index 0000000..c5cf86b --- /dev/null +++ b/static-files/journal/wymeditor/jquery.wymeditor.min.js @@ -0,0 +1,18 @@ +/*! +WYMeditor - v1.1.1 + +Home page: http://wymeditor.github.io/wymeditor/ + +Copyright (c) 2015 Jean-Francois Hovinne; +Licensed (MIT OR GPL-2.0) +*/ + +if(function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";function b(a){void 0===a&&(a=window.navigator.userAgent),a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(windows phone)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[],d={},e={browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""};if(e.browser&&(d[e.browser]=!0,d.version=e.version,d.versionNumber=parseInt(e.versionNumber,10)),e.platform&&(d[e.platform]=!0),(d.android||d.bb||d.blackberry||d.ipad||d.iphone||d.ipod||d.kindle||d.playbook||d.silk||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.edge){var f="msie";e.browser=f,d[f]=!0}if(d.safari&&d.blackberry){var g="blackberry";e.browser=g,d[g]=!0}if(d.safari&&d.playbook){var h="playbook";e.browser=h,d[h]=!0}if(d.bb){var i="blackberry";e.browser=i,d[i]=!0}if(d.opr){var j="opera";e.browser=j,d[j]=!0}if(d.safari&&d.android){var k="android";e.browser=k,d[k]=!0}if(d.safari&&d.kindle){var l="kindle";e.browser=l,d[l]=!0}if(d.safari&&d.silk){var m="silk";e.browser=m,d[m]=!0}return d.name=e.browser,d.platform=e.platform,d}return window.jQBrowser=b(window.navigator.userAgent),window.jQBrowser.uaMatch=b,a&&(a.browser=window.jQBrowser),window.jQBrowser}),"undefined"==typeof WYMeditor)var WYMeditor={};!function(){if("undefined"==typeof window.console&&"undefined"==typeof console){var a,b=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"],c=function(){};for(WYMeditor.console={},a=0;a
"+WYMeditor.TOOLS+"
"+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
"+WYMeditor.LOGO+"
",logoHtml:String()+'WYMeditor',iframeHtml:String()+'
',toolsHtml:String()+'

{Tools}

    '+WYMeditor.TOOLS_ITEMS+"
",toolsItemHtml:String()+'
  • '+WYMeditor.TOOL_TITLE+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link wym_opens_dialog"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image wym_opens_dialog"},{name:"InsertTable",title:"Table",css:"wym_tools_table wym_opens_dialog"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste wym_opens_dialog"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview wym_opens_dialog"}],containersHtml:String()+'

    {Containers}

      '+WYMeditor.CONTAINERS_ITEMS+"
    ",containersItemHtml:String()+'
  • '+WYMeditor.CONTAINER_TITLE+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:String()+'

    {Classes}

      '+WYMeditor.CLASSES_ITEMS+"
    ",classesItemHtml:String()+'
  • '+WYMeditor.CLASS_TITLE+"
  • ",classesItems:[],statusHtml:String()+'

    {Status}

    ',htmlHtml:String()+'

    {Source_Code}

    ',boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",updateSelector:".wymupdate",updateEvent:"click",stringDelimiterLeft:"{",stringDelimiterRight:"}",preInit:null,preBind:null,postInit:null},a),a=jQuery.extend(WYMeditor.DEFAULT_DIALOG_OPTIONS,a),b.each(function(){var b=this;b._wym=new WYMeditor.editor(jQuery(b),a)})},jQuery.extend({wymeditors:function(a){return WYMeditor.INSTANCES[a]}}),jQuery.extend({getWymeditorByTextarea:function(a){var b;if(!a||!a.tagName||"textarea"!==a.tagName.toLowerCase())throw"jQuery.getWymeditorByTextarea requires a textarea element.";for(b=0;b=11?!0:!1},WYMeditor._computeWymPath=function(){var a=jQuery(jQuery.grep(jQuery("script"),function(a){return a.src?a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/)||a.src.match(/\/core\.js(\?.*)?$/):null}));return a.length>0?a.attr("src"):(WYMeditor.console.warn("Error determining wymPath. No base WYMeditor file located."),WYMeditor.console.warn("Assuming wymPath to be the current URL"),WYMeditor.console.warn("Please pass a correct wymPath option"),"")},WYMeditor._computeBasePath=function(a){var b=a.lastIndexOf("/");return a.substr(0,b+1)},jQuery.fn.isPhantomNode=function(){var a=this;return a[0].nodeType===WYMeditor.NODE_TYPE.TEXT?!/[^\t\n\r ]/.test(a[0].data):!1},jQuery.fn.nextContentsUntil=function(a,b){var c,d=this,e=[],f=d.get(0);if(a=a?a:"",b=b?b:"",!f)return jQuery();for(f=f.nextSibling;f&&!jQuery(f).is(a);)e.push(f),f=f.nextSibling;return c=jQuery(e),b?c.filter(b):c},jQuery.fn.nextAllContents=function(){var a=this;return jQuery(a).nextContentsUntil("","")},jQuery.fn.prevContentsUntil=function(a,b){var c,d=this,e=[],f=d.get(0);if(a=a?a:"",b=b?b:"",!f)return jQuery();for(f=f.previousSibling;f&&!jQuery(f).is(a);)e.push(f),f=f.previousSibling;return c=jQuery(e),b?c.filter(b):c},jQuery.fn.prevAllContents=function(){var a=this;return jQuery(a).prevContentsUntil("","")},WYMeditor.isPhantomNode=function(a){return a.nodeType===WYMeditor.NODE_TYPE.TEXT?!/[^\t\n\r ]/.test(a.data):!1},WYMeditor.isPhantomString=function(a){return!/[^\t\n\r ]/.test(a)},jQuery.fn.addBack=jQuery.fn.addBack?jQuery.fn.addBack:jQuery.fn.andSelf,jQuery.fn.parentsOrSelf=function(a){var b=this;return a?b.parents().addBack().filter(a):b.parents().addBack()},WYMeditor.Helper={replaceAllInStr:function(a,b,c){var d=new RegExp(b,"g");return a.replace(d,c)},insertAt:function(a,b,c){return a.substr(0,c)+b+a.substring(c)},trim:function(a){return a.replace(/^(\s*)|(\s*)$/gm,"")},arrayContains:function(a,b){var c;for(c=0;c'+WYMeditor.DIALOG_TITLE+""+WYMeditor.DIALOG_BODY+"",h=[{placeholder:WYMeditor.DIRECTION,replacement:n.direction},{placeholder:WYMeditor.DIALOG_TITLE,replacement:e?l._encloseString(e.title):"Dialog"},{placeholder:WYMeditor.DIALOG_BODY,replacement:c||e.getBodyHtml.call(l)}],d=0;d
    {Link}
    '},getBodyClass:function(){var a=this;return a._options.dialogSelectorLink||"wym_dialog_link"},initialize:function(a){var b,c,d,e,f,g,h=this,i=a.document,j=h._options,k=h.selectedContainer();k&&(b=jQuery(j.hrefSelector,i),c=jQuery(j.titleSelector,i),d=jQuery(j.relSelector,i),e=jQuery(k).attr(WYMeditor.HREF),f=jQuery(k).attr(WYMeditor.TITLE),g=jQuery(k).attr(WYMeditor.REL),b.val(e),c.val(f),d.val(g))},submitHandler:function(a){var b=this,c=b._options,d=jQuery(c.hrefSelector,a.document).val(),e=jQuery(c.titleSelector,a.document).val(),f=jQuery(c.relSelector,a.document).val();b.link({href:d,title:e,rel:f}),a.close()}},InsertImage:{title:"Image",shouldOpen:function(){var a=this,b=a.getSelectedImage();return b&&b.tagName&&"img"===b.tagName.toLowerCase()?!0:a.hasSelection()},getBodyHtml:function(){var a=this;return a._options.dialogImageHtml||String()+'
    {Image}
    '},getBodyClass:function(){var a=this;return a._options.dialogImageSelector||"wym_dialog_image"},initialize:function(a){var b,c,d,e,f,g,h=this,i=a.document,j=h._options,k=h.getSelectedImage();k&&(b=jQuery(j.srcSelector,i),c=jQuery(j.titleSelector,i),d=jQuery(j.altSelector,i),e=jQuery(k).attr(WYMeditor.SRC),f=jQuery(k).attr(WYMeditor.TITLE),g=jQuery(k).attr(WYMeditor.ALT),b.val(e),c.val(f),d.val(g))},submitHandler:function(a){var b,c=this,d=c._options,e=c.getSelectedImage();b={src:jQuery(d.srcSelector,a.document).val(),title:jQuery(d.titleSelector,a.document).val(),alt:jQuery(d.altSelector,a.document).val()},c.focusOnDocument(),e?(c._updateImageAttrs(e,b),c.registerModification()):c.insertImage(b),a.close()}},InsertTable:{title:"Table",shouldOpen:function(){var a=this;return a.hasSelection()!==!0||a.selection().isCollapsed!==!0?!1:!0},getBodyHtml:function(){var a=this;return a._options.dialogTableHtml||String()+'
    {Table}
    '},getBodyClass:function(){var a=this;return a._options.dialogTableSelector||"wym_dialog_table"},submitHandler:function(a){var b=this,c=b._options,d=a.document,e=jQuery(c.rowsSelector,d).val(),f=jQuery(c.colsSelector,d).val(),g=jQuery(c.captionSelector,d).val(),h=jQuery(c.summarySelector,d).val();b.insertTable(e,f,g,h),a.close()}},Paste:{title:"Paste_From_Word",shouldOpen:function(){var a=this;return a.hasSelection()},getBodyHtml:function(){var a=this;return a._options.dialogPasteHtml||String()+'
    {Paste_From_Word}
    '},getBodyClass:function(){var a=this;return a._options.dialogPasteSelector||"wym_dialog_paste"},submitHandler:function(a){var b,c=this;b=jQuery(c._options.textSelector,a.document).val(),c.paste(b),a.close()}},Preview:{title:"Preview",shouldOpen:function(){return!0},getBodyHtml:function(){var a=this;return a._options.dialogPreviewHtml||a.html()},getWindowFeatures:function(){return["menubar=no","titlebar=no","toolbar=no","resizable=no","width=560","height=300","top=0","left=0","scrollbars=yes"].join(",")},getBodyClass:function(){var a=this;return a._options.dialogPreviewSelector||"wym_dialog_preview"}}},WYMeditor.DIALOG_TITLE="{Wym_Dialog_Title}",WYMeditor.DIALOG_BODY="{Wym_Dialog_Body}",WYMeditor.DIALOG_BUTTON_SELECTOR=".wym_opens_dialog a",WYMeditor.DEFAULT_DIALOG_OPTIONS={hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",relSelector:".wym_rel",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:"form",cancelSelector:".wym_cancel",previewSelector:"",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview"},WYMeditor.editor.prototype._init=function(){var wym=this,WymClass,browserInstance,SaxListener,prop,h,iframeHtml,boxHtml,aTools,sTools,oTool,sTool,i,aClasses,sClasses,oClass,sClass,aContainers,sContainers,sContainer,oContainer;if(WymClass=WYMeditor._getWymClassForBrowser()){browserInstance=new WymClass(wym),jQuery.isFunction(wym._options.preInit)&&wym._options.preInit(wym),wym.parser=null,wym.helper=null,SaxListener=new WYMeditor.XhtmlSaxListener,wym.parser=new WYMeditor.XhtmlParser(SaxListener),wym.helper=new WYMeditor.XmlHelper;for(prop in browserInstance)wym[prop]=browserInstance[prop];for(wym._box=jQuery(wym.element).hide().after(wym._options.boxHtml).next().addClass("wym_box_"+wym._index),jQuery.isFunction(jQuery.fn.data)&&(jQuery.data(wym._box.get(0),WYMeditor.WYM_INDEX,wym._index),jQuery.data(wym.element.get(0),WYMeditor.WYM_INDEX,wym._index)),h=WYMeditor.Helper,iframeHtml=wym._options.iframeHtml,iframeHtml=h.replaceAllInStr(iframeHtml,WYMeditor.IFRAME_BASE_PATH,wym._options.iframeBasePath),boxHtml=jQuery(wym._box).html(),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.LOGO,wym._options.logoHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.TOOLS,wym._options.toolsHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CONTAINERS,wym._options.containersHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CLASSES,wym._options.classesHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.HTML,wym._options.htmlHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.IFRAME,iframeHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.STATUS,wym._options.statusHtml),aTools=eval(wym._options.toolsItems),sTools="",i=0;i-1?!0:!1},WYMeditor.editor.prototype.isInlineNode=function(a){return a.nodeType===WYMeditor.NODE_TYPE.TEXT||jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.INLINE_ELEMENTS)>-1?!0:!1},WYMeditor.editor.prototype.isListNode=function(a){return a.tagName&&jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.LIST_TYPE_ELEMENTS)>-1?!0:!1},WYMeditor.editor.prototype.unwrapIfMeaninglessSpan=function(a){var b,c=jQuery(a),d=0,e=["_wym_visited","length","ie8_length"];if(!a||"undefined"==typeof a.tagName||"span"!==a.tagName.toLowerCase())return!1;for(;d0&&(g=e.item(0)),h=0;f>h;h+=1)d.parentNode.insertBefore(e.item(0),d);d.parentNode.removeChild(d),g&&i.setCaretIn(g)}else i.restoreSelectionAfterManipulation(function(){return i.switchTo(j,a,!1),!0});i.update(),i.registerModification()}return!1},WYMeditor.editor.prototype.isForbiddenRootContainer=function(a){return jQuery.inArray(a.toLowerCase(),WYMeditor.FORBIDDEN_ROOT_CONTAINERS)>-1},WYMeditor.editor.prototype.keyCanCreateBlockElement=function(a){return jQuery.inArray(a,WYMeditor.POTENTIAL_BLOCK_ELEMENT_CREATION_KEYS)>-1},WYMeditor.editor.prototype.toggleClass=function(a,b){var c,d=this;c=jQuery(d.getSelectedImage()),1!==c.length&&(c=jQuery(d.selectedContainer()).parentsOrSelf(b).last()),c.toggleClass(a),c.attr(WYMeditor.CLASS)||c.removeAttr(d._class),d.registerModification()},WYMeditor.editor.prototype.getSelectedImage=function(){var a,b,c=this;return c.hasSelection()!==!0?!1:c.selection().isCollapsed!==!1?!1:(a=c._getSelectedNodes(),1!==a.length?!1:(b=a[0],b.tagName&&"img"===b.tagName.toLowerCase()?b:!1))},WYMeditor.editor.prototype.findUp=function(a,b){if("undefined"==typeof a||null===a)return null;"#text"===a.nodeName&&(a=a.parentNode);var c,d,e=a.tagName.toLowerCase();if(typeof b===WYMeditor.STRING)for(;e!==b&&e!==WYMeditor.BODY;)a=a.parentNode,e=a.tagName.toLowerCase();else for(c=!1;!c&&e!==WYMeditor.BODY;){for(d=0;d"),jQuery(b.element).trigger(WYMeditor.EVENTS.postBlockMaybeCreated,b)},WYMeditor.editor.prototype._spaceBlockingElements=function(){var a,b,c,d,e,f,g=this,h=WYMeditor.DocumentStructureManager.CONTAINERS_BLOCKING_NAVIGATION.join(", "),i=g.$body(),j=i.children();a=jQuery.browser.mozilla?'
    ':'
    ',j.length>0&&(b=jQuery(j[0]),c=jQuery(j[j.length-1]),b.is(h)&&b.before(a),c.is(h)&&c.after(a)),d=g._getBlockSepSelector(),i.find(d).before(a),e=g._getBlockInListSepSelector(),f=i.find(e),f.each(function(){var b=this,c=jQuery(b);c.next(h).length||c.next("br").length||c.after(a)})},WYMeditor.editor.prototype._getBlockSepSelector=function(){var a,b=this,c=[],d=WYMeditor.DocumentStructureManager.CONTAINERS_BLOCKING_NAVIGATION;return"undefined"!=typeof b._blockSpacersSel?b._blockSpacersSel:(a=jQuery.grep(b.documentStructureManager.structureRules.validRootContainers,function(a){return-1===jQuery.inArray(a,d)}),jQuery.each(d,function(a,b){jQuery.each(d,function(a,d){c.push(b+" + "+d)})}),jQuery.each(d,function(b,d){jQuery.each(a,function(a,b){c.push(d+" + "+b),c.push(b+" + "+d)})}),b._blockSpacersSel=c.join(", "),b._blockSpacersSel)},WYMeditor.editor.prototype._getBlockInListSepSelector=function(){var a=this,b=[];return"undefined"!=typeof a._blockInListSpacersSel?a._blockInListSpacersSel:(jQuery.each(WYMeditor.LIST_TYPE_ELEMENTS,function(a,c){jQuery.each(WYMeditor.BLOCKING_ELEMENTS,function(a,d){b.push(c+" "+d)})}),a._blockInListSpacersSel=b.join(", "),a._blockInListSpacersSel)},WYMeditor.editor.prototype._fixDoubleBr=function(){var a,b=this,c=b.$body();c.children("br + br").filter(":not(pre br)").remove(),c.find("p + br").next("p").prev("br").remove(),a=c.find("p + br").slice(-1),a.length>0&&0===a.next().length&&a.remove()},WYMeditor.editor.prototype.link=function(a){var b,c,d,e=this;if(jQuery.isPlainObject(a)!==!0)throw"Expected a plain object.";a.hasOwnProperty("href")===!0&&"string"==typeof a.href&&0!==a.href.length&&(b=jQuery(e.selectedContainer()),b.is("a")?d=b:(c=e.uniqueStamp(),e._exec(WYMeditor.EXEC_COMMANDS.CREATE_LINK,c),d=jQuery("a[href="+c+"]",e.body())),0!==d.length&&(d.attr(a),e.registerModification()))},WYMeditor.editor.prototype.insertImage=function(a){var b,c,d=this;if(jQuery.isPlainObject(a)!==!0)throw"Expected a plain object.";a.hasOwnProperty("src")===!0&&"string"==typeof a.src&&0!==a.src.length&&(b=d.uniqueStamp(),d._exec(WYMeditor.EXEC_COMMANDS.INSERT_IMAGE,b),c=jQuery("img[src="+b+"]",d.body()),0!==c.length&&(c.attr(a),d.$body().find(".Apple-style-span").children().unwrap(),d.registerModification()))},WYMeditor.editor.prototype._updateImageAttrs=function(a,b){var c=jQuery(a);b.src!==c.attr("src")&&(c.data("DimensionsRatio",null),c.removeAttr("height").removeAttr("width")),c.attr(b)},WYMeditor.editor.prototype.toggleHtml=function(){var a=this;jQuery(a._box).find(a._options.htmlSelector).toggle()},WYMeditor.editor.prototype.uniqueStamp=function(){var a=new Date;return"wym"+a.getTime()},WYMeditor.editor.prototype._handleMultilineBlockContainerPaste=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p;for(f=jQuery(o),h="p",b.is("li")&&(h="li"),c.splitBoundaries(),o=a.findUp(c.startContainer,["p","h1","h2","h3","h4","h5","h6","li"]),p=o.tagName,i=[],j=[],jQuery(o).contents().each(function(a,b){k=c.compareNode(b),k===c.NODE_BEFORE||k===c.NODE_BEFORE_AND_AFTER&&c.startOffset===c.startContainer.length?i.push(b):j.push(b)}),e=0;e0&&jQuery(o).prepend(i),j.length>0&&(l=jQuery("<"+p+">",a._doc),l.insertAfter(jQuery(o)),l.append(j)),m=d.splice(0,1)[0],n=m.split(WYMeditor.NEWLINE).join("
    "),jQuery(o).html(jQuery(o).html()+n),f=jQuery(o),e=0;e"+d[e].split(WYMeditor.NEWLINE).join("
    ")+"",f=jQuery(g,a._doc).insertAfter(f)},WYMeditor.editor.prototype.paste=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.selectedContainer(),l=jQuery(k),m="",n=!1,o=j.selection(),p=o.getRangeAt(0);if(p.collapse(!0),b=a.split(new RegExp(WYMeditor.NEWLINE+"{2,}","g")),1===b.length&&(n=!0),"undefined"==typeof k||k&&k.tagName.toLowerCase()===WYMeditor.BODY)if(n)f=jQuery("

    "+b[0]+"

    ",j._doc).appendTo(j._doc.body);else for(e="p",g=b.length-1;g>=0;g-=1)for(m="<"+e+">"+b[g].split(WYMeditor.NEWLINE).join("
    ")+"",i=jQuery(m,j._doc),c=i.length-1;c>=0;c--)p.insertNode(i[c]);else if(n||l.is("pre"))h=j._doc.createTextNode(a),p.insertNode(h);else if(l.is("p,h1,h2,h3,h4,h5,h6,li"))j._handleMultilineBlockContainerPaste(j,l,p,b);else for(d=a.split(WYMeditor.NEWLINE),g=d.length-1;g>=0;g-=1)h=j._doc.createTextNode(d[g]),p.insertNode(h),g>0&&p.insertNode(jQuery("
    ",j._doc).get(0));j.registerModification()},WYMeditor.editor.prototype.insert=function(a){var b,c,d=this,e=d.hasSelection()?d.selection():!1;e&&(b=e.getRangeAt(0),c=b.createContextualFragment(a),b.deleteContents(),b.insertNode(c))},WYMeditor.editor.prototype.canSetCaretBefore=function(a){var b=this;if(a.nodeType===WYMeditor.NODE_TYPE.TEXT)return!0;if(a.tagName&&"br"===a.tagName.toLowerCase()){if(!a.previousSibling)return!0;if(a.previousSibling.tagName&&"br"===a.previousSibling.tagName.toLowerCase())return!0;if(b.isBlockNode(a.previousSibling))return!0;if(a.previousSibling.nodeType===WYMeditor.NODE_TYPE.TEXT)return!0}return!1},WYMeditor.editor.prototype.setCaretBefore=function(a){var b=this,c=rangy.createRange(b._doc),d=b.selection();if(!b.canSetCaretBefore(a))throw"Can't set caret before this node.";c.selectNode(a),c.collapse(!0),d.setSingleRange(c)},WYMeditor.editor.prototype.canSetCaretIn=function(a){var b=this;if(a.nodeType===WYMeditor.NODE_TYPE.TEXT||a.tagName&&jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.NO_CARET_ELEMENTS)>-1)return!1;if(b.isInlineNode(a)){if(0===a.childNodes.length)return!1;WYMeditor.console.warn("Can set a non-collapsed selection. Rangy issue #209.")}return!0},WYMeditor.editor.prototype.setCaretIn=function(a){var b=this,c=rangy.createRange(b._doc),d=b.selection();if(!b.canSetCaretIn(a))throw"The element must be able to contain other elements. Perhaps you would like to use `setCaretBefore`, instead.";c.selectNodeContents(a),b.isInlineNode(a)?WYMeditor.console.warn("Can't set a collapsed selection. Setting a non-collapsed selection, instead. Rangy issue #209."):c.collapse(!0),d.setSingleRange(c)},WYMeditor.editor.prototype._splitListItemContents=function(a){var b,c,d,e=!1,f={itemContents:[],sublistContents:[]};for(b=a.contents(),c=0;c',b.before(d),i=b.prev()),j=i.contents().last().filter("ol,ul"),j.length>0?(j.append(b),h.detach(),i.append(h),k=h.first(),n._joinAdjacentLists(j.get(0),k.get(0))):(h.length>0?(h.detach(),i.append(h),j=h.first()):(e="<"+c+">",i.append(e),j=i.contents().last()),j.prepend(b)),b.next().is(".spacer_li")&&(l=b.next(".spacer_li"),m=l.contents(),m.detach(),b.append(m),l.remove())},WYMeditor.editor.prototype._outdentSingleItem=function(a){var b,c,d,e,f,g,h,i,j,k,l,m=this;if(b=jQuery(a),c=b.parent()[0].tagName.toLowerCase(),b.parent().parent().is("ol,ul,li")){if(b.parent().parent().is("li")||(WYMeditor.console.log("Attempting to fix invalid list nesting before outdenting."),m._fixInvalidListNesting(a)),e=m._splitListItemContents(b),g=jQuery(e.sublistContents),f=jQuery(e.itemContents),h=b.parent().parent("li"),0===h.length)return void WYMeditor.console.error("Invalid list. No parentLi found, so aborting outdent");i=b.parent(),j=b.nextAllContents(),k=i.nextAllContents(),b.detach(),h.after(b),g.length>0&&(d="<"+c+'>
  • ",b.append(d),l=b.children().last(),g.detach(),l.children("li").append(g)),j.length>0&&("undefined"==typeof l&&(d="<"+c+">",b.append(d),l=b.children().last()),j.detach(),l.append(j)),k.length>0&&(k.detach(),b.contents().length>0&&b.contents().last()[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&k[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&b.append("
    "),b.append(k)),0===i.contents().length&&i.remove(),0===h.contents().length&&h.remove()}},WYMeditor.editor.prototype._fixInvalidListNesting=function(a,b){var c,d,e=this,f=a;if("undefined"==typeof b&&(b=!1),!f)return b;for(;f.parentNode&&(c=f.parentNode,c.nodeType===WYMeditor.NODE_TYPE.ELEMENT)&&(d=c.tagName.toLowerCase(),"ol"===d||"ul"===d||"li"===d);)f=c;return jQuery(f).is("li")?(WYMeditor.console.log("Correcting orphaned root li before correcting invalid list nesting."),e._correctOrphanedListItem(f),e._fixInvalidListNesting(f,!0)):jQuery(f).is("ol,ul")?e._fixInvalidlyNestedList(f,b):(WYMeditor.console.error("Can't correct invalid list nesting. No root list found"),b)},WYMeditor.editor.prototype._isPOrDivAfterEnterInEmptyNestedLi=function(a){if(jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.DocumentStructureManager.VALID_DEFAULT_ROOT_CONTAINERS)>-1&&"li"===a.parentNode.tagName.toLowerCase())switch(a.childNodes.length){case 0:return!0;case 1:if(a.childNodes[0].tagName&&"br"===a.childNodes[0].tagName.toLowerCase())return!0;if(a.childNodes[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&a.childNodes[0].data===WYMeditor.NBSP)return!0}return!1},WYMeditor.editor.prototype._isSpilledListAfterEnterInEmptyLi=function(a){var b=this;return"li"===a.tagName.toLowerCase()&&a.previousSibling&&b.isListNode(a.previousSibling)&&a.previousSibling.previousSibling&&"li"===a.previousSibling.previousSibling.tagName.toLowerCase()&&b.isListNode(a.parentNode)?!0:!1},WYMeditor.editor.prototype._handlePotentialEnterInEmptyNestedLi=function(a,b){if(a!==WYMeditor.KEY_CODE.ENTER)return null;var c=this;c._isPOrDivAfterEnterInEmptyNestedLi(b)?c._replaceNodeWithBrAndSetCaret(b):c._isSpilledListAfterEnterInEmptyLi(b)&&(c._appendSiblingsUntilNextLiToPreviousLi(b),c._replaceNodeWithBrAndSetCaret(b))},WYMeditor.editor.prototype._replaceNodeWithBrAndSetCaret=function(a){var b=this,c=jQuery(a);(a.previousSibling&&!a.previousSibling.tagName||"br"!==a.previousSibling.tagName.toLowerCase()&&b.isInlineNode(a.previousSibling))&&c.before("
    "),c.before("
    "),b.setCaretBefore(a.previousSibling),c.remove()},WYMeditor.editor.prototype._appendSiblingsUntilNextLiToPreviousLi=function(a){var b,c=jQuery(a),d=c.parent().contents(),e=c.prevAll("li").first(),f=c.nextAll("li").first(),g=e.index()+1;b=1===f.length?d.slice(g,f.index()):d.slice(g),e.append(b)},WYMeditor.editor.prototype._correctOrphanedListItem=function(a){var b,c,d,e,f=jQuery();b=jQuery(a).prevContentsUntil(":not(li)"),c=jQuery(a).nextContentsUntil(":not(li)"),f=f.add(b),f=f.add(a),f=f.add(c),e=f[0].previousSibling,e&&jQuery(e).is("ol,ul")?d=e:(f.before("
      "),d=f.prev()[0]),jQuery(d).append(f)},WYMeditor.editor.prototype._fixInvalidlyNestedList=function(a,b){var c,d,e,f,g,h,i=a,j=a,k=!1,l='
    1. ';for("undefined"!=typeof b&&(k=b);j;)if(j._wym_visited){if(j._wym_visited=!1,j===i)break;j=j.previousSibling?j.previousSibling:j.parentNode}else{if(j!==i&&!jQuery(j).is("li"))for(e=j;e.parentNode&&(e=e.parentNode,!jQuery(e).is("li"))&&e.nodeType===WYMeditor.NODE_TYPE.ELEMENT;)if(d=e.tagName.toLowerCase(),"ol"===d||"ul"===d){for(WYMeditor.console.log("Fixing orphaned list content"),k=!0,f=[j],c=j,g=null;c.previousSibling;){if(c=c.previousSibling,jQuery(c).is("li")){g=c;break}f.push(c)}f.reverse(),g||1!==f.length||jQuery(j.nextSibling).is("li")&&(g=j.nextSibling),g||(jQuery(f[0]).before(l),g=jQuery(f[0]).prev()[0]),h=jQuery(g).contents().last(),1===h.length&&h[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&f[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&jQuery(g).append("
      "),jQuery(g).append(jQuery(f));break}j.lastChild?(j._wym_visited=!0,j=j.lastChild):j=j.previousSibling?j.previousSibling:j.parentNode}return k},WYMeditor.editor.prototype._getCommonParentList=function(a,b){var c,d,e,f=!0;return a=jQuery(a).filter("li"),0===a.length?null:(c=a[0],d=jQuery(c).parents("ol,ul"),d=b?d.first():d.last(),0===d.length?null:(e=d[0],jQuery(a).each(function(a,c){d=jQuery(c).parents("ol,ul"),d=b?d.first():d.last(),(0===d.length||d[0]!==e)&&(f=!1)}),f?e:null))},WYMeditor.editor.prototype.deselect=function(){var a=this;a.selection().removeAllRanges(),a.body().blur()},WYMeditor.editor.prototype._getSelectedNodes=function(){var a,b=this,c=b.selection();return b.hasSelection()!==!0?!1:a=c.getAllRanges().reduce(function(a,b){return a.concat(b.getNodes())},[])},WYMeditor.editor.prototype._getSelectedListItems=function(a){var b,c,d,e=this;return a.isCollapsed?(b=jQuery(e.selectedContainer()),b.closest("li, table").is("table")?[]:b.closest("li")):(c=jQuery(e._getSelectedNodes()),0===c.closest("li, table").filter("li").length?[]:(d=c.not("li, ol, ul").add(c.find(".rangySelectionBoundary")).add(c.filter(function(){return e.nodeType===WYMeditor.NODE_TYPE.TEXT})).closest("li").add(c.filter("li:empty")).not(c.filter("table").find("li")),jQuery.unique(d.get())))},WYMeditor.editor.prototype._selectionOnlyInList=function(a){var b,c,d,e=this;for(d=0;d0){if(c=jQuery(b),d=c.parent(":not("+a+")"),!(d.length>0))return g._removeItemsFromList(c),!0;if(e=g._getCommonParentList(b,!0))return g.changeListType(e,a),!0}return f=g.findUp(g.selectedContainer(),WYMeditor.POTENTIAL_LIST_ELEMENTS),f?(g.convertToList(f,a),!0):!1},WYMeditor.editor.prototype.changeListType=function(a,b){var c=this;return c.switchTo(a,b)},WYMeditor.editor.prototype.convertToList=function(a,b){var c,d,e=this,f=jQuery(a);return c="<"+b+">
    2. ",e.findUp(a,WYMeditor.ROOT_CONTAINERS)===a?(f.wrapInner(c),d=f.children(),d.unwrap(),d.get(0)):(f.wrapInner(c),d=f.children(),d.get(0))},WYMeditor.editor.prototype._removeItemsFromList=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.documentStructureManager.structureRules.defaultRootContainer;for(c=0;c"),jQuery(b.prevAll().toArray().reverse()).appendTo(b.parent().prev()),b.parent().before(b)):b[0]===b.parent().children().last()[0]&&b.parent().after(b),d=0;d"):h[0].tagName&&!j.isBlockNode(h[0])&&"br"!==h[0].tagName.toLowerCase()&&j.switchTo(f[g],k,!1);b.after(b.contents().slice(d));break}j.$body().children("br").remove(),"span"===b[0].tagName.toLowerCase()&&(0===b.contents(":not(.rangySelectionBoundary)").length||b.contents(":not(.rangySelectionBoundary)").length===b.contents("br").length?(b.before(b.contents(".rangySelectionBoundary")),b.remove()):((b[0].previousSibling&&b[0].previousSibling.nodeType===WYMeditor.NODE_TYPE.TEXT||b.prevAll(":not(.rangySelectionBoundary)").length>0&&j.isBlockNode(b.prevAll(":not(.rangySelectionBoundary)")[0])===!1)&&b.before("
      "),(b[0].nextSibling&&b[0].nextSibling.nodeType===WYMeditor.NODE_TYPE.TEXT||b.nextAll(":not(.rangySelectionBoundary)").length>0&&j.isBlockNode(b.nextAll(":not(.rangySelectionBoundary)")[0])===!1)&&b.after("
      "),i=b[0].attributes,j.unwrapIfMeaninglessSpan(b[0])))}j.prepareDocForEditing()},WYMeditor.editor.prototype.insertTable=function(a,b,c,d){if(!(0>=a||0>=b)){var e,f,g,h,i,j=this,k=j._doc.createElement(WYMeditor.TABLE),l=null;for(e=k.createCaption(),e.innerHTML=c,f=0;a>f;f+=1)for(l=k.insertRow(f),g=0;b>g;g+=1)l.insertCell(g);if(""!==d&&jQuery(k).attr("summary",d),h=jQuery(j.findUp(j.selectedContainer(),WYMeditor.POTENTIAL_TABLE_INSERT_ELEMENTS)).get(0),h&&h.parentNode)if(jQuery.inArray(h.nodeName.toLowerCase(),WYMeditor.INLINE_TABLE_INSERTION_ELEMENTS)>-1){if(i=j.selection().focusNode,jQuery.inArray(i.nodeName.toLowerCase(),WYMeditor.SELECTABLE_TABLE_ELEMENTS)>-1||jQuery.inArray(i.parentNode.nodeName.toLowerCase(),WYMeditor.SELECTABLE_TABLE_ELEMENTS)>-1)for(;i.nodeName.toLowerCase()!==WYMeditor.TABLE;)i=i.parentNode;i.nodeName.toLowerCase()===WYMeditor.LI?jQuery(i).append(k):jQuery(i).after(k)}else jQuery(h).after(k);else j.$body().append(k);return j._afterInsertTable(k),j.prepareDocForEditing(),j.registerModification(),k}},WYMeditor.editor.prototype._afterInsertTable=function(){},WYMeditor.editor.prototype._listen=function(){var a=this;jQuery(a._doc).bind("paste",function(){a._handlePasteEvent()})},WYMeditor.editor.prototype._handlePasteEvent=function(){var a=this;window.setTimeout(function(){jQuery(a.element).trigger(WYMeditor.EVENTS.postBlockMaybeCreated,a)},20)},WYMeditor.editor.prototype._selectSingleNode=function(a){var b,c,d=this;if(!a)throw"Expected a node";b=d.selection(),c=rangy.createRangyRange(),c.selectNode(a),b.setSingleRange(c)},WYMeditor.editor.prototype._initSkin=function(){var a=this;jQuery(a._box).addClass("wym_skin_"+a._options.skin),"undefined"!=typeof WYMeditor.SKINS[a._options.skin]?"function"==typeof WYMeditor.SKINS[a._options.skin].init&&WYMeditor.SKINS[a._options.skin].init(a):WYMeditor.console.warn("Chosen skin _"+a.options.skin+"_ not found.")},WYMeditor.editor.prototype.body=function(){var a,b=this;if(!b._doc.body)throw"The document seems to have no body element.";if(a=b._doc.body,!a.tagName||"body"!==a.tagName.toLowerCase())throw"The document's body doesn't seem to be a `body` element.";return a},WYMeditor.editor.prototype.$body=function(){var a,b=this;return a=b.body(),jQuery(a)},WYMeditor.editor.prototype.doesElementContainSelection=function(a){var b,c,d,e,f,g,h=this;if(h.hasSelection()!==!0)return!1;if(b=jQuery(a),h.selection().isCollapsed===!0)return c=h.selectedContainer(),a===c?!0:b.has(c).length>0?!0:!1;for(d=jQuery(h._getSelectedNodes()),e=0;e-1&&a.eq(g).remove(),d===k&&(e=!1);e&&(f=j._options.containersItemHtml,f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_NAME,k.toUpperCase()),h=WYMeditor.DocumentStructureManager,f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_TITLE,h.DEFAULT_ROOT_CONTAINER_TITLES[k]),f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_CLASS,"wym_containers_"+k),c=jQuery(f),a=jQuery(j._box).find(j._options.containersSelector).find("li"),a.eq(0).before(c),c.find("a").click(function(){var a=this;return j.setRootContainer(jQuery(a).attr(WYMeditor.NAME)),!1}))},WYMeditor.ImageHandler=function(a){var b=this;return b._wym=a,b._$resizeHandle=b._createResizeHandle(),b._$currentImageMarker=null,b._$currentImg=null,b._resizingNow=!1,b._imgDragDropAllowed=WYMeditor.ImageHandler._isImgDragDropAllowed(),b._addEventListeners(),b},WYMeditor.ImageHandler._isImgDragDropAllowed=function(){var a=jQuery.browser;return a.msie&&a.versionNumber<=9?!1:!0},WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML=jQuery("
      ").addClass(WYMeditor.EDITOR_ONLY_CLASS).css({margin:0,padding:0}).attr("outerHTML"),WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML=["drag this to resize","click on image to select"].join(WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML),WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR="yellow",WYMeditor.ImageHandler.prototype._createResizeHandle=function(){var a=jQuery("
      ");return a.attr("contentEditable","false"),a.html(WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML),a.addClass(WYMeditor.RESIZE_HANDLE_CLASS).addClass(WYMeditor.EDITOR_ONLY_CLASS),a.css({margin:"0",padding:"0",cursor:"row-resize","text-align":"center",position:"absolute","background-color":WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR,"background-image":"none","min-width":"13em",width:"100%"}),a},WYMeditor.ImageHandler.prototype._getCurrentImageMarker=function(){ +var a=this;return a._$currentImageMarker&&a._$currentImageMarker.length||(a._$currentImageMarker=a._createCurrentImageMarker()),a._$currentImageMarker},WYMeditor.ImageHandler._IMAGE_MARKER_CLASS="wym-image-marker",WYMeditor.ImageHandler.prototype._createCurrentImageMarker=function(){return jQuery("
      ").addClass(WYMeditor.EDITOR_ONLY_CLASS).addClass(WYMeditor.ImageHandler._IMAGE_MARKER_CLASS).hide()},WYMeditor.ImageHandler.prototype._addEventListeners=function(){var a=this,b=jQuery(a._wym._doc);b.delegate("img","mouseover",a._onImgMouseover.bind(a)),b.delegate("img","click",a._onImgClick.bind(a)),b.delegate("."+WYMeditor.RESIZE_HANDLE_CLASS,"mousedown",a._onResizeHandleMousedown.bind(a)),b.delegate("img","mousedown",a._onImgMousedown.bind(a)),b.delegate("img","dragstart",a._onImgDragstart.bind(a)),b.bind("mousemove",a._onMousemove.bind(a)),b.bind("mouseup",a._onMouseup.bind(a)),a._edited=new WYMeditor.EXTERNAL_MODULES.Edited(b[0],function(){},a._onAnyNativeEdit.bind(a)),b.delegate("."+WYMeditor.RESIZE_HANDLE_CLASS,"click dblclick",a._onResizeHandleClickDblclick.bind(a))},WYMeditor.ImageHandler.prototype._onImgMouseover=function(a){var b=this,c=jQuery(a.target);!c.data("cE disabled")&&jQuery.browser.msie&&(c.attr("contentEditable","false"),c.data("cE disabled",!0)),b._setImgCursor(c)},WYMeditor.ImageHandler.prototype._setImgCursor=function(a){var b=this;return b._wym.getSelectedImage()!==a[0]?void a.css("cursor","pointer"):void(b._imgDragDropAllowed?a.css("cursor","move"):a.css("cursor","default"))},WYMeditor.ImageHandler.prototype._onImgClick=function(a){var b=this;return b._selectImage(a.target),b._indicateOnResizeHandleThatImageIsSelected(),!1},WYMeditor.ImageHandler.prototype._selectImage=function(a){var b=this,c=jQuery(a);jQuery.browser.msie&&8===jQuery.browser.versionNumber?setTimeout(function(){b._wym._selectSingleNode(a)},0):b._wym._selectSingleNode(a),b._setImgCursor(c)},WYMeditor.ImageHandler.prototype._indicateOnResizeHandleThatImageIsSelected=function(){var a=this,b="image is selected";a._imgDragDropAllowed&&(b=[b,"drag image to move it"].join(WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML)),a._$resizeHandle.css("font-weight","bold").html(b),setTimeout(function(){a._$resizeHandle.css("font-weight","normal").html(WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML)},1e3)},WYMeditor.ImageHandler.prototype._placeResizeHandleOnImg=function(a){var b=this,c="0.8em",d=jQuery(a);b._$currentImg=d,b._getCurrentImageMarker().insertAfter(d),d.css({"background-color":WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR,"padding-top":c,"padding-right":c,"padding-bottom":"0","padding-left":c,"margin-top":"-"+c,"margin-right":"-"+c,"margin-bottom":"0","margin-left":"-"+c}),b._$resizeHandle.prependTo(b._wym.$body()),b._correctResizeHandleOffsetAndWidth(),b._$resizeHandle.show()},WYMeditor.ImageHandler.prototype._correctResizeHandleOffsetAndWidth=function(){var a=this;a._$resizeHandle.css("max-width",a._$currentImg.outerWidth());var b=a._$currentImg.offset();a._$resizeHandle.css("left",b.left);var c=b.top+a._$currentImg.outerHeight();jQuery.browser.msie&&c--,a._$resizeHandle.css("top",c)},WYMeditor.ImageHandler.prototype._onResizeHandleMousedown=function(a){var b=this;return b._resizingNow||b._startResize(a.clientY),!1},WYMeditor.ImageHandler.prototype._startResize=function(a){var b=this;b._startMouseY=a,b._$currentImg.data("StartHeight",b._$currentImg.height()),b._resizingNow=!0},WYMeditor.ImageHandler.prototype._onMousemove=function(a){var b=this;if(a.target.tagName){if(b._resizingNow)return b._resizeImage(a.clientY),!1;if("img"===a.target.tagName.toLowerCase()&&!b._isResizeHandleAttached())return b._placeResizeHandleOnImg(a.target),!1;if(b._isResizeHandleAttached())return(jQuery(a.target).hasClass(WYMeditor.EDITOR_ONLY_CLASS)||b._isCurrentImg(a.target))&&b._isCurrentImgAtMarker()?void 0:void b._detachResizeHandle()}},WYMeditor.ImageHandler.prototype._isCurrentImgAtMarker=function(){var a=this,b=a._$currentImageMarker;if(!b.length)return!1;var c=a._$currentImg,d=b.prev("img");return c.length&&d.length&&d[0]===c[0]?!0:!1},WYMeditor.ImageHandler.prototype._isResizeHandle=function(a){return jQuery(a).hasClass(WYMeditor.RESIZE_HANDLE_CLASS)},WYMeditor.ImageHandler.prototype._isCurrentImg=function(a){var b=this;return a===b._$currentImg[0]},WYMeditor.ImageHandler.prototype._resizeImage=function(a){var b=this,c=b._$currentImg,d=c.data("DimensionsRatio");if(!d){var e=c.height(),f=c.width();d=f/e,c.data("DimensionsRatio",d)}var g=c.data("StartHeight"),h=g-b._startMouseY+a;h=h>0?h:0;var i=h*d;c.attr("height",h),c.attr("width",i),b._correctResizeHandleOffsetAndWidth()},WYMeditor.ImageHandler.prototype._onMouseup=function(){var a=this;a._resizingNow&&a._stopResize()},WYMeditor.ImageHandler.prototype._stopResize=function(){var a=this;a._resizingNow=!1,a._startMouseY=null,a._wym.registerModification()},WYMeditor.ImageHandler.prototype._onImgMousedown=function(a){var b=this;return jQuery.browser.msie&&11===jQuery.browser.versionNumber&&b._selectImage(a.target),b._imgDragDropAllowed},WYMeditor.ImageHandler.prototype._onAnyNativeEdit=function(){var a=this;setTimeout(a._handlePossibleModification.bind(a),0)},WYMeditor.ImageHandler.prototype._handlePossibleModification=function(){var a=this;if(a._isResizeHandleAttached())return a._isCurrentImgAtMarker()?void a._correctResizeHandleOffsetAndWidth():void a._detachResizeHandle()},WYMeditor.ImageHandler.prototype._isResizeHandleAttached=function(){var a=this,b=a._getResizeHandle();return b&&"none"!==b.css("display")},WYMeditor.ImageHandler.prototype._getResizeHandle=function(){var a=this,b=a._wym.$body().find("."+WYMeditor.RESIZE_HANDLE_CLASS);return b.length?b:!1},WYMeditor.ImageHandler.prototype._detachResizeHandle=function(){var a=this;a._$currentImageMarker.detach(),a._$currentImg.height()>=16&&a._$currentImg.width()>=16&&a._$currentImg.css({padding:0,margin:0}),a._$currentImg=null,a._$resizeHandle.hide()},WYMeditor.ImageHandler.prototype._onImgDragstart=function(){var a=this;a._detachResizeHandle()},WYMeditor.ImageHandler.prototype._onResizeHandleClickDblclick=function(){var a=this;return jQuery.browser.msie&&11===jQuery.browser.versionNumber&&a._wym.deselect(),!1},WYMeditor.ImageHandler.prototype._isAnImgSelected=function(a){function b(b){var d=c._wym.getSelectedImage()?"***YES***":"";b=b?b+" ":"",WYMeditor.console.log(b+a+" "+d)}var c=this;a=a.toUpperCase(),b("sync"),setTimeout(function(){b("async")},0)},WYMeditor.ImageHandler._onAllEvents=function(a){var b=this;b._isAnImgSelected([a.type,a.target.tagName,jQuery(a.target).attr("className")].join(" "))},WYMeditor.WymClassGecko=function(a){var b=this;b._wym=a,b._class="class"},WYMeditor.WymClassGecko.CELL_PLACEHOLDER='
      ',WYMeditor.WymClassGecko.NEEDS_CELL_FIX=1===parseInt(jQuery.browser.version,10)&&jQuery.browser.version>="1.9.1"&&jQuery.browser.version<"2.0",WYMeditor.WymClassGecko.prototype._docEventQuirks=function(){var a=this,b=jQuery(a._doc);b.keyup(a._keyup.bind(a)),b.focus(function(){a.undoRedo._onBodyFocus()}),b.click(a._click.bind(a))},WYMeditor.WymClassGecko.prototype._keyup=function(a){var b,c,d,e,f,g=this;d=g.documentStructureManager.structureRules.notValidRootContainers,c=g.documentStructureManager.structureRules.defaultRootContainer,b=null,g.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=g.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),g.isForbiddenRootContainer(e)&&(e=f),(e===WYMeditor.BODY||jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY)&&(g._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),g.prepareDocForEditing())),g.keyCanCreateBlockElement(a.which)&&(b=g.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&g._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),g._handlePotentialEnterInEmptyNestedLi(a.which,b),g.prepareDocForEditing())},WYMeditor.WymClassGecko.prototype._click=function(){var a,b=this,c=b.selectedContainer();WYMeditor.WymClassGecko.NEEDS_CELL_FIX===!0&&c&&c.tagName.toLowerCase()===WYMeditor.TR&&jQuery(WYMeditor.TD,b._doc.body).append(WYMeditor.WymClassGecko.CELL_PLACEHOLDER),c&&c.tagName.toLowerCase()===WYMeditor.BODY&&(a=b.selection(),a.isCollapsed===!0&&b._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,WYMeditor.P))},WYMeditor.WymClassGecko.prototype._designModeQuirks=function(){var a=this;try{a._doc.execCommand("styleWithCSS","",!1),a._doc.execCommand("enableObjectResizing",!1,!1),a._doc.execCommand("enableInlineTableEditing",!1,!1)}catch(b){}},WYMeditor.WymClassGecko.prototype._afterInsertTable=function(a){WYMeditor.WymClassGecko.NEEDS_CELL_FIX===!0&&jQuery(a).find("td").each(function(a,b){jQuery(b).append(WYMeditor.WymClassGecko.CELL_PLACEHOLDER)})},WYMeditor.WymClassWebKit=function(a){var b=this;b._wym=a,b._class="class"},WYMeditor.WymClassWebKit.prototype._docEventQuirks=function(){var a=this;jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a.keyboard.combokeys.bind("shift+enter",function(){return a._exec(WYMeditor.EXEC_COMMANDS.INSERT_LINEBREAK),!1}),a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()})},WYMeditor.WymClassWebKit.prototype._inListBreakoutDiv=function(a){var b=this,c=jQuery(b.getRootContainer());return a===WYMeditor.KEY_CODE.ENTER&&c.is("div")&&"div"!==b.documentStructureManager.defaultRootContainer&&1===c.prev("ol, ul").length?!0:!1},WYMeditor.WymClassWebKit.prototype._isLiInLiAfterEnter=function(a){var b,c,d,e,f=this,g=f.nodeAfterSel();return a!==WYMeditor.KEY_CODE.ENTER?!1:g&&(b=g.parentNode)?"string"!=typeof b.tagName?!1:"li"!==b.tagName.toLowerCase()?!1:(c=g.previousSibling)?"string"!=typeof c.tagName?!1:"li"!==c.tagName.toLowerCase()?!1:1!==c.childNodes.length?!1:(d=c.childNodes[0])?"string"!=typeof d.tagName?!1:"br"!==d.tagName.toLowerCase()?!1:(e=c.previousSibling,e?"string"!=typeof e.tagName?!1:-1===jQuery.inArray(e.tagName.toLowerCase(),["ol","ul"])?!1:!0:!1):!1:!1:!1},WYMeditor.WymClassWebKit.prototype._fixLiInLiAfterEnter=function(){var a=this,b=a.nodeAfterSel(),c=jQuery(b.previousSibling),d=c.parent("li"),e=d.contents().index(c),f=d.contents().slice(e+1);c.remove(),d.after("

    3. "),d.next().append(f),a.setCaretBefore(d.next("li").children().first("br")[0])},WYMeditor.WymClassWebKit.prototype._keyup=function(a){var b,c,d,e,f,g,h=this;if(d=h.documentStructureManager.structureRules.notValidRootContainers,c=h.documentStructureManager.structureRules.defaultRootContainer,jQuery.browser.version<534.1&&a.which===WYMeditor.KEY_CODE.ENTER&&a.shiftKey&&h._exec("InsertLineBreak"),h.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),h.isForbiddenRootContainer(e)&&(e=f),(e===WYMeditor.BODY||jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY)&&(h._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),h.prepareDocForEditing())),h.keyCanCreateBlockElement(a.which)){if(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&(h._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),b=h.selectedContainer()),h._isLiInLiAfterEnter(a.which,b))return h._fixLiInLiAfterEnter(),void(b=h.selectedContainer());h._handlePotentialEnterInEmptyNestedLi(a.which,b),h._inListBreakoutDiv(a.which)&&(g=h.switchTo(h.getRootContainer(),c),h.setCaretIn(g)),h.prepareDocForEditing()}},WYMeditor.WymClassBlink=function(a){var b=this;b._wym=a},jQuery.extend(WYMeditor.WymClassBlink.prototype,WYMeditor.WymClassWebKit.prototype),WYMeditor.WymClassSafari=function(a){var b=this;b._wym=a},jQuery.extend(WYMeditor.WymClassSafari.prototype,WYMeditor.WymClassWebKit.prototype),WYMeditor.WymClassTridentPre7=function(a){var b=this;b._wym=a,b._class="className"},WYMeditor.WymClassTridentPre7.prototype._onEditorIframeLoad=function(a){a._assignWymDoc(),a._isDesignModeOn()===!1?a._doc.designMode="On":a._afterDesignModeOn()},WYMeditor.WymClassTridentPre7.prototype._assignWymDoc=function(){var a=this;a._doc=a._iframe.contentWindow.document},WYMeditor.WymClassTridentPre7.prototype._docEventQuirks=function(){var a=this;a._doc.onbeforedeactivate=function(){a._saveCaret()},jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a._doc.onkeyup=function(){a._saveCaret()},a._doc.onclick=function(){a._saveCaret()},a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()}),a._doc.body.onbeforepaste=function(){a._iframe.contentWindow.event.returnValue=!1},a._doc.body.onpaste=function(){a._iframe.contentWindow.event.returnValue=!1,a.paste(window.clipboardData.getData("Text"))},a.$body().bind("dragend",function(b){b.target.tagName.toLowerCase()===WYMeditor.IMG&&a.deselect()}),a._doc.oncontrolselect=function(){return!1}},WYMeditor.WymClassTridentPre7.prototype._setButtonsUnselectable=function(){var a=this,b=a.get$Buttons();b.attr("unselectable","on")},WYMeditor.WymClassTridentPre7.prototype._uiQuirks=function(){var a=this;8===jQuery.browser.versionNumber&&a._setButtonsUnselectable()},WYMeditor.WymClassTridentPre7.prototype._saveCaret=function(){var a=this,b=a._doc.selection;"None"!==b.type&&(a._doc.caretPos=b.createRange())},WYMeditor.WymClassTridentPre7.prototype._wrapWithContainer=function(a,b){var c,d,e,f=this;c=jQuery(a).wrap("<"+b+" />"),d=f.selection(),e=rangy.createRange(f._doc),e.selectNodeContents(c[0]),e.collapse(),d.setSingleRange(e)},WYMeditor.WymClassTridentPre7.prototype._keyup=function(a){var b,c,d,e,f,g,h=this,i=!1;d=h.documentStructureManager.structureRules.notValidRootContainers,c=h.documentStructureManager.structureRules.defaultRootContainer,h.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=h.selectedContainer(),g=h.selection().focusNode,null!==b&&(e=b.tagName.toLowerCase()),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),h.isForbiddenRootContainer(e)&&(e=f,i=!0),e===WYMeditor.BODY&&"#text"===g.nodeName&&(i&&(g=g.parentNode),h._wrapWithContainer(g,c),h.prepareDocForEditing()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&(h.switchTo(b,c),h.prepareDocForEditing())),h.keyCanCreateBlockElement(a.which)&&(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&h.switchTo(b,c),h._handlePotentialEnterInEmptyNestedLi(a.which,b),a.which!==WYMeditor.KEY_CODE.BACKSPACE||8!==jQuery.browser.versionNumber||!b.parentNode||"ul"!==f&&"ol"!==f||h._fixInvalidListNesting(b),h.prepareDocForEditing())},WYMeditor.WymClassTrident7=function(a){var b=this;b._wym=a,b._class="class"},jQuery.extend(WYMeditor.WymClassTrident7.prototype,WYMeditor.WymClassGecko.prototype),jQuery.copyPropsFromObjectToObject(WYMeditor.WymClassTridentPre7.prototype,WYMeditor.WymClassTrident7.prototype,["_exec","_keyup","_wrapWithContainer"]),WYMeditor.WymClassTrident7.prototype.rawHtml=function(a){var b=this;return"string"!=typeof a?b.$body().html():(b._doc.designMode="off",b.$body().html(a),b._isDesignModeOn()!==!0&&b._enableDesignModeOnDocument(),!1)},WYMeditor.WymClassTrident7.prototype._docEventQuirks=function(){var a=this;jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a.$body().bind("dragend",function(b){b.target.tagName.toLowerCase()===WYMeditor.IMG&&a.deselect()}),a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()})},function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.foo=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge?b=b[c]:b[c]=a.value}):e=a.value;break;case"del":b=e,c=a.key,d=c.length,d?c.forEach(function(a,c){a in b||(b[a]={}),d-1>c?b=b[a]:delete b[a]}):e=null}}),e}var h=a("underscore");b.exports=d;var i=[];b.exports.apply=g},{udc:15,underscore:13}],13:[function(a,b,c){(function(){var a=this,d=a._,e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=f.push,j=f.slice,k=f.concat,l=g.toString,m=g.hasOwnProperty,n=f.forEach,o=f.map,p=f.reduce,q=f.reduceRight,r=f.filter,s=f.every,t=f.some,u=f.indexOf,v=f.lastIndexOf,w=Array.isArray,x=Object.keys,y=h.bind,z=function(a){return a instanceof z?a:this instanceof z?void(this._wrapped=a):new z(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=z),c._=z):a._=z,z.VERSION="1.4.4";var A=z.each=z.forEach=function(a,b,c){if(null!=a)if(n&&a.forEach===n)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;f>d;d++)if(b.call(c,a[d],d,a)===e)return}else for(var g in a)if(z.has(a,g)&&b.call(c,a[g],g,a)===e)return};z.map=z.collect=function(a,b,c){var d=[];return null==a?d:o&&a.map===o?a.map(b,c):(A(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)};var B="Reduce of empty array with no initial value";z.reduce=z.foldl=z.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),p&&a.reduce===p)return d&&(b=z.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(A(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(B);return c},z.reduceRight=z.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),q&&a.reduceRight===q)return d&&(b=z.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=z.keys(a);f=g.length}if(A(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(B);return c},z.find=z.detect=function(a,b,c){var d;return C(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},z.filter=z.select=function(a,b,c){var d=[];return null==a?d:r&&a.filter===r?a.filter(b,c):(A(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},z.reject=function(a,b,c){return z.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},z.every=z.all=function(a,b,c){b||(b=z.identity);var d=!0;return null==a?d:s&&a.every===s?a.every(b,c):(A(a,function(a,f,g){return(d=d&&b.call(c,a,f,g))?void 0:e}),!!d)};var C=z.some=z.any=function(a,b,c){b||(b=z.identity);var d=!1;return null==a?d:t&&a.some===t?a.some(b,c):(A(a,function(a,f,g){return d||(d=b.call(c,a,f,g))?e:void 0}),!!d)};z.contains=z.include=function(a,b){return null==a?!1:u&&a.indexOf===u?-1!=a.indexOf(b):C(a,function(a){return a===b})},z.invoke=function(a,b){var c=j.call(arguments,2),d=z.isFunction(b);return z.map(a,function(a){return(d?b:a[b]).apply(a,c)})},z.pluck=function(a,b){return z.map(a,function(a){return a[b]})},z.where=function(a,b,c){return z.isEmpty(b)?c?null:[]:z[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},z.findWhere=function(a,b){return z.where(a,b,!0)},z.max=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&z.isEmpty(a))return-(1/0);var d={computed:-(1/0),value:-(1/0)};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},z.min=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&z.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.indexf;){var h=f+g>>>1;c.call(d,a[h])=0})})},z.difference=function(a){var b=k.apply(f,j.call(arguments,1));return z.filter(a,function(a){return!z.contains(b,a)})},z.zip=function(){for(var a=j.call(arguments),b=z.max(z.pluck(a,"length")),c=new Array(b),d=0;b>d;d++)c[d]=z.pluck(a,""+d);return c},z.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},z.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=z.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(u&&a.indexOf===u)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},z.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(v&&a.lastIndexOf===v)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},z.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f},z.bind=function(a,b){if(a.bind===y&&y)return y.apply(a,j.call(arguments,1));var c=j.call(arguments,2);return function(){return a.apply(b,c.concat(j.call(arguments)))}},z.partial=function(a){var b=j.call(arguments,1);return function(){return a.apply(this,b.concat(j.call(arguments)))}},z.bindAll=function(a){var b=j.call(arguments,1);return 0===b.length&&(b=z.functions(a)),A(b,function(b){a[b]=z.bind(a[b],a)}),a},z.memoize=function(a,b){var c={};return b||(b=z.identity),function(){var d=b.apply(this,arguments);return z.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},z.delay=function(a,b){var c=j.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},z.defer=function(a){return z.delay.apply(z,[a,1].concat(j.call(arguments,1)))},z.throttle=function(a,b){var c,d,e,f,g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)};return function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},z.debounce=function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},z.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},z.wrap=function(a,b){return function(){var c=[a];return i.apply(c,arguments),b.apply(this,c)}},z.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},z.after=function(a,b){return 0>=a?b():function(){return--a<1?b.apply(this,arguments):void 0}},z.keys=x||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)z.has(a,c)&&(b[b.length]=c);return b},z.values=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push(a[c]);return b},z.pairs=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push([c,a[c]]);return b},z.invert=function(a){var b={};for(var c in a)z.has(a,c)&&(b[a[c]]=c);return b},z.functions=z.methods=function(a){var b=[];for(var c in a)z.isFunction(a[c])&&b.push(c);return b.sort()},z.extend=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},z.pick=function(a){var b={},c=k.apply(f,j.call(arguments,1));return A(c,function(c){c in a&&(b[c]=a[c])}),b},z.omit=function(a){var b={},c=k.apply(f,j.call(arguments,1));for(var d in a)z.contains(c,d)||(b[d]=a[d]);return b},z.defaults=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)null==a[c]&&(a[c]=b[c])}),a},z.clone=function(a){return z.isObject(a)?z.isArray(a)?a.slice():z.extend({},a):a},z.tap=function(a,b){return b(a),a};var G=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof z&&(a=a._wrapped),b instanceof z&&(b=b._wrapped);var e=l.call(a);if(e!=l.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;c.push(a),d.push(b);var g=0,h=!0;if("[object Array]"==e){if(g=a.length,h=g==b.length)for(;g--&&(h=G(a[g],b[g],c,d)););}else{var i=a.constructor,j=b.constructor;if(i!==j&&!(z.isFunction(i)&&i instanceof i&&z.isFunction(j)&&j instanceof j))return!1;for(var k in a)if(z.has(a,k)&&(g++,!(h=z.has(b,k)&&G(a[k],b[k],c,d))))break;if(h){for(k in b)if(z.has(b,k)&&!g--)break;h=!g}}return c.pop(),d.pop(),h};z.isEqual=function(a,b){return G(a,b,[],[])},z.isEmpty=function(a){if(null==a)return!0;if(z.isArray(a)||z.isString(a))return 0===a.length;for(var b in a)if(z.has(a,b))return!1;return!0},z.isElement=function(a){return!(!a||1!==a.nodeType)},z.isArray=w||function(a){return"[object Array]"==l.call(a)},z.isObject=function(a){return a===Object(a)},A(["Arguments","Function","String","Number","Date","RegExp"],function(a){z["is"+a]=function(b){return l.call(b)=="[object "+a+"]"}}),z.isArguments(arguments)||(z.isArguments=function(a){return!(!a||!z.has(a,"callee"))}),"function"!=typeof/./&&(z.isFunction=function(a){return"function"==typeof a}),z.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},z.isNaN=function(a){return z.isNumber(a)&&a!=+a},z.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==l.call(a)},z.isNull=function(a){return null===a},z.isUndefined=function(a){return void 0===a},z.has=function(a,b){return m.call(a,b)},z.noConflict=function(){return a._=d,this},z.identity=function(a){return a},z.times=function(a,b,c){for(var d=Array(a),e=0;a>e;e++)d[e]=b.call(c,e);return d},z.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var H={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};H.unescape=z.invert(H.escape);var I={escape:new RegExp("["+z.keys(H.escape).join("")+"]","g"),unescape:new RegExp("("+z.keys(H.unescape).join("|")+")","g")};z.each(["escape","unescape"],function(a){z[a]=function(b){return null==b?"":(""+b).replace(I[a],function(b){return H[a][b]})}}),z.result=function(a,b){if(null==a)return null;var c=a[b];return z.isFunction(c)?c.call(a):c},z.mixin=function(a){A(z.functions(a),function(b){var c=z[b]=a[b];z.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),N.call(this,c.apply(z,a))}})};var J=0;z.uniqueId=function(a){var b=++J+"";return a?a+b:b},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,L={ +"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},M=/\\|'|\r|\n|\t|\u2028|\u2029/g;z.template=function(a,b,c){var d;c=z.defaults({},c,z.templateSettings);var e=new RegExp([(c.escape||K).source,(c.interpolate||K).source,(c.evaluate||K).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(M,function(a){return"\\"+L[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,z);var i=function(a){return d.call(this,a,z)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},z.chain=function(a){return z(a).chain()};var N=function(a){return this._chain?z(a).chain():a};z.mixin(z),A(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];z.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],N.call(this,c)}}),A(["concat","join","slice"],function(a){var b=f[a];z.prototype[a]=function(){return N.call(this,b.apply(this._wrapped,arguments))}}),z.extend(z.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],14:[function(b,c,d){(function(b){(function(){function e(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d-1?0:-1:a?0:-1}function g(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:v+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function h(a){return a.charCodeAt(0)}function i(a,b){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++eh||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)return-1}}return a.index-b.index}function j(a){var b=-1,c=a.length,d=a[0],e=a[c/2|0],f=a[c-1];if(d&&"object"==typeof d&&e&&"object"==typeof e&&f&&"object"==typeof f)return!1;var h=m();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=m();for(i.array=a,i.cache=h,i.push=g;++be?0:e);++d=w&&d===e,i=[];if(h){var k=j(b);k?(d=f,b=k):h=!1}for(;++c-1:void 0});return e.pop(),f.pop(),s&&(n(e),n(f)),g}function ba(a,b,c,d,e){(Zc(b)?Ya:hd)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zc(b))||id(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Zc(j)?j:[]:id(j)?j:{}),d.push(b),e.push(j),l||ba(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function ca(a,b){return a+Ec(Vc()*(b-a+1))}function ea(a,b,c){var d=-1,g=ia(),h=a?a.length:0,i=[],k=!b&&h>=w&&g===e,m=c||k?l():i;if(k){var p=j(m);g=f,m=p}for(;++d3&&"function"==typeof b[c-2])var d=t(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=p(arguments,1,c),f=-1,g=l(),h=l();++fc?Sc(0,f+c):c)||0,Zc(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Ja(a)?a.indexOf(b,c):e(a,b,c))>-1:hd(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ua(a,c,d){var e=!0;c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++ff&&(f=j)}else c=null==c&&Ja(a)?h:b.createCallback(c,d,3),Ya(a,function(a,b,d){var g=c(a,b,d);g>e&&(e=g,f=a)});return f}function bb(a,c,d){var e=1/0,f=e;if("function"!=typeof c&&d&&d[c]===a&&(c=null),null==c&&Zc(a))for(var g=-1,i=a.length;++gj&&(f=j)}else c=null==c&&Ja(a)?h:b.createCallback(c,d,3),Ya(a,function(a,b,d){var g=c(a,b,d);e>g&&(e=g,f=a)});return f}function cb(a,c,d,e){if(!a)return d;var f=arguments.length<3;c=b.createCallback(c,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(d=a[++g]);++gc?Sc(0,d+c):c||0}else if(c){var f=Ab(a,b);return a[f]===b?f:-1}return e(a,b,c)}function sb(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=f;for(c=b.createCallback(c,d,3);g--&&c(a[g],g,a);)e++}else e=null==c||d?1:c||e;return p(a,0,Tc(Sc(0,f-e),f))}function tb(){for(var a=[],b=-1,c=arguments.length,d=l(),g=ia(),h=g===e,i=l();++b=w&&j(b?a[b]:i)))}var m=a[0],p=-1,q=m?m.length:0,r=[];a:for(;++pc?Sc(0,d+c):Tc(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wb(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++cf;){var h=f+g>>>1;d(a[h])1?arguments:arguments[0],b=-1,c=a?ab(md(a,"length")):0,d=nc(0>c?0:c);++b2?ga(a,17,p(arguments,2),null,b):ga(a,1,null,null,b)}function Jb(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):ua(a),c=-1,d=b.length;++c2?ga(b,19,p(arguments,2),null,a):ga(b,3,null,null,a)}function Lb(){for(var a=arguments,b=a.length;b--;)if(!Da(a[b]))throw new wc;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mb(a,b){return b="number"==typeof b?b:+b||a.length,ga(a,4,null,null,null,b)}function Nb(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Da(a))throw new wc;if(b=Sc(0,b)||0,c===!0){var n=!0;m=!1}else Ea(c)&&(n=c.leading,l="maxWait"in c&&(Sc(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var o=function(){var c=b-(od()-g);if(0>=c){e&&Dc(e);var l=j;e=i=j=r,l&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jc(o,c)},p=function(){i&&Dc(i),e=i=j=r,(m||l!==b)&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=od(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var q=l-(g-k),r=0>=q;r?(e&&(e=Dc(e)),k=g,f=a.apply(h,d)):e||(e=Jc(p,q))}return r&&i?i=Dc(i):i||b===l||(i=Jc(o,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Ob(a){if(!Da(a))throw new wc;var b=p(arguments,1);return Jc(function(){a.apply(r,b)},1)}function Pb(a,b){if(!Da(a))throw new wc;var c=p(arguments,2);return Jc(function(){a.apply(r,c)},b)}function Qb(a,b){if(!Da(a))throw new wc;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):v+arguments[0];return Hc.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rb(a){var b,c;if(!Da(a))throw new wc;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sb(a){return ga(a,16,p(arguments,1))}function Tb(a){return ga(a,32,null,p(arguments,1))}function Ub(a,b,c){var d=!0,e=!0;if(!Da(a))throw new wc;return c===!1?d=!1:Ea(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),W.leading=d,W.maxWait=b,W.trailing=e,Nb(a,b,W)}function Vb(a,b){return ga(b,16,[a])}function Wb(a){return function(){return a}}function Xb(a,b,c){var d=typeof a;if(null==a||"function"==d)return t(a,b,c);if("object"!=d)return bc(a);var e=_c(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ea(g)?function(b){for(var c=e.length,d=!1;c--&&(d=aa(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Yb(a){return null==a?"":vc(a).replace(dd,ha)}function Zb(a){return a}function $b(a,d,e){var f=!0,g=d&&ua(d);d&&(e||g.length)||(null==e&&(e=d),h=c,d=a,a=b,g=ua(d)),e===!1?f=!1:Ea(e)&&"chain"in e&&(f=e.chain);var h=a,i=Da(h);Ya(g,function(b){var c=a[b]=d[b];i&&(h.prototype[b]=function(){var b=this.__chain__,d=this.__wrapped__,e=[d];Ic.apply(e,arguments);var g=c.apply(a,e);if(f||b){if(d===g&&Ea(g))return this;g=new h(g),g.__chain__=b}return g})})}function _b(){return a._=zc,this}function ac(){}function bc(a){return function(b){return b[a]}}function cc(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Vc();return Tc(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return ca(a,b)}function dc(a,b){if(a){var c=a[b];return Da(c)?a[b]():c}}function ec(a,c,d){var e=b.templateSettings;a=vc(a||""),d=fd({},d,e);var f,g=fd({},d.imports,e.imports),h=_c(g),i=Ra(g),j=0,l=d.interpolate||H,m="__p += '",n=uc((d.escape||H).source+"|"+l.source+"|"+(l===F?C:H).source+"|"+(d.evaluate||H).source+"|$","g");a.replace(n,function(b,c,d,e,g,h){return d||(d=e),m+=a.slice(j,h).replace(J,k),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),j=h+b.length,b}),m+="';\n";var o=d.variable,p=o;p||(o="obj",m="with ("+o+") {\n"+m+"\n}\n"),m=(f?m.replace(z,""):m).replace(A,"$1").replace(B,"$1;"),m="function("+o+") {\n"+(p?"":o+" || ("+o+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var q="\n/*\n//# sourceURL="+(d.sourceURL||"/lodash/template/source["+L++ +"]")+"\n*/";try{var s=qc(h,"return "+m+q).apply(r,i)}catch(t){throw t.source=m,t}return c?s(c):(s.source=m,s)}function fc(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nc(a);for(b=t(b,c,1);++d/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:b}},Nc||(s=function(){function b(){}return function(c){if(Ea(c)){b.prototype=c;var d=new b;b.prototype=null}return d||a.Object()}}());var Yc=Mc?function(a,b){X.value=b,Mc(a,"__bindData__",X),X.value=null}:ac,Zc=Oc||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ac.call(a)==N||!1},$c=function(a){var b,c=a,d=[];if(!c)return d;if(!Y[typeof a])return d;for(b in c)Hc.call(c,b)&&d.push(b);return d},_c=Rc?function(a){return Ea(a)?Rc(a):[]}:$c,ad={"&":"&","<":"<",">":">",'"':""","'":"'"},bd=wa(ad),cd=uc("("+_c(bd).join("|")+")","g"),dd=uc("["+_c(ad).join("")+"]","g"),ed=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=t(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h/g,G=RegExp("^["+y+"]*0+(?=.$)"),H=/($^)/,I=/\bthis\b/,J=/['\n\r\t\u2028\u2029\\]/g,K=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],L=0,M="[object Arguments]",N="[object Array]",O="[object Boolean]",P="[object Date]",Q="[object Function]",R="[object Number]",S="[object Object]",T="[object RegExp]",U="[object String]",V={};V[Q]=!1,V[M]=V[N]=V[O]=V[P]=V[R]=V[S]=V[T]=V[U]=!0;var W={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=Y[typeof window]&&window||this,_=Y[typeof d]&&d&&!d.nodeType&&d,aa=Y[typeof c]&&c&&!c.nodeType&&c,ba=aa&&aa.exports===_&&_,ca=Y[typeof b]&&b;!ca||ca.global!==ca&&ca.window!==ca||($=ca);var da=q();"function"==typeof a&&"object"==typeof a.amd&&a.amd?($._=da,a(function(){return da})):_&&aa?ba?(aa.exports=da)._=da:_._=da:$._=da}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(b,c,d){!function(b,e){"use strict";"object"==typeof d?c.exports=e():"function"==typeof a&&a.amd?a(e):b.UltraDeepClone=e()}(this,function(){function a(a){return"[object "+a+"]"}function b(a){for(var b=[],c=1;a>=c;c++)b.push("arg"+c);return b}function c(a){var c=b(a.length),d="return false || function ";return d+=a.name+"(",d+=c.join(", ")+") {\n",d+="return fn.apply(this, arguments);\n",d+="};",Function("fn",d)(a)}function d(a){return function(b,c,d){c.push(b);var e=a(b);return d.push(e),e}}function e(a){return a}function f(a){return new RegExp(a)}function g(a){return new Date(a.getTime())}function h(a){return c(a)}function i(a){return Object.create(Object.getPrototypeOf(a))}function j(a){return[]}function k(a){var b=a.length;return new a.constructor(b)}function l(a,b){return function(c,d,e){var f=this;return Object.getOwnPropertyNames(c).filter(function(a){return!b||-1===b.indexOf(a)}).reduce(function(a,b){var g=d.indexOf(c[b]);return-1===g?a[b]=f(c[b]):a[b]=e[g],a},a(c,d,e))}}var m=["caller","arguments"],n=["BYTES_PER_ELEMENT","get","set","slice","subarray","buffer","length","byteOffset","byteLength"],o=d(e),p=l(d(k),n),q={};return q[a("RegExp")]=d(f),q[a("Date")]=d(g),q[a("Function")]=l(d(h),m),q[a("Object")]=l(d(i)),q[a("Array")]=l(d(j)),["Null","Undefined","Number","String","Boolean"].map(a).forEach(function(a){q[a]=o}),["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].map(a).forEach(function(a){q[a]=p}),function(a){function b(a){var e=Object.prototype.toString.call(a);return q[e].call(b,a,c,d)}var c=[],d=[];return b(a)}})},{}],16:[function(a,b,c){function d(){for(var a={},b=0;b1?void f.bindSequence(a,h,b,c):(g=f.getKeyInfo(a,c),f.callbacks[g.key]=f.callbacks[g.key]||[],f.getMatches(g.key,g.modifiers,{type:g.action},d,a,e),void f.callbacks[g.key][d?"unshift":"push"]({callback:b,modifiers:g.modifiers,action:g.action,seq:d,level:e,combo:a}))}},{}],7:[function(a,b,c){var d=a("dom-event").off;b.exports=function(){var a=this,b=a.element;d(b,"keypress",a.eventHandler),d(b,"keydown",a.eventHandler),d(b,"keyup",a.eventHandler)}},{"dom-event":33}],8:[function(a,b,c){"use strict";b.exports=function(b,c,d,e){var f,g,h=this;h.stopCallback(c,c.target||c.srcElement,d,e)||b(c,d)===!1&&(f=a("../../helpers/preventDefault"),f(c),(g=a("../../helpers/stopPropagation"))(c))}},{"../../helpers/preventDefault":27,"../../helpers/stopPropagation":32}],9:[function(a,b,c){"use strict";b.exports=function(b,c){var d,e,f,g,h,i,j,k=this,l=[];for(d=a("../../helpers/keysFromString"),e=d(b),h=a("../../helpers/special-aliases"),i=a("../../helpers/shift-map"),j=a("../../helpers/isModifier"),g=0;g95&&112>e||b.hasOwnProperty(e)&&(d.REVERSE_MAP[b[e]]=e)}return d.REVERSE_MAP}},{"../../helpers/special-keys-map":31}],12:[function(a,b,c){"use strict";b.exports=function(b,c,d){var e,f,g,h,i=this,j={},k=0,l=!1;for(e=i.getMatches(b,c,d),f=0;f-1)return!1;var c=b.tagName.toLowerCase();return"input"===c||"select"===c||"textarea"===c||b.isContentEditable}},{}],20:[function(a,b,c){"use strict";b.exports=function(a,b){var c=this;return c.directMap[a+":"+b]&&c.directMap[a+":"+b]({},a),this}},{}],21:[function(a,b,c){"use strict";b.exports=function(a,b){var c=this;return c.bind(a,function(){},b)}},{}],22:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.instances.forEach(function(a){a.reset()})}},{}],23:[function(a,b,c){"use strict";b.exports=function(b){var c,d;if(c=a("./special-keys-map"),d=a("./special-characters-map"),"keypress"===b.type){var e=String.fromCharCode(b.which);return b.shiftKey||(e=e.toLowerCase()),e}return c[b.which]?c[b.which]:d[b.which]?d[b.which]:String.fromCharCode(b.which).toLowerCase()}},{"./special-characters-map":30,"./special-keys-map":31}],24:[function(a,b,c){"use strict";b.exports=function(a){var b=[];return a.shiftKey&&b.push("shift"),a.altKey&&b.push("alt"),a.ctrlKey&&b.push("ctrl"),a.metaKey&&b.push("meta"),b}},{}],25:[function(a,b,c){"use strict";b.exports=function(a){return"shift"===a||"ctrl"===a||"alt"===a||"meta"===a}},{}],26:[function(a,b,c){"use strict";b.exports=function(a){return"+"===a?["+"]:a.split("+")}},{}],27:[function(a,b,c){"use strict";b.exports=function(a){return a.preventDefault?void a.preventDefault():void(a.returnValue=!1)}},{}],28:[function(a,b,c){"use strict";b.exports={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"}},{}],29:[function(a,b,c){"use strict";b.exports={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"}},{}],30:[function(a,b,c){"use strict";b.exports={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}},{}],31:[function(a,b,c){"use strict";b.exports={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",187:"plus",189:"minus",224:"meta"};for(var d=1;20>d;++d)b.exports[111+d]="f"+d;for(d=0;9>=d;++d)b.exports[d+96]=d},{}],32:[function(a,b,c){"use strict";b.exports=function(a){return a.stopPropagation?void a.stopPropagation():void(a.cancelBubble=!0)}},{}],33:[function(a,b,c){function d(a,b,c,d){return!a.addEventListener&&(b="on"+b),(a.addEventListener||a.attachEvent).call(a,b,c,d),c}function e(a,b,c,d){return!a.removeEventListener&&(b="on"+b),(a.removeEventListener||a.detachEvent).call(a,b,c,d),c}b.exports=d,b.exports.on=d,b.exports.off=e},{}],34:[function(a,b,c){WYMeditor.EXTERNAL_MODULES.Combokeys=a("combokeys")},{combokeys:1}]},{},[34])(34)}),function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.foo=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g-1?"backwardsRemoval":e.indexOf(c)>-1?"forwardRemoval":"space"===c?c:"enter"===c?c:"characterAddition"}if("paste"===a.type)return a.type;if("drop"===a.type)return a.type;throw new Error("Shouldn't get this far")}},{keycode:15}],10:[function(a,b,c){"use strict";b.exports=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent)return a.attachEvent("on"+b,c);throw"No event handler adding interface found"}},{}],11:[function(a,b,c){var d=a("synthetic-dom-events"),e=function(a,b,c,d){return a.addEventListener(b,c,d||!1)},f=function(a,b,c,d){return a.removeEventListener(b,c,d||!1)},g=function(a,b,c,d){function g(e){f(a,b,g,d),c(e)}e(a,b,g,d)},h=function(a,b,c){var e=d(b,c);a.dispatchEvent(e)};document.addEventListener||(e=function(a,b,c){return a.attachEvent("on"+b,c)}),document.removeEventListener||(f=function(a,b,c){return a.detachEvent("on"+b,c)}),document.dispatchEvent||(h=function(a,b,c){var e=d(b,c);return a.fireEvent("on"+e.type,e)}),b.exports={on:e,off:f,once:g,emit:h}},{"synthetic-dom-events":12}],12:[function(a,b,c){function d(a,b){return(a.ctrlKey!=(b.ctrlKey||!1)||a.altKey!=(b.altKey||!1)||a.shiftKey!=(b.shiftKey||!1)||a.metaKey!=(b.metaKey||!1)||a.keyCode!=(b.keyCode||0)||a.charCode!=(b.charCode||0))&&(a=document.createEvent("Event"),a.initEvent(b.type,b.bubbles,b.cancelable),a.ctrlKey=b.ctrlKey||!1,a.altKey=b.altKey||!1,a.shiftKey=b.shiftKey||!1,a.metaKey=b.metaKey||!1,a.keyCode=b.keyCode||0,a.charCode=b.charCode||0),a}var e=(window,document||{}),f=(e.documentElement||{},!0);try{e.createEvent("KeyEvents")}catch(g){f=!1}var h=function(a,b){b=b||{};var c=l(a),g=c;"KeyboardEvent"===c&&f&&(c="KeyEvents",g="KeyEvent");var h=e.createEvent(c),i="init"+g,k="function"==typeof h[i]?i:"initEvent",m=j[k],n=[],o={};b.type=a;for(var p=0;pf;f++)d[String.fromCharCode(f)]=f-32;for(var f=48;58>f;f++)d[f-48]=f;for(f=1;13>f;f++)d["f"+f]=f+111;for(f=0;10>f;f++)d["numpad "+f]=f+96;var g=c.names=c.title={};for(f in d)g[d[f]]=f;for(var h in e)d[h]=e[h]},{}],16:[function(a,b,c){WYMeditor.EXTERNAL_MODULES.Edited=a("edited")},{edited:1}]},{},[16])(16)}),WYMeditor.UndoRedo=function(a){var b=this;b.wym=a,a.keyboard.combokeys.bind("mod+z",function(){return a.undoRedo.undo(),!1}),a.keyboard.combokeys.bind(["shift+meta+z","mod+y"],function(){return a.undoRedo.redo(),!1})},WYMeditor.UndoRedo.prototype._onBodyFocus=function(){var a=this,b=a.wym;a.history||setTimeout(function(){a._instantiateHistory(b.getCurrentState())},0)},WYMeditor.UndoRedo.prototype._add=function(){var a=this,b=a.wym;a.history&&(a.history.add(b.getCurrentState()),a.hasUnregisteredModification=!1)},WYMeditor.UndoRedo.prototype._do=function(a){var b,c,d=this,e=d.wym,f=d.history;if(d.history){if(a===WYMeditor.UndoRedo.UN){if(0===f.lengthBackward())return;d.hasUnregisteredModification&&d._add(),f.backward(),c="postUndo"}else{if(a!==WYMeditor.UndoRedo.RE)throw"Single parameter must be either `'un'` or `'re'` (there are constants for those).";if(0===f.lengthForward())return;f.forward(),c="postRedo"}b=f.get(),e.rawHtml(b.html),b.savedSelection&&(b.savedSelection.win=e._iframe.contentWindow,b.savedSelection.doc=e._doc,rangy.restoreSelection(b.savedSelection)),jQuery(e.element).trigger(WYMeditor.EVENTS[c])}},WYMeditor.UndoRedo.UN="un",WYMeditor.UndoRedo.RE="re",WYMeditor.UndoRedo.prototype.redo=function(){var a=this;a._do(WYMeditor.UndoRedo.RE)},WYMeditor.UndoRedo.prototype.undo=function(){var a=this;a._do(WYMeditor.UndoRedo.UN)},WYMeditor.UndoRedo.prototype.reset=function(){var a=this,b=a.wym;a._instantiateHistory(b.getCurrentState()),a.hasUnregisteredModification=null},WYMeditor.UndoRedo.prototype._instantiateHistory=function(a){var b=this;b.history=new WYMeditor.EXTERNAL_MODULES.ObjectHistory(a,{limit:100})},WYMeditor.Keyboard=function(a){var b=this;return b._wym=a,b.combokeys=new WYMeditor.EXTERNAL_MODULES.Combokeys(a._doc),b},WYMeditor.Keyboard.DEFAULT_KEYBOARD_SHORTCUTS=[{combo:"mod+b",cb:function(){var a=this;return a.exec(WYMeditor.EXEC_COMMANDS.BOLD),!1}},{combo:"mod+i",cb:function(){var a=this;return a.exec(WYMeditor.EXEC_COMMANDS.ITALIC),!1}},{combo:"mod+k",cb:function(){var a=this;return a.dialog(WYMeditor.DIALOGS.CreateLink),!1}},{combo:"tab",cb:function(){return!1}}],WYMeditor.Keyboard.prototype._attachDefaultKeyboardShortcuts=function(){var a,b,c=this,d=c._wym,e=c.constructor.DEFAULT_KEYBOARD_SHORTCUTS;for(b=0;ba;a++)this._patterns[a]="("+this._untokenizeRegex(this._tokenizeRegex(this._patterns[a]).replace(/([\/\(\)])/g,"\\$1"))+")";this._regex=new RegExp(this._patterns.join("|"),this._getPerlMatchingFlags())}return this._regex},WYMeditor.ParallelRegex.prototype._tokenizeRegex=function(a){return a.replace(/\(\?(i|m|s|x|U)\)/,"~~~~~~Tk1$1~~~~~~").replace(/\(\?(\-[i|m|s|x|U])\)/,"~~~~~~Tk2$1~~~~~~").replace(/\(\?\=(.*)\)/,"~~~~~~Tk3$1~~~~~~").replace(/\(\?\!(.*)\)/,"~~~~~~Tk4$1~~~~~~").replace(/\(\?\<\=(.*)\)/,"~~~~~~Tk5$1~~~~~~").replace(/\(\?\<\!(.*)\)/,"~~~~~~Tk6$1~~~~~~").replace(/\(\?\:(.*)\)/,"~~~~~~Tk7$1~~~~~~")},WYMeditor.ParallelRegex.prototype._untokenizeRegex=function(a){return a.replace(/~~~~~~Tk1(.{1})~~~~~~/,"(?$1)").replace(/~~~~~~Tk2(.{2})~~~~~~/,"(?$1)").replace(/~~~~~~Tk3(.*)~~~~~~/,"(?=$1)").replace(/~~~~~~Tk4(.*)~~~~~~/,"(?!$1)").replace(/~~~~~~Tk5(.*)~~~~~~/,"(?<=$1)").replace(/~~~~~~Tk6(.*)~~~~~~/,"(?","Comment")},WYMeditor.XhtmlLexer.prototype.addScriptTokens=function(a){this.addEntryPattern("","Script")},WYMeditor.XhtmlLexer.prototype.addCssTokens=function(a){this.addEntryPattern("","Css")},WYMeditor.XhtmlLexer.prototype.addTagTokens=function(a){this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*/>",a,"SelfClosingTag"),this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*>",a,"OpeningTag"),this.addEntryPattern("<[a-z0-9:-]+[\\/ \\>]+",a,"OpeningTag"),this.addInTagDeclarationTokens("OpeningTag"),this.addSpecialPattern("",a,"ClosingTag")},WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens=function(a){this.addSpecialPattern("\\s+",a,"Ignore"),this.addAttributeTokens(a),this.addExitPattern("/>",a),this.addExitPattern(">",a)},WYMeditor.XhtmlLexer.prototype.addAttributeTokens=function(a){this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?==)\\s*",a,"TagAttributes"),this.addEntryPattern('=\\s*"',a,"DoubleQuotedAttribute"),this.addPattern('\\\\"',"DoubleQuotedAttribute"),this.addExitPattern('"',"DoubleQuotedAttribute"),this.addEntryPattern("=\\s*'",a,"SingleQuotedAttribute"),this.addPattern("\\\\'","SingleQuotedAttribute"),this.addExitPattern("'","SingleQuotedAttribute"),this.addSpecialPattern("=\\s*[^>\\s]*",a,"UnquotedAttribute")},WYMeditor.XhtmlParser=function(a,b){return b=b||"Text",this._Lexer=new WYMeditor.XhtmlLexer(this),this._Listener=a,this._mode=b,this._matches=[],this._last_match="",this._current_match="",this},WYMeditor.XhtmlParser.prototype.parse=function(a){return this._Lexer.parse(this.beforeParsing(a)),this.afterParsing(this._Listener.getResult())},WYMeditor.XhtmlParser.prototype.beforeParsing=function(a){return(a.match(/class="MsoNormal"/)||a.match(/ns = "urn:schemas-microsoft-com/))&&this._Listener.avoidStylingTagsAndAttributes(),this._Listener.beforeParsing(a)},WYMeditor.XhtmlParser.prototype.afterParsing=function(a){return this._Listener._avoiding_tags_implicitly&&this._Listener.allowStylingTagsAndAttributes(),this._Listener.afterParsing(a)},WYMeditor.XhtmlParser.prototype.Ignore=function(a,b){return!0},WYMeditor.XhtmlParser.prototype.Text=function(a){return this._Listener.addContent(a),!0},WYMeditor.XhtmlParser.prototype.Comment=function(a,b){return this._addNonTagBlock(a,b,"addComment")},WYMeditor.XhtmlParser.prototype.Script=function(a,b){return this._addNonTagBlock(a,b,"addScript")},WYMeditor.XhtmlParser.prototype.Css=function(a,b){return this._addNonTagBlock(a,b,"addCss")},WYMeditor.XhtmlParser.prototype._addNonTagBlock=function(a,b,c){switch(b){case WYMeditor.LEXER_ENTER:this._non_tag=a;break;case WYMeditor.LEXER_UNMATCHED:this._non_tag+=a;break;case WYMeditor.LEXER_EXIT:switch(c){case"addComment":this._Listener.addComment(this._non_tag+a);break;case"addScript":this._Listener.addScript(this._non_tag+a);break;case"addCss":this._Listener.addCss(this._non_tag+a)}}return!0},WYMeditor.XhtmlParser.prototype.SelfClosingTag=function(a,b){this.OpeningTag(a,b),this.normalizeTag(a);return this.ClosingTag(a,b)},WYMeditor.XhtmlParser.prototype.OpeningTag=function(a,b){switch(b){case WYMeditor.LEXER_ENTER:this._tag=this.normalizeTag(a),this._tag_attributes={};break;case WYMeditor.LEXER_SPECIAL:this._callOpenTagListener(this.normalizeTag(a));break;case WYMeditor.LEXER_EXIT:this._callOpenTagListener(this._tag,this._tag_attributes)}return!0},WYMeditor.XhtmlParser.prototype.ClosingTag=function(a,b){return this._callCloseTagListener(this.normalizeTag(a)),!0},WYMeditor.XhtmlParser.prototype._callOpenTagListener=function(a,b){b=b||{},this.autoCloseUnclosedBeforeNewOpening(a),this._Listener.isBlockTag(a)?(this._Listener._tag_stack.push(a),this._Listener.fixNestingBeforeOpeningBlockTag(a,b),this._Listener.openBlockTag(a,b),this._increaseOpenTagCounter(a)):this._Listener.isInlineTag(a)?this._Listener.inlineTag(a,b):(this._Listener.openUnknownTag(a,b),this._increaseOpenTagCounter(a)),this._Listener.last_tag=a,this._Listener.last_tag_opened=!0,this._Listener.last_tag_attributes=b},WYMeditor.XhtmlParser.prototype._callCloseTagListener=function(a){if(this._decreaseOpenTagCounter(a)){if(this.autoCloseUnclosedBeforeTagClosing(a),this._Listener.isBlockTag(a)){var b=this._Listener._tag_stack.pop();if(b===!1)return;if(b!==a){if(this._Listener._extraBlockClosingTags)return this._Listener._tag_stack.push(b),void this._Listener.removedExtraBlockClosingTag();a=b}this._Listener.closeBlockTag(a)}}else this._Listener.isInlineTag(a)||this._Listener.closeUnopenedTag(a);this._Listener.last_tag=a,this._Listener.last_tag_opened=!1},WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter=function(a){this._Listener._open_tags[a]=this._Listener._open_tags[a]||0,this._Listener._open_tags[a]++},WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter=function(a){return this._Listener._open_tags[a]?(this._Listener._open_tags[a]--,0===this._Listener._open_tags[a]&&(this._Listener._open_tags[a]=void 0),!0):!1},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening=function(a){this._autoCloseUnclosed(a,!1)},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing=function(a){this._autoCloseUnclosed(a,!0)},WYMeditor.XhtmlParser.prototype._autoCloseUnclosed=function(a,b){if(b=b||!1,this._Listener._open_tags)for(var c in this._Listener._open_tags)this._Listener.shouldCloseTagAutomatically(c,a,b)&&this._callCloseTagListener(c,!0); +},WYMeditor.XhtmlParser.prototype.getTagReplacements=function(){return this._Listener.getTagReplacements()},WYMeditor.XhtmlParser.prototype.normalizeTag=function(a){a=a.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,"").toLowerCase();var b=this._Listener.getTagReplacements();return b[a]?b[a]:a},WYMeditor.XhtmlParser.prototype.TagAttributes=function(a,b){return WYMeditor.LEXER_SPECIAL==b&&(this._current_attribute=a),!0},WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.UnquotedAttribute=function(a,b){return this._tag_attributes[this._current_attribute]=a.replace(/^=/,""),!0},WYMeditor.XhtmlSaxListener=function(){return this.output="",this.helper=new WYMeditor.XmlHelper,this._open_tags={},this.validator=WYMeditor.XhtmlValidator,this._tag_stack=[],this.avoided_tags=[],this._insert_before_closing=[],this._insert_after_closing=[],this._last_node_was_text=!1,this._consecutive_brs=0,this._lastAddedOpenTag="",this._insideLI=!1,this.tagsToUnwrapInLists=WYMeditor.DocumentStructureManager.VALID_DEFAULT_ROOT_CONTAINERS,this._rootInlineTagsToRemove=["br"],this._extraBlockClosingTags=0,this._insideTagToRemove=!1,this._addSpacerBeforeElementInLI=!1,this._insideTagToRemove=!1,this._lastTagRemoved=!1,this._extraLIClosingTags=0,this._removedTagStackIndex=0,this.entities={" ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","…":"…","‰":"‰","′":"′","″":"″","‹":"‹","›":"›","‾":"‾","⁄":"⁄","€":"€","ℑ":"ℑ","℘":"℘","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},this.block_tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","button","caption","cite","code","colgroup","dd","del","div","dfn","dl","dt","em","fieldset","form","head","h1","h2","h3","h4","h5","h6","html","i","iframe","ins","kbd","label","legend","li","map","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var","extends"],this.inline_tags=["br","col","hr","img","input"],this},WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically=function(a,b,c){if("td"!=a&&"option"!=a)return!1;var d=this._open_tags[a];if(!d)return!1;if("td"==a){var e=this._open_tags.tr||0;if(!c&&"td"===b&&d>=e)return!0;if(c&&"tr"==b&&d>e)return!0}else if("option"==a&&(c&&"select"==b||!c&&"option"==b))return!0;return!1},WYMeditor.XhtmlSaxListener.prototype.beforeParsing=function(a){return this.output="",this._insert_before_closing=[],this._insert_after_closing=[],this._open_tags={},this._tag_stack=[],this._last_node_was_text=!1,this._lastTagRemoved=!1,this._insideTagToRemove=!1,this.last_tag=null,a},WYMeditor.XhtmlSaxListener.prototype.afterParsing=function(a){return a=this.replaceNamedEntities(a),a=this.joinRepeatedEntities(a),a=this.removeEmptyTags(a),a=this.removeBrInPre(a)},WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities=function(a){for(var b in this.entities)a=a.replace(new RegExp(b,"g"),this.entities[b]);return a},WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities=function(a){var b="em|strong|sub|sup|acronym|pre|del|address";return a.replace(new RegExp("<\\1>",""),"").replace(new RegExp("(s*<("+b+")>s*){2}(.*)(s*s*){2}",""),"<$2>$3<$2>")},WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags=function(a){return a.replace(new RegExp("<("+this.block_tags.join("|").replace(/\|td/,"").replace(/\|th/,"")+")>(
      | | |\\s)*","g"),"")},WYMeditor.XhtmlSaxListener.prototype.removeBrInPre=function(a){var b=a.match(new RegExp("]*>(.*?)","gmi"));if(b)for(var c=0;c","g"),String.fromCharCode(13,10)));return a},WYMeditor.XhtmlSaxListener.prototype.getResult=function(){return this.output},WYMeditor.XhtmlSaxListener.prototype.getTagReplacements=function(){return{b:"strong",i:"em"}},WYMeditor.XhtmlSaxListener.prototype.getTagForStyle=function(a){return/sub/.test(a)?"sub":/super/.test(a)?"sup":/bold/.test(a)?"strong":/italic/.test(a)?"em":!1},WYMeditor.XhtmlSaxListener.prototype.addContent=function(a){this.last_tag&&"li"==this.last_tag&&(a=a.replace(/(\r|\n|\r\n)+$/g,""),a=a.replace(/(\r|\n|\r\n)+/g," ")),a.replace(/^\s+|\s+$/g,"").length>0&&(this._last_node_was_text=!0,this._addSpacerBeforeElementInLI&&(this.output+="
      ",this._addSpacerBeforeElementInLI=!1)),this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addComment=function(a){this.remove_comments||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addScript=function(a){this.remove_scripts||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addCss=function(a){this.remove_embeded_styles||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.openBlockTag=function(a,b){var c=this._last_node_was_text;if(this._last_node_was_text=!1,!this._insideTagToRemove){if(this._shouldRemoveTag(a,b))return this._insideTagToRemove=!0,void(this._removedTagStackIndex=this._tag_stack.length-1);if(this._insideLI&&jQuery.inArray(a,this.tagsToUnwrapInLists)>-1)return("li"!==this._lastAddedOpenTag||c)&&(this.output+="
      ",this._addSpacerBeforeElementInLI=!1),this._tag_stack.pop(),void this._extraBlockClosingTags++;if(this._addSpacerBeforeElementInLI&&"li"!==a&&-1===jQuery.inArray(a,WYMeditor.LIST_TYPE_ELEMENTS)&&(this.output+="
      ",this._addSpacerBeforeElementInLI=!1),b=this.validator.getValidTagAttributes(a,b),b=this.removeUnwantedClasses(b),"span"===a&&b.style){var d=this.getTagForStyle(b.style);d&&(a=d,this._tag_stack.pop(),this._tag_stack.push(a),b.style="")}"li"===a&&(this._insideLI=!0,this._addSpacerBeforeElementInLI=!1),this.output+=this.helper.tag(a,b,!0),this._lastAddedOpenTag=a,this._lastTagRemoved=!1}},WYMeditor.XhtmlSaxListener.prototype.inlineTag=function(a,b){this._insideTagToRemove||this._shouldRemoveTag(a,b)||(this._last_node_was_text=!1,b=this.validator.getValidTagAttributes(a,b),b=this.removeUnwantedClasses(b),this.output+=this.helper.tag(a,b),this._lastTagRemoved=!1)},WYMeditor.XhtmlSaxListener.prototype.openUnknownTag=function(a,b){},WYMeditor.XhtmlSaxListener.prototype.closeBlockTag=function(a){return this._last_node_was_text=!1,this._insideTagToRemove?(this._tag_stack.length===this._removedTagStackIndex&&(this._insideTagToRemove=!1),void(this._lastTagRemoved=!0)):("li"===a&&(this._insideLI=!1,this._addSpacerBeforeElementInLI=!1),jQuery.inArray(a,WYMeditor.LIST_TYPE_ELEMENTS)>-1&&(this._insideLI=!1),void(this.output=this.output+this._getClosingTagContent("before",a)+""+this._getClosingTagContent("after",a)))},WYMeditor.XhtmlSaxListener.prototype.removedExtraBlockClosingTag=function(){this._extraBlockClosingTags--,this._addSpacerBeforeElementInLI=!0,this._last_node_was_text=!1},WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag=function(a){},WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag=function(a){this._last_node_was_text=!1,this._insideTagToRemove||("li"===a&&this._extraLIClosingTags?this._extraLIClosingTags--:this.output+="")},WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes=function(){this.avoided_tags=["div","span"],this.validator.skiped_attributes=["style"],this.validator.skiped_attribute_values=["MsoNormal","main1"],this._avoiding_tags_implicitly=!0},WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes=function(){this.avoided_tags=[],this.validator.skiped_attributes=[],this.validator.skiped_attribute_values=[],this._avoiding_tags_implicitly=!1},WYMeditor.XhtmlSaxListener.prototype.isBlockTag=function(a){return!WYMeditor.Helper.arrayContains(this.avoided_tags,a)&&WYMeditor.Helper.arrayContains(this.block_tags,a)},WYMeditor.XhtmlSaxListener.prototype.isInlineTag=function(a){return!WYMeditor.Helper.arrayContains(this.avoided_tags,a)&&WYMeditor.Helper.arrayContains(this.inline_tags,a)},WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag=function(a,b){this._insertContentWhenClosingTag("after",a,b)},WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag=function(a,b){this._insertContentWhenClosingTag("before",a,b)},WYMeditor.XhtmlSaxListener.prototype.removeUnwantedClasses=function(a){var b,c;if(!a["class"])return a;for(c=0;c=2){var c=this._tag_stack[this._tag_stack.length-2];"li"!=c||this._shouldRemoveTag(a,b)||(this._open_tags.li-=1,0===this._open_tags.li&&(this._open_tags.li=void 0),this._tag_stack.splice(this._tag_stack.length-2,1),this._last_node_was_text=!1,this._insideTagToRemove?this._tag_stack.length-1===this._removedTagStackIndex&&(this._insideTagToRemove=!1,this._lastTagRemoved=!0,this._extraLIClosingTags++):this.output+="")}}else this._shouldRemoveTag(a,b)||(this.output+=this.helper.tag("li",{},!0),this.insertContentAfterClosingTag(a,"")),this._last_node_was_text=!1;else this._lastTagRemoved?(this._insideTagToRemove=!0,this._removedTagStackIndex=this._tag_stack.length-1):this._shouldRemoveTag(a,b)||(this.output=this.output.replace(/<\/li>\s*$/,""),this.insertContentAfterClosingTag(a,""))},WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag=function(a,b,c){this["_insert_"+a+"_closing"]||(this["_insert_"+a+"_closing"]=[]),this["_insert_"+a+"_closing"][b]||(this["_insert_"+a+"_closing"][b]=[]),this["_insert_"+a+"_closing"][b].push(c)},WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent=function(a,b){return this["_insert_"+a+"_closing"]&&this["_insert_"+a+"_closing"][b]&&this["_insert_"+a+"_closing"][b].length>0?this["_insert_"+a+"_closing"][b].pop():""},WYMeditor.XhtmlSaxListener.prototype._shouldRemoveTag=function(a,b){return this._isEditorOnlyTag(a,b)?!0:this._isRootInlineTagToRemove(a,b,this._tag_stack)?!0:this._isThirdConsecutiveBrWithNoAttributes(a,b)?!0:!1},WYMeditor.XhtmlSaxListener.prototype._isEditorOnlyTag=function(a,b){var c;return b["class"]?(c=b["class"].split(" "),WYMeditor.Helper.arrayContains(c,WYMeditor.EDITOR_ONLY_CLASS)?!0:!1):!1},WYMeditor.XhtmlSaxListener.prototype._isRootInlineTagToRemove=function(a,b,c){return this.isInlineTag(a)?c.length>0?!1:WYMeditor.Helper.arrayContains(this._rootInlineTagsToRemove,a)?!0:!1:!1},WYMeditor.XhtmlSaxListener.prototype._isThirdConsecutiveBrWithNoAttributes=function(a,b){var c;if("br"!==a)return this._consecutive_brs=0,!1;if(0!==this._consecutive_brs&&this._last_node_was_text)return this._consecutive_brs=0,!1;for(c in b)if(b.hasOwnProperty(c))return this._consecutive_brs=0,!1;return this._consecutive_brs++,this._consecutive_brs>2?!0:!1},WYMeditor.XhtmlValidator={_attributes:{core:{except:["base","head","html","meta","param","script","style","title"],attributes:["class","id","title","accesskey","tabindex","/^data-.*/"]},styleAttr:{except:["img"],attributes:["style"]},language:{except:["base","br","hr","iframe","param","script"],attributes:{dir:["ltr","rtl"],0:"lang",1:"xml:lang"}},keyboard:{attributes:{accesskey:/^(\w){1}$/,tabindex:/^(\d)+$/}}},_events:{window:{only:["body"],attributes:["onload","onunload"]},form:{only:["form","input","textarea","select","a","label","button"],attributes:["onchange","onsubmit","onreset","onselect","onblur","onfocus"]},keyboard:{except:["base","bdo","br","frame","frameset","head","html","iframe","meta","param","script","style","title"],attributes:["onkeydown","onkeypress","onkeyup"]},mouse:{except:["base","bdo","br","head","html","meta","param","script","style","title"],attributes:["onclick","ondblclick","onmousedown","onmousemove","onmouseover","onmouseout","onmouseup"]}},_tags:{a:{attributes:{0:"charset",1:"coords",2:"href",3:"hreflang",4:"name",5:"rel",6:"rev",shape:/^(rect|rectangle|circ|circle|poly|polygon)$/,7:"type"}},0:"abbr",1:"acronym",2:"address",area:{attributes:{0:"alt",1:"coords",2:"href",nohref:/^(true|false)$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/},required:["alt"]},3:"b",base:{attributes:["href"],required:["href"]},bdo:{attributes:{dir:/^(ltr|rtl)$/},required:["dir"]},4:"big",blockquote:{attributes:["cite"]},5:"body",6:"br",button:{attributes:{disabled:/^(disabled)$/,type:/^(button|reset|submit)$/,0:"value"},inside:"form"},7:"caption",8:"cite",9:"code",col:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"},inside:"colgroup"},colgroup:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"}},10:"dd",del:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},11:"div",12:"dfn",13:"dl",14:"dt",15:"em",fieldset:{inside:"form"},form:{attributes:{0:"action",1:"accept",2:"accept-charset",3:"enctype",method:/^(get|post)$/},required:["action"]},head:{attributes:["profile"]},16:"h1",17:"h2",18:"h3",19:"h4",20:"h5",21:"h6",22:"hr",html:{attributes:["xmlns"]},23:"i",img:{attributes:["alt","src","height","ismap","longdesc","usemap","width"],required:["alt","src"]},input:{attributes:{0:"accept",1:"alt",checked:/^(checked)$/,disabled:/^(disabled)$/,maxlength:/^(\d)+$/,2:"name",readonly:/^(readonly)$/,size:/^(\d)+$/,3:"src",type:/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/,4:"value"},inside:"form"},ins:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},24:"kbd",label:{attributes:["for"],inside:"form"},25:"legend",26:"li",link:{attributes:{0:"charset",1:"href",2:"hreflang",media:/^(all|braille|print|projection|screen|speech|,|;| )+$/i,rel:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,rev:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,3:"type"},inside:"head"},map:{attributes:["id","name"],required:["id"]},meta:{attributes:{0:"content","http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i,1:"name",2:"scheme"},required:["content"]},27:"noscript",object:{attributes:["archive","classid","codebase","codetype","data","declare","height","name","standby","type","usemap","width"]},28:"ol",optgroup:{attributes:{0:"label",disabled:/^(disabled)$/},required:["label"]},option:{attributes:{0:"label",disabled:/^(disabled)$/,selected:/^(selected)$/,1:"value"},inside:"select"},29:"p",param:{attributes:{0:"type",valuetype:/^(data|ref|object)$/,1:"valuetype",2:"value"},required:["name"]},30:"pre",q:{attributes:["cite"]},31:"samp",script:{attributes:{type:/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/,0:"charset",defer:/^(defer)$/,1:"src"},required:["type"]},select:{attributes:{disabled:/^(disabled)$/,multiple:/^(multiple)$/,0:"name",1:"size"},inside:"form"},32:"small",33:"span",34:"strong",style:{attributes:{0:"type",media:/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/},required:["type"]},35:"sub",36:"sup",table:{attributes:{0:"border",1:"cellpadding",2:"cellspacing",frame:/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/,rules:/^(none|groups|rows|cols|all)$/,3:"summary",4:"width"}},tbody:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},td:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},textarea:{attributes:["cols","rows","disabled","name","readonly"],required:["cols","rows"],inside:"form"},tfoot:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom)$/,2:"baseline"}},th:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},thead:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},37:"title",tr:{attributes:{align:/^(right|left|center|justify|char)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},38:"tt",39:"ul",40:"var"},skiped_attributes:[],skiped_attribute_values:[],getValidTagAttributes:function(a,b){var c={},d=this.getPossibleTagAttributes(a);for(var e in b){var f=b[e];e=e.toLowerCase();var g=WYMeditor.Helper;g.arrayContains(this.skiped_attributes,e)||g.arrayContains(this.skiped_attribute_values,f)||("function"!=typeof f&&g.arrayContains(d,e)?this.doesAttributeNeedsValidation(a,e)?this.validateAttribute(a,e,f)&&(c[e]=f):c[e]=f:jQuery.each(d,function(){this.match(/\/(.*)\//)&&(regex=new RegExp(this.match(/\/(.*)\//)[1]),regex.test(e)&&(c[e]=f))}))}return c},getUniqueAttributesAndEventsForTag:function(a){var b=[];if(this._tags[a]&&this._tags[a].attributes)for(var c in this._tags[a].attributes)b.push(parseInt(c,10)==c?this._tags[a].attributes[c]:c);return b},getDefaultAttributesAndEventsForTags:function(){var a=[];for(var b in this._events)a.push(this._events[b]);for(b in this._attributes)a.push(this._attributes[b]);return a},isValidTag:function(a){if(this._tags[a])return!0;for(var b in this._tags)if(this._tags[b]==a)return!0;return!1},getDefaultAttributesAndEventsForTag:function(a){var b=[];if(this.isValidTag(a)){var c=this.getDefaultAttributesAndEventsForTags();for(var d in c){var e=c[d];if("object"==typeof e){var f=WYMeditor.Helper;if(e.except&&f.arrayContains(e.except,a)||e.only&&!f.arrayContains(e.only,a))continue;var g=e.attributes?e.attributes:e.events;for(var h in g)b.push("string"!=typeof g[h]?h:g[h])}}}return b},doesAttributeNeedsValidation:function(a,b){return this._tags[a]&&(this._tags[a].attributes&&this._tags[a].attributes[b]||this._tags[a].required&&WYMeditor.Helper.arrayContains(this._tags[a].required,b))},validateAttribute:function(a,b,c){return this._tags[a]&&this._tags[a].attributes&&this._tags[a].attributes[b]&&c.length>0&&!c.match(this._tags[a].attributes[b])||this._tags[a]&&this._tags[a].required&&WYMeditor.Helper.arrayContains(this._tags[a].required,b)&&0===c.length?!1:"undefined"!=typeof this._tags[a]},getPossibleTagAttributes:function(a){return this._possible_tag_attributes||(this._possible_tag_attributes={}),this._possible_tag_attributes[a]||(this._possible_tag_attributes[a]=this.getUniqueAttributesAndEventsForTag(a).concat(this.getDefaultAttributesAndEventsForTag(a))),this._possible_tag_attributes[a]}},WYMeditor.XmlHelper=function(){return this._entitiesDiv=document.createElement("div"),this},WYMeditor.XmlHelper.prototype.tag=function(a,b,c){return b=b||!1,c=c||!1,"<"+a+(b?this.tagOptions(b):"")+(c?">":" />")},WYMeditor.XmlHelper.prototype.contentTag=function(a,b,c){return c=c||!1,"<"+a+(c?this.tagOptions(c):"")+">"+b+""},WYMeditor.XmlHelper.prototype.cdataSection=function(a){return""},WYMeditor.XmlHelper.prototype.escapeOnce=function(a){return this._fixDoubleEscape(this.escapeEntities(a))},WYMeditor.XmlHelper.prototype._fixDoubleEscape=function(a){return a.replace(/&([a-z]+|(#\d+));/gi,"&$1;")},WYMeditor.XmlHelper.prototype.tagOptions=function(a){var b=this;b._formated_options="";for(var c in a){var d=a[c];"function"!=typeof d&&d.length>0&&(parseInt(c,10)==c&&"object"==typeof d&&(c=d.shift(),d=d.pop()),""!==c&&""!==d&&(b._formated_options+=" "+c+'="'+b.escapeOnce(d)+'"'))}return b._formated_options},WYMeditor.XmlHelper.prototype.escapeEntities=function(a,b){this._entitiesDiv.innerHTML=a,this._entitiesDiv.textContent=a;var c=this._entitiesDiv.innerHTML;return"undefined"==typeof b&&(b!==!1&&(c=c.replace('"',""")),b===!0&&(c=c.replace('"',"'"))),c},WYMeditor.XmlHelper.prototype.parseAttributes=function(a){var b=[],c=a.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g);if(c.toString()!=a)for(var d in c){var e=c[d];if("function"!=typeof e&&0!==e.length){var f=new RegExp("(\\w+)\\s*"+e),g=a.match(f);if(g){var h=e.replace(/^[\s=]+/,""),i=h.charAt(0);i='"'==i?'"':"'"==i?"'":"",""!==i&&(h='"'==i?h.replace(/^"|"+$/g,""):h.replace(/^'|'+$/g,"")),a=a.replace(g[0],""),b.push([g[1],h])}}}return b},WYMeditor.STRINGS.bg={Strong:"Получер",Emphasis:"Курсив",Superscript:"Горен индекс",Subscript:"Долен индекс",Ordered_List:"Подреден списък",Unordered_List:"Неподреден списък",Indent:"Блок навътре",Outdent:"Блок навън",Undo:"Стъпка назад",Redo:"Стъпка напред",Link:"Създай хипервръзка",Unlink:"Премахни хипервръзката",Image:"Изображение",Table:"Таблица",HTML:"HTML",Paragraph:"Абзац",Heading_1:"Заглавие 1",Heading_2:"Заглавие 2",Heading_3:"Заглавие 3",Heading_4:"Заглавие 4",Heading_5:"Заглавие 5",Heading_6:"Заглавие 6",Preformatted:"Преформатиран",Blockquote:"Цитат",Table_Header:"Заглавие на таблицата",URL:"URL",Title:"Заглавие",Alternative_Text:"Алтернативен текст",Caption:"Етикет",Summary:"Общо",Number_Of_Rows:"Брой редове",Number_Of_Cols:"Брой колони",Submit:"Изпрати",Cancel:"Отмени",Choose:"Затвори",Preview:"Предварителен преглед",Paste_From_Word:"Вмъкни от MS WORD",Tools:"Инструменти",Containers:"Контейнери",Classes:"Класове",Status:"Статус",Source_Code:"Източник, код"},WYMeditor.STRINGS.ca={Strong:"Ressaltar",Emphasis:"Emfatitzar",Superscript:"Superindex",Subscript:"Subindex",Ordered_List:"Llistat ordenat",Unordered_List:"Llistat sense ordenar",Indent:"Indentat",Outdent:"Sense indentar",Undo:"Desfer",Redo:"Refer",Link:"Enllaçar",Unlink:"Eliminar enllaç",Image:"Imatge",Table:"Taula",HTML:"HTML",Paragraph:"Paràgraf",Heading_1:"Capçalera 1",Heading_2:"Capçalera 2",Heading_3:"Capçalera 3",Heading_4:"Capçalera 4",Heading_5:"Capçalera 5",Heading_6:"Capçalera 6",Preformatted:"Pre-formatejat",Blockquote:"Cita",Table_Header:"Capçalera de la taula",URL:"URL",Title:"Títol",Alternative_Text:"Text alternatiu",Caption:"Llegenda",Summary:"Summary",Number_Of_Rows:"Nombre de files",Number_Of_Cols:"Nombre de columnes",Submit:"Enviar",Cancel:"Cancel·lar",Choose:"Triar",Preview:"Vista prèvia",Paste_From_Word:"Pegar des de Word",Tools:"Eines",Containers:"Contenidors",Classes:"Classes",Status:"Estat",Source_Code:"Codi font"},WYMeditor.STRINGS.cs={Strong:"Tučné",Emphasis:"Kurzíva",Superscript:"Horní index",Subscript:"Dolní index",Ordered_List:"Číslovaný seznam",Unordered_List:"Nečíslovaný seznam",Indent:"Zvětšit odsazení",Outdent:"Zmenšit odsazení",Undo:"Zpět",Redo:"Znovu",Link:"Vytvořit odkaz",Unlink:"Zrušit odkaz",Image:"Obrázek",Table:"Tabulka",HTML:"HTML",Paragraph:"Odstavec",Heading_1:"Nadpis 1. úrovně",Heading_2:"Nadpis 2. úrovně",Heading_3:"Nadpis 3. úrovně",Heading_4:"Nadpis 4. úrovně",Heading_5:"Nadpis 5. úrovně",Heading_6:"Nadpis 6. úrovně",Preformatted:"Předformátovaný text",Blockquote:"Citace",Table_Header:"Hlavičková buňka tabulky",URL:"Adresa",Title:"Text po najetí myší",Alternative_Text:"Text pro případ nezobrazení obrázku",Caption:"Titulek tabulky",Summary:"Shrnutí obsahu",Number_Of_Rows:"Počet řádek",Number_Of_Cols:"Počet sloupců",Submit:"Vytvořit",Cancel:"Zrušit",Choose:"Vybrat",Preview:"Náhled",Paste_From_Word:"Vložit z Wordu",Tools:"Nástroje",Containers:"Typy obsahu",Classes:"Třídy",Status:"Stav",Source_Code:"Zdrojový kód"},WYMeditor.STRINGS.cy={Strong:"Bras",Emphasis:"Italig",Superscript:"Uwchsgript",Subscript:"Is-sgript",Ordered_List:"Rhestr mewn Trefn",Unordered_List:"Pwyntiau Bwled",Indent:"Mewnoli",Outdent:"Alloli",Undo:"Dadwneud",Redo:"Ailwneud",Link:"Cysylltu",Unlink:"Datgysylltu",Image:"Delwedd",Table:"Tabl",HTML:"HTML",Paragraph:"Paragraff",Heading_1:"Pennawd 1",Heading_2:"Pennawd 2",Heading_3:"Pennawd 3",Heading_4:"Pennawd 4",Heading_5:"Pennawd 5",Heading_6:"Pennawd 6",Preformatted:"Rhagfformat",Blockquote:"Bloc Dyfyniad",Table_Header:"Pennyn Tabl",URL:"URL",Title:"Teitl",Alternative_Text:"Testun Amgen",Caption:"Pennawd",Summary:"Crynodeb",Number_Of_Rows:"Nifer y rhesi",Number_Of_Cols:"Nifer y colofnau",Submit:"Anfon",Cancel:"Diddymu",Choose:"Dewis",Preview:"Rhagolwg",Paste_From_Word:"Gludo o Word",Tools:"Offer",Containers:"Cynhwysyddion",Classes:"Dosbarthiadau",Status:"Statws",Source_Code:"Cod ffynhonnell"},WYMeditor.STRINGS.da={Strong:"Fed",Emphasis:"Skrå",Superscript:"Superscript",Subscript:"Subscript",Ordered_List:"Ordnet liste",Unordered_List:"Uordnet liste",Indent:"Indrykke",Outdent:"Udrykke",Undo:"Fortryd",Redo:"Fortryd",Link:"Link",Unlink:"Fjern link",Image:"Billede",Table:"Tabel",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Forudformateret",Blockquote:"Citat",Table_Header:"Tabel Overskrift",URL:"URL",Title:"Titel",Alternative_Text:"Alternativ tekst",Caption:"Billedtekst",Summary:"Resumé",Number_Of_Rows:"Antal rækker",Number_Of_Cols:"Antal kolonner",Submit:"Indsend",Cancel:"Afbryd",Choose:"Vælg",Preview:"Forhåndsvisning",Paste_From_Word:"Indsæt fra Word",Tools:"Værktøjer",Containers:"Containere",Classes:"Klasser",Status:"Status",Source_Code:"Kildekode"},WYMeditor.STRINGS.de={Strong:"Fett",Emphasis:"Kursiv",Superscript:"Text hochstellen",Subscript:"Text tiefstellen",Ordered_List:"Geordnete Liste einfügen",Unordered_List:"Ungeordnete Liste einfügen",Indent:"Einzug erhöhen",Outdent:"Einzug vermindern",Undo:"Befehle rückgängig machen",Redo:"Befehle wiederherstellen",Link:"Hyperlink einfügen",Unlink:"Hyperlink entfernen",Image:"Bild einfügen",Table:"Tabelle einfügen",HTML:"HTML anzeigen/verstecken",Paragraph:"Absatz",Heading_1:"Überschrift 1",Heading_2:"Überschrift 2",Heading_3:"Überschrift 3",Heading_4:"Überschrift 4",Heading_5:"Überschrift 5",Heading_6:"Überschrift 6",Preformatted:"Vorformatiert",Blockquote:"Zitat",Table_Header:"Tabellenüberschrift",URL:"URL",Title:"Titel",Alternative_Text:"Alternativer Text",Caption:"Tabellenüberschrift",Summary:"Summary",Number_Of_Rows:"Anzahl Zeilen",Number_Of_Cols:"Anzahl Spalten",Submit:"Absenden",Cancel:"Abbrechen",Choose:"Auswählen",Preview:"Vorschau",Paste_From_Word:"Aus Word einfügen",Tools:"Werkzeuge",Containers:"Inhaltstyp",Classes:"Klassen",Status:"Status",Source_Code:"Quellcode"},WYMeditor.STRINGS.en={Strong:"Strong",Emphasis:"Emphasis",Superscript:"Superscript",Subscript:"Subscript",Ordered_List:"Ordered List",Unordered_List:"Unordered List",Indent:"Indent",Outdent:"Outdent",Undo:"Undo",Redo:"Redo",Link:"Link",Unlink:"Unlink",Image:"Image",Table:"Table",HTML:"HTML",Paragraph:"Paragraph",Heading_1:"Heading 1",Heading_2:"Heading 2",Heading_3:"Heading 3",Heading_4:"Heading 4",Heading_5:"Heading 5",Heading_6:"Heading 6",Preformatted:"Preformatted",Blockquote:"Blockquote",Table_Header:"Table Header",URL:"URL",Title:"Title",Relationship:"Relationship",Alternative_Text:"Alternative text",Caption:"Caption",Summary:"Summary",Number_Of_Rows:"Number of rows",Number_Of_Cols:"Number of cols",Submit:"Submit", +Cancel:"Cancel",Choose:"Choose",Preview:"Preview",Paste_From_Word:"Paste from Word",Tools:"Tools",Containers:"Formatting",Classes:"Style",Status:"Status",Source_Code:"Source code"},WYMeditor.STRINGS.es={Strong:"Resaltar",Emphasis:"Enfatizar",Superscript:"Superindice",Subscript:"Subindice",Ordered_List:"Lista ordenada",Unordered_List:"Lista sin ordenar",Indent:"Indentado",Outdent:"Sin indentar",Undo:"Deshacer",Redo:"Rehacer",Link:"Enlazar",Unlink:"Eliminar enlace",Image:"Imagen",Table:"Tabla",HTML:"HTML",Paragraph:"Párrafo",Heading_1:"Cabecera 1",Heading_2:"Cabecera 2",Heading_3:"Cabecera 3",Heading_4:"Cabecera 4",Heading_5:"Cabecera 5",Heading_6:"Cabecera 6",Preformatted:"Preformateado",Blockquote:"Cita",Table_Header:"Cabecera de la tabla",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Leyenda",Summary:"Summary",Number_Of_Rows:"Número de filas",Number_Of_Cols:"Número de columnas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Seleccionar",Preview:"Vista previa",Paste_From_Word:"Pegar desde Word",Tools:"Herramientas",Containers:"Contenedores",Classes:"Clases",Status:"Estado",Source_Code:"Código fuente"},WYMeditor.STRINGS.fa={Strong:"پررنگ",Emphasis:"ایتالیک",Superscript:"بالانويس‌ ",Subscript:"زيرنويس‌",Ordered_List:"لیست مرتب",Unordered_List:"لیست نامرتب",Indent:"افزودن دندانه",Outdent:"کاهش دندانه",Undo:"واگردانی",Redo:"تکرار",Link:"ساختن پیوند",Unlink:"برداشتن پیوند",Image:"تصویر",Table:"جدول",HTML:"HTML",Paragraph:"پاراگراف",Heading_1:"سرتیتر ۱",Heading_2:"سرتیتر ۲",Heading_3:"سرتیتر ۳",Heading_4:"سرتیتر ۴",Heading_5:"سرتیتر ۵",Heading_6:"سرتیتر ۶",Preformatted:"قالب آماده",Blockquote:"نقل قول",Table_Header:"سرجدول",URL:"آدرس اینترنتی",Title:"عنوان",Alternative_Text:"متن جایگزین",Caption:"عنوان",Summary:"Summary",Number_Of_Rows:"تعداد سطرها",Number_Of_Cols:"تعداد ستون‌ها",Submit:"فرستادن",Cancel:"لغو",Choose:"انتخاب",Preview:"پیش‌نمایش",Paste_From_Word:"انتقال از ورد",Tools:"ابزار",Containers:"‌قالب‌ها",Classes:"کلاس‌ها",Status:"وضعیت",Source_Code:"کد مبدأ"},WYMeditor.STRINGS.fi={Strong:"Lihavoitu",Emphasis:"Korostus",Superscript:"Yläindeksi",Subscript:"Alaindeksi",Ordered_List:"Numeroitu lista",Unordered_List:"Luettelomerkit",Indent:"Suurenna sisennystä",Outdent:"Pienennä sisennystä",Undo:"Kumoa",Redo:"Toista",Link:"Linkitä",Unlink:"Poista linkitys",Image:"Kuva",Table:"Taulukko",HTML:"HTML",Paragraph:"Kappale",Heading_1:"Otsikko 1",Heading_2:"Otsikko 2",Heading_3:"Otsikko 3",Heading_4:"Otsikko 4",Heading_5:"Otsikko 5",Heading_6:"Otsikko 6",Preformatted:"Esimuotoilu",Blockquote:"Sitaatti",Table_Header:"Taulukon otsikko",URL:"URL",Title:"Otsikko",Alternative_Text:"Vaihtoehtoinen teksti",Caption:"Kuvateksti",Summary:"Yhteenveto",Number_Of_Rows:"Rivien määrä",Number_Of_Cols:"Palstojen määrä",Submit:"Lähetä",Cancel:"Peruuta",Choose:"Valitse",Preview:"Esikatsele",Paste_From_Word:"Tuo Wordista",Tools:"Työkalut",Containers:"Muotoilut",Classes:"Luokat",Status:"Tila",Source_Code:"Lähdekoodi"},WYMeditor.STRINGS.fr={Strong:"Mise en évidence",Emphasis:"Emphase",Superscript:"Exposant",Subscript:"Indice",Ordered_List:"Liste Ordonnée",Unordered_List:"Liste Non-Ordonnée",Indent:"Imbriqué",Outdent:"Non-imbriqué",Undo:"Annuler",Redo:"Rétablir",Link:"Lien",Unlink:"Supprimer le Lien",Image:"Image",Table:"Tableau",HTML:"HTML",Paragraph:"Paragraphe",Heading_1:"Titre 1",Heading_2:"Titre 2",Heading_3:"Titre 3",Heading_4:"Titre 4",Heading_5:"Titre 5",Heading_6:"Titre 6",Preformatted:"Pré-formatté",Blockquote:"Citation",Table_Header:"Cellule de titre",URL:"URL",Title:"Titre",Alternative_Text:"Texte alternatif",Caption:"Légende",Summary:"Résumé",Number_Of_Rows:"Nombre de lignes",Number_Of_Cols:"Nombre de colonnes",Submit:"Envoyer",Cancel:"Annuler",Choose:"Choisir",Preview:"Prévisualisation",Paste_From_Word:"Copier depuis Word",Tools:"Outils",Containers:"Type de texte",Classes:"Type de contenu",Status:"Infos",Source_Code:"Code source"},WYMeditor.STRINGS.gl={Strong:"Moita énfase",Emphasis:"Énfase",Superscript:"Superíndice",Subscript:"Subíndice",Ordered_List:"Lista ordenada",Unordered_List:"Lista sen ordenar",Indent:"Aniñar",Outdent:"Desaniñar",Undo:"Desfacer",Redo:"Refacer",Link:"Ligazón",Unlink:"Desligar",Image:"Imaxe",Table:"Táboa",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Preformatado",Blockquote:"Cita en parágrafo",Table_Header:"Cabeceira da táboa",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Título",Summary:"Resumo",Number_Of_Rows:"Número de filas",Number_Of_Cols:"Número de columnas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Escoller",Preview:"Previsualizar",Paste_From_Word:"Colar dende Word",Tools:"Ferramentas",Containers:"Contenedores",Classes:"Clases",Status:"Estado",Source_Code:"Código fonte"},WYMeditor.STRINGS.he={Strong:"חזק",Emphasis:"מובלט",Superscript:"כתב עילי",Subscript:"כתב תחתי",Ordered_List:"רשימה ממוספרת",Unordered_List:"רשימה לא ממוספרת",Indent:"הזחה פנימה",Outdent:"הזחה החוצה",Undo:"בטל פעולה",Redo:"בצע מחדש פעולה",Link:"קישור",Unlink:"בטל קישור",Image:"תמונה",Table:"טבלה",HTML:"קוד HTML",Paragraph:"פסקה",Heading_1:"כותרת 1 ; תג <h1>",Heading_2:"כותרת 2 ; תג <h2>",Heading_3:"כותרת 3 ; תג <h3>",Heading_4:"כותרת 4 ; תג <h4>",Heading_5:"כותרת 5 ; תג <h5>",Heading_6:"כותרת 6 ; תג <h6>",Preformatted:"משמר רווחים",Blockquote:"ציטוט",Table_Header:"כותרת טבלה",URL:"קישור (URL)",Title:"כותרת",Alternative_Text:"טקסט חלופי",Caption:"כותרת",Summary:"סיכום",Number_Of_Rows:"מספר שורות",Number_Of_Cols:"מספר טורים",Submit:"שלח",Cancel:"בטל",Choose:"בחר",Preview:"תצוגה מקדימה",Paste_From_Word:"העתק מ-Word",Tools:"כלים",Containers:"מיכלים",Classes:"מחלקות",Status:"מצב",Source_Code:"קוד מקור"},WYMeditor.STRINGS.hr={Strong:"Podebljano",Emphasis:"Naglašeno",Superscript:"Iznad",Subscript:"Ispod",Ordered_List:"Pobrojana lista",Unordered_List:"Nepobrojana lista",Indent:"Uvuci",Outdent:"Izvuci",Undo:"Poništi promjenu",Redo:"Ponovno promjeni",Link:"Hiperveza",Unlink:"Ukloni hipervezu",Image:"Slika",Table:"Tablica",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Naslov 1",Heading_2:"Naslov 2",Heading_3:"Naslov 3",Heading_4:"Naslov 4",Heading_5:"Naslov 5",Heading_6:"Naslov 6",Preformatted:"Unaprijed formatirano",Blockquote:"Citat",Table_Header:"Zaglavlje tablice",URL:"URL",Title:"Naslov",Alternative_Text:"Alternativni tekst",Caption:"Zaglavlje",Summary:"Sažetak",Number_Of_Rows:"Broj redova",Number_Of_Cols:"Broj kolona",Submit:"Snimi",Cancel:"Odustani",Choose:"Izaberi",Preview:"Pregled",Paste_From_Word:"Zalijepi iz Word-a",Tools:"Alati",Containers:"Kontejneri",Classes:"Klase",Status:"Status",Source_Code:"Izvorni kod"},WYMeditor.STRINGS.hu={Strong:"Félkövér",Emphasis:"Kiemelt",Superscript:"Felső index",Subscript:"Alsó index",Ordered_List:"Rendezett lista",Unordered_List:"Rendezetlen lista",Indent:"Bekezdés",Outdent:"Bekezdés törlése",Undo:"Visszavon",Redo:"Visszaállít",Link:"Link",Unlink:"Link törlése",Image:"Kép",Table:"Tábla",HTML:"HTML",Paragraph:"Bekezdés",Heading_1:"Címsor 1",Heading_2:"Címsor 2",Heading_3:"Címsor 3",Heading_4:"Címsor 4",Heading_5:"Címsor 5",Heading_6:"Címsor 6",Preformatted:"Előformázott",Blockquote:"Idézet",Table_Header:"Tábla Fejléc",URL:"Webcím",Title:"Megnevezés",Alternative_Text:"Alternatív szöveg",Caption:"Fejléc",Summary:"Summary",Number_Of_Rows:"Sorok száma",Number_Of_Cols:"Oszlopok száma",Submit:"Elküld",Cancel:"Mégsem",Choose:"Választ",Preview:"Előnézet",Paste_From_Word:"Másolás Word-ból",Tools:"Eszközök",Containers:"Tartalmak",Classes:"Osztályok",Status:"Állapot",Source_Code:"Forráskód"},WYMeditor.STRINGS.it={Strong:"Grassetto",Emphasis:"Corsetto",Superscript:"Apice",Subscript:"Pedice",Ordered_List:"Lista Ordinata",Unordered_List:"Lista Puntata",Indent:"Indenta",Outdent:"Caccia",Undo:"Indietro",Redo:"Avanti",Link:"Inserisci Link",Unlink:"Togli Link",Image:"Inserisci Immagine",Table:"Inserisci Tabella",HTML:"HTML",Paragraph:"Paragrafo",Heading_1:"Heading 1",Heading_2:"Heading 2",Heading_3:"Heading 3",Heading_4:"Heading 4",Heading_5:"Heading 5",Heading_6:"Heading 6",Preformatted:"Preformattato",Blockquote:"Blockquote",Table_Header:"Header Tabella",URL:"Indirizzo",Title:"Titolo",Alternative_Text:"Testo Alternativo",Caption:"Caption",Summary:"Summary",Number_Of_Rows:"Numero di Righe",Number_Of_Cols:"Numero di Colonne",Submit:"Invia",Cancel:"Cancella",Choose:"Scegli",Preview:"Anteprima",Paste_From_Word:"Incolla",Tools:"Tools",Containers:"Contenitori",Classes:"Classi",Status:"Stato",Source_Code:"Codice Sorgente"},WYMeditor.STRINGS.ja={Strong:"強調",Emphasis:"強調",Superscript:"上付き",Subscript:"下付き",Ordered_List:"番号付きリスト",Unordered_List:"番号無リスト",Indent:"インデントを増やす",Outdent:"インデントを減らす",Undo:"元に戻す",Redo:"やり直す",Link:"リンク",Unlink:"リンク取消",Image:"画像",Table:"テーブル",HTML:"HTML",Paragraph:"段落",Heading_1:"見出し 1",Heading_2:"見出し 2",Heading_3:"見出し 3",Heading_4:"見出し 4",Heading_5:"見出し 5",Heading_6:"見出し 6",Preformatted:"整形済みテキスト",Blockquote:"引用文",Table_Header:"表見出し",URL:"URL",Title:"タイトル",Alternative_Text:"代替テキスト",Caption:"キャプション",Summary:"サマリー",Number_Of_Rows:"行数",Number_Of_Cols:"列数",Submit:"送信",Cancel:"キャンセル",Choose:"選択",Preview:"プレビュー",Paste_From_Word:"貼り付け",Tools:"ツール",Containers:"コンテナ",Classes:"クラス",Status:"ステータス",Source_Code:"ソースコード"},WYMeditor.STRINGS.lt={Strong:"Pusjuodis",Emphasis:"Kursyvas",Superscript:"Viršutinis indeksas",Subscript:"Apatinis indeksas",Ordered_List:"Numeruotas sąrašas",Unordered_List:"Suženklintas sąrašas",Indent:"Padidinti įtrauką",Outdent:"Sumažinti įtrauką",Undo:"Atšaukti",Redo:"Atstatyti",Link:"Nuoroda",Unlink:"Panaikinti nuorodą",Image:"Vaizdas",Table:"Lentelė",HTML:"HTML",Paragraph:"Paragrafas",Heading_1:"Antraštinis 1",Heading_2:"Antraštinis 2",Heading_3:"Antraštinis 3",Heading_4:"Antraštinis 4",Heading_5:"Antraštinis 5",Heading_6:"Antraštinis 6",Preformatted:"Formuotas",Blockquote:"Citata",Table_Header:"Lentelės antraštė",URL:"URL",Title:"Antraštinis tekstas",Relationship:"Sąryšis",Alternative_Text:"Alternatyvus tekstas",Caption:"Antraštė",Summary:"Santrauka",Number_Of_Rows:"Eilučių skaičius",Number_Of_Cols:"Stulpelių skaičius",Submit:"Išsaugoti",Cancel:"Nutraukti",Choose:"Rinktis",Preview:"Peržiūra",Paste_From_Word:"Įkelti iš MS Word",Tools:"Įrankiai",Containers:"Stiliai",Classes:"Klasės",Status:"Statusas",Source_Code:"Išeities tekstas"},WYMeditor.STRINGS.nb={Strong:"Fet",Emphasis:"Uthevet",Superscript:"Opphøyet",Subscript:"Nedsenket",Ordered_List:"Nummerert liste",Unordered_List:"Punktliste",Indent:"Rykk inn",Outdent:"Rykk ut",Undo:"Angre",Redo:"Gjenta",Link:"Lenke",Unlink:"Ta bort lenken",Image:"Bilde",Table:"Tabell",HTML:"HTML",Paragraph:"Avsnitt",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Preformatert",Blockquote:"Sitat",Table_Header:"Tabelloverskrift",URL:"URL",Title:"Tittel",Alternative_Text:"Alternativ tekst",Caption:"Overskrift",Summary:"Sammendrag",Number_Of_Rows:"Antall rader",Number_Of_Cols:"Antall kolonner",Submit:"Ok",Cancel:"Avbryt",Choose:"Velg",Preview:"Forhåndsvis",Paste_From_Word:"Lim inn fra Word",Tools:"Verktøy",Containers:"Formatering",Classes:"Klasser",Status:"Status",Source_Code:"Kildekode"},WYMeditor.STRINGS.nl={Strong:"Sterk benadrukken",Emphasis:"Benadrukken",Superscript:"Bovenschrift",Subscript:"Onderschrift",Ordered_List:"Geordende lijst",Unordered_List:"Ongeordende lijst",Indent:"Inspringen",Outdent:"Terugspringen",Undo:"Ongedaan maken",Redo:"Opnieuw uitvoeren",Link:"Linken",Unlink:"Ontlinken",Image:"Afbeelding",Table:"Tabel",HTML:"HTML",Paragraph:"Paragraaf",Heading_1:"Kop 1",Heading_2:"Kop 2",Heading_3:"Kop 3",Heading_4:"Kop 4",Heading_5:"Kop 5",Heading_6:"Kop 6",Preformatted:"Voorgeformatteerd",Blockquote:"Citaat",Table_Header:"Tabel-kop",URL:"URL",Title:"Titel",Relationship:"Relatie",Alternative_Text:"Alternatieve tekst",Caption:"Bijschrift",Summary:"Summary",Number_Of_Rows:"Aantal rijen",Number_Of_Cols:"Aantal kolommen",Submit:"Versturen",Cancel:"Annuleren",Choose:"Kiezen",Preview:"Voorbeeld bekijken",Paste_From_Word:"Plakken uit Word",Tools:"Hulpmiddelen",Containers:"Teksttypes",Classes:"Klassen",Status:"Status",Source_Code:"Broncode"},WYMeditor.STRINGS.nn={Strong:"Feit",Emphasis:"Utheva",Superscript:"Opphøgd",Subscript:"Nedsenka",Ordered_List:"Nummerert liste",Unordered_List:"Punktliste",Indent:"Rykk inn",Outdent:"Rykk ut",Undo:"Angre",Redo:"Gjentaka",Link:"Lenkje",Unlink:"Ta bort lenkja",Image:"Bilete",Table:"Tabell",HTML:"HTML",Paragraph:"Avsnitt",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Preformatert",Blockquote:"Sitat",Table_Header:"Tabelloverskrift",URL:"URL",Title:"Tittel",Alternative_Text:"Alternativ tekst",Caption:"Overskrift",Summary:"Samandrag",Number_Of_Rows:"Tal på rader",Number_Of_Cols:"Tal på kolonnar",Submit:"Ok",Cancel:"Avbryt",Choose:"Vel",Preview:"Førehandsvis",Paste_From_Word:"Lim inn frå Word",Tools:"Verkty",Containers:"Formatering",Classes:"Klassar",Status:"Status",Source_Code:"Kjeldekode"},WYMeditor.STRINGS.pl={Strong:"Nacisk",Emphasis:"Emfaza",Superscript:"Indeks górny",Subscript:"Indeks dolny",Ordered_List:"Lista numerowana",Unordered_List:"Lista wypunktowana",Indent:"Zwiększ wcięcie",Outdent:"Zmniejsz wcięcie",Undo:"Cofnij",Redo:"Ponów",Link:"Wstaw link",Unlink:"Usuń link",Image:"Obraz",Table:"Tabela",HTML:"Źródło HTML",Paragraph:"Akapit",Heading_1:"Nagłówek 1",Heading_2:"Nagłówek 2",Heading_3:"Nagłówek 3",Heading_4:"Nagłówek 4",Heading_5:"Nagłówek 5",Heading_6:"Nagłówek 6",Preformatted:"Preformatowany",Blockquote:"Cytat blokowy",Table_Header:"Nagłówek tabeli",URL:"URL",Title:"Tytuł",Alternative_Text:"Tekst alternatywny",Caption:"Tytuł tabeli",Summary:"Summary",Number_Of_Rows:"Liczba wierszy",Number_Of_Cols:"Liczba kolumn",Submit:"Wyślij",Cancel:"Anuluj",Choose:"Wybierz",Preview:"Podgląd",Paste_From_Word:"Wklej z Worda",Tools:"Narzędzia",Containers:"Format",Classes:"Styl",Status:"Status",Source_Code:"Kod źródłowy"},WYMeditor.STRINGS["pt-br"]={Strong:"Resaltar",Emphasis:"Enfatizar",Superscript:"Sobre escrito",Subscript:"Sub escrito ",Ordered_List:"Lista ordenada",Unordered_List:"Lista desordenada",Indent:"Indentado",Outdent:"Desidentar",Undo:"Desfazer",Redo:"Refazer",Link:"Link",Unlink:"Remover Link",Image:"Imagem",Table:"Tabela",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Preformatado",Blockquote:"Citação",Table_Header:"Título de tabela",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Legenda",Summary:"Summary",Number_Of_Rows:"Número de linhas",Number_Of_Cols:"Número de colunas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Selecionar",Preview:"Previsualizar",Paste_From_Word:"Copiar do Word",Tools:"Ferramentas",Containers:"Conteneiners",Classes:"Classes",Status:"Estado",Source_Code:"Código fonte"},WYMeditor.STRINGS.pt={Strong:"Negrito",Emphasis:"Itálico",Superscript:"Sobrescrito",Subscript:"Subsescrito",Ordered_List:"Lista Numerada",Unordered_List:"Lista Marcada",Indent:"Aumentar Indentaçã",Outdent:"Diminuir Indentaçã",Undo:"Desfazer",Redo:"Restaurar",Link:"Link",Unlink:"Tirar link",Image:"Imagem",Table:"Tabela",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Pré-formatado",Blockquote:"Citação",Table_Header:"Cabeçalho Tabela",URL:"URL",Title:"Título",Alternative_Text:"Texto Alterativo",Caption:"Título Tabela",Summary:"Summary",Number_Of_Rows:"Número de Linhas",Number_Of_Cols:"Número de Colunas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Escolha",Preview:"Prever",Paste_From_Word:"Colar do Word",Tools:"Ferramentas",Containers:"Containers",Classes:"Classes",Status:"Status",Source_Code:"Código Fonte"},WYMeditor.STRINGS.ru={Strong:"Жирный",Emphasis:"Наклонный",Superscript:"Надстрочный",Subscript:"Подстрочный",Ordered_List:"Нумерованый список",Unordered_List:"Ненумерованый список",Indent:"Увеличить отступ",Outdent:"Уменьшить отступ",Undo:"Отменить",Redo:"Повторить",Link:"Ссылка",Unlink:"Удалить ссылку",Image:"Изображение",Table:"Таблица",HTML:"Править HTML",Paragraph:"Параграф",Heading_1:"Заголовок 1",Heading_2:"Заголовок 2",Heading_3:"Заголовок 3",Heading_4:"Заголовок 4",Heading_5:"Заголовок 5",Heading_6:"Заголовок 6",Preformatted:"Preformatted",Blockquote:"Цитата",Table_Header:"Заголовок таблицы",URL:"URL",Title:"Заголовок",Alternative_Text:"Альтернативный текст",Caption:"Надпись",Summary:"Summary",Number_Of_Rows:"Кол-во строк",Number_Of_Cols:"Кол-во столбцов",Submit:"Отправить",Cancel:"Отмена",Choose:"Выбор",Preview:"Просмотр",Paste_From_Word:"Вставить из Word",Tools:"Инструменты",Containers:"Контейнеры",Classes:"Классы",Status:"Статус",Source_Code:"Исходный код"},WYMeditor.STRINGS.sk={Strong:"Tučné",Emphasis:"Kurzíva",Superscript:"Horný index",Subscript:"Dolný index",Ordered_List:"Číslovaný zoznam",Unordered_List:"Nečíslovaný zoznam",Indent:"Zväčšiť odsadenie",Outdent:"Zmenšiť odsadenie",Undo:"Vrátiť",Redo:"Opakovať",Link:"Vytvoriť odkaz",Unlink:"Zrušiť odkaz",Image:"Obrázok",Table:"Tabuľka",HTML:"HTML",Paragraph:"Odstavec",Heading_1:"Nadpis 1. úrovne",Heading_2:"Nadpis 2. úrovne",Heading_3:"Nadpis 3. úrovne",Heading_4:"Nadpis 4. úrovne",Heading_5:"Nadpis 5. úrovne",Heading_6:"Nadpis 6. úrovne",Preformatted:"Predformátovaný text",Blockquote:"Citácia",Table_Header:"Hlavička tabuľky",URL:"URL adresa",Title:"Titulok",Alternative_Text:"Alternatívny text",Caption:"Titulok tabuľky",Summary:"Zhrnutie obsahu",Number_Of_Rows:"Počet riadkov",Number_Of_Cols:"Počet stĺpcov",Submit:"Odoslať",Cancel:"Zrušiť",Choose:"Vybrať",Preview:"Náhľad",Paste_From_Word:"Vložiť z Wordu",Tools:"Nástroje",Containers:"Typy obsahu",Classes:"Triedy",Status:"Stav",Source_Code:"Zdrojový kód"},WYMeditor.STRINGS.sv={Strong:"Viktigt",Emphasis:"Betoning",Superscript:"Upphöjt",Subscript:"Nedsänkt",Ordered_List:"Nummerlista",Unordered_List:"Punktlista",Indent:"Indrag",Outdent:"Utdrag",Undo:"Ångra",Redo:"Gör om",Link:"Länk",Unlink:"Ta bort länk",Image:"Bild",Table:"Tabell",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Rubrik 1",Heading_2:"Rubrik 2",Heading_3:"Rubrik 3",Heading_4:"Rubrik 4",Heading_5:"Rubrik 5",Heading_6:"Rubrik 6",Preformatted:"Förformaterad",Blockquote:"Blockcitat",Table_Header:"Tabellrubrik",URL:"URL",Title:"Titel",Relationship:"Relation",Alternative_Text:"Alternativ text",Caption:"Överskrift",Summary:"Summary",Number_Of_Rows:"Antal rader",Number_Of_Cols:"Antal kolumner",Submit:"Skicka",Cancel:"Avbryt",Choose:"Välj",Preview:"Förhandsgranska",Paste_From_Word:"Klistra in från Word",Tools:"Verktyg",Containers:"Formatering",Classes:"Klasser",Status:"Status",Source_Code:"Källkod"},WYMeditor.STRINGS.tr={Strong:"Kalın",Emphasis:"Vurgu",Superscript:"Üstsimge",Subscript:"Altsimge",Ordered_List:"Sıralı List",Unordered_List:"Sırasız List",Indent:"Girintile",Outdent:"Çıkıntıla",Undo:"Geri Al",Redo:"Yinele",Link:"Bağlantı",Unlink:"Bağlantıyı Kaldır",Image:"Resim",Table:"Tablo",HTML:"HTML",Paragraph:"Parağraf",Heading_1:"Başlık 1",Heading_2:"Başlık 2",Heading_3:"Başlık 3",Heading_4:"Başlık 4",Heading_5:"Başlık 5",Heading_6:"Başlık 6",Preformatted:"Önceden Formatlı",Blockquote:"Alıntı",Table_Header:"Tablo Başlığı",URL:"URL",Title:"Başlık",Alternative_Text:"Alternatif Metin",Caption:"Etiket",Summary:"Özet",Number_Of_Rows:"Satır sayısı",Number_Of_Cols:"Sütun sayısı",Submit:"Gönder",Cancel:"İptal",Choose:"Seç",Preview:"Önizleme",Paste_From_Word:"Word'den yapıştır",Tools:"Araçlar",Containers:"Kapsayıcılar",Classes:"Sınıflar",Status:"Durum",Source_Code:"Kaynak Kodu"},WYMeditor.STRINGS.zh_cn={Strong:"加粗",Emphasis:"斜体",Superscript:"上标",Subscript:"下标",Ordered_List:"有序列表",Unordered_List:"无序列表",Indent:"增加缩进",Outdent:"减少缩进",Undo:"撤消",Redo:"重做",Link:"链接",Unlink:"取消链接",Image:"图片",Table:"表格",HTML:"HTML源代码",Paragraph:"段落",Heading_1:"标题 1",Heading_2:"标题 2",Heading_3:"标题 3",Heading_4:"标题 4",Heading_5:"标题 5",Heading_6:"标题 6",Preformatted:"原始文本",Blockquote:"引语",Table_Header:"表头",URL:"地址",Title:"提示文字",Alternative_Text:"失效文字",Caption:"标题",Summary:"Summary",Number_Of_Rows:"行数",Number_Of_Cols:"列数",Submit:"提交",Cancel:"放弃",Choose:"选择",Preview:"预览",Paste_From_Word:"从Word粘贴纯文本",Tools:"工具",Containers:"容器",Classes:"预定义样式",Status:"状态",Source_Code:"源代码",Attachment:"附件",NewParagraph:"新段落"},WYMeditor.STRINGS.zh_tw={Strong:"加粗",Emphasis:"斜體",Superscript:"上標",Subscript:"下標",Ordered_List:"有序列表",Unordered_List:"無序列表",Indent:"增加縮排",Outdent:"減少縮排",Undo:"取消",Redo:"重做",Link:"鏈結",Unlink:"取消鏈結",Image:"圖片",Table:"表格",HTML:"HTML 源代碼",Paragraph:"段落",Heading_1:"標題 1",Heading_2:"標題 2",Heading_3:"標題 3",Heading_4:"標題 4",Heading_5:"標題 5",Heading_6:"標題 6",Preformatted:"原始文本",Blockquote:"引語",Table_Header:"表格頂部",URL:"地址",Title:"提示文字",Alternative_Text:"失效文字",Caption:"主題",Summary:"大綱",Number_Of_Rows:"行數",Number_Of_Cols:"列數",Submit:"提交",Cancel:"放棄",Choose:"選擇",Preview:"預覽",Paste_From_Word:"從Word複制純文本",Tools:"工具",Containers:"容器",Classes:"預定義樣式",Status:"狀態",Source_Code:"源代碼",Attachment:"附件",NewParagraph:"新段落"},window.rangy=function(){function a(a,b){var c=typeof a[b];return c==l||!(c!=k||!a[b])||"unknown"==c}function b(a,b){return!(typeof a[b]!=k||!a[b])}function c(a,b){return typeof a[b]!=m}function d(a){return function(b,c){for(var d=c.length;d--;)if(!a(b,c[d]))return!1;return!0}}function e(a){return a&&r(a,q)&&t(a,p)}function f(a){window.alert("Rangy not supported in your browser. Reason: "+a),u.initialized=!0,u.supported=!1}function g(a){var b="Rangy warning: "+a;u.config.alertOnWarn?window.alert(b):typeof window.console!=m&&typeof window.console.log!=m&&window.console.log(b)}function h(){if(!u.initialized){var c,d=!1,g=!1;a(document,"createRange")&&(c=document.createRange(),r(c,o)&&t(c,n)&&(d=!0),c.detach());var h=b(document,"body")?document.body:document.getElementsByTagName("body")[0];h&&a(h,"createTextRange")&&(c=h.createTextRange(),e(c)&&(g=!0)),d||g||f("Neither Range nor TextRange are implemented"),u.initialized=!0,u.features={implementsDomRange:d,implementsTextRange:g};for(var i=w.concat(v),j=0,k=i.length;k>j;++j)try{i[j](u)}catch(l){b(window,"console")&&a(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",l)}}}function i(a){a=a||window,h();for(var b=0,c=x.length;c>b;++b)x[b](a)}function j(a){this.name=a,this.initialized=!1,this.supported=!1}var k="object",l="function",m="undefined",n=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],p=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],q=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],r=d(a),s=d(b),t=d(c),u={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:a,isHostObject:b,isHostProperty:c,areHostMethods:r,areHostObjects:s,areHostProperties:t,isTextRange:e},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};u.fail=f,u.warn=g,{}.hasOwnProperty?u.util.extend=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}:f("hasOwnProperty not supported");var v=[],w=[];u.init=h,u.addInitListener=function(a){u.initialized?a(u):v.push(a)};var x=[];u.addCreateMissingNativeApiListener=function(a){x.push(a)},u.createMissingNativeApi=i,j.prototype.fail=function(a){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+a)},j.prototype.warn=function(a){u.warn("Module "+this.name+": "+a)},j.prototype.createError=function(a){return new Error("Error in Rangy "+this.name+" module: "+a)},u.createModule=function(a,b){var c=new j(a);u.modules[a]=c,w.push(function(a){b(a,c),c.initialized=!0,c.supported=!0})},u.requireModules=function(a){for(var b,c,d=0,e=a.length;e>d;++d){if(c=a[d],b=u.modules[c],!(b&&b instanceof j))throw new Error("Module '"+c+"' not found");if(!b.supported)throw new Error("Module '"+c+"' not supported")}};var y=!1,z=function(a){y||(y=!0,u.initialized||h())};return typeof window==m?void f("No window found"):typeof document==m?void f("No document found"):(a(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",z,!1),a(window,"addEventListener")?window.addEventListener("load",z,!1):a(window,"attachEvent")?window.attachEvent("onload",z):f("Window does not have required addEventListener or attachEvent method"),u)}(),rangy.createModule("DomUtil",function(a,b){function c(a){var b;return typeof a.namespaceURI==z||null===(b=a.namespaceURI)||"http://www.w3.org/1999/xhtml"==b}function d(a){var b=a.parentNode;return 1==b.nodeType?b:null}function e(a){for(var b=0;a=a.previousSibling;)b++;return b}function f(a){var b;return j(a)?a.length:(b=a.childNodes)?b.length:0}function g(a,b){var c,d=[];for(c=a;c;c=c.parentNode)d.push(c);for(c=b;c;c=c.parentNode)if(D(d,c))return c;return null}function h(a,b,c){for(var d=c?b:b.parentNode;d;){if(d===a)return!0;d=d.parentNode}return!1}function i(a,b,c){for(var d,e=c?a:a.parentNode;e;){if(d=e.parentNode,d===b)return e;e=d}return null}function j(a){var b=a.nodeType;return 3==b||4==b||8==b}function k(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a}function l(a,b){var c=a.cloneNode(!1);return c.deleteData(0,b),a.deleteData(b,a.length-b),k(c,a),c}function m(a){if(9==a.nodeType)return a;if(typeof a.ownerDocument!=z)return a.ownerDocument;if(typeof a.document!=z)return a.document;if(a.parentNode)return m(a.parentNode);throw new Error("getDocument: no document found for node")}function n(a){var b=m(a);if(typeof b.defaultView!=z)return b.defaultView;if(typeof b.parentWindow!=z)return b.parentWindow;throw new Error("Cannot get a window object for node")}function o(a){if(typeof a.contentDocument!=z)return a.contentDocument;if(typeof a.contentWindow!=z)return a.contentWindow.document;throw new Error("getIframeWindow: No Document object found for iframe element")}function p(a){if(typeof a.contentWindow!=z)return a.contentWindow;if(typeof a.contentDocument!=z)return a.contentDocument.defaultView;throw new Error("getIframeWindow: No Window object found for iframe element")}function q(a){return A.isHostObject(a,"body")?a.body:a.getElementsByTagName("body")[0]}function r(a){for(var b;b=a.parentNode;)a=b;return a}function s(a,b,c,d){var f,h,j,k,l;if(a==c)return b===d?0:d>b?-1:1;if(f=i(c,a,!0))return b<=e(f)?-1:1;if(f=i(a,c,!0))return e(f)["+a.childNodes.length+"]"}return a.nodeName}function v(a){this.root=a,this._next=a}function w(a){return new v(a)}function x(a,b){this.node=a,this.offset=b}function y(a){this.code=this[a],this.codeName=a,this.message="DOMException: "+this.codeName}var z="undefined",A=a.util;A.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||b.fail("document missing a Node creation method"),A.isHostMethod(document,"getElementsByTagName")||b.fail("document missing getElementsByTagName method");var B=document.createElement("div");A.areHostMethods(B,["insertBefore","appendChild","cloneNode"]||!A.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"]))||b.fail("Incomplete Element implementation"),A.isHostProperty(B,"innerHTML")||b.fail("Element is missing innerHTML property");var C=document.createTextNode("test");A.areHostMethods(C,["splitText","deleteData","insertData","appendData","cloneNode"]||!A.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"])||!A.areHostProperties(C,["data"]))||b.fail("Incomplete Text Node implementation");var D=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1};v.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var a,b,c=this._current=this._next;if(this._current)if(a=c.firstChild)this._next=a;else{for(b=null;c!==this.root&&!(b=c.nextSibling);)c=c.parentNode;this._next=b}return this._current},detach:function(){this._current=this._next=this.root=null}},x.prototype={equals:function(a){return this.node===a.node&this.offset==a.offset},inspect:function(){return"[DomPosition("+u(this.node)+":"+this.offset+")]"}},y.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11},y.prototype.toString=function(){return this.message},a.dom={arrayContains:D,isHtmlNamespace:c,parentElement:d,getNodeIndex:e,getNodeLength:f,getCommonAncestor:g,isAncestorOf:h,getClosestAncestorIn:i,isCharacterDataNode:j,insertAfter:k,splitDataNode:l,getDocument:m,getWindow:n,getIframeWindow:p,getIframeDocument:o,getBody:q,getRootContainer:r,comparePoints:s,inspectNode:u,fragmentFromNodeChildren:t,createIterator:w,DomPosition:x},a.DOMException=y}),rangy.createModule("DomRange",function(a,b){function c(a,b){return 3!=a.nodeType&&(L.isAncestorOf(a,b.startContainer,!0)||L.isAncestorOf(a,b.endContainer,!0))}function d(a){return L.getDocument(a.startContainer)}function e(a,b,c){var d=a._listeners[b];if(d)for(var e=0,f=d.length;f>e;++e)d[e].call(a,{target:a,args:c})}function f(a){return new M(a.parentNode,L.getNodeIndex(a))}function g(a){return new M(a.parentNode,L.getNodeIndex(a)+1)}function h(a,b,c){var d=11==a.nodeType?a.firstChild:a;return L.isCharacterDataNode(b)?c==b.length?L.insertAfter(a,b):b.parentNode.insertBefore(a,0==c?b:L.splitDataNode(b,c)):c>=b.childNodes.length?b.appendChild(a):b.insertBefore(a,b.childNodes[c]),d}function i(a){for(var b,c,e,f=d(a.range).createDocumentFragment();c=a.next();){if(b=a.isPartiallySelectedSubtree(),c=c.cloneNode(!b),b&&(e=a.getSubtreeIterator(),c.appendChild(i(e)),e.detach(!0)),10==c.nodeType)throw new N("HIERARCHY_REQUEST_ERR");f.appendChild(c)}return f}function j(a,b,c){var d,e;c=c||{stop:!1};for(var f,g;f=a.next();)if(a.isPartiallySelectedSubtree()){if(b(f)===!1)return void(c.stop=!0);if(g=a.getSubtreeIterator(),j(g,b,c),g.detach(!0),c.stop)return}else for(d=L.createIterator(f);e=d.next();)if(b(e)===!1)return void(c.stop=!0)}function k(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),k(b),b.detach(!0)):a.remove()}function l(a){for(var b,c,e=d(a.range).createDocumentFragment();b=a.next();){if(a.isPartiallySelectedSubtree()?(b=b.cloneNode(!1),c=a.getSubtreeIterator(),b.appendChild(l(c)),c.detach(!0)):a.remove(),10==b.nodeType)throw new N("HIERARCHY_REQUEST_ERR");e.appendChild(b)}return e}function m(a,b,c){var d,e=!(!b||!b.length),f=!!c;e&&(d=new RegExp("^("+b.join("|")+")$"));var g=[];return j(new o(a,!1),function(a){e&&!d.test(a.nodeType)||f&&!c(a)||g.push(a)}),g}function n(a){var b="undefined"==typeof a.getName?"Range":a.getName();return"["+b+"("+L.inspectNode(a.startContainer)+":"+a.startOffset+", "+L.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function o(a,b){if(this.range=a,this.clonePartiallySelectedTextNodes=b,!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&L.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==c||L.isCharacterDataNode(this.sc)?L.getClosestAncestorIn(this.sc,c,!0):this.sc.childNodes[this.so], +this._last=this.ec!==c||L.isCharacterDataNode(this.ec)?L.getClosestAncestorIn(this.ec,c,!0):this.ec.childNodes[this.eo-1])}}function p(a){this.code=this[a],this.codeName=a,this.message="RangeException: "+this.codeName}function q(a,b,c){this.nodes=m(a,b,c),this._next=this.nodes[0],this._position=0}function r(a){return function(b,c){for(var d,e=c?b:b.parentNode;e;){if(d=e.nodeType,L.arrayContains(a,d))return e;e=e.parentNode}return null}}function s(a,b){if(W(a,b))throw new p("INVALID_NODE_TYPE_ERR")}function t(a){if(!a.startContainer)throw new N("INVALID_STATE_ERR")}function u(a,b){if(!L.arrayContains(b,a.nodeType))throw new p("INVALID_NODE_TYPE_ERR")}function v(a,b){if(0>b||b>(L.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new N("INDEX_SIZE_ERR")}function w(a,b){if(U(a,!0)!==U(b,!0))throw new N("WRONG_DOCUMENT_ERR")}function x(a){if(V(a,!0))throw new N("NO_MODIFICATION_ALLOWED_ERR")}function y(a,b){if(!a)throw new N(b)}function z(a){return!L.arrayContains(P,a.nodeType)&&!U(a,!0)}function A(a,b){return b<=(L.isCharacterDataNode(a)?a.length:a.childNodes.length)}function B(a){if(t(a),z(a.startContainer)||z(a.endContainer)||!A(a.startContainer,a.startOffset)||!A(a.endContainer,a.endOffset))throw new Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")")}function C(){}function D(a){a.START_TO_START=aa,a.START_TO_END=ba,a.END_TO_END=ca,a.END_TO_START=da,a.NODE_BEFORE=ea,a.NODE_AFTER=fa,a.NODE_BEFORE_AND_AFTER=ga,a.NODE_INSIDE=ha}function E(a){D(a),D(a.prototype)}function F(a,b){return function(){B(this);var c,d,e=this.startContainer,f=this.startOffset,h=this.commonAncestorContainer,i=new o(this,!0);e!==h&&(c=L.getClosestAncestorIn(e,h,!0),d=g(c),e=d.node,f=d.offset),j(i,x),i.reset();var k=a(i);return i.detach(),b(this,e,f,e,f),k}}function G(b,d,e){function h(a,b){return function(c){t(this),u(c,O),u(T(c),P);var d=(a?f:g)(c);(b?i:j)(this,d.node,d.offset)}}function i(a,b,c){var e=a.endContainer,f=a.endOffset;(b!==a.startContainer||c!==a.startOffset)&&((T(b)!=T(e)||1==L.comparePoints(b,c,e,f))&&(e=b,f=c),d(a,b,c,e,f))}function j(a,b,c){var e=a.startContainer,f=a.startOffset;(b!==a.endContainer||c!==a.endOffset)&&((T(b)!=T(e)||-1==L.comparePoints(b,c,e,f))&&(e=b,f=c),d(a,e,f,b,c))}function m(a,b,c){(b!==a.startContainer||c!==a.startOffset||b!==a.endContainer||c!==a.endOffset)&&d(a,b,c,b,c)}b.prototype=new C,a.util.extend(b.prototype,{setStart:function(a,b){t(this),s(a,!0),v(a,b),i(this,a,b)},setEnd:function(a,b){t(this),s(a,!0),v(a,b),j(this,a,b)},setStartBefore:h(!0,!0),setStartAfter:h(!1,!0),setEndBefore:h(!0,!1),setEndAfter:h(!1,!1),collapse:function(a){B(this),a?d(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):d(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){t(this),s(a,!0),d(this,a,0,a,L.getNodeLength(a))},selectNode:function(a){t(this),s(a,!1),u(a,O);var b=f(a),c=g(a);d(this,b.node,b.offset,c.node,c.offset)},extractContents:F(l,d),deleteContents:F(k,d),canSurroundContents:function(){B(this),x(this.startContainer),x(this.endContainer);var a=new o(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);return a.detach(),!b},detach:function(){e(this)},splitBoundaries:function(){B(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=a===c;L.isCharacterDataNode(c)&&e>0&&e0&&b=L.getNodeIndex(a)&&e++,b=0),d(this,a,b,c,e)},normalizeBoundaries:function(){B(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=function(a){var b=a.nextSibling;b&&b.nodeType==a.nodeType&&(c=a,e=a.length,a.appendData(b.data),b.parentNode.removeChild(b))},g=function(d){var f=d.previousSibling;if(f&&f.nodeType==d.nodeType){a=d;var g=d.length;if(b=f.length,d.insertData(0,f.data),f.parentNode.removeChild(f),a==c)e+=b,c=a;else if(c==d.parentNode){var h=L.getNodeIndex(d);e==h?(c=d,e=g):e>h&&e--}}},h=!0;if(L.isCharacterDataNode(c))c.length==e&&f(c);else{if(e>0){var i=c.childNodes[e-1];i&&L.isCharacterDataNode(i)&&f(i)}h=!this.collapsed}if(h){if(L.isCharacterDataNode(a))0==b&&g(a);else if(bx",Y=3==X.firstChild.nodeType}catch(Z){}a.features.htmlParsingConforms=Y;var $=Y?function(a){var b=this.startContainer,c=L.getDocument(b);if(!b)throw new N("INVALID_STATE_ERR");var d=null;return 1==b.nodeType?d=b:L.isCharacterDataNode(b)&&(d=L.parentElement(b)),d=null===d||"HTML"==d.nodeName&&L.isHtmlNamespace(L.getDocument(d).documentElement)&&L.isHtmlNamespace(d)?c.createElement("body"):d.cloneNode(!1),d.innerHTML=a,L.fragmentFromNodeChildren(d)}:function(a){t(this);var b=d(this),c=b.createElement("body");return c.innerHTML=a,L.fragmentFromNodeChildren(c)},_=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],aa=0,ba=1,ca=2,da=3,ea=0,fa=1,ga=2,ha=3;C.prototype={attachListener:function(a,b){this._listeners[a].push(b)},compareBoundaryPoints:function(a,b){B(this),w(this.startContainer,b.startContainer);var c,d,e,f,g=a==da||a==aa?"start":"end",h=a==ba||a==aa?"start":"end";return c=this[g+"Container"],d=this[g+"Offset"],e=b[h+"Container"],f=b[h+"Offset"],L.comparePoints(c,d,e,f)},insertNode:function(a){if(B(this),u(a,R),x(this.startContainer),L.isAncestorOf(a,this.startContainer,!0))throw new N("HIERARCHY_REQUEST_ERR");var b=h(a,this.startContainer,this.startOffset);this.setStartBefore(b)},cloneContents:function(){B(this);var a,b;if(this.collapsed)return d(this).createDocumentFragment();if(this.startContainer===this.endContainer&&L.isCharacterDataNode(this.startContainer))return a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),b=d(this).createDocumentFragment(),b.appendChild(a),b;var c=new o(this,!0);return a=i(c),c.detach(),a},canSurroundContents:function(){B(this),x(this.startContainer),x(this.endContainer);var a=new o(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);return a.detach(),!b},surroundContents:function(a){if(u(a,S),!this.canSurroundContents())throw new p("BAD_BOUNDARYPOINTS_ERR");var b=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);h(a,this.startContainer,this.startOffset),a.appendChild(b),this.selectNode(a)},cloneRange:function(){B(this);for(var a,b=new K(d(this)),c=_.length;c--;)a=_[c],b[a]=this[a];return b},toString:function(){B(this);var a=this.startContainer;if(a===this.endContainer&&L.isCharacterDataNode(a))return 3==a.nodeType||4==a.nodeType?a.data.slice(this.startOffset,this.endOffset):"";var b=[],c=new o(this,!0);return j(c,function(a){(3==a.nodeType||4==a.nodeType)&&b.push(a.data)}),c.detach(),b.join("")},compareNode:function(a){B(this);var b=a.parentNode,c=L.getNodeIndex(a);if(!b)throw new N("NOT_FOUND_ERR");var d=this.comparePoint(b,c),e=this.comparePoint(b,c+1);return 0>d?e>0?ga:ea:e>0?fa:ha},comparePoint:function(a,b){return B(this),y(a,"HIERARCHY_REQUEST_ERR"),w(a,this.startContainer),L.comparePoints(a,b,this.startContainer,this.startOffset)<0?-1:L.comparePoints(a,b,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:$,toHtml:function(){B(this);var a=d(this).createElement("div");return a.appendChild(this.cloneContents()),a.innerHTML},intersectsNode:function(a,b){if(B(this),y(a,"NOT_FOUND_ERR"),L.getDocument(a)!==d(this))return!1;var c=a.parentNode,e=L.getNodeIndex(a);y(c,"NOT_FOUND_ERR");var f=L.comparePoints(c,e,this.endContainer,this.endOffset),g=L.comparePoints(c,e+1,this.startContainer,this.startOffset);return b?0>=f&&g>=0:0>f&&g>0},isPointInRange:function(a,b){return B(this),y(a,"HIERARCHY_REQUEST_ERR"),w(a,this.startContainer),L.comparePoints(a,b,this.startContainer,this.startOffset)>=0&&L.comparePoints(a,b,this.endContainer,this.endOffset)<=0},intersectsRange:function(a,b){if(B(this),d(a)!=d(this))throw new N("WRONG_DOCUMENT_ERR");var c=L.comparePoints(this.startContainer,this.startOffset,a.endContainer,a.endOffset),e=L.comparePoints(this.endContainer,this.endOffset,a.startContainer,a.startOffset);return b?0>=c&&e>=0:0>c&&e>0},intersection:function(a){if(this.intersectsRange(a)){var b=L.comparePoints(this.startContainer,this.startOffset,a.startContainer,a.startOffset),c=L.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange();return-1==b&&d.setStart(a.startContainer,a.startOffset),1==c&&d.setEnd(a.endContainer,a.endOffset),d}return null},union:function(a){if(this.intersectsRange(a,!0)){var b=this.cloneRange();return-1==L.comparePoints(a.startContainer,a.startOffset,this.startContainer,this.startOffset)&&b.setStart(a.startContainer,a.startOffset),1==L.comparePoints(a.endContainer,a.endOffset,this.endContainer,this.endOffset)&&b.setEnd(a.endContainer,a.endOffset),b}throw new p("Ranges do not intersect")},containsNode:function(a,b){return b?this.intersectsNode(a,!1):this.compareNode(a)==ha},containsNodeContents:function(a){return this.comparePoint(a,0)>=0&&this.comparePoint(a,L.getNodeLength(a))<=0},containsRange:function(a){return this.intersection(a).equals(a)},containsNodeText:function(a){var b=this.cloneRange();b.selectNode(a);var c=b.getNodes([3]);if(c.length>0){b.setStart(c[0],0);var d=c.pop();b.setEnd(d,d.length);var e=this.containsRange(b);return b.detach(),e}return this.containsNodeContents(a)},createNodeIterator:function(a,b){return B(this),new q(this,a,b)},getNodes:function(a,b){return B(this),m(this,a,b)},getDocument:function(){return d(this)},collapseBefore:function(a){t(this),this.setEndBefore(a),this.collapse(!1)},collapseAfter:function(a){t(this),this.setStartAfter(a),this.collapse(!0)},getName:function(){return"DomRange"},equals:function(a){return K.rangesEqual(this,a)},inspect:function(){return n(this)}},G(K,I,J),a.rangePrototype=C.prototype,K.rangeProperties=_,K.RangeIterator=o,K.copyComparisonConstants=E,K.createPrototypeRange=G,K.inspect=n,K.getRangeDocument=d,K.rangesEqual=function(a,b){return a.startContainer===b.startContainer&&a.startOffset===b.startOffset&&a.endContainer===b.endContainer&&a.endOffset===b.endOffset},a.DomRange=K,a.RangeException=p}),rangy.createModule("WrappedRange",function(a,b){function c(a){var b=a.parentElement(),c=a.duplicate();c.collapse(!0);var d=c.parentElement();c=a.duplicate(),c.collapse(!1);var e=c.parentElement(),f=d==e?d:h.getCommonAncestor(d,e);return f==b?f:h.getCommonAncestor(b,f)}function d(a){return 0==a.compareEndPoints("StartToEnd",a)}function e(a,b,c,d){var e=a.duplicate();e.collapse(c);var f=e.parentElement();if(h.isAncestorOf(b,f,!0)||(f=b),!f.canHaveHTML)return new i(f.parentNode,h.getNodeIndex(f));var g,j,k,l,m,n=h.getDocument(f).createElement("span"),o=c?"StartToStart":"StartToEnd";do f.insertBefore(n,n.previousSibling),e.moveToElementText(n);while((g=e.compareEndPoints(o,a))>0&&n.previousSibling);if(m=n.nextSibling,-1==g&&m&&h.isCharacterDataNode(m)){e.setEndPoint(c?"EndToStart":"EndToEnd",a);var p;if(/[\r\n]/.test(m.data)){var q=e.duplicate(),r=q.text.replace(/\r\n/g,"\r").length;for(p=q.moveStart("character",r);-1==(g=q.compareEndPoints("StartToEnd",q));)p++,q.moveStart("character",1)}else p=e.text.length;l=new i(m,p)}else j=(d||!c)&&n.previousSibling,k=(d||c)&&n.nextSibling,l=k&&h.isCharacterDataNode(k)?new i(k,0):j&&h.isCharacterDataNode(j)?new i(j,j.length):new i(f,h.getNodeIndex(n));return n.parentNode.removeChild(n),l}function f(a,b){var c,d,e,f,g=a.offset,i=h.getDocument(a.node),j=i.body.createTextRange(),k=h.isCharacterDataNode(a.node);return k?(c=a.node,d=c.parentNode):(f=a.node.childNodes,c=gb;++b)if(!w.isAncestorOf(a[0],a[b]))return!1;return!0}function j(a){var b=a.getNodes();if(!i(b))throw new Error("getSingleElementFromRange: range "+a.inspect()+" did not consist of a single element");return b[0]}function k(a){return!!a&&"undefined"!=typeof a.text}function l(a,b){var c=new z(b);a._ranges=[c],e(a,c,!1),a.rangeCount=1,a.isCollapsed=c.collapsed}function m(b){if(b._ranges.length=0,"None"==b.docSelection.type)g(b);else{var c=b.docSelection.createRange();if(k(c))l(b,c);else{b.rangeCount=c.length;for(var d,f=w.getDocument(c.item(0)),h=0;hg;++g)f.add(c.item(g));try{f.add(d)}catch(i){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}f.select(),m(a)}function o(a,b,c){this.nativeSelection=a,this.docSelection=b,this._ranges=[],this.win=c,this.refresh()}function p(a,b){for(var c,d=w.getDocument(b[0].startContainer),e=w.getBody(d).createControlRange(),f=0;ff;++f)b[f]=y.inspect(a.getRangeAt(f));return"["+e+"(Ranges: "+b.join(", ")+")(anchor: "+c.inspect()+", focus: "+d.inspect()+"]"}a.requireModules(["DomUtil","DomRange","WrappedRange"]),a.config.checkSelectionRanges=!0;var s,t,u="boolean",v="_rangySelection",w=a.dom,x=a.util,y=a.DomRange,z=a.WrappedRange,A=a.DOMException,B=w.DomPosition,C="Control",D=a.util.isHostMethod(window,"getSelection"),E=a.util.isHostObject(document,"selection"),F=E&&(!D||a.config.preferTextRange);F?(s=d,a.isSelectionValid=function(a){var b=(a||window).document,c=b.selection;return"None"!=c.type||w.getDocument(c.createRange().parentElement())==b}):D?(s=c,a.isSelectionValid=function(){return!0}):b.fail("Neither document.selection or window.getSelection() detected."),a.getNativeSelection=s;var G=s(),H=a.createNativeRange(document),I=w.getBody(document),J=x.areHostObjects(G,["anchorNode","focusNode"]&&x.areHostProperties(G,["anchorOffset","focusOffset"]));a.features.selectionHasAnchorAndFocus=J;var K=x.isHostMethod(G,"extend");a.features.selectionHasExtend=K;var L="number"==typeof G.rangeCount;a.features.selectionHasRangeCount=L;var M=!1,N=!0;x.areHostMethods(G,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof G.rangeCount&&a.features.implementsDomRange&&!function(){var a=document.createElement("iframe");I.appendChild(a);var b=w.getIframeDocument(a);b.open(),b.write("12"),b.close();var c=w.getIframeWindow(a).getSelection(),d=b.documentElement,e=d.lastChild,f=e.firstChild,g=b.createRange();g.setStart(f,1),g.collapse(!0),c.addRange(g),N=1==c.rangeCount,c.removeAllRanges();var h=g.cloneRange();g.setStart(f,0),h.setEnd(f,2),c.addRange(g),c.addRange(h),M=2==c.rangeCount,g.detach(),h.detach(),I.removeChild(a)}(),a.features.selectionSupportsMultipleRanges=M,a.features.collapsedNonEditableSelectionsSupported=N;var O,P=!1;I&&x.isHostMethod(I,"createControlRange")&&(O=I.createControlRange(),x.areHostProperties(O,["item","add"])&&(P=!0)),a.features.implementsControlRange=P,t=J?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:!1};var Q;x.isHostMethod(G,"getRangeAt")?Q=function(a,b){try{return a.getRangeAt(b)}catch(c){return null}}:J&&(Q=function(b){var c=w.getDocument(b.anchorNode),d=a.createRange(c);return d.setStart(b.anchorNode,b.anchorOffset),d.setEnd(b.focusNode,b.focusOffset),d.collapsed!==this.isCollapsed&&(d.setStart(b.focusNode,b.focusOffset),d.setEnd(b.anchorNode,b.anchorOffset)),d}),a.getSelection=function(a){a=a||window;var b=a[v],c=s(a),e=E?d(a):null;return b?(b.nativeSelection=c,b.docSelection=e,b.refresh(a)):(b=new o(c,e,a),a[v]=b),b},a.getIframeSelection=function(b){return a.getSelection(w.getIframeWindow(b))};var R=o.prototype;if(!F&&J&&x.areHostMethods(G,["removeAllRanges","addRange"])){R.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),g(this)};var S=function(b,c){var d=y.getRangeDocument(c),e=a.createRange(d);e.collapseToPoint(c.endContainer,c.endOffset),b.nativeSelection.addRange(h(e)),b.nativeSelection.extend(c.startContainer,c.startOffset),b.refresh()};L?R.addRange=function(b,c){if(P&&E&&this.docSelection.type==C)n(this,b);else if(c&&K)S(this,b);else{var d;if(M?d=this.rangeCount:(this.removeAllRanges(),d=0),this.nativeSelection.addRange(h(b)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==d+1){if(a.config.checkSelectionRanges){var f=Q(this.nativeSelection,this.rangeCount-1);f&&!y.rangesEqual(f,b)&&(b=new z(f))}this._ranges[this.rangeCount-1]=b,e(this,b,V(this.nativeSelection)),this.isCollapsed=t(this)}else this.refresh()}}:R.addRange=function(a,b){b&&K?S(this,a):(this.nativeSelection.addRange(h(a)),this.refresh())},R.setRanges=function(a){if(P&&a.length>1)p(this,a);else{this.removeAllRanges();for(var b=0,c=a.length;c>b;++b)this.addRange(a[b])}}}else{if(!(x.isHostMethod(G,"empty")&&x.isHostMethod(H,"select")&&P&&F))return b.fail("No means of selecting a Range or TextRange was found"),!1;R.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var a;if(this.anchorNode)a=w.getDocument(this.anchorNode);else if(this.docSelection.type==C){var b=this.docSelection.createRange();b.length&&(a=w.getDocument(b.item(0)).body.createTextRange())}if(a){var c=a.body.createTextRange();c.select(),this.docSelection.empty()}}}catch(d){}g(this)},R.addRange=function(a){this.docSelection.type==C?n(this,a):(z.rangeToTextRange(a).select(),this._ranges[0]=a,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,e(this,a,!1))},R.setRanges=function(a){this.removeAllRanges();var b=a.length;b>1?p(this,a):b&&this.addRange(a[0])}}R.getRangeAt=function(a){if(0>a||a>=this.rangeCount)throw new A("INDEX_SIZE_ERR");return this._ranges[a]};var T;if(F)T=function(b){var c;a.isSelectionValid(b.win)?c=b.docSelection.createRange():(c=w.getBody(b.win.document).createTextRange(),c.collapse(!0)),b.docSelection.type==C?m(b):k(c)?l(b,c):g(b)};else if(x.isHostMethod(G,"getRangeAt")&&"number"==typeof G.rangeCount)T=function(b){if(P&&E&&b.docSelection.type==C)m(b);else if(b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount,b.rangeCount){for(var c=0,d=b.rangeCount;d>c;++c)b._ranges[c]=new a.WrappedRange(b.nativeSelection.getRangeAt(c));e(b,b._ranges[b.rangeCount-1],V(b.nativeSelection)),b.isCollapsed=t(b)}else g(b)};else{if(!J||typeof G.isCollapsed!=u||typeof H.collapsed!=u||!a.features.implementsDomRange)return b.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;T=function(a){var b,c=a.nativeSelection;c.anchorNode?(b=Q(c,0),a._ranges=[b],a.rangeCount=1,f(a),a.isCollapsed=t(a)):g(a)}}R.refresh=function(a){var b=a?this._ranges.slice(0):null;if(T(this),a){var c=b.length;if(c!=this._ranges.length)return!1;for(;c--;)if(!y.rangesEqual(b[c],this._ranges[c]))return!1;return!0}};var U=function(a,b){var c=a.getAllRanges(),d=!1;a.removeAllRanges();for(var e=0,f=c.length;f>e;++e)d||b!==c[e]?a.addRange(c[e]):d=!0;a.rangeCount||g(a)};P?R.removeRange=function(a){if(this.docSelection.type==C){for(var b,c=this.docSelection.createRange(),d=j(a),e=w.getDocument(c.item(0)),f=w.getBody(e).createControlRange(),g=!1,h=0,i=c.length;i>h;++h)b=c.item(h),b!==d||g?f.add(c.item(h)):g=!0;f.select(),m(this)}else U(this,a)}:R.removeRange=function(a){U(this,a)};var V;!F&&J&&a.features.implementsDomRange?(V=function(a){var b=!1;return a.anchorNode&&(b=1==w.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)),b},R.isBackwards=function(){return V(this)}):V=R.isBackwards=function(){return!1},R.toString=function(){for(var a=[],b=0,c=this.rangeCount;c>b;++b)a[b]=""+this._ranges[b];return a.join("")},R.collapse=function(b,c){q(this,b);var d=a.createRange(w.getDocument(b));d.collapseToPoint(b,c),this.removeAllRanges(),this.addRange(d),this.isCollapsed=!0},R.collapseToStart=function(){if(!this.rangeCount)throw new A("INVALID_STATE_ERR");var a=this._ranges[0];this.collapse(a.startContainer,a.startOffset)},R.collapseToEnd=function(){if(!this.rangeCount)throw new A("INVALID_STATE_ERR");var a=this._ranges[this.rangeCount-1];this.collapse(a.endContainer,a.endOffset)},R.selectAllChildren=function(b){q(this,b);var c=a.createRange(w.getDocument(b));c.selectNodeContents(b),this.removeAllRanges(),this.addRange(c)},R.deleteFromDocument=function(){if(P&&E&&this.docSelection.type==C){for(var a,b=this.docSelection.createRange();b.length;)a=b.item(0),b.remove(a),a.parentNode.removeChild(a);this.refresh()}else if(this.rangeCount){var c=this.getAllRanges();this.removeAllRanges();for(var d=0,e=c.length;e>d;++d)c[d].deleteContents();this.addRange(c[e-1])}},R.getAllRanges=function(){return this._ranges.slice(0)},R.setSingleRange=function(a){this.setRanges([a])},R.containsNode=function(a,b){for(var c=0,d=this._ranges.length;d>c;++c)if(this._ranges[c].containsNode(a,b))return!0;return!1},R.toHtml=function(){var a="";if(this.rangeCount){for(var b=y.getRangeDocument(this._ranges[0]).createElement("div"),c=0,d=this._ranges.length;d>c;++c)b.appendChild(this._ranges[c].cloneContents());a=b.innerHTML}return a},R.getName=function(){return"WrappedSelection"},R.inspect=function(){return r(this)},R.detach=function(){this.win[v]=null,this.win=this.anchorNode=this.focusNode=null},o.inspect=r,a.Selection=o,a.selectionPrototype=R,a.addCreateMissingNativeApiListener(function(b){"undefined"==typeof b.getSelection&&(b.getSelection=function(){return a.getSelection(this)}),b=null})}),rangy.createModule("SaveRestore",function(a,b){function c(a,b){return(b||document).getElementById(a)}function d(a,b){var c,d="selectionBoundary_"+ +new Date+"_"+(""+Math.random()).slice(2),e=k.getDocument(a.startContainer),f=a.cloneRange();return f.collapse(b),c=e.createElement("span"),c.id=d,c.style.lineHeight="0",c.style.display="none",c.className="rangySelectionBoundary",c.appendChild(e.createTextNode(l)),f.insertNode(c),f.detach(),c}function e(a,d,e,f){var g=c(e,a);g?(d[f?"setStartBefore":"setEndBefore"](g),g.parentNode.removeChild(g)):b.warn("Marker element has been removed. Cannot restore selection.")}function f(a,b){return b.compareBoundaryPoints(a.START_TO_START,a)}function g(e){e=e||window;var g=e.document;if(!a.isSelectionValid(e))return void b.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");var h,i,j,k=a.getSelection(e),l=k.getAllRanges(),m=[];l.sort(f);for(var n=0,o=l.length;o>n;++n)j=l[n],j.collapsed?(i=d(j,!1),m.push({markerId:i.id,collapsed:!0})):(i=d(j,!1),h=d(j,!0),m[n]={startMarkerId:h.id,endMarkerId:i.id,collapsed:!1,backwards:1==l.length&&k.isBackwards()});for(n=o-1;n>=0;--n)j=l[n],j.collapsed?j.collapseBefore(c(m[n].markerId,g)):(j.setEndBefore(c(m[n].endMarkerId,g)),j.setStartAfter(c(m[n].startMarkerId,g))); +return k.setRanges(l),{win:e,doc:g,rangeInfos:m,restored:!1}}function h(d,f){if(!d.restored){for(var g,h,i=d.rangeInfos,j=a.getSelection(d.win),k=[],l=i.length,m=l-1;m>=0;--m){if(g=i[m],h=a.createRange(d.doc),g.collapsed){var n=c(g.markerId,d.doc);if(n){n.style.display="inline";var o=n.previousSibling;o&&3==o.nodeType?(n.parentNode.removeChild(n),h.collapseToPoint(o,o.length)):(h.collapseBefore(n),n.parentNode.removeChild(n))}else b.warn("Marker element has been removed. Cannot restore selection.")}else e(d.doc,h,g.startMarkerId,!0),e(d.doc,h,g.endMarkerId,!1);1==l&&h.normalizeBoundaries(),k[m]=h}1==l&&f&&a.features.selectionHasExtend&&i[0].backwards?(j.removeAllRanges(),j.addRange(k[0],!0)):j.setRanges(k),d.restored=!0}}function i(a,b){var d=c(b,a);d&&d.parentNode.removeChild(d)}function j(a){for(var b,c=a.rangeInfos,d=0,e=c.length;e>d;++d)b=c[d],b.collapsed?i(a.doc,b.markerId):(i(a.doc,b.startMarkerId),i(a.doc,b.endMarkerId))}a.requireModules(["DomUtil","DomRange","WrappedRange"]);var k=a.dom,l="\ufeff";a.saveSelection=g,a.restoreSelection=h,a.removeMarkerElement=i,a.removeMarkers=j}),WYMeditor.SKINS.compact={init:function(a){jQuery(a._options.containersSelector+", "+a._options.classesSelector,a._box).appendTo(jQuery("div.wym_area_top",a._box)).addClass("wym_dropdown").css({"margin-right":"10px",width:"120px","float":"left"}),jQuery(a._options.toolsSelector,a._box).addClass("wym_buttons").css({"margin-right":"10px","float":"left"}),jQuery(".wym_section",a._box).hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")});var b=a._options.postInit;a._options.postInit=function(a){b&&b.call(a,a),a.$body().css("background-color","#f0f0f0")}}},WYMeditor.SKINS["default"]={init:function(a){jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").find(WYMeditor.H2).append(" >"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}},WYMeditor.SKINS.legacy={init:function(a){jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").find(WYMeditor.H2).append(" >"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}},jQuery.fn.selectify=function(){var a=this;return a.each(function(){var a=this;jQuery(a).hover(function(){var a=this;jQuery("h2",a).css("background-position","0px -18px"),jQuery("ul",a).fadeIn("fast")},function(){var a=this;jQuery("h2",a).css("background-position",""),jQuery("ul",a).fadeOut("fast")})})},WYMeditor.SKINS.minimal={init:function(a){jQuery(a._box).find(a._options.toolsSelector+", "+a._options.containersSelector+", "+a._options.classesSelector).addClass("wym_dropdown").selectify()}},function(a){var b=function(b,c){this.options=a.extend({},a.fn.wymAffix.defaults,c),this.$window=a(window),this.$window.bind("scroll.affix.data-api",a.proxy(this.checkPosition,this)),this.$window.bind("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){var a,b=this.$window.scrollTop(),c=this.options.offset,d=c.bottom,e=c.top,f="affix affix-top affix-bottom",g=!0,h=!0;"object"!=typeof c&&(d=e=c),"function"==typeof e&&(e=c.top()),"function"==typeof d&&(d=c.bottom()),null!==e&&(g=b>e),null!==d&&(h=b+this.$element.height()','","
      "].join(""),initIframeCheckFrequency:50,imagesLoadedCheckFrequency:300,imagesLoadedCheckTimeout:5e3},init:function(a){var b=WYMeditor.SKINS.seamless;Date.now||(Date.now=function(){return(new Date).getTime()}),a.seamlessSkinOpts=jQuery.extend(b.OPTS,{initialIframeResizeTimer:null,resizeAfterImagesLoadTimer:null,_imagesLoadedCheckStartedTime:0,minimumHeight:jQuery(a.element).height()}),b.initUIChrome(a),jQuery(a.element).bind(WYMeditor.EVENTS.postIframeInitialization,b.postIframeInit)},postIframeInit:function(a,b){var c=WYMeditor.SKINS.seamless;c.resizeIframeOnceBodyExists(b),jQuery(b.element).bind(WYMeditor.EVENTS.postBlockMaybeCreated,function(){c.resizeAndScrollIfNeeded(b)})},initUIChrome:function(a){var b,c,d=WYMeditor.SKINS.seamless,e=jQuery([a._options.containersSelector,a._options.classesSelector].join(", "),a._box);c=jQuery("div.wym_area_top",a._box),e.appendTo(c),e.addClass("wym_dropdown"),jQuery(".wym_dropdown",a._box).click(function(){var a=this;jQuery(a).toggleClass("hover")}),b=jQuery(a._options.toolsSelector,a._box),b.addClass("wym_buttons"),d.affixTopControls(a)},affixTopControls:function(a){var b,c,d,e,f=5;b=jQuery("div.wym_area_top",a._box),c=jQuery('
      '),b.wrap(c),c=b.parent(),c.wrap('
      '),e=c.parent(),e.height(b.height()),d=function(){c.width(e.width())},d(),jQuery(window).resize(d),c.wymAffix({offset:{top:function(){return e.offset().top-f},bottom:function(){return e.offset().top+a.seamlessSkinIframeHeight}}})},resizeIframeOnceBodyExists:function(a){var b,c=WYMeditor.SKINS.seamless;return a.seamlessSkinOpts.initialIframeResizeTimer&&(window.clearTimeout(a.seamlessSkinOpts.initialIframeResizeTimer),a.seamlessSkinOpts.initialIframeResizeTimer=null),"undefined"==typeof a._doc.body||null===a._doc.body?void(a.seamlessSkinOpts.initialIframeResizeTimer=window.setTimeout(function(){c.resizeIframeOnceBodyExists(a)},a.seamlessSkinOpts.initIframeCheckFrequency)):(b=a._doc.body.scrollHeight,c.resizeIframe(a),void c.resizeIframeOnceImagesLoaded(a))},resizeIframeOnceImagesLoaded:function(a){var b,c,d,e=WYMeditor.SKINS.seamless,f=0,g=!0,h=a.seamlessSkinOpts;if(("undefined"==typeof h._imagesLoadedCheckStartedTime||0===h._imagesLoadedCheckStartedTime)&&(h._imagesLoadedCheckStartedTime=Date.now()),null!==h.resizeAfterImagesLoadTimer&&(window.clearTimeout(h.resizeAfterImagesLoadTimer),h.resizeAfterImagesLoadTimer=null),b=a.$body().find("img"),c=b.length,0!==c){for(f=0;c>f;f+=1)if(!e._imageIsLoaded(b[f])){g=!1;break}return e.resizeAndScrollIfNeeded(a),g===!0?void(h._imagesLoadedCheckStartedTime=0):(d=Date.now()-h._imagesLoadedCheckStartedTime,d>h.imagesLoadedCheckTimeout?void(h._imagesLoadedCheckStartedTime=0):void(h.resizeAfterImagesLoadTimer=window.setTimeout(function(){e.resizeIframeOnceImagesLoaded(a)},h.imagesLoadedCheckFrequency)))}},_imageIsLoaded:function(a){return a.complete!==!0?!1:"undefined"!=typeof a.naturalWidth&&0===a.naturalWidth?!1:!0},_getIframeHeightStrategy:function(a){var b,c,d,e,f;if(c=jQuery(a._doc).children().eq(0),b=a._doc.body.scrollHeight,d=c.height(),e=c[0].scrollHeight,WYMeditor.isInternetExplorerPre11())return f=function(a){var b=jQuery(a._doc).children().eq(0),c=b[0].scrollHeight;return c-10};if(d>=b)return f=function(a){var b=jQuery(a._doc).children().eq(0),c=b.height();return c};if(b>e)return f=function(a){return a._doc.body.scrollHeight};throw new Error("unsupported browser")},resizeIframe:function(a){var b,c=WYMeditor.SKINS.seamless,d=jQuery(a._iframe),e=d.height();return"undefined"==typeof WYMeditor.IFRAME_HEIGHT_GETTER&&(WYMeditor.IFRAME_HEIGHT_GETTER=c._getIframeHeightStrategy(a)),b=WYMeditor.IFRAME_HEIGHT_GETTER(a),b0&&(d=l.scrollTop()+e+j,l.scrollTop(d)))},resizeAndScrollIfNeeded:function(a){var b=WYMeditor.SKINS.seamless,c=b.resizeIframe(a);c===!0&&b.scrollIfNeeded(a)}},jQuery.fn.selectify=function(){var a=this;return a.each(function(){var a=this;jQuery(a).hover(function(){var a=this;jQuery("h2",a).css("background-position","0px -18px"),jQuery("ul",a).fadeIn("fast")},function(){var a=this;jQuery("h2",a).css("background-position",""),jQuery("ul",a).fadeOut("fast")})})},WYMeditor.SKINS.silver={init:function(a){jQuery(a._box).append('
      ').wrapInner('
      '),jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").selectify(),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){var a=this;jQuery(a).addClass("hover")},function(){var a=this;jQuery(a).removeClass("hover")})}},WYMeditor.SKINS.twopanels={init:function(a){jQuery(a._box).find(a._options.containersSelector).appendTo("div.wym_area_left"),jQuery(a._box).find(a._options.classesSelector+", "+a._options.containersSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"115px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}}; \ No newline at end of file diff --git a/static-files/journal/wymeditor/plugins/fullscreen/icon_fullscreen.gif b/static-files/journal/wymeditor/plugins/fullscreen/icon_fullscreen.gif new file mode 100644 index 0000000..d2a8b0a Binary files /dev/null and b/static-files/journal/wymeditor/plugins/fullscreen/icon_fullscreen.gif differ diff --git a/static-files/journal/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js b/static-files/journal/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js new file mode 100644 index 0000000..faaa693 --- /dev/null +++ b/static-files/journal/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js @@ -0,0 +1,126 @@ +/* + * WYMeditor : what you see is What You Mean web-based editor + * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ + * Dual licensed under the MIT (MIT-license.txt) + * and GPL (GPL-license.txt) licenses. + * + * For further information visit: + * http://www.wymeditor.org/ + * + * File Name: + * jquery.wymeditor.fullscreen.js + * Fullscreen plugin for WYMeditor + * + * File Authors: + * Luis Santos (luis.santos a-t openquest dotpt) + * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) + * Gerd Riesselmann (gerd a-t gyro-php dot org) : Fixed issue with new skin layout + * Philipp Cordes (pc a-t irgendware dotnet) + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.fullscreen = function() { + var wym = this, + $box = jQuery(wym._box), + $iframe = jQuery(wym._iframe), + $overlay = null, + $window = jQuery(window), + + editorMargin = 15; // Margin from window (without padding) + + + //construct the button's html + var html = '' + + "
    4. " + + "" + + "Fullscreen" + + "" + + "
    5. "; + //add the button to the tools box + $box.find(wym._options.toolsSelector + wym._options.toolsListSelector) + .append(html); + + function resize () { + // Calculate margins + var uiHeight = $box.outerHeight(true) - $iframe.outerHeight(true); + var editorPadding = $box.outerWidth() - $box.width(); + + // Calculate heights + var screenHeight = $window.height(); + var iframeHeight = (screenHeight - uiHeight - (editorMargin * 2)) + 'px'; + + // Calculate witdths + var screenWidth = $window.width(); + var boxWidth = (screenWidth - editorPadding - (editorMargin * 2)) + 'px'; + + $box.css('width', boxWidth); + $iframe.css('height', iframeHeight); + $overlay.css({ + 'height': screenHeight + 'px', + 'width': screenWidth + 'px' + }); + } + + //handle click event + $box.find('li.wym_tools_fullscreen a').click(function() { + if ($box.css('position') != 'fixed') { + // Store previous inline styles + $box.data('wym-inline-css', $box.attr('style')); + $iframe.data('wym-inline-css', $iframe.attr('style')); + + // Create overlay + $overlay = jQuery('
      ') + .appendTo('body').css({ + 'position': 'fixed', + 'background-color': 'rgb(0, 0, 0)', + 'opacity': '0.75', + 'z-index': '98', + 'top': '0px', + 'left': '0px' + }); + + // Possition the editor + $box.css({ + 'position': 'fixed', + 'z-index': '99', + 'top': editorMargin + 'px', + 'left': editorMargin + 'px' + }); + + // Bind event listeners + $window.bind('resize', resize); + $box.find('li.wym_tools_html a').bind('click', resize); + + // Force resize + resize(); + } else { + // Unbind event listeners + $window.unbind('resize', resize); + $box.find('li.wym_tools_html a').unbind('click', resize); + + // Remove inline styles + $box.css({ + 'position': 'static', + 'z-index': '', + 'width': '', + 'top': '', + 'left': '' + }); + $iframe.css('height', ''); + + // Remove overlay + $overlay.remove(); + $overlay = null; + + // Retore previous inline styles + $box.attr('style', $box.data('wym-inline-css')); + $iframe.attr('style', $iframe.data('wym-inline-css')); + } + + return false; + }); +}; diff --git a/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js b/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js new file mode 100644 index 0000000..b009e25 --- /dev/null +++ b/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2011 PolicyStat LLC. + * MIT licensed (MIT-license.txt) + * + * This plugin adds the ability to use tab and shift+tab to indent/outdent + * lists, mimicking a user's expected behavior when inside an editor. + * + * @author Wes Winham (winhamwr@gmail.com) + */ + +function ListPlugin(options, wym) { + var listPlugin = this; + ListPlugin._options = jQuery.extend({}, options); + listPlugin._wym = wym; + + listPlugin.init(); +} + +ListPlugin.prototype.init = function() { + var listPlugin = this; + listPlugin._wym.listPlugin = listPlugin; + + listPlugin.bindEvents(); +}; + +ListPlugin.prototype.bindEvents = function() { + var listPlugin = this, + wym = listPlugin._wym; + + wym.keyboard.combokeys.bind( + "tab", + function () { + wym.indent(); + return false; + } + ); + wym.keyboard.combokeys.bind( + "shift+tab", + function () { + wym.outdent(); + return false; + } + ); +}; diff --git a/static-files/journal/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js b/static-files/journal/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js new file mode 100644 index 0000000..2323440 --- /dev/null +++ b/static-files/journal/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js @@ -0,0 +1,192 @@ +/* + * WYMeditor : what you see is What You Mean web-based editor + * Copyright (c) 2005 - 2011 Jean-Francois Hovinne, http://www.wymeditor.org/ + * Dual licensed under the MIT (MIT-license.txt) + * and GPL (GPL-license.txt) licenses. + * + * For further information visit: + * http://www.wymeditor.org/ + * + * File Name: + * jquery.wymeditor.rdfa.js + * RDFa plugin for WYMeditor + * + * File Authors: + * Jean-Francois Hovinne (@jfhovinne) + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.rdfa = function (options) { + var wym = this, + rdfa = new WYMeditor.RDFa(options, wym); + return rdfa; +}; + +//RDFa constructor +WYMeditor.RDFa = function (options, wym) { + var rdfa = this; + options = jQuery.extend({ + setStdNameSpaces: true, + extendXHTMLParser: true, + buttons: {} + }, options); + + rdfa._options = options; + rdfa._wym = wym; + rdfa.init(); +}; + +//RDFa plugin init +WYMeditor.RDFa.prototype.init = function () { + var rdfa = this; + if (rdfa._options.setStdNameSpaces) { + rdfa.setStdNameSpaces(); + } + if (rdfa._options.extendXHTMLParser) { + rdfa.extendXHTMLParser(); + } + rdfa.setButtons(); +}; + +//Adding the namespaces to the document +WYMeditor.RDFa.prototype.setStdNameSpaces = function () { + var rdfa = this; + rdfa.addNameSpace('xmlns', 'http://www.w3.org/1999/xhtml'); + rdfa.addNameSpace('version', 'XHTML+RDFa 1.0'); +}; + +WYMeditor.RDFa.prototype.addNameSpace = function (attr, value) { + var rdfa = this; + jQuery('html', rdfa._wym._doc) + .attr(attr, value); +}; + +WYMeditor.RDFa.prototype.extendXHTMLParser = function () { + var rdfa = this; + rdfa.extendAttributes(); + rdfa.setStdVocabularies(); + rdfa.extendLinkAttributes(); +}; + +WYMeditor.RDFa.prototype.extendAttributes = function () { + //Add the RDFa attributes + WYMeditor.XhtmlValidator._attributes.core.attributes.push( + 'rel', + 'rev', + 'content', + 'href', + 'src', + 'about', + 'property', + 'resource', + 'datatype', + 'typeof' + ); +}; + +WYMeditor.RDFa.prototype.setStdVocabularies = function () { + var rdfa = this; + //Add the 'standard' vocabularies + vocabularies = [ + 'xmlns:biblio', + 'xmlns:cc', + 'xmlns:dbp', + 'xmlns:dbr', + 'xmlns:dc', + 'xmlns:ex', + 'xmlns:foaf', + 'xmlns:rdf', + 'xmlns:rdfs', + 'xmlns:taxo', + 'xmlns:xhv', + 'xmlns:xsd' + ]; + jQuery.each(vocabularies, function (index, vocabulary) { + rdfa.addVocabulary(vocabulary); + }); +}; + +WYMeditor.RDFa.prototype.addVocabulary = function (vocabulary) { + WYMeditor.XhtmlValidator._attributes.core.attributes.push(vocabulary); +}; + +WYMeditor.RDFa.prototype.extendLinkAttributes = function () { + //Overwrite the attributes 'rel' and 'rev' + WYMeditor.XhtmlValidator._tags.a = { + "attributes": { + "0": "charset", + "1": "coords", + "2": "href", + "3": "hreflang", + "4": "name", + "5": "rel", + "6": "rev", + "shape": /^(rect|rectangle|circ|circle|poly|polygon)$/, + "7": "type" + } + }; +}; + +WYMeditor.RDFa.prototype.setButtons = function () { + var rdfa = this, + list = jQuery(rdfa._wym._box).find('div.wym_classes ul'); + jQuery.each(rdfa._options.buttons, function (index, button) { + list + .append('
    6. ') + .children(':last') + .append('
      ') + .children(':last') + .attr('href', '#') + .text(button.title) + .bind('click', + { + instance: rdfa._wym, + button: button, + ns: button.ns, + attr: button.attr, + value: button.value + }, + rdfa.clickButtonHandler); + }); +}; + +WYMeditor.RDFa.prototype.clickButtonHandler = function (evt) { + var wym = evt.data.instance, + selected = wym.selectedContainer(); + + //the attribute already exists, remove it + if (typeof jQuery(selected).attr(evt.data.attr) !== 'undefined' && + jQuery(selected).attr(evt.data.attr) !== '') { + WYMeditor.console.log( + 'attribute already exists, remove it:', + evt.data.attr, + jQuery(selected).attr(evt.data.attr) + ); + jQuery(selected) + .removeAttr(evt.data.attr) + .removeClass(evt.data.ns) + .removeClass(evt.data.attr) + .removeClass(evt.data.value); + + //else, add it + } else { + WYMeditor.console.log('attribute does not exist, add it:', evt.data.attr, evt.data.value); + if (evt.data.value) { //value available + jQuery(selected) + .attr(evt.data.attr, evt.data.ns + ':' + evt.data.value) + .addClass(evt.data.ns) + .addClass(evt.data.attr) + .addClass(evt.data.value); + } else { //value not available + evt.data.value = prompt('Value', ''); + if (evt.data.value !== null) { + jQuery(selected) + .attr(evt.data.attr, evt.data.value) + .addClass(evt.data.ns) + .addClass(evt.data.attr) + .addClass(evt.data.value); + } + } + } + return false; +}; diff --git a/static-files/journal/wymeditor/plugins/table/jquery.wymeditor.table.js b/static-files/journal/wymeditor/plugins/table/jquery.wymeditor.table.js new file mode 100644 index 0000000..d258cb5 --- /dev/null +++ b/static-files/journal/wymeditor/plugins/table/jquery.wymeditor.table.js @@ -0,0 +1,761 @@ +/* global rangy */ +"use strict"; + +// Fugue icons by Yusuke Kamiyamane http://p.yusukekamiyamane.com/ +// and licensed under Creative Commons Attribution + +/** + * A Table editing plugin that gives the user ability to add and remove + * rows and columns as well as merge rows and columns. + * + * @param options A configuration object. + * @param wym The WYMeditor instance to which the TableEditor should attach. + * @class + */ +function TableEditor(options, wym) { + var tableEditor = this; + options = jQuery.extend({ + sMergeRowButtonHtml: String() + + '
    7. ' + + '' + + 'Merge Table Row' + + '' + + '
    8. ', + + sMergeRowButtonSelector: "li.wym_tools_merge_row a", + + sAddRowButtonHtml: String() + + "
    9. " + + "" + + "Add Table Row" + + "" + + "
    10. ", + sAddRowButtonSelector: "li.wym_tools_add_row a", + + sRemoveRowButtonHtml: String() + + "
    11. " + + "" + + "Remove Table Row" + + "" + + "
    12. ", + sRemoveRowButtonSelector: "li.wym_tools_remove_row a", + + sAddColumnButtonHtml: String() + + "
    13. " + + "" + + "Add Table Column" + + "" + + "
    14. ", + sAddColumnButtonSelector: "li.wym_tools_add_column a", + + sRemoveColumnButtonHtml: String() + + "
    15. " + + "" + + "Remove Table Column" + + "" + + "
    16. ", + sRemoveColumnButtonSelector: "li.wym_tools_remove_column a", + + enableCellTabbing: true + + }, options); + + tableEditor._options = options; + tableEditor._wym = wym; + + tableEditor.init(); +} + +/** + * Construct and return a table objects using the given options object. + * + * @param options The configuration object. + */ +WYMeditor.editor.prototype.table = function (options) { + var wym = this, + tableEditor = new TableEditor(options, wym); + wym.tableEditor = tableEditor; + + return tableEditor; +}; + +/** + * Initialize the TableEditor object by adding appropriate toolbar buttons and + * binding any required event listeners. + */ +TableEditor.prototype.init = function () { + var tableEditor = this, + wym = tableEditor._wym, + // Add the tool panel buttons + tools = jQuery(wym._box).find( + wym._options.toolsSelector + wym._options.toolsListSelector + ); + + tools.append(tableEditor._options.sMergeRowButtonHtml); + tools.append(tableEditor._options.sAddRowButtonHtml); + tools.append(tableEditor._options.sRemoveRowButtonHtml); + tools.append(tableEditor._options.sAddColumnButtonHtml); + tools.append(tableEditor._options.sRemoveColumnButtonHtml); + + tableEditor.bindEvents(); + rangy.init(); +}; + +/** + * Bind all required event listeners, including button listeners and support + * for tabbing through table cells if enableCellTabbing is true. + */ +TableEditor.prototype.bindEvents = function () { + var tableEditor = this, + wym = tableEditor._wym; + + // Handle tool button click + jQuery(wym._box).find( + tableEditor._options.sMergeRowButtonSelector + ).click(function () { + tableEditor.mergeRow(); + return false; + }); + jQuery(wym._box).find( + tableEditor._options.sAddRowButtonSelector + ).click(function () { + return tableEditor.addRow(wym.selectedContainer()); + }); + jQuery(wym._box).find( + tableEditor._options.sRemoveRowButtonSelector + ).click(function () { + return tableEditor.removeRow(wym.selectedContainer()); + }); + jQuery(wym._box).find( + tableEditor._options.sAddColumnButtonSelector + ).click(function () { + return tableEditor.addColumn(wym.selectedContainer()); + }); + jQuery(wym._box).find( + tableEditor._options.sRemoveColumnButtonSelector + ).click(function () { + return tableEditor.removeColumn(wym.selectedContainer()); + }); + + // Handle tab clicks + if (tableEditor._options.enableCellTabbing) { + jQuery(wym._doc).bind('keydown', tableEditor.keyDown); + } +}; + +/** + * Get the number of columns in a given tr element, accounting for colspan and + * rowspan. This function assumes that the table structure is valid, and will + * return incorrect results for uneven tables. + * + * @param tr The node whose number of columns we need to count. + * + * @returns {Number} The number of columns in the given tr, accounting for + * colspan and rowspan. + */ +TableEditor.prototype.getNumColumns = function (tr) { + var tableEditor = this, + wym = tableEditor._wym, + numColumns = 0, + table, + firstTr; + + table = wym.findUp(tr, 'table'); + firstTr = jQuery(table).find('tr:eq(0)'); + + // Count the tds and ths in the FIRST ROW of this table, accounting for + // colspan. We count the first td because it won't have any rowspan's + // before it to complicate things + jQuery(firstTr).children('td,th').each(function (index, elmnt) { + numColumns += TableEditor.GET_COLSPAN_PROP(elmnt); + }); + + return numColumns; +}; + +/** + TableEditor.GET_COLSPAN_PROP + ============================ + + Get the integer value of the inferred colspan property on the given cell in + a cross-browser compatible way that's also compatible across jquery + versions. + + jquery 1.6 changed the way .attr works, which affected certain browsers + differently with regard to colspan and rowspan for cells that didn't + explicitly have that attribute set. +*/ +TableEditor.GET_COLSPAN_PROP = function (cell) { + var colspan = jQuery(cell).attr('colspan'); + if (typeof colspan === 'undefined') { + colspan = 1; + } + return parseInt(colspan, 10); +}; + +/** + TableEditor.GET_ROWSPAN_PROP + ============================ + + Get the integer value of the inferred rowspan property on the given cell in + a cross-browser compatible way that's also compatible across jquery + versions. + + See GET_COLSPAN_PROP for details +*/ +TableEditor.GET_ROWSPAN_PROP = function (cell) { + var rowspan = jQuery(cell).attr('rowspan'); + if (typeof rowspan === 'undefined') { + rowspan = 1; + } + return parseInt(rowspan, 10); +}; +/** + * Get the X grid index of the given td or th table cell (0-indexed). This + * takes in to account all colspans and rowspans. + * + * @param cell The td or th node whose X index we're returning. + */ +TableEditor.prototype.getCellXIndex = function (cell) { + var tableEditor = this, + i, + parentTr, + baseRowColumns, + rowColCount, + missingCells, + rowspanIndexes, + checkTr, + rowOffset, + trChildren, + elmnt, + colspan, + indexCounter, + cellIndex; + parentTr = jQuery(cell).parent('tr')[0]; + + baseRowColumns = tableEditor.getNumColumns(parentTr); + + // Figure out how many explicit cells are missing which is how many + // rowspans we're affected by + rowColCount = 0; + jQuery(parentTr).children('td,th').each(function (index, elmnt) { + rowColCount += TableEditor.GET_COLSPAN_PROP(elmnt); + }); + + missingCells = baseRowColumns - rowColCount; + rowspanIndexes = []; + checkTr = parentTr; + rowOffset = 1; + + // If this cell is affected by a rowspan from farther up the table, + // we need to take in to account any possible colspan attributes on that + // cell. Store the real X index of the cells to the left of our cell to use + // in the colspan calculation. + while (missingCells > 0) { + checkTr = jQuery(checkTr).prev('tr'); + rowOffset += 1; + trChildren = jQuery(checkTr).children('td,th'); + for (i = 0; i < trChildren.length; i++) { + elmnt = trChildren[i]; + if (TableEditor.GET_ROWSPAN_PROP(elmnt) >= rowOffset) { + // Actually affects our source row + missingCells -= 1; + colspan = TableEditor.GET_COLSPAN_PROP(elmnt); + rowspanIndexes[tableEditor.getCellXIndex(elmnt)] = colspan; + } + } + } + + indexCounter = 0; + cellIndex = null; + // Taking in to account the real X indexes of all of the columns to the + // left of this cell, determine the real X index. + jQuery(parentTr).children('td,th').each(function (index, elmnt) { + if (cellIndex !== null) { + // We've already iterated to the cell we're checking + return; + } + // Account for an inferred colspan created by a rowspan from above + while (typeof rowspanIndexes[indexCounter] !== 'undefined') { + indexCounter += parseInt(rowspanIndexes[indexCounter], 10); + } + if (elmnt === cell) { + // We're at our cell, no need to keep moving to the right. + // Signal this by setting the cellIndex + cellIndex = indexCounter; + return; + } + // Account for an explicit colspan on this cell + indexCounter += TableEditor.GET_COLSPAN_PROP(elmnt); + }); + + if (cellIndex === null) { + // Somehow, we never found the cell when iterating over its row. + throw "Cell index not found"; + } + return cellIndex; +}; + +/** + * Get the number of columns represented by the given array of contiguous cell + * (td/th) nodes. + * Accounts for colspan and rowspan attributes. + * + * @param cells An array of td/th nodes whose total column span we're checking. + * + * @return {Number} The number of columns represented by the "cells" + */ +TableEditor.prototype.getTotalColumns = function (cells) { + var tableEditor = this, + rootTr = tableEditor.getCommonParentTr(cells), + baseRowColumns, + colspanCount, + rowColCount, + lastCell, + firstCell; + + if (rootTr === null) { + // Non-contiguous columns + throw "getTotalColumns only allowed for contiguous cells"; + } + + baseRowColumns = tableEditor.getNumColumns(rootTr); + + // Count the number of simple columns, not accounting for rowspans + colspanCount = 0; + jQuery(cells).each(function (index, elmnt) { + colspanCount += TableEditor.GET_COLSPAN_PROP(elmnt); + }); + + // Determine if we're affected by rowspans. If the number of simple columns + // in the row equals the number of columns in the first row, we don't have + // any rowspans + rowColCount = 0; + jQuery(rootTr).children('td,th').each(function (index, elmnt) { + rowColCount += TableEditor.GET_COLSPAN_PROP(elmnt); + }); + + if (rowColCount === baseRowColumns) { + // Easy case. No rowspans to deal with + return colspanCount; + } else { + if (cells.length === 1) { + // Easy. Just the colspan + return TableEditor.GET_COLSPAN_PROP(cells[0]); + } else { + lastCell = jQuery(cells).eq(cells.length - 1)[0]; + firstCell = jQuery(cells).eq(0)[0]; + // On jQuery 1.4 upgrade, jQuery(cells).eq(-1) + return 1 + tableEditor.getCellXIndex(lastCell) - + tableEditor.getCellXIndex(firstCell); + } + } +}; + +/** + * Merge the table cells in the given selection using a colspan. + * + * @return {Boolean} true if changes are made, false otherwise + */ +TableEditor.prototype.mergeRow = function () { + var tableEditor = this, + wym = tableEditor._wym, + // Get all of the affected nodes in the range + nodes = wym._getSelectedNodes(), + cells, + rootTr, + mergeCell, + $elmnt, + rowspanProp, + newContent, + combinedColspan; + + wym.deselect(); + + // Just use the td and th nodes + cells = jQuery(nodes).filter('td,th'); + if (cells.length === 0) { + return false; + } + + // If the selection is across multiple tables, don't merge + rootTr = tableEditor.getCommonParentTr(cells); + if (rootTr === null) { + return false; + } + + mergeCell = cells[0]; + // If any of the cells have a rowspan, create the inferred cells + jQuery(cells).each(function (i, elmnt) { + $elmnt = jQuery(elmnt); + rowspanProp = TableEditor.GET_ROWSPAN_PROP(elmnt); + if (rowspanProp <= 1) { + // We don't care about cells without a rowspan + return; + } + + // This cell has an actual rowspan, we need to account for it + // Figure out the x index for this cell in the table grid + var index = tableEditor.getCellXIndex(elmnt), + // Create the previously-inferred cell in the appropriate index + // with one less rowspan + newRowspan = rowspanProp - 1, + newTd, + insertionIndex, + insertionCells, + cellInserted, + xIndex; + if (newRowspan === 1) { + newTd = '' + $elmnt.html() + ''; + } else { + newTd = String() + + '' + + $elmnt.html() + + ''; + } + if (index === 0) { + $elmnt.parent('tr') + .next('tr') + .prepend(newTd); + } else { + // TODO: account for colspan/rowspan with insertion + // Account for colspan/rowspan by walking from right to left + // looking for the cell closest to the desired index to APPEND to + insertionIndex = index - 1; + insertionCells = $elmnt.parent('tr').next('tr').find('td,th'); + cellInserted = false; + for (i = insertionCells.length - 1; i >= 0; i--) { + xIndex = tableEditor.getCellXIndex(insertionCells[i]); + if (xIndex <= insertionIndex) { + jQuery(insertionCells[i]).after(newTd); + cellInserted = true; + break; + } + } + if (!cellInserted) { + // Bail out now before we clear HTML and break things + throw "Cell rowspan invalid"; + } + } + + // Clear the cell's html, since we just moved it down + $elmnt.html(''); + }); + + // Remove any rowspan from the mergecell now that we've shifted rowspans + // down + // ie fails when we try to remove a rowspan for some reason + try { + jQuery(mergeCell).removeAttr('rowspan'); + } catch (err) { + jQuery(mergeCell).attr('rowspan', 1); + } + + // Build the content of the new combined cell from all of the included + // cells + newContent = ''; + jQuery(cells).each(function (index, elmnt) { + newContent += jQuery(elmnt).html(); + }); + + // Add a colspan to the farthest-left cell + combinedColspan = tableEditor.getTotalColumns(cells); + if (jQuery.browser.msie) { + // jQuery.attr doesn't work for colspan in ie + mergeCell.colSpan = combinedColspan; + } else { + jQuery(mergeCell).attr('colspan', combinedColspan); + } + + // Delete the rest of the cells + jQuery(cells).each(function (index, elmnt) { + if (index !== 0) { + jQuery(elmnt).remove(); + } + }); + + // Change the content in our newly-merged cell + jQuery(mergeCell).html(newContent); + + tableEditor.selectElement(mergeCell); + + wym.registerModification(); + return true; +}; + +/** + * Add a row to the given elmnt (representing a or a child of a ). + * + * @param The node which will have a row appended after its parent row. + */ +TableEditor.prototype.addRow = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + tr = tableEditor._wym.findUp(elmnt, 'tr'), + numColumns, + tdHtml, + i; + + if (tr === null) { + return false; + } + + numColumns = tableEditor.getNumColumns(tr); + + tdHtml = ''; + for (i = 0; i < numColumns; i++) { + tdHtml += ' '; + } + jQuery(tr).after('' + tdHtml + ''); + + wym.registerModification(); + return false; +}; + +/** + * Remove the given table if it doesn't have any rows/columns. + * + * @param table The table to delete if it is empty. + */ +TableEditor.prototype.removeEmptyTable = function (table) { + var tableEditor = this, + wym = tableEditor._wym, + cells = jQuery(table).find('td,th'), + $table; + if (cells.length === 0) { + $table = jQuery(table); + $table.prev('br.' + WYMeditor.BLOCKING_ELEMENT_SPACER_CLASS).remove(); + $table.next('br.' + WYMeditor.BLOCKING_ELEMENT_SPACER_CLASS).remove(); + $table.remove(); + wym.prepareDocForEditing(); + } +}; + +/** + * Remove the row for the given element (representing a or a child + * of a ). + * + * @param elmnt The node whose parent tr will be removed. + */ +TableEditor.prototype.removeRow = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + tr = wym.findUp(elmnt, 'tr'), + table; + + if (tr === null) { + return false; + } + table = wym.findUp(elmnt, 'table'); + if ( + wym.hasSelection() === true && + wym.doesElementContainSelection(elmnt) === true + ) { + wym.deselect(); + } + jQuery(tr).remove(); + tableEditor.removeEmptyTable(table); + + wym.registerModification(); + return false; +}; + +/** + * Add a column to the given elmnt (representing a or a child of a ). + * + * @param elmnt The node which will have a column appended afterward. + */ +TableEditor.prototype.addColumn = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + td = wym.findUp(elmnt, ['td', 'th']), + prevTds, + tdIndex, + tr, + newTd = ' ', + newTh = ' ', + insertionElement; + + if (td === null) { + return false; + } + prevTds = jQuery(td).prevAll(); + tdIndex = prevTds.length; + + tr = wym.findUp(td, 'tr'); + jQuery(tr).siblings('tr').andSelf().each(function (index, element) { + insertionElement = newTd; + if (jQuery(element).find('th').length > 0) { + // The row has a TH, so insert a th + insertionElement = newTh; + } + + jQuery(element).find('td,th').eq(tdIndex).after(insertionElement); + }); + + wym.registerModification(); + return false; +}; + +/** + * Remove the column to the right of the given elmnt (representing a or a + * child of a ). + */ +TableEditor.prototype.removeColumn = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + td = wym.findUp(elmnt, ['td', 'th']), + table, + prevTds, + tdIndex, + tr; + if (td === null) { + return false; + } + table = wym.findUp(elmnt, 'table'); + prevTds = jQuery(td).prevAll(); + tdIndex = prevTds.length; + + tr = wym.findUp(td, 'tr'); + jQuery(tr).siblings('tr').addBack().each(function (index, element) { + var $cell = jQuery(element).find("td, th").eq(tdIndex); + if ( + wym.hasSelection() === true && + wym.doesElementContainSelection($cell[0]) === true + ) { + wym.deselect(); + } + $cell.remove(); + }); + tableEditor.removeEmptyTable(table); + + wym.registerModification(); + return false; +}; + +/** + * keyDown event handler used for consistent tab key cell movement. + */ +TableEditor.prototype.keyDown = function (evt) { + var doc = this, + wym = WYMeditor.INSTANCES[doc.title], + tableEditor = wym.tableEditor; + + if (evt.which === WYMeditor.KEY_CODE.TAB) { + return tableEditor.selectNextCell(wym.selectedContainer()); + } + + return null; +}; + +/** + * Move the focus to the next cell. + */ +TableEditor.prototype.selectNextCell = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + cell = wym.findUp(elmnt, ['td', 'th']), + nextCells, + tr, + nextRows; + + if (cell === null) { + return null; + } + + // Try moving to the next cell to the right + nextCells = jQuery(cell).next('td,th'); + if (nextCells.length > 0) { + tableEditor.selectElement(nextCells[0]); + return false; + } + + // There was no cell to the right, use the first cell in the next row + tr = wym.findUp(cell, 'tr'); + nextRows = jQuery(tr).next('tr'); + if (nextRows.length !== 0) { + nextCells = jQuery(nextRows).children('td,th'); + if (nextCells.length > 0) { + tableEditor.selectElement(nextCells[0]); + return false; + } + } + + // There is no next row. Do a normal tab + return null; +}; + +/** + * Select the given element using rangy selectors. + */ +TableEditor.prototype.selectElement = function (elmnt) { + var tableEditor = this, + wym = tableEditor._wym, + sel = wym.selection(), + range = rangy.createRange(wym._doc); + + range.setStart(elmnt, 0); + range.setEnd(elmnt, 0); + range.collapse(false); + + try { + sel.setSingleRange(range); + } catch (err) { + // ie8 can raise an "unkown runtime error" trying to empty the range + } + // Old IE selection hack + if (WYMeditor.isInternetExplorerPre11()) { + wym._saveCaret(); + } +}; + +/** + * Get the common parent tr for the given table cell nodes. If the closest + * parent tr for each cell isn't the same, returns null. + */ +TableEditor.prototype.getCommonParentTr = function (cells) { + var firstCell, + parentTrList, + rootTr; + + cells = jQuery(cells).filter('td,th'); + if (cells.length === 0) { + return null; + } + firstCell = cells[0]; + parentTrList = jQuery(firstCell).parent('tr'); + + if (parentTrList.length === 0) { + return null; + } + rootTr = parentTrList[0]; + + // Ensure that all of the cells have the same parent tr + jQuery(cells).each(function (index, elmnt) { + parentTrList = jQuery(elmnt).parent('tr'); + if (parentTrList.length === 0 || parentTrList[0] !== rootTr) { + return null; + } + }); + + return rootTr; +}; diff --git a/static-files/journal/wymeditor/plugins/table/table_delete_column.png b/static-files/journal/wymeditor/plugins/table/table_delete_column.png new file mode 100644 index 0000000..9022d68 Binary files /dev/null and b/static-files/journal/wymeditor/plugins/table/table_delete_column.png differ diff --git a/static-files/journal/wymeditor/plugins/table/table_delete_row.png b/static-files/journal/wymeditor/plugins/table/table_delete_row.png new file mode 100644 index 0000000..f9d956f Binary files /dev/null and b/static-files/journal/wymeditor/plugins/table/table_delete_row.png differ diff --git a/static-files/journal/wymeditor/plugins/table/table_insert_column.png b/static-files/journal/wymeditor/plugins/table/table_insert_column.png new file mode 100644 index 0000000..49226ec Binary files /dev/null and b/static-files/journal/wymeditor/plugins/table/table_insert_column.png differ diff --git a/static-files/journal/wymeditor/plugins/table/table_insert_row.png b/static-files/journal/wymeditor/plugins/table/table_insert_row.png new file mode 100644 index 0000000..da435c3 Binary files /dev/null and b/static-files/journal/wymeditor/plugins/table/table_insert_row.png differ diff --git a/static-files/journal/wymeditor/plugins/table/table_join_row.png b/static-files/journal/wymeditor/plugins/table/table_join_row.png new file mode 100644 index 0000000..70e5983 Binary files /dev/null and b/static-files/journal/wymeditor/plugins/table/table_join_row.png differ diff --git a/static-files/journal/wymeditor/popup.html b/static-files/journal/wymeditor/popup.html new file mode 100644 index 0000000..0b4f522 --- /dev/null +++ b/static-files/journal/wymeditor/popup.html @@ -0,0 +1 @@ + diff --git a/static-files/journal/wymeditor/skins/seamless/icons.png b/static-files/journal/wymeditor/skins/seamless/icons.png new file mode 100644 index 0000000..c6eb463 Binary files /dev/null and b/static-files/journal/wymeditor/skins/seamless/icons.png differ diff --git a/static-files/journal/wymeditor/skins/seamless/skin.css b/static-files/journal/wymeditor/skins/seamless/skin.css new file mode 100644 index 0000000..c48d618 --- /dev/null +++ b/static-files/journal/wymeditor/skins/seamless/skin.css @@ -0,0 +1,306 @@ +/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ +.wym_skin_seamless p, +.wym_skin_seamless h2, +.wym_skin_seamless h3, +.wym_skin_seamless ul, +.wym_skin_seamless li { + background: transparent url(); + margin: 0; + padding: 0; + border-width: 0; + list-style: none; +} + +/*HIDDEN BY DEFAULT*/ +.wym_skin_seamless .wym_area_left { + display: none; +} +.wym_skin_seamless .wym_area_right { + display: block; +} + +/*TYPOGRAPHY*/ +.wym_skin_seamless { + font-size: 62.5%; + font-family: Verdana, Arial, sans-serif; +} +.wym_skin_seamless h2 { + font-size: 110%; /* = 11px */ +} +.wym_skin_seamless h3 { + font-size: 100%; /* = 10px */ +} +.wym_skin_seamless li { + font-size: 100%; /* = 10px */ +} + +/*WYM_BOX*/ +.wym_box { + margin: 0; + overflow: visible; + width: 98%; +} +.wym_skin_seamless { + border-style: none; + padding: 1px; +} + +/*WYM_HTML*/ +.wym_skin_seamless .wym_html { + width: 98%; +} +.wym_skin_seamless .wym_html textarea { + width: 100%; + height: 200px; + border: 1px solid gray; + background: white; +} + +/* Top controls */ +.wym_skin_seamless .wym_area_top { + width: 802px; + margin-left: auto; + margin-right: auto; + height: 24px; +} +.wym_skin_seamless .wym_area_top_affix_placeholder { + margin: 0px; + padding: 0px; +} +.wym_skin_seamless .affix { + position: fixed; + top: 0px; + width: 100%; + background: white; +} + +/*WYM_IFRAME*/ +.wym_skin_seamless .wym_iframe { + width: 802px; + margin-left: auto; + margin-right: auto; +} +.wym_skin_seamless .wym_iframe iframe { + width: 100%; + /* Don't set a height. That will be dynamic based on the content. */ + border-style: none; + background: white; + display: block; + vertical-align: bottom; +} + +/*AREAS*/ +.wym_skin_seamless .wym_area_left { + width: 150px; + float: left; +} +.wym_skin_seamless .wym_area_right { + width: 150px; + float: right; +} +.wym_skin_seamless .wym_area_bottom { + height: 1%; + clear: both; +} + +/*SECTIONS SYSTEM*/ +/*common defaults for all sections*/ +.wym_skin_seamless .wym_section { + margin-bottom: 5px; +} +.wym_skin_seamless .wym_section h2, +.wym_skin_seamless .wym_section h3 { + padding: 1px 3px; + margin: 0; +} +.wym_skin_seamless .wym_section a { + display: block; + text-decoration: none; + color: black; +} +.wym_skin_seamless .wym_section a:hover { + background-color: yellow; +} +/*hide section titles by default*/ +.wym_skin_seamless .wym_section h2 { + display: none; +} +/*disable any margin-collapse*/ +.wym_skin_seamless .wym_section { + padding-top: 1px; + padding-bottom: 1px; +} + +/*option: add this class to a section to make it render as a panel*/ +.wym_skin_seamless .wym_panel { +} +.wym_skin_seamless .wym_panel h2 { + display: block; +} + +/*option: add this class to a section to make it render as a dropdown menu*/ +.wym_skin_seamless .wym_dropdown { + padding: 0; + background: #ddd; + border: solid gray; + margin-right: 10px; + width: 110px; + float: left; + border-width: 1px 1px 1px 1px; +} +.wym_skin_seamless .wym_dropdown h2 { + display: block; + font-size: 2.0em; + line-height: 20px; +} +.wym_skin_seamless .wym_dropdown ul { + display: none; + position: absolute; + background: white; + font-size: 1.7em; + /* If there's a top margin, we hit a gap and break the hover + * when scrolling down */ + margin-top: 0px; + margin-left: -1px; + padding: 5px 10px 5px 3px; +} +.wym_skin_seamless .wym_dropdown:hover ul, +.wym_skin_seamless .wym_dropdown.hover ul { + display: block; +} +.wym_skin_seamless .wym_dropdown li { + width: 120px; +} + +/* option: add this class to a section to make its elements render buttons + (icons are only available for the wym_tools section for now) + */ +.wym_skin_seamless .wym_buttons { + margin-right: 5px; + float: left; +} +.wym_skin_seamless .wym_buttons li { + float:left; +} +.wym_skin_seamless .wym_buttons a { + width: 20px; + height: 20px; + overflow: hidden; + padding: 2px; +} +/*image replacements*/ +.wym_skin_seamless .wym_buttons li a { + background: url(icons.png) no-repeat; + text-indent: -9999px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_strong a { + background-position: 0 -382px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_emphasis a { + background-position: 0 -22px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_superscript a { + background-position: 0 -430px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_subscript a { + background-position: 0 -454px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_ordered_list a { + background-position: 0 -48px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_unordered_list a { + background-position: 0 -72px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_indent a { + background-position: 0 -574px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_outdent a { + background-position: 0 -598px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_undo a { + background-position: 0 -502px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_redo a { + background-position: 0 -526px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_link a { + background-position: 0 -96px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_unlink a { + background-position: 0 -168px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_image a { + background-position: 0 -121px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_table a { + background-position: 0 -144px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_paste a { + background-position: 0 -552px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_html a { + background-position: 0 -193px; +} +.wym_skin_seamless .wym_buttons li.wym_tools_preview a { + background-position: 0 -408px; +} + +/*DECORATION*/ +.wym_skin_seamless .wym_panel { + padding: 0; + border: solid gray; + border-width: 1px; + background: white; +} +.wym_skin_seamless .wym_panel ul { + margin: 2px 0 5px; +} + +/*DIALOGS*/ +.wym_dialog div.row { + margin-bottom: 5px; +} +.wym_dialog div.row input { + margin-right: 5px; +} +.wym_dialog div.row label { + float: left; + width: 120px; + display: block; + text-align: right; + margin-right: 10px; +} +.wym_dialog div.row-indent { + padding-left: 160px; +} +/*autoclearing*/ +.wym_dialog div.row:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.wym_dialog div.row { + display: inline-block; +} +/* Hides from IE-mac \*/ +* html .wym_dialog div.row { + height: 1%; +} +.wym_dialog div.row { + display: block; +} +/* End hide from IE-mac */ + +/*WYMEDITOR_LINK*/ +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; +} diff --git a/static-files/journal/wymeditor/skins/wymeditor_icon.png b/static-files/journal/wymeditor/skins/wymeditor_icon.png new file mode 100644 index 0000000..d4fc155 Binary files /dev/null and b/static-files/journal/wymeditor/skins/wymeditor_icon.png differ -- cgit v1.2.3