diff --git a/requirements.txt b/requirements.txt index e3efc4975..d3d59df42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,15 @@ Django==1.4 +PyMeta==0.5.0 certifi==0.0.8 chardet==1.0.1 +distribute==0.6.24 +django-autoslug==1.5.0 +gunicorn==0.14.2 httplib2==0.7.4 +-e git://github.com/brosner/python-oauth2.git@82a05f96878f187f67c1af44befc1bec562e5c1f#egg=oauth2-dev oauthlib==0.1.3 pyasn1==0.1.3 +pybars==0.0.1 requests==0.12.1 rsa==3.0.1 wsgiref==0.1.2 -psycopg2==2.4.5 -gunicorn==0.14.2 --e git://github.com/brosner/python-oauth2.git#egg=oauth2 -pybars==0.0.1 diff --git a/syte/auth_decorator.py b/syte/auth_decorator.py new file mode 100644 index 000000000..091c69b49 --- /dev/null +++ b/syte/auth_decorator.py @@ -0,0 +1,62 @@ +# Modified from http://djangosnippets.org/snippets/243/ +import base64 + +from django.http import HttpResponse +from django.contrib.auth import authenticate, login +from django.conf import settings + +############################################################################# +# +def view_or_basicauth(view, request, realm = "", *args, **kwargs): + if 'HTTP_AUTHORIZATION' in request.META: + auth = request.META['HTTP_AUTHORIZATION'].split() + if len(auth) == 2: + # NOTE: We are only support basic authentication for now. + # + if auth[0].lower() == "basic": + uname, passwd = base64.b64decode(auth[1]).split(':') + if uname == settings.BUILTIN_POST_USERNAME and passwd == settings.BUILTIN_POST_PASSWORD: + return view(request, *args, **kwargs) + + response = HttpResponse() + response.status_code = 401 + response['WWW-Authenticate'] = 'Basic realm="%s"' % realm + return response + +############################################################################# +# +def logged_in_or_basicauth(realm = ""): + """ + A simple decorator that requires a user to be logged in. If they are not + logged in the request is examined for a 'authorization' header. + + If the header is present it is tested for basic authentication and + the user is logged in with the provided credentials. + + If the header is not present a http 401 is sent back to the + requestor to provide credentials. + + The purpose of this is that in several django projects I have needed + several specific views that need to support basic authentication, yet the + web site as a whole used django's provided authentication. + + The uses for this are for urls that are access programmatically such as + by rss feed readers, yet the view requires a user to be logged in. Many rss + readers support supplying the authentication credentials via http basic + auth (and they do NOT support a redirect to a form where they post a + username/password.) + + Use is simple: + + @logged_in_or_basicauth + def your_view: + ... + + You can provide the name of the realm to ask for authentication within. + """ + def view_decorator(func): + def wrapper(request, *args, **kwargs): + return view_or_basicauth(func, request, + realm, *args, **kwargs) + return wrapper + return view_decorator \ No newline at end of file diff --git a/syte/models.py b/syte/models.py new file mode 100644 index 000000000..4bbdf46ea --- /dev/null +++ b/syte/models.py @@ -0,0 +1,20 @@ +from django.db import models +from autoslug import AutoSlugField + + +class Tag(models.Model): + name = models.CharField(max_length=50) + + +class Post(models.Model): + title = models.CharField(max_length=200) + text = models.TextField() + + published = models.BooleanField(default=False) + publish_date = models.DateTimeField(auto_now_add=True, null=True) + + slug = AutoSlugField(populate_from='title',always_update=True) + tags = models.ManyToManyField(Tag, related_name="posts") + + class Meta: + ordering = ["-publish_date"] \ No newline at end of file diff --git a/syte/settings.py b/syte/settings.py index e23383f3e..c84f452dc 100644 --- a/syte/settings.py +++ b/syte/settings.py @@ -65,3 +65,10 @@ from syte_settings import * +if BUILTIN_POST_ENABLED: + + INSTALLED_APPS += ("syte",) + + DATABASES = { + 'default': BUILTIN_POST_DATABASE_SETTINGS + } diff --git a/syte/static/css/bootstrap.css b/syte/static/css/bootstrap.css new file mode 100644 index 000000000..d0e5fbf24 --- /dev/null +++ b/syte/static/css/bootstrap.css @@ -0,0 +1,1114 @@ +/*! + * Bootstrap v2.0.4 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.input-block-level { + display: block; + width: 100%; + min-height: 28px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} +.row { + margin-left: -20px; + *zoom: 1; +} +.row:before, +.row:after { + display: table; + content: ""; +} +.row:after { + clear: both; +} +[class*="span"] { + float: left; + margin-left: 20px; +} +.container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.span12 { + width: 940px; +} +.span11 { + width: 860px; +} +.span10 { + width: 780px; +} +.span9 { + width: 700px; +} +.span8 { + width: 620px; +} +.span7 { + width: 540px; +} +.span6 { + width: 460px; +} +.span5 { + width: 380px; +} +.span4 { + width: 300px; +} +.span3 { + width: 220px; +} +.span2 { + width: 140px; +} +.span1 { + width: 60px; +} +.offset12 { + margin-left: 980px; +} +.offset11 { + margin-left: 900px; +} +.offset10 { + margin-left: 820px; +} +.offset9 { + margin-left: 740px; +} +.offset8 { + margin-left: 660px; +} +.offset7 { + margin-left: 580px; +} +.offset6 { + margin-left: 500px; +} +.offset5 { + margin-left: 420px; +} +.offset4 { + margin-left: 340px; +} +.offset3 { + margin-left: 260px; +} +.offset2 { + margin-left: 180px; +} +.offset1 { + margin-left: 100px; +} +.row-fluid { + width: 100%; + *zoom: 1; +} +.row-fluid:before, +.row-fluid:after { + display: table; + content: ""; +} +.row-fluid:after { + clear: both; +} +.row-fluid [class*="span"] { + display: block; + width: 100%; + min-height: 28px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin-left: 2.127659574%; + *margin-left: 2.0744680846382977%; +} +.row-fluid [class*="span"]:first-child { + margin-left: 0; +} +.row-fluid .span12 { + width: 99.99999998999999%; + *width: 99.94680850063828%; +} +.row-fluid .span11 { + width: 91.489361693%; + *width: 91.4361702036383%; +} +.row-fluid .span10 { + width: 82.97872339599999%; + *width: 82.92553190663828%; +} +.row-fluid .span9 { + width: 74.468085099%; + *width: 74.4148936096383%; +} +.row-fluid .span8 { + width: 65.95744680199999%; + *width: 65.90425531263828%; +} +.row-fluid .span7 { + width: 57.446808505%; + *width: 57.3936170156383%; +} +.row-fluid .span6 { + width: 48.93617020799999%; + *width: 48.88297871863829%; +} +.row-fluid .span5 { + width: 40.425531911%; + *width: 40.3723404216383%; +} +.row-fluid .span4 { + width: 31.914893614%; + *width: 31.8617021246383%; +} +.row-fluid .span3 { + width: 23.404255317%; + *width: 23.3510638276383%; +} +.row-fluid .span2 { + width: 14.89361702%; + *width: 14.8404255306383%; +} +.row-fluid .span1 { + width: 6.382978723%; + *width: 6.329787233638298%; +} +.container { + margin-right: auto; + margin-left: auto; + *zoom: 1; +} +.container:before, +.container:after { + display: table; + content: ""; +} +.container:after { + clear: both; +} +.container-fluid { + padding-right: 20px; + padding-left: 20px; + *zoom: 1; +} +.container-fluid:before, +.container-fluid:after { + display: table; + content: ""; +} +.container-fluid:after { + clear: both; +} +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} +.table { + width: 100%; + margin-bottom: 18px; +} +.table th, +.table td { + padding: 8px; + line-height: 18px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table th { + font-weight: bold; +} +.table thead th { + vertical-align: bottom; +} +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} +.table tbody + tbody { + border-top: 2px solid #dddddd; +} +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapsed; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} +.table-bordered thead:first-child tr:first-child th:first-child, +.table-bordered tbody:first-child tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} +.table-bordered thead:first-child tr:first-child th:last-child, +.table-bordered tbody:first-child tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} +.table-bordered thead:last-child tr:last-child th:first-child, +.table-bordered tbody:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} +.table-bordered thead:last-child tr:last-child th:last-child, +.table-bordered tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} +.table-striped tbody tr:nth-child(odd) td, +.table-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.table tbody tr:hover td, +.table tbody tr:hover th { + background-color: #f5f5f5; +} +table .span1 { + float: none; + width: 44px; + margin-left: 0; +} +table .span2 { + float: none; + width: 124px; + margin-left: 0; +} +table .span3 { + float: none; + width: 204px; + margin-left: 0; +} +table .span4 { + float: none; + width: 284px; + margin-left: 0; +} +table .span5 { + float: none; + width: 364px; + margin-left: 0; +} +table .span6 { + float: none; + width: 444px; + margin-left: 0; +} +table .span7 { + float: none; + width: 524px; + margin-left: 0; +} +table .span8 { + float: none; + width: 604px; + margin-left: 0; +} +table .span9 { + float: none; + width: 684px; + margin-left: 0; +} +table .span10 { + float: none; + width: 764px; + margin-left: 0; +} +table .span11 { + float: none; + width: 844px; + margin-left: 0; +} +table .span12 { + float: none; + width: 924px; + margin-left: 0; +} +table .span13 { + float: none; + width: 1004px; + margin-left: 0; +} +table .span14 { + float: none; + width: 1084px; + margin-left: 0; +} +table .span15 { + float: none; + width: 1164px; + margin-left: 0; +} +table .span16 { + float: none; + width: 1244px; + margin-left: 0; +} +table .span17 { + float: none; + width: 1324px; + margin-left: 0; +} +table .span18 { + float: none; + width: 1404px; + margin-left: 0; +} +table .span19 { + float: none; + width: 1484px; + margin-left: 0; +} +table .span20 { + float: none; + width: 1564px; + margin-left: 0; +} +table .span21 { + float: none; + width: 1644px; + margin-left: 0; +} +table .span22 { + float: none; + width: 1724px; + margin-left: 0; +} +table .span23 { + float: none; + width: 1804px; + margin-left: 0; +} +table .span24 { + float: none; + width: 1884px; + margin-left: 0; +} +form { + margin: 0 0 18px; +} +fieldset { + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 27px; + font-size: 19.5px; + line-height: 36px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +legend small { + font-size: 13.5px; + color: #999999; +} +label, +input, +button, +select, +textarea { + font-size: 13px; + font-weight: normal; + line-height: 18px; +} +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +label { + display: block; + margin-bottom: 5px; +} +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + display: inline-block; + height: 18px; + padding: 4px; + margin-bottom: 9px; + font-size: 13px; + line-height: 18px; + color: #555555; +} +input, +textarea { + width: 210px; +} +textarea { + height: auto; +} +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus, +.uneditable-input:focus { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); +} +input[type="radio"], +input[type="checkbox"] { + margin: 3px 0; + *margin-top: 0; + /* IE7 */ + + line-height: normal; + cursor: pointer; +} +input[type="submit"], +input[type="reset"], +input[type="button"], +input[type="radio"], +input[type="checkbox"] { + width: auto; +} +.uneditable-textarea { + width: auto; + height: auto; +} +select, +input[type="file"] { + height: 28px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 28px; +} +select { + width: 220px; + border: 1px solid #bbb; +} +select[multiple], +select[size] { + height: auto; +} +select:focus, +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.radio, +.checkbox { + min-height: 18px; + padding-left: 18px; +} +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -18px; +} +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} +.input-mini { + width: 60px; +} +.input-small { + width: 90px; +} +.input-medium { + width: 150px; +} +.input-large { + width: 210px; +} +.input-xlarge { + width: 270px; +} +.input-xxlarge { + width: 530px; +} +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"] { + float: none; + margin-left: 0; +} +.input-append input[class*="span"], +.input-append .uneditable-input[class*="span"], +.input-prepend input[class*="span"], +.input-prepend .uneditable-input[class*="span"], +.row-fluid .input-prepend [class*="span"], +.row-fluid .input-append [class*="span"] { + display: inline-block; +} +input, +textarea, +.uneditable-input { + margin-left: 0; +} +input.span12, textarea.span12, .uneditable-input.span12 { + width: 930px; +} +input.span11, textarea.span11, .uneditable-input.span11 { + width: 850px; +} +input.span10, textarea.span10, .uneditable-input.span10 { + width: 770px; +} +input.span9, textarea.span9, .uneditable-input.span9 { + width: 690px; +} +input.span8, textarea.span8, .uneditable-input.span8 { + width: 610px; +} +input.span7, textarea.span7, .uneditable-input.span7 { + width: 530px; +} +input.span6, textarea.span6, .uneditable-input.span6 { + width: 450px; +} +input.span5, textarea.span5, .uneditable-input.span5 { + width: 370px; +} +input.span4, textarea.span4, .uneditable-input.span4 { + width: 290px; +} +input.span3, textarea.span3, .uneditable-input.span3 { + width: 210px; +} +input.span2, textarea.span2, .uneditable-input.span2 { + width: 130px; +} +input.span1, textarea.span1, .uneditable-input.span1 { + width: 50px; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + cursor: not-allowed; + background-color: #eeeeee; + border-color: #ddd; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"][readonly], +input[type="checkbox"][readonly] { + background-color: transparent; +} +.control-group.warning > label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} +.control-group.warning .checkbox, +.control-group.warning .radio, +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; + border-color: #c09853; +} +.control-group.warning .checkbox:focus, +.control-group.warning .radio:focus, +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: 0 0 6px #dbc59e; + -moz-box-shadow: 0 0 6px #dbc59e; + box-shadow: 0 0 6px #dbc59e; +} +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} +.control-group.error > label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} +.control-group.error .checkbox, +.control-group.error .radio, +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; + border-color: #b94a48; +} +.control-group.error .checkbox:focus, +.control-group.error .radio:focus, +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: 0 0 6px #d59392; + -moz-box-shadow: 0 0 6px #d59392; + box-shadow: 0 0 6px #d59392; +} +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} +.control-group.success > label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} +.control-group.success .checkbox, +.control-group.success .radio, +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; + border-color: #468847; +} +.control-group.success .checkbox:focus, +.control-group.success .radio:focus, +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: 0 0 6px #7aba7b; + -moz-box-shadow: 0 0 6px #7aba7b; + box-shadow: 0 0 6px #7aba7b; +} +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} +input:focus:required:invalid, +textarea:focus:required:invalid, +select:focus:required:invalid { + color: #b94a48; + border-color: #ee5f5b; +} +input:focus:required:invalid:focus, +textarea:focus:required:invalid:focus, +select:focus:required:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +.form-actions { + padding: 17px 20px 18px; + margin-top: 18px; + margin-bottom: 18px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; +} +.form-actions:before, +.form-actions:after { + display: table; + content: ""; +} +.form-actions:after { + clear: both; +} +.uneditable-input { + overflow: hidden; + white-space: nowrap; + cursor: not-allowed; + background-color: #ffffff; + border-color: #eee; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); +} +:-moz-placeholder { + color: #999999; +} +:-ms-input-placeholder { + color: #999999; +} +::-webkit-input-placeholder { + color: #999999; +} +.help-block, +.help-inline { + color: #555555; +} +.help-block { + display: block; + margin-bottom: 9px; +} +.help-inline { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + vertical-align: middle; + padding-left: 5px; +} +.input-prepend, +.input-append { + margin-bottom: 5px; +} +.input-prepend input, +.input-append input, +.input-prepend select, +.input-append select, +.input-prepend .uneditable-input, +.input-append .uneditable-input { + position: relative; + margin-bottom: 0; + *margin-left: 0; + vertical-align: middle; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend input:focus, +.input-append input:focus, +.input-prepend select:focus, +.input-append select:focus, +.input-prepend .uneditable-input:focus, +.input-append .uneditable-input:focus { + z-index: 2; +} +.input-prepend .uneditable-input, +.input-append .uneditable-input { + border-left-color: #ccc; +} +.input-prepend .add-on, +.input-append .add-on { + display: inline-block; + width: auto; + height: 18px; + min-width: 16px; + padding: 4px 5px; + font-weight: normal; + line-height: 18px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + vertical-align: middle; + background-color: #eeeeee; + border: 1px solid #ccc; +} +.input-prepend .add-on, +.input-append .add-on, +.input-prepend .btn, +.input-append .btn { + margin-left: -1px; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.input-prepend .active, +.input-append .active { + background-color: #a9dba9; + border-color: #46a546; +} +.input-prepend .add-on, +.input-prepend .btn { + margin-right: -1px; +} +.input-prepend .add-on:first-child, +.input-prepend .btn:first-child { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append input, +.input-append select, +.input-append .uneditable-input { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .uneditable-input { + border-right-color: #ccc; + border-left-color: #eee; +} +.input-append .add-on:last-child, +.input-append .btn:last-child { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend.input-append input, +.input-prepend.input-append select, +.input-prepend.input-append .uneditable-input { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.input-prepend.input-append .add-on:first-child, +.input-prepend.input-append .btn:first-child { + margin-right: -1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend.input-append .add-on:last-child, +.input-prepend.input-append .btn:last-child { + margin-left: -1px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.search-query { + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ + + margin-bottom: 0; + -webkit-border-radius: 14px; + -moz-border-radius: 14px; + border-radius: 14px; +} +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input, +.form-search .input-prepend, +.form-inline .input-prepend, +.form-horizontal .input-prepend, +.form-search .input-append, +.form-inline .input-append, +.form-horizontal .input-append { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-bottom: 0; +} +.form-search .hide, +.form-inline .hide, +.form-horizontal .hide { + display: none; +} +.form-search label, +.form-inline label { + display: inline-block; +} +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + margin-bottom: 0; +} +.form-search .radio, +.form-search .checkbox, +.form-inline .radio, +.form-inline .checkbox { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"], +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-right: 3px; + margin-left: 0; +} +.control-group { + margin-bottom: 9px; +} +legend + .control-group { + margin-top: 18px; + -webkit-margin-top-collapse: separate; +} +.form-horizontal .control-group { + margin-bottom: 18px; + *zoom: 1; +} +.form-horizontal .control-group:before, +.form-horizontal .control-group:after { + display: table; + content: ""; +} +.form-horizontal .control-group:after { + clear: both; +} +.form-horizontal .control-label { + float: left; + width: 140px; + padding-top: 5px; + text-align: right; +} +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 160px; + *margin-left: 0; +} +.form-horizontal .controls:first-child { + *padding-left: 160px; +} +.form-horizontal .help-block { + margin-top: 9px; + margin-bottom: 0; +} +.form-horizontal .form-actions { + padding-left: 160px; +} diff --git a/syte/static/css/tables.css b/syte/static/css/tables.css new file mode 100644 index 000000000..b99b282c9 --- /dev/null +++ b/syte/static/css/tables.css @@ -0,0 +1,422 @@ +/*! + * Bootstrap v2.0.4 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.input-block-level { + display: block; + width: 100%; + min-height: 28px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} +.row { + margin-left: -20px; + *zoom: 1; +} +.row:before, +.row:after { + display: table; + content: ""; +} +.row:after { + clear: both; +} +[class*="span"] { + float: left; + margin-left: 20px; +} +.container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.span12 { + width: 940px; +} +.span11 { + width: 860px; +} +.span10 { + width: 780px; +} +.span9 { + width: 700px; +} +.span8 { + width: 620px; +} +.span7 { + width: 540px; +} +.span6 { + width: 460px; +} +.span5 { + width: 380px; +} +.span4 { + width: 300px; +} +.span3 { + width: 220px; +} +.span2 { + width: 140px; +} +.span1 { + width: 60px; +} +.offset12 { + margin-left: 980px; +} +.offset11 { + margin-left: 900px; +} +.offset10 { + margin-left: 820px; +} +.offset9 { + margin-left: 740px; +} +.offset8 { + margin-left: 660px; +} +.offset7 { + margin-left: 580px; +} +.offset6 { + margin-left: 500px; +} +.offset5 { + margin-left: 420px; +} +.offset4 { + margin-left: 340px; +} +.offset3 { + margin-left: 260px; +} +.offset2 { + margin-left: 180px; +} +.offset1 { + margin-left: 100px; +} +.row-fluid { + width: 100%; + *zoom: 1; +} +.row-fluid:before, +.row-fluid:after { + display: table; + content: ""; +} +.row-fluid:after { + clear: both; +} +.row-fluid [class*="span"] { + display: block; + width: 100%; + min-height: 28px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin-left: 2.127659574%; + *margin-left: 2.0744680846382977%; +} +.row-fluid [class*="span"]:first-child { + margin-left: 0; +} +.row-fluid .span12 { + width: 99.99999998999999%; + *width: 99.94680850063828%; +} +.row-fluid .span11 { + width: 91.489361693%; + *width: 91.4361702036383%; +} +.row-fluid .span10 { + width: 82.97872339599999%; + *width: 82.92553190663828%; +} +.row-fluid .span9 { + width: 74.468085099%; + *width: 74.4148936096383%; +} +.row-fluid .span8 { + width: 65.95744680199999%; + *width: 65.90425531263828%; +} +.row-fluid .span7 { + width: 57.446808505%; + *width: 57.3936170156383%; +} +.row-fluid .span6 { + width: 48.93617020799999%; + *width: 48.88297871863829%; +} +.row-fluid .span5 { + width: 40.425531911%; + *width: 40.3723404216383%; +} +.row-fluid .span4 { + width: 31.914893614%; + *width: 31.8617021246383%; +} +.row-fluid .span3 { + width: 23.404255317%; + *width: 23.3510638276383%; +} +.row-fluid .span2 { + width: 14.89361702%; + *width: 14.8404255306383%; +} +.row-fluid .span1 { + width: 6.382978723%; + *width: 6.329787233638298%; +} +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} +.table { + width: 100%; + margin-bottom: 18px; +} +.table th, +.table td { + padding: 8px; + line-height: 18px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table th { + font-weight: bold; +} +.table thead th { + vertical-align: bottom; +} +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} +.table tbody + tbody { + border-top: 2px solid #dddddd; +} +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapsed; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} +.table-bordered thead:first-child tr:first-child th:first-child, +.table-bordered tbody:first-child tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} +.table-bordered thead:first-child tr:first-child th:last-child, +.table-bordered tbody:first-child tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} +.table-bordered thead:last-child tr:last-child th:first-child, +.table-bordered tbody:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} +.table-bordered thead:last-child tr:last-child th:last-child, +.table-bordered tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} +.table-striped tbody tr:nth-child(odd) td, +.table-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.table tbody tr:hover td, +.table tbody tr:hover th { + background-color: #f5f5f5; +} +table .span1 { + float: none; + width: 44px; + margin-left: 0; +} +table .span2 { + float: none; + width: 124px; + margin-left: 0; +} +table .span3 { + float: none; + width: 204px; + margin-left: 0; +} +table .span4 { + float: none; + width: 284px; + margin-left: 0; +} +table .span5 { + float: none; + width: 364px; + margin-left: 0; +} +table .span6 { + float: none; + width: 444px; + margin-left: 0; +} +table .span7 { + float: none; + width: 524px; + margin-left: 0; +} +table .span8 { + float: none; + width: 604px; + margin-left: 0; +} +table .span9 { + float: none; + width: 684px; + margin-left: 0; +} +table .span10 { + float: none; + width: 764px; + margin-left: 0; +} +table .span11 { + float: none; + width: 844px; + margin-left: 0; +} +table .span12 { + float: none; + width: 924px; + margin-left: 0; +} +table .span13 { + float: none; + width: 1004px; + margin-left: 0; +} +table .span14 { + float: none; + width: 1084px; + margin-left: 0; +} +table .span15 { + float: none; + width: 1164px; + margin-left: 0; +} +table .span16 { + float: none; + width: 1244px; + margin-left: 0; +} +table .span17 { + float: none; + width: 1324px; + margin-left: 0; +} +table .span18 { + float: none; + width: 1404px; + margin-left: 0; +} +table .span19 { + float: none; + width: 1484px; + margin-left: 0; +} +table .span20 { + float: none; + width: 1564px; + margin-left: 0; +} +table .span21 { + float: none; + width: 1644px; + margin-left: 0; +} +table .span22 { + float: none; + width: 1724px; + margin-left: 0; +} +table .span23 { + float: none; + width: 1804px; + margin-left: 0; +} +table .span24 { + float: none; + width: 1884px; + margin-left: 0; +} diff --git a/syte/static/js/libs/redactor.js b/syte/static/js/libs/redactor.js new file mode 100644 index 000000000..f96ae955b --- /dev/null +++ b/syte/static/js/libs/redactor.js @@ -0,0 +1,3387 @@ +/* + Redactor v7.7.1 + Updated: July 7, 2012 + + http://redactorjs.com/ + + Copyright (c) 2009-2012, Imperavi Ltd. + License: http://redactorjs.com/license/ + + Usage: $('#content').redactor(); +*/ + +if (typeof RELANG === 'undefined') +{ + var RELANG = {}; +} + +var RLANG = { + html: 'HTML', + video: 'Insert Video...', + image: 'Insert Image...', + table: 'Table', + link: 'Link', + link_insert: 'Insert Link ...', + unlink: 'Unlink', + formatting: 'Formatting', + paragraph: 'Paragraph', + quote: 'Quote', + code: 'Code', + header1: 'Header 1', + header2: 'Header 2', + header3: 'Header 3', + header4: 'Header 4', + bold: 'Bold', + italic: 'Italic', + fontcolor: 'Font Color', + backcolor: 'Back Color', + unorderedlist: 'Unordered List', + orderedlist: 'Ordered List', + outdent: 'Outdent', + indent: 'Indent', + cancel: 'Cancel', + insert: 'Insert', + save: 'Save', + _delete: 'Delete', + insert_table: 'Insert Table...', + insert_row_above: 'Add Row Above', + insert_row_below: 'Add Row Below', + insert_column_left: 'Add Column Left', + insert_column_right: 'Add Column Right', + delete_column: 'Delete Column', + delete_row: 'Delete Row', + delete_table: 'Delete Table', + rows: 'Rows', + columns: 'Columns', + add_head: 'Add Head', + delete_head: 'Delete Head', + title: 'Title', + image_position: 'Position', + none: 'None', + left: 'Left', + right: 'Right', + image_web_link: 'Image Web Link', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video Embed Code', + file: 'Insert File...', + upload: 'Upload', + download: 'Download', + choose: 'Choose', + or_choose: 'Or choose', + drop_file_here: 'Drop file here', + align_left: 'Align Left', + align_center: 'Align Center', + align_right: 'Align Right', + align_justify: 'Justify', + horizontalrule: 'Insert Horizontal Rule', + fullscreen: 'Fullscreen', + deleted: 'Deleted', + anchor: 'Anchor' +}; + + + + +(function($){ + + "use strict"; + + // Plugin + jQuery.fn.redactor = function(option) + { + return this.each(function() + { + var $obj = $(this); + + var data = $obj.data('redactor'); + if (!data) + { + $obj.data('redactor', (data = new Redactor(this, option))); + } + }); + }; + + + // Initialization + var Redactor = function(element, options) + { + // Element + this.$el = $(element); + + // Lang + if (typeof options !== 'undefined' && typeof options.lang !== 'undefined' && options.lang !== 'en' && typeof RELANG[options.lang] !== 'undefined') + { + RLANG = RELANG[options.lang]; + } + + // Options + this.opts = $.extend({ + + lang: 'en', + direction: 'ltr', // ltr or rtl + + callback: false, // function + keyupCallback: false, // function + keydownCallback: false, // function + execCommandCallback: false, // function + + path: false, + css: 'style.css', + focus: false, + resize: true, + autoresize: false, + fixed: false, + + autoformat: true, + cleanUp: true, + removeStyles: false, + removeClasses: false, + convertDivs: true, + convertLinks: true, + xhtml: false, + + handler: false, // false or url + + autosave: false, // false or url + interval: 60, // seconds + + imageGetJson: false, // url (ex. /folder/images.json ) or false + + imageUpload: false, // url + imageUploadCallback: false, // function + + fileUpload: false, // url + fileUploadCallback: false, // function + + observeImages: true, + visual: true, + fullscreen: false, + overlay: true, // modal overlay + + buttonsCustom: {}, + buttonsAdd: [], + buttons: ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', + 'image', 'video', 'file', 'table', 'link', '|', + 'fontcolor', 'backcolor', '|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', + 'horizontalrule', 'fullscreen'], + + colors: [ + '#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00', + '#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca', + '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694', + '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314', + '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100', + '#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'], + + // private + allEmptyHtml: '


', + mozillaEmptyHtml: '

 

', + + // modal windows container + modal_file: String() + + '
' + + '' + + '' + + '
' + + '' + + '
' + + '
', + + modal_image_edit: String() + + '' + + '' + + '' + + '' + + '' + + '' + + '', + + modal_image: String() + + '
' + + '' + RLANG.upload + '' + + '' + RLANG.choose + '' + + '' + RLANG.link + '' + + '
' + + '
' + + '
' + + '' + + '
' + + '' + + '
' + + '' + + '', + + modal_link: String() + + '
' + + '
' + + 'URL' + + 'Email' + + '' + RLANG.anchor + '' + + '
' + + '' + + '
' + + '' + + '' + + '
' + + '' + + '' + + '
' + + '', + + modal_table: String() + + '' + + '' + + '' + + '' + + '', + + modal_video: String() + + '
' + + '' + + '' + + '
' + + '', + + + toolbar: { + html: + { + title: RLANG.html, + func: 'toggle' + }, + formatting: + { + title: RLANG.formatting, + func: 'show', + dropdown: + { + p: + { + title: RLANG.paragraph, + exec: 'formatblock' + }, + blockquote: + { + title: RLANG.quote, + exec: 'formatblock', + className: 'redactor_format_blockquote' + }, + pre: + { + title: RLANG.code, + exec: 'formatblock', + className: 'redactor_format_pre' + }, + h1: + { + title: RLANG.header1, + exec: 'formatblock', + className: 'redactor_format_h1' + }, + h2: + { + title: RLANG.header2, + exec: 'formatblock', + className: 'redactor_format_h2' + }, + h3: + { + title: RLANG.header3, + exec: 'formatblock', + className: 'redactor_format_h3' + }, + h4: + { + title: RLANG.header4, + exec: 'formatblock', + className: 'redactor_format_h4' + } + } + }, + bold: + { + title: RLANG.bold, + exec: 'bold' + }, + italic: + { + title: RLANG.italic, + exec: 'italic' + }, + deleted: + { + title: RLANG.deleted, + exec: 'strikethrough' + }, + unorderedlist: + { + title: '• ' + RLANG.unorderedlist, + exec: 'insertunorderedlist' + }, + orderedlist: + { + title: '1. ' + RLANG.orderedlist, + exec: 'insertorderedlist' + }, + outdent: + { + title: '< ' + RLANG.outdent, + exec: 'outdent' + }, + indent: + { + title: '> ' + RLANG.indent, + exec: 'indent' + }, + image: + { + title: RLANG.image, + func: 'showImage' + }, + video: + { + title: RLANG.video, + func: 'showVideo' + }, + file: + { + title: RLANG.file, + func: 'showFile' + }, + table: + { + title: RLANG.table, + func: 'show', + dropdown: + { + insert_table: + { + title: RLANG.insert_table, + func: 'showTable' + }, + separator_drop1: + { + name: 'separator' + }, + insert_row_above: + { + title: RLANG.insert_row_above, + func: 'insertRowAbove' + }, + insert_row_below: + { + title: RLANG.insert_row_below, + func: 'insertRowBelow' + }, + insert_column_left: + { + title: RLANG.insert_column_left, + func: 'insertColumnLeft' + }, + insert_column_right: + { + title: RLANG.insert_column_right, + func: 'insertColumnRight' + }, + separator_drop2: + { + name: 'separator' + }, + add_head: + { + title: RLANG.add_head, + func: 'addHead' + }, + delete_head: + { + title: RLANG.delete_head, + func: 'deleteHead' + }, + separator_drop3: + { + name: 'separator' + }, + delete_column: + { + title: RLANG.delete_column, + func: 'deleteColumn' + }, + delete_row: + { + title: RLANG.delete_row, + func: 'deleteRow' + }, + delete_table: + { + title: RLANG.delete_table, + func: 'deleteTable' + } + } + }, + link: + { + title: RLANG.link, + func: 'show', + dropdown: + { + link: + { + title: RLANG.link_insert, + func: 'showLink' + }, + unlink: + { + title: RLANG.unlink, + exec: 'unlink' + } + } + }, + fontcolor: + { + title: RLANG.fontcolor, + func: 'show' + }, + backcolor: + { + title: RLANG.backcolor, + func: 'show' + }, + alignleft: + { + exec: 'JustifyLeft', + title: RLANG.align_left + }, + aligncenter: + { + exec: 'JustifyCenter', + title: RLANG.align_center + }, + alignright: + { + exec: 'JustifyRight', + title: RLANG.align_right + }, + justify: + { + exec: 'justifyfull', + title: RLANG.align_justify + }, + horizontalrule: + { + exec: 'inserthorizontalrule', + title: RLANG.horizontalrule + }, + fullscreen: + { + title: RLANG.fullscreen, + func: 'fullscreen' + } + } + + + }, options, this.$el.data()); + + this.dropdowns = []; + + // Init + this.init(); + }; + + // Functionality + Redactor.prototype = { + + + // Initialization + init: function() + { + // get path to styles + this.getPath(); + + if (this.opts.toolbar !== false) + { + $.extend(this.opts.toolbar, this.opts.buttonsCustom); + + $.each(this.opts.buttonsAdd, $.proxy(function(i,s) + { + this.opts.buttons.push(s); + }, this)); + } + + // get dimensions + this.height = this.$el.css('height'); + this.width = this.$el.css('width'); + + // construct editor + this.build(); + + // get html + var html = this.$el.val(); + + // preformatter + html = this.preformater(html); + + // conver newlines to p + if (this.opts.autoformat) + { + html = this.paragraphy(html); + } + + // enable + this.$editor = this.enable(html); + + // focus always on page + this.observeFocus(); + + // cleanup + if (this.opts.cleanUp === true) + { + $(this.doc).bind('paste', $.proxy(function(e) + { + setTimeout($.proxy(function () + { + var marker = Math.floor(Math.random() * 99999); + var marker_text = ''; + if ($.browser.mozilla) marker_text = ' '; + var node = $('' + marker_text + ''); + this.insertNodeAtCaret(node.get(0)); + + this.pasteCleanUp(marker); + + }, this), 100); + + }, this)); + } + + // keyup + $(this.doc).keyup($.proxy(function(e) + { + var key = e.keyCode || e.which; + + // callback as you type + if (typeof this.opts.keyupCallback === 'function') + { + this.opts.keyupCallback(this, e); + } + + if (this.opts.autoformat) + { + // if empty + if (key === 8 || key === 46) + { + return this.formatEmpty(e); + } + + // new line p + if (key === 13 && !e.shiftKey && !e.ctrlKey && !e.metaKey) + { + return this.formatNewLine(e); + } + } + + this.syncCode(); + + }, this)); + + // toolbar + this.buildToolbar(); + + // resizer + if (this.opts.autoresize === false) + { + this.buildResizer(); + } + else + { + this.observeAutoResize(); + } + + // shortcuts + this.shortcuts(); + + // autosave + this.autoSave(); + + // observers + this.observeImages(); + this.observeTables(); + + // fullscreen on start + if (this.opts.fullscreen) + { + this.opts.fullscreen = false; + this.fullscreen(); + } + + // focus + if (this.opts.focus) + { + this.focus(); + } + + // fixed + if (this.opts.fixed) + { + this.observeScroll(); + $(document).scroll($.proxy(this.observeScroll, this)); + } + + // callback + if (typeof this.opts.callback === 'function') + { + this.opts.callback(this); + } + + }, + shortcuts: function() + { + $(this.doc).keydown($.proxy(function(e) + { + var key = e.keyCode || e.which; + + // callback keydown + if (typeof this.opts.keydownCallback === 'function') + { + this.opts.keydownCallback(this, e); + } + + if (e.ctrlKey) + { + if (key === 90) + { + this._shortcuts(e, 'undo'); // Ctrl + z + } + else if (key === 90 && e.shiftKey) + { + this._shortcuts(e, 'redo'); // Ctrl + Shift + z + } + else if (key === 77) + { + this._shortcuts(e, 'removeFormat'); // Ctrl + m + } + else if (key === 66) + { + this._shortcuts(e, 'bold'); // Ctrl + b + } + else if (key === 73) + { + this._shortcuts(e, 'italic'); // Ctrl + i + } + else if (key === 74) + { + this._shortcuts(e, 'insertunorderedlist'); // Ctrl + j + } + else if (key === 75) + { + this._shortcuts(e, 'insertorderedlist'); // Ctrl + k + } + else if (key === 76) + { + this._shortcuts(e, 'superscript'); // Ctrl + l + } + else if (key === 72) + { + this._shortcuts(e, 'subscript'); // Ctrl + h + } + } + + if (!e.shiftKey && key === 9) + { + this._shortcuts(e, 'indent'); // Tab + } + else if (e.shiftKey && key === 9 ) + { + this._shortcuts(e, 'outdent'); // Shift + tab + } + + // safari shift key + enter + if ($.browser.webkit && navigator.userAgent.indexOf('Chrome') === -1) + { + return this.safariShiftKeyEnter(e, key); + } + + }, this)); + + }, + _shortcuts: function(e, cmd) + { + if (e.preventDefault) + { + e.preventDefault(); + } + this.execCommand(cmd, null); + }, + getPath: function() + { + if (this.opts.path !== false) + { + return this.opts.path; + } + + $('script').each($.proxy(function(i,s) + { + if (s.src) + { + // Match redactor.js or redactor.min.js, followed by an optional querystring (often used for cache purposes) + var regexp = new RegExp(/\/redactor(\.min)?\.js(\?.*)?/); + if (s.src.match(regexp)) + { + this.opts.path = s.src.replace(regexp, ''); + } + } + }, this)); + + }, + build: function() + { + // container + this.$box = $('
'); + + // frame + this.$frame = $(''); + + // hide textarea + this.$el.css('width', '100%').hide(); + + // append box and frame + this.$box.insertAfter(this.$el).append(this.$frame).append(this.$el); + + }, + write: function(html) + { + this.doc.open(); + this.doc.write(html); + this.doc.close(); + }, + enable: function(html) + { + this.doc = this.getDoc(this.$frame.get(0)); + + if (this.doc !== null) + { + this.write(this.setDoc(html)); + if ($.browser.mozilla) + { + this.doc.execCommand("useCSS", false, true); + } + return $(this.doc).find('#page'); + } + else + { + return false; + } + }, + setDoc: function(html) + { + var frameHtml = '\n' + + '' + + '
' + + html + + '
'; + + return frameHtml; + }, + getDoc: function(frame) + { + if (frame.contentDocument) + { + return frame.contentDocument; + } + else if (frame.contentWindow && frame.contentWindow.document) + { + return frame.contentWindow.document; + } + else if (frame.document) + { + return frame.document; + } + else + { + return null; + } + }, + focus: function() + { + this.$editor.focus(); + }, + syncCode: function() + { + var html = this.formatting(this.$editor.html()); + this.$el.val(html); + }, + + // API functions + setCode: function(html) + { + html = this.preformater(html); + + this.$editor.html(html).focus(); + + this.syncCode(); + }, + getCode: function() + { + var html = this.$editor ? this.$editor.html() : this.$el.val(); + html = this.reformater(html); + + return html; + }, + insertHtml: function(html) + { + this.execCommand('inserthtml', html); + this.observeImages(); + }, + destroy: function() + { + var html = this.getCode(); + + this.$box.after(this.$el); + this.$box.remove(); + this.$el.val(html).show(); + + for (var i = 0; i < this.dropdowns.length; i++) + { + this.dropdowns[i].remove(); + delete(this.dropdowns[i]); + } + + }, + handler: function() + { + $.ajax({ + url: this.opts.handler, + type: 'POST', + data: 'redactor=' + escape(encodeURIComponent(this.getCode())), + success: $.proxy(function(data) + { + this.setCode(data); + this.syncCode(); + + }, this) + }); + + }, + // end API functions + + // OBSERVERS + observeFocus: function() + { + if ($(this.doc).find('body').height() < $(this.$frame.get(0).contentWindow).height()) + { + $(this.doc).click($.proxy(function(e) { this.$editor.focus(); }, this)); + } + }, + observeImages: function() + { + if (this.opts.observeImages === false) + { + return false; + } + + if ($.browser.mozilla) + { + this.doc.execCommand("enableObjectResizing", false, "false"); + } + + $(this.doc).find('img').each($.proxy(function(i,s) + { + if ($.browser.msie) $(s).attr('unselectable', 'on'); + this.resizeImage(s); + + }, this)); + + }, + observeTables: function() + { + $(this.doc).find('body').find('table').click($.proxy(this.tableObserver, this)); + }, + observeScroll: function() + { + var scrolltop = $(document).scrollTop(); + var boxtop = this.$box.offset().top; + + if (scrolltop > boxtop) + { + this.fixed = true; + this.$toolbar.css({ position: 'fixed', width: '100%' }); + } + else + { + this.fixed = false; + this.$toolbar.css({ position: 'relative', width: 'auto' }); + } + }, + observeAutoResize: function() + { + this.$editor.css({ 'min-height': this.$el.height() + 'px' }); + $(this.doc).find('body').css({ 'overflow': 'hidden' }); + this.setAutoSize(false); + $(this.doc).keyup($.proxy(this.setAutoSize, this)); + }, + setAutoSize: function(e) + { + var key = false; + if (e !== false) + { + key = e.keyCode || e.which; + } + + var height = this.$editor.outerHeight(true); + + if (e === true && (key === 8 || key === 46)) + { + this.$frame.height(height); + } + else + { + this.$frame.height(height+30); + } + + + }, + + + // EXECCOMMAND + execCommand: function(cmd, param) + { + if (this.opts.visual && this.doc) + { + try + { + if ($.browser.msie) + { + this.focus(); + } + + if (cmd === 'inserthtml' && $.browser.msie) + { + this.doc.selection.createRange().pasteHTML(param); + } + else if (cmd === 'formatblock' && $.browser.msie) + { + this.doc.execCommand(cmd, false, '<' +param + '>'); + } + else + { + this.doc.execCommand(cmd, false, param); + } + + this.syncCode(); + this.focus(); + + if (typeof this.opts.execCommandCallback === 'function') + { + this.opts.execCommandCallback(this, cmd); + } + } + catch (e) { } + + } + }, + + // FORMAT NEW LINE + formatNewLine: function(e) + { + var parent = this.getParentNode(); + if (parent.nodeName === 'DIV' && parent.id === 'page') + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var element = $(this.getCurrentNode()); + if (element.get(0).tagName === 'DIV' && (element.html() === '' || element.html() === '
')) + { + var newElement = $('

').append(element.clone().get(0).childNodes); + element.replaceWith(newElement); + newElement.html('
'); + this.setFocusNode(newElement.get(0)); + + this.syncCode(); + return false; + } + else + { + this.syncCode(); + } + + // convert links + if (this.opts.convertLinks) + { + this.$editor.linkify(); + } + } + else + { + this.syncCode(); + return true; + } + }, + + // SAFARI SHIFT KEY + ENTER + safariShiftKeyEnter: function(e, key) + { + if (e.shiftKey && key === 13) + { + e.preventDefault(); + + var node1 = $('
'); + this.insertNodeAtCaret(node1.get(0)); + this.setFocusNode(node1.get(0)); + + this.syncCode(); + + return false; + } + else + { + return true; + } + }, + + // FORMAT EMPTY + formatEmpty: function(e) + { + var html = $.trim(this.$editor.html()); + + if ($.browser.mozilla) + { + html = html.replace(/
/gi, ''); + } + + if (html === '') + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var nodehtml = this.opts.allEmptyHtml; + if ($.browser.mozilla) + { + nodehtml = this.opts.mozillaEmptyHtml; + } + + var node = $(nodehtml).get(0); + this.$editor.html(node); + this.setFocusNode(node); + + this.syncCode(); + return false; + } + else + { + this.syncCode(); + } + }, + + // PARAGRAPHY + paragraphy: function (str) + { + str = $.trim(str); + if (str === '') + { + if (!$.browser.mozilla) + { + return this.opts.allEmptyHtml; + } + else + { + return this.opts.mozillaEmptyHtml; + } + } + + // convert div to p + if (this.opts.convertDivs) str = str.replace(/([\w\W]*?)<\/div>/gi, '

$2

'); + + // inner functions + var X = function(x, a, b) { return x.replace(new RegExp(a, 'g'), b); }; + var R = function(a, b) { return X(str, a, b); }; + + // block elements + var blocks = '(table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|style|script|object|input|param|p|h[1-6])'; + + str += '\n'; + + R('
\\s*
', '\n\n'); + R('(<' + blocks + '[^>]*>)', '\n$1'); + R('()', '$1\n\n'); + R('\r\n|\r', '\n'); // newlines + R('\n\n+', '\n\n'); // remove duplicates + R('\n?((.|\n)+?)$', '

$1

\n'); // including one at the end + R('

\\s*?

', ''); // remove empty p + R('

(]*>\\s*)', '$1

'); + R('

([^<]+)\\s*?(]*>)', '

$1

$2'); + R('

\\s*(]*>)\\s*

', '$1'); + R('

(', '$1'); + R('

\\s*(]*>)', '$1'); + R('(]*>)\\s*

', '$1'); + R('(]*>)\\s*
', '$1'); + R('
(\\s*]*>)', '$1'); + + // pre + if (str.indexOf(')((.|\n)*?)', function(m0, m1, m2, m3) + { + return X(m1, '\\\\([\'\"\\\\])', '$1') + X(X(X(m3, '

', '\n'), '

|
', ''), '\\\\([\'\"\\\\])', '$1') + ''; + }); + } + + return R('\n

$', '

'); + }, + + // PREPARE FORMATER + preformater: function(html) + { + if (html !== null) + { + html = html.replace(/
/gi,'
'); + //html = html.replace(/]*>([\w\W]*?)

([\w\W]*?)<\/p>([\w\W]*?)<\/blockquote[^>]*>/gi,'

$1$2
$3
'); + html = html.replace(/]*>([\w\W]*?)<\/strong[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/em[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/del[^>]*>/gi,'$1'); + } + else + { + html = ''; + } + + return html; + }, + + // REVERT FORMATER + reformater: function(html) + { + html = html.replace(/
/gi,'
'); + html = html.replace(/]*>([\w\W]*?)<\/b[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/i[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/strike[^>]*>/gi,'$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + + return html; + }, + + // REMOVE TAGS + stripTags: function(html) + { + var allowed = ["code", "span", "div", "label", "a", "br", "p", "b", "i", "del", "strike", "img", "video", "audio", "iframe", "object", "embed", "param", "blockquote", "mark", "cite", "small", "ul", "ol", "li", "hr", "dl", "dt", "dd", "sup", "sub", "big", "pre", "code", "figure", "figcaption", "strong", "em", "table", "tr", "td", "th", "tbody", "thead", "tfoot", "h1", "h2", "h3", "h4", "h5", "h6"]; + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; + return html.replace(tags, function ($0, $1) + { + return $.inArray($1.toLowerCase(), allowed) > '-1' ? $0 : ''; + }); + }, + cleanStyles: function (properties, str, m) + { + + var attr = m.split('='); + var prop = attr[1].split(';'); + + var t = ''; + $.each(prop, function(z,s) + { + if (typeof s == 'undefined') return true; + if (s == '"' || s == "'") return true; + + s = s.replace(/(^"|^')/,'').replace(/("$|'$)/,'').replace(/"(.*?)"/gi, ''); + s = $.trim(s); + + var p = s.split(':'); + + if (typeof p[1] !== 'undefined' && (p[1].search('pt') === -1 && p[1].search('cm') === -1)) + { + if ($.inArray($.trim(p[0]), properties) != '-1') t += s + '; '; + } + }); + + return str.replace(m, 'style="' + t + '"'); + }, + + + // PASTE CLEANUP + pasteCleanUp: function(marker) + { + var html = this.$editor.html(); + + // remove comments and php tags + html = html.replace(/|<\?(?:php)?[\s\S]*?\?>/gi, '') + + // remove formatting + html = this.formattingRemove(html); + + // remove tags + html = this.stripTags(html); + + // remove classes + if (this.opts.removeClasses) + { + html = html.replace(/ class="([\w\W]*?)"/gi, ''); + } + else + { + html = html.replace(/\s*class="TOC(.*?)"/gi, "" ); + html = html.replace(/\s*class="Heading(.*?)"/gi, "" ); + html = html.replace(/\s*class="Body(.*?)"/gi, "" ); + html = html.replace(/\sclass="Nonformat"/gi, ''); + html = html.replace(/\sclass="Mso(.*?)"/gi, ''); + html = html.replace(/\sclass="Apple(.*?)"/gi, ''); + html = html.replace(/"Times New Roman"/gi, ''); + } + + var attributes = ['width', 'height', 'src', 'style', 'href', 'frameborder', 'class', 'id', 'rel', 'unselectable']; + var properties = ['color', 'background-color', 'font-style', 'margin', 'margin-top', 'margin-bottom', 'margin-left', 'margin-right', 'text-align', 'width', 'height', 'cursor', 'float']; + + // remove attributes + var matches = html.match(/([\w\-.:]+)\s*=\s*("[^"]*"|'[^']*'|[\w\-.:]+)/gi); + $.each(matches, $.proxy(function(i,m) + { + var attr = m.split('='); + if ($.inArray(attr[0], attributes) == '-1') + { + html = html.replace(m, ''); + } + + // remove styles + if (this.opts.removeStyles === false && attr[0] == 'style') + { + html = this.cleanStyles(properties, html, m); + } + + }, this)); + + // remove styles + if (this.opts.removeStyles === false) + { + html = html.replace(/background-color:(\s+)transparent;\s/gi, ''); + html = html.replace(/font-style:(\s+)normal;\s/gi, ''); + } + else + { + html = html.replace(/ style="([\w\W]*?)"/gi, ''); + } + + // remove empty styles + html = html.replace(/((\s{2,})?|\s)style=(""|'')/gi, ''); + + // remove nbsp + html = html.replace(/( ){1,}/gi, ' '); + + // remove empty span + html = html.replace(/(\s)?<\/span>/gi, ' '); + + // remove double white spaces + html = html.replace(/\s{2,}/g, ' '); + + // remove span without styles + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$2'); + + // empty tags + html = this.formattingEmptyTags(html); + + // add formatting before + html = this.formattingAddBefore(html); + + // add formatting after + html = this.formattingAddAfter(html); + + // indenting + html = this.formattingIndenting(html); + + // dirty paragraphs + html = html.replace(/

/gi, ""); + html = html.replace(/

\s+\n+<(.*?)/gi, "<$1"); + html = html.replace(/<\/(.*?)>\s+\n+<\/p>/gi, ""); + html = html.replace(/

(\s)?<\/p>/gi, ''); + html = html.replace(/

<\/p>/gi, ''); + + // remove google docs marker + html = html.replace(/([\w\W]*?)<\/b>/gi, "$2"); + + // trim spaces + html = html.replace(/; ">/gi, ';">'); + + // SET HTML + this.$editor.html(html); + + // RETURN FOCUS + var node = $(this.doc.body).find('#pastemarkerend' + marker).get(0); + this.setFocusNode(node); + + this.syncCode(); + + + setTimeout($.proxy(function() + { + // remove pastemarker + $(this.doc.body).find('span[rel=pastemarkerend]').remove(); + + if (this.opts.autoresize === true) this.setAutoSize(false); + + this.observeImages(); + this.observeTables(); + + }, this), 100); + + + }, + + // TEXTAREA CODE FORMATTING + formattingRemove: function(html) + { + html = html.replace(/\s{2,}/g, ' '); + html = html.replace(/\n/g, ' '); + html = html.replace(/[\t]*/g, ''); + html = html.replace(/\n\s*\n/g, "\n"); + html = html.replace(/^[\s\n]*/g, ''); + html = html.replace(/[\s\n]*$/g, ''); + html = html.replace(/>\s+<'); + + return html; + }, + formattingIndenting: function(html) + { + html = html.replace(/

  • /g, "\t"); + + return html; + }, + formattingEmptyTags: function(html) + { + var etags = ["
    ","
    \\s*
    ","\\s*","
      ","
        ","
      1. ","
        ","","\\s*", " ", "\\s*", " ", "

        \\s*

        ", "

         

        ", "

        \\s*
        \\s*

        ", "
        \\s*
        ", "
        \\s*
        \\s*
        "]; + for (var i = 0; i < etags.length; ++i) + { + var bbb = etags[i]; + html = html.replace(new RegExp(bbb,'gi'), ""); + } + + return html; + }, + formattingAddBefore: function(html) + { + var lb = '\r\n'; + var btags = ["", '', "","', '
        ', '', '', '', '', '', '', '
        ', '
        ', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']; + for (var i = 0; i < atags.length; ++i) + { + var aaa = atags[i]; + html = html.replace(new RegExp(aaa,'gi'),aaa+lb); + } + + return html; + }, + formatting: function(html) + { + // lowercase + if ($.browser.msie) + { + var match = html.match(/<(.*?)>/gi); + $.each(match, function(i,s) + { + html = html.replace(s, s.toLowerCase()); + }) + html = html.replace(/style="(.*?)"/gi, function(w) { return w.toLowerCase(); }); + html = html.replace(/ jQuery(.*?)=\"(.*?)\"/gi, ''); + } + + html = html.replace(/([\w\W]*?)<\/span><\/span>/gi, '$5'); + html = html.replace(/([\w\W]*?)<\/span><\/span>/gi, '$5'); + + html = html.replace(/([\w\W]*?)<\/span\>/gi, '$3
        '); + html = html.replace(/([\w\W]*?)<\/font\>/gi, '$3
        '); + html = html.replace(/([\w\W]*?)<\/span\>/gi, '$3'); + html = html.replace(/([\w\W]*?)<\/font\>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + + if (this.opts.xhtml) + { + html = html.replace(/
        /gi,'
        '); + html = html.replace(/
        $/gi,''); + html = html.replace(/^
        /gi,''); + html = html.replace(/(]+[^\/])>/gi,'$1 />'); + } + + // mini clean + html = html.replace(/

        /g, '

        '); + html = html.replace(/<\/p><\/p>/g, '

        '); + html = html.replace(//g, '
        '); + html = html.replace(/

         /g, '

        '); + html = html.replace(/

          /g, '
            '); + html = html.replace(/

              /g, '
                '); + html = html.replace(/<\/ul><\/p>/g, '
          '); + html = html.replace(/<\/ol><\/p>/g, ''); + html = html.replace( / <\/p>/gi, ''); + + // remove formatting + html = this.formattingRemove(html); + + // empty tags + html = this.formattingEmptyTags(html); + + // add formatting before + html = this.formattingAddBefore(html); + + // add formatting after + html = this.formattingAddAfter(html); + + // indenting + html = this.formattingIndenting(html); + + return html; + }, + + // TOGGLE + toggle: function() + { + var html; + + if (this.opts.visual) + { + this.$frame.hide(); + + html = this.$editor.html(); + html = $.trim(this.formatting(html)); + + this.$el.val(html).show().focus(); + + this.setBtnActive('html'); + this.opts.visual = false; + } + else + { + this.$el.hide(); + + this.$editor.html(this.$el.val()); + + this.$frame.show(); + + if (this.$editor.html() === '') + { + if (!$.browser.mozilla) + { + html = this.opts.allEmptyHtml; + } + else + { + html = this.opts.mozillaEmptyHtml; + } + + this.setCode(html); + } + + this.focus(); + + this.setBtnInactive('html'); + this.opts.visual = true; + + this.observeImages(); + this.observeTables(); + + if (this.opts.autoresize === true) this.setAutoSize(false); + } + }, + + // AUTOSAVE + autoSave: function() + { + if (this.opts.autosave === false) + { + return false; + } + + setInterval($.proxy(function() + { + $.post(this.opts.autosave, { data: this.getCode() }); + + }, this), this.opts.interval*1000); + }, + + // TOOLBAR + buildToolbar: function() + { + if (this.opts.toolbar === false) + { + return false; + } + + this.$toolbar = $('
            ').addClass('redactor_toolbar'); + this.$box.prepend(this.$toolbar); + + $.each(this.opts.buttons, $.proxy(function(i,key) + { + + if (key !== '|' && typeof this.opts.toolbar[key] !== 'undefined') + { + var s = this.opts.toolbar[key]; + + if (this.opts.fileUpload === false && key === 'file') + { + return true; + } + + var li = $('
          • '); + + if (key === 'fullscreen') + { + $(li).addClass('redactor_toolbar_right'); + } + + var a = this.buildButton(key, s); + + // dropdown + if (key === 'backcolor' || key === 'fontcolor' || typeof(s.dropdown) !== 'undefined') + { + var dropdown = $('
          • ')); + } + + }, this)); + + $(document).click(this.hdlHideDropDown); + $(this.doc).click(this.hdlHideDropDown); + + }, + buildButton: function(key, s) + { + var button = $(' '); + + if (typeof s.func === 'undefined') + { + button.click($.proxy(function() { this.execCommand(s.exec, key); }, this)); + } + else if (s.func !== 'show') + { + button.click($.proxy(function(e) { this[s.func](e); }, this)); + } + + if (typeof s.callback !== 'undefined') + { + button.click($.proxy(function(e) { s.callback(this, e, key); }, this)); + } + + return button; + }, + buildDropdown: function(dropdown, obj) + { + $.each(obj, $.proxy( + function (x, d) + { + if (typeof(d.className) === 'undefined') + { + d.className = ''; + } + + var drop_a; + if (typeof d.name !== 'undefined' && d.name === 'separator') + { + drop_a = $(''); + } + else + { + drop_a = $('' + d.title + ''); + + if (typeof(d.func) === 'undefined') + { + $(drop_a).click($.proxy(function() { this.execCommand(d.exec, x); }, this)); + } + else + { + $(drop_a).click($.proxy(function(e) { this[d.func](e); }, this)); + } + } + + $(dropdown).append(drop_a); + + }, this) + ); + + return dropdown; + + }, + buildColorPicker: function(dropdown, key) + { + var mode; + if (key === 'backcolor') + { + if ($.browser.msie) + { + mode = 'BackColor'; + } + else + { + mode = 'hilitecolor'; + } + } + else + { + mode = 'forecolor'; + } + + $(dropdown).width(210); + + var len = this.opts.colors.length; + for (var i = 0; i < len; ++i) + { + var color = this.opts.colors[i]; + + var swatch = $('').css({ 'backgroundColor': color }); + $(dropdown).append(swatch); + + var _self = this; + $(swatch).click(function() + { + if ($.browser.mozilla) + { + if (mode == 'hilitecolor') + { + _self.execCommand('useCSS', false, false); + _self.execCommand(mode, $(this).attr('rel')); + _self.execCommand('useCSS', false, true); + } + else + { + _self.execCommand('styleWithCSS', false, false); + _self.execCommand(mode, $(this).attr('rel')); + _self.execCommand('styleWithCSS', false, true); + } + } + else + { + _self.execCommand(mode, $(this).attr('rel')); + } + + }); + } + + var elnone = $('').html(RLANG.none); + + if (key === 'backcolor') + { + elnone.click($.proxy(this.setBackgroundNone, this)); + } + else + { + elnone.click($.proxy(this.setColorNone, this)); + } + + $(dropdown).append(elnone); + + return dropdown; + }, + setBackgroundNone: function() + { + $(this.getParentNode()).css('background-color', 'transparent'); + this.syncCode(); + }, + setColorNone: function() + { + $(this.getParentNode()).attr('color', '').css('color', ''); + this.syncCode(); + }, + + + // DROPDOWNS + showDropDown: function(e, dropdown, key) + { + if (this.getBtn(key).hasClass('dropact')) + { + this.hideAllDropDown(); + } + else + { + this.hideAllDropDown(); + + this.setBtnActive(key); + this.getBtn(key).addClass('dropact'); + + var left = this.getBtn(key).offset().left; + + + if (this.opts.fixed && this.fixed) + { + $(dropdown).css({ position: 'fixed', left: left + 'px', top: '30px' }).show(); + } + else + { + var top = this.$toolbar.offset().top + 30; + $(dropdown).css({ position: 'absolute', left: left + 'px', top: top + 'px' }).show(); + } + } + + }, + hideAllDropDown: function() + { + this.$toolbar.find('a.dropact').removeClass('act').removeClass('dropact'); + $('.redactor_dropdown').hide(); + }, + hideDropDown: function(e, dropdown, key) + { + if (!$(e.target).parent().hasClass('dropact')) + { + $(dropdown).removeClass('act'); + this.showedDropDown = false; + this.hideAllDropDown(); + } + }, + + // SELECTION AND NODE MANIPULATION + getSelection: function () + { + if (this.$frame.get(0).contentWindow.getSelection) + { + return this.$frame.get(0).contentWindow.getSelection(); + } + else if (this.$frame.get(0).contentWindow.document.selection) + { + return this.$frame.get(0).contentWindow.document.selection.createRange(); + } + }, + getParentNode: function() + { + if (window.getSelection) + { + return this.getSelection().getRangeAt(0).startContainer.parentNode; + } + else if (document.selection) + { + return this.getSelection().parentElement(); + } + }, + getCurrentNode: function() + { + if (window.getSelection) + { + return this.getSelection().getRangeAt(0).startContainer; + } + else if (document.selection) + { + return this.getSelection(); + } + }, + setFocusNode: function(node, toStart) + { + var range = this.doc.createRange(); + + var selection = this.getSelection(); + toStart = toStart ? 0 : 1; + + if (selection !== null) + { + range.selectNodeContents(node); + selection.addRange(range); + selection.collapse(node, toStart); + } + + this.focus(); + }, + insertNodeAtCaret: function (node) + { + if (typeof window.getSelection !== "undefined") + { + var sel = this.getSelection(); + if (sel.rangeCount) + { + var range = sel.getRangeAt(0); + range.collapse(false); + range.insertNode(node); + range = range.cloneRange(); + range.selectNodeContents(node); + range.collapse(false); + sel.removeAllRanges(); + sel.addRange(range); + } + } + else if (typeof document.selection !== "undefined" && document.selection.type !== "Control") + { + var html = (node.nodeType === 1) ? node.outerHTML : node.data; + var id = "marker_" + ("" + Math.random()).slice(2); + html += ''; + var textRange = this.getSelection(); + textRange.collapse(false); + textRange.pasteHTML(html); + var markerSpan = document.getElementById(id); + textRange.moveToElementText(markerSpan); + textRange.select(); + markerSpan.parentNode.removeChild(markerSpan); + } + }, + + // BUTTONS MANIPULATIONS + getBtn: function(key) + { + return $(this.$toolbar.find('a.redactor_btn_' + key)); + }, + setBtnActive: function(key) + { + this.getBtn(key).addClass('act'); + }, + setBtnInactive: function(key) + { + this.getBtn(key).removeClass('act'); + }, + changeBtnIcon: function(key, classname) + { + this.getBtn(key).addClass('redactor_btn_' + classname); + }, + removeBtnIcon: function(key, classname) + { + this.getBtn(key).removeClass('redactor_btn_' + classname); + }, + removeBtn: function(key) + { + this.getBtn(key).remove(); + }, + addBtn: function(key, obj) + { + this.$toolbar.append($('
          • ').append(this.buildButton(key, obj))); + }, + + // FULLSCREEN + fullscreen: function() + { + var html; + + if (this.opts.fullscreen === false) + { + this.changeBtnIcon('fullscreen', 'normalscreen'); + this.setBtnActive('fullscreen'); + this.opts.fullscreen = true; + + this.height = this.$frame.css('height'); + this.width = (this.$box.width() - 2) + 'px'; + + html = this.getCode(); + + this.tmpspan = $(''); + this.$box.addClass('redactor_box_fullscreen').after(this.tmpspan); + + $(document.body).prepend(this.$box).css('overflow', 'hidden'); + + this.$editor = this.enable(html); + + $(this.doc).click($.proxy(this.hideAllDropDown, this)); + + // focus always on page + this.observeFocus(); + + this.observeImages(); + this.observeTables(); + + this.$box.find('.redactor_resizer').hide(); + + this.fullScreenResize(); + $(window).resize($.proxy(this.fullScreenResize, this)); + $(document).scrollTop(0,0); + this.focus(); + + } + else + { + this.removeBtnIcon('fullscreen', 'normalscreen'); + this.setBtnInactive('fullscreen'); + this.opts.fullscreen = false; + + $(window).unbind('resize', $.proxy(this.fullScreenResize, this)); + $(document.body).css('overflow', ''); + + html = this.getCode(); + + this.$box.removeClass('redactor_box_fullscreen').css('width', 'auto'); + + this.tmpspan.after(this.$box).remove(); + + this.$editor = this.enable(html); + + this.observeImages(); + this.observeTables(); + + if (this.opts.autoresize) + { + this.observeAutoResize(); + } + this.$box.find('.redactor_resizer').show(); + + $(this.doc).click($.proxy(this.hideAllDropDown, this)); + + // focus always on page + this.observeFocus(); + + this.syncCode(); + + this.$frame.css('height', this.height); + this.$el.css('height', this.height); + this.focus(); + } + }, + fullScreenResize: function() + { + if (this.opts.fullscreen === false) + { + return false; + } + + var height = $(window).height() - 42; + this.$box.width($(window).width() - 2); + this.$frame.height(height); + this.$el.height(height); + }, + + // RESIZE + buildResizer: function() + { + if (this.opts.resize === false) + { + return false; + } + + this.$resizer = $('
            '); + this.$box.append(this.$resizer); + this.$resizer.mousedown($.proxy(this.initResize, this)); + + }, + initResize: function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + this.splitter = e.target; + + if (this.opts.visual) + { + this.element_resize = this.$frame; + this.element_resize.get(0).style.visibility = 'hidden'; + this.element_resize_parent = this.$el; + } + else + { + this.element_resize = this.$el; + this.element_resize_parent = this.$frame; + } + + this.stopResizeHdl = $.proxy(this.stopResize, this); + this.startResizeHdl = $.proxy(this.startResize, this); + this.resizeHdl = $.proxy(this.resize, this); + + $(document).mousedown(this.startResizeHdl); + $(document).mouseup(this.stopResizeHdl); + $(this.splitter).mouseup(this.stopResizeHdl); + + this.null_point = false; + this.h_new = false; + this.h = this.element_resize.height(); + }, + startResize: function() + { + $(document).mousemove(this.resizeHdl); + }, + resize: function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var y = e.pageY; + + if (this.null_point === false) + { + this.null_point = y; + } + + if (this.h_new === false) + { + this.h_new = this.element_resize.height(); + } + + var s_new = (this.h_new + y - this.null_point) - 10; + + if (s_new <= 30) + { + return true; + } + + if (s_new >= 0) + { + this.element_resize.get(0).style.height = s_new + 'px'; + this.element_resize_parent.get(0).style.height = s_new + 'px'; + } + }, + stopResize: function(e) + { + $(document).unbind('mousemove', this.resizeHdl); + $(document).unbind('mousedown', this.startResizeHdl); + $(document).unbind('mouseup', this.stopResizeHdl); + $(this.splitter).unbind('mouseup', this.stopResizeHdl); + + this.element_resize.get(0).style.visibility = 'visible'; + }, + + // RESIZE IMAGES + resizeImage: function(resize) + { + var clicked = false; + var clicker = false; + var start_x; + var start_y; + var ratio = $(resize).width()/$(resize).height(); + + var y = 1; + var x = 1; + var min_w = 1; + var min_h = 1; + + $(resize).hover(function() { $(resize).css('cursor', 'nw-resize'); }, function() { $(resize).css('cursor','default'); clicked=false; }); + + $(resize).mousedown(function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + clicked = true; + clicker = true; + + start_x = Math.round(e.pageX - $(resize).eq(0).offset().left); + start_y = Math.round(e.pageY - $(resize).eq(0).offset().top); + }); + + $(resize).mouseup($.proxy(function(e) + { + clicked = false; + this.syncCode(); + if (this.opts.autoresize === true) this.setAutoSize(false); + + }, this)); + + $(resize).click($.proxy(function(e) + { + if (clicker) + { + this.imageEdit(e); + } + + }, this)); + + $(resize).mousemove(function(e) + { + if (clicked) + { + clicker = false; + + var mouse_x = Math.round(e.pageX - $(this).eq(0).offset().left) - start_x; + var mouse_y = Math.round(e.pageY - $(this).eq(0).offset().top) - start_y; + + var div_h = $(resize).height(); + + var new_h = parseInt(div_h, 10) + mouse_y; + var new_w = new_h*ratio; + + if (x === 1 || (typeof(x) === "number" && new_w < x && new_w > min_w)) + { + $(resize).width(new_w); + } + if (y === 1 || (typeof(y) === "number" && new_h < y && new_h > min_h)) + { + $(resize).height(new_h); + } + start_x = Math.round(e.pageX - $(this).eq(0).offset().left); + start_y = Math.round(e.pageY - $(this).eq(0).offset().top); + } + }); + }, + + // TABLE + showTable: function() + { + this.modalInit(RLANG.table, 'table', 300, $.proxy(function() + { + $('#redactor_insert_table_btn').click($.proxy(this.insertTable, this)); + }, this), + + function() + { + $('#redactor_table_rows').focus(); + } + ); + }, + insertTable: function() + { + var rows = $('#redactor_table_rows').val(); + var columns = $('#redactor_table_columns').val(); + + var table_box = $('
            '); + + var tableid = Math.floor(Math.random() * 99999); + var table = $('
            '); + + for (var i = 0; i < rows; i++) + { + var row = $(''); + for (var z = 0; z < columns; z++) + { + var column = $(' '); + $(row).append(column); + } + $(table).append(row); + } + + $(table_box).append(table); + var html = $(table_box).html(); + + if ($.browser.msie) + { + html += '

            '; + } + else + { + html += '

             

            '; + } + + this.execCommand('inserthtml', html); + this.modalClose(); + + this.$table = $(this.doc).find('body').find('#table' + tableid); + this.$table.click($.proxy(this.tableObserver, this)); + + if (this.opts.autoresize === true) this.setAutoSize(false); + }, + tableObserver: function(e) + { + this.$table = $(e.target).parents('table'); + + this.$table_tr = this.$table.find('tr'); + this.$table_td = this.$table.find('td'); + + this.$table_td.removeClass('current'); + + this.$tbody = $(e.target).parents('tbody'); + this.$thead = $(this.$table).find('thead'); + + this.$current_td = $(e.target); + this.$current_td.addClass('current'); + + this.$current_tr = $(e.target).parents('tr'); + }, + deleteTable: function() + { + $(this.$table).remove(); + this.$table = false; + this.syncCode(); + }, + deleteRow: function() + { + $(this.$current_tr).remove(); + this.syncCode(); + }, + deleteColumn: function() + { + var index = $(this.$current_td).get(0).cellIndex; + + $(this.$table).find('tr').each(function() + { + $(this).find('td').eq(index).remove(); + }); + + this.syncCode(); + }, + addHead: function() + { + if ($(this.$table).find('thead').size() !== 0) + { + this.deleteHead(); + } + else + { + var tr = $(this.$table).find('tr').first().clone(); + tr.find('td').html(' '); + this.$thead = $(''); + this.$thead.append(tr); + $(this.$table).prepend(this.$thead); + this.syncCode(); + } + }, + deleteHead: function() + { + $(this.$thead).remove(); + this.$thead = false; + this.syncCode(); + }, + insertRowAbove: function() + { + this.insertRow('before'); + }, + insertRowBelow: function() + { + this.insertRow('after'); + }, + insertColumnLeft: function() + { + this.insertColumn('before'); + }, + insertColumnRight: function() + { + this.insertColumn('after'); + }, + insertRow: function(type) + { + var new_tr = $(this.$current_tr).clone(); + new_tr.find('td').html(' '); + if (type === 'after') + { + $(this.$current_tr).after(new_tr); + } + else + { + $(this.$current_tr).before(new_tr); + } + + this.syncCode(); + }, + insertColumn: function(type) + { + var index = 0; + + this.$current_td.addClass('current'); + + this.$current_tr.find('td').each(function(i,s) + { + if ($(s).hasClass('current')) + { + index = i; + } + }); + + this.$table_tr.each(function(i,s) + { + var current = $(s).find('td').eq(index); + + var td = current.clone(); + td.html(' '); + + if (type === 'after') + { + $(current).after(td); + } + else + { + $(current).before(td); + } + + }); + + this.syncCode(); + }, + + // INSERT VIDEO + showVideo: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + this.modalInit(RLANG.video, 'video', 600, $.proxy(function() + { + $('#redactor_insert_video_btn').click($.proxy(this.insertVideo, this)); + }, this), + + function() + { + $('#redactor_insert_video_area').focus(); + } + ); + }, + insertVideo: function() + { + var data = $('#redactor_insert_video_area').val(); + data = this.stripTags(data); + + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).after(data).remove(); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', data); + } + + this.modalClose(); + + if (this.opts.autoresize === true) + { + this.setAutoSize(false); + } + }, + + // INSERT IMAGE + imageEdit: function(e) + { + var $el = $(e.target); + var parent = $el.parent(); + + var handler = $.proxy(function() + { + $('#redactor_file_alt').val($el.attr('alt')); + $('#redactor_image_edit_src').attr('href', $el.attr('src')); + $('#redactor_form_image_align').val($el.css('float')); + + if ($(parent).get(0).tagName === 'A') + { + $('#redactor_file_link').val($(parent).attr('href')); + } + + $('#redactor_image_delete_btn').click($.proxy(function() { this.imageDelete($el); }, this)); + $('#redactorSaveBtn').click($.proxy(function() { this.imageSave($el); }, this)); + + }, this); + + this.modalInit(RLANG.image, 'image_edit', 380, handler); + + }, + imageDelete: function(el) + { + $(el).remove(); + this.modalClose(); + this.syncCode(); + + if (this.opts.autoresize === true) + { + this.setAutoSize(false); + } + }, + imageSave: function(el) + { + var parent = $(el).parent(); + + $(el).attr('alt', $('#redactor_file_alt').val()); + + var floating = $('#redactor_form_image_align').val(); + + if (floating === 'left') + { + $(el).css({ 'float': 'left', margin: '0 10px 10px 0' }); + } + else if (floating === 'right') + { + $(el).css({ 'float': 'right', margin: '0 0 10px 10px' }); + } + else + { + $(el).css({ 'float': 'none', margin: '0' }); + } + + // as link + var link = $.trim($('#redactor_file_link').val()); + if (link !== '') + { + if ($(parent).get(0).tagName !== 'A') + { + $(el).replaceWith('' + this.outerHTML(el) + ''); + } + else + { + $(parent).attr('href', link); + } + } + else + { + if ($(parent).get(0).tagName === 'A') + { + $(parent).replaceWith(this.outerHTML(el)); + } + } + + this.modalClose(); + this.observeImages(); + this.syncCode(); + + }, + showImage: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + var handler = $.proxy(function() + { + // json + if (this.opts.imageGetJson !== false) + { + $.getJSON(this.opts.imageGetJson, $.proxy(function(data) { + + $.each(data, $.proxy(function(key, val) + { + var img = $(''); + $('#redactor_image_box').append(img); + $(img).click($.proxy(this.imageSetThumb, this)); + + }, this)); + + }, this)); + } + else + { + $('#redactor_tabs a').eq(1).remove(); + } + + if (this.opts.imageUpload !== false) + { + + // dragupload + if (this.isMobile() === false) + { + if ($('#redactor_file').size() !== 0) + { + $('#redactor_file').dragupload( + { + url: this.opts.imageUpload, + success: $.proxy(this.imageUploadCallback, this) + }); + } + } + + // ajax upload + this.uploadInit('redactor_file', { auto: true, url: this.opts.imageUpload, success: $.proxy(this.imageUploadCallback, this) }); + } + else + { + $('.redactor_tab').hide(); + if (this.opts.imageGetJson === false) + { + $('#redactor_tabs').remove(); + $('#redactor_tab3').show(); + } + else + { + var tabs = $('#redactor_tabs a'); + tabs.eq(0).remove(); + tabs.eq(1).addClass('redactor_tabs_act'); + $('#redactor_tab2').show(); + } + } + + $('#redactor_upload_btn').click($.proxy(this.imageUploadCallbackLink, this)); + + }, this); + + var endCallback = $.proxy(function() + { + if (this.opts.imageUpload === false && this.opts.imageGetJson === false) + { + $('#redactor_file_link').focus(); + } + }, this); + + this.modalInit(RLANG.image, 'image', 570, handler, endCallback, true); + + }, + imageSetThumb: function(e) + { + this._imageSet('', true); + }, + imageUploadCallbackLink: function() + { + if ($('#redactor_file_link').val() !== '') + { + var data = ''; + this._imageSet(data, true); + } + else + { + this.modalClose(); + } + }, + imageUploadCallback: function(data) + { + this._imageSet(data); + }, + _imageSet: function(json, link) + { + var html = '', data = ''; + if (link !== true) + { + data = $.parseJSON(json); + html = '

            '; + } + else + { + html = json; + } + + this.focus(); + + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).after(html).remove(); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', html); + } + + // upload image callback + if (link !== true && typeof this.opts.imageUploadCallback === 'function') + { + this.opts.imageUploadCallback(this, data); + } + + this.modalClose(); + + $(this.doc).find('img').load($.proxy(function() + { + this.setAutoSize(false); + + }, this)); + + this.observeImages(); + }, + + // INSERT LINK + showLink: function() + { + var handler = $.proxy(function() + { + var sel = this.getSelection(); + var url = '', text = ''; + + if ($.browser.msie) + { + var parent = this.getParentNode(); + if (parent.nodeName === 'A') + { + this.insert_link_node = $(parent); + text = this.insert_link_node.text(); + url = this.insert_link_node.attr('href'); + } + else + { + if (this.oldIE()) + { + text = sel.text; + } + else + { + text = sel.toString(); + } + + this.spanid = Math.floor(Math.random() * 99999); + + var html = '' + text + ''; + + if (text !== '') + { + html = '' + text + ''; + } + + this.execCommand('inserthtml', html); + } + } + else + { + if (sel && sel.anchorNode && sel.anchorNode.parentNode.tagName === 'A') + { + url = sel.anchorNode.parentNode.href; + text = sel.anchorNode.parentNode.text; + if (sel.toString() === '') + { + this.insert_link_node = sel.anchorNode.parentNode; + } + } + else + { + text = sel.toString(); + url = ''; + } + } + + $('.redactor_link_text').val(text); + + var turl = url.replace(top.location.href, ''); + + if (url.search('mailto:') === 0) + { + this.setModalTab(2); + + $('#redactor_tab_selected').val(2); + $('#redactor_link_mailto').val(url.replace('mailto:', '')); + } + else if (turl.search(/^#/gi) === 0) + { + this.setModalTab(3); + + $('#redactor_tab_selected').val(3); + $('#redactor_link_anchor').val(turl.replace(/^#/gi, '')); + } + else + { + $('#redactor_link_url').val(url); + } + + $('#redactor_insert_link_btn').click($.proxy(this.insertLink, this)); + + + }, this); + + var endCallback = function(url) + { + $('#redactor_link_url').focus(); + }; + + this.modalInit(RLANG.link, 'link', 460, handler, endCallback); + + }, + insertLink: function() + { + var tab_selected = $('#redactor_tab_selected').val(); + var link = '', text = ''; + + if (tab_selected === '1') // url + { + link = $('#redactor_link_url').val(); + text = $('#redactor_link_url_text').val(); + } + else if (tab_selected === '2') // mailto + { + link = 'mailto:' + $('#redactor_link_mailto').val(); + text = $('#redactor_link_mailto_text').val(); + } + else if (tab_selected === '3') // anchor + { + link = '#' + $('#redactor_link_anchor').val(); + text = $('#redactor_link_anchor_text').val(); + } + + this._insertLink('' + text + ' ', $.trim(text), link); + + }, + _insertLink: function(a, text, link) + { + if (text != '') + { + if (this.insert_link_node) + { + $(this.insert_link_node).text(text); + $(this.insert_link_node).attr('href', link); + this.syncCode(); + } + else + { + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).replaceWith(a); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', a); + } + } + } + + this.modalClose(); + }, + + // INSERT FILE + showFile: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + var handler = $.proxy(function() + { + var sel = this.getSelection(); + + var text = ''; + + if (this.oldIE()) + { + text = sel.text; + } + else + { + text = sel.toString(); + } + + $('#redactor_filename').val(text); + + // dragupload + if (this.isMobile() === false) + { + $('#redactor_file').dragupload( + { + url: this.opts.fileUpload, + success: $.proxy(function(data) + { + this.fileUploadCallback(data); + }, this) + }); + } + + this.uploadInit('redactor_file', { auto: true, url: this.opts.fileUpload, success: $.proxy(function(data) { + + this.fileUploadCallback(data); + + }, this)}); + }, this); + + this.modalInit(RLANG.file, 'file', 500, handler); + }, + fileUploadCallback: function(json) + { + var data = $.parseJSON(json); + var text = $('#redactor_filename').val(); + + if (text === '') + { + text = data.filename; + } + + var link = '' + text + ''; + + // chrome fix + if ($.browser.webkit && !!window.chrome) + { + link = link + ' '; + } + + if ($.browser.msie) + { + if (text !== '') + { + $(this.doc.getElementById('span' + this.spanid)).replaceWith(link); + } + else + { + $(this.doc.getElementById('span' + this.spanid)).after(link).remove(); + } + + this.syncCode(); + } + else + { + this.execCommand('inserthtml', link); + } + + // file upload callback + if (typeof this.opts.fileUploadCallback === 'function') + { + this.opts.fileUploadCallback(this, data); + } + + this.modalClose(); + }, + + + + // MODAL + modalInit: function(title, url, width, handler, endCallback, scroll) + { + // modal overlay + if ($('#redactor_modal_overlay').size() === 0) + { + this.overlay = $(''); + $('body').prepend(this.overlay); + } + + if (this.opts.overlay) + { + $('#redactor_modal_overlay').show(); + $('#redactor_modal_overlay').click($.proxy(this.modalClose, this)); + } + + if ($('#redactor_modal').size() === 0) + { + this.modal = $(''); + $('body').append(this.modal); + } + + $('#redactor_modal_close').click($.proxy(this.modalClose, this)); + + this.hdlModalClose = $.proxy(function(e) { if ( e.keyCode === 27) { this.modalClose(); } }, this); + + $(document).keyup(this.hdlModalClose); + $(this.doc).keyup(this.hdlModalClose); + + $('#redactor_modal_inner').html(this.opts['modal_' + url]); + $('#redactor_modal_header').html(title); + + // tabs + if ($('#redactor_tabs').size() !== 0) + { + var that = this; + $('#redactor_tabs a').each(function(i,s) + { + i++; + $(s).click(function() + { + $('#redactor_tabs a').removeClass('redactor_tabs_act'); + $(this).addClass('redactor_tabs_act'); + $('.redactor_tab').hide(); + $('#redactor_tab' + i).show(); + $('#redactor_tab_selected').val(i); + + if (that.isMobile() === false) + { + var height = $('#redactor_modal').outerHeight(); + $('#redactor_modal').css('margin-top', '-' + (height+10)/2 + 'px'); + } + }); + }); + } + + $('#redactor_btn_modal_close').click($.proxy(this.modalClose, this)); + + // callback + if (typeof(handler) === 'function') + { + handler(); + } + + // setup + var height = $('#redactor_modal').outerHeight(); + + if (this.isMobile() === false) + { + $('#redactor_modal').css({ position: 'fixed', top: '50%', left: '50%', width: width + 'px', height: 'auto', marginTop: '-' + (height+10)/2 + 'px', marginLeft: '-' + (width+60)/2 + 'px' }).fadeIn('fast'); + } + else + { + $('#redactor_modal').css({ position: 'absolute', width: '96%', height: 'auto', top: '20px', left: '0', marginTop: '0px', marginLeft: '2%' }).show(); + this.scrolltop(); + } + + + // end callback + if (typeof(endCallback) === 'function') + { + endCallback(); + } + + if (scroll === true) + { + $('#redactor_image_box').height(300).css('overflow', 'auto'); + } + + }, + modalClose: function() + { + + $('#redactor_modal_close').unbind('click', this.modalClose); + $('#redactor_modal').fadeOut('fast', $.proxy(function() + { + $('#redactor_modal_inner').html(''); + + if (this.opts.overlay) + { + $('#redactor_modal_overlay').hide(); + $('#redactor_modal_overlay').unbind('click', this.modalClose); + } + + $(document).unbind('keyup', this.hdlModalClose); + $(this.doc).unbind('keyup', this.hdlModalClose); + + }, this)); + + }, + setModalTab: function(num) + { + $('.redactor_tab').hide(); + var tabs = $('#redactor_tabs a'); + tabs.removeClass('redactor_tabs_act'); + tabs.eq(num-1).addClass('redactor_tabs_act'); + $('#redactor_tab' + num).show(); + }, + + // UPLOAD + uploadInit: function(element, options) + { + // Upload Options + this.uploadOptions = { + url: false, + success: false, + start: false, + trigger: false, + auto: false, + input: false + }; + + $.extend(this.uploadOptions, options); + + // Test input or form + if ($('#' + element).size() !== 0 && $('#' + element).get(0).tagName === 'INPUT') + { + this.uploadOptions.input = $('#' + element); + this.element = $($('#' + element).get(0).form); + } + else + { + this.element = $('#' + element); + } + + this.element_action = this.element.attr('action'); + + // Auto or trigger + if (this.uploadOptions.auto) + { + $(this.uploadOptions.input).change($.proxy(function() + { + this.element.submit(function(e) { return false; }); + this.uploadSubmit(); + }, this)); + + } + else if (this.uploadOptions.trigger) + { + $('#' + this.uploadOptions.trigger).click($.proxy(this.uploadSubmit, this)); + } + }, + uploadSubmit : function() + { + this.uploadForm(this.element, this.uploadFrame()); + }, + uploadFrame : function() + { + this.id = 'f' + Math.floor(Math.random() * 99999); + + var d = document.createElement('div'); + var iframe = ''; + d.innerHTML = iframe; + document.body.appendChild(d); + + // Start + if (this.uploadOptions.start) + { + this.uploadOptions.start(); + } + + $('#' + this.id).load($.proxy(this.uploadLoaded, this)); + + return this.id; + }, + uploadForm : function(f, name) + { + if (this.uploadOptions.input) + { + var formId = 'redactorUploadForm' + this.id; + var fileId = 'redactorUploadFile' + this.id; + this.form = $('
            '); + + var oldElement = this.uploadOptions.input; + var newElement = $(oldElement).clone(); + $(oldElement).attr('id', fileId); + $(oldElement).before(newElement); + $(oldElement).appendTo(this.form); + $(this.form).css('position', 'absolute'); + $(this.form).css('top', '-2000px'); + $(this.form).css('left', '-2000px'); + $(this.form).appendTo('body'); + + this.form.submit(); + } + else + { + f.attr('target', name); + f.attr('method', 'POST'); + f.attr('enctype', 'multipart/form-data'); + f.attr('action', this.uploadOptions.url); + + this.element.submit(); + } + + }, + uploadLoaded : function() + { + var i = $('#' + this.id); + var d; + + if (i.contentDocument) + { + d = i.contentDocument; + } + else if (i.contentWindow) + { + d = i.contentWindow.document; + } + else + { + d = window.frames[this.id].document; + } + + if (d.location.href === "about:blank") + { + return true; + } + + // Success + if (this.uploadOptions.success) + { + // Remove bizarre
             tag wrappers around our json data:
            +				var rawString = d.body.innerHTML;
            +				var jsonString = rawString.match(/\{.*\}/)[0];
            +				this.uploadOptions.success(jsonString);
            +			}
            +		
            +			this.element.attr('action', this.element_action);
            +			this.element.attr('target', '');
            +		
            +		},
            +		
            +		// UTILITY
            +		markerIE: function()
            +		{
            +			this.spanid = Math.floor(Math.random() * 99999);
            +			this.execCommand('inserthtml', '');
            +		},
            +		oldIE: function()
            +		{
            +			if ($.browser.msie && parseInt($.browser.version, 10) < 9)
            +			{
            +				return true;
            +			}
            +			
            +			return false;
            +		},
            +		outerHTML: function(s) 
            +		{
            +			return $("

            ").append($(s).eq(0).clone()).html(); + }, + normalize: function(str) + { + return parseInt(str.replace('px',''), 10); + }, + isMobile: function() + { + if (/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent)) + { + return true; + } + else + { + return false; + } + }, + scrolltop: function() + { + $('html,body').animate({ scrollTop: 0 }, 500); + } + + }; + + + // API + $.fn.getDoc = function() + { + return $(this.data('redactor').doc); + }; + + $.fn.getFrame = function() + { + return this.data('redactor').$frame; + }; + + $.fn.getEditor = function() + { + return this.data('redactor').$editor; + }; + + $.fn.getCode = function() + { + return this.data('redactor').getCode(); + }; + + $.fn.getText = function() + { + return this.data('redactor').$editor.text(); + }; + + $.fn.setCode = function(html) + { + this.data('redactor').setCode(html); + }; + + $.fn.insertHtml = function(html) + { + this.data('redactor').insertHtml(html); + }; + + $.fn.destroyEditor = function() + { + this.data('redactor').destroy(); + this.removeData('redactor'); + }; + + $.fn.setFocus = function() + { + this.data('redactor').focus(); + }; + + $.fn.execCommand = function(cmd, param) + { + this.data('redactor').execCommand(cmd, param); + }; + +})(jQuery); + +/* + Plugin Drag and drop Upload v1.0.1 + http://imperavi.com/ + Copyright 2012, Imperavi Ltd. +*/ +(function($){ + + "use strict"; + + // Initialization + $.fn.dragupload = function(options) + { + return this.each(function() { + var obj = new Construct(this, options); + obj.init(); + }); + }; + + // Options and variables + function Construct(el, options) { + + this.opts = $.extend({ + + url: false, + success: false, + preview: false, + + text: RLANG.drop_file_here, + atext: RLANG.or_choose + + }, options); + + this.$el = $(el); + } + + // Functionality + Construct.prototype = { + init: function() + { + if (!$.browser.opera && !$.browser.msie) + { + + this.droparea = $('

            '); + this.dropareabox = $('
            ' + this.opts.text + '
            '); + this.dropalternative = $('
            ' + this.opts.atext + '
            '); + + this.droparea.append(this.dropareabox); + + this.$el.before(this.droparea); + this.$el.before(this.dropalternative); + + // drag over + this.dropareabox.bind('dragover', $.proxy(function() { return this.ondrag(); }, this)); + + // drag leave + this.dropareabox.bind('dragleave', $.proxy(function() { return this.ondragleave(); }, this)); + + var uploadProgress = $.proxy(function(e) + { + var percent = parseInt(e.loaded / e.total * 100, 10); + this.dropareabox.text('Loading ' + percent + '%'); + + }, this); + + var xhr = jQuery.ajaxSettings.xhr(); + + if (xhr.upload) + { + xhr.upload.addEventListener('progress', uploadProgress, false); + } + + var provider = function () { return xhr; }; + + // drop + this.dropareabox.get(0).ondrop = $.proxy(function(event) + { + event.preventDefault(); + + this.dropareabox.removeClass('hover').addClass('drop'); + + var file = event.dataTransfer.files[0]; + + var fd = new FormData(); + fd.append('file', file); + + $.ajax({ + dataType: 'html', + url: this.opts.url, + data: fd, + xhr: provider, + cache: false, + contentType: false, + processData: false, + type: 'POST', + success: $.proxy(function(data) + { + if (this.opts.success !== false) + { + this.opts.success(data); + } + + if (this.opts.preview === true) + { + this.dropareabox.html(data); + } + + }, this) + }); + + }, this); + } + }, + ondrag: function() + { + this.dropareabox.addClass('hover'); + return false; + }, + ondragleave: function() + { + this.dropareabox.removeClass('hover'); + return false; + } + }; + +})(jQuery); + + +// Define: Linkify plugin from stackoverflow +(function($){ + + "use strict"; + + var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g, + url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g, + + linkifyThis = function () + { + var childNodes = this.childNodes, + i = childNodes.length; + while(i--) + { + var n = childNodes[i]; + if (n.nodeType === 3) + { + var html = n.nodeValue; + if (html) + { + html = html.replace(/&/g, '&') + .replace(//g, '>') + .replace(url1, '$1$2$3') + .replace(url2, '$1$2$5'); + + $(n).after(html).remove(); + } + } + else if (n.nodeType === 1 && !/^(a|button|textarea)$/i.test(n.tagName)) + { + linkifyThis.call(n); + } + } + }; + + $.fn.linkify = function () + { + this.each(linkifyThis); + }; + +})(jQuery); diff --git a/syte/static/js/libs/redactor.min.js b/syte/static/js/libs/redactor.min.js new file mode 100644 index 000000000..cc3483efc --- /dev/null +++ b/syte/static/js/libs/redactor.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('17(68 290==="110"){18 290={}}18 26={47:"609",184:"185 434...",169:"185 509...",56:"409",149:"405",488:"185 405 ...",284:"616",197:"643",521:"642",522:"651",317:"470",481:"280 1",480:"280 2",482:"280 3",479:"280 4",166:"635",163:"633",202:"640 477",173:"634 477",278:"636 501",289:"629 501",201:"641",203:"644",205:"655",249:"185",340:"608",438:"255",345:"185 409...",354:"256 393 611",353:"256 393 621",355:"256 391 399",356:"256 391 397",348:"255 391",349:"255 393",350:"255 409",527:"614",528:"626",352:"256 507",351:"255 507",39:"736",441:"709",123:"708",113:"399",222:"397",512:"509 712 405",98:"715",251:"338",699:"343",524:"434 725 470",127:"185 671...",204:"672",675:"674",339:"660",458:"658 339",440:"661 127 662",491:"398 399",489:"398 665",493:"398 397",499:"663",282:"185 693 687",87:"681",275:"685",337:"678"};(15(11){212.128.103=15(12){28 7.106(15(){18 19=11(7);18 14=19.82("103");17(!14){19.82("103",(14=171 36(7,12)))}})};18 36=15(14,12){7.$78=11(14);17(68 12!=="110"&&68 12.234!=="110"&&12.234!=="594"&&68 290[12.234]!=="110"){26=290[12.234]}7.22=11.309({234:"594",523:"689",236:21,346:21,357:21,332:21,250:21,45:"40.45",86:21,196:41,161:21,160:21,347:41,496:41,378:21,436:21,505:41,517:41,454:21,336:21,363:21,443:60,266:21,264:21,211:21,277:21,225:21,143:41,213:41,87:21,232:41,497:{},495:[],362:["47","|","197","|","166","163","275","|","278","289","201","203","|","169","184","127","56","149","|","202","173","|","579","492","487","494","|","282","87"],361:["#690","#677","#664","#657","#666","#668","#670","#734","#730","#706","#710","#617","#431","#645","#646","#639","#628","#624","#631","#612","#618","#627","#650","#654","#622","#619","#613","#711","#656","#714","#591","#701","#702","#705","#703","#719","#722","#724","#673","#667","#659","#591","#688","#691","#692","#695","#694","#680","#683","#684","#682","#679","#686","#676","#669","#431","#696","#697","#723","#721","#718","#720","#726","#727","#733","#735"],273:"<33><71 />",274:"<33>&102;",732:207()+\'<67 29="731" 262="267" 182="" 301="297/67-82"><61>728 (729)<63 122="98" 29="406" 43="145" /><32 40="146-116: 717;"><63 122="127" 29="188" 126="127" />\',716:207()+"<61>"+26.39+\'<63 29="414" 43="145" /><61>\'+26.149+\'<63 29="170" 43="145" /><61>\'+26.441+\'<206 29="394"><175 141="123">\'+26.123+\'<175 141="113">\'+26.113+\'<175 141="222">\'+26.222+\'<32 29="254"><36 52="101:104(81);" 29="549" 40="88: #704;">\'+26.438+\'<24 43="253"><63 122="219" 126="340" 29="576" 141="\'+26.340+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",698:207()+\'<32 29="154"><36 52="101:104(81);" 43="198">\'+26.204+\'<36 52="101:104(81);">\'+26.339+\'<36 52="101:104(81);">\'+26.149+\'<67 29="700" 262="267" 182="" 301="297/67-82"><32 29="513" 43="138"><63 122="127" 29="188" 126="127" /><32 29="389" 43="138" 40="178: 123;"><32 29="418"><32 29="390" 43="138" 40="178: 123;"><61>\'+26.512+\'<63 126="170" 29="170" 43="145" /><32 29="254"><24 43="253"><63 122="219" 126="204" 29="567" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",707:207()+\'<67 29="713" 262="267" 182=""><32 29="154"><36 52="101:104(81);" 43="198">343<36 52="101:104(81);">338<36 52="101:104(81);">\'+26.337+\'<63 122="296" 29="235" 141="1" /><32 43="138" 29="513"><61>343<63 29="292" 43="145" /><61>\'+26.98+\'<63 43="145 281" 29="554" /><32 43="138" 29="389" 40="178: 123;"><61>338<63 29="412" 43="145" /><61>\'+26.98+\'<63 43="145 281" 29="564" /><32 43="138" 29="390" 40="178: 123;"><61>\'+26.337+\'<63 43="145" 29="402" /><61>\'+26.98+\'<63 43="145 281" 29="573" /><32 29="254"><24 43="253"><63 122="219" 29="559" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",620:207()+"<61>"+26.527+\'<63 172="5" 141="2" 29="324" /><61>\'+26.528+\'<63 172="5" 141="3" 29="585" /><32 29="254"><24 43="253"><63 122="219" 126="204" 29="586" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",615:207()+\'<67 29="607"><61>\'+26.524+\'<252 29="428" 40="89: 99%; 51: 610;"><32 29="254"><24 43="253"><63 122="219" 29="545" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",105:{47:{39:26.47,64:"461"},197:{39:26.197,64:"91",260:{33:{39:26.521,80:"180"},194:{39:26.522,80:"180",156:"647"},130:{39:26.317,80:"180",156:"653"},376:{39:26.481,80:"180",156:"652"},374:{39:26.480,80:"180",156:"649"},375:{39:26.482,80:"180",156:"638"},379:{39:26.479,80:"180",156:"623"}}},166:{39:26.166,80:"166"},163:{39:26.163,80:"163"},275:{39:26.275,80:"625"},278:{39:"&630; "+26.278,80:"475"},289:{39:"1. "+26.289,80:"474"},201:{39:"< "+26.201,80:"201"},203:{39:"> "+26.203,80:"203"},169:{39:26.169,64:"540"},184:{39:26.184,64:"602"},127:{39:26.127,64:"569"},56:{39:26.56,64:"91",260:{345:{39:26.345,64:"578"},632:{126:"294"},354:{39:26.354,64:"450"},353:{39:26.353,64:"601"},355:{39:26.355,64:"593"},356:{39:26.356,64:"580"},637:{126:"294"},352:{39:26.352,64:"597"},351:{39:26.351,64:"382"},648:{126:"294"},348:{39:26.348,64:"603"},349:{39:26.349,64:"605"},350:{39:26.350,64:"604"}}},149:{39:26.149,64:"91",260:{149:{39:26.488,64:"561"},284:{39:26.284,80:"284"}}},202:{39:26.202,64:"91"},173:{39:26.173,64:"91"},579:{80:"762",39:26.491},492:{80:"852",39:26.489},487:{80:"853",39:26.493},494:{80:"854",39:26.499},282:{80:"851",39:26.282},87:{39:26.87,64:"87"}}},12,7.$78.82());7.265=[];7.318()};36.530={318:15(){7.484();17(7.22.105!==21){11.309(7.22.105,7.22.497);11.106(7.22.495,11.31(15(14,19){7.22.362.565(19)},7))}7.51=7.$78.45("51");7.89=7.$78.45("89");7.483();18 12=7.$78.48();12=7.342(12);17(7.22.347){12=7.506(12)}7.$84=7.291(12);7.283();17(7.22.496===41){11(7.44).408("850",11.31(15(14){444(11.31(15(){18 19=95.263(95.209()*258);18 20="";17(11.59.177){20="&102;"}18 16=11(\'<24 144="310" 29="310\'+19+\'">\'+20+"");7.371(16.70(0));7.446(19)},7),100)},7))}11(7.44).199(11.31(15(16){18 14=16.314||16.334;17(68 7.22.346==="15"){7.22.346(7,16)}17(7.22.347){17(14===8||14===46){28 7.508(16)}17(14===13&&!16.248&&!16.485&&!16.846){28 7.525(16)}}7.58()},7));7.442();17(7.22.161===21){7.555()}25{7.387()}7.486();7.463();7.143();7.208();17(7.22.87){7.22.87=21;7.87()}17(7.22.86){7.86()}17(7.22.160){7.335();11(57).847(11.31(7.335,7))}17(68 7.22.236==="15"){7.22.236(7)}},486:15(){11(7.44).848(11.31(15(14){18 12=14.314||14.334;17(68 7.22.357==="15"){7.22.357(7,14)}17(14.485){17(12===90){7.134(14,"849")}25{17(12===90&&14.248){7.134(14,"855")}25{17(12===77){7.134(14,"856")}25{17(12===66){7.134(14,"166")}25{17(12===73){7.134(14,"163")}25{17(12===74){7.134(14,"475")}25{17(12===75){7.134(14,"474")}25{17(12===76){7.134(14,"862")}25{17(12===72){7.134(14,"863")}}}}}}}}}}17(!14.248&&12===9){7.134(14,"203")}25{17(14.248&&12===9){7.134(14,"201")}}17(11.59.539&&467.468.471("864")===-1){28 7.516(14,12)}},7))},134:15(14,12){17(14.119){14.119()}7.69(12,81)},484:15(){17(7.22.250!==21){28 7.22.250}11("503").106(11.31(15(12,14){17(14.147){18 19=171 237(/\\/103(\\.529)?\\.861(\\?.*)?/);17(14.147.307(19)){7.22.250=14.147.23(19,"")}}},7))},483:15(){7.$114=11(\'<32 43="860">\');7.$92=11(\'<261 447="0" 857="151" 40="51: \'+7.51+\';" 43="858">\');7.$78.45("89","100%").155();7.$114.859(7.$78).83(7.$92).83(7.$78)},344:15(12){7.44.845();7.44.344(12);7.44.844()},291:15(12){7.44=7.400(7.$92.70(0));17(7.44!==81){7.344(7.502(12));17(11.59.177){7.44.69("365",21,41)}28 11(7.44).65("#333")}25{28 21}},502:15(14){18 12=\'\\54<47><518><149 832="833" 122="98/45" 52="\'+7.22.250+"/45/"+7.22.45+\'" 144="830"><93><32 29="333" 829="41" 825="\'+7.22.523+\'">\'+14+"";28 12},400:15(12){17(12.302){28 12.302}25{17(12.148&&12.148.57){28 12.148.57}25{17(12.57){28 12.57}25{28 81}}}},86:15(){7.$84.86()},58:15(){18 12=7.197(7.$84.47());7.$78.48(12)},239:15(12){12=7.342(12);7.$84.47(12).86();7.58()},176:15(){18 12=7.$84?7.$84.47():7.$78.48();12=7.510(12);28 12},401:15(12){7.69("157",12);7.143()},432:15(){18 14=7.176();7.$114.120(7.$78);7.$114.94();7.$78.48(14).91();195(18 12=0;12<7.265.224;12++){7.265[12].94();826(7.265[12])}},336:15(){11.519({140:7.22.336,122:"269",82:"103="+827(828(7.176())),131:11.31(15(12){7.239(12);7.58()},7)})},283:15(){17(11(7.44).65("93").51()<11(7.$92.70(0).148).51()){11(7.44).53(11.31(15(12){7.$84.86()},7))}},143:15(){17(7.22.143===21){28 21}17(11.59.177){7.44.69("834",21,"21")}11(7.44).65("179").106(11.31(15(12,14){17(11.59.97){11(14).79("435","835")}7.535(14)},7))},208:15(){11(7.44).65("93").65("56").53(11.31(7.319,7))},335:15(){18 12=11(57).392();18 14=7.$114.165().116;17(12>14){7.160=41;7.$105.45({181:"160",89:"100%"})}25{7.160=21;7.$105.45({181:"841",89:"151"})}},387:15(){7.$84.45({"529-51":7.$78.51()+"135"});11(7.44).65("93").45({288:"296"});7.152(21);11(7.44).199(11.31(7.152,7))},152:15(16){18 14=21;17(16!==21){14=16.314||16.334}18 12=7.$84.410(41);17(16===41&&(14===8||14===46)){7.$92.51(12)}25{7.$92.51(12+30)}},69:15(12,16){17(7.22.213&&7.44){866{17(11.59.97){7.86()}17(12==="157"&&11.59.97){7.44.187.366().552(16)}25{17(12==="180"&&11.59.97){7.44.69(12,21,"<"+16+">")}25{7.44.69(12,21,16)}}7.58();7.86();17(68 7.22.332==="15"){7.22.332(7,12)}}843(14){}}},525:15(16){18 14=7.228();17(14.562==="526"&&14.29==="333"){17(16.119){16.119()}18 12=11(7.547());17(12.70(0).190==="526"&&(12.47()===""||12.47()==="<71>")){18 20=11("<33>").83(12.216().70(0).476);12.233(20);20.47("<71 />");7.226(20.70(0));7.58();28 21}25{7.58()}17(7.22.517){7.$84.490()}}25{7.58();28 41}},516:15(16,14){17(16.248&&14===13){16.119();18 12=11("<24><71 />");7.371(12.70(0));7.226(12.70(0));7.58();28 21}25{28 41}},508:15(20){18 14=11.186(7.$84.47());17(11.59.177){14=14.23(/<71>/35,"")}17(14===""){17(20.119){20.119()}18 12=7.22.273;17(11.59.177){12=7.22.274}18 16=11(12).70(0);7.$84.47(16);7.226(16);7.58();28 21}25{7.58()}},506:15(19){19=11.186(19);17(19===""){17(!11.59.177){28 7.22.273}25{28 7.22.274}}17(7.22.505){19=19.23(/<32(.*?)>([\\49\\55]*?)<\\/32>/35,"<33>$2")}18 16=15(34,37,20){28 34.23(171 237(37,"20"),20)};18 12=15(34,20){28 16(19,34,20)};18 14="(56|118|439|377|840|167|107|111|245|32|238|243|242|132|137|125|130|206|67|194|504|839|40|503|308|63|511|33|34[1-6])";19+="\\54";12("<71 />\\\\38*<71 />","\\54\\54");12("(<"+14+"[^>]*>)","\\54$1");12("()","$1\\54\\54");12("\\164\\54|\\164","\\54");12("\\54\\54+","\\54\\54");12("\\54?((.|\\54)+?)$","<33>$1\\54");12("<33>\\\\38*?","");12("<33>(<32[^>]*>\\\\38*)","$1<33>");12("<33>([^<]+)\\\\38*?(]*>)","<33>$1$2");12("<33>\\\\38*(]*>)\\\\38*","$1");12("<33>(<125.+?)","$1");12("<33>\\\\38*(]*>)","$1");12("(]*>)\\\\38*","$1");12("(]*>)\\\\38*<71 />","$1");12("<71 />(\\\\38*]*>)","$1");17(19.471("<130")!=-1){12("(<130(.|\\54)*?>)((.|\\54)*?)",15(62,37,34,20){28 16(37,"\\\\\\\\([\'\\"\\\\\\\\])","$1")+16(16(16(20,"<33>","\\54"),"|<71 />",""),"\\\\\\\\([\'\\"\\\\\\\\])","$1")+""})}28 12("\\54$","")},342:15(12){17(12!==81){12=12.23(/<71>/35,"<71 />");12=12.23(/<139\\11[^>]*>([\\49\\55]*?)<\\/139[^>]*>/35,"<11>$1");12=12.23(/<129\\11[^>]*>([\\49\\55]*?)<\\/129[^>]*>/35,"<37>$1");12=12.23(/<241\\11[^>]*>([\\49\\55]*?)<\\/241[^>]*>/35,"<259>$1")}25{12=""}28 12},510:15(12){12=12.23(/<71>/35,"<71 />");12=12.23(/<11\\11[^>]*>([\\49\\55]*?)<\\/11[^>]*>/35,"<139>$1");12=12.23(/<37\\11[^>]*>([\\49\\55]*?)<\\/37[^>]*>/35,"<129>$1");12=12.23(/<259\\11[^>]*>([\\49\\55]*?)<\\/259[^>]*>/35,"<241>$1");12=12.23(/<24(.*?)40="133-341: 166;">([\\49\\55]*?)<\\/24>/35,"<139>$2");12=12.23(/<24(.*?)40="133-40: 163;">([\\49\\55]*?)<\\/24>/35,"<129>$2");12=12.23(/<24(.*?)40="133-341: 166; 133-40: 163;">([\\49\\55]*?)<\\/24>/35,"<129><139>$2");12=12.23(/<24(.*?)40="133-40: 163; 133-341: 166;">([\\49\\55]*?)<\\/24>/35,"<139><129>$2");28 12},413:15(14){18 19=["317","24","32","61","36","71","33","11","37","241","259","179","184","836","261","308","381","511","194","837","838","865","132","137","125","384","238","242","243","892","891","893","130","317","386","890","139","129","56","107","111","245","167","118","439","376","374","375","379","465","466"];18 12=/<\\/?([36-889][36-894-9]*)\\11[^>]*>/35;28 14.23(12,15(20,16){28 11.359(16.385(),19)>"-1"?20:""})},433:15(16,20,14){18 12=14.299("=");18 34=12[1].299(";");18 19="";11.106(34,15(85,37){17(68 37=="110"){28 41}17(37==\'"\'||37=="\'"){28 41}37=37.23(/(^"|^\')/,"").23(/("$|\'$)/,"").23(/"(.*?)"/35,"");37=11.186(37);18 62=37.299(":");17(68 62[1]!=="110"&&(62[1].279("896")===-1&&62[1].279("895")===-1)){17(11.359(11.186(62[0]),16)!="-1"){19+=37+"; "}}});28 20.23(14,\'40="\'+19+\'"\')},446:15(12){18 16=7.$84.47();16=16.23(/|<\\?(?:887)?[\\38\\445]*?\\?>/35,"");16=7.331(16);16=7.413(16);17(7.22.436){16=16.23(/ 43="([\\49\\55]*?)"/35,"")}25{16=16.23(/\\38*43="873(.*?)"/35,"");16=16.23(/\\38*43="874(.*?)"/35,"");16=16.23(/\\38*43="875(.*?)"/35,"");16=16.23(/\\358="872"/35,"");16=16.23(/\\358="871(.*?)"/35,"");16=16.23(/\\358="888(.*?)"/35,"");16=16.23(/"867 868 869"/35,"")}18 14=["89","51","147","40","52","447","43","29","144","435"];18 19=["88","189-88","133-40","146","146-116","146-870","146-113","146-222","98-876","89","51","326","246"];18 34=16.307(/([\\49\\-.:]+)\\38*=\\38*("[^"]*"|\'[^\']*\'|[\\49\\-.:]+)/35);11.106(34,11.31(15(108,85){18 62=85.299("=");17(11.359(62[0],14)=="-1"){16=16.23(85,"")}17(7.22.378===21&&62[0]=="40"){16=7.433(19,16,85)}},7));17(7.22.378===21){16=16.23(/189-88:(\\38+)606;\\38/35,"");16=16.23(/133-40:(\\38+)877;\\38/35,"")}25{16=16.23(/ 40="([\\49\\55]*?)"/35,"")}16=16.23(/((\\38{2,})?|\\38)40=(""|\'\')/35,"");16=16.23(/(&102;){1,}/35,"&102;");16=16.23(/<24(\\38)?>(\\38)?<\\/24>/35," ");16=16.23(/\\38{2,}/20," ");16=16.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");16=16.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");16=16.23(/<24(\\38)?>([\\49\\55]*?)<\\/24>/35,"$2");16=7.383(16);16=7.373(16);16=7.372(16);16=7.364(16);16=16.23(/<33><32>/35,"");16=16.23(/<33>\\38+\\54+<(.*?)/35,"<$1");16=16.23(/<\\/(.*?)>\\38+\\54+<\\/33>/35,"");16=16.23(/<33 40="(.*?)">(\\38)?<\\/33>/35,"");16=16.23(/<33 40="(.*?)"><\\/33>/35,"");16=16.23(/<11\\884="885-886-883(.*?)">([\\49\\55]*?)<\\/11>/35,"$2");16=16.23(/; ">/35,\';">\');7.$84.47(16);18 20=11(7.44.93).65("#310"+12).70(0);7.226(20);7.58();444(11.31(15(){11(7.44.93).65("24[144=310]").94();17(7.22.161===41){7.152(21)}7.143();7.208()},7),100)},331:15(12){12=12.23(/\\38{2,}/20," ");12=12.23(/\\54/20," ");12=12.23(/[\\218]*/20,"");12=12.23(/\\54\\38*\\54/20,"\\54");12=12.23(/^[\\38\\54]*/20,"");12=12.23(/[\\38\\54]*$/20,"");12=12.23(/>\\38+<");28 12},364:15(12){12=12.23(/<125/20,"\\218<125");12=12.23(/<107/20,"\\218<107");12=12.23(/<111/20,"\\218\\218<111");12=12.23(/<\\/107>/20,"\\218");28 12},383:15(16){18 19=["<130>","<194>\\\\38*","<129>\\\\38*","<132>","<137>","<125>","<56>","<107>","<24>\\\\38*<24>","<24>&102;<24>","<11>\\\\38*","<11>&102;","<33>\\\\38*","<33>&102;","<33>\\\\38*<71>\\\\38*","<32>\\\\38*","<32>\\\\38*<71>\\\\38*"];195(18 14=0;14<19.224;++14){18 12=19[14];16=16.23(171 237(12,"35"),"")}28 16},373:15(19){18 16="\\164\\54";18 20=["<33","<67","","","<451","<459","<308","<381","<206","<175","<63","<252","<130","<194","<132","<137","<125","<238","<242","<243","<56","<118","<167","<377","","<245","<107","<111","<386"];195(18 14=0;14<20.224;++14){18 12=20[14];19=19.23(171 237(12,"35"),16+12)}28 19},372:15(19){18 20="\\164\\54";18 12=["","","","","","","","","<71>","<71 />","","","","","","","","","","","","","","","","","","","",""];195(18 14=0;14<12.224;++14){18 16=12[14];19=19.23(171 237(16,"35"),16+20)}28 19},197:15(14){17(11.59.97){18 12=14.307(/<(.*?)>/35);11.106(12,15(19,16){14=14.23(16,16.385())});14=14.23(/40="(.*?)"/35,15(19){28 19.385()});14=14.23(/ 212(.*?)=\\"(.*?)\\"/35,"")}14=14.23(/<24([\\49\\55]*?)40="88:(.*?);"><24([\\49\\55]*?)40="189-88:(.*?);">([\\49\\55]*?)<\\/24><\\/24>/35,\'<24 40="88: $2; 189-88: $4;">$5\');14=14.23(/<24([\\49\\55]*?)40="189-88:(.*?);"><24([\\49\\55]*?)40="88:(.*?);">([\\49\\55]*?)<\\/24><\\/24>/35,\'<24 40="88: $2; 189-88: $4;">$5\');14=14.23(/<24([\\49\\55]*?)88="(.*?)">([\\49\\55]*?)<\\/24\\>/35,\'<24$531="88: $2;">$3\');14=14.23(/<133([\\49\\55]*?)88="(.*?)">([\\49\\55]*?)<\\/133\\>/35,\'<24$531="88: $2;">$3\');14=14.23(/<24 40="(.*?)"\\38+40="(.*?)"[\\38]*>([\\49\\55]*?)<\\/24\\>/35,\'<24 40="$1;$2">$3\');14=14.23(/<133([\\49\\55]*?)>([\\49\\55]*?)<\\/133\\>/35,"<24$1>$2");14=14.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");17(7.22.454){14=14.23(/<71>/35,"<71 />");14=14.23(/<71 ?\\/?>$/35,"");14=14.23(/^<71 ?\\/?>/35,"");14=14.23(/(<179 [^>]+[^\\/])>/35,"$1 />")}14=14.23(/<33><33>/20,"<33>");14=14.23(/<\\/33><\\/33>/20,"");14=14.23(/<384(.*?)>/20,"<384 />");14=14.23(/<33>&102;/20,"<33>");14=14.23(/<33><132>/20,"<132>");14=14.23(/<33><137>/20,"<137>");14=14.23(/<\\/132><\\/33>/20,"");14=14.23(/<\\/137><\\/33>/20,"");14=14.23(/<33(.*?)>&102;<\\/33>/35,"");14=7.331(14);14=7.383(14);14=7.373(14);14=7.372(14);14=7.364(14);28 14},461:15(){18 12;17(7.22.213){7.$92.155();12=7.$84.47();12=11.186(7.197(12));7.$78.48(12).91().86();7.287("47");7.22.213=21}25{7.$78.155();7.$84.47(7.$78.48());7.$92.91();17(7.$84.47()===""){17(!11.59.177){12=7.22.273}25{12=7.22.274}7.239(12)}7.86();7.367("47");7.22.213=41;7.143();7.208();17(7.22.161===41){7.152(21)}}},463:15(){17(7.22.363===21){28 21}882(11.31(15(){11.267(7.22.363,{82:7.176()})},7),7.22.443*878)},442:15(){17(7.22.105===21){28 21}7.$105=11("<132>").121("879");7.$114.311(7.$105);11.106(7.22.362,11.31(15(16,19){17(19!=="|"&&68 7.22.105[19]!=="110"){18 20=7.22.105[19];17(7.22.277===21&&19==="127"){28 41}18 12=11("<125>");17(19==="87"){11(12).121("880")}18 14=7.369(19,20);17(19==="173"||19==="202"||68(20.260)!=="110"){18 34=11(\'<32 43="575" 40="178: 123;">\');17(19==="173"||19==="202"){34=7.581(34,19)}25{34=7.595(34,20.260)}7.265.565(34.425(11(57.93)));7.360=11.31(15(37){7.546(37,34,19)},7);7.599=11.31(15(37){7.598(37,34,19)},7);14.53(7.599)}7.$105.83(11(12).83(14))}17(19==="|"){7.$105.83(11(\'<125 43="881">\'))}},7));11(57).53(7.360);11(7.44).53(7.360)},369:15(14,19){18 12=11(\'<36 52="101:104(81);" 39="\'+19.39+\'" 43="276\'+14+\'"><24>&102;\');17(68 19.64==="110"){12.53(11.31(15(){7.69(19.80,14)},7))}25{17(19.64!=="91"){12.53(11.31(15(16){7[19.64](16)},7))}}17(68 19.236!=="110"){12.53(11.31(15(16){19.236(7,16,14)},7))}28 12},595:15(14,12){11.106(12,11.31(15(19,20){17(68(20.156)==="110"){20.156=""}18 16;17(68 20.126!=="110"&&20.126==="294"){16=11(\'<36 43="842">\')}25{16=11(\'<36 52="101:104(81);" 43="\'+20.156+\'">\'+20.39+"");17(68(20.64)==="110"){11(16).53(11.31(15(){7.69(20.80,19)},7))}25{11(16).53(11.31(15(34){7[20.64](34)},7))}}11(14).83(16)},7));28 14},581:15(108,85){18 16;17(85==="173"){17(11.59.97){16="823"}25{16="588"}}25{16="766"}11(108).89(210);18 20=7.22.361.224;195(18 19=0;19<20;++19){18 12=7.22.361[19];18 62=11(\'<36 144="\'+12+\'" 52="101:104(81);" 43="767">\').45({768:12});11(108).83(62);18 34=7;11(62).53(15(){17(11.59.177){17(16=="588"){34.69("365",21,21);34.69(16,11(7).79("144"));34.69("365",21,41)}25{34.69("589",21,21);34.69(16,11(7).79("144"));34.69("589",21,41)}}25{34.69(16,11(7).79("144"))}})}18 14=11(\'<36 52="101:104(81);" 43="765">\').47(26.123);17(85==="173"){14.53(11.31(7.584,7))}25{14.53(11.31(7.596,7))}11(108).83(14);28 108},584:15(){11(7.228()).45("189-88","606");7.58()},596:15(){11(7.228()).79("88","").45("88","");7.58()},598:15(20,34,12){17(7.162(12).417("227")){7.220()}25{7.220();7.287(12);7.162(12).121("227");18 16=7.162(12).165().113;17(7.22.160&&7.160){11(34).45({181:"160",113:16+"135",116:"764"}).91()}25{18 14=7.$105.165().116+30;11(34).45({181:"420",113:16+"135",116:14+"135"}).91()}}},220:15(){7.$105.65("36.227").136("271").136("227");11(".575").155()},546:15(14,16,12){17(!11(14.142).395().417("227")){11(16).136("271");7.760=21;7.220()}},112:15(){17(7.$92.70(0).148.112){28 7.$92.70(0).148.112()}25{17(7.$92.70(0).148.57.187){28 7.$92.70(0).148.57.187.366()}}},228:15(){17(158.112){28 7.112().370(0).551.217}25{17(57.187){28 7.112().761()}}},547:15(){17(158.112){28 7.112().370(0).551}25{17(57.187){28 7.112()}}},226:15(16,14){18 12=7.44.366();18 19=7.112();14=14?0:1;17(19!==81){12.541(16);19.537(12);19.272(16,14)}7.86()},371:15(20){17(68 158.112!=="110"){18 34=7.112();17(34.824){18 14=34.370(0);14.272(21);14.763(20);14=14.769();14.541(20);14.272(21);34.737();34.537(14)}}25{17(68 57.187!=="110"&&57.187.122!=="770"){18 19=(20.419===1)?20.304:20.82;18 37="777"+(""+95.209()).778(2);19+=\'<24 29="\'+37+\'">\';18 16=7.112();16.272(21);16.552(19);18 12=57.223(37);16.779(12);16.206();12.217.776(12)}}},162:15(12){28 11(7.$105.65("36.276"+12))},287:15(12){7.162(12).121("271")},367:15(12){7.162(12).136("271")},572:15(12,14){7.162(12).121("276"+14)},563:15(12,14){7.162(12).136("276"+14)},775:15(12){7.162(12).94()},771:15(12,14){7.$105.83(11("<125>").83(7.369(12,14)))},87:15(){18 12;17(7.22.87===21){7.572("87","557");7.287("87");7.22.87=41;7.51=7.$92.45("51");7.89=(7.$114.89()-2)+"135";12=7.176();7.368=11("<24>");7.$114.121("556").120(7.368);11(57.93).311(7.$114).45("288","296");7.$84=7.291(12);11(7.44).53(11.31(7.220,7));7.283();7.143();7.208();7.$114.65(".325").155();7.312();11(158).196(11.31(7.312,7));11(57).392(0,0);7.86()}25{7.563("87","557");7.367("87");7.22.87=21;11(158).159("196",11.31(7.312,7));11(57.93).45("288","");12=7.176();7.$114.136("556").45("89","151");7.368.120(7.$114).94();7.$84=7.291(12);7.143();7.208();17(7.22.161){7.387()}7.$114.65(".325").91();11(7.44).53(11.31(7.220,7));7.283();7.58();7.$92.45("51",7.51);7.$78.45("51",7.51);7.86()}},312:15(){17(7.22.87===21){28 21}18 12=11(158).51()-42;7.$114.89(11(158).89()-2);7.$92.51(12);7.$78.51(12)},555:15(){17(7.22.196===21){28 21}7.$330=11(\'<32 43="325">&772;\');7.$114.83(7.$330);7.$330.313(11.31(7.568,7))},568:15(12){17(12.119){12.119()}7.327=12.142;17(7.22.213){7.193=7.$92;7.193.70(0).40.534="296";7.322=7.$78}25{7.193=7.$78;7.322=7.$92}7.240=11.31(7.536,7);7.328=11.31(7.553,7);7.329=11.31(7.196,7);11(57).313(7.328);11(57).247(7.240);11(7.327).247(7.240);7.305=21;7.303=21;7.34=7.193.51()},553:15(){11(57).323(7.329)},196:15(14){17(14.119){14.119()}18 16=14.270;17(7.305===21){7.305=16}17(7.303===21){7.303=7.193.51()}18 12=(7.303+16-7.305)-10;17(12<=30){28 41}17(12>=0){7.193.70(0).40.51=12+"135";7.322.70(0).40.51=12+"135"}},536:15(12){11(57).159("323",7.329);11(57).159("313",7.328);11(57).159("247",7.240);11(7.327).159("247",7.240);7.193.70(0).40.534="773"},535:15(14){18 20=21;18 12=21;18 108;18 85;18 16=11(14).89()/11(14).51();18 34=1;18 37=1;18 62=1;18 19=1;11(14).293(15(){11(14).45("326","774-196")},15(){11(14).45("326","759");20=21});11(14).313(15(117){17(117.119){117.119()}20=41;12=41;108=95.200(117.321-11(14).124(0).165().113);85=95.200(117.270-11(14).124(0).165().116)});11(14).247(11.31(15(117){20=21;7.58();17(7.22.161===41){7.152(21)}},7));11(14).53(11.31(15(117){17(12){7.548(117)}},7));11(14).323(15(257){17(20){12=21;18 54=95.200(257.321-11(7).124(0).165().113)-108;18 117=95.200(257.270-11(7).124(0).165().116)-85;18 33=11(14).51();18 164=316(33,10)+117;18 298=164*16;17(37===1||(68(37)==="543"&&298<37&&298>62)){11(14).89(298)}17(34===1||(68(34)==="543"&&164<34&&164>19)){11(14).51(164)}108=95.200(257.321-11(7).124(0).165().113);85=95.200(257.270-11(7).124(0).165().116)}})},578:15(){7.183(26.56,"56",300,11.31(15(){11("#586").53(11.31(7.592,7))},7),15(){11("#324").86()})},592:15(){18 117=11("#324").48();18 16=11("#585").48();18 12=11("<32>");18 14=95.263(95.209()*258);18 85=11(\'<56 29="56\'+14+\'"><167>\');195(18 20=0;20<117;20++){18 108=11("<107>");195(18 62=0;62<16;62++){18 19=11("<111>&102;");11(108).83(19)}11(85).83(108)}11(12).83(85);18 34=11(12).47();17(11.59.97){34+="<33>"}25{34+="<33>&102;"}7.69("157",34);7.115();7.$56=11(7.44).65("93").65("#56"+14);7.$56.53(11.31(7.319,7));17(7.22.161===41){7.152(21)}},319:15(12){7.$56=11(12.142).320("56");7.$583=7.$56.65("107");7.$577=7.$56.65("111");7.$577.136("286");7.$167=11(12.142).320("167");7.$118=11(7.$56).65("118");7.$285=11(12.142);7.$285.121("286");7.$214=11(12.142).320("107")},604:15(){11(7.$56).94();7.$56=21;7.58()},605:15(){11(7.$214).94();7.58()},603:15(){18 12=11(7.$285).70(0).758;11(7.$56).65("107").106(15(){11(7).65("111").124(12).94()});7.58()},597:15(){17(11(7.$56).65("118").172()!==0){7.382()}25{18 12=11(7.$56).65("107").744().216();12.65("111").47("&102;");7.$118=11("<118>");7.$118.83(12);11(7.$56).311(7.$118);7.58()}},382:15(){11(7.$118).94();7.$118=21;7.58()},450:15(){7.426("191")},601:15(){7.426("120")},593:15(){7.388("191")},580:15(){7.388("120")},426:15(12){18 14=11(7.$214).216();14.65("111").47("&102;");17(12==="120"){11(7.$214).120(14)}25{11(7.$214).191(14)}7.58()},388:15(14){18 12=0;7.$285.121("286");7.$214.65("111").106(15(19,16){17(11(16).417("286")){12=19}});7.$583.106(15(19,16){18 20=11(16).65("111").124(12);18 34=20.216();34.47("&102;");17(14==="120"){11(20).120(34)}25{11(20).191(34)}});7.58()},602:15(){17(11.59.97){7.306()}7.183(26.184,"184",600,11.31(15(){11("#545").53(11.31(7.544,7))},7),15(){11("#428").86()})},544:15(){18 12=11("#428").48();12=7.413(12);17(11.59.97){11(7.44.223("24"+7.153)).120(12).94();7.58()}25{7.69("157",12)}7.115();17(7.22.161===41){7.152(21)}},548:15(20){18 12=11(20.142);18 16=12.395();18 14=11.31(15(){11("#414").48(12.79("411"));11("#745").79("52",12.79("147"));11("#394").48(12.45("246"));17(11(16).70(0).190==="230"){11("#170").48(11(16).79("52"))}11("#549").53(11.31(15(){7.533(12)},7));11("#576").53(11.31(15(){7.532(12)},7))},7);7.183(26.169,"746",380,14)},533:15(12){11(12).94();7.115();7.58();17(7.22.161===41){7.152(21)}},532:15(14){18 12=11(14).395();11(14).79("411",11("#414").48());18 16=11("#394").48();17(16==="113"){11(14).45({"246":"113",146:"0 295 295 0"})}25{17(16==="222"){11(14).45({"246":"222",146:"0 0 295 295"})}25{11(14).45({"246":"123",146:"0"})}}18 19=11.186(11("#170").48());17(19!==""){17(11(12).70(0).190!=="230"){11(14).233(\'<36 52="\'+19+\'">\'+7.304(14)+"")}25{11(12).79("52",19)}}25{17(11(12).70(0).190==="230"){11(12).233(7.304(14))}}7.115();7.143();7.58()},540:15(){17(11.59.97){7.306()}18 12=11.31(15(){17(7.22.266!==21){11.743(7.22.266,11.31(15(16){11.106(16,11.31(15(34,37){18 20=11(\'<179 147="\'+37.742+\'" 144="\'+37.169+\'" />\');11("#418").83(20);11(20).53(11.31(7.571,7))},7))},7))}25{11("#154 36").124(1).94()}17(7.22.264!==21){17(7.244()===21){17(11("#188").172()!==0){11("#188").407({140:7.22.264,131:11.31(7.211,7)})}}7.416("188",{151:41,140:7.22.264,131:11.31(7.211,7)})}25{11(".138").155();17(7.22.266===21){11("#154").94();11("#390").91()}25{18 19=11("#154 36");19.124(0).94();19.124(1).121("198");11("#389").91()}}11("#567").53(11.31(7.560,7))},7);18 14=11.31(15(){17(7.22.264===21&&7.22.266===21){11("#170").86()}},7);7.183(26.169,"169",570,12,14,41)},571:15(12){7.315(\'<179 411="" 147="\'+11(12.142).79("144")+\'" />\',41)},560:15(){17(11("#170").48()!==""){18 12=\'<179 147="\'+11("#170").48()+\'" />\';7.315(12,41)}25{7.115()}},211:15(12){7.315(12)},315:15(14,19){18 12="",16="";17(19!==41){16=11.566(14);12=\'<33><179 147="\'+16.538+\'" />\'}25{12=14}7.86();17(11.59.97){11(7.44.223("24"+7.153)).120(12).94();7.58()}25{7.69("157",12)}17(19!==41&&68 7.22.211==="15"){7.22.211(7,16)}7.115();11(7.44).65("179").464(11.31(15(){7.152(21)},7));7.143()},561:15(){18 12=11.31(15(){18 37=7.112();18 19="",62="";17(11.59.97){18 20=7.228();17(20.562==="230"){7.192=11(20);62=7.192.98();19=7.192.79("52")}25{17(7.396()){62=37.98}25{62=37.268()}7.153=95.263(95.209()*258);18 16=\'<24 29="24\'+7.153+\'">\'+62+"";17(62!==""){16=\'<24 29="24\'+7.153+\'">\'+62+""}7.69("157",16)}}25{17(37&&37.229&&37.229.217.190==="230"){19=37.229.217.52;62=37.229.217.98;17(37.268()===""){7.192=37.229.217}}25{62=37.268();19=""}}11(".281").48(62);18 34=19.23(116.455.52,"");17(19.279("251:")===0){7.423(2);11("#235").48(2);11("#412").48(19.23("251:",""))}25{17(34.279(/^#/35)===0){7.423(3);11("#235").48(3);11("#402").48(34.23(/^#/35,""))}25{11("#292").48(19)}}11("#559").53(11.31(7.558,7))},7);18 14=15(19){11("#292").86()};7.183(26.149,"149",460,12,14)},558:15(){18 14=11("#235").48();18 12="",19="";17(14==="1"){12=11("#292").48();19=11("#554").48()}25{17(14==="2"){12="251:"+11("#412").48();19=11("#564").48()}25{17(14==="3"){12="#"+11("#402").48();19=11("#573").48()}}}7.574(\'<36 52="\'+12+\'">\'+19+" ",11.186(19),12)},574:15(12,19,14){17(19!=""){17(7.192){11(7.192).98(19);11(7.192).79("52",14);7.58()}25{17(11.59.97){11(7.44.223("24"+7.153)).233(12);7.58()}25{7.69("157",12)}}}7.115()},569:15(){17(11.59.97){7.306()}18 12=11.31(15(){18 14=7.112();18 19="";17(7.396()){19=14.98}25{19=14.268()}11("#406").48(19);17(7.244()===21){11("#188").407({140:7.22.277,131:11.31(15(16){7.225(16)},7)})}7.416("188",{151:41,140:7.22.277,131:11.31(15(16){7.225(16)},7)})},7);7.183(26.127,"127",500,12)},225:15(12){18 19=11.566(12);18 16=11("#406").48();17(16===""){16=19.738}18 14=\'<36 52="\'+19.538+\'">\'+16+"";17(11.59.539&&!!158.739){14=14+"&102;"}17(11.59.97){17(16!==""){11(7.44.223("24"+7.153)).233(14)}25{11(7.44.223("24"+7.153)).120(14).94()}7.58()}25{7.69("157",14)}17(68 7.22.225==="15"){7.22.225(7,19)}7.115()},183:15(62,19,20,16,37,14){17(11("#221").172()===0){7.232=11(\'<32 29="221" 40="178: 123;">\');11("93").311(7.232)}17(7.22.232){11("#221").91();11("#221").53(11.31(7.115,7))}17(11("#168").172()===0){7.542=11(\'<32 29="168" 40="178: 123;"><32 29="427">&740;<32 29="550"><32 29="421">\');11("93").83(7.542)}11("#427").53(11.31(7.115,7));7.231=11.31(15(85){17(85.314===27){7.115()}},7);11(57).199(7.231);11(7.44).199(7.231);11("#421").47(7.22["741"+19]);11("#550").47(62);17(11("#154").172()!==0){18 34=7;11("#154 36").106(15(85,108){85++;11(108).53(15(){11("#154 36").136("198");11(7).121("198");11(".138").155();11("#138"+85).91();11("#235").48(85);17(34.244()===21){18 117=11("#168").410();11("#168").45("146-116","-"+(117+10)/2+"135")}})})}11("#215").53(11.31(7.115,7));17(68(16)==="15"){16()}18 12=11("#168").410();17(7.244()===21){11("#168").45({181:"160",116:"50%",113:"50%",89:20+"135",51:"151",590:"-"+(12+10)/2+"135",587:"-"+(20+60)/2+"135"}).747("582")}25{11("#168").45({181:"420",89:"96%",51:"151",116:"748",113:"0",590:"755",587:"2%"}).91();7.469()}17(68(37)==="15"){37()}17(14===41){11("#418").51(300).45("288","151")}},115:15(){11("#427").159("53",7.115);11("#168").756("582",11.31(15(){11("#421").47("");17(7.22.232){11("#221").155();11("#221").159("53",7.115)}11(57).159("199",7.231);11(7.44).159("199",7.231)},7))},423:15(12){11(".138").155();18 14=11("#154 36");14.136("198");14.124(12-1).121("198");11("#138"+12).91()},416:15(14,12){7.109={140:21,131:21,422:21,403:21,151:21,63:21};11.309(7.109,12);17(11("#"+14).172()!==0&&11("#"+14).70(0).190==="757"){7.109.63=11("#"+14);7.174=11(11("#"+14).70(0).67)}25{7.174=11("#"+14)}7.449=7.174.79("182");17(7.109.151){11(7.109.63).754(11.31(15(){7.174.429(15(16){28 21});7.430()},7))}25{17(7.109.403){11("#"+7.109.403).53(11.31(7.430,7))}}},430:15(){7.448(7.174,7.437())},437:15(){7.29="16"+95.263(95.209()*258);18 19=57.753("32");18 12=\'<261 40="178:123" 147="456:457" 29="\'+7.29+\'" 126="\'+7.29+\'">\';19.453=12;57.93.749(19);17(7.109.422){7.109.422()}11("#"+7.29).464(11.31(7.462,7));28 7.29},448:15(20,19){17(7.109.63){18 34="750"+7.29;18 12="751"+7.29;7.67=11(\'<67 182="\'+7.109.140+\'" 262="269" 142="\'+19+\'" 126="\'+34+\'" 29="\'+34+\'" 301="297/67-82">\');18 14=7.109.63;18 37=11(14).216();11(14).79("29",12);11(14).191(37);11(14).425(7.67);11(7.67).45("181","420");11(7.67).45("116","-452");11(7.67).45("113","-452");11(7.67).425("93");7.67.429()}25{20.79("142",19);20.79("262","269");20.79("301","297/67-82");20.79("182",7.109.140);7.174.429()}},462:15(){18 16=11("#"+7.29);18 20;17(16.302){20=16.302}25{17(16.148){20=16.148.57}25{20=158.752[7.29].57}}17(20.455.52==="456:457"){28 41}17(7.109.131){18 19=20.93.453;18 12=19.307(/\\{.*\\}/)[0];7.109.131(12)}7.174.79("182",7.449);7.174.79("142","")},306:15(){7.153=95.263(95.209()*258);7.69("157",\'<24 29="24\'+7.153+\'">\')},396:15(){17(11.59.97&&316(11.59.780,10)<9){28 41}28 21},304:15(12){28 11("<33>").83(11(12).124(0).216()).47()},781:15(12){28 316(12.23("135",""),10)},244:15(){17(/(810|811|812|809|808)/.498(467.468)){28 41}25{28 21}},469:15(){11("47,93").804({392:0},500)}};11.128.400=15(){28 11(7.82("103").44)};11.128.805=15(){28 7.82("103").$92};11.128.806=15(){28 7.82("103").$84};11.128.176=15(){28 7.82("103").176()};11.128.807=15(){28 7.82("103").$84.98()};11.128.239=15(12){7.82("103").239(12)};11.128.401=15(12){7.82("103").401(12)};11.128.813=15(){7.82("103").432();7.814("103")};11.128.820=15(){7.82("103").86()};11.128.69=15(12,14){7.82("103").69(12,14)}})(212);(15(11){11.128.407=15(12){28 7.106(15(){18 14=171 36(7,12);14.318()})};15 36(14,12){7.22=11.309({140:21,131:21,478:21,98:26.440,514:26.458},12);7.$78=11(14)}36.530={318:15(){17(!11.59.821&&!11.59.97){7.404=11(\'<32 43="822">\');7.150=11(\'<32 43="819">\'+7.22.98+"");7.515=11(\'<32 43="818">\'+7.22.514+"");7.404.83(7.150);7.$78.191(7.404);7.$78.191(7.515);7.150.408("815",11.31(15(){28 7.473()},7));7.150.408("816",11.31(15(){28 7.472()},7));18 19=11.31(15(20){18 16=316(20.817/20.803*100,10);7.150.98("802 "+16+"%")},7);18 14=212.788.520();17(14.204){14.204.789("790",19,21)}18 12=15(){28 14};7.150.70(0).787=11.31(15(34){34.119();7.150.136("293").121("786");18 20=34.782.783[0];18 16=171 784();16.83("127",20);11.519({785:"47",140:7.22.140,82:16,520:12,791:21,792:21,799:21,122:"269",131:11.31(15(37){17(7.22.131!==21){7.22.131(37)}17(7.22.478===41){7.150.47(37)}},7)})},7)}},473:15(){7.150.121("293");28 21},472:15(){7.150.136("293");28 21}}})(212);(15(11){18 14=/(^|&415;|\\38)(800\\..+?\\..+?)(\\38|&424;|$)/20,36=/(^|&415;|\\38)(((801?|798):\\/\\/|251:).+?)(\\38|&424;|$)/20,12=15(){18 20=7.476,16=20.224;797(16--){18 34=20[16];17(34.419===3){18 19=34.793;17(19){19=19.23(/&/20,"&794;").23(//20,"&424;").23(14,\'$1<36 52="795://$2">$2$3\').23(36,\'$1<36 52="$2">$2$5\');11(34).120(19).94()}}25{17(34.419===1&&!/^(36|219|252)$/37.498(34.190)){12.796(34)}}}};11.128.490=15(){7.106(12)}})(212);',10,897,'|||||||this||||b|c||d|function|f|if|var|e|g|false|opts|replace|span|else|RLANG||return|id||proxy|div|p|h|gi|a|i|s|title|style|true||class|doc|css||html|val|w||height|href|click|n|W|table|document|syncCode|browser||label|j|input|func|find||form|typeof|execCommand|get|br|||||||el|attr|exec|null|data|append|editor|k|focus|fullscreen|color|width||show|frame|body|remove|Math||msie|text|||javascript|nbsp|redactor|void|toolbar|each|tr|l|uploadOptions|undefined|td|getSelection|left|box|modalClose|top|m|thead|preventDefault|after|addClass|type|none|eq|li|name|file|fn|em|pre|success|ul|font|_shortcuts|px|removeClass|ol|redactor_tab|strong|url|value|target|observeImages|rel|redactor_input|margin|src|contentWindow|link|dropareabox|auto|setAutoSize|spanid|redactor_tabs|hide|className|inserthtml|window|unbind|fixed|autoresize|getBtn|italic|r|offset|bold|tbody|redactor_modal|image|redactor_file_link|new|size|backcolor|element|option|getCode|mozilla|display|img|formatblock|position|action|modalInit|video|Insert|trim|selection|redactor_file|background|tagName|before|insert_link_node|element_resize|blockquote|for|resize|formatting|redactor_tabs_act|keyup|round|outdent|fontcolor|indent|upload|cancel|select|String|observeTables|random||imageUploadCallback|jQuery|visual|current_tr|redactor_btn_modal_close|clone|parentNode|t|button|hideAllDropDown|redactor_modal_overlay|right|getElementById|length|fileUploadCallback|setFocusNode|dropact|getParentNode|anchorNode|A|hdlModalClose|overlay|replaceWith|lang|redactor_tab_selected|callback|RegExp|dl|setCode|stopResizeHdl|del|dt|dd|isMobile|th|float|mouseup|shiftKey|insert|path|mailto|textarea|redactor_btns_box|redactor_modal_footer|Delete|Add|q|99999|strike|dropdown|iframe|method|floor|imageUpload|dropdowns|imageGetJson|post|toString|POST|pageY|act|collapse|allEmptyHtml|mozillaEmptyHtml|deleted|redactor_btn_|fileUpload|unorderedlist|search|Header|redactor_link_text|horizontalrule|observeFocus|unlink|current_td|current|setBtnActive|overflow|orderedlist|RELANG|enable|redactor_link_url|hover|separator|10px|hidden|multipart|o|split||enctype|contentDocument|h_new|outerHTML|null_point|markerIE|match|object|extend|pastemarkerend|prepend|fullScreenResize|mousedown|keyCode|_imageSet|parseInt|code|init|tableObserver|parents|pageX|element_resize_parent|mousemove|redactor_table_rows|redactor_resizer|cursor|splitter|startResizeHdl|resizeHdl|resizer|formattingRemove|execCommandCallback|page|which|observeScroll|handler|anchor|Email|choose|save|weight|preformater|URL|write|insert_table|keyupCallback|autoformat|delete_column|delete_row|delete_table|delete_head|add_head|insert_row_below|insert_row_above|insert_column_left|insert_column_right|keydownCallback|sclass|inArray|hdlHideDropDown|colors|buttons|autosave|formattingIndenting|useCSS|createRange|setBtnInactive|tmpspan|buildButton|getRangeAt|insertNodeAtCaret|formattingAddAfter|formattingAddBefore|h2|h3|h1|caption|removeStyles|h4||embed|deleteHead|formattingEmptyTags|hr|toLowerCase|figure|observeAutoResize|insertColumn|redactor_tab2|redactor_tab3|Column|scrollTop|Row|redactor_form_image_align|parent|oldIE|Right|Align|Left|getDoc|insertHtml|redactor_link_anchor|trigger|droparea|Link|redactor_filename|dragupload|bind|Table|outerHeight|alt|redactor_link_mailto|stripTags|redactor_file_alt|lt|uploadInit|hasClass|redactor_image_box|nodeType|absolute|redactor_modal_inner|start|setModalTab|gt|appendTo|insertRow|redactor_modal_close|redactor_insert_video_area|submit|uploadSubmit|7f7f7f|destroy|cleanStyles|Video|unselectable|removeClasses|uploadFrame|_delete|tfoot|drop_file_here|image_position|buildToolbar|interval|setTimeout|S|pasteCleanUp|frameborder|uploadForm|element_action|insertRowAbove|fieldset|2000px|innerHTML|xhtml|location|about|blank|or_choose|legend||toggle|uploadLoaded|autoSave|load|h5|h6|navigator|userAgent|scrolltop|Code|indexOf|ondragleave|ondrag|insertorderedlist|insertunorderedlist|childNodes|Color|preview|header4|header2|header1|header3|build|getPath|ctrlKey|shortcuts|alignright|link_insert|align_center|linkify|align_left|aligncenter|align_right|justify|buttonsAdd|cleanUp|buttonsCustom|test|align_justify||List|setDoc|script|address|convertDivs|paragraphy|Head|formatEmpty|Image|reformater|param|image_web_link|redactor_tab1|atext|dropalternative|safariShiftKeyEnter|convertLinks|head|ajax|xhr|paragraph|quote|direction|video_html_code|formatNewLine|DIV|rows|columns|min|prototype|1style|imageSave|imageDelete|visibility|resizeImage|stopResize|addRange|filelink|webkit|showImage|selectNodeContents|modal|number|insertVideo|redactor_insert_video_btn|hideDropDown|getCurrentNode|imageEdit|redactor_image_delete_btn|redactor_modal_header|startContainer|pasteHTML|startResize|redactor_link_url_text|buildResizer|redactor_box_fullscreen|normalscreen|insertLink|redactor_insert_link_btn|imageUploadCallbackLink|showLink|nodeName|removeBtnIcon|redactor_link_mailto_text|push|parseJSON|redactor_upload_btn|initResize|showFile||imageSetThumb|changeBtnIcon|redactor_link_anchor_text|_insertLink|redactor_dropdown|redactorSaveBtn|table_td|showTable|alignleft|insertColumnRight|buildColorPicker|fast|table_tr|setBackgroundNone|redactor_table_columns|redactor_insert_table_btn|marginLeft|hilitecolor|styleWithCSS|marginTop|b7dde8|insertTable|insertColumnLeft|en|buildDropdown|setColorNone|addHead|showDropDown|hdlShowDropDown||insertRowBelow|showVideo|deleteColumn|deleteTable|deleteRow|transparent|redactorInsertVideoForm|Save|HTML|160px|Above|dbeef3|b8cce4|Rows|modal_video|Unlink|f2f2f2|fdeada|8db3e2|modal_table|Below|c4bd97|redactor_format_h4|ebf1dd|strikethrough|Columns|fff2ca|f2dcdb|Ordered|bull|e5e0ec|separator_drop1|Italic|Back|Bold|Unordered|separator_drop2|redactor_format_h3|dbe5f1|Font|Outdent|Paragraph|Formatting|Indent|ddd9c3|c6d9f0|redactor_format_blockquote|separator_drop3|redactor_format_h2|d8d8d8|Quote|redactor_format_h1|redactor_format_pre|595959|Cancel|d7e3bc|1f497d|Or|b2a2c7|Choose|Drop|here|Justify|eeece1|Center|4f81bd|c3d69b|c0504d|c09100|9bbb59|File|Upload|d99694|Download|download|e36c09|000000|Anchor|5f497a|17365d|Fullscreen|76923c|366092|953734|Deleted|92cddc|Rule|fac08f|ltr|ffffff|f2c314|a5a5a5|Horizontal|494429|262626|0c0c0c|1d1b10|modal_image|web|redactorInsertImageForm|fbd5b5|ffe694|3f3f3f|000|bfbfbf|f79646|modal_link|None|Position|ffff00|e5b9b7|Web|redactorInsertLinkForm|ccc1d9|Text|modal_image_edit|7px|632423|938953|4f6128|244061|548dd4|0f243e|95b3d7|Embed|3f3151|31859b|Name|optional|4bacc6|redactorUploadFileForm|modal_file|974806|8064a2|7f6000|Title|removeAllRanges|filename|chrome|times|modal_|thumb|getJSON|first|redactor_image_edit_src|image_edit|fadeIn|20px|appendChild|redactorUploadForm|redactorUploadFile|frames|createElement|change|0px|fadeOut|INPUT|cellIndex|default|showedDropDown|parentElement|JustifyLeft|insertNode|30px|redactor_color_none|forecolor|redactor_color_link|backgroundColor|cloneRange|Control|addBtn|mdash|visible|nw|removeBtn|removeChild|marker_|slice|moveToElementText|version|normalize|dataTransfer|files|FormData|dataType|drop|ondrop|ajaxSettings|addEventListener|progress|cache|contentType|nodeValue|amp|http|call|while|ftp|processData|www|https|Loading|total|animate|getFrame|getEditor|getText|Android|BlackBerry|iPhone|iPod|iPad|destroyEditor|removeData|dragover|dragleave|loaded|redactor_dropalternative|redactor_dropareabox|setFocus|opera|redactor_droparea|BackColor|rangeCount|dir|delete|escape|encodeURIComponent|contenteditable|stylesheet|DOCTYPE|media|all|enableObjectResizing|on|audio|mark|cite|math|colgroup|relative|redactor_separator_drop|catch|close|open|metaKey|scroll|keydown|undo|paste|inserthorizontalrule|JustifyCenter|JustifyRight|justifyfull|redo|removeFormat|scrolling|redactor_frame|insertAfter|redactor_box|js|superscript|subscript|Chrome|small|try|Times|New|Roman|bottom|Mso|Nonformat|TOC|Heading|Body|align|normal|1000|redactor_toolbar|redactor_toolbar_right|redactor_separator|setInterval|marker|sid|internal|source|php|Apple|z|figcaption|sub|sup|big|z0|cm|pt'.split('|'),0,{})) \ No newline at end of file diff --git a/syte/static/js/libs/redactor/css/docstyle.css b/syte/static/js/libs/redactor/css/docstyle.css new file mode 100644 index 000000000..fad2f56dd --- /dev/null +++ b/syte/static/js/libs/redactor/css/docstyle.css @@ -0,0 +1,139 @@ +html { + padding: 0; + margin: 0; +} +body { + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + font-size: 15px; + margin: 0; + padding: 0; + overflow-x: hidden; + background: #f4f4f4; +} +#page { + max-width: 900px; + width: 74%; + margin: 20px auto; + padding: 15px 50px; + background: #fff; + border: 1px solid #ddd; +} +#page:focus { + outline: none; +} + +a { + color: #15c; +} + +object, +embed, +video, +iframe { + width: auto; + max-width: 100%; +} +video, +iframe { + height: auto; +} + +::selection { + background-color: #333; + color: #fff; + text-shadow: none; +} + +div, +p, +ul, +ol, +table, +dl, +blockquote, +pre, +iframe, +object, +hr { + margin-bottom: 15px; + line-height: 1.5em; +} +blockquote { + margin-left: 3em; + font-style: italic; + color: #777; +} +ul, ol { + padding-left: 2em; +} +ul ul, +ol ol, +ul ol, +ol ul { + border: none; + margin: 2px !important; + padding: 0; + padding-left: 2em; +} +dl dt { font-weight: bold; } +dd { margin-left: 1em;} + +table { + border-collapse: collapse; + font-size: 1em; +} +table td { + border: 1px solid #ddd; + padding: 5px; +} +table thead td { + border-bottom: 2px solid #000 !important; + font-weight: bold; +} +code, pre { + font-family: monospace sans-serif; +} +code { + background-color: #d8d7d7; +} +pre { + padding: 1em; + border: 1px dashed #ccc; + background: #f5f5f5; + overflow: auto; +} +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; +} + +h1, h2, h3, h4,h5 { + font-weight: bold; +} + +h1 { + font-size: 36px; + line-height: 40px; + margin-bottom: 10px; +} +h2 { + font-size: 30px; + line-height: 36px; + margin-bottom: 15px; +} +h3 { + font-size: 24px; + line-height: 30px; + margin-bottom: 10px; +} +h4 { + font-size: 18px; + line-height: 24px; + margin-bottom: 10px; +} +h4 { + font-size: 1em; + margin-bottom: 10px; +} diff --git a/syte/static/js/libs/redactor/css/redactor.css b/syte/static/js/libs/redactor/css/redactor.css new file mode 100644 index 000000000..0f40119f8 --- /dev/null +++ b/syte/static/js/libs/redactor/css/redactor.css @@ -0,0 +1,410 @@ +.redactor_box { + position: relative; + border: 1px solid #ddd; +/* line-height: 0; */ +} +.redactor_box, .redactor_box textarea { + background-color: #fff; +} +.redactor_box iframe { + outline: none; + width: 100%; + background: #fff; + display: block; + overflow: auto; +} +.redactor_box textarea { + font-family: Menlo, Monaco, monospace, sans-serif; + font-size: 13px; + overflow: auto; + resize: none; + margin: 0; + padding: 0; + display: block; + position: relative; + z-index: 1004; + outline: none; + border: none; + width: 100%; +} +.redactor_box textarea:focus { + outline: none !important; + border: none !important; +} + +/* + Fullscreen +*/ +body .redactor_box_fullscreen { + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; + z-index: 2000; +} + +/* + TOOLBAR +*/ +.redactor_toolbar { + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + position: relative; + left: 0; + top: 0; + margin: 0 !important; + padding: 0 !important; + line-height: 0 !important; + list-style: none; + font-size: 0; + background: #f2f2f2; + background: -moz-linear-gradient(top, #f5f5f5 0%, #ddd 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#ddd)); + background: -webkit-linear-gradient(top, #f5f5f5 0%,#ddd 100%); + background: -o-linear-gradient(top, #f5f5f5 0%,#ddd 100%); + background: -ms-linear-gradient(top, #f5f5f5 0%,#ddd 100%); + background: linear-gradient(top, #f5f5f5 0%,#ddd 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dddddd',GradientType=0 ); + overflow: hidden; + height: 33px; + border-bottom: 1px solid #bbb; +} +.redactor_toolbar li { + float: left !important; + padding: 3px 1px; + padding-right: 0; + list-style-type: none; +} +.redactor_toolbar li.redactor_separator { + float: left; + height: 34px; + border-left: 1px solid #d7d7d7; + border-right: 1px solid #eee; + padding: 0; + margin: 0 2px 0 3px; +} +li.redactor_toolbar_right { + float: none; + float: right !important; + padding: 2px 0; + padding-right: 1px !important; +} +.redactor_toolbar li a, .redactor_toolbar li a span { + width: 25px; + height: 26px; +} +.redactor_toolbar li a { + border: 1px solid transparent; + * border: 1px solid #eee; + display: block; + line-height: 0; + font-size: 0; + cursor: pointer; + zoom: 1; + text-decoration: none; +} +.redactor_toolbar li a span { + display: block; + text-indent: -9999px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAj8AAAAaCAQAAADyW/UQAAAOBUlEQVR4Xu3cCXBUZbrH4V93Z+nubB0CWTBAAIcgigRFFhVZHC7BHUYbuF6FKDKIKOvieGeGiY7LyGUYFFBx7rApg+3CMohI2MNFNknYFAwkIUD2dE7SnXSn093nOl0RC073ycEDZZV1Hqo4ReiX76360v867/k66ER+DhqNRqPnutFoNBotfjQajRY/Go1Go8WPRqPR4kej0Wjxo9HospOnDZlind5/mZlQNBr9ezdbRSyodK0O3sOeGxZhAI9vSQ5e1NIYn32jZioyEha98yJuLnMybFWvhiGuu71dPano/NGAX99Ic+TZ8ELj4aich78Z4EOO4c3+Rz/1W8JcHnPstlHjR1QjqupKvYgXppe/MaDP9Dz8yHhTJKQ5OkLTWKy1tLDFIyirGD9wRa5MhWJhhBYxcUJk8dtb8SLP9MwSp9UXRQAplCMv5omvmm7mknZ/WTKPJpSIG1PijwWIf/e9Gbj45UqWDx+omcrfKL58LzdmFm3U+yPdET5Lsx5LqVfvNTRGiHrnze6eDmulfsdDA7bI7GbYqyNOrE2tmLAtsf7IDcseOPb4iKV4VHWlXhvfkyBMZipOFBpOJ5ahkKbNGy+/+EcCSCOf1qVBIHwAa60kgKTv1kv09Ws7UqcsfvQf9hWW9J1DLg7kGJYNr8siwLbe+giprcfP6tfefyGn300l2ev/efu6u6rmzivPXkIzrYtb+7snFjZFPPPRsHUYccnlua2ztQiJoHkdOeW/q178KBGstXIV0jUAZCrU1CQD2PIRCMZizQCSr4if2JJX0VlPDiiMc5k9eBsxNxOGAUNdpGA+0PmTW0qz2Yed4MKyR59a1u3CiPzIw/GFd2asGG7pghkPhOjKuCrtyWLcl67SrtTTb7zNFAuVmbRRHj/pGOnEOSTU72CgSvpKFWuo7Uk93aXwAQuypK+av4g2IbtK6Vj82Ik7St/OzL3F2LxqMZ7ZmaRQF/rkSz+vx8QFT72PCYg+/HJU3awLkxZPXDCvB3pCiS6aSAsEIJrWOChFB3oDBWP3mnxg7E8MSjR81rUpIsEzLI/zuOXSGRgs87eXMw93iuF0Ik2uQv5r0gqVNUYAVpLN/NmG2Qbmk/3jL1YCYORySY03wpA9KSvNS1nCqsn3frGPpSxmSdy7nVYN2QuN3UgkuPDfP33q/b7f3VK1+P6N4vaSmaOjG0YeQwchuspmUflRFv1wlelKv6B7Vs5o7xjXaM9o95RXakyft5n0ntU/2vP9V9wTPlrYGR2hmA88NGlngqem/Zbb0KNIL9ntUb4biqvSVKyhvif1o9cZfrK3d3TaTx2heN/86x3bOIkOdDoKOTz/Dbyhhq/wqWOdWY7B0HUzbSjb0O/ikFFb8aVEnXxSmPH0LuO6Je/iQSo63XmWFudQwkGhWwCvm0MLb3UZEprGH8SAEv5j3eGWIvZRgJeQbH9r+T2DK+Uj5Xvw4mqwUKe0QvKvy1Soqsnn4GRb9UCYXL/USiPy4jxGYB/bacRPj8a0D5bse+6VtXgxEBURwSS3mTiCiZgzq2TekCNG3cY7Mj8fWPGnj2PDZi1PPBl8xaVpxzrpdNHRZmH2r53OH66ieKuOYKLPvOe6u/u5jjX15guWhkcTlpmT/JlppamCyX02qdB6JobROAgu1hN34/4bB9d0+PrRzG04USCZAwwind1IqN9BaVW+ijXU96SexZZtnQfwTumz7blKzw+1PUstoZTxJU20dU8EUSSfPMw0Bo+fqKc3OQanlGTu+XVBfC5gPvJ0jGPMvzg7b12tfVv63q5li7LGLR+Ekys1jzi4Y5TbwFU73dW6H25wjtuTkk8DSrQ5fyd0O0IpXkITrNPANsS6HKnBtkVcqYEC2wTqAnXKKqCYley2rrNlWZfLVEj6so1EwGJdp7DG/H343A9Qff9k21IrZK2A5eMJLtyvg9hqGvADbaA55vSqKXcvnoobR3QV+PREIBU5488XZ2Tu94flZIzbctvXsxcm1o/c2XiY7/AgxeRvOEk4llfHZ69FuHRt5uZdSJFiH9jVnr2T0oa4nb3KHa8/bYjod6pj2NB8g4uOz/5GGEpSiPgxLB90box1DMDZ+0hQEj8WBE4zCAvpnEZOiN0msEMCxQoHqcFMkxmMilnJBsl+S3Zc2pOC16s/u7pp+wlbZ/L//cjEtonjthoElBBaQrKePXjxE0oDDUD85X8OHj8J6U2HKev4rasxb9xBag+kn3l4yH6OU4BzY59zSfYU6GGnrTR+qE86uOofXz64Jsml46pk2F/asuCeA6mv3Zee/8r/0Tp9TobDYvIOy8GOHIvsqGPhSjHWA/BMv2HxiitAoNiaJ9uBlAW+D6x40hTXtA+EDwQC6PnPoGE4TDYvXUowegC/zyACYCAgOZV4yhC9ftCL0hHmO9P7f7o446HcvkXZY2d+HHV25vSuJb0r3hnZ45u5jYgEU8N59CR73JRTfunqJ5lgEiBWYD1nVj+x4x7gfgCdWLveupVbY0fUW0jgDMFEFd275M12ZjpMvq86/p9Dx67Ch7xA6AicoxPdW4sfC8EVk/9TBqmgVQL5QIbiDiwKOpYNReVPLscP3J4L1iJbZ7Ad5SjHELErOh/rHAhVAEFZBbjDrbnB+gkjAN+cdXW+Ld32tDsxddfA5SM2ztTpH/ySQvxZaxpui3HeXziiIO5zvEg1cZyVw6v+9yWuUrOLIzMrZzxzIer8RJZykdaYD46EG6soxoGEiuErYdJfT/Vc8+GwCcErZLfDIq0hXy6UrLW2IYprEvkRFcN/CCLWE1SY2KyzRybRghhxwokBGwiwR4JBlEbW0d6lkx/a/fgXuxP9+pyuJx+47Xhis21Ql9OjCjAQ1NKBx+4ODF/MnuB0tlxDD1/hos4ezllK/muX6U57l/aOZn1FVOpx6yGKiRYiRB0RBKP/oHdFn3YvI9ClZ8+dXfbOGrsBO/LoxSAC6IQRN3JkdlvdIKV8JfVrWGxZssFYjAVB7uwqEED5CAiKz8cskl7kOotfNnJbB7N/xQrOS/sJI4AacuLOj+4+OjUv5aCL7sW/GZCflEc17fofu+n8PSUU8y2nqUZKpJZDWLhqXje7SbBYL0SFR9JOQfzEV/aDLqepxAvXcPhy9sv718jlL+MNNXzJzMyCdaFchZQtG6zTFNZEEFwiwfjNnjpjvSlJjw/wJQnTjna1kUstoK83gdmDn8uFe3sb9I9vYlefDo5fHe4+duv59pvvHHjsic9M52gG9cMXvk6V51Of+7t4Jsbi6+wzTV9bEZ39n5XdDs1tcHBrbWy3UIN0/ObPvVFZf1nef/6AQ12gqsfMtxY8gwsZ6RzgKGBkIkZ6cUDh8CUdu+QGKbkq+crrMHwJ5MuuLSC0enalpxB5+s3tV8iej8l0ltJ0L4h+8jgh7SeMANwUUcYxbujdvnfz4rHoRm+mADee335ELBcpoRo3IsF5aOCn8C7oW9AW+hegozX6zzPsHSDjK2rhmg5fTVNfcnR+du47M65q+ArMzCHHrBBs68m/mlVC3I81EownUahLXv9A85n60qTa6TWv/TGmgn1UvK53t9OlmR+EtnV4uFzYr5o3ha81jzkTVfvA6uFdFj5y7PaH9z2yKXwPZ/GAzPCVGFNAKZWXrqGGL/tTG1ePOjOAAdXEOofl+L4wmfqk77yr6UaAXpVjNoTYz5g1c+nGEeJn5/I/3MQFNmOUix8j/bAB4OYc6fTiKG5CssiPXfKDlLRKaaX64UvalZqzqyTp2ZVU/IpcZMl01lVobnn0vFfuY4ciLi5Qhom4KeKU0xylHBE7+/HTiJdrJ2Z8TmO3wKPnPIh3ZRY9/gHVyIt8/pWK2QDZv5u0ZmgZ4jUcvkx/f52bOY6ouAIEdoFtN4Ly4QvBNp1idpGmtMa6kGAGE1zdfXvesn49zvCoznXRkdUU6RZdTS+JYf4Y0eg3+aN0ZO6jnsv5ehbfcXDT3AOm2/8RYd87p7Zn1pahW3S5FOIiBOsntNg769I1tLKbPn3NTirgo4avOB0b/tTqp04RiwGRInZSFnS4LeJKv7WlIGMiRl5gFeUMIh2w8AJv4VZ5hqW8Sn2l+pMvFWdXcuJsf7b+/iedj8VkfdHwKwLPfnr+xx924JP/1LMPJx7y+Y5qXIAHj+Kn4VBsy0JovaUV2dxDCk4qiSCMb9lBJfKMb2/GTU907MODDlH+ZrclfTdwhaC3yQ4OUYCAk3LZCmkAWSCwirKKYta33KivbLXGPexUTndkDDsleWdV3fVZ+/DjnU9HV0XVJnrCHQavIaJZL8a4o11JZekN3S+kfUoVl/NEFj734ZayzWO2jhcjwwwzP8nYxj5K8NBCdVd17KeENoThx0E5NejZzgmi0OGhhjKcih/0JlNOSG/Rgt3spjWSXRAoRk2V+kppT/yEldSfXUnZ+frf9/pv70g4ZKtCQLmY5S8zmFQa2E85BnzX52e+LKQBgnS6kyKGVNpiAMBPA5VU0oS8SJJJxgTUcY5aRH7Z0niEQVgIRWA366+IrDCSuIVuJBFPNOHo0AE+PDRQSwVnOUEZXi5nIo0MbsCACTjBAcppVtmVehmMk94hspJ8NNfm3Wq5FGqCoorB3M5JjuDFLqlQ8l53cJ4aJfHz89MYA3FrJJTAYbdkstBjJIZYzEQShgEQ8eGliUYcOHHjQyqceNoRhZ4GyqjFp7ara/YGkd4hCvw8NBbaUEctftS6/vHzsQjwmI5fKI36Pde+TzR6rovHdFr4/LKp33Pt+0Rz/YcvjUaj0f63Q41Go8WPRqPR8P9b1CzENPsjXQAAAABJRU5ErkJggg==); + background-repeat: no-repeat; + background-position: 0; +} + +.redactor_toolbar li a:hover { + border-color: #98a6ba; + background-color: #dde4ef; +} +.redactor_toolbar li a:active, .redactor_toolbar li a.act { + border-color: #b5b5b5; + background-color: #e8e8e8; +} + + +/* + BUTTONS + step 25px +*/ +body .redactor_toolbar li a.redactor_btn_html span { background-position: 0; } +body .redactor_toolbar li a.redactor_btn_formatting span { background-position: -25px; } +body .redactor_toolbar li a.redactor_btn_bold span { background-position: -50px; } +body .redactor_toolbar li a.redactor_btn_italic span { background-position: -75px; } +body .redactor_toolbar li a.redactor_btn_deleted span { background-position: -550px; } +body .redactor_toolbar li a.redactor_btn_unorderedlist span { background-position: -100px; } +body .redactor_toolbar li a.redactor_btn_orderedlist span { background-position: -125px; } +body .redactor_toolbar li a.redactor_btn_outdent span { background-position: -150px; } +body .redactor_toolbar li a.redactor_btn_indent span { background-position: -175px; } +body .redactor_toolbar li a.redactor_btn_image span { background-position: -200px; } +body .redactor_toolbar li a.redactor_btn_video span { background-position: -225px; } +body .redactor_toolbar li a.redactor_btn_file span { background-position: -250px; } +body .redactor_toolbar li a.redactor_btn_table span { background-position: -275px; } +body .redactor_toolbar li a.redactor_btn_link span { background-position: -300px; } +body .redactor_toolbar li a.redactor_btn_fontcolor span { background-position: -325px; } +body .redactor_toolbar li a.redactor_btn_backcolor span { background-position: -350px; } +body .redactor_toolbar li a.redactor_btn_alignleft span { background-position: -375px; } +body .redactor_toolbar li a.redactor_btn_aligncenter span { background-position: -400px; } +body .redactor_toolbar li a.redactor_btn_alignright span { background-position: -425px; } +body .redactor_toolbar li a.redactor_btn_justify span { background-position: -450px; } +body .redactor_toolbar li a.redactor_btn_horizontalrule span { background-position: -475px; } +body .redactor_toolbar li a.redactor_btn_fullscreen span { background-position: -500px; } +body .redactor_toolbar li a.redactor_btn_normalscreen span { background-position: -525px !important; } + +body .redactor_toolbar li a.redactor_btn_button1 span { background-position: -575px; } + + +/* + Toolbar classes +*/ +.redactor_format_blockquote { + font-style: italic; + color: #666 !important; + padding-left: 10px; +} +.redactor_format_pre { + font-family: monospace, sans-serif; +} +.redactor_format_h1, .redactor_format_h2, .redactor_format_h3, .redactor_format_h4 { + font-weight: bold; +} +.redactor_format_h1 { + font-size: 30px; + line-height: 36px; +} +.redactor_format_h2 { + font-size: 24px; + line-height: 36px; +} +.redactor_format_h3 { + font-size: 20px; + line-height: 30px; +} +.redactor_format_h4 { + font-size: 16px; + line-height: 26px; +} + + +/* + RESIZER +*/ +.redactor_resizer { + background-color: #f5f5f5; + padding-top: 2px; + line-height: 4px; + font-size: 12px; + color: #ddd; + text-align: center; + text-shadow: 0 -1px 0 #aaa; + cursor: s-resize; +} + + + +/* + DROPDOWN +*/ +.redactor_dropdown { + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + top: 28px; + left: 0; + z-index: 2004; + position: absolute; + width: 200px; + background-color: #fff; + border: 1px solid #ccc; + font-size: 13px; + -webkit-box-shadow: 0 2px 4px #ccc; + -moz-box-shadow: 0 2px 4px #ccc; + box-shadow: 0 2px 4px #ccc; + line-height: 21px; + padding: 10px; +} +.redactor_separator_drop { + border-top: 1px solid #ddd;; + padding: 0 !important; + line-height: 0; + font-size: 0; +} +.redactor_dropdown a { + display: block; + color: #000; + padding: 3px 5px; + text-decoration: none; +} +.redactor_dropdown a:hover { + color: #444 !important; + text-decoration: none; + background-color: #dde4ef; +} + +/* ColorPicker */ +.redactor_color_link { + padding: 0 !important; + width: 15px !important; + height: 15px !important; + float: left !important; + border: 2px solid #fff !important; + font-size: 0; +} +.redactor_color_none { + font-size: 11px; +} + + + +/* MODAL */ +#redactor_modal_overlay { + position: fixed; + margin: auto; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 50000; + + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + filter:alpha(opacity=80); + opacity: 0.80; + + background-color: #fff !important; +} + +#redactor_modal { + background-color: #fff; + padding: 0; + position: fixed; + top: 50%; + left: 50%; + + box-shadow: 0px 5px 20px #999; + -webkit-box-shadow: 0 5px 20px #999; + -moz-box-shadow: 0 5px 20px #999; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + z-index: 50001; + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + font-size: 12px !important; + color: #000; +} +#redactor_modal_header { + padding: 15px; + font-size: 18px; + + border-radius: 8px 8px 0 0; + + font-weight: bold; + background-color: #f6f6f6; + border-bottom: 1px solid #ddd; +} +#redactor_modal_inner { + padding: 15px 30px 20px 30px; +} +#redactor_modal_close { + position: absolute; + right: 0px; + top: 11px; + font-size: 24px; + width: 30px; + height: 30px; + color: #999; + cursor: pointer; +} +#redactor_modal_close:hover { + color: #000; +} +#redactor_modal_footer { + overflow: hidden; + padding-top: 20px; +} +#redactor_modal label { + margin: 10px 0 0 0 !important; + padding: 0 !important; + float: none !important; + display: block !important; +} +#redactor_modal textarea { + margin-top: 4px; + display: block; +} +#redactor_btn_modal_close { + color: #777; + font-size: 11px !important; + margin-left: 10px; +} +.redactor_input { + width: 99%; + font-size: 14px; +} +#redactor_image_box { + height: 270px; + overflow: auto; + margin-bottom: 10px; +} +#redactor_image_box img { + margin-right: 10px; + margin-bottom: 10px; + cursor: pointer; +} +#redactor_tabs { + margin-bottom: 18px; +} +#redactor_tabs a { + display: inline-block; + border: 1px solid #ddd; + padding: 4px 14px; + font-size: 12px; + text-decoration: none; + color: #000; + line-height: 1; + border-radius: 10px; + margin-right: 3px; +} +#redactor_tabs a:hover, #redactor_tabs a.redactor_tabs_act { + background-color: #eee; + color: #777 !important; + text-decoration: none !important; +} +.redactor_btns_box { + float: right; + padding: 6px 16px; + background-color: #eee; + border-radius: 5px; +} + +/* Drag and Drop Area */ +.redactor_droparea { + position: relative; + width: 100%; + margin: auto; + margin-bottom: 5px; +} +.redactor_droparea .redactor_dropareabox { + z-index: 1; + position: relative; + text-align: center; + width: 99%; + padding: 60px 0; + border: 2px dashed #bbb; +} +.redactor_droparea .redactor_dropareabox, .redactor_dropalternative { + color: #777; + font-size: 12px; +} +.redactor_dropalternative { + margin: 4px 0 2px 0; +} +.redactor_dropareabox.hover { + background: #efe3b8; + border-color: #aaa; +} +.redactor_dropareabox.error { + background: #f7e5e5; + border-color: #dcc3c3; +} +.redactor_dropareabox.drop { + background: #f4f4ee; + border-color: #e0e5d6; +} diff --git a/syte/static/js/libs/redactor/css/style.css b/syte/static/js/libs/redactor/css/style.css new file mode 100644 index 000000000..70e94a427 --- /dev/null +++ b/syte/static/js/libs/redactor/css/style.css @@ -0,0 +1,135 @@ +html { + padding: 0; + margin: 0; +} +body { + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + font-size: 15px; + margin: 0; + padding: 0; + overflow-x: hidden; + background: #fff; +} +#page { + margin: 20px; + background: #fff; +} +#page:focus { + outline: none; +} + +a { + color: #15c; +} + +object, +embed, +video, +iframe { + width: auto; + max-width: 100%; +} +video, +iframe { + height: auto; +} + +::selection { + background-color: #333; + color: #fff; + text-shadow: none; +} + +div, +p, +ul, +ol, +table, +dl, +blockquote, +pre, +iframe, +object, +hr { + margin-bottom: 15px; + line-height: 1.5em; +} +blockquote { + margin-left: 3em; + font-style: italic; + color: #777; +} +ul, ol { + padding-left: 2em; +} +ul ul, +ol ol, +ul ol, +ol ul { + border: none; + margin: 2px !important; + padding: 0; + padding-left: 2em; +} +dl dt { font-weight: bold; } +dd { margin-left: 1em;} + +table { + border-collapse: collapse; + font-size: 1em; +} +table td { + border: 1px solid #ddd; + padding: 5px; +} +table thead td { + border-bottom: 2px solid #000 !important; + font-weight: bold; +} +code, pre { + font-family: monospace sans-serif; +} +code { + background-color: #d8d7d7; +} +pre { + padding: 1em; + border: 1px dashed #ccc; + background: #f5f5f5; + overflow: auto; +} +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; +} + +h1, h2, h3, h4,h5 { + font-weight: bold; +} + +h1 { + font-size: 36px; + line-height: 40px; + margin-bottom: 10px; +} +h2 { + font-size: 30px; + line-height: 38px; + margin-bottom: 15px; +} +h3 { + font-size: 24px; + line-height: 30px; + margin-bottom: 10px; +} +h4 { + font-size: 18px; + line-height: 24px; + margin-bottom: 10px; +} +h5 { + font-size: 1em; + margin-bottom: 10px; +} diff --git a/syte/static/js/libs/redactor/css/wym.css b/syte/static/js/libs/redactor/css/wym.css new file mode 100644 index 000000000..13572d394 --- /dev/null +++ b/syte/static/js/libs/redactor/css/wym.css @@ -0,0 +1,151 @@ + +body { + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + font-size: 15px; + margin: 0; + padding: 0; + overflow-x: hidden; + background-color: #f8f8f8; +} + +#page { + margin: 20px; + background: #f8f8f8; + border: none; + padding: 0; +} +#page:focus { + outline: none; +} + +a { + color: #15c; +} + +object, +embed, +video, +iframe { + width: auto; + max-width: 100%; +} +video, +iframe { + height: auto; +} + +div, +p, +ul, +ol, +table, +dl, +pre, +h1, +h2, +h3, +h4, +h5, +blockquote { + background-color: #fff; + border: 1px solid #ebebeb; + padding: 10px; + margin: 10px 0; +} + +p ul, +p ol { + margin: 0; + padding: 0; + border: none; +} + +div, +p, +ul, +ol, +table, +dl, +blockquote, +pre, +iframe, +object, +hr { + margin-bottom: 15px; + line-height: 1.5em; +} +blockquote { + margin-left: 3em; + font-style: italic; + color: #777; +} +div { + background-color: #fff; + border: 1px dashed #ebebeb; +} +ul, ol { + padding-left: 2em !important; +} +ul ul, +ol ol, +ul ol, +ol ul { + border: none; + margin: 2px !important; + padding: 0; + padding-left: 2em; +} +dl dt { font-weight: bold; } +dd { margin-left: 1em;} + +table { + border-collapse: collapse; + font-size: 1em; +} +table td { + border: 1px solid #ddd; + padding: 5px; +} +table thead td { + border-bottom: 2px solid #000 !important; + font-weight: bold; +} +code, pre { + font-family: monospace sans-serif; +} +code { + background-color: #d8d7d7; +} +pre { + padding: 1em; + border: 1px dashed #ccc; + background: #f5f5f5; + overflow: auto; +} +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; +} + +h1, h2, h3, h4,h5 { + font-weight: bold; + margin-bottom: 10px; +} + +h1 { + font-size: 36px; +} +h2 { + font-size: 30px; +} +h3 { + font-size: 24px; +} +h4 { + font-size: 18px; +} +h5 { + font-size: 1em; +} diff --git a/syte/static/js/libs/redactor/langs/bg.js b/syte/static/js/libs/redactor/langs/bg.js new file mode 100644 index 000000000..c7268a706 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/bg.js @@ -0,0 +1,67 @@ +var RELANG = {}; +RELANG['bg'] = { + html: 'HTML', + video: 'Видео', + image: 'Изображение', + table: 'Таблица', + link: 'Връзка', + link_insert: 'Вкарай връзка ...', + unlink: 'Премахни връзка', + formatting: 'Стилове', + paragraph: 'Параграф', + quote: 'Цитат', + code: 'Код', + header1: 'Заглавие 1', + header2: 'Заглавие 2', + header3: 'Заглавие 3', + header4: 'Заглавие 4', + bold: 'Удебели', + italic: 'Наклони', + fontcolor: 'Цвят на текста', + backcolor: 'Цвят на фона', + unorderedlist: 'Неподреден списък', + orderedlist: 'Подреден списък', + outdent: 'Вкарай навътре', + indent: 'Изкарай навън', + cancel: 'Отказ', + insert: 'Вкарай', + save: 'Запази', + _delete: 'Премахни', + insert_table: 'Вкарай таблица', + insert_row_above: 'Добави ред отгоре', + insert_row_below: 'Добави ред отдолу', + insert_column_left: 'Добави колона отляво', + insert_column_right: 'Добави колона отдясно', + delete_column: 'Премахни колоната', + delete_row: 'Премахни реда', + delete_table: 'Премахни таблицата', + rows: 'Редове', + columns: 'Колони', + add_head: 'Добави заглавен ред', + delete_head: 'Премахни заглавен ред', + title: 'Заглавие', + image_view: 'Виж изображението', + image_position: 'Позиция', + left: 'Ляво', + right: 'Дясно', + image_web_link: 'Уеб връзка', + text: 'Текст', + mailto: 'Имейл', + web: 'Адрес', + video_html_code: 'Код за вграждане на видео', + file: 'Файл', + upload: 'Качи', + download: 'Свали', + choose: 'Избор', + or_choose: 'Или избери', + drop_file_here: 'Провлачете файлове тук', + align_left: 'Подравни в ляво', + align_center: 'Центрирай', + align_right: 'Подравни в дясно', + align_justify: 'Подравни двустранно', + horizontalrule: 'Хоризонтална линия', + fullscreen: 'Цял екран', + deleted: 'Зачеркни', + none: 'Няма', + anchor: 'Връзка' +}; diff --git a/syte/static/js/libs/redactor/langs/by.js b/syte/static/js/libs/redactor/langs/by.js new file mode 100644 index 000000000..5eb4697d4 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/by.js @@ -0,0 +1,65 @@ +var RELANG = {}; +RELANG['by'] = { + html: 'Код', + video: 'Відэа', + image: 'Малюнак', + table: 'Табліца', + link: 'Спасылка', + link_insert: 'Уставіць спасылку ...', + unlink: 'Выдаліць спасылку', + formatting: 'Стылі', + paragraph: 'Звычайны тэкст', + quote: 'Цытата', + code: 'Код', + header1: 'Загаловак 1', + header2: 'Загаловак 2', + bold: 'Паўтлусты', + italic: 'Нахільны', + fontcolor: 'Колер тэксту', + backcolor: 'Заліванне тэксту', + unorderedlist: 'Звычайны спіс', + orderedlist: 'Нумараваны спіс', + outdent: 'Паменьшыць водступ', + indent: 'Павялічыць водступ', + cancel: 'Адмяніць', + insert: 'Уставіць', + save: 'Захаваць', + _delete: 'Выдаліць', + insert_table: 'Уставіць табліцу', + insert_row_above: 'Дадаць радок зверху', + insert_row_below: 'Дадаць радок знізу', + insert_column_left: 'Дадаць слупок злева', + insert_column_right: 'Дадаць слупок справа', + delete_column: 'Выдаліць слупок', + delete_row: 'Выдаліць радок', + delete_table: 'Выдаліць табліцу', + rows: 'Радкі', + columns: 'Стаўбцы', + add_head: 'Дадаць загаловак', + delete_head: 'Выдаліць загаловак', + title: 'Падказка', + image_view: 'Запампаваць малюнак', + image_position: 'Абцяканне тэкстам', + none: 'Няма', + left: 'Злева', + right: 'Справа', + image_web_link: 'Спасылка на малюнак', + text: 'Тэкст', + mailto: 'Эл. пошта ', + web: 'URL', + video_html_code: 'Код відэа роліка', + file: 'Файл', + upload: 'Загрузіць', + download: 'Запампаваць', + choose: 'Выбраць', + or_choose: 'Ці іншае', + drop_file_here: 'Перацягніце файл сюды', + align_left: 'Па левым краі', + align_center: 'Па цэнтры', + align_right: 'Па правым краі', + align_justify: 'Выраўнаваць тэкст па шырыні', + horizontalrule: 'Гарызантальная лінейка', + fullscreen: 'Ва ўвесь экран', + deleted: 'Закрэслены', + anchor: 'Anchor' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/cs.js b/syte/static/js/libs/redactor/langs/cs.js new file mode 100644 index 000000000..6e6dfc753 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/cs.js @@ -0,0 +1,77 @@ +var RELANG = {}; +RELANG['cs'] = { + html: 'HTML', + video: 'Video', + image: 'Obrázek', + table: 'Tabulka', + link: 'Odkaz', + link_insert: 'Vložit odkaz ...', + unlink: 'Odstranit odkaz', + formatting: 'Styly', + paragraph: 'Odstavec', + quote: 'Citace', + code: 'Kód', + header1: 'Nadpis 1', + header2: 'Nadpis 2', + header3: 'Nadpis 3', + header4: 'Nadpis 4', + format: 'Formát', + bold: 'Tučné', + italic: 'Kurzíva', + superscript: 'Horní index', + strikethrough: 'Přeškrtnuté', + fontcolor: 'Barva písma', + backcolor: 'Barva pozadí', + removeformat: 'Odstranit formátování', + cleanformatting: 'Odstranit styly', + lists: 'Seznamy', + unorderedlist: 'Seznam s odrážkami', + orderedlist: 'Číslovaný seznam', + outdent: 'Zmenšit odsazení', + indent: 'Zvětšit odsazení', + redo: 'Vpřed', + undo: 'Zpět', + cut: 'Vyjmout', + cancel: 'Zrušit', + insert: 'Vložit', + save: 'Uložit', + _delete: 'Smazat', + insert_table: 'Vložit tabulku', + insert_row_above: 'Přidat řádek nahoru', + insert_row_below: 'Přidat řádek dolu', + insert_column_left: 'Přidat sloupec vlevo', + insert_column_right: 'Přidat sloupec vpravo', + delete_column: 'Smazat sloupec', + delete_row: 'Smazat řádek', + delete_table: 'Smazat tabulku', + Rows: 'Řádky', + Columns: 'Sloupce', + add_head: 'Přidat záhlaví', + delete_head: 'Smazat záhlaví', + title: 'Titulek', + image_view: 'Zobrazit obrázek', + image_position: 'Pozice', + none: 'žádný', + left: 'vlevo', + right: 'vpravo', + image_web_link: 'Odkaz na obrázek', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Kód pro vložení videa na stránku', + file: 'Soubor', + upload: 'Nahrát', + download: 'Stáhnout', + choose: 'Vybrat', + or_choose: 'nebo', + drop_file_here: 'Přetáhněte soubor zde', + align_left: 'Zarovnat vlevo', + align_center: 'Zarovnat na střed', + align_right: 'Zarovnat vpravo', + align_justify: 'Zarovnat do bloku', + horizontalrule: 'Vodorovná čára', + fullscreen: 'Celá obrazovka', + deleted: 'Přeškrtnuté', + none: 'Žádná', + anchor: 'Záložka' +}; diff --git a/syte/static/js/libs/redactor/langs/de.js b/syte/static/js/libs/redactor/langs/de.js new file mode 100644 index 000000000..b79d6430f --- /dev/null +++ b/syte/static/js/libs/redactor/langs/de.js @@ -0,0 +1,70 @@ +var RELANG = {}; +RELANG['de'] = { + html: 'HTML', + video: 'Video', + image: 'Bilder', + table: 'Tabelle', + link: 'Link', + link_insert: 'Link einfügen ...', + unlink: 'Link entfernen', + formatting: 'Formatvorlagen', + paragraph: 'Absatz', + quote: 'Zitat', + code: 'Code', + header1: 'Überschrift 1', + header2: 'Überschrift 2', + header3: 'Überschrift 3', + header4: 'Überschrift 4', + bold: 'Fett', + italic: 'Kursiv', + fontcolor: 'Schriftfarbe', + backcolor: 'Texthervorhebungsfarbe', + unorderedlist: 'Aufzählungszeichen', + orderedlist: 'Nummerierung', + outdent: 'Einzug verkleinern', + indent: 'Einzug vergrößern', + redo: 'Wiederholen', + undo: 'Rückgängig', + cut: 'Ausschneiden', + cancel: 'Abbrechen', + insert: 'Einfügen', + save: 'Speichern', + _delete: 'Löschen', + insert_table: 'Tabelle einfügen', + insert_row_above: 'Zeile oberhalb einfügen', + insert_row_below: 'Zeile unterhalb einfügen', + insert_column_left: 'Spalte links einfügen', + insert_column_right: 'Spalte rechts einfügen', + delete_column: 'Spalte löschen', + delete_row: 'Zeile löschen', + delete_table: 'Tabelle löschen', + rows: 'Zeilen', + columns: 'Spalten', + add_head: 'Titel einfügen', + delete_head: 'Titel entfernen', + title: 'Title', + image_view: 'Bilder', + image_position: 'Textumbruch', + none: 'Keine', + left: 'Links', + right: 'Rechts', + image_web_link: 'Bilder Link', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video-Einbettungscode', + file: 'Datei', + upload: 'Hochladen', + download: 'Download', + choose: 'Auswählen', + or_choose: 'Oder, wählen Sie eine Datei aus', + drop_file_here: 'Ziehen Sie eine Datei hier hin', + align_left: 'Linksbündig', + align_center: 'Mitte', + align_right: 'Rechtsbündig', + align_justify: 'Blocksatz', + horizontalrule: 'Horizontale Linie', + fullscreen: 'Vollbild', + deleted: 'Durchgestrichen', + anchor: 'Anker' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/en.js b/syte/static/js/libs/redactor/langs/en.js new file mode 100644 index 000000000..7860203dd --- /dev/null +++ b/syte/static/js/libs/redactor/langs/en.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['en'] = { + html: 'HTML', + video: 'Insert Video...', + image: 'Insert Image...', + table: 'Table', + link: 'Link', + link_insert: 'Insert Link ...', + unlink: 'Unlink', + formatting: 'Formatting', + paragraph: 'Paragraph', + quote: 'Quote', + code: 'Code', + header1: 'Header 1', + header2: 'Header 2', + header3: 'Header 3', + header4: 'Header 4', + bold: 'Bold', + italic: 'Italic', + fontcolor: 'Font Color', + backcolor: 'Back Color', + unorderedlist: 'Unordered List', + orderedlist: 'Ordered List', + outdent: 'Outdent', + indent: 'Indent', + cancel: 'Cancel', + insert: 'Insert', + save: 'Save', + _delete: 'Delete', + insert_table: 'Insert Table...', + insert_row_above: 'Add Row Above', + insert_row_below: 'Add Row Below', + insert_column_left: 'Add Column Left', + insert_column_right: 'Add Column Right', + delete_column: 'Delete Column', + delete_row: 'Delete Row', + delete_table: 'Delete Table', + rows: 'Rows', + columns: 'Columns', + add_head: 'Add Head', + delete_head: 'Delete Head', + title: 'Title', + image_position: 'Position', + none: 'None', + left: 'Left', + right: 'Right', + image_web_link: 'Image Web Link', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video Embed Code', + file: 'Insert File...', + upload: 'Upload', + download: 'Download', + choose: 'Choose', + or_choose: 'Or choose', + drop_file_here: 'Drop file here', + align_left: 'Align Left', + align_center: 'Align Center', + align_right: 'Align Right', + align_justify: 'Justify', + horizontalrule: 'Insert Horizontal Rule', + fullscreen: 'Fullscreen', + deleted: 'Deleted', + anchor: 'Anchor' +}; diff --git a/syte/static/js/libs/redactor/langs/eo.js b/syte/static/js/libs/redactor/langs/eo.js new file mode 100644 index 000000000..90de30c7f --- /dev/null +++ b/syte/static/js/libs/redactor/langs/eo.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['eo'] = { + html: 'HTML', // substantive + video: 'Enŝovu Videon...', // imperative + image: 'Enŝovu Bildon...', // imperative + table: 'Tabelo', // substantive + link: 'Ligu', // imperative + link_insert: 'Enŝovu Ligilon ...', // imperative + unlink: 'Malligu', // imperative + formatting: 'Tekstaranĝo', // substantive + paragraph: 'Paragrafo', // substantive + quote: 'Citaĵo', // substantive + code: 'Kodo', // substantive + header1: 'Kapo 1', // substantive + header2: 'Kapo 2', // substantive + header3: 'Kapo 3', // substantive + header4: 'Kapo 4', // substantive + bold: 'Grasa', // adjective + italic: 'Kursiva', // adjective + fontcolor: 'Tipara koloro', // substantive + backcolor: 'Fona koloro', // substantive + unorderedlist: 'Malorda Listo', // substantive + orderedlist: 'Orda Listo', // substantive + outdent: 'Malkrommarĝenu', // imperative + indent: 'Krommarĝenu', // imperative + cancel: 'Rezignu', // imperative + insert: 'Enŝovu', // imperative + save: 'Konservu', // imperative + _delete: 'Forigu', // imperative + insert_table: 'Enŝovu Tabelon...', // imperative + insert_row_above: 'Enŝovu Vico Supren', // imperative + insert_row_below: 'Enŝovu Vico Malsupren', // imperative + insert_column_left: 'Enŝovu Kolumno Maldekstren', // imperative + insert_column_right: 'Enŝovu Kolumno Dekstre', // imperative + delete_column: 'Forigu Kolumnon', // imperative + delete_row: 'Forigu Vicon', // imperative + delete_table: 'Forigu Tabelon', // imperative + rows: 'Vicoj', // substantive (plural) + columns: 'Kolumnoj', // substantive (plural) + add_head: 'Enŝovu Kapon', // imperative + delete_head: 'Forigu Kapon', // imperative + title: 'Titolo', // substantive + image_position: 'Bildloko', // substantive + none: 'Neniu', // determiner + left: 'Maldekstra', // adjective + right: 'Dekstra', // adjective + image_web_link: 'Bilda Hiperligilo', // substantive + text: 'Teksto', // substantive + mailto: 'Retpoŝto', // substantive + web: 'URL', // substantive + video_html_code: 'Videa Enkorpigita Kodo', // substantive + file: 'Enŝovu Dosieron...', // imperative + upload: 'Alŝutu', // imperative + download: 'Elŝutu', // imperative + choose: 'Elektu', // imperative + or_choose: 'Aŭ Elektu', // imperative + drop_file_here: 'Demetu Dosiero Ĉi Tien', // imperative + align_left: 'Ĝisrandigu Maldekstren', // imperative + align_center: 'Centrigu', // imperative + align_right: 'Ĝisrandigu Dekstren', // imperative + align_justify: 'Ĝisrandigu', // imperative + horizontalrule: 'Enŝovu Horizontala Linion', // imperative + fullscreen: 'Plenekrana', // adjective + deleted: 'Foriga', // adjective + anchor: 'Ankro' // substantive +}; diff --git a/syte/static/js/libs/redactor/langs/es.js b/syte/static/js/libs/redactor/langs/es.js new file mode 100644 index 000000000..aa911404e --- /dev/null +++ b/syte/static/js/libs/redactor/langs/es.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['es'] = { + html: 'HTML', + video: 'Video', + image: 'Imagen', + table: 'Tabla', + link: 'Enlace', + link_insert: 'Insertar enlace ...', + unlink: 'Desenlazar', + formatting: 'Estilos', + paragraph: 'Párrafo', + quote: 'Comillas', + code: 'Código', + header1: 'Cabecera 1', + header2: 'Cabecera 2', + header3: 'Cabecera 3', + header4: 'Cabecera 4', + bold: 'Negrita', + italic: 'Itálica', + fontcolor: 'Color fuente', + backcolor: 'Color fondo', + unorderedlist: 'Lista sin orden', + orderedlist: 'Lista ordenada', + outdent: 'Disminuir sangrado', + indent: 'Sangrar', + cancel: 'Cancelar', + insert: 'Añadir', + save: 'Guardar', + _delete: 'Borrar', + insert_table: 'Añadir tabla', + insert_row_above: 'Añadir fila arriba', + insert_row_below: 'Añadir fila debajo', + insert_column_left: 'Añadir columna a la izquierda', + insert_column_right: 'Añadir column a la derecha', + delete_column: 'Borrar columna', + delete_row: 'Borrar fila', + delete_table: 'Borrar tabla', + rows: 'Filas', + columns: 'Columnas', + add_head: 'Añadir cabecera', + delete_head: 'Borrar cabecera', + title: 'Título', + image_position: 'Posición', + none: 'ninguna', + left: 'izquierda', + right: 'derecha', + image_web_link: 'Enlace de imagen web', + text: 'Texto', + mailto: 'Email', + web: 'URL', + video_html_code: 'Código embebido del video', + file: 'Fichero', + upload: 'Cargar', + download: 'Descargar', + choose: 'Seleccionar', + or_choose: 'O seleccionar', + drop_file_here: 'Soltar el fichero aquí', + align_left: 'Alinear a la izquierda', + align_center: 'Alinear al centro', + align_right: 'Alinear a la derecha', + align_justify: 'Justificar', + horizontalrule: 'Trazo horizontal', + fullscreen: 'Pantalla completa', + deleted: 'Borrado', + anchor: 'Anclaje o anchor' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/fa.js b/syte/static/js/libs/redactor/langs/fa.js new file mode 100644 index 000000000..85568c2e3 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/fa.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['fa'] = { + html: 'اچ تی ام ال', + video: 'درج ویدیو...', + image: 'درج تصویر', + table: 'جدول', + link: 'پیوند', + link_insert: 'درج پیوند ...', + unlink: 'از بین بردن پیوند', + formatting: 'فالب بندی', + paragraph: 'پراگراف', + quote: 'نقل قول', + code: 'کد', + header1: 'سرامد 1', + header2: 'سرامد 2', + header3: 'سرامد 3', + header4: 'سرامد 4', + bold: 'درشت', + italic: 'خمیده', + fontcolor: 'رنگ قلم', + backcolor: 'رنگ ضمینه', + unorderedlist: 'فهرست نامرتب', + orderedlist: 'فهرست مرتب شده', + outdent: 'بیرو رفتگی', + indent: 'تو رفتگی', + cancel: 'انصراف', + insert: 'درج', + save: 'ذخیره', + _delete: 'حذف', + insert_table: 'درج جدول ..', + insert_row_above: 'سطر جدید در بالا', + insert_row_below: 'سطر جدید در پائین', + insert_column_left: 'ستون جدید در سمت چپ', + insert_column_right: 'ستون جدید در سمت راست', + delete_column: 'حذف ستون', + delete_row: 'حذف سطر', + delete_table: 'حذف جدول', + rows: 'سطرها', + columns: 'ستونها', + add_head: 'درج سر ستون ', + delete_head: 'حذف سرستون', + title: 'عنوان', + image_position: 'موقعیت', + none: 'هیچیک', + left: 'چپ', + right: 'راست', + image_web_link: 'آدرس تصویر در اینترنت', + text: 'متن', + mailto: 'ایمیل', + web: 'آدرس', + video_html_code: 'کد نمایش ویدئو', + file: 'درج فایل ....', + upload: 'بارگزاری', + download: 'بارگیری', + choose: 'انتخاب کنید', + or_choose: 'یا انتخاب کنید', + drop_file_here: 'این فایل ها حذف شوند', + align_left: 'چپ جین', + align_center: 'وسط چین', + align_right: 'راست چین', + align_justify: 'کشیده', + horizontalrule: 'درج خط جدا کننده', + fullscreen: 'نمایش کامل', + deleted: 'حذف شده', + anchor: 'قلاب' +}; diff --git a/syte/static/js/libs/redactor/langs/fi.js b/syte/static/js/libs/redactor/langs/fi.js new file mode 100644 index 000000000..4ddcd2d47 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/fi.js @@ -0,0 +1,69 @@ +var RELANG = {}; +RELANG['fi'] = { + html: 'HTML', + video: 'Video', + image: 'Kuva', + table: 'Taulukko', + link: 'Linkki', + link_insert: 'Lisää linkki...', + unlink: 'Poista linkki', + formatting: 'Tyylit', + paragraph: 'Normaaliteksti', + quote: 'Lainaus', + code: 'Koodi', + header1: 'Otsikko 1', + header2: 'Otsikko 2', + header3: 'Otsikko 3', + header4: 'Otsikko 4', + bold: 'Lihavointi', + italic: 'Kursivointi', + fontcolor: 'Tekstin väri', + backcolor: 'Taustaväri', + unorderedlist: 'Luettelo luettelomerkein', + orderedlist: 'Numeroitu luettelo', + outdent: 'Vähennä sisennystä', + indent: 'Lisää sisennystä', + redo: 'Tee uudelleen', + undo: 'Kumoa', + cut: 'Leikkaa', + cancel: 'Peru', + insert: 'Lisää', + save: 'Tallenna', + _delete: 'Poista', + insert_table: 'Lisää taulukko', + insert_row_above: 'Lisää rivi ylle', + insert_row_below: 'Lisää rivi alle', + insert_column_left: 'Lisää sarake vasemmalle', + insert_column_right: 'Lisää sarake oikealle', + delete_column: 'Poista sarake', + delete_row: 'Poista rivi', + delete_table: 'Poista taulukko', + rows: 'Rivit', + columns: 'Sarakkeet', + add_head: 'Lisää otsikkorivi', + delete_head: 'Poista otsikkorivi', + title: 'Kuvateksti', + image_position: 'Kuvan sijainti', + none: 'oletus', + left: 'vasen', + right: 'oikea', + image_web_link: 'Kuvan URL-osoite', + text: 'Teksti', + mailto: 'Sähköposti', + web: 'URL-osoite', + video_html_code: 'Videon upotuskoodi', + file: 'Tiedosto', + upload: 'Lähetä', + download: 'Lataa', + choose: 'Valitse', + or_choose: 'tai valitse', + drop_file_here: 'Vedä ja pudota kuva tähän', + align_left: 'Tasaa vasemmalle', + align_center: 'Keskitä', + align_right: 'Tasaa oikealle', + align_justify: 'Tasaa molemmat reunat', + horizontalrule: 'Vaakaviiva', + fullscreen: 'Koko näyttö', + deleted: 'Poistettu', + anchor: 'Ankkuri' +}; diff --git a/syte/static/js/libs/redactor/langs/fr.js b/syte/static/js/libs/redactor/langs/fr.js new file mode 100644 index 000000000..fdd4cf325 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/fr.js @@ -0,0 +1,76 @@ +var RELANG = {}; +RELANG['fr'] = { + html: 'Code HTML', + video: 'Vidéo', + image: 'Image', + table: 'Tableau', + link: 'Lien URL', + link_insert: 'Insérer/Modifier un lien', + unlink: 'Nettoyer le lien', + styles: 'Styles', + paragraph: 'Paragraphe', + quote: 'Citation', + code: 'Code', + header1: 'Titre 1', + header2: 'Titre 2', + header3: 'Titre 3', + header4: 'Titre 4', + format: 'Format', + bold: 'Gras', + italic: 'Italique', + superscript: 'Diacritique', + strikethrough: 'Rayé', + fontcolor: 'Couleur du texte', + backcolor: 'Couleur du fond de ligne', + removeformat: 'Nettoyer le format', + lists: 'Listes', + unorderedlist: 'Liste à puce', + orderedlist: 'Liste numérotée', + outdent: 'Diminuer l\'alinéa', + indent: 'Augmenter l\'alinéa', + redo: 'Refaire', + undo: 'Défaire', + cut: 'Couper', + cancel: 'Annuler', + insert: 'Insérer', + save: 'Sauvegarder', + _delete: 'Supprimer', + insert_table: 'Insérer le tableau', + insert_row_above: 'Ajouter une ligne au dessus', + insert_row_below: 'Ajouter une ligne en dessous', + insert_column_left: 'Ajouter une colonne à gauche', + insert_column_right: 'Ajouter une colonne à droite', + delete_column: 'Supprimer la colonne', + delete_row: 'Supprimer la ligne', + delete_table: 'Supprimer le tableau', + Rows: 'Lignes ', + Columns: 'Colonnes', + add_head: 'Ajouter un titre', + delete_head: 'Supprimer le titre', + title: 'Titre', + image_view: 'Voir l\'image', + image_position: 'Position de l\'image', + none: 'aucun', + left: 'à gauche', + right: 'à droite', + image_web_link: 'lien de l\'image', + text: 'Texte', + mailto: 'Envoyer à ', + web: 'URL', + video_html_code: 'Code HTML de la vidéo', + file: 'Fichier', + upload: 'Envoyer', + download: 'Télécharger', + choose: 'Choisir', + or_choose: 'ou', + drop_file_here: 'Glissez-déposez le fichier ici', + align_left: 'Aligner à gauche', + align_center: 'Aligner au centre', + align_right: 'Aligner à droite', + align_justify: 'Justifier', + horizontalrule: 'Ligne horizontale', + fullscreen: 'Plein écran', + deleted: 'Supprimer', + none: 'aucun', + anchor: 'Ancre' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/hr.js b/syte/static/js/libs/redactor/langs/hr.js new file mode 100644 index 000000000..3fbd34b3a --- /dev/null +++ b/syte/static/js/libs/redactor/langs/hr.js @@ -0,0 +1,69 @@ +var RELANG = {}; +RELANG['hr'] = { + html: 'HTML', + video: 'Video', + image: 'Slika', + table: 'Tablica', + link: 'Poveznica', + link_insert: 'Umetni poveznicu...', + unlink: 'Ukloni poveznicu', + formatting: 'Stilovi', + paragraph: 'Paragraf', + quote: 'Citat', + code: 'Izvorni kod', + header1: 'Zaglavlje 1', + header2: 'Zaglavlje 2', + header3: 'Zaglavlje 3', + header4: 'Zaglavlje 4', + bold: 'Podebljaj', + italic: 'Nakosi', + fontcolor: 'Boja slova', + backcolor: 'Boja pozadine', + unorderedlist: 'Nesortirana lista', + orderedlist: 'Sortirana lista', + outdent: 'Izvuci', + indent: 'Uvuci', + redo: 'Korak naprijed', + undo: 'Korak nazad', + cut: 'Izreži', + cancel: 'Odustani', + insert: 'Umetni', + save: 'Spremi', + _delete: 'Izbriši', + insert_table: 'Umetni tablicu', + insert_row_above: 'Dodaj redak iznad', + insert_row_below: 'Dodaj redak ispod', + insert_column_left: 'Dodaj stupac lijevo', + insert_column_right: 'Dodaj stupac desno', + delete_column: 'Izbriši stupac', + delete_row: 'Izbriši redak', + delete_table: 'Izbriši tablicu', + rows: 'Redaka', + columns: 'Stupaca', + add_head: 'Dodaj zaglavlje', + delete_head: 'Ukloni zaglavlje', + title: 'Naslov', + image_position: 'Poravnanje', + none: 'bez', + left: 'lijevo', + right: 'desno', + image_web_link: 'Web adresa slike', + text: 'Tekst', + mailto: 'Email', + web: 'Web adresa', + video_html_code: 'Video kod', + file: 'Datoteka', + upload: 'Pošalji', + download: 'Preuzmi', + choose: 'Odaberi', + or_choose: 'Ili odaberi', + drop_file_here: 'Povuci datoteku ovdje', + align_left: 'Poravnaj lijevo', + align_center: 'Centriraj', + align_right: 'Poravnaj desno', + align_justify: 'Od ruba do ruba', + horizontalrule: 'Horizontalna crta', + fullscreen: 'Prikaz preko �itavog ekrana', + deleted: 'Izbrisano', + anchor: 'Sidro' +}; diff --git a/syte/static/js/libs/redactor/langs/hu.js b/syte/static/js/libs/redactor/langs/hu.js new file mode 100644 index 000000000..779c75509 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/hu.js @@ -0,0 +1,67 @@ +var RELANG = {}; +RELANG['hu'] = { + html: 'HTML', + video: 'Videó', + image: 'Kép', + table: 'Tábla', + link: 'Link', + link_insert: 'Link beszúrás ...', + unlink: 'Link megszüntetés', + formatting: 'Stílusok', + paragraph: 'Bekezdés', + quote: 'Idézet', + code: 'Kód', + header1: 'Címsor 1', + header2: 'Címsor 2', + header3: 'Címsor 3', + header4: 'Címsor 4', + bold: 'Félkövér', + italic: 'Dőlt', + fontcolor: 'Szöveg szine', + backcolor: 'Szöveg hátterének szine', + unorderedlist: 'Nem számozott lista', + orderedlist: 'Számozott lista', + outdent: 'Outdent', + indent: 'Indent', + cancel: 'Mégsem', + insert: 'Beszurás', + save: 'Mentés', + _delete: 'Törlés', + insert_table: 'Táblázat beszúrása', + insert_row_above: 'Sor beszúrása az aktuális sor fölé', + insert_row_below: 'Sor beszúrása ez alá', + insert_column_left: 'Oszlop beszúrása ettöl balra', + insert_column_right: 'Oszlop hozzáadása ettöl jobbra', + delete_column: 'Oszlop törlése', + delete_row: 'Sor törlése', + delete_table: 'Táblázat törlése', + rows: 'Sorok', + columns: 'Oszlopok', + add_head: 'Fejrész hozzáadása', + delete_head: 'Fejrész törlése', + title: 'Felira', + image_view: 'Kép megnézése', + image_position: 'Pozició', + none: 'nincs', + left: 'bal', + right: 'jobb', + image_web_link: 'Link a képre', + text: 'Szöveg', + mailto: 'Email', + web: 'URL', + video_html_code: 'Videó embed code', + file: 'File', + upload: 'Feltöltés', + download: 'Letöltés', + choose: 'Válassz', + or_choose: 'Vagy válassz', + drop_file_here: 'Ide dobd a file-t', + align_left: 'Balra igazítás', + align_center: 'Középre igazítás', + align_right: 'Jobbra igazítás', + align_justify: 'Sorkizárt', + horizontalrule: 'Horizontális vonal', + fullscreen: 'Teljes képernyős', + deleted: 'Törölt', + anchor: 'Horgony' +}; diff --git a/syte/static/js/libs/redactor/langs/it.js b/syte/static/js/libs/redactor/langs/it.js new file mode 100644 index 000000000..0f75d5bbc --- /dev/null +++ b/syte/static/js/libs/redactor/langs/it.js @@ -0,0 +1,68 @@ +var RELANG = {}; +RELANG['it'] = { + html: 'HTML', + video: 'Video', + image: 'Immagine', + table: 'Tabella', + link: 'Collegamento', + link_insert: 'Inserisci un collegamento ...', + unlink: 'Rimuovi il collegamento', + formatting: 'Stili', + paragraph: 'Paragrafo', + quote: 'Quote', + code: 'Codice', + header1: 'H1', + header2: 'H2', + header3: 'H3', + header4: 'H4', + bold: 'Grassetto', + italic: 'Corsivo', + superscript: 'Superscript', + strikethrough: 'Strikethrough', + fontcolor: 'Colore del font', + backcolor: 'Colore di sfondo', + unorderedlist: 'Elenco puntato', + orderedlist: 'Elenco numerato', + outdent: 'Outdent', + indent: 'Indent', + cancel: 'Cancella', + insert: 'Inserisci', + save: 'Salva', + _delete: 'rimuovi', + insert_table: 'Inserisci tabella', + insert_row_above: 'Inserisci una riga sopra', + insert_row_below: 'Inserisci una riga sotto', + insert_column_left: 'Aggiungi una colonna a sinistra', + insert_column_right: 'Aggiungi una colonna a destra', + delete_column: 'Cancella colonna', + delete_row: 'Cancella riga', + delete_table: 'Cancella tabella', + rows: 'Righe', + columns: 'Colonne', + add_head: 'Aggiungi head', + delete_head: 'Cancella head', + title: 'Titolo', + image_position: 'Posizione', + none: 'Nessun', + left: 'Sinistra', + right: 'Destra', + image_web_link: 'URL immagine', + text: 'Testo', + mailto: 'Email', + web: 'URL', + video_html_code: 'Embed code filmato', + file: 'File', + upload: 'Upload', + download: 'Download', + choose: 'Scegli', + or_choose: 'O Scegli', + drop_file_here: 'Trascina il file qui', + align_left: 'Allinea a sinistra', + align_center: 'Allinea al centro', + align_right: 'Allinea a destra', + align_justify: 'Giustifica', + horizontalrule: 'Orizzonatale', + fullscreen: 'Schermo intero', + deleted: 'Cancellato', + anchor: 'Ancora' +}; diff --git a/syte/static/js/libs/redactor/langs/ja.js b/syte/static/js/libs/redactor/langs/ja.js new file mode 100644 index 000000000..ccbdd94f5 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/ja.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['ja'] = { + html: 'HTML', + video: 'ビデオ', + image: 'イメージ', + table: 'テーブル', + link: 'リンク', + link_insert: 'リンクの挿入 ...', + unlink: 'リンクを外す', + formatting: 'スタイル', + paragraph: '段落', + quote: '引用', + code: 'コード', + header1: 'ヘッダー 1', + header2: 'ヘッダー 2', + header3: 'ヘッダー 3', + header4: 'ヘッダー 4', + bold: '太字', + italic: 'イタリック', + fontcolor: 'フォント色', + backcolor: '背景色', + unorderedlist: '番号なしリスト', + orderedlist: '番号つきリスト', + outdent: '字上げ(逆インデント)', + indent: '字下げ(インデント)', + cancel: 'キャンセル', + insert: '挿入', + save: '保存', + _delete: '削除', + insert_table: 'テーブルの挿入', + insert_row_above: '列を上に追加', + insert_row_below: '列を下に追加', + insert_column_left: '行を左に追加', + insert_column_right: '行を右に追加', + delete_column: '行を削除', + delete_row: '列を削除', + delete_table: 'テーブルを削除', + rows: '列', + columns: '行', + add_head: 'テーブルヘッダの追加', + delete_head: 'テーブルヘッダの削除', + title: 'タイトル', + image_position: 'イメージの位置', + none: '無し', + left: '左', + right: '右', + image_web_link: 'イメージへのリンク', + text: 'テキスト', + mailto: 'メール', + web: 'URL', + video_html_code: 'ビデオ埋め込みコード', + file: 'ファイル', + upload: 'アップロード', + download: 'ダウンロード', + choose: '選択', + or_choose: 'または選択', + drop_file_here: 'ファイルをここにドロップ', + align_left: '左揃え', + align_center: '中央揃え', + align_right: '右揃え', + align_justify: '均等割り付け', + horizontalrule: '水平線', + fullscreen: '全画面', + deleted: '打消し', + anchor: 'アンカー' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/ko.js b/syte/static/js/libs/redactor/langs/ko.js new file mode 100644 index 000000000..42d97f6c3 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/ko.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['ko'] = { + html: 'HTML', + video: '비디오', + image: '이미지', + table: '표', + link: '링크', + link_insert: '링크 삽입...', + unlink: '링크 삭제', + formatting: '스타일', + paragraph: '단락', + quote: '인용', + code: '코드', + header1: '헤더 1', + header2: '헤더 2', + header3: '헤더 3', + header4: '헤더 4', + bold: '굵게', + italic: '기울임꼴', + fontcolor: '글자색', + backcolor: '배경색', + unorderedlist: '글머리기호', + orderedlist: '번호매기기', + outdent: '내어쓰기', + indent: '들여쓰기', + cancel: '취소', + insert: '삽입', + save: '저장', + _delete: '삭제', + insert_table: '표 삽입', + insert_row_above: '열을 위에 추가', + insert_row_below: '열을 아래에 추가', + insert_column_left: '행을 왼쪽에 추가', + insert_column_right: '행을 오른쪽에 추가', + delete_column: '컬럼 삭제', + delete_row: '행 삭제', + delete_table: '표 삭제', + rows: '열', + columns: '행', + add_head: '표 헤더 추가', + delete_head: '표 헤더 체거', + title: '제목', + image_position: '이미지 위치', + none: '없음', + left: '왼쪽', + right: '오른쪽', + image_web_link: '이미지 링크', + text: '텍스트', + mailto: '메일', + web: 'URL', + video_html_code: '비디오 삽입(embed) 코드', + file: '파일', + upload: '업로드', + download: '다운로드', + choose: '선택', + or_choose: '또는 선택', + drop_file_here: '파일을 여기에 떨굼', + align_left: '왼쪽정렬', + align_center: '가운데정렬', + align_right: '오른쪽정렬', + align_justify: '가지런히정렬', + horizontalrule: '수평선', + fullscreen: '전체화면', + deleted: '취소선', + anchor: '링크' +}; diff --git a/syte/static/js/libs/redactor/langs/lv.js b/syte/static/js/libs/redactor/langs/lv.js new file mode 100644 index 000000000..d2f0bf8ef --- /dev/null +++ b/syte/static/js/libs/redactor/langs/lv.js @@ -0,0 +1,65 @@ +var RELANG = {}; +RELANG['lv'] = { + html: 'HTML кods', + video: 'Video', + image: 'Attēls', + table: 'Tabula', + link: 'Saite', + link_insert: 'Iekļaut saiti ...', + unlink: 'Noņemt saiti', + formatting: 'Stili', + paragraph: 'Vienkāršs teksts', + quote: 'Citāts', + code: 'Kods', + header1: 'Virsraksts 1', + header2: 'Virsraksts 2', + header3: 'Virsraksts 3', + header4: 'Virsraksts 4', + bold: 'Pustrekns', + italic: 'Slīps', + fontcolor: 'Teksta krāsa', + backcolor: 'Fona krāsa', + unorderedlist: 'Parasts saraksts', + orderedlist: 'Numurēts saraksts', + outdent: 'Samazināt atkāpi', + indent: 'Palielināt atkāpi', + cancel: 'Atcelt', + insert: 'Iespraust', + save: 'Saglabāt', + _delete: 'Dzēst', + insert_table: 'Iespraust tabulu', + insert_row_above: 'Pievienot rindu no augšas', + insert_row_below: 'Pievienot rindu no apakšas', + insert_column_left: 'Pievienot stabiņu no kreisās puses', + insert_column_right: 'Pievienot stabiņu no labās puses', + delete_column: 'Dzēst stabiņu', + delete_row: 'Dzēst rindu', + delete_table: 'Dzēst tabulu', + rows: 'Rindas', + columns: 'Stabiņi', + add_head: 'Pievienot virsrakstu', + delete_head: 'Dzēst virsrakstu', + title: 'Uzvedne', + image_position: 'Аttēla apliece', + none: 'nav', + left: 'pa kreisi', + right: 'pa labi', + image_web_link: 'vai saite uz attēlu', + text: 'Teksts', + mailto: 'E-pasts', + web: 'URL', + video_html_code: 'Videoklipu kods', + file: 'Fails', + upload: 'Augšupielāde', + download: 'Lejupielāde', + choose: 'Izvēlieties', + or_choose: 'Vai izvēlieties', + drop_file_here: 'Vilkt failu uz šejieni', + align_left: 'Izlīdzināt pa labi', + align_center: 'Izlīdzināt pa kreisi', + align_right: 'Izlīdzināt pret centru', + align_justify: 'Izlīdzināt malas', + horizontalrule: 'Horizontāla līnija', + fullscreen: 'Pa visu ekrānu', + anchor: 'Anchor' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/nl.js b/syte/static/js/libs/redactor/langs/nl.js new file mode 100644 index 000000000..d0fa70eaa --- /dev/null +++ b/syte/static/js/libs/redactor/langs/nl.js @@ -0,0 +1,69 @@ +var RELANG = {}; +RELANG['nl'] = { + html: 'HTML', + video: 'Video', + image: 'Afbeelding', + table: 'Tabel', + link: 'Link', + link_insert: 'Link invoegen...', + unlink: 'Link ontkoppelen', + formatting: 'Stijlen', + paragraph: 'Paragraaf', + quote: 'Citaat', + code: 'Code', + header1: 'Kop 1', + header2: 'Kop 2', + header3: 'Kop 3', + header4: 'Kop 4', + bold: 'Vet', + italic: 'Cursief', + fontcolor: 'Tekstkleur', + backcolor: 'Achtergrondkleur', + unorderedlist: 'Ongeordende lijst', + orderedlist: 'Geordende lijst', + outdent: 'Uitspringen', + indent: 'Inspringen', + redo: 'Opnieuw maken', + undo: 'Ongedaan maken', + cut: 'Knippen', + cancel: 'Annuleren', + insert: 'Invoegen', + save: 'Opslaan', + _delete: 'Verwijderen', + insert_table: 'Tabel invoegen', + insert_row_above: 'Rij hierboven invoegen', + insert_row_below: 'Rij hieronder invoegen', + insert_column_left: 'Kolom links toevoegen', + insert_column_right: 'Kolom rechts toevoegen', + delete_column: 'Verwijder kolom', + delete_row: 'Verwijder rij', + delete_table: 'Verwijder tabel', + rows: 'Rijen', + columns: 'Kolommen', + add_head: 'Titel toevoegen', + delete_head: 'Titel verwijderen', + title: 'Titel', + image_position: 'Positie', + none: 'geen', + left: 'links', + right: 'rechts', + image_web_link: 'Afbeelding link', + text: 'Tekst', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video embed code', + file: 'Bestand', + upload: 'Uploaden', + download: 'Downloaden', + choose: 'Kies', + or_choose: 'Of kies', + drop_file_here: 'Sleep bestand hier', + align_left: 'Links uitlijnen', + align_center: 'Centreren', + align_right: 'Rechts uitlijnen', + align_justify: 'Uitvullen', + horizontalrule: 'Horizontale lijn', + fullscreen: 'Volledig scherm', + deleted: 'Verwijderd', + anchor: 'Anker' +}; diff --git a/syte/static/js/libs/redactor/langs/pl.js b/syte/static/js/libs/redactor/langs/pl.js new file mode 100644 index 000000000..22b24fa96 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/pl.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['pl'] = { + html: 'Źródło', + video: 'Wideo', + image: 'Obrazek', + table: 'Tabela', + link: 'Link', + link_insert: 'Wstaw link ...', + unlink: 'Usuń link', + formatting: 'Style', + paragraph: 'Zwykły tekst', + quote: 'Cytat', + code: 'Kod źródłowy', + header1: 'Nagłówek 1', + header2: 'Nagłówek 2', + header3: 'Nagłówek 3', + header4: 'Nagłówek 4', + bold: 'Pogrubiony', + italic: 'Pochylony', + fontcolor: 'Kolor tekstu', + backcolor: 'Kolor tła', + unorderedlist: 'Wypunktowanie', + orderedlist: 'Numeracja', + outdent: 'Zwiększ wcięcie', + indent: 'Zmniejsz wcięcie', + cancel: 'Anuluj', + insert: 'Wstaw', + save: 'Zachowaj', + _delete: 'Usuń', + insert_table: 'Wstaw tabele', + insert_row_above: 'Dodaj wiersz na górze', + insert_row_below: 'Dodaj wiersz na dole', + insert_column_left: 'Dodaj kolumnę po lewej', + insert_column_right: 'Dodaj kolumnę po prawej', + delete_column: 'Usuń kolumnę', + delete_row: 'Usuń wiersz', + delete_table: 'Usuń tabele', + rows: 'Wiersze', + columns: 'Kolumny', + add_head: 'Dodaj nagłówek', + delete_head: 'Usuń nagłówek', + title: 'Wskazówka', + image_position: 'Obramowanie', + none: 'nie ma', + left: 'od lewej', + right: 'od prawej', + image_web_link: 'albo link do obrazku', + text: 'Tekst', + mailto: 'Poczta e-mail', + web: 'URL', + video_html_code: 'Kod źródłowy pliku wideo', + file: 'Plik', + upload: 'Wgraj na serwer', + download: 'Pobierz', + choose: 'Choose', + or_choose: 'Or choose', + drop_file_here: 'Drop file here', + align_left: 'Align left', + align_center: 'Align center', + align_right: 'Align right', + align_justify: 'Justify', + horizontalrule: 'Horizontal rule', + fullscreen: 'Fullscreen', + deleted: 'Deleted', + anchor: 'Anchor' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/pt_br.js b/syte/static/js/libs/redactor/langs/pt_br.js new file mode 100644 index 000000000..e343e9f19 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/pt_br.js @@ -0,0 +1,72 @@ +var RELANG = {}; +RELANG['pt_br'] = { + html: 'Ver HTML', + video: 'Vídeo', + image: 'Imagem', + table: 'Tabela', + link: 'Link', + link_insert: 'Inserir link...', + unlink: 'Remover link', + formatting: 'Estilos', + paragraph: 'Parágrafo', + quote: 'Citação', + code: 'Código', + header1: 'Título 1', + header2: 'Título 2', + header3: 'Título 3', + header4: 'Título 4', + bold: 'Negrito', + italic: 'Itálico', + fontcolor: 'Cor da fonte', + backcolor: 'Cor do fundo', + unorderedlist: 'Lista não ordenada', + orderedlist: 'Lista ordenada', + outdent: 'Remover identação', + indent: 'Identar', + cancel: 'Cancelar', + insert: 'Inserir', + save: 'Salvar', + _delete: 'Remover', + insert_table: 'Inserir tabela', + add_cell: 'Adicionar coluna', + delete_cell: 'Remover coluna', + add_row: 'Adicionar linha', + delete_row: 'Remover linha', + thead: 'Cabeçalho', + delete_table: 'Remover tabela', + insert_row_above: 'Adicionar linha acima', + insert_row_below: 'Adicionar linha abaixo', + insert_column_left: 'Adicionar coluna à esquerda', + insert_column_right: 'Adicionar coluna da direita', + delete_column: 'Remover Coluna', + delete_row: 'Remover linha', + delete_table: 'Remover tabela', + rows: 'Linhas', + columns: 'Colunas', + add_head: 'Adicionar cabeçalho', + delete_head: 'Remover cabeçalho', + title: 'Título', + image_position: 'Posição', + none: 'nenhum', + left: 'esquerda', + right: 'direita', + image_web_link: 'link para uma imagem', + text: 'Texto', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video embed code', + file: 'Arquivo', + upload: 'Upload', + download: 'Download', + choose: 'Escolha', + or_choose: 'Ou escolha', + drop_file_here: 'Arraste um arquivo até aqui', + align_left: 'Alinhar a esquerda', + align_center: 'Centralizar', + align_right: 'Alinhar a direita', + align_justify: 'Justificar', + horizontalrule: 'Linha horizontal', + fullscreen: 'Tela cheia', + deleted: 'Removido', + anchor: 'Anchor' +}; diff --git a/syte/static/js/libs/redactor/langs/ru.js b/syte/static/js/libs/redactor/langs/ru.js new file mode 100644 index 000000000..57f0267a4 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/ru.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['ru'] = { + html: 'Код', + video: 'Видео', + image: 'Изображение', + table: 'Таблица', + link: 'Ссылка', + link_insert: 'Вставить ссылку ...', + unlink: 'Удалить ссылку', + formatting: 'Форматирование', + paragraph: 'Обычный текст', + quote: 'Цитата', + code: 'Код', + header1: 'Заголовок 1', + header2: 'Заголовок 2', + header3: 'Заголовок 3', + header4: 'Заголовок 4', + bold: 'Полужирный', + italic: 'Наклонный', + fontcolor: 'Цвет текста', + backcolor: 'Заливка текста', + unorderedlist: 'Обычный список', + orderedlist: 'Нумерованный список', + outdent: 'Уменьшить отступ', + indent: 'Увеличить отступ', + cancel: 'Отменить', + insert: 'Вставить', + save: 'Сохранить', + _delete: 'Удалить', + insert_table: 'Вставить таблицу', + insert_row_above: 'Добавить строку сверху', + insert_row_below: 'Добавить строку снизу', + insert_column_left: 'Добавить столбец слева', + insert_column_right: 'Добавить столбец справа', + delete_column: 'Удалить столбец', + delete_row: 'Удалить строку', + delete_table: 'Удалить таблицу', + rows: 'Строки', + columns: 'Столбцы', + add_head: 'Добавить заголовок', + delete_head: 'Удалить заголовок', + title: 'Подсказка', + image_position: 'Обтекание текстом', + none: 'Нет', + left: 'Cлева', + right: 'Cправа', + image_web_link: 'Cсылка на изображение', + text: 'Текст', + mailto: 'Эл. почта', + web: 'URL', + video_html_code: 'Код видео ролика', + file: 'Файл', + upload: 'Загрузить', + download: 'Скачать', + choose: 'Выбрать', + or_choose: 'Или выберите', + drop_file_here: 'Перетащите файл сюда', + align_left: 'По левому краю', + align_center: 'По центру', + align_right: 'По правому краю', + align_justify: 'Выровнять текст по ширине', + horizontalrule: 'Горизонтальная линейка', + fullscreen: 'Во весь экран', + deleted: 'Зачеркнутый', + anchor: 'Якорь' +}; diff --git a/syte/static/js/libs/redactor/langs/sk.js b/syte/static/js/libs/redactor/langs/sk.js new file mode 100644 index 000000000..d63051955 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/sk.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['sk'] = { + html: 'HTML', + video: 'Video', + image: 'Obrázok', + table: 'Tabulka', + link: 'Odkaz', + link_insert: 'Vložiť odkaz ...', + unlink: 'Odstrániť odkaz', + formatting: 'Štýl', + paragraph: 'Odstavec', + quote: 'Citácia', + code: 'Kód', + header1: 'Nadpis 1', + header2: 'Nadpis 2', + header3: 'Nadpis 3', + header4: 'Nadpis 4', + bold: 'Tučné', + italic: 'Kurzíva', + fontcolor: 'Farba písma', + backcolor: 'Farba pozadia', + unorderedlist: 'Zoznam s odrážkami', + orderedlist: 'Číslovaný zoznam', + outdent: 'Zmenšiť odsadenie', + indent: 'Zväčšiť odsadenie', + cancel: 'Zrušiť', + insert: 'Vložiť', + save: 'Uložiť', + _delete: 'Smazať', + insert_table: 'Vložiť tabulku', + insert_row_above: 'Pridať riadok hore', + insert_row_below: 'Pridať riadok dole', + insert_column_left: 'Pridať stĺpec vľavo', + insert_column_right: 'Pridať stľpec vpravo', + delete_column: 'Zmazať stľpec', + delete_row: 'Zmazať riadok', + delete_table: 'Zmazať tabulku', + rows: 'Riadky', + columns: 'Stľpce', + add_head: 'Pridať záhlavie', + delete_head: 'Zmazať záhlavie', + title: 'Titulok', + image_position: 'Pozícia', + none: 'žiadny', + left: 'vľavo', + right: 'vpravo', + image_web_link: 'Odkaz na obrázok', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Kód pre vloženie videa na stránku', + file: 'Súbor', + upload: 'Nahrát', + download: 'Stiahnúť', + choose: 'Vybrať', + or_choose: 'alebo', + drop_file_here: 'Pretiahnite súbor sem', + align_left: 'Zarovnať vľavo', + align_center: 'Zarovnať na stred', + align_right: 'Zarovnať vpravo', + align_justify: 'Zarovnať do bloku', + horizontalrule: 'Vodorovná čiara', + fullscreen: 'Celá obrazovka', + deleted: 'Prečiarknuté', + anchor: 'Záložka' +}; diff --git a/syte/static/js/libs/redactor/langs/sq.js b/syte/static/js/libs/redactor/langs/sq.js new file mode 100644 index 000000000..5b184f93a --- /dev/null +++ b/syte/static/js/libs/redactor/langs/sq.js @@ -0,0 +1,69 @@ +var RELANG = {}; +RELANG['sq'] = { + html: 'HTML', + video: 'Video', + image: 'Fotografi', + table: 'Tabelë', + link: 'Link', + link_insert: 'Lidh linq ...', + unlink: 'Hiq linkun', + formatting: 'Stilet', + paragraph: 'Paragraf', + quote: 'Kuotë', + code: 'Kod', + header1: 'Header 1', + header2: 'Header 2', + header3: 'Header 3', + header4: 'Header 4', + bold: 'Te trasha / Bold', + italic: 'Kursive / Italic', + fontcolor: 'Ngjyra e shkronjave', + backcolor: 'Ngjyra e mbrapavisë së shkronjave', + unorderedlist: 'Liste pa renditje', + orderedlist: 'Liste me renditje', + outdent: 'Outdent', + indent: 'Indent', + redo: 'Ribëj', + undo: 'Zhbëj', + cut: 'Cut', + cancel: 'Anulo', + insert: 'Insert', + save: 'Ruaje', + _delete: 'Fshije', + insert_table: 'Shto tabelë', + insert_row_above: 'Shto rresht sipër', + insert_row_below: 'Shto rresht përfundi', + insert_column_left: 'Shto kolonë majtas', + insert_column_right: 'Shto kolonë djathtas', + delete_column: 'Fshije kolonën', + delete_row: 'Fshije rreshtin', + delete_table: 'Fshije tabelën', + rows: 'Rreshta', + columns: 'Kolona', + add_head: 'Shto titujt e tabelës', + delete_head: 'Fshije titujt e tabelës', + title: 'Titulli', + image_position: 'Pozita', + none: 'Normale', + left: 'Majtas', + right: 'Djathtas', + image_web_link: 'Linku i fotografisë në internet', + text: 'Teksti', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video embed code', + file: 'Fajll', + upload: 'Ngarko', + download: 'Shkarko', + choose: 'Zgjedh', + or_choose: 'Ose zgjedh', + drop_file_here: 'Gjuaje fajllin këtu', + align_left: 'Rreshtoje majtas', + align_center: 'Rreshtoje në mes', + align_right: 'Rreshtoje djathtas', + align_justify: 'Rreshtoje të gjithin njejt', + horizontalrule: 'Vizë horizontale', + fullscreen: 'Pamje e plotë', + deleted: 'E fshirë', + anchor: 'Anchor' +}; diff --git a/syte/static/js/libs/redactor/langs/tr.js b/syte/static/js/libs/redactor/langs/tr.js new file mode 100644 index 000000000..5cbb234c9 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/tr.js @@ -0,0 +1,66 @@ +var RELANG = {}; +RELANG['tr'] = { + html: 'HTML', + video: 'Video', + image: 'Görsel', + table: 'Tablo', + link: 'Bağlantı', + link_insert: 'Bağlantı Ekle ...', + unlink: 'Bağlantı Kaldır', + formatting: 'Stiller', + paragraph: 'Paragraf', + quote: 'Alıntı', + code: 'Kod', + header1: 'Başlık 1', + header2: 'Başlık 2', + header3: 'Başlık 3', + header4: 'Başlık 4', + bold: 'Kalın', + italic: 'Eğik', + fontcolor: 'Yazı rengi', + backcolor: 'Arkaplan rengi', + unorderedlist: 'Sırasız liste', + orderedlist: 'Sıralı liste', + outdent: 'Girintiyi azalt', + indent: 'Girintiyi artır', + cancel: 'İptal', + insert: 'Ekle', + save: 'Kaydet', + _delete: 'Sil', + insert_table: 'Tablo ekle', + insert_row_above: 'Yukarı satır ekle', + insert_row_below: 'Alta satır ekle', + insert_column_left: 'Sola sütun ekle', + insert_column_right: 'Sağa sütun ekle', + delete_column: 'Sütun sil', + delete_row: 'Satır sil', + delete_table: 'Tablo sil', + rows: 'Satırlar', + columns: 'Sütunlar', + add_head: 'Başlık ekle', + delete_head: 'Başlık sil', + title: 'Başlık', + image_position: 'Pozisyon', + none: 'hiçbiri', + left: 'sol', + right: 'sağ', + image_web_link: 'Görselin web bağlantısı', + text: 'Yazı', + mailto: 'E-Posta', + web: 'URL', + video_html_code: 'Video embed kodu', + file: 'Dosya', + upload: 'Yükle', + download: 'İndir', + choose: 'Seç', + or_choose: 'Veya seç', + drop_file_here: 'Dosyayı buraya bırak', + align_left: 'Sola hizala', + align_center: 'Ortala', + align_right: 'Sağa hizala', + align_justify: 'Satır uzunluğuna ayarla', + horizontalrule: 'Yatay çizgi', + fullscreen: 'Tam ekran', + deleted: 'Silindi', + anchor: 'Çapa' +}; diff --git a/syte/static/js/libs/redactor/langs/ua.js b/syte/static/js/libs/redactor/langs/ua.js new file mode 100644 index 000000000..c9f33fbcc --- /dev/null +++ b/syte/static/js/libs/redactor/langs/ua.js @@ -0,0 +1,67 @@ +var RELANG = {}; +RELANG['ua'] = { + html: 'Код', + video: 'Відео', + image: 'Зображення', + table: 'Таблиця', + link: 'Посилання', + link_insert: 'Вставити посилання ...', + unlink: 'Видалити посилання', + formatting: 'Стилі', + paragraph: 'Звичайний текст', + quote: 'Цитата', + code: 'Код', + header1: 'Заголовок 1', + header2: 'Заголовок 2', + header3: 'Заголовок 3', + header4: 'Заголовок 4', + bold: 'Жирний', + italic: 'Похилий', + fontcolor: 'Колір тексту', + backcolor: 'Заливка тексту', + unorderedlist: 'Звичайний список', + orderedlist: 'Нумерований список', + outdent: 'Зменшити відступ', + indent: 'Збільшити відступ', + cancel: 'Скасувати', + insert: 'Вставити', + save: 'Зберегти', + _delete: 'Видалити', + insert_table: 'Вставити таблицю', + insert_row_above: 'Додати рядок зверху', + insert_row_below: 'Додати рядок знизу', + insert_column_left: 'Додати стовпець ліворуч', + insert_column_right: 'Додати стовпець праворуч', + delete_column: 'Видалити стовпець', + delete_row: 'Видалити рядок', + delete_table: 'Видалити таблицю', + rows: 'Рядки', + columns: 'Стовпці', + add_head: 'Додати заголовок', + delete_head: 'Видалити заголовок', + title: 'Підказка', + image_view: 'Завантажити зображення', + image_position: 'Обтікання текстом', + none: 'ні', + left: 'ліворуч', + right: 'праворуч', + image_web_link: 'Посилання на зображення', + text: 'Текст', + mailto: 'Ел. пошта', + web: 'URL', + video_html_code: 'Код відео ролика', + file: 'Файл', + upload: 'Завантажити', + download: 'Завантажити', + choose: 'Вибрати', + or_choose: 'Або виберіть', + drop_file_here: 'Перетягніть файл сюди', + align_left: 'По лівому краю', + align_center: 'По центру', + align_right: 'По правому краю', + align_justify: 'Вирівняти текст по ширині', + horizontalrule: 'Горизонтальная лінійка', + fullscreen: 'На весь екран', + deleted: 'Закреслений', + anchor: 'Anchor' +}; \ No newline at end of file diff --git a/syte/static/js/libs/redactor/langs/zh_cn.js b/syte/static/js/libs/redactor/langs/zh_cn.js new file mode 100644 index 000000000..e30fbe5c3 --- /dev/null +++ b/syte/static/js/libs/redactor/langs/zh_cn.js @@ -0,0 +1,67 @@ +//@chen1706@gmail.com +var RELANG = {}; +RELANG['zh_cn'] = { + html: 'HTML代码', + video: '视频', + image: '图片', + table: '表格', + link: '链接', + link_insert: '插入链接', + unlink: '取消链接', + formatting: '样式', + paragraph: '段落', + quote: '引用', + code: '代码', + header1: '一级标题', + header2: '二级标题', + header3: '三级标题', + header4: '四级标题', + bold: '粗体', + italic: '斜体', + fontcolor: '字体颜色', + backcolor: '背景颜色', + unorderedlist: '项目编号', + orderedlist: '数字编号', + outdent: '减少缩进', + indent: '增加缩进', + cancel: '取消', + insert: '插入', + save: '保存', + _delete: '删除', + insert_table: '插入表格', + insert_row_above: '在上方插入', + insert_row_below: '在下方插入', + insert_column_left: '在左侧插入', + insert_column_right: '在右侧插入', + delete_column: '删除整列', + delete_row: '删除整行', + delete_table: '删除表格', + rows: '行', + columns: '列', + add_head: '添加标题', + delete_head: '删除标题', + title: '标题', + image_position: '位置', + none: '无', + left: '左', + right: '右', + image_web_link: '图片网页链接', + text: '文本', + mailto: '邮箱', + web: '网址', + video_html_code: '视频嵌入代码', + file: '文件', + upload: '上传', + download: '下载', + choose: '选择', + or_choose: '或选择', + drop_file_here: '将文件拖拽至此区域', + align_left: '左对齐', + align_center: '居中', + align_right: '右对齐', + align_justify: '两端对齐', + horizontalrule: '水平线', + fullscreen: '全屏', + deleted: '删除', + anchor: '锚点' +}; diff --git a/syte/static/js/libs/redactor/redactor.js b/syte/static/js/libs/redactor/redactor.js new file mode 100644 index 000000000..f96ae955b --- /dev/null +++ b/syte/static/js/libs/redactor/redactor.js @@ -0,0 +1,3387 @@ +/* + Redactor v7.7.1 + Updated: July 7, 2012 + + http://redactorjs.com/ + + Copyright (c) 2009-2012, Imperavi Ltd. + License: http://redactorjs.com/license/ + + Usage: $('#content').redactor(); +*/ + +if (typeof RELANG === 'undefined') +{ + var RELANG = {}; +} + +var RLANG = { + html: 'HTML', + video: 'Insert Video...', + image: 'Insert Image...', + table: 'Table', + link: 'Link', + link_insert: 'Insert Link ...', + unlink: 'Unlink', + formatting: 'Formatting', + paragraph: 'Paragraph', + quote: 'Quote', + code: 'Code', + header1: 'Header 1', + header2: 'Header 2', + header3: 'Header 3', + header4: 'Header 4', + bold: 'Bold', + italic: 'Italic', + fontcolor: 'Font Color', + backcolor: 'Back Color', + unorderedlist: 'Unordered List', + orderedlist: 'Ordered List', + outdent: 'Outdent', + indent: 'Indent', + cancel: 'Cancel', + insert: 'Insert', + save: 'Save', + _delete: 'Delete', + insert_table: 'Insert Table...', + insert_row_above: 'Add Row Above', + insert_row_below: 'Add Row Below', + insert_column_left: 'Add Column Left', + insert_column_right: 'Add Column Right', + delete_column: 'Delete Column', + delete_row: 'Delete Row', + delete_table: 'Delete Table', + rows: 'Rows', + columns: 'Columns', + add_head: 'Add Head', + delete_head: 'Delete Head', + title: 'Title', + image_position: 'Position', + none: 'None', + left: 'Left', + right: 'Right', + image_web_link: 'Image Web Link', + text: 'Text', + mailto: 'Email', + web: 'URL', + video_html_code: 'Video Embed Code', + file: 'Insert File...', + upload: 'Upload', + download: 'Download', + choose: 'Choose', + or_choose: 'Or choose', + drop_file_here: 'Drop file here', + align_left: 'Align Left', + align_center: 'Align Center', + align_right: 'Align Right', + align_justify: 'Justify', + horizontalrule: 'Insert Horizontal Rule', + fullscreen: 'Fullscreen', + deleted: 'Deleted', + anchor: 'Anchor' +}; + + + + +(function($){ + + "use strict"; + + // Plugin + jQuery.fn.redactor = function(option) + { + return this.each(function() + { + var $obj = $(this); + + var data = $obj.data('redactor'); + if (!data) + { + $obj.data('redactor', (data = new Redactor(this, option))); + } + }); + }; + + + // Initialization + var Redactor = function(element, options) + { + // Element + this.$el = $(element); + + // Lang + if (typeof options !== 'undefined' && typeof options.lang !== 'undefined' && options.lang !== 'en' && typeof RELANG[options.lang] !== 'undefined') + { + RLANG = RELANG[options.lang]; + } + + // Options + this.opts = $.extend({ + + lang: 'en', + direction: 'ltr', // ltr or rtl + + callback: false, // function + keyupCallback: false, // function + keydownCallback: false, // function + execCommandCallback: false, // function + + path: false, + css: 'style.css', + focus: false, + resize: true, + autoresize: false, + fixed: false, + + autoformat: true, + cleanUp: true, + removeStyles: false, + removeClasses: false, + convertDivs: true, + convertLinks: true, + xhtml: false, + + handler: false, // false or url + + autosave: false, // false or url + interval: 60, // seconds + + imageGetJson: false, // url (ex. /folder/images.json ) or false + + imageUpload: false, // url + imageUploadCallback: false, // function + + fileUpload: false, // url + fileUploadCallback: false, // function + + observeImages: true, + visual: true, + fullscreen: false, + overlay: true, // modal overlay + + buttonsCustom: {}, + buttonsAdd: [], + buttons: ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', + 'image', 'video', 'file', 'table', 'link', '|', + 'fontcolor', 'backcolor', '|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', + 'horizontalrule', 'fullscreen'], + + colors: [ + '#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00', + '#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca', + '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694', + '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314', + '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100', + '#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'], + + // private + allEmptyHtml: '


            ', + mozillaEmptyHtml: '

             

            ', + + // modal windows container + modal_file: String() + + '
            ' + + '' + + '' + + '
            ' + + '' + + '
            ' + + '
            ', + + modal_image_edit: String() + + '' + + '' + + '' + + '' + + '' + + '' + + '', + + modal_image: String() + + '' + + '
            ' + + '
            ' + + '' + + '
            ' + + '' + + '
            ' + + '' + + '', + + modal_link: String() + + '
            ' + + '
            ' + + 'URL' + + 'Email' + + '' + RLANG.anchor + '' + + '
            ' + + '' + + '
            ' + + '' + + '' + + '
            ' + + '' + + '' + + '
            ' + + '', + + modal_table: String() + + '' + + '' + + '' + + '' + + '', + + modal_video: String() + + '
            ' + + '' + + '' + + '
            ' + + '', + + + toolbar: { + html: + { + title: RLANG.html, + func: 'toggle' + }, + formatting: + { + title: RLANG.formatting, + func: 'show', + dropdown: + { + p: + { + title: RLANG.paragraph, + exec: 'formatblock' + }, + blockquote: + { + title: RLANG.quote, + exec: 'formatblock', + className: 'redactor_format_blockquote' + }, + pre: + { + title: RLANG.code, + exec: 'formatblock', + className: 'redactor_format_pre' + }, + h1: + { + title: RLANG.header1, + exec: 'formatblock', + className: 'redactor_format_h1' + }, + h2: + { + title: RLANG.header2, + exec: 'formatblock', + className: 'redactor_format_h2' + }, + h3: + { + title: RLANG.header3, + exec: 'formatblock', + className: 'redactor_format_h3' + }, + h4: + { + title: RLANG.header4, + exec: 'formatblock', + className: 'redactor_format_h4' + } + } + }, + bold: + { + title: RLANG.bold, + exec: 'bold' + }, + italic: + { + title: RLANG.italic, + exec: 'italic' + }, + deleted: + { + title: RLANG.deleted, + exec: 'strikethrough' + }, + unorderedlist: + { + title: '• ' + RLANG.unorderedlist, + exec: 'insertunorderedlist' + }, + orderedlist: + { + title: '1. ' + RLANG.orderedlist, + exec: 'insertorderedlist' + }, + outdent: + { + title: '< ' + RLANG.outdent, + exec: 'outdent' + }, + indent: + { + title: '> ' + RLANG.indent, + exec: 'indent' + }, + image: + { + title: RLANG.image, + func: 'showImage' + }, + video: + { + title: RLANG.video, + func: 'showVideo' + }, + file: + { + title: RLANG.file, + func: 'showFile' + }, + table: + { + title: RLANG.table, + func: 'show', + dropdown: + { + insert_table: + { + title: RLANG.insert_table, + func: 'showTable' + }, + separator_drop1: + { + name: 'separator' + }, + insert_row_above: + { + title: RLANG.insert_row_above, + func: 'insertRowAbove' + }, + insert_row_below: + { + title: RLANG.insert_row_below, + func: 'insertRowBelow' + }, + insert_column_left: + { + title: RLANG.insert_column_left, + func: 'insertColumnLeft' + }, + insert_column_right: + { + title: RLANG.insert_column_right, + func: 'insertColumnRight' + }, + separator_drop2: + { + name: 'separator' + }, + add_head: + { + title: RLANG.add_head, + func: 'addHead' + }, + delete_head: + { + title: RLANG.delete_head, + func: 'deleteHead' + }, + separator_drop3: + { + name: 'separator' + }, + delete_column: + { + title: RLANG.delete_column, + func: 'deleteColumn' + }, + delete_row: + { + title: RLANG.delete_row, + func: 'deleteRow' + }, + delete_table: + { + title: RLANG.delete_table, + func: 'deleteTable' + } + } + }, + link: + { + title: RLANG.link, + func: 'show', + dropdown: + { + link: + { + title: RLANG.link_insert, + func: 'showLink' + }, + unlink: + { + title: RLANG.unlink, + exec: 'unlink' + } + } + }, + fontcolor: + { + title: RLANG.fontcolor, + func: 'show' + }, + backcolor: + { + title: RLANG.backcolor, + func: 'show' + }, + alignleft: + { + exec: 'JustifyLeft', + title: RLANG.align_left + }, + aligncenter: + { + exec: 'JustifyCenter', + title: RLANG.align_center + }, + alignright: + { + exec: 'JustifyRight', + title: RLANG.align_right + }, + justify: + { + exec: 'justifyfull', + title: RLANG.align_justify + }, + horizontalrule: + { + exec: 'inserthorizontalrule', + title: RLANG.horizontalrule + }, + fullscreen: + { + title: RLANG.fullscreen, + func: 'fullscreen' + } + } + + + }, options, this.$el.data()); + + this.dropdowns = []; + + // Init + this.init(); + }; + + // Functionality + Redactor.prototype = { + + + // Initialization + init: function() + { + // get path to styles + this.getPath(); + + if (this.opts.toolbar !== false) + { + $.extend(this.opts.toolbar, this.opts.buttonsCustom); + + $.each(this.opts.buttonsAdd, $.proxy(function(i,s) + { + this.opts.buttons.push(s); + }, this)); + } + + // get dimensions + this.height = this.$el.css('height'); + this.width = this.$el.css('width'); + + // construct editor + this.build(); + + // get html + var html = this.$el.val(); + + // preformatter + html = this.preformater(html); + + // conver newlines to p + if (this.opts.autoformat) + { + html = this.paragraphy(html); + } + + // enable + this.$editor = this.enable(html); + + // focus always on page + this.observeFocus(); + + // cleanup + if (this.opts.cleanUp === true) + { + $(this.doc).bind('paste', $.proxy(function(e) + { + setTimeout($.proxy(function () + { + var marker = Math.floor(Math.random() * 99999); + var marker_text = ''; + if ($.browser.mozilla) marker_text = ' '; + var node = $('' + marker_text + ''); + this.insertNodeAtCaret(node.get(0)); + + this.pasteCleanUp(marker); + + }, this), 100); + + }, this)); + } + + // keyup + $(this.doc).keyup($.proxy(function(e) + { + var key = e.keyCode || e.which; + + // callback as you type + if (typeof this.opts.keyupCallback === 'function') + { + this.opts.keyupCallback(this, e); + } + + if (this.opts.autoformat) + { + // if empty + if (key === 8 || key === 46) + { + return this.formatEmpty(e); + } + + // new line p + if (key === 13 && !e.shiftKey && !e.ctrlKey && !e.metaKey) + { + return this.formatNewLine(e); + } + } + + this.syncCode(); + + }, this)); + + // toolbar + this.buildToolbar(); + + // resizer + if (this.opts.autoresize === false) + { + this.buildResizer(); + } + else + { + this.observeAutoResize(); + } + + // shortcuts + this.shortcuts(); + + // autosave + this.autoSave(); + + // observers + this.observeImages(); + this.observeTables(); + + // fullscreen on start + if (this.opts.fullscreen) + { + this.opts.fullscreen = false; + this.fullscreen(); + } + + // focus + if (this.opts.focus) + { + this.focus(); + } + + // fixed + if (this.opts.fixed) + { + this.observeScroll(); + $(document).scroll($.proxy(this.observeScroll, this)); + } + + // callback + if (typeof this.opts.callback === 'function') + { + this.opts.callback(this); + } + + }, + shortcuts: function() + { + $(this.doc).keydown($.proxy(function(e) + { + var key = e.keyCode || e.which; + + // callback keydown + if (typeof this.opts.keydownCallback === 'function') + { + this.opts.keydownCallback(this, e); + } + + if (e.ctrlKey) + { + if (key === 90) + { + this._shortcuts(e, 'undo'); // Ctrl + z + } + else if (key === 90 && e.shiftKey) + { + this._shortcuts(e, 'redo'); // Ctrl + Shift + z + } + else if (key === 77) + { + this._shortcuts(e, 'removeFormat'); // Ctrl + m + } + else if (key === 66) + { + this._shortcuts(e, 'bold'); // Ctrl + b + } + else if (key === 73) + { + this._shortcuts(e, 'italic'); // Ctrl + i + } + else if (key === 74) + { + this._shortcuts(e, 'insertunorderedlist'); // Ctrl + j + } + else if (key === 75) + { + this._shortcuts(e, 'insertorderedlist'); // Ctrl + k + } + else if (key === 76) + { + this._shortcuts(e, 'superscript'); // Ctrl + l + } + else if (key === 72) + { + this._shortcuts(e, 'subscript'); // Ctrl + h + } + } + + if (!e.shiftKey && key === 9) + { + this._shortcuts(e, 'indent'); // Tab + } + else if (e.shiftKey && key === 9 ) + { + this._shortcuts(e, 'outdent'); // Shift + tab + } + + // safari shift key + enter + if ($.browser.webkit && navigator.userAgent.indexOf('Chrome') === -1) + { + return this.safariShiftKeyEnter(e, key); + } + + }, this)); + + }, + _shortcuts: function(e, cmd) + { + if (e.preventDefault) + { + e.preventDefault(); + } + this.execCommand(cmd, null); + }, + getPath: function() + { + if (this.opts.path !== false) + { + return this.opts.path; + } + + $('script').each($.proxy(function(i,s) + { + if (s.src) + { + // Match redactor.js or redactor.min.js, followed by an optional querystring (often used for cache purposes) + var regexp = new RegExp(/\/redactor(\.min)?\.js(\?.*)?/); + if (s.src.match(regexp)) + { + this.opts.path = s.src.replace(regexp, ''); + } + } + }, this)); + + }, + build: function() + { + // container + this.$box = $('
            '); + + // frame + this.$frame = $(''); + + // hide textarea + this.$el.css('width', '100%').hide(); + + // append box and frame + this.$box.insertAfter(this.$el).append(this.$frame).append(this.$el); + + }, + write: function(html) + { + this.doc.open(); + this.doc.write(html); + this.doc.close(); + }, + enable: function(html) + { + this.doc = this.getDoc(this.$frame.get(0)); + + if (this.doc !== null) + { + this.write(this.setDoc(html)); + if ($.browser.mozilla) + { + this.doc.execCommand("useCSS", false, true); + } + return $(this.doc).find('#page'); + } + else + { + return false; + } + }, + setDoc: function(html) + { + var frameHtml = '\n' + + '' + + '
            ' + + html + + '
            '; + + return frameHtml; + }, + getDoc: function(frame) + { + if (frame.contentDocument) + { + return frame.contentDocument; + } + else if (frame.contentWindow && frame.contentWindow.document) + { + return frame.contentWindow.document; + } + else if (frame.document) + { + return frame.document; + } + else + { + return null; + } + }, + focus: function() + { + this.$editor.focus(); + }, + syncCode: function() + { + var html = this.formatting(this.$editor.html()); + this.$el.val(html); + }, + + // API functions + setCode: function(html) + { + html = this.preformater(html); + + this.$editor.html(html).focus(); + + this.syncCode(); + }, + getCode: function() + { + var html = this.$editor ? this.$editor.html() : this.$el.val(); + html = this.reformater(html); + + return html; + }, + insertHtml: function(html) + { + this.execCommand('inserthtml', html); + this.observeImages(); + }, + destroy: function() + { + var html = this.getCode(); + + this.$box.after(this.$el); + this.$box.remove(); + this.$el.val(html).show(); + + for (var i = 0; i < this.dropdowns.length; i++) + { + this.dropdowns[i].remove(); + delete(this.dropdowns[i]); + } + + }, + handler: function() + { + $.ajax({ + url: this.opts.handler, + type: 'POST', + data: 'redactor=' + escape(encodeURIComponent(this.getCode())), + success: $.proxy(function(data) + { + this.setCode(data); + this.syncCode(); + + }, this) + }); + + }, + // end API functions + + // OBSERVERS + observeFocus: function() + { + if ($(this.doc).find('body').height() < $(this.$frame.get(0).contentWindow).height()) + { + $(this.doc).click($.proxy(function(e) { this.$editor.focus(); }, this)); + } + }, + observeImages: function() + { + if (this.opts.observeImages === false) + { + return false; + } + + if ($.browser.mozilla) + { + this.doc.execCommand("enableObjectResizing", false, "false"); + } + + $(this.doc).find('img').each($.proxy(function(i,s) + { + if ($.browser.msie) $(s).attr('unselectable', 'on'); + this.resizeImage(s); + + }, this)); + + }, + observeTables: function() + { + $(this.doc).find('body').find('table').click($.proxy(this.tableObserver, this)); + }, + observeScroll: function() + { + var scrolltop = $(document).scrollTop(); + var boxtop = this.$box.offset().top; + + if (scrolltop > boxtop) + { + this.fixed = true; + this.$toolbar.css({ position: 'fixed', width: '100%' }); + } + else + { + this.fixed = false; + this.$toolbar.css({ position: 'relative', width: 'auto' }); + } + }, + observeAutoResize: function() + { + this.$editor.css({ 'min-height': this.$el.height() + 'px' }); + $(this.doc).find('body').css({ 'overflow': 'hidden' }); + this.setAutoSize(false); + $(this.doc).keyup($.proxy(this.setAutoSize, this)); + }, + setAutoSize: function(e) + { + var key = false; + if (e !== false) + { + key = e.keyCode || e.which; + } + + var height = this.$editor.outerHeight(true); + + if (e === true && (key === 8 || key === 46)) + { + this.$frame.height(height); + } + else + { + this.$frame.height(height+30); + } + + + }, + + + // EXECCOMMAND + execCommand: function(cmd, param) + { + if (this.opts.visual && this.doc) + { + try + { + if ($.browser.msie) + { + this.focus(); + } + + if (cmd === 'inserthtml' && $.browser.msie) + { + this.doc.selection.createRange().pasteHTML(param); + } + else if (cmd === 'formatblock' && $.browser.msie) + { + this.doc.execCommand(cmd, false, '<' +param + '>'); + } + else + { + this.doc.execCommand(cmd, false, param); + } + + this.syncCode(); + this.focus(); + + if (typeof this.opts.execCommandCallback === 'function') + { + this.opts.execCommandCallback(this, cmd); + } + } + catch (e) { } + + } + }, + + // FORMAT NEW LINE + formatNewLine: function(e) + { + var parent = this.getParentNode(); + if (parent.nodeName === 'DIV' && parent.id === 'page') + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var element = $(this.getCurrentNode()); + if (element.get(0).tagName === 'DIV' && (element.html() === '' || element.html() === '
            ')) + { + var newElement = $('

            ').append(element.clone().get(0).childNodes); + element.replaceWith(newElement); + newElement.html('
            '); + this.setFocusNode(newElement.get(0)); + + this.syncCode(); + return false; + } + else + { + this.syncCode(); + } + + // convert links + if (this.opts.convertLinks) + { + this.$editor.linkify(); + } + } + else + { + this.syncCode(); + return true; + } + }, + + // SAFARI SHIFT KEY + ENTER + safariShiftKeyEnter: function(e, key) + { + if (e.shiftKey && key === 13) + { + e.preventDefault(); + + var node1 = $('
            '); + this.insertNodeAtCaret(node1.get(0)); + this.setFocusNode(node1.get(0)); + + this.syncCode(); + + return false; + } + else + { + return true; + } + }, + + // FORMAT EMPTY + formatEmpty: function(e) + { + var html = $.trim(this.$editor.html()); + + if ($.browser.mozilla) + { + html = html.replace(/
            /gi, ''); + } + + if (html === '') + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var nodehtml = this.opts.allEmptyHtml; + if ($.browser.mozilla) + { + nodehtml = this.opts.mozillaEmptyHtml; + } + + var node = $(nodehtml).get(0); + this.$editor.html(node); + this.setFocusNode(node); + + this.syncCode(); + return false; + } + else + { + this.syncCode(); + } + }, + + // PARAGRAPHY + paragraphy: function (str) + { + str = $.trim(str); + if (str === '') + { + if (!$.browser.mozilla) + { + return this.opts.allEmptyHtml; + } + else + { + return this.opts.mozillaEmptyHtml; + } + } + + // convert div to p + if (this.opts.convertDivs) str = str.replace(/([\w\W]*?)<\/div>/gi, '

            $2

            '); + + // inner functions + var X = function(x, a, b) { return x.replace(new RegExp(a, 'g'), b); }; + var R = function(a, b) { return X(str, a, b); }; + + // block elements + var blocks = '(table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|style|script|object|input|param|p|h[1-6])'; + + str += '\n'; + + R('
            \\s*
            ', '\n\n'); + R('(<' + blocks + '[^>]*>)', '\n$1'); + R('()', '$1\n\n'); + R('\r\n|\r', '\n'); // newlines + R('\n\n+', '\n\n'); // remove duplicates + R('\n?((.|\n)+?)$', '

            $1

            \n'); // including one at the end + R('

            \\s*?

            ', ''); // remove empty p + R('

            (]*>\\s*)', '$1

            '); + R('

            ([^<]+)\\s*?(]*>)', '

            $1

            $2'); + R('

            \\s*(]*>)\\s*

            ', '$1'); + R('

            (', '$1'); + R('

            \\s*(]*>)', '$1'); + R('(]*>)\\s*

            ', '$1'); + R('(]*>)\\s*
            ', '$1'); + R('
            (\\s*]*>)', '$1'); + + // pre + if (str.indexOf(')((.|\n)*?)
            ', function(m0, m1, m2, m3) + { + return X(m1, '\\\\([\'\"\\\\])', '$1') + X(X(X(m3, '

            ', '\n'), '

            |
            ', ''), '\\\\([\'\"\\\\])', '$1') + ''; + }); + } + + return R('\n

            $', '

            '); + }, + + // PREPARE FORMATER + preformater: function(html) + { + if (html !== null) + { + html = html.replace(/
            /gi,'
            '); + //html = html.replace(/]*>([\w\W]*?)

            ([\w\W]*?)<\/p>([\w\W]*?)<\/blockquote[^>]*>/gi,'

            $1$2
            $3
            '); + html = html.replace(/]*>([\w\W]*?)<\/strong[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/em[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/del[^>]*>/gi,'$1'); + } + else + { + html = ''; + } + + return html; + }, + + // REVERT FORMATER + reformater: function(html) + { + html = html.replace(/
            /gi,'
            '); + html = html.replace(/]*>([\w\W]*?)<\/b[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/i[^>]*>/gi,'$1'); + html = html.replace(/]*>([\w\W]*?)<\/strike[^>]*>/gi,'$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, "$2"); + + return html; + }, + + // REMOVE TAGS + stripTags: function(html) + { + var allowed = ["code", "span", "div", "label", "a", "br", "p", "b", "i", "del", "strike", "img", "video", "audio", "iframe", "object", "embed", "param", "blockquote", "mark", "cite", "small", "ul", "ol", "li", "hr", "dl", "dt", "dd", "sup", "sub", "big", "pre", "code", "figure", "figcaption", "strong", "em", "table", "tr", "td", "th", "tbody", "thead", "tfoot", "h1", "h2", "h3", "h4", "h5", "h6"]; + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; + return html.replace(tags, function ($0, $1) + { + return $.inArray($1.toLowerCase(), allowed) > '-1' ? $0 : ''; + }); + }, + cleanStyles: function (properties, str, m) + { + + var attr = m.split('='); + var prop = attr[1].split(';'); + + var t = ''; + $.each(prop, function(z,s) + { + if (typeof s == 'undefined') return true; + if (s == '"' || s == "'") return true; + + s = s.replace(/(^"|^')/,'').replace(/("$|'$)/,'').replace(/"(.*?)"/gi, ''); + s = $.trim(s); + + var p = s.split(':'); + + if (typeof p[1] !== 'undefined' && (p[1].search('pt') === -1 && p[1].search('cm') === -1)) + { + if ($.inArray($.trim(p[0]), properties) != '-1') t += s + '; '; + } + }); + + return str.replace(m, 'style="' + t + '"'); + }, + + + // PASTE CLEANUP + pasteCleanUp: function(marker) + { + var html = this.$editor.html(); + + // remove comments and php tags + html = html.replace(/|<\?(?:php)?[\s\S]*?\?>/gi, '') + + // remove formatting + html = this.formattingRemove(html); + + // remove tags + html = this.stripTags(html); + + // remove classes + if (this.opts.removeClasses) + { + html = html.replace(/ class="([\w\W]*?)"/gi, ''); + } + else + { + html = html.replace(/\s*class="TOC(.*?)"/gi, "" ); + html = html.replace(/\s*class="Heading(.*?)"/gi, "" ); + html = html.replace(/\s*class="Body(.*?)"/gi, "" ); + html = html.replace(/\sclass="Nonformat"/gi, ''); + html = html.replace(/\sclass="Mso(.*?)"/gi, ''); + html = html.replace(/\sclass="Apple(.*?)"/gi, ''); + html = html.replace(/"Times New Roman"/gi, ''); + } + + var attributes = ['width', 'height', 'src', 'style', 'href', 'frameborder', 'class', 'id', 'rel', 'unselectable']; + var properties = ['color', 'background-color', 'font-style', 'margin', 'margin-top', 'margin-bottom', 'margin-left', 'margin-right', 'text-align', 'width', 'height', 'cursor', 'float']; + + // remove attributes + var matches = html.match(/([\w\-.:]+)\s*=\s*("[^"]*"|'[^']*'|[\w\-.:]+)/gi); + $.each(matches, $.proxy(function(i,m) + { + var attr = m.split('='); + if ($.inArray(attr[0], attributes) == '-1') + { + html = html.replace(m, ''); + } + + // remove styles + if (this.opts.removeStyles === false && attr[0] == 'style') + { + html = this.cleanStyles(properties, html, m); + } + + }, this)); + + // remove styles + if (this.opts.removeStyles === false) + { + html = html.replace(/background-color:(\s+)transparent;\s/gi, ''); + html = html.replace(/font-style:(\s+)normal;\s/gi, ''); + } + else + { + html = html.replace(/ style="([\w\W]*?)"/gi, ''); + } + + // remove empty styles + html = html.replace(/((\s{2,})?|\s)style=(""|'')/gi, ''); + + // remove nbsp + html = html.replace(/( ){1,}/gi, ' '); + + // remove empty span + html = html.replace(/(\s)?<\/span>/gi, ' '); + + // remove double white spaces + html = html.replace(/\s{2,}/g, ' '); + + // remove span without styles + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$2'); + + // empty tags + html = this.formattingEmptyTags(html); + + // add formatting before + html = this.formattingAddBefore(html); + + // add formatting after + html = this.formattingAddAfter(html); + + // indenting + html = this.formattingIndenting(html); + + // dirty paragraphs + html = html.replace(/

            /gi, ""); + html = html.replace(/

            \s+\n+<(.*?)/gi, "<$1"); + html = html.replace(/<\/(.*?)>\s+\n+<\/p>/gi, ""); + html = html.replace(/

            (\s)?<\/p>/gi, ''); + html = html.replace(/

            <\/p>/gi, ''); + + // remove google docs marker + html = html.replace(/([\w\W]*?)<\/b>/gi, "$2"); + + // trim spaces + html = html.replace(/; ">/gi, ';">'); + + // SET HTML + this.$editor.html(html); + + // RETURN FOCUS + var node = $(this.doc.body).find('#pastemarkerend' + marker).get(0); + this.setFocusNode(node); + + this.syncCode(); + + + setTimeout($.proxy(function() + { + // remove pastemarker + $(this.doc.body).find('span[rel=pastemarkerend]').remove(); + + if (this.opts.autoresize === true) this.setAutoSize(false); + + this.observeImages(); + this.observeTables(); + + }, this), 100); + + + }, + + // TEXTAREA CODE FORMATTING + formattingRemove: function(html) + { + html = html.replace(/\s{2,}/g, ' '); + html = html.replace(/\n/g, ' '); + html = html.replace(/[\t]*/g, ''); + html = html.replace(/\n\s*\n/g, "\n"); + html = html.replace(/^[\s\n]*/g, ''); + html = html.replace(/[\s\n]*$/g, ''); + html = html.replace(/>\s+<'); + + return html; + }, + formattingIndenting: function(html) + { + html = html.replace(/

          • /g, "\t"); + + return html; + }, + formattingEmptyTags: function(html) + { + var etags = ["
            ","
            \\s*
            ","\\s*","
              ","
                ","
              1. ","
                ","","\\s*", " ", "\\s*", " ", "

                \\s*

                ", "

                 

                ", "

                \\s*
                \\s*

                ", "
                \\s*
                ", "
                \\s*
                \\s*
                "]; + for (var i = 0; i < etags.length; ++i) + { + var bbb = etags[i]; + html = html.replace(new RegExp(bbb,'gi'), ""); + } + + return html; + }, + formattingAddBefore: function(html) + { + var lb = '\r\n'; + var btags = ["", '', "","', '', '', '', '', '', '', '', '
                ', '
                ', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']; + for (var i = 0; i < atags.length; ++i) + { + var aaa = atags[i]; + html = html.replace(new RegExp(aaa,'gi'),aaa+lb); + } + + return html; + }, + formatting: function(html) + { + // lowercase + if ($.browser.msie) + { + var match = html.match(/<(.*?)>/gi); + $.each(match, function(i,s) + { + html = html.replace(s, s.toLowerCase()); + }) + html = html.replace(/style="(.*?)"/gi, function(w) { return w.toLowerCase(); }); + html = html.replace(/ jQuery(.*?)=\"(.*?)\"/gi, ''); + } + + html = html.replace(/([\w\W]*?)<\/span><\/span>/gi, '$5'); + html = html.replace(/([\w\W]*?)<\/span><\/span>/gi, '$5'); + + html = html.replace(/([\w\W]*?)<\/span\>/gi, '$3
                '); + html = html.replace(/([\w\W]*?)<\/font\>/gi, '$3
                '); + html = html.replace(/([\w\W]*?)<\/span\>/gi, '$3'); + html = html.replace(/([\w\W]*?)<\/font\>/gi, "$2"); + html = html.replace(/([\w\W]*?)<\/span>/gi, '$1'); + + if (this.opts.xhtml) + { + html = html.replace(/
                /gi,'
                '); + html = html.replace(/
                $/gi,''); + html = html.replace(/^
                /gi,''); + html = html.replace(/(]+[^\/])>/gi,'$1 />'); + } + + // mini clean + html = html.replace(/

                /g, '

                '); + html = html.replace(/<\/p><\/p>/g, '

                '); + html = html.replace(//g, '
                '); + html = html.replace(/

                 /g, '

                '); + html = html.replace(/

                  /g, '
                    '); + html = html.replace(/

                      /g, '
                        '); + html = html.replace(/<\/ul><\/p>/g, '
                  '); + html = html.replace(/<\/ol><\/p>/g, ''); + html = html.replace( / <\/p>/gi, ''); + + // remove formatting + html = this.formattingRemove(html); + + // empty tags + html = this.formattingEmptyTags(html); + + // add formatting before + html = this.formattingAddBefore(html); + + // add formatting after + html = this.formattingAddAfter(html); + + // indenting + html = this.formattingIndenting(html); + + return html; + }, + + // TOGGLE + toggle: function() + { + var html; + + if (this.opts.visual) + { + this.$frame.hide(); + + html = this.$editor.html(); + html = $.trim(this.formatting(html)); + + this.$el.val(html).show().focus(); + + this.setBtnActive('html'); + this.opts.visual = false; + } + else + { + this.$el.hide(); + + this.$editor.html(this.$el.val()); + + this.$frame.show(); + + if (this.$editor.html() === '') + { + if (!$.browser.mozilla) + { + html = this.opts.allEmptyHtml; + } + else + { + html = this.opts.mozillaEmptyHtml; + } + + this.setCode(html); + } + + this.focus(); + + this.setBtnInactive('html'); + this.opts.visual = true; + + this.observeImages(); + this.observeTables(); + + if (this.opts.autoresize === true) this.setAutoSize(false); + } + }, + + // AUTOSAVE + autoSave: function() + { + if (this.opts.autosave === false) + { + return false; + } + + setInterval($.proxy(function() + { + $.post(this.opts.autosave, { data: this.getCode() }); + + }, this), this.opts.interval*1000); + }, + + // TOOLBAR + buildToolbar: function() + { + if (this.opts.toolbar === false) + { + return false; + } + + this.$toolbar = $('
                    ').addClass('redactor_toolbar'); + this.$box.prepend(this.$toolbar); + + $.each(this.opts.buttons, $.proxy(function(i,key) + { + + if (key !== '|' && typeof this.opts.toolbar[key] !== 'undefined') + { + var s = this.opts.toolbar[key]; + + if (this.opts.fileUpload === false && key === 'file') + { + return true; + } + + var li = $('
                  • '); + + if (key === 'fullscreen') + { + $(li).addClass('redactor_toolbar_right'); + } + + var a = this.buildButton(key, s); + + // dropdown + if (key === 'backcolor' || key === 'fontcolor' || typeof(s.dropdown) !== 'undefined') + { + var dropdown = $('
                  • ')); + } + + }, this)); + + $(document).click(this.hdlHideDropDown); + $(this.doc).click(this.hdlHideDropDown); + + }, + buildButton: function(key, s) + { + var button = $(' '); + + if (typeof s.func === 'undefined') + { + button.click($.proxy(function() { this.execCommand(s.exec, key); }, this)); + } + else if (s.func !== 'show') + { + button.click($.proxy(function(e) { this[s.func](e); }, this)); + } + + if (typeof s.callback !== 'undefined') + { + button.click($.proxy(function(e) { s.callback(this, e, key); }, this)); + } + + return button; + }, + buildDropdown: function(dropdown, obj) + { + $.each(obj, $.proxy( + function (x, d) + { + if (typeof(d.className) === 'undefined') + { + d.className = ''; + } + + var drop_a; + if (typeof d.name !== 'undefined' && d.name === 'separator') + { + drop_a = $(''); + } + else + { + drop_a = $('' + d.title + ''); + + if (typeof(d.func) === 'undefined') + { + $(drop_a).click($.proxy(function() { this.execCommand(d.exec, x); }, this)); + } + else + { + $(drop_a).click($.proxy(function(e) { this[d.func](e); }, this)); + } + } + + $(dropdown).append(drop_a); + + }, this) + ); + + return dropdown; + + }, + buildColorPicker: function(dropdown, key) + { + var mode; + if (key === 'backcolor') + { + if ($.browser.msie) + { + mode = 'BackColor'; + } + else + { + mode = 'hilitecolor'; + } + } + else + { + mode = 'forecolor'; + } + + $(dropdown).width(210); + + var len = this.opts.colors.length; + for (var i = 0; i < len; ++i) + { + var color = this.opts.colors[i]; + + var swatch = $('').css({ 'backgroundColor': color }); + $(dropdown).append(swatch); + + var _self = this; + $(swatch).click(function() + { + if ($.browser.mozilla) + { + if (mode == 'hilitecolor') + { + _self.execCommand('useCSS', false, false); + _self.execCommand(mode, $(this).attr('rel')); + _self.execCommand('useCSS', false, true); + } + else + { + _self.execCommand('styleWithCSS', false, false); + _self.execCommand(mode, $(this).attr('rel')); + _self.execCommand('styleWithCSS', false, true); + } + } + else + { + _self.execCommand(mode, $(this).attr('rel')); + } + + }); + } + + var elnone = $('').html(RLANG.none); + + if (key === 'backcolor') + { + elnone.click($.proxy(this.setBackgroundNone, this)); + } + else + { + elnone.click($.proxy(this.setColorNone, this)); + } + + $(dropdown).append(elnone); + + return dropdown; + }, + setBackgroundNone: function() + { + $(this.getParentNode()).css('background-color', 'transparent'); + this.syncCode(); + }, + setColorNone: function() + { + $(this.getParentNode()).attr('color', '').css('color', ''); + this.syncCode(); + }, + + + // DROPDOWNS + showDropDown: function(e, dropdown, key) + { + if (this.getBtn(key).hasClass('dropact')) + { + this.hideAllDropDown(); + } + else + { + this.hideAllDropDown(); + + this.setBtnActive(key); + this.getBtn(key).addClass('dropact'); + + var left = this.getBtn(key).offset().left; + + + if (this.opts.fixed && this.fixed) + { + $(dropdown).css({ position: 'fixed', left: left + 'px', top: '30px' }).show(); + } + else + { + var top = this.$toolbar.offset().top + 30; + $(dropdown).css({ position: 'absolute', left: left + 'px', top: top + 'px' }).show(); + } + } + + }, + hideAllDropDown: function() + { + this.$toolbar.find('a.dropact').removeClass('act').removeClass('dropact'); + $('.redactor_dropdown').hide(); + }, + hideDropDown: function(e, dropdown, key) + { + if (!$(e.target).parent().hasClass('dropact')) + { + $(dropdown).removeClass('act'); + this.showedDropDown = false; + this.hideAllDropDown(); + } + }, + + // SELECTION AND NODE MANIPULATION + getSelection: function () + { + if (this.$frame.get(0).contentWindow.getSelection) + { + return this.$frame.get(0).contentWindow.getSelection(); + } + else if (this.$frame.get(0).contentWindow.document.selection) + { + return this.$frame.get(0).contentWindow.document.selection.createRange(); + } + }, + getParentNode: function() + { + if (window.getSelection) + { + return this.getSelection().getRangeAt(0).startContainer.parentNode; + } + else if (document.selection) + { + return this.getSelection().parentElement(); + } + }, + getCurrentNode: function() + { + if (window.getSelection) + { + return this.getSelection().getRangeAt(0).startContainer; + } + else if (document.selection) + { + return this.getSelection(); + } + }, + setFocusNode: function(node, toStart) + { + var range = this.doc.createRange(); + + var selection = this.getSelection(); + toStart = toStart ? 0 : 1; + + if (selection !== null) + { + range.selectNodeContents(node); + selection.addRange(range); + selection.collapse(node, toStart); + } + + this.focus(); + }, + insertNodeAtCaret: function (node) + { + if (typeof window.getSelection !== "undefined") + { + var sel = this.getSelection(); + if (sel.rangeCount) + { + var range = sel.getRangeAt(0); + range.collapse(false); + range.insertNode(node); + range = range.cloneRange(); + range.selectNodeContents(node); + range.collapse(false); + sel.removeAllRanges(); + sel.addRange(range); + } + } + else if (typeof document.selection !== "undefined" && document.selection.type !== "Control") + { + var html = (node.nodeType === 1) ? node.outerHTML : node.data; + var id = "marker_" + ("" + Math.random()).slice(2); + html += ''; + var textRange = this.getSelection(); + textRange.collapse(false); + textRange.pasteHTML(html); + var markerSpan = document.getElementById(id); + textRange.moveToElementText(markerSpan); + textRange.select(); + markerSpan.parentNode.removeChild(markerSpan); + } + }, + + // BUTTONS MANIPULATIONS + getBtn: function(key) + { + return $(this.$toolbar.find('a.redactor_btn_' + key)); + }, + setBtnActive: function(key) + { + this.getBtn(key).addClass('act'); + }, + setBtnInactive: function(key) + { + this.getBtn(key).removeClass('act'); + }, + changeBtnIcon: function(key, classname) + { + this.getBtn(key).addClass('redactor_btn_' + classname); + }, + removeBtnIcon: function(key, classname) + { + this.getBtn(key).removeClass('redactor_btn_' + classname); + }, + removeBtn: function(key) + { + this.getBtn(key).remove(); + }, + addBtn: function(key, obj) + { + this.$toolbar.append($('
                  • ').append(this.buildButton(key, obj))); + }, + + // FULLSCREEN + fullscreen: function() + { + var html; + + if (this.opts.fullscreen === false) + { + this.changeBtnIcon('fullscreen', 'normalscreen'); + this.setBtnActive('fullscreen'); + this.opts.fullscreen = true; + + this.height = this.$frame.css('height'); + this.width = (this.$box.width() - 2) + 'px'; + + html = this.getCode(); + + this.tmpspan = $(''); + this.$box.addClass('redactor_box_fullscreen').after(this.tmpspan); + + $(document.body).prepend(this.$box).css('overflow', 'hidden'); + + this.$editor = this.enable(html); + + $(this.doc).click($.proxy(this.hideAllDropDown, this)); + + // focus always on page + this.observeFocus(); + + this.observeImages(); + this.observeTables(); + + this.$box.find('.redactor_resizer').hide(); + + this.fullScreenResize(); + $(window).resize($.proxy(this.fullScreenResize, this)); + $(document).scrollTop(0,0); + this.focus(); + + } + else + { + this.removeBtnIcon('fullscreen', 'normalscreen'); + this.setBtnInactive('fullscreen'); + this.opts.fullscreen = false; + + $(window).unbind('resize', $.proxy(this.fullScreenResize, this)); + $(document.body).css('overflow', ''); + + html = this.getCode(); + + this.$box.removeClass('redactor_box_fullscreen').css('width', 'auto'); + + this.tmpspan.after(this.$box).remove(); + + this.$editor = this.enable(html); + + this.observeImages(); + this.observeTables(); + + if (this.opts.autoresize) + { + this.observeAutoResize(); + } + this.$box.find('.redactor_resizer').show(); + + $(this.doc).click($.proxy(this.hideAllDropDown, this)); + + // focus always on page + this.observeFocus(); + + this.syncCode(); + + this.$frame.css('height', this.height); + this.$el.css('height', this.height); + this.focus(); + } + }, + fullScreenResize: function() + { + if (this.opts.fullscreen === false) + { + return false; + } + + var height = $(window).height() - 42; + this.$box.width($(window).width() - 2); + this.$frame.height(height); + this.$el.height(height); + }, + + // RESIZE + buildResizer: function() + { + if (this.opts.resize === false) + { + return false; + } + + this.$resizer = $('
                    '); + this.$box.append(this.$resizer); + this.$resizer.mousedown($.proxy(this.initResize, this)); + + }, + initResize: function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + this.splitter = e.target; + + if (this.opts.visual) + { + this.element_resize = this.$frame; + this.element_resize.get(0).style.visibility = 'hidden'; + this.element_resize_parent = this.$el; + } + else + { + this.element_resize = this.$el; + this.element_resize_parent = this.$frame; + } + + this.stopResizeHdl = $.proxy(this.stopResize, this); + this.startResizeHdl = $.proxy(this.startResize, this); + this.resizeHdl = $.proxy(this.resize, this); + + $(document).mousedown(this.startResizeHdl); + $(document).mouseup(this.stopResizeHdl); + $(this.splitter).mouseup(this.stopResizeHdl); + + this.null_point = false; + this.h_new = false; + this.h = this.element_resize.height(); + }, + startResize: function() + { + $(document).mousemove(this.resizeHdl); + }, + resize: function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + var y = e.pageY; + + if (this.null_point === false) + { + this.null_point = y; + } + + if (this.h_new === false) + { + this.h_new = this.element_resize.height(); + } + + var s_new = (this.h_new + y - this.null_point) - 10; + + if (s_new <= 30) + { + return true; + } + + if (s_new >= 0) + { + this.element_resize.get(0).style.height = s_new + 'px'; + this.element_resize_parent.get(0).style.height = s_new + 'px'; + } + }, + stopResize: function(e) + { + $(document).unbind('mousemove', this.resizeHdl); + $(document).unbind('mousedown', this.startResizeHdl); + $(document).unbind('mouseup', this.stopResizeHdl); + $(this.splitter).unbind('mouseup', this.stopResizeHdl); + + this.element_resize.get(0).style.visibility = 'visible'; + }, + + // RESIZE IMAGES + resizeImage: function(resize) + { + var clicked = false; + var clicker = false; + var start_x; + var start_y; + var ratio = $(resize).width()/$(resize).height(); + + var y = 1; + var x = 1; + var min_w = 1; + var min_h = 1; + + $(resize).hover(function() { $(resize).css('cursor', 'nw-resize'); }, function() { $(resize).css('cursor','default'); clicked=false; }); + + $(resize).mousedown(function(e) + { + if (e.preventDefault) + { + e.preventDefault(); + } + + clicked = true; + clicker = true; + + start_x = Math.round(e.pageX - $(resize).eq(0).offset().left); + start_y = Math.round(e.pageY - $(resize).eq(0).offset().top); + }); + + $(resize).mouseup($.proxy(function(e) + { + clicked = false; + this.syncCode(); + if (this.opts.autoresize === true) this.setAutoSize(false); + + }, this)); + + $(resize).click($.proxy(function(e) + { + if (clicker) + { + this.imageEdit(e); + } + + }, this)); + + $(resize).mousemove(function(e) + { + if (clicked) + { + clicker = false; + + var mouse_x = Math.round(e.pageX - $(this).eq(0).offset().left) - start_x; + var mouse_y = Math.round(e.pageY - $(this).eq(0).offset().top) - start_y; + + var div_h = $(resize).height(); + + var new_h = parseInt(div_h, 10) + mouse_y; + var new_w = new_h*ratio; + + if (x === 1 || (typeof(x) === "number" && new_w < x && new_w > min_w)) + { + $(resize).width(new_w); + } + if (y === 1 || (typeof(y) === "number" && new_h < y && new_h > min_h)) + { + $(resize).height(new_h); + } + start_x = Math.round(e.pageX - $(this).eq(0).offset().left); + start_y = Math.round(e.pageY - $(this).eq(0).offset().top); + } + }); + }, + + // TABLE + showTable: function() + { + this.modalInit(RLANG.table, 'table', 300, $.proxy(function() + { + $('#redactor_insert_table_btn').click($.proxy(this.insertTable, this)); + }, this), + + function() + { + $('#redactor_table_rows').focus(); + } + ); + }, + insertTable: function() + { + var rows = $('#redactor_table_rows').val(); + var columns = $('#redactor_table_columns').val(); + + var table_box = $('
                    '); + + var tableid = Math.floor(Math.random() * 99999); + var table = $('
                    '); + + for (var i = 0; i < rows; i++) + { + var row = $(''); + for (var z = 0; z < columns; z++) + { + var column = $(' '); + $(row).append(column); + } + $(table).append(row); + } + + $(table_box).append(table); + var html = $(table_box).html(); + + if ($.browser.msie) + { + html += '

                    '; + } + else + { + html += '

                     

                    '; + } + + this.execCommand('inserthtml', html); + this.modalClose(); + + this.$table = $(this.doc).find('body').find('#table' + tableid); + this.$table.click($.proxy(this.tableObserver, this)); + + if (this.opts.autoresize === true) this.setAutoSize(false); + }, + tableObserver: function(e) + { + this.$table = $(e.target).parents('table'); + + this.$table_tr = this.$table.find('tr'); + this.$table_td = this.$table.find('td'); + + this.$table_td.removeClass('current'); + + this.$tbody = $(e.target).parents('tbody'); + this.$thead = $(this.$table).find('thead'); + + this.$current_td = $(e.target); + this.$current_td.addClass('current'); + + this.$current_tr = $(e.target).parents('tr'); + }, + deleteTable: function() + { + $(this.$table).remove(); + this.$table = false; + this.syncCode(); + }, + deleteRow: function() + { + $(this.$current_tr).remove(); + this.syncCode(); + }, + deleteColumn: function() + { + var index = $(this.$current_td).get(0).cellIndex; + + $(this.$table).find('tr').each(function() + { + $(this).find('td').eq(index).remove(); + }); + + this.syncCode(); + }, + addHead: function() + { + if ($(this.$table).find('thead').size() !== 0) + { + this.deleteHead(); + } + else + { + var tr = $(this.$table).find('tr').first().clone(); + tr.find('td').html(' '); + this.$thead = $(''); + this.$thead.append(tr); + $(this.$table).prepend(this.$thead); + this.syncCode(); + } + }, + deleteHead: function() + { + $(this.$thead).remove(); + this.$thead = false; + this.syncCode(); + }, + insertRowAbove: function() + { + this.insertRow('before'); + }, + insertRowBelow: function() + { + this.insertRow('after'); + }, + insertColumnLeft: function() + { + this.insertColumn('before'); + }, + insertColumnRight: function() + { + this.insertColumn('after'); + }, + insertRow: function(type) + { + var new_tr = $(this.$current_tr).clone(); + new_tr.find('td').html(' '); + if (type === 'after') + { + $(this.$current_tr).after(new_tr); + } + else + { + $(this.$current_tr).before(new_tr); + } + + this.syncCode(); + }, + insertColumn: function(type) + { + var index = 0; + + this.$current_td.addClass('current'); + + this.$current_tr.find('td').each(function(i,s) + { + if ($(s).hasClass('current')) + { + index = i; + } + }); + + this.$table_tr.each(function(i,s) + { + var current = $(s).find('td').eq(index); + + var td = current.clone(); + td.html(' '); + + if (type === 'after') + { + $(current).after(td); + } + else + { + $(current).before(td); + } + + }); + + this.syncCode(); + }, + + // INSERT VIDEO + showVideo: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + this.modalInit(RLANG.video, 'video', 600, $.proxy(function() + { + $('#redactor_insert_video_btn').click($.proxy(this.insertVideo, this)); + }, this), + + function() + { + $('#redactor_insert_video_area').focus(); + } + ); + }, + insertVideo: function() + { + var data = $('#redactor_insert_video_area').val(); + data = this.stripTags(data); + + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).after(data).remove(); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', data); + } + + this.modalClose(); + + if (this.opts.autoresize === true) + { + this.setAutoSize(false); + } + }, + + // INSERT IMAGE + imageEdit: function(e) + { + var $el = $(e.target); + var parent = $el.parent(); + + var handler = $.proxy(function() + { + $('#redactor_file_alt').val($el.attr('alt')); + $('#redactor_image_edit_src').attr('href', $el.attr('src')); + $('#redactor_form_image_align').val($el.css('float')); + + if ($(parent).get(0).tagName === 'A') + { + $('#redactor_file_link').val($(parent).attr('href')); + } + + $('#redactor_image_delete_btn').click($.proxy(function() { this.imageDelete($el); }, this)); + $('#redactorSaveBtn').click($.proxy(function() { this.imageSave($el); }, this)); + + }, this); + + this.modalInit(RLANG.image, 'image_edit', 380, handler); + + }, + imageDelete: function(el) + { + $(el).remove(); + this.modalClose(); + this.syncCode(); + + if (this.opts.autoresize === true) + { + this.setAutoSize(false); + } + }, + imageSave: function(el) + { + var parent = $(el).parent(); + + $(el).attr('alt', $('#redactor_file_alt').val()); + + var floating = $('#redactor_form_image_align').val(); + + if (floating === 'left') + { + $(el).css({ 'float': 'left', margin: '0 10px 10px 0' }); + } + else if (floating === 'right') + { + $(el).css({ 'float': 'right', margin: '0 0 10px 10px' }); + } + else + { + $(el).css({ 'float': 'none', margin: '0' }); + } + + // as link + var link = $.trim($('#redactor_file_link').val()); + if (link !== '') + { + if ($(parent).get(0).tagName !== 'A') + { + $(el).replaceWith('' + this.outerHTML(el) + ''); + } + else + { + $(parent).attr('href', link); + } + } + else + { + if ($(parent).get(0).tagName === 'A') + { + $(parent).replaceWith(this.outerHTML(el)); + } + } + + this.modalClose(); + this.observeImages(); + this.syncCode(); + + }, + showImage: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + var handler = $.proxy(function() + { + // json + if (this.opts.imageGetJson !== false) + { + $.getJSON(this.opts.imageGetJson, $.proxy(function(data) { + + $.each(data, $.proxy(function(key, val) + { + var img = $(''); + $('#redactor_image_box').append(img); + $(img).click($.proxy(this.imageSetThumb, this)); + + }, this)); + + }, this)); + } + else + { + $('#redactor_tabs a').eq(1).remove(); + } + + if (this.opts.imageUpload !== false) + { + + // dragupload + if (this.isMobile() === false) + { + if ($('#redactor_file').size() !== 0) + { + $('#redactor_file').dragupload( + { + url: this.opts.imageUpload, + success: $.proxy(this.imageUploadCallback, this) + }); + } + } + + // ajax upload + this.uploadInit('redactor_file', { auto: true, url: this.opts.imageUpload, success: $.proxy(this.imageUploadCallback, this) }); + } + else + { + $('.redactor_tab').hide(); + if (this.opts.imageGetJson === false) + { + $('#redactor_tabs').remove(); + $('#redactor_tab3').show(); + } + else + { + var tabs = $('#redactor_tabs a'); + tabs.eq(0).remove(); + tabs.eq(1).addClass('redactor_tabs_act'); + $('#redactor_tab2').show(); + } + } + + $('#redactor_upload_btn').click($.proxy(this.imageUploadCallbackLink, this)); + + }, this); + + var endCallback = $.proxy(function() + { + if (this.opts.imageUpload === false && this.opts.imageGetJson === false) + { + $('#redactor_file_link').focus(); + } + }, this); + + this.modalInit(RLANG.image, 'image', 570, handler, endCallback, true); + + }, + imageSetThumb: function(e) + { + this._imageSet('', true); + }, + imageUploadCallbackLink: function() + { + if ($('#redactor_file_link').val() !== '') + { + var data = ''; + this._imageSet(data, true); + } + else + { + this.modalClose(); + } + }, + imageUploadCallback: function(data) + { + this._imageSet(data); + }, + _imageSet: function(json, link) + { + var html = '', data = ''; + if (link !== true) + { + data = $.parseJSON(json); + html = '

                    '; + } + else + { + html = json; + } + + this.focus(); + + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).after(html).remove(); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', html); + } + + // upload image callback + if (link !== true && typeof this.opts.imageUploadCallback === 'function') + { + this.opts.imageUploadCallback(this, data); + } + + this.modalClose(); + + $(this.doc).find('img').load($.proxy(function() + { + this.setAutoSize(false); + + }, this)); + + this.observeImages(); + }, + + // INSERT LINK + showLink: function() + { + var handler = $.proxy(function() + { + var sel = this.getSelection(); + var url = '', text = ''; + + if ($.browser.msie) + { + var parent = this.getParentNode(); + if (parent.nodeName === 'A') + { + this.insert_link_node = $(parent); + text = this.insert_link_node.text(); + url = this.insert_link_node.attr('href'); + } + else + { + if (this.oldIE()) + { + text = sel.text; + } + else + { + text = sel.toString(); + } + + this.spanid = Math.floor(Math.random() * 99999); + + var html = '' + text + ''; + + if (text !== '') + { + html = '' + text + ''; + } + + this.execCommand('inserthtml', html); + } + } + else + { + if (sel && sel.anchorNode && sel.anchorNode.parentNode.tagName === 'A') + { + url = sel.anchorNode.parentNode.href; + text = sel.anchorNode.parentNode.text; + if (sel.toString() === '') + { + this.insert_link_node = sel.anchorNode.parentNode; + } + } + else + { + text = sel.toString(); + url = ''; + } + } + + $('.redactor_link_text').val(text); + + var turl = url.replace(top.location.href, ''); + + if (url.search('mailto:') === 0) + { + this.setModalTab(2); + + $('#redactor_tab_selected').val(2); + $('#redactor_link_mailto').val(url.replace('mailto:', '')); + } + else if (turl.search(/^#/gi) === 0) + { + this.setModalTab(3); + + $('#redactor_tab_selected').val(3); + $('#redactor_link_anchor').val(turl.replace(/^#/gi, '')); + } + else + { + $('#redactor_link_url').val(url); + } + + $('#redactor_insert_link_btn').click($.proxy(this.insertLink, this)); + + + }, this); + + var endCallback = function(url) + { + $('#redactor_link_url').focus(); + }; + + this.modalInit(RLANG.link, 'link', 460, handler, endCallback); + + }, + insertLink: function() + { + var tab_selected = $('#redactor_tab_selected').val(); + var link = '', text = ''; + + if (tab_selected === '1') // url + { + link = $('#redactor_link_url').val(); + text = $('#redactor_link_url_text').val(); + } + else if (tab_selected === '2') // mailto + { + link = 'mailto:' + $('#redactor_link_mailto').val(); + text = $('#redactor_link_mailto_text').val(); + } + else if (tab_selected === '3') // anchor + { + link = '#' + $('#redactor_link_anchor').val(); + text = $('#redactor_link_anchor_text').val(); + } + + this._insertLink('' + text + ' ', $.trim(text), link); + + }, + _insertLink: function(a, text, link) + { + if (text != '') + { + if (this.insert_link_node) + { + $(this.insert_link_node).text(text); + $(this.insert_link_node).attr('href', link); + this.syncCode(); + } + else + { + if ($.browser.msie) + { + $(this.doc.getElementById('span' + this.spanid)).replaceWith(a); + this.syncCode(); + } + else + { + this.execCommand('inserthtml', a); + } + } + } + + this.modalClose(); + }, + + // INSERT FILE + showFile: function() + { + if ($.browser.msie) + { + this.markerIE(); + } + + var handler = $.proxy(function() + { + var sel = this.getSelection(); + + var text = ''; + + if (this.oldIE()) + { + text = sel.text; + } + else + { + text = sel.toString(); + } + + $('#redactor_filename').val(text); + + // dragupload + if (this.isMobile() === false) + { + $('#redactor_file').dragupload( + { + url: this.opts.fileUpload, + success: $.proxy(function(data) + { + this.fileUploadCallback(data); + }, this) + }); + } + + this.uploadInit('redactor_file', { auto: true, url: this.opts.fileUpload, success: $.proxy(function(data) { + + this.fileUploadCallback(data); + + }, this)}); + }, this); + + this.modalInit(RLANG.file, 'file', 500, handler); + }, + fileUploadCallback: function(json) + { + var data = $.parseJSON(json); + var text = $('#redactor_filename').val(); + + if (text === '') + { + text = data.filename; + } + + var link = '' + text + ''; + + // chrome fix + if ($.browser.webkit && !!window.chrome) + { + link = link + ' '; + } + + if ($.browser.msie) + { + if (text !== '') + { + $(this.doc.getElementById('span' + this.spanid)).replaceWith(link); + } + else + { + $(this.doc.getElementById('span' + this.spanid)).after(link).remove(); + } + + this.syncCode(); + } + else + { + this.execCommand('inserthtml', link); + } + + // file upload callback + if (typeof this.opts.fileUploadCallback === 'function') + { + this.opts.fileUploadCallback(this, data); + } + + this.modalClose(); + }, + + + + // MODAL + modalInit: function(title, url, width, handler, endCallback, scroll) + { + // modal overlay + if ($('#redactor_modal_overlay').size() === 0) + { + this.overlay = $(''); + $('body').prepend(this.overlay); + } + + if (this.opts.overlay) + { + $('#redactor_modal_overlay').show(); + $('#redactor_modal_overlay').click($.proxy(this.modalClose, this)); + } + + if ($('#redactor_modal').size() === 0) + { + this.modal = $(''); + $('body').append(this.modal); + } + + $('#redactor_modal_close').click($.proxy(this.modalClose, this)); + + this.hdlModalClose = $.proxy(function(e) { if ( e.keyCode === 27) { this.modalClose(); } }, this); + + $(document).keyup(this.hdlModalClose); + $(this.doc).keyup(this.hdlModalClose); + + $('#redactor_modal_inner').html(this.opts['modal_' + url]); + $('#redactor_modal_header').html(title); + + // tabs + if ($('#redactor_tabs').size() !== 0) + { + var that = this; + $('#redactor_tabs a').each(function(i,s) + { + i++; + $(s).click(function() + { + $('#redactor_tabs a').removeClass('redactor_tabs_act'); + $(this).addClass('redactor_tabs_act'); + $('.redactor_tab').hide(); + $('#redactor_tab' + i).show(); + $('#redactor_tab_selected').val(i); + + if (that.isMobile() === false) + { + var height = $('#redactor_modal').outerHeight(); + $('#redactor_modal').css('margin-top', '-' + (height+10)/2 + 'px'); + } + }); + }); + } + + $('#redactor_btn_modal_close').click($.proxy(this.modalClose, this)); + + // callback + if (typeof(handler) === 'function') + { + handler(); + } + + // setup + var height = $('#redactor_modal').outerHeight(); + + if (this.isMobile() === false) + { + $('#redactor_modal').css({ position: 'fixed', top: '50%', left: '50%', width: width + 'px', height: 'auto', marginTop: '-' + (height+10)/2 + 'px', marginLeft: '-' + (width+60)/2 + 'px' }).fadeIn('fast'); + } + else + { + $('#redactor_modal').css({ position: 'absolute', width: '96%', height: 'auto', top: '20px', left: '0', marginTop: '0px', marginLeft: '2%' }).show(); + this.scrolltop(); + } + + + // end callback + if (typeof(endCallback) === 'function') + { + endCallback(); + } + + if (scroll === true) + { + $('#redactor_image_box').height(300).css('overflow', 'auto'); + } + + }, + modalClose: function() + { + + $('#redactor_modal_close').unbind('click', this.modalClose); + $('#redactor_modal').fadeOut('fast', $.proxy(function() + { + $('#redactor_modal_inner').html(''); + + if (this.opts.overlay) + { + $('#redactor_modal_overlay').hide(); + $('#redactor_modal_overlay').unbind('click', this.modalClose); + } + + $(document).unbind('keyup', this.hdlModalClose); + $(this.doc).unbind('keyup', this.hdlModalClose); + + }, this)); + + }, + setModalTab: function(num) + { + $('.redactor_tab').hide(); + var tabs = $('#redactor_tabs a'); + tabs.removeClass('redactor_tabs_act'); + tabs.eq(num-1).addClass('redactor_tabs_act'); + $('#redactor_tab' + num).show(); + }, + + // UPLOAD + uploadInit: function(element, options) + { + // Upload Options + this.uploadOptions = { + url: false, + success: false, + start: false, + trigger: false, + auto: false, + input: false + }; + + $.extend(this.uploadOptions, options); + + // Test input or form + if ($('#' + element).size() !== 0 && $('#' + element).get(0).tagName === 'INPUT') + { + this.uploadOptions.input = $('#' + element); + this.element = $($('#' + element).get(0).form); + } + else + { + this.element = $('#' + element); + } + + this.element_action = this.element.attr('action'); + + // Auto or trigger + if (this.uploadOptions.auto) + { + $(this.uploadOptions.input).change($.proxy(function() + { + this.element.submit(function(e) { return false; }); + this.uploadSubmit(); + }, this)); + + } + else if (this.uploadOptions.trigger) + { + $('#' + this.uploadOptions.trigger).click($.proxy(this.uploadSubmit, this)); + } + }, + uploadSubmit : function() + { + this.uploadForm(this.element, this.uploadFrame()); + }, + uploadFrame : function() + { + this.id = 'f' + Math.floor(Math.random() * 99999); + + var d = document.createElement('div'); + var iframe = ''; + d.innerHTML = iframe; + document.body.appendChild(d); + + // Start + if (this.uploadOptions.start) + { + this.uploadOptions.start(); + } + + $('#' + this.id).load($.proxy(this.uploadLoaded, this)); + + return this.id; + }, + uploadForm : function(f, name) + { + if (this.uploadOptions.input) + { + var formId = 'redactorUploadForm' + this.id; + var fileId = 'redactorUploadFile' + this.id; + this.form = $('
                    '); + + var oldElement = this.uploadOptions.input; + var newElement = $(oldElement).clone(); + $(oldElement).attr('id', fileId); + $(oldElement).before(newElement); + $(oldElement).appendTo(this.form); + $(this.form).css('position', 'absolute'); + $(this.form).css('top', '-2000px'); + $(this.form).css('left', '-2000px'); + $(this.form).appendTo('body'); + + this.form.submit(); + } + else + { + f.attr('target', name); + f.attr('method', 'POST'); + f.attr('enctype', 'multipart/form-data'); + f.attr('action', this.uploadOptions.url); + + this.element.submit(); + } + + }, + uploadLoaded : function() + { + var i = $('#' + this.id); + var d; + + if (i.contentDocument) + { + d = i.contentDocument; + } + else if (i.contentWindow) + { + d = i.contentWindow.document; + } + else + { + d = window.frames[this.id].document; + } + + if (d.location.href === "about:blank") + { + return true; + } + + // Success + if (this.uploadOptions.success) + { + // Remove bizarre
                     tag wrappers around our json data:
                    +				var rawString = d.body.innerHTML;
                    +				var jsonString = rawString.match(/\{.*\}/)[0];
                    +				this.uploadOptions.success(jsonString);
                    +			}
                    +		
                    +			this.element.attr('action', this.element_action);
                    +			this.element.attr('target', '');
                    +		
                    +		},
                    +		
                    +		// UTILITY
                    +		markerIE: function()
                    +		{
                    +			this.spanid = Math.floor(Math.random() * 99999);
                    +			this.execCommand('inserthtml', '');
                    +		},
                    +		oldIE: function()
                    +		{
                    +			if ($.browser.msie && parseInt($.browser.version, 10) < 9)
                    +			{
                    +				return true;
                    +			}
                    +			
                    +			return false;
                    +		},
                    +		outerHTML: function(s) 
                    +		{
                    +			return $("

                    ").append($(s).eq(0).clone()).html(); + }, + normalize: function(str) + { + return parseInt(str.replace('px',''), 10); + }, + isMobile: function() + { + if (/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent)) + { + return true; + } + else + { + return false; + } + }, + scrolltop: function() + { + $('html,body').animate({ scrollTop: 0 }, 500); + } + + }; + + + // API + $.fn.getDoc = function() + { + return $(this.data('redactor').doc); + }; + + $.fn.getFrame = function() + { + return this.data('redactor').$frame; + }; + + $.fn.getEditor = function() + { + return this.data('redactor').$editor; + }; + + $.fn.getCode = function() + { + return this.data('redactor').getCode(); + }; + + $.fn.getText = function() + { + return this.data('redactor').$editor.text(); + }; + + $.fn.setCode = function(html) + { + this.data('redactor').setCode(html); + }; + + $.fn.insertHtml = function(html) + { + this.data('redactor').insertHtml(html); + }; + + $.fn.destroyEditor = function() + { + this.data('redactor').destroy(); + this.removeData('redactor'); + }; + + $.fn.setFocus = function() + { + this.data('redactor').focus(); + }; + + $.fn.execCommand = function(cmd, param) + { + this.data('redactor').execCommand(cmd, param); + }; + +})(jQuery); + +/* + Plugin Drag and drop Upload v1.0.1 + http://imperavi.com/ + Copyright 2012, Imperavi Ltd. +*/ +(function($){ + + "use strict"; + + // Initialization + $.fn.dragupload = function(options) + { + return this.each(function() { + var obj = new Construct(this, options); + obj.init(); + }); + }; + + // Options and variables + function Construct(el, options) { + + this.opts = $.extend({ + + url: false, + success: false, + preview: false, + + text: RLANG.drop_file_here, + atext: RLANG.or_choose + + }, options); + + this.$el = $(el); + } + + // Functionality + Construct.prototype = { + init: function() + { + if (!$.browser.opera && !$.browser.msie) + { + + this.droparea = $('

                    '); + this.dropareabox = $('
                    ' + this.opts.text + '
                    '); + this.dropalternative = $('
                    ' + this.opts.atext + '
                    '); + + this.droparea.append(this.dropareabox); + + this.$el.before(this.droparea); + this.$el.before(this.dropalternative); + + // drag over + this.dropareabox.bind('dragover', $.proxy(function() { return this.ondrag(); }, this)); + + // drag leave + this.dropareabox.bind('dragleave', $.proxy(function() { return this.ondragleave(); }, this)); + + var uploadProgress = $.proxy(function(e) + { + var percent = parseInt(e.loaded / e.total * 100, 10); + this.dropareabox.text('Loading ' + percent + '%'); + + }, this); + + var xhr = jQuery.ajaxSettings.xhr(); + + if (xhr.upload) + { + xhr.upload.addEventListener('progress', uploadProgress, false); + } + + var provider = function () { return xhr; }; + + // drop + this.dropareabox.get(0).ondrop = $.proxy(function(event) + { + event.preventDefault(); + + this.dropareabox.removeClass('hover').addClass('drop'); + + var file = event.dataTransfer.files[0]; + + var fd = new FormData(); + fd.append('file', file); + + $.ajax({ + dataType: 'html', + url: this.opts.url, + data: fd, + xhr: provider, + cache: false, + contentType: false, + processData: false, + type: 'POST', + success: $.proxy(function(data) + { + if (this.opts.success !== false) + { + this.opts.success(data); + } + + if (this.opts.preview === true) + { + this.dropareabox.html(data); + } + + }, this) + }); + + }, this); + } + }, + ondrag: function() + { + this.dropareabox.addClass('hover'); + return false; + }, + ondragleave: function() + { + this.dropareabox.removeClass('hover'); + return false; + } + }; + +})(jQuery); + + +// Define: Linkify plugin from stackoverflow +(function($){ + + "use strict"; + + var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g, + url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g, + + linkifyThis = function () + { + var childNodes = this.childNodes, + i = childNodes.length; + while(i--) + { + var n = childNodes[i]; + if (n.nodeType === 3) + { + var html = n.nodeValue; + if (html) + { + html = html.replace(/&/g, '&') + .replace(//g, '>') + .replace(url1, '$1$2$3') + .replace(url2, '$1$2$5'); + + $(n).after(html).remove(); + } + } + else if (n.nodeType === 1 && !/^(a|button|textarea)$/i.test(n.tagName)) + { + linkifyThis.call(n); + } + } + }; + + $.fn.linkify = function () + { + this.each(linkifyThis); + }; + +})(jQuery); diff --git a/syte/static/js/libs/redactor/redactor.min.js b/syte/static/js/libs/redactor/redactor.min.js new file mode 100644 index 000000000..cc3483efc --- /dev/null +++ b/syte/static/js/libs/redactor/redactor.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('17(68 290==="110"){18 290={}}18 26={47:"609",184:"185 434...",169:"185 509...",56:"409",149:"405",488:"185 405 ...",284:"616",197:"643",521:"642",522:"651",317:"470",481:"280 1",480:"280 2",482:"280 3",479:"280 4",166:"635",163:"633",202:"640 477",173:"634 477",278:"636 501",289:"629 501",201:"641",203:"644",205:"655",249:"185",340:"608",438:"255",345:"185 409...",354:"256 393 611",353:"256 393 621",355:"256 391 399",356:"256 391 397",348:"255 391",349:"255 393",350:"255 409",527:"614",528:"626",352:"256 507",351:"255 507",39:"736",441:"709",123:"708",113:"399",222:"397",512:"509 712 405",98:"715",251:"338",699:"343",524:"434 725 470",127:"185 671...",204:"672",675:"674",339:"660",458:"658 339",440:"661 127 662",491:"398 399",489:"398 665",493:"398 397",499:"663",282:"185 693 687",87:"681",275:"685",337:"678"};(15(11){212.128.103=15(12){28 7.106(15(){18 19=11(7);18 14=19.82("103");17(!14){19.82("103",(14=171 36(7,12)))}})};18 36=15(14,12){7.$78=11(14);17(68 12!=="110"&&68 12.234!=="110"&&12.234!=="594"&&68 290[12.234]!=="110"){26=290[12.234]}7.22=11.309({234:"594",523:"689",236:21,346:21,357:21,332:21,250:21,45:"40.45",86:21,196:41,161:21,160:21,347:41,496:41,378:21,436:21,505:41,517:41,454:21,336:21,363:21,443:60,266:21,264:21,211:21,277:21,225:21,143:41,213:41,87:21,232:41,497:{},495:[],362:["47","|","197","|","166","163","275","|","278","289","201","203","|","169","184","127","56","149","|","202","173","|","579","492","487","494","|","282","87"],361:["#690","#677","#664","#657","#666","#668","#670","#734","#730","#706","#710","#617","#431","#645","#646","#639","#628","#624","#631","#612","#618","#627","#650","#654","#622","#619","#613","#711","#656","#714","#591","#701","#702","#705","#703","#719","#722","#724","#673","#667","#659","#591","#688","#691","#692","#695","#694","#680","#683","#684","#682","#679","#686","#676","#669","#431","#696","#697","#723","#721","#718","#720","#726","#727","#733","#735"],273:"<33><71 />",274:"<33>&102;",732:207()+\'<67 29="731" 262="267" 182="" 301="297/67-82"><61>728 (729)<63 122="98" 29="406" 43="145" /><32 40="146-116: 717;"><63 122="127" 29="188" 126="127" />\',716:207()+"<61>"+26.39+\'<63 29="414" 43="145" /><61>\'+26.149+\'<63 29="170" 43="145" /><61>\'+26.441+\'<206 29="394"><175 141="123">\'+26.123+\'<175 141="113">\'+26.113+\'<175 141="222">\'+26.222+\'<32 29="254"><36 52="101:104(81);" 29="549" 40="88: #704;">\'+26.438+\'<24 43="253"><63 122="219" 126="340" 29="576" 141="\'+26.340+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",698:207()+\'<32 29="154"><36 52="101:104(81);" 43="198">\'+26.204+\'<36 52="101:104(81);">\'+26.339+\'<36 52="101:104(81);">\'+26.149+\'<67 29="700" 262="267" 182="" 301="297/67-82"><32 29="513" 43="138"><63 122="127" 29="188" 126="127" /><32 29="389" 43="138" 40="178: 123;"><32 29="418"><32 29="390" 43="138" 40="178: 123;"><61>\'+26.512+\'<63 126="170" 29="170" 43="145" /><32 29="254"><24 43="253"><63 122="219" 126="204" 29="567" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",707:207()+\'<67 29="713" 262="267" 182=""><32 29="154"><36 52="101:104(81);" 43="198">343<36 52="101:104(81);">338<36 52="101:104(81);">\'+26.337+\'<63 122="296" 29="235" 141="1" /><32 43="138" 29="513"><61>343<63 29="292" 43="145" /><61>\'+26.98+\'<63 43="145 281" 29="554" /><32 43="138" 29="389" 40="178: 123;"><61>338<63 29="412" 43="145" /><61>\'+26.98+\'<63 43="145 281" 29="564" /><32 43="138" 29="390" 40="178: 123;"><61>\'+26.337+\'<63 43="145" 29="402" /><61>\'+26.98+\'<63 43="145 281" 29="573" /><32 29="254"><24 43="253"><63 122="219" 29="559" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",620:207()+"<61>"+26.527+\'<63 172="5" 141="2" 29="324" /><61>\'+26.528+\'<63 172="5" 141="3" 29="585" /><32 29="254"><24 43="253"><63 122="219" 126="204" 29="586" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",615:207()+\'<67 29="607"><61>\'+26.524+\'<252 29="428" 40="89: 99%; 51: 610;"><32 29="254"><24 43="253"><63 122="219" 29="545" 141="\'+26.249+\'" /><36 52="101:104(81);" 29="215">\'+26.205+"",105:{47:{39:26.47,64:"461"},197:{39:26.197,64:"91",260:{33:{39:26.521,80:"180"},194:{39:26.522,80:"180",156:"647"},130:{39:26.317,80:"180",156:"653"},376:{39:26.481,80:"180",156:"652"},374:{39:26.480,80:"180",156:"649"},375:{39:26.482,80:"180",156:"638"},379:{39:26.479,80:"180",156:"623"}}},166:{39:26.166,80:"166"},163:{39:26.163,80:"163"},275:{39:26.275,80:"625"},278:{39:"&630; "+26.278,80:"475"},289:{39:"1. "+26.289,80:"474"},201:{39:"< "+26.201,80:"201"},203:{39:"> "+26.203,80:"203"},169:{39:26.169,64:"540"},184:{39:26.184,64:"602"},127:{39:26.127,64:"569"},56:{39:26.56,64:"91",260:{345:{39:26.345,64:"578"},632:{126:"294"},354:{39:26.354,64:"450"},353:{39:26.353,64:"601"},355:{39:26.355,64:"593"},356:{39:26.356,64:"580"},637:{126:"294"},352:{39:26.352,64:"597"},351:{39:26.351,64:"382"},648:{126:"294"},348:{39:26.348,64:"603"},349:{39:26.349,64:"605"},350:{39:26.350,64:"604"}}},149:{39:26.149,64:"91",260:{149:{39:26.488,64:"561"},284:{39:26.284,80:"284"}}},202:{39:26.202,64:"91"},173:{39:26.173,64:"91"},579:{80:"762",39:26.491},492:{80:"852",39:26.489},487:{80:"853",39:26.493},494:{80:"854",39:26.499},282:{80:"851",39:26.282},87:{39:26.87,64:"87"}}},12,7.$78.82());7.265=[];7.318()};36.530={318:15(){7.484();17(7.22.105!==21){11.309(7.22.105,7.22.497);11.106(7.22.495,11.31(15(14,19){7.22.362.565(19)},7))}7.51=7.$78.45("51");7.89=7.$78.45("89");7.483();18 12=7.$78.48();12=7.342(12);17(7.22.347){12=7.506(12)}7.$84=7.291(12);7.283();17(7.22.496===41){11(7.44).408("850",11.31(15(14){444(11.31(15(){18 19=95.263(95.209()*258);18 20="";17(11.59.177){20="&102;"}18 16=11(\'<24 144="310" 29="310\'+19+\'">\'+20+"");7.371(16.70(0));7.446(19)},7),100)},7))}11(7.44).199(11.31(15(16){18 14=16.314||16.334;17(68 7.22.346==="15"){7.22.346(7,16)}17(7.22.347){17(14===8||14===46){28 7.508(16)}17(14===13&&!16.248&&!16.485&&!16.846){28 7.525(16)}}7.58()},7));7.442();17(7.22.161===21){7.555()}25{7.387()}7.486();7.463();7.143();7.208();17(7.22.87){7.22.87=21;7.87()}17(7.22.86){7.86()}17(7.22.160){7.335();11(57).847(11.31(7.335,7))}17(68 7.22.236==="15"){7.22.236(7)}},486:15(){11(7.44).848(11.31(15(14){18 12=14.314||14.334;17(68 7.22.357==="15"){7.22.357(7,14)}17(14.485){17(12===90){7.134(14,"849")}25{17(12===90&&14.248){7.134(14,"855")}25{17(12===77){7.134(14,"856")}25{17(12===66){7.134(14,"166")}25{17(12===73){7.134(14,"163")}25{17(12===74){7.134(14,"475")}25{17(12===75){7.134(14,"474")}25{17(12===76){7.134(14,"862")}25{17(12===72){7.134(14,"863")}}}}}}}}}}17(!14.248&&12===9){7.134(14,"203")}25{17(14.248&&12===9){7.134(14,"201")}}17(11.59.539&&467.468.471("864")===-1){28 7.516(14,12)}},7))},134:15(14,12){17(14.119){14.119()}7.69(12,81)},484:15(){17(7.22.250!==21){28 7.22.250}11("503").106(11.31(15(12,14){17(14.147){18 19=171 237(/\\/103(\\.529)?\\.861(\\?.*)?/);17(14.147.307(19)){7.22.250=14.147.23(19,"")}}},7))},483:15(){7.$114=11(\'<32 43="860">\');7.$92=11(\'<261 447="0" 857="151" 40="51: \'+7.51+\';" 43="858">\');7.$78.45("89","100%").155();7.$114.859(7.$78).83(7.$92).83(7.$78)},344:15(12){7.44.845();7.44.344(12);7.44.844()},291:15(12){7.44=7.400(7.$92.70(0));17(7.44!==81){7.344(7.502(12));17(11.59.177){7.44.69("365",21,41)}28 11(7.44).65("#333")}25{28 21}},502:15(14){18 12=\'\\54<47><518><149 832="833" 122="98/45" 52="\'+7.22.250+"/45/"+7.22.45+\'" 144="830"><93><32 29="333" 829="41" 825="\'+7.22.523+\'">\'+14+"";28 12},400:15(12){17(12.302){28 12.302}25{17(12.148&&12.148.57){28 12.148.57}25{17(12.57){28 12.57}25{28 81}}}},86:15(){7.$84.86()},58:15(){18 12=7.197(7.$84.47());7.$78.48(12)},239:15(12){12=7.342(12);7.$84.47(12).86();7.58()},176:15(){18 12=7.$84?7.$84.47():7.$78.48();12=7.510(12);28 12},401:15(12){7.69("157",12);7.143()},432:15(){18 14=7.176();7.$114.120(7.$78);7.$114.94();7.$78.48(14).91();195(18 12=0;12<7.265.224;12++){7.265[12].94();826(7.265[12])}},336:15(){11.519({140:7.22.336,122:"269",82:"103="+827(828(7.176())),131:11.31(15(12){7.239(12);7.58()},7)})},283:15(){17(11(7.44).65("93").51()<11(7.$92.70(0).148).51()){11(7.44).53(11.31(15(12){7.$84.86()},7))}},143:15(){17(7.22.143===21){28 21}17(11.59.177){7.44.69("834",21,"21")}11(7.44).65("179").106(11.31(15(12,14){17(11.59.97){11(14).79("435","835")}7.535(14)},7))},208:15(){11(7.44).65("93").65("56").53(11.31(7.319,7))},335:15(){18 12=11(57).392();18 14=7.$114.165().116;17(12>14){7.160=41;7.$105.45({181:"160",89:"100%"})}25{7.160=21;7.$105.45({181:"841",89:"151"})}},387:15(){7.$84.45({"529-51":7.$78.51()+"135"});11(7.44).65("93").45({288:"296"});7.152(21);11(7.44).199(11.31(7.152,7))},152:15(16){18 14=21;17(16!==21){14=16.314||16.334}18 12=7.$84.410(41);17(16===41&&(14===8||14===46)){7.$92.51(12)}25{7.$92.51(12+30)}},69:15(12,16){17(7.22.213&&7.44){866{17(11.59.97){7.86()}17(12==="157"&&11.59.97){7.44.187.366().552(16)}25{17(12==="180"&&11.59.97){7.44.69(12,21,"<"+16+">")}25{7.44.69(12,21,16)}}7.58();7.86();17(68 7.22.332==="15"){7.22.332(7,12)}}843(14){}}},525:15(16){18 14=7.228();17(14.562==="526"&&14.29==="333"){17(16.119){16.119()}18 12=11(7.547());17(12.70(0).190==="526"&&(12.47()===""||12.47()==="<71>")){18 20=11("<33>").83(12.216().70(0).476);12.233(20);20.47("<71 />");7.226(20.70(0));7.58();28 21}25{7.58()}17(7.22.517){7.$84.490()}}25{7.58();28 41}},516:15(16,14){17(16.248&&14===13){16.119();18 12=11("<24><71 />");7.371(12.70(0));7.226(12.70(0));7.58();28 21}25{28 41}},508:15(20){18 14=11.186(7.$84.47());17(11.59.177){14=14.23(/<71>/35,"")}17(14===""){17(20.119){20.119()}18 12=7.22.273;17(11.59.177){12=7.22.274}18 16=11(12).70(0);7.$84.47(16);7.226(16);7.58();28 21}25{7.58()}},506:15(19){19=11.186(19);17(19===""){17(!11.59.177){28 7.22.273}25{28 7.22.274}}17(7.22.505){19=19.23(/<32(.*?)>([\\49\\55]*?)<\\/32>/35,"<33>$2")}18 16=15(34,37,20){28 34.23(171 237(37,"20"),20)};18 12=15(34,20){28 16(19,34,20)};18 14="(56|118|439|377|840|167|107|111|245|32|238|243|242|132|137|125|130|206|67|194|504|839|40|503|308|63|511|33|34[1-6])";19+="\\54";12("<71 />\\\\38*<71 />","\\54\\54");12("(<"+14+"[^>]*>)","\\54$1");12("()","$1\\54\\54");12("\\164\\54|\\164","\\54");12("\\54\\54+","\\54\\54");12("\\54?((.|\\54)+?)$","<33>$1\\54");12("<33>\\\\38*?","");12("<33>(<32[^>]*>\\\\38*)","$1<33>");12("<33>([^<]+)\\\\38*?(]*>)","<33>$1$2");12("<33>\\\\38*(]*>)\\\\38*","$1");12("<33>(<125.+?)","$1");12("<33>\\\\38*(]*>)","$1");12("(]*>)\\\\38*","$1");12("(]*>)\\\\38*<71 />","$1");12("<71 />(\\\\38*]*>)","$1");17(19.471("<130")!=-1){12("(<130(.|\\54)*?>)((.|\\54)*?)",15(62,37,34,20){28 16(37,"\\\\\\\\([\'\\"\\\\\\\\])","$1")+16(16(16(20,"<33>","\\54"),"|<71 />",""),"\\\\\\\\([\'\\"\\\\\\\\])","$1")+""})}28 12("\\54$","")},342:15(12){17(12!==81){12=12.23(/<71>/35,"<71 />");12=12.23(/<139\\11[^>]*>([\\49\\55]*?)<\\/139[^>]*>/35,"<11>$1");12=12.23(/<129\\11[^>]*>([\\49\\55]*?)<\\/129[^>]*>/35,"<37>$1");12=12.23(/<241\\11[^>]*>([\\49\\55]*?)<\\/241[^>]*>/35,"<259>$1")}25{12=""}28 12},510:15(12){12=12.23(/<71>/35,"<71 />");12=12.23(/<11\\11[^>]*>([\\49\\55]*?)<\\/11[^>]*>/35,"<139>$1");12=12.23(/<37\\11[^>]*>([\\49\\55]*?)<\\/37[^>]*>/35,"<129>$1");12=12.23(/<259\\11[^>]*>([\\49\\55]*?)<\\/259[^>]*>/35,"<241>$1");12=12.23(/<24(.*?)40="133-341: 166;">([\\49\\55]*?)<\\/24>/35,"<139>$2");12=12.23(/<24(.*?)40="133-40: 163;">([\\49\\55]*?)<\\/24>/35,"<129>$2");12=12.23(/<24(.*?)40="133-341: 166; 133-40: 163;">([\\49\\55]*?)<\\/24>/35,"<129><139>$2");12=12.23(/<24(.*?)40="133-40: 163; 133-341: 166;">([\\49\\55]*?)<\\/24>/35,"<139><129>$2");28 12},413:15(14){18 19=["317","24","32","61","36","71","33","11","37","241","259","179","184","836","261","308","381","511","194","837","838","865","132","137","125","384","238","242","243","892","891","893","130","317","386","890","139","129","56","107","111","245","167","118","439","376","374","375","379","465","466"];18 12=/<\\/?([36-889][36-894-9]*)\\11[^>]*>/35;28 14.23(12,15(20,16){28 11.359(16.385(),19)>"-1"?20:""})},433:15(16,20,14){18 12=14.299("=");18 34=12[1].299(";");18 19="";11.106(34,15(85,37){17(68 37=="110"){28 41}17(37==\'"\'||37=="\'"){28 41}37=37.23(/(^"|^\')/,"").23(/("$|\'$)/,"").23(/"(.*?)"/35,"");37=11.186(37);18 62=37.299(":");17(68 62[1]!=="110"&&(62[1].279("896")===-1&&62[1].279("895")===-1)){17(11.359(11.186(62[0]),16)!="-1"){19+=37+"; "}}});28 20.23(14,\'40="\'+19+\'"\')},446:15(12){18 16=7.$84.47();16=16.23(/|<\\?(?:887)?[\\38\\445]*?\\?>/35,"");16=7.331(16);16=7.413(16);17(7.22.436){16=16.23(/ 43="([\\49\\55]*?)"/35,"")}25{16=16.23(/\\38*43="873(.*?)"/35,"");16=16.23(/\\38*43="874(.*?)"/35,"");16=16.23(/\\38*43="875(.*?)"/35,"");16=16.23(/\\358="872"/35,"");16=16.23(/\\358="871(.*?)"/35,"");16=16.23(/\\358="888(.*?)"/35,"");16=16.23(/"867 868 869"/35,"")}18 14=["89","51","147","40","52","447","43","29","144","435"];18 19=["88","189-88","133-40","146","146-116","146-870","146-113","146-222","98-876","89","51","326","246"];18 34=16.307(/([\\49\\-.:]+)\\38*=\\38*("[^"]*"|\'[^\']*\'|[\\49\\-.:]+)/35);11.106(34,11.31(15(108,85){18 62=85.299("=");17(11.359(62[0],14)=="-1"){16=16.23(85,"")}17(7.22.378===21&&62[0]=="40"){16=7.433(19,16,85)}},7));17(7.22.378===21){16=16.23(/189-88:(\\38+)606;\\38/35,"");16=16.23(/133-40:(\\38+)877;\\38/35,"")}25{16=16.23(/ 40="([\\49\\55]*?)"/35,"")}16=16.23(/((\\38{2,})?|\\38)40=(""|\'\')/35,"");16=16.23(/(&102;){1,}/35,"&102;");16=16.23(/<24(\\38)?>(\\38)?<\\/24>/35," ");16=16.23(/\\38{2,}/20," ");16=16.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");16=16.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");16=16.23(/<24(\\38)?>([\\49\\55]*?)<\\/24>/35,"$2");16=7.383(16);16=7.373(16);16=7.372(16);16=7.364(16);16=16.23(/<33><32>/35,"");16=16.23(/<33>\\38+\\54+<(.*?)/35,"<$1");16=16.23(/<\\/(.*?)>\\38+\\54+<\\/33>/35,"");16=16.23(/<33 40="(.*?)">(\\38)?<\\/33>/35,"");16=16.23(/<33 40="(.*?)"><\\/33>/35,"");16=16.23(/<11\\884="885-886-883(.*?)">([\\49\\55]*?)<\\/11>/35,"$2");16=16.23(/; ">/35,\';">\');7.$84.47(16);18 20=11(7.44.93).65("#310"+12).70(0);7.226(20);7.58();444(11.31(15(){11(7.44.93).65("24[144=310]").94();17(7.22.161===41){7.152(21)}7.143();7.208()},7),100)},331:15(12){12=12.23(/\\38{2,}/20," ");12=12.23(/\\54/20," ");12=12.23(/[\\218]*/20,"");12=12.23(/\\54\\38*\\54/20,"\\54");12=12.23(/^[\\38\\54]*/20,"");12=12.23(/[\\38\\54]*$/20,"");12=12.23(/>\\38+<");28 12},364:15(12){12=12.23(/<125/20,"\\218<125");12=12.23(/<107/20,"\\218<107");12=12.23(/<111/20,"\\218\\218<111");12=12.23(/<\\/107>/20,"\\218");28 12},383:15(16){18 19=["<130>","<194>\\\\38*","<129>\\\\38*","<132>","<137>","<125>","<56>","<107>","<24>\\\\38*<24>","<24>&102;<24>","<11>\\\\38*","<11>&102;","<33>\\\\38*","<33>&102;","<33>\\\\38*<71>\\\\38*","<32>\\\\38*","<32>\\\\38*<71>\\\\38*"];195(18 14=0;14<19.224;++14){18 12=19[14];16=16.23(171 237(12,"35"),"")}28 16},373:15(19){18 16="\\164\\54";18 20=["<33","<67","","","<451","<459","<308","<381","<206","<175","<63","<252","<130","<194","<132","<137","<125","<238","<242","<243","<56","<118","<167","<377","","<245","<107","<111","<386"];195(18 14=0;14<20.224;++14){18 12=20[14];19=19.23(171 237(12,"35"),16+12)}28 19},372:15(19){18 20="\\164\\54";18 12=["","","","","","","","","<71>","<71 />","","","","","","","","","","","","","","","","","","","",""];195(18 14=0;14<12.224;++14){18 16=12[14];19=19.23(171 237(16,"35"),16+20)}28 19},197:15(14){17(11.59.97){18 12=14.307(/<(.*?)>/35);11.106(12,15(19,16){14=14.23(16,16.385())});14=14.23(/40="(.*?)"/35,15(19){28 19.385()});14=14.23(/ 212(.*?)=\\"(.*?)\\"/35,"")}14=14.23(/<24([\\49\\55]*?)40="88:(.*?);"><24([\\49\\55]*?)40="189-88:(.*?);">([\\49\\55]*?)<\\/24><\\/24>/35,\'<24 40="88: $2; 189-88: $4;">$5\');14=14.23(/<24([\\49\\55]*?)40="189-88:(.*?);"><24([\\49\\55]*?)40="88:(.*?);">([\\49\\55]*?)<\\/24><\\/24>/35,\'<24 40="88: $2; 189-88: $4;">$5\');14=14.23(/<24([\\49\\55]*?)88="(.*?)">([\\49\\55]*?)<\\/24\\>/35,\'<24$531="88: $2;">$3\');14=14.23(/<133([\\49\\55]*?)88="(.*?)">([\\49\\55]*?)<\\/133\\>/35,\'<24$531="88: $2;">$3\');14=14.23(/<24 40="(.*?)"\\38+40="(.*?)"[\\38]*>([\\49\\55]*?)<\\/24\\>/35,\'<24 40="$1;$2">$3\');14=14.23(/<133([\\49\\55]*?)>([\\49\\55]*?)<\\/133\\>/35,"<24$1>$2");14=14.23(/<24>([\\49\\55]*?)<\\/24>/35,"$1");17(7.22.454){14=14.23(/<71>/35,"<71 />");14=14.23(/<71 ?\\/?>$/35,"");14=14.23(/^<71 ?\\/?>/35,"");14=14.23(/(<179 [^>]+[^\\/])>/35,"$1 />")}14=14.23(/<33><33>/20,"<33>");14=14.23(/<\\/33><\\/33>/20,"");14=14.23(/<384(.*?)>/20,"<384 />");14=14.23(/<33>&102;/20,"<33>");14=14.23(/<33><132>/20,"<132>");14=14.23(/<33><137>/20,"<137>");14=14.23(/<\\/132><\\/33>/20,"");14=14.23(/<\\/137><\\/33>/20,"");14=14.23(/<33(.*?)>&102;<\\/33>/35,"");14=7.331(14);14=7.383(14);14=7.373(14);14=7.372(14);14=7.364(14);28 14},461:15(){18 12;17(7.22.213){7.$92.155();12=7.$84.47();12=11.186(7.197(12));7.$78.48(12).91().86();7.287("47");7.22.213=21}25{7.$78.155();7.$84.47(7.$78.48());7.$92.91();17(7.$84.47()===""){17(!11.59.177){12=7.22.273}25{12=7.22.274}7.239(12)}7.86();7.367("47");7.22.213=41;7.143();7.208();17(7.22.161===41){7.152(21)}}},463:15(){17(7.22.363===21){28 21}882(11.31(15(){11.267(7.22.363,{82:7.176()})},7),7.22.443*878)},442:15(){17(7.22.105===21){28 21}7.$105=11("<132>").121("879");7.$114.311(7.$105);11.106(7.22.362,11.31(15(16,19){17(19!=="|"&&68 7.22.105[19]!=="110"){18 20=7.22.105[19];17(7.22.277===21&&19==="127"){28 41}18 12=11("<125>");17(19==="87"){11(12).121("880")}18 14=7.369(19,20);17(19==="173"||19==="202"||68(20.260)!=="110"){18 34=11(\'<32 43="575" 40="178: 123;">\');17(19==="173"||19==="202"){34=7.581(34,19)}25{34=7.595(34,20.260)}7.265.565(34.425(11(57.93)));7.360=11.31(15(37){7.546(37,34,19)},7);7.599=11.31(15(37){7.598(37,34,19)},7);14.53(7.599)}7.$105.83(11(12).83(14))}17(19==="|"){7.$105.83(11(\'<125 43="881">\'))}},7));11(57).53(7.360);11(7.44).53(7.360)},369:15(14,19){18 12=11(\'<36 52="101:104(81);" 39="\'+19.39+\'" 43="276\'+14+\'"><24>&102;\');17(68 19.64==="110"){12.53(11.31(15(){7.69(19.80,14)},7))}25{17(19.64!=="91"){12.53(11.31(15(16){7[19.64](16)},7))}}17(68 19.236!=="110"){12.53(11.31(15(16){19.236(7,16,14)},7))}28 12},595:15(14,12){11.106(12,11.31(15(19,20){17(68(20.156)==="110"){20.156=""}18 16;17(68 20.126!=="110"&&20.126==="294"){16=11(\'<36 43="842">\')}25{16=11(\'<36 52="101:104(81);" 43="\'+20.156+\'">\'+20.39+"");17(68(20.64)==="110"){11(16).53(11.31(15(){7.69(20.80,19)},7))}25{11(16).53(11.31(15(34){7[20.64](34)},7))}}11(14).83(16)},7));28 14},581:15(108,85){18 16;17(85==="173"){17(11.59.97){16="823"}25{16="588"}}25{16="766"}11(108).89(210);18 20=7.22.361.224;195(18 19=0;19<20;++19){18 12=7.22.361[19];18 62=11(\'<36 144="\'+12+\'" 52="101:104(81);" 43="767">\').45({768:12});11(108).83(62);18 34=7;11(62).53(15(){17(11.59.177){17(16=="588"){34.69("365",21,21);34.69(16,11(7).79("144"));34.69("365",21,41)}25{34.69("589",21,21);34.69(16,11(7).79("144"));34.69("589",21,41)}}25{34.69(16,11(7).79("144"))}})}18 14=11(\'<36 52="101:104(81);" 43="765">\').47(26.123);17(85==="173"){14.53(11.31(7.584,7))}25{14.53(11.31(7.596,7))}11(108).83(14);28 108},584:15(){11(7.228()).45("189-88","606");7.58()},596:15(){11(7.228()).79("88","").45("88","");7.58()},598:15(20,34,12){17(7.162(12).417("227")){7.220()}25{7.220();7.287(12);7.162(12).121("227");18 16=7.162(12).165().113;17(7.22.160&&7.160){11(34).45({181:"160",113:16+"135",116:"764"}).91()}25{18 14=7.$105.165().116+30;11(34).45({181:"420",113:16+"135",116:14+"135"}).91()}}},220:15(){7.$105.65("36.227").136("271").136("227");11(".575").155()},546:15(14,16,12){17(!11(14.142).395().417("227")){11(16).136("271");7.760=21;7.220()}},112:15(){17(7.$92.70(0).148.112){28 7.$92.70(0).148.112()}25{17(7.$92.70(0).148.57.187){28 7.$92.70(0).148.57.187.366()}}},228:15(){17(158.112){28 7.112().370(0).551.217}25{17(57.187){28 7.112().761()}}},547:15(){17(158.112){28 7.112().370(0).551}25{17(57.187){28 7.112()}}},226:15(16,14){18 12=7.44.366();18 19=7.112();14=14?0:1;17(19!==81){12.541(16);19.537(12);19.272(16,14)}7.86()},371:15(20){17(68 158.112!=="110"){18 34=7.112();17(34.824){18 14=34.370(0);14.272(21);14.763(20);14=14.769();14.541(20);14.272(21);34.737();34.537(14)}}25{17(68 57.187!=="110"&&57.187.122!=="770"){18 19=(20.419===1)?20.304:20.82;18 37="777"+(""+95.209()).778(2);19+=\'<24 29="\'+37+\'">\';18 16=7.112();16.272(21);16.552(19);18 12=57.223(37);16.779(12);16.206();12.217.776(12)}}},162:15(12){28 11(7.$105.65("36.276"+12))},287:15(12){7.162(12).121("271")},367:15(12){7.162(12).136("271")},572:15(12,14){7.162(12).121("276"+14)},563:15(12,14){7.162(12).136("276"+14)},775:15(12){7.162(12).94()},771:15(12,14){7.$105.83(11("<125>").83(7.369(12,14)))},87:15(){18 12;17(7.22.87===21){7.572("87","557");7.287("87");7.22.87=41;7.51=7.$92.45("51");7.89=(7.$114.89()-2)+"135";12=7.176();7.368=11("<24>");7.$114.121("556").120(7.368);11(57.93).311(7.$114).45("288","296");7.$84=7.291(12);11(7.44).53(11.31(7.220,7));7.283();7.143();7.208();7.$114.65(".325").155();7.312();11(158).196(11.31(7.312,7));11(57).392(0,0);7.86()}25{7.563("87","557");7.367("87");7.22.87=21;11(158).159("196",11.31(7.312,7));11(57.93).45("288","");12=7.176();7.$114.136("556").45("89","151");7.368.120(7.$114).94();7.$84=7.291(12);7.143();7.208();17(7.22.161){7.387()}7.$114.65(".325").91();11(7.44).53(11.31(7.220,7));7.283();7.58();7.$92.45("51",7.51);7.$78.45("51",7.51);7.86()}},312:15(){17(7.22.87===21){28 21}18 12=11(158).51()-42;7.$114.89(11(158).89()-2);7.$92.51(12);7.$78.51(12)},555:15(){17(7.22.196===21){28 21}7.$330=11(\'<32 43="325">&772;\');7.$114.83(7.$330);7.$330.313(11.31(7.568,7))},568:15(12){17(12.119){12.119()}7.327=12.142;17(7.22.213){7.193=7.$92;7.193.70(0).40.534="296";7.322=7.$78}25{7.193=7.$78;7.322=7.$92}7.240=11.31(7.536,7);7.328=11.31(7.553,7);7.329=11.31(7.196,7);11(57).313(7.328);11(57).247(7.240);11(7.327).247(7.240);7.305=21;7.303=21;7.34=7.193.51()},553:15(){11(57).323(7.329)},196:15(14){17(14.119){14.119()}18 16=14.270;17(7.305===21){7.305=16}17(7.303===21){7.303=7.193.51()}18 12=(7.303+16-7.305)-10;17(12<=30){28 41}17(12>=0){7.193.70(0).40.51=12+"135";7.322.70(0).40.51=12+"135"}},536:15(12){11(57).159("323",7.329);11(57).159("313",7.328);11(57).159("247",7.240);11(7.327).159("247",7.240);7.193.70(0).40.534="773"},535:15(14){18 20=21;18 12=21;18 108;18 85;18 16=11(14).89()/11(14).51();18 34=1;18 37=1;18 62=1;18 19=1;11(14).293(15(){11(14).45("326","774-196")},15(){11(14).45("326","759");20=21});11(14).313(15(117){17(117.119){117.119()}20=41;12=41;108=95.200(117.321-11(14).124(0).165().113);85=95.200(117.270-11(14).124(0).165().116)});11(14).247(11.31(15(117){20=21;7.58();17(7.22.161===41){7.152(21)}},7));11(14).53(11.31(15(117){17(12){7.548(117)}},7));11(14).323(15(257){17(20){12=21;18 54=95.200(257.321-11(7).124(0).165().113)-108;18 117=95.200(257.270-11(7).124(0).165().116)-85;18 33=11(14).51();18 164=316(33,10)+117;18 298=164*16;17(37===1||(68(37)==="543"&&298<37&&298>62)){11(14).89(298)}17(34===1||(68(34)==="543"&&164<34&&164>19)){11(14).51(164)}108=95.200(257.321-11(7).124(0).165().113);85=95.200(257.270-11(7).124(0).165().116)}})},578:15(){7.183(26.56,"56",300,11.31(15(){11("#586").53(11.31(7.592,7))},7),15(){11("#324").86()})},592:15(){18 117=11("#324").48();18 16=11("#585").48();18 12=11("<32>");18 14=95.263(95.209()*258);18 85=11(\'<56 29="56\'+14+\'"><167>\');195(18 20=0;20<117;20++){18 108=11("<107>");195(18 62=0;62<16;62++){18 19=11("<111>&102;");11(108).83(19)}11(85).83(108)}11(12).83(85);18 34=11(12).47();17(11.59.97){34+="<33>"}25{34+="<33>&102;"}7.69("157",34);7.115();7.$56=11(7.44).65("93").65("#56"+14);7.$56.53(11.31(7.319,7));17(7.22.161===41){7.152(21)}},319:15(12){7.$56=11(12.142).320("56");7.$583=7.$56.65("107");7.$577=7.$56.65("111");7.$577.136("286");7.$167=11(12.142).320("167");7.$118=11(7.$56).65("118");7.$285=11(12.142);7.$285.121("286");7.$214=11(12.142).320("107")},604:15(){11(7.$56).94();7.$56=21;7.58()},605:15(){11(7.$214).94();7.58()},603:15(){18 12=11(7.$285).70(0).758;11(7.$56).65("107").106(15(){11(7).65("111").124(12).94()});7.58()},597:15(){17(11(7.$56).65("118").172()!==0){7.382()}25{18 12=11(7.$56).65("107").744().216();12.65("111").47("&102;");7.$118=11("<118>");7.$118.83(12);11(7.$56).311(7.$118);7.58()}},382:15(){11(7.$118).94();7.$118=21;7.58()},450:15(){7.426("191")},601:15(){7.426("120")},593:15(){7.388("191")},580:15(){7.388("120")},426:15(12){18 14=11(7.$214).216();14.65("111").47("&102;");17(12==="120"){11(7.$214).120(14)}25{11(7.$214).191(14)}7.58()},388:15(14){18 12=0;7.$285.121("286");7.$214.65("111").106(15(19,16){17(11(16).417("286")){12=19}});7.$583.106(15(19,16){18 20=11(16).65("111").124(12);18 34=20.216();34.47("&102;");17(14==="120"){11(20).120(34)}25{11(20).191(34)}});7.58()},602:15(){17(11.59.97){7.306()}7.183(26.184,"184",600,11.31(15(){11("#545").53(11.31(7.544,7))},7),15(){11("#428").86()})},544:15(){18 12=11("#428").48();12=7.413(12);17(11.59.97){11(7.44.223("24"+7.153)).120(12).94();7.58()}25{7.69("157",12)}7.115();17(7.22.161===41){7.152(21)}},548:15(20){18 12=11(20.142);18 16=12.395();18 14=11.31(15(){11("#414").48(12.79("411"));11("#745").79("52",12.79("147"));11("#394").48(12.45("246"));17(11(16).70(0).190==="230"){11("#170").48(11(16).79("52"))}11("#549").53(11.31(15(){7.533(12)},7));11("#576").53(11.31(15(){7.532(12)},7))},7);7.183(26.169,"746",380,14)},533:15(12){11(12).94();7.115();7.58();17(7.22.161===41){7.152(21)}},532:15(14){18 12=11(14).395();11(14).79("411",11("#414").48());18 16=11("#394").48();17(16==="113"){11(14).45({"246":"113",146:"0 295 295 0"})}25{17(16==="222"){11(14).45({"246":"222",146:"0 0 295 295"})}25{11(14).45({"246":"123",146:"0"})}}18 19=11.186(11("#170").48());17(19!==""){17(11(12).70(0).190!=="230"){11(14).233(\'<36 52="\'+19+\'">\'+7.304(14)+"")}25{11(12).79("52",19)}}25{17(11(12).70(0).190==="230"){11(12).233(7.304(14))}}7.115();7.143();7.58()},540:15(){17(11.59.97){7.306()}18 12=11.31(15(){17(7.22.266!==21){11.743(7.22.266,11.31(15(16){11.106(16,11.31(15(34,37){18 20=11(\'<179 147="\'+37.742+\'" 144="\'+37.169+\'" />\');11("#418").83(20);11(20).53(11.31(7.571,7))},7))},7))}25{11("#154 36").124(1).94()}17(7.22.264!==21){17(7.244()===21){17(11("#188").172()!==0){11("#188").407({140:7.22.264,131:11.31(7.211,7)})}}7.416("188",{151:41,140:7.22.264,131:11.31(7.211,7)})}25{11(".138").155();17(7.22.266===21){11("#154").94();11("#390").91()}25{18 19=11("#154 36");19.124(0).94();19.124(1).121("198");11("#389").91()}}11("#567").53(11.31(7.560,7))},7);18 14=11.31(15(){17(7.22.264===21&&7.22.266===21){11("#170").86()}},7);7.183(26.169,"169",570,12,14,41)},571:15(12){7.315(\'<179 411="" 147="\'+11(12.142).79("144")+\'" />\',41)},560:15(){17(11("#170").48()!==""){18 12=\'<179 147="\'+11("#170").48()+\'" />\';7.315(12,41)}25{7.115()}},211:15(12){7.315(12)},315:15(14,19){18 12="",16="";17(19!==41){16=11.566(14);12=\'<33><179 147="\'+16.538+\'" />\'}25{12=14}7.86();17(11.59.97){11(7.44.223("24"+7.153)).120(12).94();7.58()}25{7.69("157",12)}17(19!==41&&68 7.22.211==="15"){7.22.211(7,16)}7.115();11(7.44).65("179").464(11.31(15(){7.152(21)},7));7.143()},561:15(){18 12=11.31(15(){18 37=7.112();18 19="",62="";17(11.59.97){18 20=7.228();17(20.562==="230"){7.192=11(20);62=7.192.98();19=7.192.79("52")}25{17(7.396()){62=37.98}25{62=37.268()}7.153=95.263(95.209()*258);18 16=\'<24 29="24\'+7.153+\'">\'+62+"";17(62!==""){16=\'<24 29="24\'+7.153+\'">\'+62+""}7.69("157",16)}}25{17(37&&37.229&&37.229.217.190==="230"){19=37.229.217.52;62=37.229.217.98;17(37.268()===""){7.192=37.229.217}}25{62=37.268();19=""}}11(".281").48(62);18 34=19.23(116.455.52,"");17(19.279("251:")===0){7.423(2);11("#235").48(2);11("#412").48(19.23("251:",""))}25{17(34.279(/^#/35)===0){7.423(3);11("#235").48(3);11("#402").48(34.23(/^#/35,""))}25{11("#292").48(19)}}11("#559").53(11.31(7.558,7))},7);18 14=15(19){11("#292").86()};7.183(26.149,"149",460,12,14)},558:15(){18 14=11("#235").48();18 12="",19="";17(14==="1"){12=11("#292").48();19=11("#554").48()}25{17(14==="2"){12="251:"+11("#412").48();19=11("#564").48()}25{17(14==="3"){12="#"+11("#402").48();19=11("#573").48()}}}7.574(\'<36 52="\'+12+\'">\'+19+" ",11.186(19),12)},574:15(12,19,14){17(19!=""){17(7.192){11(7.192).98(19);11(7.192).79("52",14);7.58()}25{17(11.59.97){11(7.44.223("24"+7.153)).233(12);7.58()}25{7.69("157",12)}}}7.115()},569:15(){17(11.59.97){7.306()}18 12=11.31(15(){18 14=7.112();18 19="";17(7.396()){19=14.98}25{19=14.268()}11("#406").48(19);17(7.244()===21){11("#188").407({140:7.22.277,131:11.31(15(16){7.225(16)},7)})}7.416("188",{151:41,140:7.22.277,131:11.31(15(16){7.225(16)},7)})},7);7.183(26.127,"127",500,12)},225:15(12){18 19=11.566(12);18 16=11("#406").48();17(16===""){16=19.738}18 14=\'<36 52="\'+19.538+\'">\'+16+"";17(11.59.539&&!!158.739){14=14+"&102;"}17(11.59.97){17(16!==""){11(7.44.223("24"+7.153)).233(14)}25{11(7.44.223("24"+7.153)).120(14).94()}7.58()}25{7.69("157",14)}17(68 7.22.225==="15"){7.22.225(7,19)}7.115()},183:15(62,19,20,16,37,14){17(11("#221").172()===0){7.232=11(\'<32 29="221" 40="178: 123;">\');11("93").311(7.232)}17(7.22.232){11("#221").91();11("#221").53(11.31(7.115,7))}17(11("#168").172()===0){7.542=11(\'<32 29="168" 40="178: 123;"><32 29="427">&740;<32 29="550"><32 29="421">\');11("93").83(7.542)}11("#427").53(11.31(7.115,7));7.231=11.31(15(85){17(85.314===27){7.115()}},7);11(57).199(7.231);11(7.44).199(7.231);11("#421").47(7.22["741"+19]);11("#550").47(62);17(11("#154").172()!==0){18 34=7;11("#154 36").106(15(85,108){85++;11(108).53(15(){11("#154 36").136("198");11(7).121("198");11(".138").155();11("#138"+85).91();11("#235").48(85);17(34.244()===21){18 117=11("#168").410();11("#168").45("146-116","-"+(117+10)/2+"135")}})})}11("#215").53(11.31(7.115,7));17(68(16)==="15"){16()}18 12=11("#168").410();17(7.244()===21){11("#168").45({181:"160",116:"50%",113:"50%",89:20+"135",51:"151",590:"-"+(12+10)/2+"135",587:"-"+(20+60)/2+"135"}).747("582")}25{11("#168").45({181:"420",89:"96%",51:"151",116:"748",113:"0",590:"755",587:"2%"}).91();7.469()}17(68(37)==="15"){37()}17(14===41){11("#418").51(300).45("288","151")}},115:15(){11("#427").159("53",7.115);11("#168").756("582",11.31(15(){11("#421").47("");17(7.22.232){11("#221").155();11("#221").159("53",7.115)}11(57).159("199",7.231);11(7.44).159("199",7.231)},7))},423:15(12){11(".138").155();18 14=11("#154 36");14.136("198");14.124(12-1).121("198");11("#138"+12).91()},416:15(14,12){7.109={140:21,131:21,422:21,403:21,151:21,63:21};11.309(7.109,12);17(11("#"+14).172()!==0&&11("#"+14).70(0).190==="757"){7.109.63=11("#"+14);7.174=11(11("#"+14).70(0).67)}25{7.174=11("#"+14)}7.449=7.174.79("182");17(7.109.151){11(7.109.63).754(11.31(15(){7.174.429(15(16){28 21});7.430()},7))}25{17(7.109.403){11("#"+7.109.403).53(11.31(7.430,7))}}},430:15(){7.448(7.174,7.437())},437:15(){7.29="16"+95.263(95.209()*258);18 19=57.753("32");18 12=\'<261 40="178:123" 147="456:457" 29="\'+7.29+\'" 126="\'+7.29+\'">\';19.453=12;57.93.749(19);17(7.109.422){7.109.422()}11("#"+7.29).464(11.31(7.462,7));28 7.29},448:15(20,19){17(7.109.63){18 34="750"+7.29;18 12="751"+7.29;7.67=11(\'<67 182="\'+7.109.140+\'" 262="269" 142="\'+19+\'" 126="\'+34+\'" 29="\'+34+\'" 301="297/67-82">\');18 14=7.109.63;18 37=11(14).216();11(14).79("29",12);11(14).191(37);11(14).425(7.67);11(7.67).45("181","420");11(7.67).45("116","-452");11(7.67).45("113","-452");11(7.67).425("93");7.67.429()}25{20.79("142",19);20.79("262","269");20.79("301","297/67-82");20.79("182",7.109.140);7.174.429()}},462:15(){18 16=11("#"+7.29);18 20;17(16.302){20=16.302}25{17(16.148){20=16.148.57}25{20=158.752[7.29].57}}17(20.455.52==="456:457"){28 41}17(7.109.131){18 19=20.93.453;18 12=19.307(/\\{.*\\}/)[0];7.109.131(12)}7.174.79("182",7.449);7.174.79("142","")},306:15(){7.153=95.263(95.209()*258);7.69("157",\'<24 29="24\'+7.153+\'">\')},396:15(){17(11.59.97&&316(11.59.780,10)<9){28 41}28 21},304:15(12){28 11("<33>").83(11(12).124(0).216()).47()},781:15(12){28 316(12.23("135",""),10)},244:15(){17(/(810|811|812|809|808)/.498(467.468)){28 41}25{28 21}},469:15(){11("47,93").804({392:0},500)}};11.128.400=15(){28 11(7.82("103").44)};11.128.805=15(){28 7.82("103").$92};11.128.806=15(){28 7.82("103").$84};11.128.176=15(){28 7.82("103").176()};11.128.807=15(){28 7.82("103").$84.98()};11.128.239=15(12){7.82("103").239(12)};11.128.401=15(12){7.82("103").401(12)};11.128.813=15(){7.82("103").432();7.814("103")};11.128.820=15(){7.82("103").86()};11.128.69=15(12,14){7.82("103").69(12,14)}})(212);(15(11){11.128.407=15(12){28 7.106(15(){18 14=171 36(7,12);14.318()})};15 36(14,12){7.22=11.309({140:21,131:21,478:21,98:26.440,514:26.458},12);7.$78=11(14)}36.530={318:15(){17(!11.59.821&&!11.59.97){7.404=11(\'<32 43="822">\');7.150=11(\'<32 43="819">\'+7.22.98+"");7.515=11(\'<32 43="818">\'+7.22.514+"");7.404.83(7.150);7.$78.191(7.404);7.$78.191(7.515);7.150.408("815",11.31(15(){28 7.473()},7));7.150.408("816",11.31(15(){28 7.472()},7));18 19=11.31(15(20){18 16=316(20.817/20.803*100,10);7.150.98("802 "+16+"%")},7);18 14=212.788.520();17(14.204){14.204.789("790",19,21)}18 12=15(){28 14};7.150.70(0).787=11.31(15(34){34.119();7.150.136("293").121("786");18 20=34.782.783[0];18 16=171 784();16.83("127",20);11.519({785:"47",140:7.22.140,82:16,520:12,791:21,792:21,799:21,122:"269",131:11.31(15(37){17(7.22.131!==21){7.22.131(37)}17(7.22.478===41){7.150.47(37)}},7)})},7)}},473:15(){7.150.121("293");28 21},472:15(){7.150.136("293");28 21}}})(212);(15(11){18 14=/(^|&415;|\\38)(800\\..+?\\..+?)(\\38|&424;|$)/20,36=/(^|&415;|\\38)(((801?|798):\\/\\/|251:).+?)(\\38|&424;|$)/20,12=15(){18 20=7.476,16=20.224;797(16--){18 34=20[16];17(34.419===3){18 19=34.793;17(19){19=19.23(/&/20,"&794;").23(//20,"&424;").23(14,\'$1<36 52="795://$2">$2$3\').23(36,\'$1<36 52="$2">$2$5\');11(34).120(19).94()}}25{17(34.419===1&&!/^(36|219|252)$/37.498(34.190)){12.796(34)}}}};11.128.490=15(){7.106(12)}})(212);',10,897,'|||||||this||||b|c||d|function|f|if|var|e|g|false|opts|replace|span|else|RLANG||return|id||proxy|div|p|h|gi|a|i|s|title|style|true||class|doc|css||html|val|w||height|href|click|n|W|table|document|syncCode|browser||label|j|input|func|find||form|typeof|execCommand|get|br|||||||el|attr|exec|null|data|append|editor|k|focus|fullscreen|color|width||show|frame|body|remove|Math||msie|text|||javascript|nbsp|redactor|void|toolbar|each|tr|l|uploadOptions|undefined|td|getSelection|left|box|modalClose|top|m|thead|preventDefault|after|addClass|type|none|eq|li|name|file|fn|em|pre|success|ul|font|_shortcuts|px|removeClass|ol|redactor_tab|strong|url|value|target|observeImages|rel|redactor_input|margin|src|contentWindow|link|dropareabox|auto|setAutoSize|spanid|redactor_tabs|hide|className|inserthtml|window|unbind|fixed|autoresize|getBtn|italic|r|offset|bold|tbody|redactor_modal|image|redactor_file_link|new|size|backcolor|element|option|getCode|mozilla|display|img|formatblock|position|action|modalInit|video|Insert|trim|selection|redactor_file|background|tagName|before|insert_link_node|element_resize|blockquote|for|resize|formatting|redactor_tabs_act|keyup|round|outdent|fontcolor|indent|upload|cancel|select|String|observeTables|random||imageUploadCallback|jQuery|visual|current_tr|redactor_btn_modal_close|clone|parentNode|t|button|hideAllDropDown|redactor_modal_overlay|right|getElementById|length|fileUploadCallback|setFocusNode|dropact|getParentNode|anchorNode|A|hdlModalClose|overlay|replaceWith|lang|redactor_tab_selected|callback|RegExp|dl|setCode|stopResizeHdl|del|dt|dd|isMobile|th|float|mouseup|shiftKey|insert|path|mailto|textarea|redactor_btns_box|redactor_modal_footer|Delete|Add|q|99999|strike|dropdown|iframe|method|floor|imageUpload|dropdowns|imageGetJson|post|toString|POST|pageY|act|collapse|allEmptyHtml|mozillaEmptyHtml|deleted|redactor_btn_|fileUpload|unorderedlist|search|Header|redactor_link_text|horizontalrule|observeFocus|unlink|current_td|current|setBtnActive|overflow|orderedlist|RELANG|enable|redactor_link_url|hover|separator|10px|hidden|multipart|o|split||enctype|contentDocument|h_new|outerHTML|null_point|markerIE|match|object|extend|pastemarkerend|prepend|fullScreenResize|mousedown|keyCode|_imageSet|parseInt|code|init|tableObserver|parents|pageX|element_resize_parent|mousemove|redactor_table_rows|redactor_resizer|cursor|splitter|startResizeHdl|resizeHdl|resizer|formattingRemove|execCommandCallback|page|which|observeScroll|handler|anchor|Email|choose|save|weight|preformater|URL|write|insert_table|keyupCallback|autoformat|delete_column|delete_row|delete_table|delete_head|add_head|insert_row_below|insert_row_above|insert_column_left|insert_column_right|keydownCallback|sclass|inArray|hdlHideDropDown|colors|buttons|autosave|formattingIndenting|useCSS|createRange|setBtnInactive|tmpspan|buildButton|getRangeAt|insertNodeAtCaret|formattingAddAfter|formattingAddBefore|h2|h3|h1|caption|removeStyles|h4||embed|deleteHead|formattingEmptyTags|hr|toLowerCase|figure|observeAutoResize|insertColumn|redactor_tab2|redactor_tab3|Column|scrollTop|Row|redactor_form_image_align|parent|oldIE|Right|Align|Left|getDoc|insertHtml|redactor_link_anchor|trigger|droparea|Link|redactor_filename|dragupload|bind|Table|outerHeight|alt|redactor_link_mailto|stripTags|redactor_file_alt|lt|uploadInit|hasClass|redactor_image_box|nodeType|absolute|redactor_modal_inner|start|setModalTab|gt|appendTo|insertRow|redactor_modal_close|redactor_insert_video_area|submit|uploadSubmit|7f7f7f|destroy|cleanStyles|Video|unselectable|removeClasses|uploadFrame|_delete|tfoot|drop_file_here|image_position|buildToolbar|interval|setTimeout|S|pasteCleanUp|frameborder|uploadForm|element_action|insertRowAbove|fieldset|2000px|innerHTML|xhtml|location|about|blank|or_choose|legend||toggle|uploadLoaded|autoSave|load|h5|h6|navigator|userAgent|scrolltop|Code|indexOf|ondragleave|ondrag|insertorderedlist|insertunorderedlist|childNodes|Color|preview|header4|header2|header1|header3|build|getPath|ctrlKey|shortcuts|alignright|link_insert|align_center|linkify|align_left|aligncenter|align_right|justify|buttonsAdd|cleanUp|buttonsCustom|test|align_justify||List|setDoc|script|address|convertDivs|paragraphy|Head|formatEmpty|Image|reformater|param|image_web_link|redactor_tab1|atext|dropalternative|safariShiftKeyEnter|convertLinks|head|ajax|xhr|paragraph|quote|direction|video_html_code|formatNewLine|DIV|rows|columns|min|prototype|1style|imageSave|imageDelete|visibility|resizeImage|stopResize|addRange|filelink|webkit|showImage|selectNodeContents|modal|number|insertVideo|redactor_insert_video_btn|hideDropDown|getCurrentNode|imageEdit|redactor_image_delete_btn|redactor_modal_header|startContainer|pasteHTML|startResize|redactor_link_url_text|buildResizer|redactor_box_fullscreen|normalscreen|insertLink|redactor_insert_link_btn|imageUploadCallbackLink|showLink|nodeName|removeBtnIcon|redactor_link_mailto_text|push|parseJSON|redactor_upload_btn|initResize|showFile||imageSetThumb|changeBtnIcon|redactor_link_anchor_text|_insertLink|redactor_dropdown|redactorSaveBtn|table_td|showTable|alignleft|insertColumnRight|buildColorPicker|fast|table_tr|setBackgroundNone|redactor_table_columns|redactor_insert_table_btn|marginLeft|hilitecolor|styleWithCSS|marginTop|b7dde8|insertTable|insertColumnLeft|en|buildDropdown|setColorNone|addHead|showDropDown|hdlShowDropDown||insertRowBelow|showVideo|deleteColumn|deleteTable|deleteRow|transparent|redactorInsertVideoForm|Save|HTML|160px|Above|dbeef3|b8cce4|Rows|modal_video|Unlink|f2f2f2|fdeada|8db3e2|modal_table|Below|c4bd97|redactor_format_h4|ebf1dd|strikethrough|Columns|fff2ca|f2dcdb|Ordered|bull|e5e0ec|separator_drop1|Italic|Back|Bold|Unordered|separator_drop2|redactor_format_h3|dbe5f1|Font|Outdent|Paragraph|Formatting|Indent|ddd9c3|c6d9f0|redactor_format_blockquote|separator_drop3|redactor_format_h2|d8d8d8|Quote|redactor_format_h1|redactor_format_pre|595959|Cancel|d7e3bc|1f497d|Or|b2a2c7|Choose|Drop|here|Justify|eeece1|Center|4f81bd|c3d69b|c0504d|c09100|9bbb59|File|Upload|d99694|Download|download|e36c09|000000|Anchor|5f497a|17365d|Fullscreen|76923c|366092|953734|Deleted|92cddc|Rule|fac08f|ltr|ffffff|f2c314|a5a5a5|Horizontal|494429|262626|0c0c0c|1d1b10|modal_image|web|redactorInsertImageForm|fbd5b5|ffe694|3f3f3f|000|bfbfbf|f79646|modal_link|None|Position|ffff00|e5b9b7|Web|redactorInsertLinkForm|ccc1d9|Text|modal_image_edit|7px|632423|938953|4f6128|244061|548dd4|0f243e|95b3d7|Embed|3f3151|31859b|Name|optional|4bacc6|redactorUploadFileForm|modal_file|974806|8064a2|7f6000|Title|removeAllRanges|filename|chrome|times|modal_|thumb|getJSON|first|redactor_image_edit_src|image_edit|fadeIn|20px|appendChild|redactorUploadForm|redactorUploadFile|frames|createElement|change|0px|fadeOut|INPUT|cellIndex|default|showedDropDown|parentElement|JustifyLeft|insertNode|30px|redactor_color_none|forecolor|redactor_color_link|backgroundColor|cloneRange|Control|addBtn|mdash|visible|nw|removeBtn|removeChild|marker_|slice|moveToElementText|version|normalize|dataTransfer|files|FormData|dataType|drop|ondrop|ajaxSettings|addEventListener|progress|cache|contentType|nodeValue|amp|http|call|while|ftp|processData|www|https|Loading|total|animate|getFrame|getEditor|getText|Android|BlackBerry|iPhone|iPod|iPad|destroyEditor|removeData|dragover|dragleave|loaded|redactor_dropalternative|redactor_dropareabox|setFocus|opera|redactor_droparea|BackColor|rangeCount|dir|delete|escape|encodeURIComponent|contenteditable|stylesheet|DOCTYPE|media|all|enableObjectResizing|on|audio|mark|cite|math|colgroup|relative|redactor_separator_drop|catch|close|open|metaKey|scroll|keydown|undo|paste|inserthorizontalrule|JustifyCenter|JustifyRight|justifyfull|redo|removeFormat|scrolling|redactor_frame|insertAfter|redactor_box|js|superscript|subscript|Chrome|small|try|Times|New|Roman|bottom|Mso|Nonformat|TOC|Heading|Body|align|normal|1000|redactor_toolbar|redactor_toolbar_right|redactor_separator|setInterval|marker|sid|internal|source|php|Apple|z|figcaption|sub|sup|big|z0|cm|pt'.split('|'),0,{})) \ No newline at end of file diff --git a/syte/static/less/styles.less b/syte/static/less/styles.less index d0324502e..cad141dc1 100644 --- a/syte/static/less/styles.less +++ b/syte/static/less/styles.less @@ -9,7 +9,6 @@ @import 'profiles.less'; @import 'code.less'; - // Specific styles .main-header { position: fixed; diff --git a/syte/static/templates/blog-post-text.html b/syte/static/templates/blog-post-text.html index c34cb2214..b5127a406 100644 --- a/syte/static/templates/blog-post-text.html +++ b/syte/static/templates/blog-post-text.html @@ -1,22 +1,22 @@ diff --git a/syte/syte_settings.py b/syte/syte_settings.py index d95037c28..b420476f7 100644 --- a/syte/syte_settings.py +++ b/syte/syte_settings.py @@ -2,11 +2,23 @@ DEPLOYMENT_MODE = 'dev' COMPRESS_REVISION_NUMBER = '1.0' -#Blog Integration: Tumblr +#Tumblr blog integration +TUMBLR_INTEGRATION_ENABLED = False TUMBLR_BLOG_URL = '[ENTER TUMBLR BLOG URL] ex. rigoneri.tumblr.com' TUMBLR_API_URL = 'http://api.tumblr.com/v2/blog/{0}'.format(TUMBLR_BLOG_URL) TUMBLR_API_KEY = '[ENTER TUMBLR API KEY HERE, SEE TUMBLR SETUP INSTRUCTIONS]' +BUILTIN_POST_ENABLED = True +BUILTIN_POST_DATABASE_SETTINGS = { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'posts.db', + 'USER': '', + 'PASSWORD':'', + 'HOST':'', +} +BUILTIN_POST_USERNAME = "" +BUILTIN_POST_PASSWORD = "" + #RSS Feed Integration: (by default use Tumbrl rss feed) RSS_FEED_ENABLED = True RSS_FEED_URL = 'http://{0}/rss'.format(TUMBLR_BLOG_URL) diff --git a/syte/templates/admin.html b/syte/templates/admin.html new file mode 100644 index 000000000..96695a902 --- /dev/null +++ b/syte/templates/admin.html @@ -0,0 +1,57 @@ +{% extends "admintemplate.html" %} + +{% block admintitle %} + List +{% endblock %} + +{% block navmain %} +
                  • New Post
                  • +{% endblock %} + +{% block admincontent %} + + {% if draft_posts|length %} +
                    +
                    +

                    Drafts

                    + + + + + + + + {% for post in draft_posts %} + + + + {% endfor %} + +
                    Title
                    {{ post.title }}
                    +
                    +
                    + {% endif %} + +
                    +
                    +

                    Published Posts

                    + + + + + + + + + {% for post in published_posts %} + + + + + {% endfor %} + +
                    #Title
                    {{ post.id }}{{ post.title }}
                    +
                    +
                    + +{% endblock %} \ No newline at end of file diff --git a/syte/templates/admintemplate.html b/syte/templates/admintemplate.html new file mode 100644 index 000000000..fcf80ddf3 --- /dev/null +++ b/syte/templates/admintemplate.html @@ -0,0 +1,18 @@ +{% extends 'base.html' %} +{% block pagetitle %}{{ post_title }}{% endblock %} +{% block main_section %} +
                    +
                    +
                    +

                    Posts / {% block admintitle %}{% endblock %}

                    +
                    +
                    + +
                    + {% block admincontent %}{% endblock %} +
                    +
                    + + +
                    +{% endblock %} \ No newline at end of file diff --git a/syte/templates/base.html b/syte/templates/base.html index 469cdb536..5b56762b5 100644 --- a/syte/templates/base.html +++ b/syte/templates/base.html @@ -10,8 +10,10 @@ {% if RSS_FEED_ENABLED %} {% endif %} + {% block extra_css %}{% endblock %} {% if DEV_DEPLOYMENT_MODE %} + {% else %} @@ -28,12 +30,14 @@

                    iOS & Web Developer + Designer + Entrepreneur Co-Founder of + {% block navmain %}
                  • Home
                  • Twitter
                  • Github
                  • Dribbble
                  • Instagram
                  • Contact
                  • + {% endblock %}

                  Fork me on Github diff --git a/syte/templates/posteditor.html b/syte/templates/posteditor.html new file mode 100644 index 000000000..d5454995a --- /dev/null +++ b/syte/templates/posteditor.html @@ -0,0 +1,68 @@ +{% extends "admintemplate.html" %} + +{% block extra_css %}{% endblock %} + + +{% block extra_js %} + + +{% endblock %} + +{% block navmain %} +
                • Save Post
                • + {% if post %} +
                • +
                  + {% csrf_token %} + Delete Post +
                  +
                • + {% if post.published %} +
                • +
                  + {% csrf_token %} + Unpublish Post +
                  +
                • +
                • View Live
                • + {% else %} +
                • +
                  + {% csrf_token %} + Publish Post +
                  +
                • + {% endif %} + {% endif %} +{% endblock %} + +{% block admintitle %} + {% if not post %}Create{% else %}Edit{% endif %} +{% endblock %} + +{% block admincontent %} +
                  +
                  +
                  + {% csrf_token %} + + +
                  + +
                  +
                  + +{% endblock %} \ No newline at end of file diff --git a/syte/urls.py b/syte/urls.py index fde8759a8..2c6d601f8 100644 --- a/syte/urls.py +++ b/syte/urls.py @@ -14,6 +14,17 @@ url(r'^/?$', 'syte.views.home'), ) +if settings.BUILTIN_POST_ENABLED: + urlpatterns += patterns('', + url(r'^p/(?P\w+)$','syte.views.post_slug'), + url(r'^admin/?$','syte.views.adminindex'), + url(r'^admin/(?P\d+)$','syte.views.editpost'), + url(r'^admin/(?P\d+)/delete$','syte.views.deletepost'), + url(r'^admin/(?P\d+)/publish','syte.views.publishpost'), + url(r'^admin/(?P\d+)/unpublish','syte.views.unpublishpost'), + url(r'^admin/create/?$','syte.views.createpost'), + ) + #Twitter Integration if settings.TWITTER_INTEGRATION_ENABLED: urlpatterns += patterns('', diff --git a/syte/views.py b/syte/views.py index 15881309b..4527461e2 100644 --- a/syte/views.py +++ b/syte/views.py @@ -1,6 +1,6 @@ from context_processor import site_pages -from django.shortcuts import redirect, render +from django.shortcuts import redirect, render, get_object_or_404 from django.template import Context, loader from django.http import HttpResponse, HttpResponseServerError, Http404 from django.conf import settings @@ -11,6 +11,10 @@ import requests import json import oauth2 as oauth +import time +from syte import auth_decorator +if settings.BUILTIN_POST_ENABLED: + from syte import models def server_error(request, template_name='500.html'): t = loader.get_template(template_name) @@ -26,7 +30,6 @@ def page_not_found_error(request, template_name='404.html'): def home(request): return render(request, 'index.html', {}) - def twitter(request, username): consumer = oauth.Consumer(key=settings.TWITTER_CONSUMER_KEY, secret=settings.TWITTER_CONSUMER_SECRET) @@ -102,39 +105,80 @@ def dribbble(request, username): def blog(request): - r = requests.get('{0}/posts?api_key={1}'.format(settings.TUMBLR_API_URL, - settings.TUMBLR_API_KEY)) - return HttpResponse(content=r.text, status=r.status_code, - content_type=r.headers['content-type']) - - -def blog_post(request, post_id): - context = dict() + if settings.BUILTIN_POST_ENABLED: + + posts = { + count:{ + "body":post.text, + "date":post.publish_date.isoformat(), + "format":"html", + "id":post.id, + "slug":post.slug, + "tags":[tag.name for tag in post.tags.all()], + "timestamp":time.mktime(post.publish_date.timetuple()), + "title":post.title, + "type":"text" + } for count,post in enumerate(models.Post.objects.filter(published=True).select_related("tags").all()) + } - r = requests.get('{0}/posts?api_key={1}&id={2}'.format(settings.TUMBLR_API_URL, - settings.TUMBLR_API_KEY, post_id)) + blog_data = { + "meta":{"msg":"OK","status":200}, + "response":{ + "posts": posts, + "total_posts":len(posts), + } + } - if r.status_code == 200: - post_response = r.json.get('response', {}) - posts = post_response.get('posts', []) + return HttpResponse(content=json.dumps(blog_data), status=200, + content_type="application/json") - if posts: - post = posts[0] - f_date = datetime.strptime(post['date'], '%Y-%m-%d %H:%M:%S %Z') - post['formated_date'] = f_date.strftime('%B %d, %Y') + else: + r = requests.get('{0}/posts?api_key={1}'.format(settings.TUMBLR_API_URL, + settings.TUMBLR_API_KEY)) + return HttpResponse(content=r.text, status=r.status_code, + content_type=r.headers['content-type']) - if settings.DISQUS_INTEGRATION_ENABLED: - post['disqus_enabled'] = True - path_to_here = os.path.abspath(os.path.dirname(__file__)) - f = open('{0}/static/templates/blog-post-{1}.html'.format(path_to_here, post['type']), 'r') - f_data = f.read() - f.close() +def blog_post(request, post_id): + context = dict() - compiler = Compiler() - template = compiler.compile(unicode(f_data)) - context['post_data'] = template(post) - context['post_title'] = post['title'] + if settings.BUILTIN_POST_ENABLED: + _post = get_object_or_404(models.Post,id=post_id,published=True) + post = dict() + post["id"] = _post.id + post["title"] = _post.title + post["formated_date"] = _post.publish_date.strftime('%B %d, %Y') + post["type"] = "text" + post["body"] = _post.text + post["tags"] = [tag.name for tag in _post.tags.all()] + else: + r = requests.get('{0}/posts?api_key={1}&id={2}'.format(settings.TUMBLR_API_URL, + settings.TUMBLR_API_KEY, post_id)) + if r.status_code != 200: + post = None + else: + posts = r.json.get('response', {}).get("posts",[]) + if not posts: + post = None + else: + post = posts[0] + tdate = datetime.strptime(post['date'], '%Y-%m-%d %H:%M:%S %Z') + post["formated_date"] = tdate.strftime('%B %d, %Y') + + if post: + if settings.DISQUS_INTEGRATION_ENABLED: + post['disqus_enabled'] = True + + path_to_here = os.path.abspath(os.path.dirname(__file__)) + f = open('{0}/static/templates/blog-post-{1}.html'.format(path_to_here, post['type']), 'r') + f_data = f.read() + f.close() + + compiler = Compiler() + print post + template = compiler.compile(unicode(f_data)) + context['post_data'] = template(post) + context['post_title'] = post['title'] return render(request, 'blog-post.html', context) @@ -142,6 +186,9 @@ def blog_post(request, post_id): def blog_tags(request, tag_slug): #Due to the issue with the tumblr api described below we will redirect to the #users tumblr tags page for now. + + if settings.BUILTIN_POST_ENABLED: + raise Http404 return redirect('http://{0}/tagged/{1}'.format( settings.TUMBLR_BLOG_URL, tag_slug)) @@ -233,4 +280,64 @@ def instagram_next(request, max_id): content_type=media_r.headers['content-type']) - +def post_slug(request, post_slug): + return blog_post(request, get_object_or_404(models.Post, published=True, slug=post_slug).id) + +@auth_decorator.logged_in_or_basicauth() +def adminindex(request): + return render(request, "admin.html", {"published_posts":models.Post.objects.filter(published=True).all(), + "draft_posts":models.Post.objects.filter(published=False).all()}) + +@auth_decorator.logged_in_or_basicauth() +def createpost(request): + if request.method == "POST": + title = request.POST.get("title","") + content = request.POST.get("content","") + + post = models.Post() + post.title = title + post.text = content + post.save() + return redirect("/admin/%s"%post.id) + + return render(request, "posteditor.html", {"post":None}) + +@auth_decorator.logged_in_or_basicauth() +def editpost(request, post_id): + post = get_object_or_404(models.Post,id=post_id) + + if request.method == "POST": + title = request.POST.get("title","") + content = request.POST.get("content","") + post.title = title + post.text = content + post.save() + + return render(request, "posteditor.html",{"post":post}) + +@auth_decorator.logged_in_or_basicauth() +def publishpost(request, post_id): + if not request.method == "POST": return redirect("/admin") + post = get_object_or_404(models.Post, id=post_id) + post.published = True + post.publish_date = datetime.now() + post.save() + return redirect("/admin/%s"%post.id) + +@auth_decorator.logged_in_or_basicauth() +def unpublishpost(request, post_id): + if not request.method == "POST": return redirect("/admin") + + post = get_object_or_404(models.Post, id=post_id) + post.published = False + post.publish_date = None + post.save() + return redirect("/admin/%s"%post.id) + +@auth_decorator.logged_in_or_basicauth() +def deletepost(request, post_id): + if not request.method == "POST": return redirect("/admin") + + post = get_object_or_404(models.Post, id=post_id) + post.delete() + return redirect("/admin") \ No newline at end of file