bootstrap-wysihtml5-rails 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bootstrap-rails.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Bootstrap Wysihtml5 for Rails
2
+
3
+ Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.
4
+ It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
5
+
6
+ http://twitter.github.com/bootstrap/
7
+
8
+ Bootstrap Wysihtml5 is a plugin for Bootstrap designed by James Hollingworth. It provides a stylish wysiwyg editor for Bootstrap.
9
+
10
+ https://github.com/jhollingworth/bootstrap-wysihtml5
11
+
12
+ bootstrap-wysihtml5-rails project integrates it with Rails 3 assets pipeline.
13
+
14
+ http://github.com/Nerian/bootstrap-wysihtml5
15
+
16
+
17
+ ## Rails > 3.1
18
+ Include bootstrap-wysihtml5-rails in Gemfile;
19
+
20
+ ``` ruby
21
+ gem 'bootstrap-wysihtml5-rails'
22
+ ```
23
+
24
+ or you can install from latest build;
25
+
26
+ ``` ruby
27
+ gem 'bootstrap-wysihtml5-rails', :require => 'bootstrap-wysihtml5-rails',
28
+ :git => 'git://github.com/Nerian/bootstrap-wysihtml5-rails.git'
29
+ ```
30
+
31
+ and run bundle install.
32
+
33
+ ## Stylesheets
34
+
35
+ Add necessary stylesheet file to app/assets/stylesheets/application.css
36
+
37
+ ``` css
38
+ *= require bootstrap-wysihtml5
39
+ ```
40
+
41
+ ## Javascripts
42
+
43
+ Add necessary javascript(s) files to app/assets/javascripts/application.js
44
+
45
+ ``` javascript
46
+ //= require wysihtml5
47
+ //= require bootstrap-wysihtml5
48
+ ```
49
+
50
+ ## Using bootstrap-wysihtml5-rails
51
+
52
+ Just call wysihtml5() with any selector.
53
+
54
+ ```html
55
+ <textarea id="some-textarea" placeholder="Enter text ..."></textarea>
56
+
57
+ <script type="text/javascript">
58
+ $('#some-textarea').wysihtml5();
59
+ </script>
60
+ ```
61
+
62
+ ## License
63
+ Copyright (c) 2011 Gonzalo Rodríguez-Baltanás Díaz
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
67
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env rake
2
+ require File.expand_path('../lib/bootstrap-wysihtml5-rails/version', __FILE__)
3
+
4
+ desc "Build the gem"
5
+ task "build" do
6
+ system("gem build bootstrap-wysihtml5-rails.gemspec")
7
+ end
8
+
9
+ desc "Publish the gem"
10
+ task 'publish' do
11
+ system("gem push bootstrap-wysihtml5-rails-#{BootstrapWysihtml5Rails::Rails::VERSION}.gem")
12
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/bootstrap-wysihtml5-rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Gonzalo Rodríguez-Baltanás Díaz"]
6
+ gem.email = ["siotopo@gmail.com"]
7
+ gem.description = %q{A wysiwyg text editor for Twitter Bootstrap}
8
+ gem.homepage = "https://github.com/Nerian/bootstrap-datepicker-rails"
9
+ gem.summary = gem.description
10
+
11
+ gem.name = "bootstrap-wysihtml5-rails"
12
+ gem.require_paths = ["lib"]
13
+ gem.files = `git ls-files`.split("\n")
14
+ gem.version = BootstrapWysihtml5Rails::Rails::VERSION
15
+
16
+ gem.add_dependency "railties", ">= 3.0"
17
+ gem.add_development_dependency "bundler", ">= 1.0"
18
+ gem.add_development_dependency "rake"
19
+ end
@@ -0,0 +1,12 @@
1
+ require "rails"
2
+ require "bootstrap-wysihtml5-rails/version"
3
+
4
+ module BootstrapWysihtml5Rails
5
+ module Rails
6
+ if ::Rails.version < "3.1"
7
+ require "bootstrap-wysihtml5-rails/railtie"
8
+ else
9
+ require "bootstrap-wysihtml5-rails/engine"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ module BootstrapWysihtml5Rails
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapWysihtml5Rails
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie; end
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapWysihtml5Rails
2
+ module Rails
3
+ VERSION = "0.1"
4
+ end
5
+ end
@@ -0,0 +1,99 @@
1
+ !function($, wysi) {
2
+ "use strict"
3
+
4
+ var templates = {
5
+ "font-styles": "<li class='dropdown'>" +
6
+ "<a class='btn dropdown-toggle' data-toggle='dropdown' href='#'>" +
7
+ "<i class='icon-font'></i>&nbsp;<span class='current-font'>Normal text</span>&nbsp;<b class='caret'></b>" +
8
+ "</a>" +
9
+ "<ul class='dropdown-menu'>" +
10
+ "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div'>Normal text</a></li>" +
11
+ "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1'>Heading 1</a></li>" +
12
+ "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2'>Heading 2</a></li>" +
13
+ "</ul>" +
14
+ "</li>",
15
+ "emphasis": "<li>" +
16
+ "<div class='btn-group'>" +
17
+ "<a class='btn' data-wysihtml5-command='bold' title='CTRL+B'>Bold</a>" +
18
+ "<a class='btn' data-wysihtml5-command='italic' title='CTRL+I'>Italic</a>" +
19
+ "</div>" +
20
+ "</li>",
21
+ "lists": "<li>" +
22
+ "<div class='btn-group'>" +
23
+ "<a class='btn' data-wysihtml5-command='insertUnorderedList'><i class='icon-list'></i></a>" +
24
+ "<a class='btn' data-wysihtml5-command='insertOrderedList'><i class='icon-th-list'></i></a>" +
25
+ "</div>" +
26
+ "</li>"
27
+ };
28
+
29
+ var defaultOptions = {
30
+ "font-styles": true,
31
+ "emphasis": true,
32
+ "lists": true
33
+ };
34
+
35
+ var Wysihtml5 = function(el, options) {
36
+ this.el = el;
37
+ this.toolbar = this.createToolbar(el, options || defaultOptions);
38
+ this.editor = new wysi.Editor(this.el.attr('id'), {
39
+ toolbar: this.toolbar.attr('id')
40
+ });
41
+
42
+ $('iframe.wysihtml5-sandbox').each(function(i, el){
43
+ $(el.contentWindow).off('focus.wysihtml5').on({
44
+ 'focus.wysihtml5' : function(){
45
+ $('li.dropdown').removeClass('open');
46
+ }
47
+ });
48
+ });
49
+ };
50
+
51
+ Wysihtml5.prototype = {
52
+ constructor: Wysihtml5,
53
+
54
+ createToolbar: function(el, options) {
55
+ var toolbar = $("<ul/>", {
56
+ id : el.attr('id') + "-wysihtml5-toolbar",
57
+ class : "wysihtml5-toolbar",
58
+ style: "display:none"
59
+ }).button();
60
+
61
+ for(var key in defaultOptions) {
62
+ var value;
63
+
64
+ if(options[key] != undefined) {
65
+ if(options[key] == true) {
66
+ value = true;
67
+ }
68
+ } else {
69
+ value = defaultOptions[key];
70
+ }
71
+
72
+ if(value == true) {
73
+ toolbar.append(templates[key]);
74
+ }
75
+ }
76
+
77
+ var self = this;
78
+
79
+ toolbar.find("a[data-wysihtml5-command='formatBlock']").click(function(e) {
80
+ var el = $(e.srcElement);
81
+ self.toolbar.find('.current-font').text(el.html())
82
+ });
83
+
84
+ this.el.before(toolbar);
85
+
86
+ return toolbar;
87
+ }
88
+ };
89
+
90
+ $.fn.wysihtml5 = function (options) {
91
+ return this.each(function () {
92
+ var $this = $(this);
93
+ $this.data('wysihtml5', new Wysihtml5($this, options));
94
+ })
95
+ };
96
+
97
+ $.fn.wysihtml5.Constructor = Wysihtml5;
98
+
99
+ }(window.jQuery, window.wysihtml5);
@@ -0,0 +1,258 @@
1
+ /*
2
+ wysihtml5 v0.3.0_rc1
3
+ https://github.com/xing/wysihtml5
4
+
5
+ Author: Christopher Blum (https://github.com/tiff)
6
+
7
+ Copyright (C) 2011 XING AG
8
+ Licensed under GNU General Public License
9
+
10
+ Rangy, a cross-browser JavaScript range and selection library
11
+ http://code.google.com/p/rangy/
12
+
13
+ Copyright 2011, Tim Down
14
+ Licensed under the MIT license.
15
+ Version: 1.2.2
16
+ Build date: 13 November 2011
17
+ */
18
+ var wysihtml5={version:"0.3.0_rc1",commands:{},dom:{},quirks:{},toolbar:{},lang:{},selection:{},views:{},INVISIBLE_SPACE:"\ufeff",EMPTY_FUNCTION:function(){},ELEMENT_NODE:1,TEXT_NODE:3,BACKSPACE_KEY:8,ENTER_KEY:13,ESCAPE_KEY:27,SPACE_KEY:32,DELETE_KEY:46};
19
+ window.rangy=function(){function a(a,b){var c=typeof a[b];return c==k||!!(c==j&&a[b])||"unknown"==c}function c(a,b){return!!(typeof a[b]==j&&a[b])}function b(a,b){return typeof a[b]!=i}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&&m(a,s)&&x(a,q)}function f(a){window.alert("Rangy not supported in your browser. Reason: "+a);o.initialized=!0;o.supported=!1}function h(){if(!o.initialized){var b,d=!1,i=!1;a(document,"createRange")&&
20
+ (b=document.createRange(),m(b,p)&&x(b,n)&&(d=!0),b.detach());if((b=c(document,"body")?document.body:document.getElementsByTagName("body")[0])&&a(b,"createTextRange"))b=b.createTextRange(),e(b)&&(i=!0);!d&&!i&&f("Neither Range nor TextRange are implemented");o.initialized=!0;o.features={implementsDomRange:d,implementsTextRange:i};d=w.concat(z);i=0;for(b=d.length;i<b;++i)try{d[i](o)}catch(j){c(window,"console")&&a(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",
21
+ j)}}}function g(a){this.name=a;this.supported=this.initialized=!1}var j="object",k="function",i="undefined",n="startContainer,startOffset,endContainer,endOffset,collapsed,commonAncestorContainer,START_TO_START,START_TO_END,END_TO_START,END_TO_END".split(","),p="setStart,setStartBefore,setStartAfter,setEnd,setEndBefore,setEndAfter,collapse,selectNode,selectNodeContents,compareBoundaryPoints,deleteContents,extractContents,cloneContents,insertNode,surroundContents,cloneRange,toString,detach".split(","),
22
+ q="boundingHeight,boundingLeft,boundingTop,boundingWidth,htmlText,text".split(","),s="collapse,compareEndPoints,duplicate,getBookmark,moveToBookmark,moveToElementText,parentElement,pasteHTML,select,setEndPoint,getBoundingClientRect".split(","),m=d(a),r=d(c),x=d(b),o={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:a,isHostObject:c,isHostProperty:b,areHostMethods:m,areHostObjects:r,areHostProperties:x,isTextRange:e},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};
23
+ o.fail=f;o.warn=function(a){a="Rangy warning: "+a;o.config.alertOnWarn?window.alert(a):typeof window.console!=i&&typeof window.console.log!=i&&window.console.log(a)};({}).hasOwnProperty?o.util.extend=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}:f("hasOwnProperty not supported");var z=[],w=[];o.init=h;o.addInitListener=function(a){o.initialized?a(o):z.push(a)};var y=[];o.addCreateMissingNativeApiListener=function(a){y.push(a)};o.createMissingNativeApi=function(a){a=a||window;h();
24
+ for(var b=0,c=y.length;b<c;++b)y[b](a)};g.prototype.fail=function(a){this.initialized=!0;this.supported=!1;throw Error("Module '"+this.name+"' failed to load: "+a);};g.prototype.warn=function(a){o.warn("Module "+this.name+": "+a)};g.prototype.createError=function(a){return Error("Error in Rangy "+this.name+" module: "+a)};o.createModule=function(a,b){var c=new g(a);o.modules[a]=c;w.push(function(a){b(a,c);c.initialized=!0;c.supported=!0})};o.requireModules=function(a){for(var b=0,c=a.length,d,i;b<
25
+ c;++b){i=a[b];d=o.modules[i];if(!d||!(d instanceof g))throw Error("Module '"+i+"' not found");if(!d.supported)throw Error("Module '"+i+"' not supported");}};var A=!1,r=function(){A||(A=!0,o.initialized||h())};if(typeof window==i)f("No window found");else if(typeof document==i)f("No document found");else return a(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",r,!1),a(window,"addEventListener")?window.addEventListener("load",r,!1):a(window,"attachEvent")?window.attachEvent("onload",
26
+ r):f("Window does not have required addEventListener or attachEvent method"),o}();
27
+ rangy.createModule("DomUtil",function(a,c){function b(a){for(var b=0;a=a.previousSibling;)b++;return b}function d(a,b){var c=[],d;for(d=a;d;d=d.parentNode)c.push(d);for(d=b;d;d=d.parentNode)if(m(c,d))return d;return null}function e(a,b,c){for(c=c?a:a.parentNode;c;){a=c.parentNode;if(a===b)return c;c=a}return null}function f(a){a=a.nodeType;return 3==a||4==a||8==a}function h(a,b){var c=b.nextSibling,d=b.parentNode;c?d.insertBefore(a,c):d.appendChild(a);return a}function g(a){if(9==a.nodeType)return a;
28
+ if(typeof a.ownerDocument!=p)return a.ownerDocument;if(typeof a.document!=p)return a.document;if(a.parentNode)return g(a.parentNode);throw Error("getDocument: no document found for node");}function j(a){return!a?"[No node]":f(a)?'"'+a.data+'"':1==a.nodeType?"<"+a.nodeName+(a.id?' id="'+a.id+'"':"")+">["+a.childNodes.length+"]":a.nodeName}function k(a){this._next=this.root=a}function i(a,b){this.node=a;this.offset=b}function n(a){this.code=this[a];this.codeName=a;this.message="DOMException: "+this.codeName}
29
+ var p="undefined",q=a.util;q.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||c.fail("document missing a Node creation method");q.isHostMethod(document,"getElementsByTagName")||c.fail("document missing getElementsByTagName method");var s=document.createElement("div");q.areHostMethods(s,["insertBefore","appendChild","cloneNode"])||c.fail("Incomplete Element implementation");q.isHostProperty(s,"innerHTML")||c.fail("Element is missing innerHTML property");s=document.createTextNode("test");
30
+ q.areHostMethods(s,["splitText","deleteData","insertData","appendData","cloneNode"])||c.fail("Incomplete Text Node implementation");var m=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1};k.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next,b;if(this._current){b=a.firstChild;if(!b)for(b=null;a!==this.root&&!(b=a.nextSibling);)a=a.parentNode;this._next=b}return this._current},detach:function(){this._current=this._next=this.root=
31
+ null}};i.prototype={equals:function(a){return this.node===a.node&this.offset==a.offset},inspect:function(){return"[DomPosition("+j(this.node)+":"+this.offset+")]"}};n.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};n.prototype.toString=function(){return this.message};a.dom={arrayContains:m,isHtmlNamespace:function(a){var b;return typeof a.namespaceURI==p||null===(b=a.namespaceURI)||"http://www.w3.org/1999/xhtml"==
32
+ b},parentElement:function(a){a=a.parentNode;return 1==a.nodeType?a:null},getNodeIndex:b,getNodeLength:function(a){var b;return f(a)?a.length:(b=a.childNodes)?b.length:0},getCommonAncestor:d,isAncestorOf:function(a,b,c){for(b=c?b:b.parentNode;b;){if(b===a)return!0;b=b.parentNode}return!1},getClosestAncestorIn:e,isCharacterDataNode:f,insertAfter:h,splitDataNode:function(a,b){var c=a.cloneNode(!1);c.deleteData(0,b);a.deleteData(b,a.length-b);h(c,a);return c},getDocument:g,getWindow:function(a){a=g(a);
33
+ if(typeof a.defaultView!=p)return a.defaultView;if(typeof a.parentWindow!=p)return a.parentWindow;throw Error("Cannot get a window object for node");},getIframeWindow:function(a){if(typeof a.contentWindow!=p)return a.contentWindow;if(typeof a.contentDocument!=p)return a.contentDocument.defaultView;throw Error("getIframeWindow: No Window object found for iframe element");},getIframeDocument:function(a){if(typeof a.contentDocument!=p)return a.contentDocument;if(typeof a.contentWindow!=p)return a.contentWindow.document;
34
+ throw Error("getIframeWindow: No Document object found for iframe element");},getBody:function(a){return q.isHostObject(a,"body")?a.body:a.getElementsByTagName("body")[0]},getRootContainer:function(a){for(var b;b=a.parentNode;)a=b;return a},comparePoints:function(a,c,i,j){var k;if(a==i)return c===j?0:c<j?-1:1;if(k=e(i,a,!0))return c<=b(k)?-1:1;if(k=e(a,i,!0))return b(k)<j?-1:1;c=d(a,i);a=a===c?c:e(a,c,!0);i=i===c?c:e(i,c,!0);if(a===i)throw Error("comparePoints got to case 4 and childA and childB are the same!");
35
+ for(c=c.firstChild;c;){if(c===a)return-1;if(c===i)return 1;c=c.nextSibling}throw Error("Should not be here!");},inspectNode:j,fragmentFromNodeChildren:function(a){for(var b=g(a).createDocumentFragment(),c;c=a.firstChild;)b.appendChild(c);return b},createIterator:function(a){return new k(a)},DomPosition:i};a.DOMException=n});
36
+ rangy.createModule("DomRange",function(a){function c(a,b){return 3!=a.nodeType&&(l.isAncestorOf(a,b.startContainer,!0)||l.isAncestorOf(a,b.endContainer,!0))}function b(a){return l.getDocument(a.startContainer)}function d(a,b,c){if(b=a._listeners[b])for(var d=0,i=b.length;d<i;++d)b[d].call(a,{target:a,args:c})}function e(a){return new u(a.parentNode,l.getNodeIndex(a))}function f(a){return new u(a.parentNode,l.getNodeIndex(a)+1)}function h(a,b,c){var d=11==a.nodeType?a.firstChild:a;l.isCharacterDataNode(b)?
37
+ 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]);return d}function g(a){for(var c,d,i=b(a.range).createDocumentFragment();d=a.next();){c=a.isPartiallySelectedSubtree();d=d.cloneNode(!c);c&&(c=a.getSubtreeIterator(),d.appendChild(g(c)),c.detach(!0));if(10==d.nodeType)throw new B("HIERARCHY_REQUEST_ERR");i.appendChild(d)}return i}function j(a,b,c){for(var d,i,c=c||{stop:!1};d=a.next();)if(a.isPartiallySelectedSubtree())if(!1===
38
+ b(d)){c.stop=!0;break}else{if(d=a.getSubtreeIterator(),j(d,b,c),d.detach(!0),c.stop)break}else for(d=l.createIterator(d);i=d.next();)if(!1===b(i)){c.stop=!0;return}}function k(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),k(b),b.detach(!0)):a.remove()}function i(a){for(var c,d=b(a.range).createDocumentFragment(),j;c=a.next();){a.isPartiallySelectedSubtree()?(c=c.cloneNode(!1),j=a.getSubtreeIterator(),c.appendChild(i(j)),j.detach(!0)):a.remove();if(10==c.nodeType)throw new B("HIERARCHY_REQUEST_ERR");
39
+ d.appendChild(c)}return d}function n(a,b,c){var d=!(!b||!b.length),i,e=!!c;d&&(i=RegExp("^("+b.join("|")+")$"));var k=[];j(new q(a,!1),function(a){(!d||i.test(a.nodeType))&&(!e||c(a))&&k.push(a)});return k}function p(a){return"["+("undefined"==typeof a.getName?"Range":a.getName())+"("+l.inspectNode(a.startContainer)+":"+a.startOffset+", "+l.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function q(a,b){this.range=a;this.clonePartiallySelectedTextNodes=b;if(!a.collapsed){this.sc=a.startContainer;
40
+ 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)?this.sc.childNodes[this.so]:l.getClosestAncestorIn(this.sc,c,!0),this._last=this.ec===c&&!l.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:l.getClosestAncestorIn(this.ec,c,!0))}}function s(a){this.code=
41
+ this[a];this.codeName=a;this.message="RangeException: "+this.codeName}function m(a,b,c){this.nodes=n(a,b,c);this._next=this.nodes[0];this._position=0}function r(a){return function(b,c){for(var d,i=c?b:b.parentNode;i;){d=i.nodeType;if(l.arrayContains(a,d))return i;i=i.parentNode}return null}}function x(a,b){if($(a,b))throw new s("INVALID_NODE_TYPE_ERR");}function o(a){if(!a.startContainer)throw new B("INVALID_STATE_ERR");}function z(a,b){if(!l.arrayContains(b,a.nodeType))throw new s("INVALID_NODE_TYPE_ERR");
42
+ }function w(a,b){if(0>b||b>(l.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new B("INDEX_SIZE_ERR");}function y(a,b){if(O(a,!0)!==O(b,!0))throw new B("WRONG_DOCUMENT_ERR");}function A(a){if(aa(a,!0))throw new B("NO_MODIFICATION_ALLOWED_ERR");}function t(a,b){if(!a)throw new B(b);}function v(a){o(a);if(!l.arrayContains(G,a.startContainer.nodeType)&&!O(a.startContainer,!0)||!l.arrayContains(G,a.endContainer.nodeType)&&!O(a.endContainer,!0)||!(a.startOffset<=(l.isCharacterDataNode(a.startContainer)?
43
+ a.startContainer.length:a.startContainer.childNodes.length))||!(a.endOffset<=(l.isCharacterDataNode(a.endContainer)?a.endContainer.length:a.endContainer.childNodes.length)))throw Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")");}function D(){}function K(a){a.START_TO_START=Q;a.START_TO_END=U;a.END_TO_END=ba;a.END_TO_START=V;a.NODE_BEFORE=W;a.NODE_AFTER=X;a.NODE_BEFORE_AND_AFTER=Y;a.NODE_INSIDE=R}function F(a){K(a);K(a.prototype)}function E(a,b){return function(){v(this);
44
+ var c=this.startContainer,d=this.startOffset,i=this.commonAncestorContainer,e=new q(this,!0);c!==i&&(c=l.getClosestAncestorIn(c,i,!0),d=f(c),c=d.node,d=d.offset);j(e,A);e.reset();i=a(e);e.detach();b(this,c,d,c,d);return i}}function I(b,d,j){function h(a,b){return function(c){o(this);z(c,L);z(M(c),G);c=(a?e:f)(c);(b?n:g)(this,c.node,c.offset)}}function n(a,b,c){var i=a.endContainer,j=a.endOffset;if(b!==a.startContainer||c!==a.startOffset){if(M(b)!=M(i)||1==l.comparePoints(b,c,i,j))i=b,j=c;d(a,b,c,
45
+ i,j)}}function g(a,b,c){var i=a.startContainer,j=a.startOffset;if(b!==a.endContainer||c!==a.endOffset){if(M(b)!=M(i)||-1==l.comparePoints(b,c,i,j))i=b,j=c;d(a,i,j,b,c)}}b.prototype=new D;a.util.extend(b.prototype,{setStart:function(a,b){o(this);x(a,!0);w(a,b);n(this,a,b)},setEnd:function(a,b){o(this);x(a,!0);w(a,b);g(this,a,b)},setStartBefore:h(!0,!0),setStartAfter:h(!1,!0),setEndBefore:h(!0,!1),setEndAfter:h(!1,!1),collapse:function(a){v(this);a?d(this,this.startContainer,this.startOffset,this.startContainer,
46
+ this.startOffset):d(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){o(this);x(a,!0);d(this,a,0,a,l.getNodeLength(a))},selectNode:function(a){o(this);x(a,!1);z(a,L);var b=e(a),a=f(a);d(this,b.node,b.offset,a.node,a.offset)},extractContents:E(i,d),deleteContents:E(k,d),canSurroundContents:function(){v(this);A(this.startContainer);A(this.endContainer);var a=new q(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);a.detach();return!b},
47
+ detach:function(){j(this)},splitBoundaries:function(){v(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,i=this.endOffset,j=a===c;l.isCharacterDataNode(c)&&0<i&&i<c.length&&l.splitDataNode(c,i);l.isCharacterDataNode(a)&&0<b&&b<a.length&&(a=l.splitDataNode(a,b),j?(i-=b,c=a):c==a.parentNode&&i>=l.getNodeIndex(a)&&i++,b=0);d(this,a,b,c,i)},normalizeBoundaries:function(){v(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,i=this.endOffset,j=function(a){var b=
48
+ a.nextSibling;b&&b.nodeType==a.nodeType&&(c=a,i=a.length,a.appendData(b.data),b.parentNode.removeChild(b))},e=function(d){var j=d.previousSibling;if(j&&j.nodeType==d.nodeType){a=d;var e=d.length;b=j.length;d.insertData(0,j.data);j.parentNode.removeChild(j);a==c?(i+=b,c=a):c==d.parentNode&&(j=l.getNodeIndex(d),i==j?(c=d,i=e):i>j&&i--)}},k=!0;l.isCharacterDataNode(c)?c.length==i&&j(c):(0<i&&(k=c.childNodes[i-1])&&l.isCharacterDataNode(k)&&j(k),k=!this.collapsed);k?l.isCharacterDataNode(a)?0==b&&e(a):
49
+ b<a.childNodes.length&&(j=a.childNodes[b])&&l.isCharacterDataNode(j)&&e(j):(a=c,b=i);d(this,a,b,c,i)},collapseToPoint:function(a,b){o(this);x(a,!0);w(a,b);(a!==this.startContainer||b!==this.startOffset||a!==this.endContainer||b!==this.endOffset)&&d(this,a,b,a,b)}});F(b)}function N(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset;a.commonAncestorContainer=a.collapsed?a.startContainer:l.getCommonAncestor(a.startContainer,a.endContainer)}function J(a,b,c,i,j){var e=a.startContainer!==
50
+ b||a.startOffset!==c,k=a.endContainer!==i||a.endOffset!==j;a.startContainer=b;a.startOffset=c;a.endContainer=i;a.endOffset=j;N(a);d(a,"boundarychange",{startMoved:e,endMoved:k})}function C(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};N(this)}a.requireModules(["DomUtil"]);var l=a.dom,u=l.DomPosition,B=a.DOMException;q.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=
51
+ null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next;a&&(this._next=a!==this._last?a.nextSibling:null,l.isCharacterDataNode(a)&&this.clonePartiallySelectedTextNodes&&(a===this.ec&&(a=a.cloneNode(!0)).deleteData(this.eo,a.length-this.eo),this._current===this.sc&&(a=a.cloneNode(!0)).deleteData(0,this.so)));return a},remove:function(){var a=this._current,b,c;l.isCharacterDataNode(a)&&(a===this.sc||a===this.ec)?(b=a===this.sc?this.so:0,c=a===
52
+ this.ec?this.eo:a.length,b!=c&&a.deleteData(b,c-b)):a.parentNode&&a.parentNode.removeChild(a)},isPartiallySelectedSubtree:function(){return c(this._current,this.range)},getSubtreeIterator:function(){var a;if(this.isSingleCharacterDataNode)a=this.range.cloneRange(),a.collapse();else{a=new C(b(this.range));var c=this._current,d=c,i=0,j=c,e=l.getNodeLength(c);l.isAncestorOf(c,this.sc,!0)&&(d=this.sc,i=this.so);l.isAncestorOf(c,this.ec,!0)&&(j=this.ec,e=this.eo);J(a,d,i,j,e)}return new q(a,this.clonePartiallySelectedTextNodes)},
53
+ detach:function(a){a&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};s.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};s.prototype.toString=function(){return this.message};m.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){this._current=this._next;this._next=this.nodes[++this._position];return this._current},detach:function(){this._current=this._next=this.nodes=null}};var L=[1,3,4,5,
54
+ 7,8,10],G=[2,9,11],P=[1,3,4,5,7,8,10,11],H=[1,3,4,5,7,8],M=l.getRootContainer,O=r([9,11]),aa=r([5,6,10,12]),$=r([6,10,12]),Z=document.createElement("style"),S=!1;try{Z.innerHTML="<b>x</b>",S=3==Z.firstChild.nodeType}catch(ca){}a.features.htmlParsingConforms=S;var T="startContainer,startOffset,endContainer,endOffset,collapsed,commonAncestorContainer".split(","),Q=0,U=1,ba=2,V=3,W=0,X=1,Y=2,R=3;D.prototype={attachListener:function(a,b){this._listeners[a].push(b)},compareBoundaryPoints:function(a,b){v(this);
55
+ y(this.startContainer,b.startContainer);var c=a==V||a==Q?"start":"end",d=a==U||a==Q?"start":"end";return l.comparePoints(this[c+"Container"],this[c+"Offset"],b[d+"Container"],b[d+"Offset"])},insertNode:function(a){v(this);z(a,P);A(this.startContainer);if(l.isAncestorOf(a,this.startContainer,!0))throw new B("HIERARCHY_REQUEST_ERR");this.setStartBefore(h(a,this.startContainer,this.startOffset))},cloneContents:function(){v(this);var a,c;if(this.collapsed)return b(this).createDocumentFragment();if(this.startContainer===
56
+ this.endContainer&&l.isCharacterDataNode(this.startContainer))return a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),c=b(this).createDocumentFragment(),c.appendChild(a),c;c=new q(this,!0);a=g(c);c.detach();return a},canSurroundContents:function(){v(this);A(this.startContainer);A(this.endContainer);var a=new q(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);a.detach();return!b},surroundContents:function(a){z(a,H);if(!this.canSurroundContents())throw new s("BAD_BOUNDARYPOINTS_ERR");
57
+ 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(){v(this);for(var a=new C(b(this)),c=T.length,d;c--;)d=T[c],a[d]=this[d];return a},toString:function(){v(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=[],a=new q(this,!0);j(a,function(a){(3==
58
+ a.nodeType||4==a.nodeType)&&b.push(a.data)});a.detach();return b.join("")},compareNode:function(a){v(this);var b=a.parentNode,c=l.getNodeIndex(a);if(!b)throw new B("NOT_FOUND_ERR");a=this.comparePoint(b,c);b=this.comparePoint(b,c+1);return 0>a?0<b?Y:W:0<b?X:R},comparePoint:function(a,b){v(this);t(a,"HIERARCHY_REQUEST_ERR");y(a,this.startContainer);return 0>l.comparePoints(a,b,this.startContainer,this.startOffset)?-1:0<l.comparePoints(a,b,this.endContainer,this.endOffset)?1:0},createContextualFragment:S?
59
+ function(a){var b=this.startContainer,c=l.getDocument(b);if(!b)throw new B("INVALID_STATE_ERR");var d=null;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;return l.fragmentFromNodeChildren(d)}:function(a){o(this);var c=b(this).createElement("body");c.innerHTML=a;return l.fragmentFromNodeChildren(c)},toHtml:function(){v(this);
60
+ var a=b(this).createElement("div");a.appendChild(this.cloneContents());return a.innerHTML},intersectsNode:function(a,c){v(this);t(a,"NOT_FOUND_ERR");if(l.getDocument(a)!==b(this))return!1;var d=a.parentNode,i=l.getNodeIndex(a);t(d,"NOT_FOUND_ERR");var j=l.comparePoints(d,i,this.endContainer,this.endOffset),d=l.comparePoints(d,i+1,this.startContainer,this.startOffset);return c?0>=j&&0<=d:0>j&&0<d},isPointInRange:function(a,b){v(this);t(a,"HIERARCHY_REQUEST_ERR");y(a,this.startContainer);return 0<=
61
+ l.comparePoints(a,b,this.startContainer,this.startOffset)&&0>=l.comparePoints(a,b,this.endContainer,this.endOffset)},intersectsRange:function(a,c){v(this);if(b(a)!=b(this))throw new B("WRONG_DOCUMENT_ERR");var d=l.comparePoints(this.startContainer,this.startOffset,a.endContainer,a.endOffset),i=l.comparePoints(this.endContainer,this.endOffset,a.startContainer,a.startOffset);return c?0>=d&&0<=i:0>d&&0<i},intersection:function(a){if(this.intersectsRange(a)){var b=l.comparePoints(this.startContainer,
62
+ this.startOffset,a.startContainer,a.startOffset),c=l.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange();-1==b&&d.setStart(a.startContainer,a.startOffset);1==c&&d.setEnd(a.endContainer,a.endOffset);return d}return null},union:function(a){if(this.intersectsRange(a,!0)){var b=this.cloneRange();-1==l.comparePoints(a.startContainer,a.startOffset,this.startContainer,this.startOffset)&&b.setStart(a.startContainer,a.startOffset);1==l.comparePoints(a.endContainer,
63
+ a.endOffset,this.endContainer,this.endOffset)&&b.setEnd(a.endContainer,a.endOffset);return b}throw new s("Ranges do not intersect");},containsNode:function(a,b){return b?this.intersectsNode(a,!1):this.compareNode(a)==R},containsNodeContents:function(a){return 0<=this.comparePoint(a,0)&&0>=this.comparePoint(a,l.getNodeLength(a))},containsRange:function(a){return this.intersection(a).equals(a)},containsNodeText:function(a){var b=this.cloneRange();b.selectNode(a);var c=b.getNodes([3]);return 0<c.length?
64
+ (b.setStart(c[0],0),a=c.pop(),b.setEnd(a,a.length),a=this.containsRange(b),b.detach(),a):this.containsNodeContents(a)},createNodeIterator:function(a,b){v(this);return new m(this,a,b)},getNodes:function(a,b){v(this);return n(this,a,b)},getDocument:function(){return b(this)},collapseBefore:function(a){o(this);this.setEndBefore(a);this.collapse(!1)},collapseAfter:function(a){o(this);this.setStartAfter(a);this.collapse(!0)},getName:function(){return"DomRange"},equals:function(a){return C.rangesEqual(this,
65
+ a)},inspect:function(){return p(this)}};I(C,J,function(a){o(a);a.startContainer=a.startOffset=a.endContainer=a.endOffset=null;a.collapsed=a.commonAncestorContainer=null;d(a,"detach",null);a._listeners=null});a.rangePrototype=D.prototype;C.rangeProperties=T;C.RangeIterator=q;C.copyComparisonConstants=F;C.createPrototypeRange=I;C.inspect=p;C.getRangeDocument=b;C.rangesEqual=function(a,b){return a.startContainer===b.startContainer&&a.startOffset===b.startOffset&&a.endContainer===b.endContainer&&a.endOffset===
66
+ b.endOffset};a.DomRange=C;a.RangeException=s});
67
+ rangy.createModule("WrappedRange",function(a){function c(a,b,c,d){var h=a.duplicate();h.collapse(c);var g=h.parentElement();e.isAncestorOf(b,g,!0)||(g=b);if(!g.canHaveHTML)return new f(g.parentNode,e.getNodeIndex(g));var b=e.getDocument(g).createElement("span"),s,m=c?"StartToStart":"StartToEnd";do g.insertBefore(b,b.previousSibling),h.moveToElementText(b);while(0<(s=h.compareEndPoints(m,a))&&b.previousSibling);m=b.nextSibling;if(-1==s&&m&&e.isCharacterDataNode(m)){h.setEndPoint(c?"EndToStart":"EndToEnd",
68
+ a);if(/[\r\n]/.test(m.data)){g=h.duplicate();c=g.text.replace(/\r\n/g,"\r").length;for(c=g.moveStart("character",c);-1==g.compareEndPoints("StartToEnd",g);)c++,g.moveStart("character",1)}else c=h.text.length;g=new f(m,c)}else m=(d||!c)&&b.previousSibling,g=(c=(d||c)&&b.nextSibling)&&e.isCharacterDataNode(c)?new f(c,0):m&&e.isCharacterDataNode(m)?new f(m,m.length):new f(g,e.getNodeIndex(b));b.parentNode.removeChild(b);return g}function b(a,b){var c,d,h=a.offset,f=e.getDocument(a.node),g=f.body.createTextRange(),
69
+ m=e.isCharacterDataNode(a.node);m?(c=a.node,d=c.parentNode):(c=a.node.childNodes,c=h<c.length?c[h]:null,d=a.node);f=f.createElement("span");f.innerHTML="&#feff;";c?d.insertBefore(f,c):d.appendChild(f);g.moveToElementText(f);g.collapse(!b);d.removeChild(f);if(m)g[b?"moveStart":"moveEnd"]("character",h);return g}a.requireModules(["DomUtil","DomRange"]);var d,e=a.dom,f=e.DomPosition,h=a.DomRange;if(a.features.implementsDomRange&&(!a.features.implementsTextRange||!a.config.preferTextRange))(function(){function b(a){for(var c=
70
+ i.length,d;c--;)d=i[c],a[d]=a.nativeRange[d]}var c,i=h.rangeProperties,f;d=function(a){if(!a)throw Error("Range must be specified");this.nativeRange=a;b(this)};h.createPrototypeRange(d,function(a,b,c,d,i){var j=a.endContainer!==d||a.endOffset!=i;if(a.startContainer!==b||a.startOffset!=c||j)a.setEnd(d,i),a.setStart(b,c)},function(a){a.nativeRange.detach();a.detached=!0;for(var b=i.length,c;b--;)c=i[b],a[c]=null});c=d.prototype;c.selectNode=function(a){this.nativeRange.selectNode(a);b(this)};c.deleteContents=
71
+ function(){this.nativeRange.deleteContents();b(this)};c.extractContents=function(){var a=this.nativeRange.extractContents();b(this);return a};c.cloneContents=function(){return this.nativeRange.cloneContents()};c.surroundContents=function(a){this.nativeRange.surroundContents(a);b(this)};c.collapse=function(a){this.nativeRange.collapse(a);b(this)};c.cloneRange=function(){return new d(this.nativeRange.cloneRange())};c.refresh=function(){b(this)};c.toString=function(){return this.nativeRange.toString()};
72
+ var g=document.createTextNode("test");e.getBody(document).appendChild(g);var q=document.createRange();q.setStart(g,0);q.setEnd(g,0);try{q.setStart(g,1),c.setStart=function(a,c){this.nativeRange.setStart(a,c);b(this)},c.setEnd=function(a,c){this.nativeRange.setEnd(a,c);b(this)},f=function(a){return function(c){this.nativeRange[a](c);b(this)}}}catch(s){c.setStart=function(a,c){try{this.nativeRange.setStart(a,c)}catch(d){this.nativeRange.setEnd(a,c),this.nativeRange.setStart(a,c)}b(this)},c.setEnd=function(a,
73
+ c){try{this.nativeRange.setEnd(a,c)}catch(d){this.nativeRange.setStart(a,c),this.nativeRange.setEnd(a,c)}b(this)},f=function(a,c){return function(d){try{this.nativeRange[a](d)}catch(i){this.nativeRange[c](d),this.nativeRange[a](d)}b(this)}}}c.setStartBefore=f("setStartBefore","setEndBefore");c.setStartAfter=f("setStartAfter","setEndAfter");c.setEndBefore=f("setEndBefore","setStartBefore");c.setEndAfter=f("setEndAfter","setStartAfter");q.selectNodeContents(g);c.selectNodeContents=q.startContainer==
74
+ g&&q.endContainer==g&&0==q.startOffset&&q.endOffset==g.length?function(a){this.nativeRange.selectNodeContents(a);b(this)}:function(a){this.setStart(a,0);this.setEnd(a,h.getEndOffset(a))};q.selectNodeContents(g);q.setEnd(g,3);f=document.createRange();f.selectNodeContents(g);f.setEnd(g,4);f.setStart(g,2);c.compareBoundaryPoints=-1==q.compareBoundaryPoints(q.START_TO_END,f)&1==q.compareBoundaryPoints(q.END_TO_START,f)?function(a,b){b=b.nativeRange||b;a==b.START_TO_END?a=b.END_TO_START:a==b.END_TO_START&&
75
+ (a=b.START_TO_END);return this.nativeRange.compareBoundaryPoints(a,b)}:function(a,b){return this.nativeRange.compareBoundaryPoints(a,b.nativeRange||b)};a.util.isHostMethod(q,"createContextualFragment")&&(c.createContextualFragment=function(a){return this.nativeRange.createContextualFragment(a)});e.getBody(document).removeChild(g);q.detach();f.detach()})(),a.createNativeRange=function(a){return(a||document).createRange()};else if(a.features.implementsTextRange){d=function(a){this.textRange=a;this.refresh()};
76
+ d.prototype=new h(document);d.prototype.refresh=function(){var a,b,d=this.textRange;a=d.parentElement();var f=d.duplicate();f.collapse(!0);b=f.parentElement();f=d.duplicate();f.collapse(!1);d=f.parentElement();b=b==d?b:e.getCommonAncestor(b,d);b=b==a?b:e.getCommonAncestor(a,b);0==this.textRange.compareEndPoints("StartToEnd",this.textRange)?b=a=c(this.textRange,b,!0,!0):(a=c(this.textRange,b,!0,!1),b=c(this.textRange,b,!1,!1));this.setStart(a.node,a.offset);this.setEnd(b.node,b.offset)};h.copyComparisonConstants(d);
77
+ var g=function(){return this}();"undefined"==typeof g.Range&&(g.Range=d);a.createNativeRange=function(a){return(a||document).body.createTextRange()}}a.features.implementsTextRange&&(d.rangeToTextRange=function(a){if(a.collapsed)return b(new f(a.startContainer,a.startOffset),!0);var c=b(new f(a.startContainer,a.startOffset),!0),d=b(new f(a.endContainer,a.endOffset),!1),a=e.getDocument(a.startContainer).body.createTextRange();a.setEndPoint("StartToStart",c);a.setEndPoint("EndToEnd",d);return a});d.prototype.getName=
78
+ function(){return"WrappedRange"};a.WrappedRange=d;a.createRange=function(b){return new d(a.createNativeRange(b||document))};a.createRangyRange=function(a){return new h(a||document)};a.createIframeRange=function(b){return a.createRange(e.getIframeDocument(b))};a.createIframeRangyRange=function(b){return a.createRangyRange(e.getIframeDocument(b))};a.addCreateMissingNativeApiListener(function(b){b=b.document;"undefined"==typeof b.createRange&&(b.createRange=function(){return a.createRange(this)});b=
79
+ b=null})});
80
+ rangy.createModule("WrappedSelection",function(a,c){function b(a){return(a||window).getSelection()}function d(a){return(a||window).document.selection}function e(a,b,c){var d=c?"end":"start",c=c?"start":"end";a.anchorNode=b[d+"Container"];a.anchorOffset=b[d+"Offset"];a.focusNode=b[c+"Container"];a.focusOffset=b[c+"Offset"]}function f(a){a.anchorNode=a.focusNode=null;a.anchorOffset=a.focusOffset=0;a.rangeCount=0;a.isCollapsed=!0;a._ranges.length=0}function h(b){var c;b instanceof x?(c=b._selectionNativeRange,c||
81
+ (c=a.createNativeRange(m.getDocument(b.startContainer)),c.setEnd(b.endContainer,b.endOffset),c.setStart(b.startContainer,b.startOffset),b._selectionNativeRange=c,b.attachListener("detach",function(){this._selectionNativeRange=null}))):b instanceof o?c=b.nativeRange:a.features.implementsDomRange&&b instanceof m.getWindow(b.startContainer).Range&&(c=b);return c}function g(a){var b=a.getNodes(),c;a:if(!b.length||1!=b[0].nodeType)c=!1;else{c=1;for(var d=b.length;c<d;++c)if(!m.isAncestorOf(b[0],b[c])){c=
82
+ !1;break a}c=!0}if(!c)throw Error("getSingleElementFromRange: range "+a.inspect()+" did not consist of a single element");return b[0]}function j(a,b){var c=new o(b);a._ranges=[c];e(a,c,!1);a.rangeCount=1;a.isCollapsed=c.collapsed}function k(b){b._ranges.length=0;if("None"==b.docSelection.type)f(b);else{var c=b.docSelection.createRange();if(c&&"undefined"!=typeof c.text)j(b,c);else{b.rangeCount=c.length;for(var d,i=m.getDocument(c.item(0)),k=0;k<b.rangeCount;++k)d=a.createRange(i),d.selectNode(c.item(k)),
83
+ b._ranges.push(d);b.isCollapsed=1==b.rangeCount&&b._ranges[0].collapsed;e(b,b._ranges[b.rangeCount-1],!1)}}}function i(a,b){for(var c=a.docSelection.createRange(),d=g(b),i=m.getDocument(c.item(0)),i=m.getBody(i).createControlRange(),e=0,j=c.length;e<j;++e)i.add(c.item(e));try{i.add(d)}catch(f){throw Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}i.select();k(a)}function n(a,b,c){this.nativeSelection=a;this.docSelection=b;this._ranges=
84
+ [];this.win=c;this.refresh()}function p(a,b){for(var c=m.getDocument(b[0].startContainer),c=m.getBody(c).createControlRange(),d=0,i;d<rangeCount;++d){i=g(b[d]);try{c.add(i)}catch(e){throw Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}c.select();k(a)}function q(a,b){if(a.anchorNode&&m.getDocument(a.anchorNode)!==m.getDocument(b))throw new z("WRONG_DOCUMENT_ERR");}function s(a){var b=[],c=new w(a.anchorNode,a.anchorOffset),
85
+ d=new w(a.focusNode,a.focusOffset),i="function"==typeof a.getName?a.getName():"Selection";if("undefined"!=typeof a.rangeCount)for(var e=0,j=a.rangeCount;e<j;++e)b[e]=x.inspect(a.getRangeAt(e));return"["+i+"(Ranges: "+b.join(", ")+")(anchor: "+c.inspect()+", focus: "+d.inspect()+"]"}a.requireModules(["DomUtil","DomRange","WrappedRange"]);a.config.checkSelectionRanges=!0;var m=a.dom,r=a.util,x=a.DomRange,o=a.WrappedRange,z=a.DOMException,w=m.DomPosition,y,A,t=a.util.isHostMethod(window,"getSelection"),
86
+ v=a.util.isHostObject(document,"selection"),D=v&&(!t||a.config.preferTextRange);D?(y=d,a.isSelectionValid=function(a){var a=(a||window).document,b=a.selection;return"None"!=b.type||m.getDocument(b.createRange().parentElement())==a}):t?(y=b,a.isSelectionValid=function(){return!0}):c.fail("Neither document.selection or window.getSelection() detected.");a.getNativeSelection=y;var t=y(),K=a.createNativeRange(document),F=m.getBody(document),E=r.areHostObjects(t,r.areHostProperties(t,["anchorOffset","focusOffset"]));
87
+ a.features.selectionHasAnchorAndFocus=E;var I=r.isHostMethod(t,"extend");a.features.selectionHasExtend=I;var N="number"==typeof t.rangeCount;a.features.selectionHasRangeCount=N;var J=!1,C=!0;r.areHostMethods(t,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof t.rangeCount&&a.features.implementsDomRange&&function(){var a=document.createElement("iframe");F.appendChild(a);var b=m.getIframeDocument(a);b.open();b.write("<html><head></head><body>12</body></html>");b.close();var c=m.getIframeWindow(a).getSelection(),
88
+ d=b.documentElement.lastChild.firstChild,b=b.createRange();b.setStart(d,1);b.collapse(!0);c.addRange(b);C=1==c.rangeCount;c.removeAllRanges();var i=b.cloneRange();b.setStart(d,0);i.setEnd(d,2);c.addRange(b);c.addRange(i);J=2==c.rangeCount;b.detach();i.detach();F.removeChild(a)}();a.features.selectionSupportsMultipleRanges=J;a.features.collapsedNonEditableSelectionsSupported=C;var l=!1,u;F&&r.isHostMethod(F,"createControlRange")&&(u=F.createControlRange(),r.areHostProperties(u,["item","add"])&&(l=
89
+ !0));a.features.implementsControlRange=l;A=E?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:!1};var B;r.isHostMethod(t,"getRangeAt")?B=function(a,b){try{return a.getRangeAt(b)}catch(c){return null}}:E&&(B=function(b){var c=m.getDocument(b.anchorNode),c=a.createRange(c);c.setStart(b.anchorNode,b.anchorOffset);c.setEnd(b.focusNode,b.focusOffset);c.collapsed!==this.isCollapsed&&(c.setStart(b.focusNode,
90
+ b.focusOffset),c.setEnd(b.anchorNode,b.anchorOffset));return c});a.getSelection=function(a){var a=a||window,b=a._rangySelection,c=y(a),i=v?d(a):null;b?(b.nativeSelection=c,b.docSelection=i,b.refresh(a)):(b=new n(c,i,a),a._rangySelection=b);return b};a.getIframeSelection=function(b){return a.getSelection(m.getIframeWindow(b))};u=n.prototype;if(!D&&E&&r.areHostMethods(t,["removeAllRanges","addRange"])){u.removeAllRanges=function(){this.nativeSelection.removeAllRanges();f(this)};var L=function(b,c){var d=
91
+ x.getRangeDocument(c),d=a.createRange(d);d.collapseToPoint(c.endContainer,c.endOffset);b.nativeSelection.addRange(h(d));b.nativeSelection.extend(c.startContainer,c.startOffset);b.refresh()};u.addRange=N?function(b,c){if(l&&v&&"Control"==this.docSelection.type)i(this,b);else if(c&&I)L(this,b);else{var d;J?d=this.rangeCount:(this.removeAllRanges(),d=0);this.nativeSelection.addRange(h(b));this.rangeCount=this.nativeSelection.rangeCount;this.rangeCount==d+1?(a.config.checkSelectionRanges&&(d=B(this.nativeSelection,
92
+ this.rangeCount-1))&&!x.rangesEqual(d,b)&&(b=new o(d)),this._ranges[this.rangeCount-1]=b,e(this,b,H(this.nativeSelection)),this.isCollapsed=A(this)):this.refresh()}}:function(a,b){b&&I?L(this,a):(this.nativeSelection.addRange(h(a)),this.refresh())};u.setRanges=function(a){if(l&&1<a.length)p(this,a);else{this.removeAllRanges();for(var b=0,c=a.length;b<c;++b)this.addRange(a[b])}}}else if(r.isHostMethod(t,"empty")&&r.isHostMethod(K,"select")&&l&&D)u.removeAllRanges=function(){try{if(this.docSelection.empty(),
93
+ "None"!=this.docSelection.type){var a;if(this.anchorNode)a=m.getDocument(this.anchorNode);else if("Control"==this.docSelection.type){var b=this.docSelection.createRange();b.length&&(a=m.getDocument(b.item(0)).body.createTextRange())}a&&(a.body.createTextRange().select(),this.docSelection.empty())}}catch(c){}f(this)},u.addRange=function(a){"Control"==this.docSelection.type?i(this,a):(o.rangeToTextRange(a).select(),this._ranges[0]=a,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,e(this,
94
+ a,!1))},u.setRanges=function(a){this.removeAllRanges();var b=a.length;1<b?p(this,a):b&&this.addRange(a[0])};else return c.fail("No means of selecting a Range or TextRange was found"),!1;u.getRangeAt=function(a){if(0>a||a>=this.rangeCount)throw new z("INDEX_SIZE_ERR");return this._ranges[a]};var G;if(D)G=function(b){var c;a.isSelectionValid(b.win)?c=b.docSelection.createRange():(c=m.getBody(b.win.document).createTextRange(),c.collapse(!0));"Control"==b.docSelection.type?k(b):c&&"undefined"!=typeof c.text?
95
+ j(b,c):f(b)};else if(r.isHostMethod(t,"getRangeAt")&&"number"==typeof t.rangeCount)G=function(b){if(l&&v&&"Control"==b.docSelection.type)k(b);else if(b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount,b.rangeCount){for(var c=0,d=b.rangeCount;c<d;++c)b._ranges[c]=new a.WrappedRange(b.nativeSelection.getRangeAt(c));e(b,b._ranges[b.rangeCount-1],H(b.nativeSelection));b.isCollapsed=A(b)}else f(b)};else if(E&&"boolean"==typeof t.isCollapsed&&"boolean"==typeof K.collapsed&&a.features.implementsDomRange)G=
96
+ function(a){var b;b=a.nativeSelection;b.anchorNode?(b=B(b,0),a._ranges=[b],a.rangeCount=1,b=a.nativeSelection,a.anchorNode=b.anchorNode,a.anchorOffset=b.anchorOffset,a.focusNode=b.focusNode,a.focusOffset=b.focusOffset,a.isCollapsed=A(a)):f(a)};else return c.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;u.refresh=function(a){var b=a?this._ranges.slice(0):null;G(this);if(a){a=b.length;if(a!=this._ranges.length)return!1;for(;a--;)if(!x.rangesEqual(b[a],this._ranges[a]))return!1;
97
+ return!0}};var P=function(a,b){var c=a.getAllRanges(),d=!1;a.removeAllRanges();for(var i=0,e=c.length;i<e;++i)d||b!==c[i]?a.addRange(c[i]):d=!0;a.rangeCount||f(a)};u.removeRange=l?function(a){if("Control"==this.docSelection.type){for(var b=this.docSelection.createRange(),a=g(a),c=m.getDocument(b.item(0)),c=m.getBody(c).createControlRange(),d,i=!1,e=0,j=b.length;e<j;++e)d=b.item(e),d!==a||i?c.add(b.item(e)):i=!0;c.select();k(this)}else P(this,a)}:function(a){P(this,a)};var H;!D&&E&&a.features.implementsDomRange?
98
+ (H=function(a){var b=!1;a.anchorNode&&(b=1==m.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset));return b},u.isBackwards=function(){return H(this)}):H=u.isBackwards=function(){return!1};u.toString=function(){for(var a=[],b=0,c=this.rangeCount;b<c;++b)a[b]=""+this._ranges[b];return a.join("")};u.collapse=function(b,c){q(this,b);var d=a.createRange(m.getDocument(b));d.collapseToPoint(b,c);this.removeAllRanges();this.addRange(d);this.isCollapsed=!0};u.collapseToStart=function(){if(this.rangeCount){var a=
99
+ this._ranges[0];this.collapse(a.startContainer,a.startOffset)}else throw new z("INVALID_STATE_ERR");};u.collapseToEnd=function(){if(this.rangeCount){var a=this._ranges[this.rangeCount-1];this.collapse(a.endContainer,a.endOffset)}else throw new z("INVALID_STATE_ERR");};u.selectAllChildren=function(b){q(this,b);var c=a.createRange(m.getDocument(b));c.selectNodeContents(b);this.removeAllRanges();this.addRange(c)};u.deleteFromDocument=function(){if(l&&v&&"Control"==this.docSelection.type){for(var a=this.docSelection.createRange(),
100
+ b;a.length;)b=a.item(0),a.remove(b),b.parentNode.removeChild(b);this.refresh()}else if(this.rangeCount){a=this.getAllRanges();this.removeAllRanges();b=0;for(var c=a.length;b<c;++b)a[b].deleteContents();this.addRange(a[c-1])}};u.getAllRanges=function(){return this._ranges.slice(0)};u.setSingleRange=function(a){this.setRanges([a])};u.containsNode=function(a,b){for(var c=0,d=this._ranges.length;c<d;++c)if(this._ranges[c].containsNode(a,b))return!0;return!1};u.toHtml=function(){var a="";if(this.rangeCount){for(var a=
101
+ x.getRangeDocument(this._ranges[0]).createElement("div"),b=0,c=this._ranges.length;b<c;++b)a.appendChild(this._ranges[b].cloneContents());a=a.innerHTML}return a};u.getName=function(){return"WrappedSelection"};u.inspect=function(){return s(this)};u.detach=function(){this.win=this.anchorNode=this.focusNode=this.win._rangySelection=null};n.inspect=s;a.Selection=n;a.selectionPrototype=u;a.addCreateMissingNativeApiListener(function(b){"undefined"==typeof b.getSelection&&(b.getSelection=function(){return a.getSelection(this)});
102
+ b=null})});var Base=function(){};
103
+ Base.extend=function(a,c){var b=Base.prototype.extend;Base._prototyping=!0;var d=new this;b.call(d,a);d.base=function(){};delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!=arguments[0])return(arguments[0].extend||b).call(arguments[0],d)};f.ancestor=this;f.extend=this.extend;f.forEach=this.forEach;f.implement=this.implement;f.prototype=
104
+ d;f.toString=this.toString;f.valueOf=function(a){return"object"==a?f:e.valueOf()};b.call(f,c);"function"==typeof f.init&&f.init();return f};
105
+ Base.prototype={extend:function(a,c){if(1<arguments.length){var b=this[a];if(b&&"function"==typeof c&&(!b.valueOf||b.valueOf()!=c.valueOf())&&/\bbase\b/.test(c)){var d=c.valueOf(),c=function(){var a=this.base||Base.prototype.base;this.base=b;var c=d.apply(this,arguments);this.base=a;return c};c.valueOf=function(a){return"object"==a?c:d};c.toString=Base.toString}this[a]=c}else if(a){var e=Base.prototype.extend;!Base._prototyping&&"function"!=typeof this&&(e=this.extend||e);for(var f={toSource:null},
106
+ h=["constructor","toString","valueOf"],g=Base._prototyping?0:1;j=h[g++];)a[j]!=f[j]&&e.call(this,j,a[j]);for(var j in a)f[j]||e.call(this,j,a[j])}return this}};
107
+ Base=Base.extend({constructor:function(a){this.extend(a)}},{ancestor:Object,version:"1.1",forEach:function(a,c,b){for(var d in a)void 0===this.prototype[d]&&c.call(b,a[d],d,a)},implement:function(){for(var a=0;a<arguments.length;a++)if("function"==typeof arguments[a])arguments[a](this.prototype);else this.prototype.extend(arguments[a]);return this},toString:function(){return""+this.valueOf()}});
108
+ wysihtml5.browser=function(){var a=navigator.userAgent,c=document.createElement("div"),b=-1!==a.indexOf("MSIE")&&-1===a.indexOf("Opera"),d=-1!==a.indexOf("Gecko")&&-1===a.indexOf("KHTML"),e=-1!==a.indexOf("AppleWebKit/"),f=-1!==a.indexOf("Opera/");return{USER_AGENT:a,supported:function(){var a=this.USER_AGENT.toLowerCase(),b="contentEditable"in c,d=document.execCommand&&document.queryCommandSupported&&document.queryCommandState,e=document.querySelector&&document.querySelectorAll,a=this.isIos()&&5>
109
+ (/ipad|iphone|ipod/.test(a)&&a.match(/ os (\d+).+? like mac os x/)||[,0])[1]||-1!==a.indexOf("opera mobi")||-1!==a.indexOf("hpwos/");return b&&d&&e&&!a},isTouchDevice:function(){return this.supportsEvent("touchmove")},isIos:function(){var a=this.USER_AGENT.toLowerCase();return-1!==a.indexOf("webkit")&&-1!==a.indexOf("mobile")},supportsSandboxedIframes:function(){return b},throwsMixedContentWarningWhenIframeSrcIsEmpty:function(){return!("querySelector"in document)},displaysCaretInEmptyContentEditableCorrectly:function(){return!d},
110
+ hasCurrentStyleProperty:function(){return"currentStyle"in c},insertsLineBreaksOnReturn:function(){return d},supportsPlaceholderAttributeOn:function(a){return"placeholder"in a},supportsEvent:function(a){var b;if(!(b="on"+a in c))c.setAttribute("on"+a,"return;"),b="function"===typeof c["on"+a];return b},supportsEventsInIframeCorrectly:function(){return!f},firesOnDropOnlyWhenOnDragOverIsCancelled:function(){return e||d},supportsDataTransfer:function(){try{return e&&(window.Clipboard||window.DataTransfer).prototype.getData}catch(a){return!1}},
111
+ supportsHTML5Tags:function(a){a=a.createElement("div");a.innerHTML="<article>foo</article>";return"<article>foo</article>"===a.innerHTML.toLowerCase()},supportsCommand:function(){var a={formatBlock:b,insertUnorderedList:b||f,insertOrderedList:b||f},c={insertHTML:d};return function(b,d){if(!a[d]){try{return b.queryCommandSupported(d)}catch(i){}try{return b.queryCommandEnabled(d)}catch(e){return!!c[d]}}return!1}}(),doesAutoLinkingInContentEditable:function(){return b},canDisableAutoLinking:function(){return this.supportsCommand(document,
112
+ "AutoUrlDetect")},clearsContentEditableCorrectly:function(){return d||f||e},supportsGetAttributeCorrectly:function(){return"1"!=document.createElement("td").getAttribute("rowspan")},canSelectImagesInContentEditable:function(){return d||b||f},clearsListsInContentEditableCorrectly:function(){return d||b||e},autoScrollsToCaret:function(){return!e},autoClosesUnclosedTags:function(){var a=c.cloneNode(!1),b;a.innerHTML="<p><div></div>";a=a.innerHTML.toLowerCase();b="<p></p><div></div>"===a||"<p><div></div></p>"===
113
+ a;this.autoClosesUnclosedTags=function(){return b};return b},supportsNativeGetElementsByClassName:function(){return-1!==(""+document.getElementsByClassName).indexOf("[native code]")},supportsSelectionModify:function(){return"getSelection"in window&&"modify"in window.getSelection()},supportsClassList:function(){return"classList"in c},needsSpaceAfterLineBreak:function(){return f},supportsSpeechApiOn:function(b){return 11<=(a.match(/Chrome\/(\d+)/)||[,0])[1]&&("onwebkitspeechchange"in b||"speech"in b)},
114
+ crashesWhenDefineProperty:function(a){return b&&("XMLHttpRequest"===a||"XDomainRequest"===a)}}}();wysihtml5.lang.array=function(a){return{contains:function(c){if(a.indexOf)return-1!==a.indexOf(c);for(var b=0,d=a.length;b<d;b++)if(a[b]===c)return!0;return!1},without:function(c){for(var c=wysihtml5.lang.array(c),b=[],d=0,e=a.length;d<e;d++)c.contains(a[d])||b.push(a[d]);return b},get:function(){for(var c=0,b=a.length,d=[];c<b;c++)d.push(a[c]);return d}}};
115
+ wysihtml5.lang.Dispatcher=Base.extend({observe:function(a,c){this.events=this.events||{};this.events[a]=this.events[a]||[];this.events[a].push(c);return this},on:function(){return this.observe.apply(this,wysihtml5.lang.array(arguments).get())},fire:function(a,c){this.events=this.events||{};for(var b=this.events[a]||[],d=0;d<b.length;d++)b[d].call(this,c);return this},stopObserving:function(a,c){this.events=this.events||{};var b=0,d,e;if(a){for(d=this.events[a]||[],e=[];b<d.length;b++)d[b]!==c&&c&&
116
+ e.push(d[b]);this.events[a]=e}else this.events={};return this}});wysihtml5.lang.object=function(a){return{merge:function(c){for(var b in c)a[b]=c[b];return this},get:function(){return a},clone:function(){var c={},b;for(b in a)c[b]=a[b];return c},isArray:function(){return"[object Array]"===Object.prototype.toString.call(a)}}};
117
+ (function(){var a=/^\s+/,c=/\s+$/;wysihtml5.lang.string=function(b){b=""+b;return{trim:function(){return b.replace(a,"").replace(c,"")},interpolate:function(a){for(var c in a)b=this.replace("#{"+c+"}").by(a[c]);return b},replace:function(a){return{by:function(c){return b.split(a).join(c)}}}}}})();
118
+ (function(a){function c(a){return a.replace(e,function(a,b){var c=(b.match(f)||[])[1]||"",d=g[c],b=b.replace(f,"");b.split(d).length>b.split(c).length&&(b+=c,c="");var e=d=b;b.length>h&&(e=e.substr(0,h)+"...");"www."===d.substr(0,4)&&(d="http://"+d);return'<a href="'+d+'">'+e+"</a>"+c})}function b(j){if(!d.contains(j.nodeName))if(j.nodeType===a.TEXT_NODE&&j.data.match(e)){var f=j.parentNode,i;i=f.ownerDocument;var h=i._wysihtml5_tempElement;h||(h=i._wysihtml5_tempElement=i.createElement("div"));i=
119
+ h;i.innerHTML="<span></span>"+c(j.data);for(i.removeChild(i.firstChild);i.firstChild;)f.insertBefore(i.firstChild,j);f.removeChild(j)}else{f=a.lang.array(j.childNodes).get();i=f.length;for(h=0;h<i;h++)b(f[h]);return j}}var d=a.lang.array("CODE,PRE,A,SCRIPT,HEAD,TITLE,STYLE".split(",")),e=/((https?:\/\/|www\.)[^\s<]{3,})/gi,f=/([^\w\/\-](,?))$/i,h=100,g={")":"(","]":"[","}":"{"};a.dom.autoLink=function(a){var c;a:{c=a;for(var i;c.parentNode;){c=c.parentNode;i=c.nodeName;if(d.contains(i)){c=!0;break a}if("body"===
120
+ i)break}c=!1}if(c)return a;a===a.ownerDocument.documentElement&&(a=a.ownerDocument.body);return b(a)};a.dom.autoLink.URL_REG_EXP=e})(wysihtml5);
121
+ (function(a){var c=a.browser.supportsClassList(),b=a.dom;b.addClass=function(a,e){if(c)return a.classList.add(e);b.hasClass(a,e)||(a.className+=" "+e)};b.removeClass=function(a,b){if(c)return a.classList.remove(b);a.className=a.className.replace(RegExp("(^|\\s+)"+b+"(\\s+|$)")," ")};b.hasClass=function(a,b){if(c)return a.classList.contains(b);var f=a.className;return 0<f.length&&(f==b||RegExp("(^|\\s)"+b+"(\\s|$)").test(f))}})(wysihtml5);
122
+ wysihtml5.dom.contains=function(){var a=document.documentElement;if(a.contains)return function(a,b){b.nodeType!==wysihtml5.ELEMENT_NODE&&(b=b.parentNode);return a!==b&&a.contains(b)};if(a.compareDocumentPosition)return function(a,b){return!!(a.compareDocumentPosition(b)&16)}}();
123
+ wysihtml5.dom.convertToList=function(){function a(a,b){var d=a.createElement("li");b.appendChild(d);return d}return function(c,b){if("UL"===c.nodeName||"OL"===c.nodeName||"MENU"===c.nodeName)return c;for(var d=c.ownerDocument,e=d.createElement(b),f=wysihtml5.lang.array(c.childNodes).get(),h=f.length,g,j,k,i,n=0;n<h;n++)i=i||a(d,e),g=f[n],j="block"===wysihtml5.dom.getStyle("display").from(g),k="BR"===g.nodeName,j?(i=i.firstChild?a(d,e):i,i.appendChild(g),i=null):k?i=i.firstChild?null:i:i.appendChild(g);
124
+ c.parentNode.replaceChild(e,c);return e}}();wysihtml5.dom.copyAttributes=function(a){return{from:function(c){return{to:function(b){for(var d,e=0,f=a.length;e<f;e++)d=a[e],c[d]&&(b[d]=c[d]);return{andTo:arguments.callee}}}}}};
125
+ (function(a){var c=["-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing"],b=function(b){for(var e=0,f=c.length;e<f;e++)if("border-box"===a.getStyle(c[e]).from(b))return c[e]};a.copyStyles=function(d){return{from:function(e){b(e)&&parseInt(a.getStyle("width").from(e),10)<e.offsetWidth&&(d=wysihtml5.lang.array(d).without(c));for(var f="",h=d.length,g=0,j;g<h;g++)j=d[g],f+=j+":"+a.getStyle(j).from(e)+";";return{to:function(b){a.setStyles(f).on(b);return{andTo:arguments.callee}}}}}}})(wysihtml5.dom);
126
+ (function(a){a.dom.delegate=function(c,b,d,e){return a.dom.observe(c,d,function(d){for(var h=d.target,g=a.lang.array(c.querySelectorAll(b));h&&h!==c;){if(g.contains(h)){e.call(h,d);break}h=h.parentNode}})}})(wysihtml5);
127
+ wysihtml5.dom.getAsDom=function(){var a="abbr,article,aside,audio,bdi,canvas,command,datalist,details,figcaption,figure,footer,header,hgroup,keygen,mark,meter,nav,output,progress,rp,rt,ruby,svg,section,source,summary,time,track,video,wbr".split(",");return function(c,b){var b=b||document,d;if("object"===typeof c&&c.nodeType)d=b.createElement("div"),d.appendChild(c);else if(wysihtml5.browser.supportsHTML5Tags(b))d=b.createElement("div"),d.innerHTML=c;else{d=b;if(!d._wysihtml5_supportsHTML5Tags){for(var e=
128
+ 0,f=a.length;e<f;e++)d.createElement(a[e]);d._wysihtml5_supportsHTML5Tags=!0}d=b;e=d.createElement("div");e.style.display="none";d.body.appendChild(e);try{e.innerHTML=c}catch(h){}d.body.removeChild(e);d=e}return d}}();
129
+ wysihtml5.dom.getParentElement=function(){function a(a,b){return!b||!b.length?!0:"string"===typeof b?a===b:wysihtml5.lang.array(b).contains(a)}return function(c,b,d){d=d||50;if(b.className||b.classRegExp)a:{for(var e=b.nodeName,f=b.className,b=b.classRegExp;d--&&c&&"BODY"!==c.nodeName;){var h;if(h=c.nodeType===wysihtml5.ELEMENT_NODE)if(h=a(c.nodeName,e)){h=f;var g=(c.className||"").match(b)||[];h=!h?!!g.length:g[g.length-1]===h}if(h)break a;c=c.parentNode}c=null}else a:{e=b.nodeName;for(f=d;f--&&
130
+ c&&"BODY"!==c.nodeName;){if(a(c.nodeName,e))break a;c=c.parentNode}c=null}return c}}();
131
+ wysihtml5.dom.getStyle=function(){function a(a){return a.replace(b,function(a){return a.charAt(1).toUpperCase()})}var c={"float":"styleFloat"in document.createElement("div").style?"styleFloat":"cssFloat"},b=/\-[a-z]/g;return function(b){return{from:function(e){if(e.nodeType===wysihtml5.ELEMENT_NODE){var f=e.ownerDocument,h=c[b]||a(b),g=e.style,j=e.currentStyle,k=g[h];if(k)return k;if(j)return j[h];var h=f.defaultView||f.parentWindow,f=("height"===b||"width"===b)&&"TEXTAREA"===e.nodeName,i;if(h.getComputedStyle)return f&&
132
+ (i=g.overflow,g.overflow="hidden"),e=h.getComputedStyle(e,null).getPropertyValue(b),f&&(g.overflow=i||""),e}}}}}();wysihtml5.dom.hasElementWithTagName=function(){var a={},c=1;return function(b,d){var e=(b._wysihtml5_identifier||(b._wysihtml5_identifier=c++))+":"+d,f=a[e];f||(f=a[e]=b.getElementsByTagName(d));return 0<f.length}}();
133
+ (function(a){var c={},b=1;a.dom.hasElementWithClassName=function(d,e){if(!a.browser.supportsNativeGetElementsByClassName())return!!d.querySelector("."+e);var f=(d._wysihtml5_identifier||(d._wysihtml5_identifier=b++))+":"+e,h=c[f];h||(h=c[f]=d.getElementsByClassName(e));return 0<h.length}})(wysihtml5);wysihtml5.dom.insert=function(a){return{after:function(c){c.parentNode.insertBefore(a,c.nextSibling)},before:function(c){c.parentNode.insertBefore(a,c)},into:function(c){c.appendChild(a)}}};
134
+ wysihtml5.dom.insertCSS=function(a){a=a.join("\n");return{into:function(c){var b=c.head||c.getElementsByTagName("head")[0],d=c.createElement("style");d.type="text/css";d.styleSheet?d.styleSheet.cssText=a:d.appendChild(c.createTextNode(a));b&&b.appendChild(d)}}};
135
+ wysihtml5.dom.observe=function(a,c,b){for(var c="string"===typeof c?[c]:c,d,e,f=0,h=c.length;f<h;f++)e=c[f],a.addEventListener?a.addEventListener(e,b,!1):(d=function(c){"target"in c||(c.target=c.srcElement);c.preventDefault=c.preventDefault||function(){this.returnValue=!1};c.stopPropagation=c.stopPropagation||function(){this.cancelBubble=!0};b.call(a,c)},a.attachEvent("on"+e,d));return{stop:function(){for(var e,f=0,k=c.length;f<k;f++)e=c[f],a.removeEventListener?a.removeEventListener(e,b,!1):a.detachEvent("on"+
136
+ e,d)}}};
137
+ wysihtml5.dom.parse=function(){function a(c,e){var f=c.childNodes,j=f.length,k;k=b[c.nodeType];var h=0;k=k&&k(c);if(!k)return null;for(h=0;h<j;h++)(newChild=a(f[h],e))&&k.appendChild(newChild);return e&&1>=k.childNodes.length&&k.nodeName.toLowerCase()===d&&!k.attributes.length?k.firstChild:k}function c(a,b){var b=b.toLowerCase(),c;if(c="IMG"==a.nodeName)if(c="src"==b){var d;try{d=a.complete&&!a.mozMatchesSelector(":-moz-broken")}catch(e){a.complete&&"complete"===a.readyState&&(d=!0)}c=!0===d}return c?
138
+ a.src:g&&"outerHTML"in a?-1!=a.outerHTML.toLowerCase().indexOf(" "+b+"=")?a.getAttribute(b):null:a.getAttribute(b)}var b={1:function(a){var b,f,g=h.tags;f=a.nodeName.toLowerCase();b=a.scopeName;if(a._wysihtml5)return null;a._wysihtml5=1;if("wysihtml5-temp"===a.className)return null;b&&"HTML"!=b&&(f=b+":"+f);"outerHTML"in a&&!wysihtml5.browser.autoClosesUnclosedTags()&&"P"===a.nodeName&&"</p>"!==a.outerHTML.slice(-4).toLowerCase()&&(f="div");if(f in g){b=g[f];if(!b||b.remove)return null;b="string"===
139
+ typeof b?{rename_tag:b}:b}else if(a.firstChild)b={rename_tag:d};else return null;f=a.ownerDocument.createElement(b.rename_tag||f);var g={},s=b.set_class,m=b.add_class,r=b.set_attributes,x=b.check_attributes,o=h.classes,z=0,w=[];b=[];var y=[],A=[],t;r&&(g=wysihtml5.lang.object(r).clone());if(x)for(t in x)if(r=j[x[t]])r=r(c(a,t)),"string"===typeof r&&(g[t]=r);s&&w.push(s);if(m)for(t in m)if(r=k[m[t]])s=r(c(a,t)),"string"===typeof s&&w.push(s);o["_wysihtml5-temp-placeholder"]=1;(A=a.getAttribute("class"))&&
140
+ (w=w.concat(A.split(e)));for(m=w.length;z<m;z++)a=w[z],o[a]&&b.push(a);for(o=b.length;o--;)a=b[o],wysihtml5.lang.array(y).contains(a)||y.unshift(a);y.length&&(g["class"]=y.join(" "));for(t in g)try{f.setAttribute(t,g[t])}catch(v){}g.src&&("undefined"!==typeof g.width&&f.setAttribute("width",g.width),"undefined"!==typeof g.height&&f.setAttribute("height",g.height));return f},3:function(a){return a.ownerDocument.createTextNode(a.data)}},d="span",e=/\s+/,f={tags:{},classes:{}},h={},g=!wysihtml5.browser.supportsGetAttributeCorrectly(),
141
+ j={url:function(){var a=/^https?:\/\//i;return function(b){return!b||!b.match(a)?null:b.replace(a,function(a){return a.toLowerCase()})}}(),alt:function(){var a=/[^ a-z0-9_\-]/gi;return function(b){return!b?"":b.replace(a,"")}}(),numbers:function(){var a=/\D/g;return function(b){return(b=(b||"").replace(a,""))||null}}()},k={align_img:function(){var a={left:"wysiwyg-float-left",right:"wysiwyg-float-right"};return function(b){return a[(""+b).toLowerCase()]}}(),align_text:function(){var a={left:"wysiwyg-text-align-left",
142
+ right:"wysiwyg-text-align-right",center:"wysiwyg-text-align-center",justify:"wysiwyg-text-align-justify"};return function(b){return a[(""+b).toLowerCase()]}}(),clear_br:function(){var a={left:"wysiwyg-clear-left",right:"wysiwyg-clear-right",both:"wysiwyg-clear-both",all:"wysiwyg-clear-both"};return function(b){return a[(""+b).toLowerCase()]}}(),size_font:function(){var a={1:"wysiwyg-font-size-xx-small",2:"wysiwyg-font-size-small",3:"wysiwyg-font-size-medium",4:"wysiwyg-font-size-large",5:"wysiwyg-font-size-x-large",
143
+ 6:"wysiwyg-font-size-xx-large",7:"wysiwyg-font-size-xx-large","-":"wysiwyg-font-size-smaller","+":"wysiwyg-font-size-larger"};return function(b){return a[(""+b).charAt(0)]}}()};return function(b,c,d,e){wysihtml5.lang.object(h).merge(f).merge(c).get();for(var d=d||b.ownerDocument||document,c=d.createDocumentFragment(),j="string"===typeof b,b=j?wysihtml5.dom.getAsDom(b,d):b;b.firstChild;)d=b.firstChild,b.removeChild(d),(d=a(d,e))&&c.appendChild(d);b.innerHTML="";b.appendChild(c);return j?wysihtml5.quirks.getCorrectInnerHTML(b):
144
+ b}}();wysihtml5.dom.removeEmptyTextNodes=function(a){for(var c=wysihtml5.lang.array(a.childNodes).get(),b=c.length,d=0;d<b;d++)a=c[d],a.nodeType===wysihtml5.TEXT_NODE&&""===a.data&&a.parentNode.removeChild(a)};wysihtml5.dom.renameElement=function(a,c){for(var b=a.ownerDocument.createElement(c),d;d=a.firstChild;)b.appendChild(d);wysihtml5.dom.copyAttributes(["align","className"]).from(a).to(b);a.parentNode.replaceChild(b,a);return b};
145
+ wysihtml5.dom.replaceWithChildNodes=function(a){if(a.parentNode)if(a.firstChild){for(var c=a.ownerDocument.createDocumentFragment();a.firstChild;)c.appendChild(a.firstChild);a.parentNode.replaceChild(c,a)}else a.parentNode.removeChild(a)};
146
+ (function(a){function c(a){var c=a.ownerDocument.createElement("br");a.appendChild(c)}a.resolveList=function(b){if(!("MENU"!==b.nodeName&&"UL"!==b.nodeName&&"OL"!==b.nodeName)){var d=b.ownerDocument.createDocumentFragment(),e=b.previousSibling,f,h,g;for(e&&"block"!==a.getStyle("display").from(e)&&c(d);g=b.firstChild;){for(f=g.lastChild;e=g.firstChild;)h=(h=e===f)&&"block"!==a.getStyle("display").from(e)&&"BR"!==e.nodeName,d.appendChild(e),h&&c(d);g.parentNode.removeChild(g)}b.parentNode.replaceChild(d,
147
+ b)}}})(wysihtml5.dom);
148
+ (function(a){var c={uaCompatible:"IE=Edge"},b=document,d="parent,top,opener,frameElement,frames,localStorage,globalStorage,sessionStorage,indexedDB".split(","),e="open,close,openDialog,showModalDialog,alert,confirm,prompt,openDatabase,postMessage,XMLHttpRequest,XDomainRequest".split(","),f=["referrer","write","open","close"];a.dom.Sandbox=Base.extend({constructor:function(b,d){this.callback=b||a.EMPTY_FUNCTION;this.config=a.lang.object({}).merge(c).merge(d).get();this.iframe=this._createIframe()},
149
+ insertInto:function(a){"string"===typeof a&&(a=b.getElementById(a));a.appendChild(this.iframe)},getIframe:function(){return this.iframe},getWindow:function(){this._readyError()},getDocument:function(){this._readyError()},destroy:function(){var a=this.getIframe();a.parentNode.removeChild(a)},_readyError:function(){throw Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet");},_createIframe:function(){var c=this,d=b.createElement("iframe");d.className="wysihtml5-sandbox";a.dom.setAttributes({security:"restricted",
150
+ allowtransparency:"true",frameborder:0,width:0,height:0,marginwidth:0,marginheight:0}).on(d);a.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()&&(d.src="javascript:'<html></html>'");d.onload=function(){d.onreadystatechange=d.onload=null;c._onLoadIframe(d)};d.onreadystatechange=function(){/loaded|complete/.test(d.readyState)&&(d.onreadystatechange=d.onload=null,c._onLoadIframe(d))};return d},_onLoadIframe:function(c){if(a.dom.contains(b.documentElement,c)){var g=this,j=c.contentWindow,k=c.contentDocument||
151
+ c.contentWindow.document,c=this._getHtml({charset:b.characterSet||b.charset||"utf-8",stylesheets:this.config.stylesheets,uaCompatible:this.config.uaCompatible});k.open("text/html","replace");k.write(c);k.close();this.getWindow=function(){return j};this.getDocument=function(){return k};j.onerror=function(a,b,c){throw Error("wysihtml5.Sandbox: "+a,b,c);};if(!a.browser.supportsSandboxedIframes()){var i;for(c=0,i=d.length;c<i;c++)this._unset(j,d[c]);for(c=0,i=e.length;c<i;c++)this._unset(j,e[c],a.EMPTY_FUNCTION);
152
+ for(c=0,i=f.length;c<i;c++)this._unset(k,f[c]);this._unset(k,"cookie","",!0)}this.loaded=!0;setTimeout(function(){g.callback(g)},0)}},_getHtml:function(b){var c=b.stylesheets,d="",e=0,i;if(c="string"===typeof c?[c]:c)for(i=c.length;e<i;e++)d+='<link rel="stylesheet" href="'+c[e]+'">';b.stylesheets=d;return a.lang.string('<!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" content="#{uaCompatible}"><meta charset="#{charset}">#{stylesheets}</head><body></body></html>').interpolate(b)},_unset:function(b,
153
+ c,d,e){try{b[c]=d}catch(i){}try{b.__defineGetter__(c,function(){return d})}catch(f){}if(e)try{b.__defineSetter__(c,function(){})}catch(p){}if(!a.browser.crashesWhenDefineProperty(c))try{var q={get:function(){return d}};e&&(q.set=function(){});Object.defineProperty(b,c,q)}catch(s){}}})})(wysihtml5);(function(){var a={className:"class"};wysihtml5.dom.setAttributes=function(c){return{on:function(b){for(var d in c)b.setAttribute(a[d]||d,c[d])}}}})();
154
+ wysihtml5.dom.setStyles=function(a){return{on:function(c){c=c.style;if("string"===typeof a)c.cssText+=";"+a;else for(var b in a)"float"===b?(c.cssFloat=a[b],c.styleFloat=a[b]):c[b]=a[b]}}};
155
+ (function(a){a.simulatePlaceholder=function(c,b,d){var e=function(){b.hasPlaceholderSet()&&b.clear();a.removeClass(b.element,"placeholder")},f=function(){b.isEmpty()&&(b.setValue(d),a.addClass(b.element,"placeholder"))};c.observe("set_placeholder",f).observe("unset_placeholder",e).observe("focus:composer",e).observe("paste:composer",e).observe("blur:composer",f);f()}})(wysihtml5.dom);
156
+ (function(a){var c=document.documentElement;"textContent"in c?(a.setTextContent=function(a,c){a.textContent=c},a.getTextContent=function(a){return a.textContent}):"innerText"in c?(a.setTextContent=function(a,c){a.innerText=c},a.getTextContent=function(a){return a.innerText}):(a.setTextContent=function(a,c){a.nodeValue=c},a.getTextContent=function(a){return a.nodeValue})})(wysihtml5.dom);
157
+ wysihtml5.quirks.cleanPastedHTML=function(){var a={"a u":wysihtml5.dom.replaceWithChildNodes};return function(c,b,d){var b=b||a,d=d||c.ownerDocument||document,e="string"===typeof c,f,h,g,j=0,c=e?wysihtml5.dom.getAsDom(c,d):c;for(g in b){f=c.querySelectorAll(g);d=b[g];for(h=f.length;j<h;j++)d(f[j])}return e?c.innerHTML:c}}();
158
+ (function(a){var c=a.dom;a.quirks.ensureProperClearing=function(){var a=function(){var a=this;setTimeout(function(){var b=a.innerHTML.toLowerCase();if("<p>&nbsp;</p>"==b||"<p>&nbsp;</p><p>&nbsp;</p>"==b)a.innerHTML=""},0)};return function(d){c.observe(d,["cut","keydown"],a)}}();a.quirks.ensureProperClearingOfLists=function(){var b=["OL","UL","MENU"];return function(d){c.observe(d,"keydown",function(e){e.keyCode===a.BACKSPACE_KEY&&(e=a.selection.getSelectedNode(),d.firstChild&&a.lang.array(b).contains(d.firstChild.nodeName)&&
159
+ (e=c.getParentElement(e,{nodeName:b}))&&e==d.firstChild&&1>=e.childNodes.length&&(e.firstChild?""===e.firstChild.innerHTML:1)&&e.parentNode.removeChild(e))})}}()})(wysihtml5);(function(a){a.quirks.getCorrectInnerHTML=function(c){var b=c.innerHTML;if(-1===b.indexOf("%7E"))return b;var c=c.querySelectorAll("[href*='~'], [src*='~']"),d,e,f,h;for(h=0,f=c.length;h<f;h++)d=c[h].href||c[h].src,e=a.lang.string(d).replace("~").by("%7E"),b=a.lang.string(b).replace(e).by(d);return b}})(wysihtml5);
160
+ (function(a){function c(b){if(b=d.getParentElement(b,{nodeName:["P","DIV"]},2)){var c=document.createTextNode(a.INVISIBLE_SPACE);d.insert(c).before(b);d.replaceWithChildNodes(b);a.selection.selectNode(c)}}function b(b){var g=b.keyCode;if(!(b.shiftKey||g!==a.ENTER_KEY&&g!==a.BACKSPACE_KEY)){var j=a.selection.getSelectedNode();(j=d.getParentElement(j,{nodeName:e},4))?"LI"===j.nodeName&&(g===a.ENTER_KEY||g===a.BACKSPACE_KEY)?setTimeout(function(){var b=a.selection.getSelectedNode();b&&(d.getParentElement(b,
161
+ {nodeName:f},2)||c(b))},0):j.nodeName.match(/H[1-6]/)&&g===a.ENTER_KEY&&setTimeout(function(){c(a.selection.getSelectedNode())},0):g===a.ENTER_KEY&&!a.browser.insertsLineBreaksOnReturn()&&(a.commands.exec("insertLineBreak"),b.preventDefault())}}var d=a.dom,e="LI,P,H1,H2,H3,H4,H5,H6".split(","),f=["UL","OL","MENU"];a.quirks.insertLineBreakOnReturn=function(a){d.observe(a.ownerDocument,"keydown",b)}})(wysihtml5);
162
+ (function(a){a.quirks.redraw=function(c){a.dom.addClass(c,"wysihtml5-quirks-redraw");a.dom.removeClass(c,"wysihtml5-quirks-redraw");try{var b=c.ownerDocument;b.execCommand("italic",!1,null);b.execCommand("italic",!1,null)}catch(d){}}})(wysihtml5);
163
+ (function(a){var c=a.dom;a.selection={initialize:function(a){window.rangy.init();this.doc=a},getBookmark:function(){var a=this.getRange();return a&&a.cloneRange()},setBookmark:function(a){a&&this.setSelection(a)},setBefore:function(a){var c=rangy.createRange(this.doc);c.setStartBefore(a);c.setEndBefore(a);return this.setSelection(c)},setAfter:function(a){var c=rangy.createRange(this.doc);c.setStartAfter(a);c.setEndAfter(a);return this.setSelection(c)},selectNode:function(b){var d=rangy.createRange(this.doc),
164
+ e=b.nodeType===a.ELEMENT_NODE,f="canHaveHTML"in b?b.canHaveHTML:"IMG"!==b.nodeName,h=e?b.innerHTML:b.data,h=""===h||h===a.INVISIBLE_SPACE,g=c.getStyle("display").from(b),g="block"===g||"list-item"===g;if(h&&e&&f)try{b.innerHTML=a.INVISIBLE_SPACE}catch(j){}f?d.selectNodeContents(b):d.selectNode(b);f&&h&&e?d.collapse(g):f&&h&&(d.setStartAfter(b),d.setEndAfter(b));this.setSelection(d)},getSelectedNode:function(a){if(a&&this.doc.selection&&"Control"===this.doc.selection.type&&(a=this.doc.selection.createRange())&&
165
+ a.length)return a.item(0);a=this.getSelection(this.doc);return a.focusNode===a.anchorNode?a.focusNode:(a=this.getRange(this.doc))?a.commonAncestorContainer:this.doc.body},executeAndRestore:function(b,c){var e=this.doc.body,f=c&&e.scrollTop,h=c&&e.scrollLeft,g='<span class="_wysihtml5-temp-placeholder">'+a.INVISIBLE_SPACE+"</span>",j=this.getRange(this.doc);if(j){g=j.createContextualFragment(g);j.insertNode(g);try{b(j.startContainer,j.endContainer)}catch(k){setTimeout(function(){throw k;},0)}(caretPlaceholder=
166
+ this.doc.querySelector("._wysihtml5-temp-placeholder"))?(j=rangy.createRange(this.doc),j.selectNode(caretPlaceholder),j.deleteContents(),this.setSelection(j)):e.focus();c&&(e.scrollTop=f,e.scrollLeft=h);try{caretPlaceholder.parentNode.removeChild(caretPlaceholder)}catch(i){}}else b(e,e)},executeAndRestoreSimple:function(a){var c,e,f=this.getRange(),h=this.doc.body,g;if(f){c=f.getNodes([3]);h=c[0]||f.startContainer;g=c[c.length-1]||f.endContainer;c=h===f.startContainer?f.startOffset:0;e=g===f.endContainer?
167
+ f.endOffset:g.length;try{a(f.startContainer,f.endContainer)}catch(j){setTimeout(function(){throw j;},0)}a=rangy.createRange(this.doc);try{a.setStart(h,c)}catch(k){}try{a.setEnd(g,e)}catch(i){}try{this.setSelection(a)}catch(n){}}else a(h,h)},insertHTML:function(a){var a=rangy.createRange(this.doc).createContextualFragment(a),c=a.lastChild;this.insertNode(a);c&&this.setAfter(c)},insertNode:function(a){var c=this.getRange();c&&c.insertNode(a)},surround:function(a){var c=this.getRange();if(c)try{c.surroundContents(a),
168
+ this.selectNode(a)}catch(e){a.appendChild(c.extractContents()),c.insertNode(a)}},scrollIntoView:function(b){var c=this.doc,e=c.documentElement.scrollHeight>c.documentElement.offsetHeight,f;if(!(f=c._wysihtml5ScrollIntoViewElement))f=c.createElement("span"),f.innerHTML=a.INVISIBLE_SPACE;c=c._wysihtml5ScrollIntoViewElement=f;if(e){this.insertNode(c);e=c;f=0;if(e.parentNode){do f+=e.offsetTop||0,e=e.offsetParent;while(e)}e=f;c.parentNode.removeChild(c);e>b.scrollTop&&(b.scrollTop=e)}},selectLine:function(){a.browser.supportsSelectionModify()?
169
+ this._selectLine_W3C():this.doc.selection&&this._selectLine_MSIE()},_selectLine_W3C:function(){var a=this.doc.defaultView.getSelection();a.modify("extend","left","lineboundary");a.modify("extend","right","lineboundary")},_selectLine_MSIE:function(){var a=this.doc.selection.createRange(),c=a.boundingTop,e=this.doc.body.scrollWidth,f;if(a.moveToPoint){0===c&&(f=this.doc.createElement("span"),this.insertNode(f),c=f.offsetTop,f.parentNode.removeChild(f));c+=1;for(f=-10;f<e;f+=2)try{a.moveToPoint(f,c);
170
+ break}catch(h){}for(f=this.doc.selection.createRange();0<=e;e--)try{f.moveToPoint(e,c);break}catch(g){}a.setEndPoint("EndToEnd",f);a.select()}},getText:function(){var a=this.getSelection();return a?a.toString():""},getNodes:function(a,c){var e=this.getRange();return e?e.getNodes([a],c):[]},getRange:function(){var a=this.getSelection();return a&&a.rangeCount&&a.getRangeAt(0)},getSelection:function(){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow)},setSelection:function(a){return rangy.getSelection(this.doc.defaultView||
171
+ this.doc.parentWindow).setSingleRange(a)}}})(wysihtml5);
172
+ (function(a,c){function b(a,b){return c.dom.isCharacterDataNode(a)?0==b?!!a.previousSibling:b==a.length?!!a.nextSibling:!0:0<b&&b<a.childNodes.length}function d(a,b,e){var f;c.dom.isCharacterDataNode(b)&&(0==e?(e=c.dom.getNodeIndex(b),b=b.parentNode):e==b.length?(e=c.dom.getNodeIndex(b)+1,b=b.parentNode):f=c.dom.splitDataNode(b,e));if(!f){f=b.cloneNode(!1);f.id&&f.removeAttribute("id");for(var g;g=b.childNodes[e];)f.appendChild(g);c.dom.insertAfter(f,b)}return b==a?f:d(a,f.parentNode,c.dom.getNodeIndex(f))}
173
+ function e(b){this.firstTextNode=(this.isElementMerge=b.nodeType==a.ELEMENT_NODE)?b.lastChild:b;this.textNodes=[this.firstTextNode]}function f(a,b,c,d){this.tagNames=a||[h];this.cssClass=b||"";this.similarClassRegExp=c;this.normalize=d;this.applyToAnyTagName=!1}var h="span",g=/\s+/g;e.prototype={doMerge:function(){for(var a=[],b,c,d=0,e=this.textNodes.length;d<e;++d)b=this.textNodes[d],c=b.parentNode,a[d]=b.data,d&&(c.removeChild(b),c.hasChildNodes()||c.parentNode.removeChild(c));return this.firstTextNode.data=
174
+ a=a.join("")},getLength:function(){for(var a=this.textNodes.length,b=0;a--;)b+=this.textNodes[a].length;return b},toString:function(){for(var a=[],b=0,c=this.textNodes.length;b<c;++b)a[b]="'"+this.textNodes[b].data+"'";return"[Merge("+a.join(",")+")]"}};f.prototype={getAncestorWithClass:function(b){for(var d;b;){if(this.cssClass)if(d=this.cssClass,b.className){var e=b.className.match(this.similarClassRegExp)||[];d=e[e.length-1]===d}else d=!1;else d=!0;if(b.nodeType==a.ELEMENT_NODE&&c.dom.arrayContains(this.tagNames,
175
+ b.tagName.toLowerCase())&&d)return b;b=b.parentNode}return!1},postApply:function(a,b){for(var c=a[0],d=a[a.length-1],f=[],g,h=c,m=d,r=0,x=d.length,o,z,w=0,y=a.length;w<y;++w)o=a[w],(z=this.getAdjacentMergeableTextNode(o.parentNode,!1))?(g||(g=new e(z),f.push(g)),g.textNodes.push(o),o===c&&(h=g.firstTextNode,r=h.length),o===d&&(m=g.firstTextNode,x=g.getLength())):g=null;if(c=this.getAdjacentMergeableTextNode(d.parentNode,!0))g||(g=new e(d),f.push(g)),g.textNodes.push(c);if(f.length){for(w=0,y=f.length;w<
176
+ y;++w)f[w].doMerge();b.setStart(h,r);b.setEnd(m,x)}},getAdjacentMergeableTextNode:function(b,c){var d=b.nodeType==a.TEXT_NODE,e=d?b.parentNode:b,f=c?"nextSibling":"previousSibling";if(d){if((d=b[f])&&d.nodeType==a.TEXT_NODE)return d}else if((d=e[f])&&this.areElementsMergeable(b,d))return d[c?"firstChild":"lastChild"];return null},areElementsMergeable:function(a,b){var d;if(d=c.dom.arrayContains(this.tagNames,(a.tagName||"").toLowerCase()))if(d=c.dom.arrayContains(this.tagNames,(b.tagName||"").toLowerCase()))if(d=
177
+ a.className.replace(g," ")==b.className.replace(g," "))a:if(a.attributes.length!=b.attributes.length)d=!1;else{d=0;for(var e=a.attributes.length,f,h;d<e;++d)if(f=a.attributes[d],h=f.name,"class"!=h&&(h=b.attributes.getNamedItem(h),f.specified!=h.specified||f.specified&&f.nodeValue!==h.nodeValue)){d=!1;break a}d=!0}return d},createContainer:function(a){a=a.createElement(this.tagNames[0]);this.cssClass&&(a.className=this.cssClass);return a},applyToTextNode:function(a){var b=a.parentNode;1==b.childNodes.length&&
178
+ c.dom.arrayContains(this.tagNames,b.tagName.toLowerCase())?this.cssClass&&(a=this.cssClass,b.className?(b.className&&(b.className=b.className.replace(this.similarClassRegExp,"")),b.className+=" "+a):b.className=a):(b=this.createContainer(c.dom.getDocument(a)),a.parentNode.insertBefore(b,a),b.appendChild(a))},isRemovable:function(b){return c.dom.arrayContains(this.tagNames,b.tagName.toLowerCase())&&a.lang.string(b.className).trim()==this.cssClass},undoToTextNode:function(a,c,e){c.containsNode(e)||
179
+ (a=c.cloneRange(),a.selectNode(e),a.isPointInRange(c.endContainer,c.endOffset)&&b(c.endContainer,c.endOffset)&&(d(e,c.endContainer,c.endOffset),c.setEndAfter(e)),a.isPointInRange(c.startContainer,c.startOffset)&&b(c.startContainer,c.startOffset)&&(e=d(e,c.startContainer,c.startOffset)));this.similarClassRegExp&&e.className&&(e.className=e.className.replace(this.similarClassRegExp,""));if(this.isRemovable(e)){c=e;for(e=c.parentNode;c.firstChild;)e.insertBefore(c.firstChild,c);e.removeChild(c)}},applyToRange:function(b){var c=
180
+ b.getNodes([a.TEXT_NODE]);if(!c.length)try{var d=this.createContainer(b.endContainer.ownerDocument);b.surroundContents(d);this.selectNode(b,d);return}catch(e){}b.splitBoundaries();c=b.getNodes([a.TEXT_NODE]);if(c.length){for(var f=0,g=c.length;f<g;++f)d=c[f],this.getAncestorWithClass(d)||this.applyToTextNode(d);b.setStart(c[0],0);d=c[c.length-1];b.setEnd(d,d.length);this.normalize&&this.postApply(c,b)}},undoToRange:function(b){var c=b.getNodes([a.TEXT_NODE]),d,e;c.length?(b.splitBoundaries(),c=b.getNodes([a.TEXT_NODE])):
181
+ (c=b.endContainer.ownerDocument.createTextNode(a.INVISIBLE_SPACE),b.insertNode(c),b.selectNode(c),c=[c]);for(var f=0,g=c.length;f<g;++f)d=c[f],(e=this.getAncestorWithClass(d))&&this.undoToTextNode(d,b,e);1==g?this.selectNode(b,c[0]):(b.setStart(c[0],0),d=c[c.length-1],b.setEnd(d,d.length),this.normalize&&this.postApply(c,b))},selectNode:function(b,c){var d=c.nodeType===a.ELEMENT_NODE,e="canHaveHTML"in c?c.canHaveHTML:!0,f=d?c.innerHTML:c.data;if((f=""===f||f===a.INVISIBLE_SPACE)&&d&&e)try{c.innerHTML=
182
+ a.INVISIBLE_SPACE}catch(g){}b.selectNodeContents(c);f&&d?b.collapse(!1):f&&(b.setStartAfter(c),b.setEndAfter(c))},getTextSelectedByRange:function(a,b){var c=b.cloneRange();c.selectNodeContents(a);var d=c.intersection(b),d=d?d.toString():"";c.detach();return d},isAppliedToRange:function(b){var c=[],d,e=b.getNodes([a.TEXT_NODE]);if(!e.length)return(d=this.getAncestorWithClass(b.startContainer))?[d]:!1;for(var f=0,g=e.length,h;f<g;++f){h=this.getTextSelectedByRange(e[f],b);d=this.getAncestorWithClass(e[f]);
183
+ if(""!=h&&!d)return!1;c.push(d)}return c},toggleRange:function(a){this.isAppliedToRange(a)?this.undoToRange(a):this.applyToRange(a)}};a.selection.HTMLApplier=f})(wysihtml5,rangy);
184
+ wysihtml5.commands={initialize:function(a){this.editor=a;this.element=a.composer.element;this.doc=this.element.ownerDocument},support:function(a){return wysihtml5.browser.supportsCommand(this.doc,a)},exec:function(a,c){var b=this[a],d=b&&b.exec;this.editor.fire("beforecommand:composer");if(d)return d.call(b,this.element,a,c);try{return this.doc.execCommand(a,!1,c)}catch(e){}this.editor.fire("aftercommand:composer")},state:function(a,c){var b=this[a],d=b&&b.state;if(d)return d.call(b,this.element,
185
+ a,c);try{return this.doc.queryCommandState(a)}catch(e){return!1}},value:function(a){var c=this[a];if(c=c&&c.value)c(this.element,a);else try{return this.doc.queryCommandValue(a)}catch(b){return null}}};(function(a){a.commands.bold={exec:function(c,b){return a.commands.formatInline.exec(c,b,"b")},state:function(c,b){return a.commands.formatInline.state(c,b,"b")},value:function(){}}})(wysihtml5);
186
+ (function(a){function c(c,h){var g=c.ownerDocument,j="_wysihtml5-temp-"+ +new Date,k=0,i,n,p;a.commands.formatInline.exec(c,b,d,j,/non-matching-class/g);i=g.querySelectorAll(d+"."+j);for(j=i.length;k<j;k++)for(p in n=i[k],n.removeAttribute("class"),h)n.setAttribute(p,h[p]);k=n;1===j&&(p=e.getTextContent(n),j=!!n.querySelector("*"),p=""===p||p===a.INVISIBLE_SPACE,!j&&p&&(e.setTextContent(n,n.href),g=g.createTextNode(" "),a.selection.setAfter(n),a.selection.insertNode(g),k=g));a.selection.setAfter(k)}
187
+ var b,d="A",e=a.dom;a.commands.createLink={exec:function(b,d,g){var j=this.state(b,d);j?a.selection.executeAndRestore(function(){for(var a=j.length,b=0,c,d,f;b<a;b++)c=j[b],d=e.getParentElement(c,{nodeName:"code"}),f=e.getTextContent(c),f.match(e.autoLink.URL_REG_EXP)&&!d?e.renameElement(c,"code"):e.replaceWithChildNodes(c)}):(g="object"===typeof g?g:{href:g},c(b,g))},state:function(b,c){return a.commands.formatInline.state(b,c,"A")},value:function(){return b}}})(wysihtml5);
188
+ (function(a){var c=/wysiwyg-font-size-[a-z]+/g;a.commands.fontSize={exec:function(b,d,e){return a.commands.formatInline.exec(b,d,"span","wysiwyg-font-size-"+e,c)},state:function(b,d,e){return a.commands.formatInline.state(b,d,"span","wysiwyg-font-size-"+e,c)},value:function(){}}})(wysihtml5);
189
+ (function(a){var c=/wysiwyg-color-[a-z]+/g;a.commands.foreColor={exec:function(b,d,e){return a.commands.formatInline.exec(b,d,"span","wysiwyg-color-"+e,c)},state:function(b,d,e){return a.commands.formatInline.state(b,d,"span","wysiwyg-color-"+e,c)},value:function(){}}})(wysihtml5);
190
+ (function(a){function c(b){for(b=b.previousSibling;b&&b.nodeType===a.TEXT_NODE&&!a.lang.string(b.data).trim();)b=b.previousSibling;return b}function b(b){for(b=b.nextSibling;b&&b.nodeType===a.TEXT_NODE&&!a.lang.string(b.data).trim();)b=b.nextSibling;return b}function d(a){return"BR"===a.nodeName||"block"===h.getStyle("display").from(a)?!0:!1}function e(b,c,d,e){if(e)var f=h.observe(b,"DOMNodeInserted",function(b){b=b.target;b.nodeType===a.ELEMENT_NODE&&"inline"!==h.getStyle("display").from(b).substr(0,
191
+ 6)&&(b.className+=" "+e)});b.execCommand(c,!1,d);f&&f.stop()}function f(a){g.selectLine();g.surround(a);var d=b(a),e=c(a);d&&"BR"===d.nodeName&&d.parentNode.removeChild(d);e&&"BR"===e.nodeName&&e.parentNode.removeChild(e);(d=a.lastChild)&&"BR"===d.nodeName&&d.parentNode.removeChild(d);g.selectNode(a)}var h=a.dom,g=a.selection,j="H1,H2,H3,H4,H5,H6,P,BLOCKQUOTE,DIV".split(",");a.commands.formatBlock={exec:function(k,i,n,p,q){var s=k.ownerDocument,m=this.state(k,i,n,p,q),n="string"===typeof n?n.toUpperCase():
192
+ n;if(m)g.executeAndRestoreSimple(function(){q&&(m.className=m.className.replace(q,""));var e=!!a.lang.string(m.className).trim();if(!e&&m.nodeName===(n||"DIV")){var e=m,f=e.ownerDocument,i=b(e),g=c(e);i&&!d(i)&&e.parentNode.insertBefore(f.createElement("br"),i);g&&!d(g)&&e.parentNode.insertBefore(f.createElement("br"),e);h.replaceWithChildNodes(m)}else e&&h.renameElement(m,"DIV")});else{if(null===n||a.lang.array(j).contains(n))if(k=g.getSelectedNode(),m=h.getParentElement(k,{nodeName:j})){g.executeAndRestoreSimple(function(){n&&
193
+ (m=h.renameElement(m,n));if(p){var a=m;a.className?(a.className=a.className.replace(q,""),a.className+=" "+p):a.className=p}});return}a.commands.support(i)?e(s,i,n||"DIV",p):(m=s.createElement(n||"DIV"),p&&(m.className=p),f(m))}},state:function(a,b,c,d,e){c="string"===typeof c?c.toUpperCase():c;a=g.getSelectedNode();return h.getParentElement(a,{nodeName:c,className:d,classRegExp:e})},value:function(){}}})(wysihtml5);
194
+ (function(a){function c(c,f,h){var g=c+":"+f;if(!d[g]){var j=d,k=a.selection.HTMLApplier,i=b[c],c=i?[c.toLowerCase(),i.toLowerCase()]:[c.toLowerCase()];j[g]=new k(c,f,h,!0)}return d[g]}var b={strong:"b",em:"i",b:"strong",i:"em"},d={};a.commands.formatInline={exec:function(b,d,h,g,j){b=a.selection.getRange();if(!b)return!1;c(h,g,j).toggleRange(b);a.selection.setSelection(b)},state:function(d,f,h,g,j){d=d.ownerDocument;f=b[h]||h;if(!a.dom.hasElementWithTagName(d,h)&&!a.dom.hasElementWithTagName(d,f)||
195
+ g&&!a.dom.hasElementWithClassName(d,g))return!1;d=a.selection.getRange();return!d?!1:c(h,g,j).isAppliedToRange(d)},value:function(){}}})(wysihtml5);(function(a){a.commands.insertHTML={exec:function(c,b,d){a.commands.support(b)?c.ownerDocument.execCommand(b,!1,d):a.selection.insertHTML(d)},state:function(){return!1},value:function(){}}})(wysihtml5);
196
+ (function(a){a.commands.insertImage={exec:function(c,b,d){var d="object"===typeof d?d:{src:d},e=c.ownerDocument,b=this.state(c),f;if(b)a.selection.setBefore(b),d=b.parentNode,d.removeChild(b),a.dom.removeEmptyTextNodes(d),"A"===d.nodeName&&!d.firstChild&&(a.selection.setAfter(d),d.parentNode.removeChild(d)),a.quirks.redraw(c);else{b=e.createElement("IMG");for(f in d)b[f]=d[f];a.selection.insertNode(b);a.selection.setAfter(b)}},state:function(c){if(!a.dom.hasElementWithTagName(c.ownerDocument,"IMG"))return!1;
197
+ c=a.selection.getSelectedNode();if(!c)return!1;if("IMG"===c.nodeName)return c;if(c.nodeType!==a.ELEMENT_NODE)return!1;c=a.selection.getText();if(c=a.lang.string(c).trim())return!1;c=a.selection.getNodes(a.ELEMENT_NODE,function(a){return"IMG"===a.nodeName});return 1!==c.length?!1:c[0]},value:function(a){return(a=this.state(a))&&a.src}}})(wysihtml5);
198
+ (function(a){var c="<br>"+(a.browser.needsSpaceAfterLineBreak()?" ":"");a.commands.insertLineBreak={exec:function(b,d){a.commands.support(d)?(b.ownerDocument.execCommand(d,!1,null),a.browser.autoScrollsToCaret()||a.selection.scrollIntoView(b)):a.commands.exec("insertHTML",c)},state:function(){return!1},value:function(){}}})(wysihtml5);
199
+ (function(a){a.commands.insertOrderedList={exec:function(c,b){var d=c.ownerDocument,e,f,h;a.commands.support(b)?d.execCommand(b,!1,null):(e=a.selection.getSelectedNode(),(h=a.dom.getParentElement(e,{nodeName:["UL","OL"]},4))?a.selection.executeAndRestoreSimple(function(){"OL"===h.nodeName?a.dom.resolveList(h):("UL"===h.nodeName||"MENU"===h.nodeName)&&a.dom.renameElement(h,"ol")}):(f=d.createElement("span"),a.selection.surround(f),d=""===f.innerHTML||f.innerHTML===a.INVISIBLE_SPACE,a.selection.executeAndRestoreSimple(function(){h=
200
+ a.dom.convertToList(f,"ol")}),d&&a.selection.selectNode(h.querySelector("li"))))},state:function(a,b){try{return a.ownerDocument.queryCommandState(b)}catch(d){return!1}},value:function(){}}})(wysihtml5);
201
+ (function(a){a.commands.insertUnorderedList={exec:function(c,b){var d=c.ownerDocument,e,f,h;a.commands.support(b)?d.execCommand(b,!1,null):(e=a.selection.getSelectedNode(),(h=a.dom.getParentElement(e,{nodeName:["UL","OL"]}))?a.selection.executeAndRestoreSimple(function(){"UL"===h.nodeName?a.dom.resolveList(h):("OL"===h.nodeName||"MENU"===h.nodeName)&&a.dom.renameElement(h,"ul")}):(f=d.createElement("span"),a.selection.surround(f),d=""===f.innerHTML||f.innerHTML===a.INVISIBLE_SPACE,a.selection.executeAndRestoreSimple(function(){h=
202
+ a.dom.convertToList(f,"ul")}),d&&a.selection.selectNode(h.querySelector("li"))))},state:function(a,b){try{return a.ownerDocument.queryCommandState(b)}catch(d){return!1}},value:function(){}}})(wysihtml5);(function(a){a.commands.italic={exec:function(c,b){return a.commands.formatInline.exec(c,b,"i")},state:function(c,b){return a.commands.formatInline.state(c,b,"i")},value:function(){}}})(wysihtml5);
203
+ (function(a){var c=/wysiwyg-text-align-[a-z]+/g;a.commands.justifyCenter={exec:function(b){return a.commands.formatBlock.exec(b,"formatBlock",null,"wysiwyg-text-align-center",c)},state:function(b){return a.commands.formatBlock.state(b,"formatBlock",null,"wysiwyg-text-align-center",c)},value:function(){}}})(wysihtml5);
204
+ (function(a){var c=/wysiwyg-text-align-[a-z]+/g;a.commands.justifyLeft={exec:function(b){return a.commands.formatBlock.exec(b,"formatBlock",null,"wysiwyg-text-align-left",c)},state:function(b){return a.commands.formatBlock.state(b,"formatBlock",null,"wysiwyg-text-align-left",c)},value:function(){}}})(wysihtml5);
205
+ (function(a){var c=/wysiwyg-text-align-[a-z]+/g;a.commands.justifyRight={exec:function(b){return a.commands.formatBlock.exec(b,"formatBlock",null,"wysiwyg-text-align-right",c)},state:function(b){return a.commands.formatBlock.state(b,"formatBlock",null,"wysiwyg-text-align-right",c)},value:function(){}}})(wysihtml5);
206
+ (function(a){var c=/wysiwyg-text-decoration-underline/g;a.commands.underline={exec:function(b,d){return a.commands.formatInline.exec(b,d,"span","wysiwyg-text-decoration-underline",c)},state:function(b,d){return a.commands.formatInline.state(b,d,"span","wysiwyg-text-decoration-underline",c)},value:function(){}}})(wysihtml5);
207
+ (function(a){var c='<span id="_wysihtml5-undo" class="_wysihtml5-temp">'+a.INVISIBLE_SPACE+"</span>",b='<span id="_wysihtml5-redo" class="_wysihtml5-temp">'+a.INVISIBLE_SPACE+"</span>",d=a.dom;a.UndoManager=a.lang.Dispatcher.extend({constructor:function(b){this.editor=b;this.composerElement=b.composer.element;this.history=[this.editor.composer.getValue()];this.position=1;a.commands.support("insertHTML")&&this._observe()},_observe:function(){var e=this,f=this.editor.composer.sandbox.getDocument(),
208
+ h;d.observe(this.composerElement,"keydown",function(a){if(a.ctrlKey||a.metaKey){var b=a.keyCode,c=90===b&&a.shiftKey||89===b;90===b&&!a.shiftKey?(e.undo(),a.preventDefault()):c&&(e.redo(),a.preventDefault())}});d.observe(this.composerElement,"keydown",function(a){a=a.keyCode;a!==h&&(h=a,(8===a||46===a)&&e.transact())});var g,j,k=function(){for(var a;a=f.querySelector("._wysihtml5-temp");)a.parentNode.removeChild(a);clearInterval(g)};d.observe(this.composerElement,"contextmenu",function(){k();a.selection.executeAndRestoreSimple(function(){e.composerElement.lastChild&&
209
+ a.selection.setAfter(e.composerElement.lastChild);f.execCommand("insertHTML",!1,c);f.execCommand("insertHTML",!1,b);f.execCommand("undo",!1,null)});g=setInterval(function(){f.getElementById("_wysihtml5-redo")?(k(),e.redo()):f.getElementById("_wysihtml5-undo")||(k(),e.undo())},400);j||(j=!0,d.observe(document,"mousedown",k),d.observe(f,["mousedown","paste","cut","copy"],k))});this.editor.observe("newword:composer",function(){e.transact()}).observe("beforecommand:composer",function(){e.transact()})},
210
+ transact:function(){var a=this.history[this.position-1],b=this.editor.composer.getValue();if(b!=a){if(40<(this.history.length=this.position))this.history.shift(),this.position--;this.position++;this.history.push(b)}},undo:function(){this.transact();1>=this.position||(this.set(this.history[--this.position-1]),this.editor.fire("undo:composer"))},redo:function(){this.position>=this.history.length||(this.set(this.history[++this.position-1]),this.editor.fire("redo:composer"))},set:function(a){this.editor.composer.setValue(a);
211
+ this.editor.focus(!0)}})})(wysihtml5);
212
+ wysihtml5.views.View=Base.extend({constructor:function(a,c,b){this.parent=a;this.element=c;this.config=b;this._observeViewChange()},_observeViewChange:function(){var a=this;this.parent.observe("beforeload",function(){a.parent.observe("change_view",function(c){c===a.name?(a.parent.currentView=a,a.show(),setTimeout(function(){a.focus()},0)):a.hide()})})},focus:function(){if(this.element.ownerDocument.querySelector(":focus")!==this.element)try{this.element.focus()}catch(a){}},hide:function(){this.element.style.display=
213
+ "none"},show:function(){this.element.style.display=""},disable:function(){this.element.setAttribute("disabled","disabled")},enable:function(){this.element.removeAttribute("disabled")}});
214
+ (function(a){var c=a.dom,b=a.browser,d=a.selection,e=a.commands;a.views.Composer=a.views.View.extend({name:"composer",CARET_HACK:"<br>",constructor:function(a,b,c){this.base(a,b,c);this.textarea=this.parent.textarea;this._initSandbox()},clear:function(){this.element.innerHTML=b.displaysCaretInEmptyContentEditableCorrectly()?"":this.CARET_HACK},getValue:function(b){var c=this.isEmpty()?"":a.quirks.getCorrectInnerHTML(this.element);b&&(c=this.parent.parse(c));return c=a.lang.string(c).replace(a.INVISIBLE_SPACE).by("")},
215
+ setValue:function(a,b){b&&(a=this.parent.parse(a));this.element.innerHTML=a},show:function(){this.iframe.style.display=this._displayStyle||"";this.disable();this.enable()},hide:function(){this._displayStyle=c.getStyle("display").from(this.iframe);"none"===this._displayStyle&&(this._displayStyle=null);this.iframe.style.display="none"},disable:function(){this.element.removeAttribute("contentEditable");this.base()},enable:function(){this.element.setAttribute("contentEditable","true");this.base()},focus:function(a){this.base();
216
+ var b=this.element.lastChild;a&&b&&("BR"===b.nodeName?d.setBefore(this.element.lastChild):d.setAfter(this.element.lastChild))},getTextContent:function(){return c.getTextContent(this.element)},hasPlaceholderSet:function(){return this.getTextContent()==this.textarea.element.getAttribute("placeholder")},isEmpty:function(){var a=this.element.innerHTML;return""===a||a===this.CARET_HACK||this.hasPlaceholderSet()||""===this.getTextContent()&&!this.element.querySelector("blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea")},
217
+ _initSandbox:function(){var a=this;this.sandbox=new c.Sandbox(function(){a._create()},{stylesheets:this.config.stylesheets,uaCompatible:"IE=7"});this.iframe=this.sandbox.getIframe();var b=document.createElement("input");b.type="hidden";b.name="_wysihtml5_mode";b.value=1;var d=this.textarea.element;c.insert(this.iframe).after(d);c.insert(b).after(d)},_create:function(){var f=this;this.element=this.sandbox.getDocument().body;this.textarea=this.parent.textarea;this.element.innerHTML=this.textarea.getValue(!0);
218
+ this.enable();d.initialize(this.sandbox.getDocument());e.initialize(this.parent);c.copyAttributes("className,spellcheck,title,lang,dir,accessKey".split(",")).from(this.textarea.element).to(this.element);c.addClass(this.element,this.config.composerClassName);this.config.style&&this.style();this.observe();var h=this.config.name;h&&(c.addClass(this.element,h),c.addClass(this.iframe,h));(h="string"===typeof this.config.placeholder?this.config.placeholder:this.textarea.element.getAttribute("placeholder"))&&
219
+ c.simulatePlaceholder(this.parent,this,h);e.exec("styleWithCSS",!1);this._initAutoLinking();this._initObjectResizing();this._initUndoManager();(this.textarea.element.hasAttribute("autofocus")||document.querySelector(":focus")==this.textarea.element)&&setTimeout(function(){f.focus()},100);a.quirks.insertLineBreakOnReturn(this.element);b.clearsContentEditableCorrectly()||a.quirks.ensureProperClearing(this.element);b.clearsListsInContentEditableCorrectly()||a.quirks.ensureProperClearingOfLists(this.element);
220
+ this.initSync&&this.config.sync&&this.initSync();this.textarea.hide();this.parent.fire("beforeload").fire("load")},_initAutoLinking:function(){var f=b.canDisableAutoLinking(),h=b.doesAutoLinkingInContentEditable();f&&e.exec("autoUrlDetect",!1);if(this.config.autoLink){(!h||h&&f)&&this.parent.observe("newword:composer",function(){d.executeAndRestore(function(a,b){c.autoLink(b.parentNode)})});var g=this.sandbox.getDocument().getElementsByTagName("a"),j=c.autoLink.URL_REG_EXP,k=function(b){b=a.lang.string(c.getTextContent(b)).trim();
221
+ "www."===b.substr(0,4)&&(b="http://"+b);return b};c.observe(this.element,"keydown",function(a){if(g.length){var a=d.getSelectedNode(a.target.ownerDocument),b=c.getParentElement(a,{nodeName:"A"},4),e;b&&(e=k(b),setTimeout(function(){var a=k(b);a!==e&&a.match(j)&&b.setAttribute("href",a)},0))}})}},_initObjectResizing:function(){var d=["width","height"],h=d.length,g=this.element;e.exec("enableObjectResizing",this.config.allowObjectResizing);this.config.allowObjectResizing?b.supportsEvent("resizeend")&&
222
+ c.observe(g,"resizeend",function(b){for(var b=b.target||b.srcElement,c=b.style,e=0,n;e<h;e++)n=d[e],c[n]&&(b.setAttribute(n,parseInt(c[n],10)),c[n]="");a.quirks.redraw(g)}):b.supportsEvent("resizestart")&&c.observe(g,"resizestart",function(a){a.preventDefault()})},_initUndoManager:function(){new a.UndoManager(this.parent)}})})(wysihtml5);
223
+ (function(a){var c=a.dom,b=document,d=window,e=b.createElement("div"),f="background-color,color,cursor,font-family,font-size,font-style,font-variant,font-weight,line-height,letter-spacing,text-align,text-decoration,text-indent,text-rendering,word-break,word-wrap,word-spacing".split(","),h="background-color,border-collapse,border-bottom-color,border-bottom-style,border-bottom-width,border-left-color,border-left-style,border-left-width,border-right-color,border-right-style,border-right-width,border-top-color,border-top-style,border-top-width,clear,display,float,margin-bottom,margin-left,margin-right,margin-top,outline-color,outline-offset,outline-width,outline-style,padding-left,padding-right,padding-top,padding-bottom,position,top,left,right,bottom,z-index,vertical-align,text-align,-webkit-box-sizing,-moz-box-sizing,-ms-box-sizing,box-sizing,-webkit-box-shadow,-moz-box-shadow,-ms-box-shadow,box-shadow,-webkit-border-top-right-radius,-moz-border-radius-topright,border-top-right-radius,-webkit-border-bottom-right-radius,-moz-border-radius-bottomright,border-bottom-right-radius,-webkit-border-bottom-left-radius,-moz-border-radius-bottomleft,border-bottom-left-radius,-webkit-border-top-left-radius,-moz-border-radius-topleft,border-top-left-radius,width,height".split(","),
224
+ g="width,height,top,left,right,bottom".split(","),j=["html { height: 100%; }","body { min-height: 100%; padding: 0; margin: 0; margin-top: -1px; padding-top: 1px; }","._wysihtml5-temp { display: none; }",a.browser.isGecko?"body.placeholder { color: graytext !important; }":"body.placeholder { color: #a9a9a9 !important; }","body[disabled] { background-color: #eee !important; color: #999 !important; cursor: default !important; }","img:-moz-broken { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],
225
+ k=function(a){if(a.setActive)try{a.setActive()}catch(e){}else{var f=a.style,g=b.documentElement.scrollTop||b.body.scrollTop,h=b.documentElement.scrollLeft||b.body.scrollLeft,f={position:f.position,top:f.top,left:f.left,WebkitUserSelect:f.WebkitUserSelect};c.setStyles({position:"absolute",top:"-99999px",left:"-99999px",WebkitUserSelect:"none"}).on(a);a.focus();c.setStyles(f).on(a);d.scrollTo&&d.scrollTo(h,g)}};a.views.Composer.prototype.style=function(){var i=this,n=b.querySelector(":focus"),p=this.textarea.element,
226
+ q=p.hasAttribute("placeholder"),s=q&&p.getAttribute("placeholder");this.focusStylesHost=this.focusStylesHost||e.cloneNode(!1);this.blurStylesHost=this.blurStylesHost||e.cloneNode(!1);q&&p.removeAttribute("placeholder");p===n&&p.blur();c.copyStyles(h).from(p).to(this.iframe).andTo(this.blurStylesHost);c.copyStyles(f).from(p).to(this.element).andTo(this.blurStylesHost);c.insertCSS(j).into(this.element.ownerDocument);k(p);c.copyStyles(h).from(p).to(this.focusStylesHost);c.copyStyles(f).from(p).to(this.focusStylesHost);
227
+ var m=a.lang.array(h).without(["display"]);n?n.focus():p.blur();q&&p.setAttribute("placeholder",s);a.browser.hasCurrentStyleProperty()||c.observe(d,"resize",function(){var a=c.getStyle("display").from(p);p.style.display="";c.copyStyles(g).from(p).to(i.iframe).andTo(i.focusStylesHost).andTo(i.blurStylesHost);p.style.display=a});this.parent.observe("focus:composer",function(){c.copyStyles(m).from(i.focusStylesHost).to(i.iframe);c.copyStyles(f).from(i.focusStylesHost).to(i.element)});this.parent.observe("blur:composer",
228
+ function(){c.copyStyles(m).from(i.blurStylesHost).to(i.iframe);c.copyStyles(f).from(i.blurStylesHost).to(i.element)});return this}})(wysihtml5);
229
+ (function(a){var c=a.dom,b=a.browser,d={66:"bold",73:"italic",85:"underline"};a.views.Composer.prototype.observe=function(){var e=this,f=this.getValue(),h=this.sandbox.getIframe(),g=this.element,j=b.supportsEventsInIframeCorrectly()?g:this.sandbox.getWindow(),k=b.supportsEvent("drop")?["drop","paste"]:["dragdrop","paste"];c.observe(h,"DOMNodeRemoved",function(){clearInterval(i);e.parent.fire("destroy:composer")});var i=setInterval(function(){c.contains(document.documentElement,h)||(clearInterval(i),
230
+ e.parent.fire("destroy:composer"))},250);c.observe(j,"focus",function(){e.parent.fire("focus").fire("focus:composer");setTimeout(function(){f=e.getValue()},0)});c.observe(j,"blur",function(){f!==e.getValue()&&e.parent.fire("change").fire("change:composer");e.parent.fire("blur").fire("blur:composer")});a.browser.isIos()&&c.observe(g,"blur",function(){var b=g.ownerDocument.createElement("input"),c=document.documentElement.scrollTop||document.body.scrollTop,d=document.documentElement.scrollLeft||document.body.scrollLeft;
231
+ try{a.selection.insertNode(b)}catch(e){g.appendChild(b)}b.focus();b.parentNode.removeChild(b);window.scrollTo(d,c)});c.observe(g,"dragenter",function(){e.parent.fire("unset_placeholder")});b.firesOnDropOnlyWhenOnDragOverIsCancelled()&&c.observe(g,["dragover","dragenter"],function(a){a.preventDefault()});c.observe(g,k,function(c){var d=c.dataTransfer,f;d&&b.supportsDataTransfer()&&(f=d.getData("text/html")||d.getData("text/plain"));f?(g.focus(),a.commands.exec("insertHTML",f),e.parent.fire("paste").fire("paste:composer"),
232
+ c.stopPropagation(),c.preventDefault()):setTimeout(function(){e.parent.fire("paste").fire("paste:composer")},0)});c.observe(g,"keyup",function(b){b=b.keyCode;(b===a.SPACE_KEY||b===a.ENTER_KEY)&&e.parent.fire("newword:composer")});this.parent.observe("paste:composer",function(){setTimeout(function(){e.parent.fire("newword:composer")},0)});b.canSelectImagesInContentEditable()||c.observe(g,"mousedown",function(b){var c=b.target;"IMG"===c.nodeName&&(a.selection.selectNode(c),b.preventDefault())});c.observe(g,
233
+ "keydown",function(b){var c=d[b.keyCode];if((b.ctrlKey||b.metaKey)&&c)a.commands.exec(c),b.preventDefault()});c.observe(g,"keydown",function(b){var c=a.selection.getSelectedNode(!0),d=b.keyCode;if(c&&"IMG"===c.nodeName&&(d===a.BACKSPACE_KEY||d===a.DELETE_KEY))d=c.parentNode,d.removeChild(c),"A"===d.nodeName&&!d.firstChild&&d.parentNode.removeChild(d),setTimeout(function(){a.quirks.redraw(g)},0),b.preventDefault()});var n={IMG:"Image: ",A:"Link: "};c.observe(g,"mouseover",function(a){var a=a.target,
234
+ b=a.nodeName;"A"!==b&&"IMG"!==b||(b=n[b]+(a.getAttribute("href")||a.getAttribute("src")),a.setAttribute("title",b))})}})(wysihtml5);
235
+ (function(a){a.views.Synchronizer=Base.extend({constructor:function(a,b,d){this.editor=a;this.textarea=b;this.composer=d;this._observe()},fromComposerToTextarea:function(c){this.textarea.setValue(a.lang.string(this.composer.getValue()).trim(),c)},fromTextareaToComposer:function(a){var b=this.textarea.getValue();b?this.composer.setValue(b,a):(this.composer.clear(),this.editor.fire("set_placeholder"))},sync:function(a){"textarea"===this.editor.currentView.name?this.fromTextareaToComposer(a):this.fromComposerToTextarea(a)},
236
+ _observe:function(){var c,b=this,d=this.textarea.element.form,e=function(){c=setInterval(function(){b.fromComposerToTextarea()},400)},f=function(){clearInterval(c);c=null};e();d&&(a.dom.observe(d,"submit",function(){b.sync(!0)}),a.dom.observe(d,"reset",function(){setTimeout(function(){b.fromTextareaToComposer()},0)}));this.editor.observe("change_view",function(a){"composer"===a&&!c?(b.fromTextareaToComposer(!0),e()):"textarea"===a&&(b.fromComposerToTextarea(!0),f())});this.editor.observe("destroy:composer",
237
+ f)}})})(wysihtml5);
238
+ wysihtml5.views.Textarea=wysihtml5.views.View.extend({name:"textarea",constructor:function(a,c,b){this.base(a,c,b);this._observe()},clear:function(){this.element.value=""},getValue:function(a){var c=this.isEmpty()?"":this.element.value;a&&(c=this.parent.parse(c));return c},setValue:function(a,c){c&&(a=this.parent.parse(a));this.element.value=a},hasPlaceholderSet:function(){var a=wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),c=this.element.getAttribute("placeholder")||null,b=this.element.value;
239
+ return a&&!b||b===c},isEmpty:function(){return!wysihtml5.lang.string(this.element.value).trim()||this.hasPlaceholderSet()},_observe:function(){var a=this.element,c=this.parent,b={focusin:"focus",focusout:"blur"},d=wysihtml5.browser.supportsEvent("focusin")?["focusin","focusout","change"]:["focus","blur","change"];c.observe("beforeload",function(){wysihtml5.dom.observe(a,d,function(a){a=b[a.type]||a.type;c.fire(a).fire(a+":textarea")});wysihtml5.dom.observe(a,["paste","drop"],function(){setTimeout(function(){c.fire("paste").fire("paste:textarea")},
240
+ 0)})})}});
241
+ (function(a){var c=a.dom;a.toolbar.Dialog=a.lang.Dispatcher.extend({constructor:function(a,c){this.link=a;this.container=c},_observe:function(){if(!this._observed){var b=this,d=function(a){var c=b._serialize();c==b.elementToChange?b.fire("edit",c):b.fire("save",c);b.hide();a.preventDefault();a.stopPropagation()};c.observe(b.link,"click",function(){c.hasClass(b.link,"wysihtml5-command-dialog-opened")&&setTimeout(function(){b.hide()},0)});c.observe(this.container,"keydown",function(c){var e=c.keyCode;
242
+ e===a.ENTER_KEY&&d(c);e===a.ESCAPE_KEY&&b.hide()});c.delegate(this.container,"[data-wysihtml5-dialog-action=save]","click",d);c.delegate(this.container,"[data-wysihtml5-dialog-action=cancel]","click",function(a){b.fire("cancel");b.hide();a.preventDefault();a.stopPropagation()});for(var e=this.container.querySelectorAll("input, select, textarea"),f=0,h=e.length,g=function(){clearInterval(b.interval)};f<h;f++)c.observe(e[f],"change",g);this._observed=!0}},_serialize:function(){for(var a=this.elementToChange||
243
+ {},c=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),e=c.length,f=0;f<e;f++)a[c[f].getAttribute("data-wysihtml5-dialog-field")]=c[f].value;return a},_interpolate:function(){for(var a,c,e=document.querySelector(":focus"),f=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),h=f.length,g=0;g<h;g++)a=f[g],a!==e&&(c=a.getAttribute("data-wysihtml5-dialog-field"),c=this.elementToChange?this.elementToChange[c]||"":a.defaultValue,a.value=c)},show:function(a){var d=this,e=this.container.querySelector("input, select, textarea");
244
+ this.elementToChange=a;this._observe();this._interpolate();a&&(this.interval=setInterval(function(){d._interpolate()},500));c.addClass(this.link,"wysihtml5-command-dialog-opened");this.container.style.display="";this.fire("show");if(e&&!a)try{e.focus()}catch(f){}},hide:function(){clearInterval(this.interval);this.elementToChange=null;c.removeClass(this.link,"wysihtml5-command-dialog-opened");this.container.style.display="none";this.fire("hide")}})})(wysihtml5);
245
+ (function(a){var c=a.dom,b={position:"relative"},d={left:0,margin:0,opacity:0,overflow:"hidden",padding:0,position:"absolute",top:0,zIndex:1},e={cursor:"inherit",fontSize:"50px",height:"50px",marginTop:"-25px",outline:0,padding:0,position:"absolute",right:"-4px",top:"50%"},f={"x-webkit-speech":"",speech:""};a.toolbar.Speech=function(h,g){var j=document.createElement("input");if(a.browser.supportsSpeechApiOn(j)){var k=document.createElement("div");a.lang.object(d).merge({width:g.offsetWidth+"px",height:g.offsetHeight+
246
+ "px"});c.insert(j).into(k);c.insert(k).into(g);c.setStyles(e).on(j);c.setAttributes(f).on(j);c.setStyles(d).on(k);c.setStyles(b).on(g);c.observe(j,"onwebkitspeechchange"in j?"webkitspeechchange":"speechchange",function(){h.execCommand("insertText",j.value);j.value=""});c.observe(j,"click",function(a){c.hasClass(g,"wysihtml5-command-disabled")&&a.preventDefault();a.stopPropagation()})}else g.style.display="none"}})(wysihtml5);
247
+ (function(a){var c=a.dom;a.toolbar.Toolbar=Base.extend({constructor:function(b,c){this.editor=b;this.container="string"===typeof c?document.getElementById(c):c;this.composer=b.composer;this._getLinks("command");this._getLinks("action");this._observe();this.show();for(var e=this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),f=e.length,h=0;h<f;h++)new a.toolbar.Speech(this,e[h])},_getLinks:function(b){for(var c=this[b+"Links"]=a.lang.array(this.container.querySelectorAll("a[data-wysihtml5-"+
248
+ b+"]")).get(),e=c.length,f=0,h=this[b+"Mapping"]={},g,j,k,i;f<e;f++)g=c[f],j=g.getAttribute("data-wysihtml5-"+b),k=g.getAttribute("data-wysihtml5-"+b+"-value"),i=this._getDialog(g,j),h[j+":"+k]={link:g,name:j,value:k,dialog:i,state:!1}},_getDialog:function(b,c){var e=this,f=this.container.querySelector("[data-wysihtml5-dialog='"+c+"']"),h,g;f&&(h=new a.toolbar.Dialog(b,f),h.observe("show",function(){g=a.selection.getBookmark();e.editor.fire("show:dialog",{command:c,dialogContainer:f,commandLink:b})}),
249
+ h.observe("save",function(h){e.editor.focus(!1);g&&a.selection.setBookmark(g);e._execCommand(c,h);e.editor.fire("save:dialog",{command:c,dialogContainer:f,commandLink:b})}),h.observe("cancel",function(){e.editor.focus(!1);e.editor.fire("cancel:dialog",{command:c,dialogContainer:f,commandLink:b})}));return h},execCommand:function(a,c){if(!this.commandsDisabled){var e=this.commandMapping[a+":"+c];e&&e.dialog&&!e.state?e.dialog.show():this._execCommand(a,c)}},_execCommand:function(b,c){this.editor.focus(!1);
250
+ a.commands.exec(b,c);this._updateLinkStates()},execAction:function(a){var c=this.editor;switch(a){case "change_view":c.currentView===c.textarea?c.fire("change_view","composer"):c.fire("change_view","textarea")}},_observe:function(){for(var a=this,d=this.editor,e=this.container,f=this.commandLinks.concat(this.actionLinks),h=f.length,g=0;g<h;g++)c.setAttributes({href:"javascript:;",unselectable:"on"}).on(f[g]);c.delegate(e,"[data-wysihtml5-command]","mousedown",function(a){a.preventDefault()});c.delegate(e,
251
+ "[data-wysihtml5-command]","click",function(c){var d=this.getAttribute("data-wysihtml5-command"),e=this.getAttribute("data-wysihtml5-command-value");a.execCommand(d,e);c.preventDefault()});c.delegate(e,"[data-wysihtml5-action]","click",function(c){var d=this.getAttribute("data-wysihtml5-action");a.execAction(d);c.preventDefault()});d.observe("focus:composer",function(){a.bookmark=null;clearInterval(a.interval);a.interval=setInterval(function(){a._updateLinkStates()},500)});d.observe("blur:composer",
252
+ function(){clearInterval(a.interval)});d.observe("destroy:composer",function(){clearInterval(a.interval)});d.observe("change_view",function(d){setTimeout(function(){a.commandsDisabled="composer"!==d;a._updateLinkStates();a.commandsDisabled?c.addClass(e,"wysihtml5-commands-disabled"):c.removeClass(e,"wysihtml5-commands-disabled")},0)})},_updateLinkStates:function(){var b=this.commandMapping,d,e,f;for(d in b)f=b[d],this.commandsDisabled?(e=!1,c.removeClass(f.link,"wysihtml5-command-active"),f.dialog&&
253
+ f.dialog.hide()):(e=a.commands.state(f.name,f.value),a.lang.object(e).isArray()&&(e=1===e.length?e[0]:!0),c.removeClass(f.link,"wysihtml5-command-disabled")),f.state!==e&&((f.state=e)?(c.addClass(f.link,"wysihtml5-command-active"),f.dialog&&("object"===typeof e?f.dialog.show(e):f.dialog.hide())):(c.removeClass(f.link,"wysihtml5-command-active"),f.dialog&&f.dialog.hide()))},show:function(){this.container.style.display=""},hide:function(){this.container.style.display="none"}})})(wysihtml5);
254
+ (function(a){var c={name:void 0,style:!0,toolbar:void 0,autoLink:!0,parserRules:{tags:{br:{},span:{},div:{},p:{}},classes:{}},parser:a.dom.parse,composerClassName:"wysihtml5-editor",bodyClassName:"wysihtml5-supported",stylesheets:[],placeholderText:void 0,allowObjectResizing:!0,supportTouchDevices:!0};a.Editor=a.lang.Dispatcher.extend({constructor:function(b,d){this.textareaElement="string"===typeof b?document.getElementById(b):b;this.config=a.lang.object({}).merge(c).merge(d).get();this.currentView=
255
+ this.textarea=new a.views.Textarea(this,this.textareaElement,this.config);this._isCompatible=a.browser.supported();if(!this._isCompatible||!this.config.supportTouchDevices&&a.browser.isTouchDevice()){var e=this;setTimeout(function(){e.fire("beforeload").fire("load")},0)}else{a.dom.addClass(document.body,this.config.bodyClassName);this.currentView=this.composer=new a.views.Composer(this,this.textareaElement,this.config);"function"===typeof this.config.parser&&this._initParser();this.observe("beforeload",
256
+ function(){this.synchronizer=new a.views.Synchronizer(this,this.textarea,this.composer);this.config.toolbar&&(this.toolbar=new a.toolbar.Toolbar(this,this.config.toolbar))});try{console.log("Heya! This page is using wysihtml5 for rich text editing. Check out https://github.com/xing/wysihtml5")}catch(f){}}},isCompatible:function(){return this._isCompatible},clear:function(){this.currentView.clear();return this},getValue:function(a){return this.currentView.getValue(a)},setValue:function(a,c){if(!a)return this.clear();
257
+ this.currentView.setValue(a,c);return this},focus:function(a){this.currentView.focus(a);return this},disable:function(){this.currentView.disable();return this},enable:function(){this.currentView.enable();return this},isEmpty:function(){return this.currentView.isEmpty()},hasPlaceholderSet:function(){return this.currentView.hasPlaceholderSet()},parse:function(b){var c=this.config.parser(b,this.config.parserRules,this.composer.sandbox.getDocument(),!0);"object"===typeof b&&a.quirks.redraw(b);return c},
258
+ _initParser:function(){this.observe("paste:composer",function(){var b=this;a.selection.executeAndRestore(function(){a.quirks.cleanPastedHTML(b.composer.element);b.parse(b.composer.element)},!0)});this.observe("paste:textarea",function(){this.textarea.setValue(this.parse(this.textarea.getValue()))})}})})(wysihtml5);
@@ -0,0 +1,36 @@
1
+ ul.wysihtml5-toolbar {
2
+ margin: 0;
3
+ padding: 0;
4
+ display: block;
5
+ }
6
+
7
+ ul.wysihtml5-toolbar::after {
8
+ clear: both;
9
+ display: table;
10
+ content: "";
11
+ }
12
+
13
+ ul.wysihtml5-toolbar > li {
14
+ float: left;
15
+ display: list-item;
16
+ list-style: none;
17
+ margin: 0 5px 10px 0;
18
+ }
19
+
20
+ ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
21
+ font-weight: bold;
22
+ }
23
+
24
+ ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
25
+ font-style: italic;
26
+ }
27
+
28
+ ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
29
+ background-image: none;
30
+ -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
31
+ -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
32
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
33
+ background-color: #E6E6E6;
34
+ background-color: #D9D9D9 9;
35
+ outline: 0;
36
+ }
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap-wysihtml5-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Gonzalo Rodríguez-Baltanás Díaz
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: railties
16
+ requirement: &70194232882180 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70194232882180
25
+ - !ruby/object:Gem::Dependency
26
+ name: bundler
27
+ requirement: &70194232873300 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70194232873300
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &70194232366020 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70194232366020
47
+ description: A wysiwyg text editor for Twitter Bootstrap
48
+ email:
49
+ - siotopo@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - README.md
57
+ - Rakefile
58
+ - bootstrap-wysihtml5-rails.gemspec
59
+ - lib/bootstrap-wysihtml5-rails.rb
60
+ - lib/bootstrap-wysihtml5-rails/engine.rb
61
+ - lib/bootstrap-wysihtml5-rails/railtie.rb
62
+ - lib/bootstrap-wysihtml5-rails/version.rb
63
+ - vendor/assets/javascripts/bootstrap-wysihtml5.js
64
+ - vendor/assets/javascripts/wysihtml5.js
65
+ - vendor/assets/stylesheets/bootstrap-wysihtml5.css
66
+ homepage: https://github.com/Nerian/bootstrap-datepicker-rails
67
+ licenses: []
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ segments:
79
+ - 0
80
+ hash: 2916060995147173201
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ segments:
88
+ - 0
89
+ hash: 2916060995147173201
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 1.8.17
93
+ signing_key:
94
+ specification_version: 3
95
+ summary: A wysiwyg text editor for Twitter Bootstrap
96
+ test_files: []