diff options
226 files changed, 28820 insertions, 0 deletions
diff --git a/comiccontrol/.htaccess b/comiccontrol/.htaccess new file mode 100644 index 0000000..1fa0056 --- /dev/null +++ b/comiccontrol/.htaccess @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + +#Disable rewriting +RewriteEngine Off + +</IfModule>
\ No newline at end of file diff --git a/comiccontrol/404.php b/comiccontrol/404.php new file mode 100644 index 0000000..94e8fbb --- /dev/null +++ b/comiccontrol/404.php @@ -0,0 +1 @@ +Page not found.
\ No newline at end of file diff --git a/comiccontrol/comiccontrol.css b/comiccontrol/comiccontrol.css new file mode 100644 index 0000000..60cf2a7 --- /dev/null +++ b/comiccontrol/comiccontrol.css @@ -0,0 +1,136 @@ +@charset "utf-8"; +/* CSS Document */ + + +body{ + font-family:Georgia, "Times New Roman", Times, serif; + width:1100px; + margin: 0 auto; +} +#logout{ + font-size:14px; + position:absolute; + right:0px; + bottom:20px; +} +#loginwrapper{ + width:430px; + margin: 0 auto; + margin-top:300px; + text-align:center; +} +.errorbox{ + padding:20px; + margin-bottom:20px; + text-align:center; + background:#ffa3a3; + border:1px solid #e24444; + color:#e24444; +} +.successbox{ + padding:20px; + margin-bottom:20px; + text-align:center; + background:#a3dd91; + border:1px solid #448031; + color:#448031; +} +label{ + width:200px; + float:left; + display:block; + height:30px; + text-align:right; +} +.forminput{ + margin-left:20px; + float:left; +} +.formline{ + height:40px; + clear:both; +} +#header{ + height: 90px; + font-size:70px; + margin-top:20px; + border-bottom: 1px solid #000000; + position:relative; + padding:0px; + margin-bottom:0px; +} +#menu{ + float:left; + width:200px; + padding:15px; +} +#content{ + padding:15px 0px 15px 15px; + width:854px; + float:left; + border-left: 1px dashed #000000; +} +h1{ + font-size:34px; +} +h2{ + border-bottom: 1px dashed #000; + padding-bottom:10px; +} +.line{ + height:10px; + width:100%; + border-top:1px solid #000000; +} +a{ + text-decoration:none; + color:#000000; +} +.blockborder{ + width:240px; + height:100px; + padding:20px; + border-right:1px dashed #000000; + text-align:center; + font-size:20px; + float:left; +} +.blocknoborder{ + width:240px; + height:100px; + padding:20px; + text-align:center; + font-size:20px; + float:left; +} +.ccbutton{ + padding:20px; + display:block; + margin: 0 auto; + border: 1px dashed black; + text-align:center; +} +.ccbuttoncont{ + padding-bottom:20px; + width:300px; + margin: 0 auto; +} +.formbox{ + padding:20px; + display:block; + margin: 0 auto; + margin-bottom:20px; + border: 1px dashed black; + text-align:center; + width:700px; +} +td{ + padding:7px; + border-bottom:1px dashed #000; +} +.dashtextwrap{ + padding:15px; + border:1px dashed #000; + margin-top:15px; + clear:both; +}
\ No newline at end of file diff --git a/comiccontrol/comicupload.php b/comiccontrol/comicupload.php new file mode 100644 index 0000000..a59ecbf --- /dev/null +++ b/comiccontrol/comicupload.php @@ -0,0 +1,149 @@ +<? + +if(authCheck()){ + +ini_set("memory_limit","512M"); +set_time_limit(60); + // make a note of the current working directory, relative to root. +$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); + + +//error handler +function error($error, $location, $seconds = 5) +{ + echo '<script type="text/javascript" lang="javascript">alert("'.$error.'");window.location="edit.php?do=add";</script>'; +} + + + +// make a note of the location of the upload form in case we need it +$uploadForm = $root . "edit.php?do=add"; + +// make a note of the location of the success page +$uploadSuccess = $root . "edit.php?do=add&upload=success"; + + +// Now let's deal with the upload + +// possible PHP upload errors +$errors = array(1 => 'php.ini max file size exceeded', + 2 => 'html form max file size exceeded', + 3 => 'file upload was only partial', + 4 => 'no file was attached'); + +// check the upload form was actually submitted else print the form +isset($_POST['submit']) + or error('the upload form is neaded', $uploadForm); + +// check for PHP's built-in uploading errors +($_FILES[$fieldname]['error'] == 0) + or error($errors[$_FILES[$fieldname]['error']], $uploadForm); + +// check that the file we are working on really was the subject of an HTTP upload +is_uploaded_file($_FILES[$fieldname]['tmp_name']) + or error('not an HTTP upload', $uploadForm); + +// validation... since this is an image upload script we should run a check +// to make sure the uploaded file is in fact an image. Here is a simple check: +// getimagesize() returns false if the file tested is not an image. +getimagesize($_FILES[$fieldname]['tmp_name']) + or error('only image uploads are allowed', $uploadForm); + + + +// make a unique filename for the uploaded file and check it is not already +// taken... if it is already taken keep trying until we find a vacant one +// sample filename: 1140732936-filename.jpg +$now = time(); + +// make a note of the directory that will recieve the uploaded file +$uploadsDirectory = '../comics/'; +while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])) +{ + $now++; +} + +if($usemaxwidth == "yes"){ + $w = $maxwidth; + $source = @imagecreatefromstring( + @file_get_contents($_FILES[$fieldname]['tmp_name'])) + or die('Not a valid image format.'); + $x = imagesx($source); + $y = imagesy($source); + $h = $y; + if($x > $w) { + $h = ($w/$x) * $y; + }else{ + $w=$x; + } + $slate = @imagecreatetruecolor($w, $h) + or die("Image too large"); + imagecopyresampled($slate, $source, 0, 0, 0, 0, $w, $h, $x, $y); + @imagejpeg($slate, $uploadFilename, 85) + or error('receiving directory insufficient permission', $uploadForm); + imagedestroy($slate); + imagedestroy($source); + $uploadReg = $now.'-'.$_FILES[$fieldname]['name']; +}else{ + copy($_FILES[$fieldname]['tmp_name'], $uploadFilename); + $uploadReg = $now.'-'.$_FILES[$fieldname]['name']; +} + + +// make a note of the directory that will recieve the uploaded file +$uploadsDirectory = '../comicsthumbs/'; +while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])) +{ + $now++; +} +$uploadThumb = $now.'-'.$_FILES[$fieldname]['name']; + +$w = $thumbwidth; +$h = $thumbheight; + +$source = @imagecreatefromstring( +@file_get_contents($_FILES[$fieldname]['tmp_name'])) +or die('Not a valid image format.'); +$x = imagesx($source); +$y = imagesy($source); +if($x > $w) { + if($y > $h){ + if(($x/$y)<=($w/$h)){ + $w = round(($h / $y) * $x); + $h = round(($h / $y) * $y); + }else{ + $h = round(($w/$x)*$y); + $w = round(($w/$x)*$x); + } + }else{ + $h = round(($w/$x)*$y); + } +}else{ + if($y > $h){ + $w = round(($h / $y) * $x); + }else{ + $w = $x; + $h = $y; + } +} +$slate = @imagecreatetruecolor($w, $h) +or die("Image too large"); +imagecopyresampled($slate, $source, 0, 0, 0, 0, $w, $h, $x, $y); +@imagejpeg($slate, $uploadFilename, 85) +or error('receiving directory insufficient permission', $uploadForm); +imagedestroy($slate); +imagedestroy($source); + + +// make a note of the directory that will recieve the uploaded file +$uploadsDirectory = '../comicshighres/'; +while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])) +{ + $now++; +} +move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename); +$uploadHighres = $now.'-'.$_FILES[$fieldname]['name']; + +} + +?>
\ No newline at end of file diff --git a/comiccontrol/custom.php b/comiccontrol/custom.php new file mode 100644 index 0000000..9eb92f9 --- /dev/null +++ b/comiccontrol/custom.php @@ -0,0 +1,3 @@ +<? + +?>
\ No newline at end of file diff --git a/comiccontrol/dbconfig.php b/comiccontrol/dbconfig.php new file mode 100644 index 0000000..9d20cad --- /dev/null +++ b/comiccontrol/dbconfig.php @@ -0,0 +1,14 @@ +<?php + +//DATABASE INFO +$dbhost = "localhost"; +$dbname = "database_main"; +$dblogin = "database_user"; +$dbpass = "password"; + + +//CONNECT TO DATABASE +$z = new mysqli($dbhost, $dblogin, $dbpass, $dbname); +$tableprefix = "prefix_"; + +?>
\ No newline at end of file diff --git a/comiccontrol/defaultstyles.css b/comiccontrol/defaultstyles.css new file mode 100644 index 0000000..9e0ec4d --- /dev/null +++ b/comiccontrol/defaultstyles.css @@ -0,0 +1,132 @@ +.cc-comic{ + margin: 0 auto; + margin-top: 0px; +} +.cc-comicbody{ + text-align:center; + margin: 0; + padding:0; +} +.cc-newsheader{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:24px; + font-weight:bold; +} +.cc-publishtime{ + padding-bottom:5px; + font-size:10px; +} +.cc-newsbody{ + padding:10px 0px; +} +.cc-transcript{ + padding:10px 0px; +} +.cc-tagline{ + padding:5px 0px; +} +.cc-commentlink{ + padding-top:10px; +} +.cc-commentheader{ + padding-top:10px; + font-weight:bold; + font-size:24px; +} +.cc-chapterrow{ + font-size:16px; + font-weight:bold; + padding:10px 0px; + border-bottom:1px solid #000; +} +.cc-chapterrow a{ + text-decoration:none; +} +.cc-searchheader{ + font-size:24px; + padding-bottom:10px; + font-weight:bold; +} +.cc-searchbox{ + width:200px; + padding:10px; + float:left; +} +.cc-searchbox a{ + text-decoration:none; +} +.cc-searchcomicname{ + text-align:center; + width:200px; + font-weight:bold; + padding-bottom:5px; +} +.cc-searchcomicimgbox{ + width:200px; + text-align:center; + height:200px; +} +.cc-searchcomicimgbox img{ + max-width:200px; + max-height:200px; + width:auto; + height:auto; +} +.cc-searchprevnext{ + padding:5px 0px; + text-align:center; + width:100%; + font-size:16px; +} +.cc-searchpages{ + padding:5px 0px; + text-align:center; + width:100%; + font-size:16px; +} +.cc-blogtitle{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:24px; + font-weight:bold; +} +.cc-blogpublishtime{ + padding-bottom:5px; + font-size:10px; +} +.cc-blogcontent{ + padding:10px 0px; +} +.cc-transcript{ + padding:10px 0px; +} +.cc-tagline{ + padding:5px 0px; +} +.cc-blogcommentlink{ + padding-top:10px; +} +.cc-blogcommentheader{ + padding-top:10px; + font-weight:bold; + font-size:24px; +} +.cc-postdivider{ + clear:both; + height:20px; +} +.cc-blogprevnext{ + padding:5px 0px; + text-align:center; + width:100%; + font-size:16px; +} +.cc-blogpages{ + padding:5px 0px; + text-align:center; + width:100%; + font-size:16px; +} +.cc-searchblogtitle{ + padding:10px; + border-bottom:1px solid #000; +}
\ No newline at end of file diff --git a/comiccontrol/draganddrop/cookies.js b/comiccontrol/draganddrop/cookies.js new file mode 100644 index 0000000..6e097b2 --- /dev/null +++ b/comiccontrol/draganddrop/cookies.js @@ -0,0 +1,34 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) + +based on http://www.quirksmode.org/js/cookies.html +*/ + +ToolMan._cookieOven = { + + set : function(name, value, expirationInDays) { + if (expirationInDays) { + var date = new Date() + date.setTime(date.getTime() + (expirationInDays * 24 * 60 * 60 * 1000)) + var expires = "; expires=" + date.toGMTString() + } else { + var expires = "" + } + document.cookie = name + "=" + value + expires + "; path=/" + }, + + get : function(name) { + var namePattern = name + "=" + var cookies = document.cookie.split(';') + for(var i = 0, n = cookies.length; i < n; i++) { + var c = cookies[i] + while (c.charAt(0) == ' ') c = c.substring(1, c.length) + if (c.indexOf(namePattern) == 0) + return c.substring(namePattern.length, c.length) + } + return null + }, + + eraseCookie : function(name) { + createCookie(name, "", -1) + } +} diff --git a/comiccontrol/draganddrop/coordinates.js b/comiccontrol/draganddrop/coordinates.js new file mode 100644 index 0000000..15e8d3e --- /dev/null +++ b/comiccontrol/draganddrop/coordinates.js @@ -0,0 +1,154 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ + +/* FIXME: assumes position styles are specified in 'px' */ + +ToolMan._coordinatesFactory = { + + create : function(x, y) { + // FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file + //if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y + return new _ToolManCoordinate(this, x, y) + }, + + origin : function() { + return this.create(0, 0) + }, + + /* + * FIXME: Safari 1.2, returns (0,0) on absolutely positioned elements + */ + topLeftPosition : function(element) { + var left = parseInt(ToolMan.css().readStyle(element, "left")) + var left = isNaN(left) ? 0 : left + var top = parseInt(ToolMan.css().readStyle(element, "top")) + var top = isNaN(top) ? 0 : top + + return this.create(left, top) + }, + + bottomRightPosition : function(element) { + return this.topLeftPosition(element).plus(this._size(element)) + }, + + topLeftOffset : function(element) { + var offset = this._offset(element) + + var parent = element.offsetParent + while (parent) { + offset = offset.plus(this._offset(parent)) + parent = parent.offsetParent + } + return offset + }, + + bottomRightOffset : function(element) { + return this.topLeftOffset(element).plus( + this.create(element.offsetWidth, element.offsetHeight)) + }, + + scrollOffset : function() { + if (window.pageXOffset) { + return this.create(window.pageXOffset, window.pageYOffset) + } else if (document.documentElement) { + return this.create( + document.body.scrollLeft + document.documentElement.scrollLeft, + document.body.scrollTop + document.documentElement.scrollTop) + } else if (document.body.scrollLeft >= 0) { + return this.create(document.body.scrollLeft, document.body.scrollTop) + } else { + return this.create(0, 0) + } + }, + + clientSize : function() { + if (window.innerHeight >= 0) { + return this.create(window.innerWidth, window.innerHeight) + } else if (document.documentElement) { + return this.create(document.documentElement.clientWidth, + document.documentElement.clientHeight) + } else if (document.body.clientHeight >= 0) { + return this.create(document.body.clientWidth, + document.body.clientHeight) + } else { + return this.create(0, 0) + } + }, + + /** + * mouse coordinate relative to the window (technically the + * browser client area) i.e. the part showing your page + * + * NOTE: in Safari the coordinate is relative to the document + */ + mousePosition : function(event) { + event = ToolMan.events().fix(event) + return this.create(event.clientX, event.clientY) + }, + + /** + * mouse coordinate relative to the document + */ + mouseOffset : function(event) { + event = ToolMan.events().fix(event) + if (event.pageX >= 0 || event.pageX < 0) { + return this.create(event.pageX, event.pageY) + } else if (event.clientX >= 0 || event.clientX < 0) { + return this.mousePosition(event).plus(this.scrollOffset()) + } + }, + + _size : function(element) { + /* TODO: move to a Dimension class */ + return this.create(element.offsetWidth, element.offsetHeight) + }, + + _offset : function(element) { + return this.create(element.offsetLeft, element.offsetTop) + } +} + +function _ToolManCoordinate(factory, x, y) { + this.factory = factory + this.x = isNaN(x) ? 0 : x + this.y = isNaN(y) ? 0 : y +} + +_ToolManCoordinate.prototype = { + toString : function() { + return "(" + this.x + "," + this.y + ")" + }, + + plus : function(that) { + return this.factory.create(this.x + that.x, this.y + that.y) + }, + + minus : function(that) { + return this.factory.create(this.x - that.x, this.y - that.y) + }, + + min : function(that) { + return this.factory.create( + Math.min(this.x , that.x), Math.min(this.y , that.y)) + }, + + max : function(that) { + return this.factory.create( + Math.max(this.x , that.x), Math.max(this.y , that.y)) + }, + + constrainTo : function (one, two) { + var min = one.min(two) + var max = one.max(two) + + return this.max(min).min(max) + }, + + distance : function (that) { + return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2)) + }, + + reposition : function(element) { + element.style["top"] = this.y + "px" + element.style["left"] = this.x + "px" + } +} diff --git a/comiccontrol/draganddrop/core.js b/comiccontrol/draganddrop/core.js new file mode 100644 index 0000000..494b9ec --- /dev/null +++ b/comiccontrol/draganddrop/core.js @@ -0,0 +1,170 @@ +/* +Copyright (c) 2005 Tim Taylor Consulting <http://tool-man.org/> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +*/ + +var ToolMan = { + events : function() { + if (!ToolMan._eventsFactory) throw "ToolMan Events module isn't loaded"; + return ToolMan._eventsFactory + }, + + css : function() { + if (!ToolMan._cssFactory) throw "ToolMan CSS module isn't loaded"; + return ToolMan._cssFactory + }, + + coordinates : function() { + if (!ToolMan._coordinatesFactory) throw "ToolMan Coordinates module isn't loaded"; + return ToolMan._coordinatesFactory + }, + + drag : function() { + if (!ToolMan._dragFactory) throw "ToolMan Drag module isn't loaded"; + return ToolMan._dragFactory + }, + + dragsort : function() { + if (!ToolMan._dragsortFactory) throw "ToolMan DragSort module isn't loaded"; + return ToolMan._dragsortFactory + }, + + helpers : function() { + return ToolMan._helpers + }, + + cookies : function() { + if (!ToolMan._cookieOven) throw "ToolMan Cookie module isn't loaded"; + return ToolMan._cookieOven + }, + + junkdrawer : function() { + return ToolMan._junkdrawer + } + +} + +ToolMan._helpers = { + map : function(array, func) { + for (var i = 0, n = array.length; i < n; i++) func(array[i]) + }, + + nextItem : function(item, nodeName) { + if (item == null) return + var next = item.nextSibling + while (next != null) { + if (next.nodeName == nodeName) return next + next = next.nextSibling + } + return null + }, + + previousItem : function(item, nodeName) { + var previous = item.previousSibling + while (previous != null) { + if (previous.nodeName == nodeName) return previous + previous = previous.previousSibling + } + return null + }, + + moveBefore : function(item1, item2) { + var parent = item1.parentNode + parent.removeChild(item1) + parent.insertBefore(item1, item2) + }, + + moveAfter : function(item1, item2) { + var parent = item1.parentNode + parent.removeChild(item1) + parent.insertBefore(item1, item2 ? item2.nextSibling : null) + } +} + +/** + * scripts without a proper home + * + * stuff here is subject to change unapologetically and without warning + */ +ToolMan._junkdrawer = { + serializeList : function(list) { + var items = list.getElementsByTagName("li") + var array = new Array() + for (var i = 0, n = items.length; i < n; i++) { + var item = items[i] + + array.push(item.id) + } + return array; + }, + + inspectListOrder : function(id) { + alert(ToolMan.junkdrawer().serializeList(document.getElementById(id))) + }, + + restoreListOrder : function(listID) { + var list = document.getElementById(listID) + if (list == null) return + + var cookie = ToolMan.cookies().get("list-" + listID) + if (!cookie) return; + + var IDs = cookie.split('|') + var items = ToolMan.junkdrawer()._itemsByID(list) + + for (var i = 0, n = IDs.length; i < n; i++) { + var itemID = IDs[i] + if (itemID in items) { + var item = items[itemID] + list.removeChild(item) + list.insertBefore(item, null) + } + } + }, + + _identifier : function(item) { + var trim = ToolMan.junkdrawer().trim + var identifier + + identifier = trim(item.getAttribute("id")) + if (identifier != null && identifier.length > 0) return identifier; + + identifier = trim(item.getAttribute("itemID")) + if (identifier != null && identifier.length > 0) return identifier; + + // FIXME: strip out special chars or make this an MD5 hash or something + return trim(item.innerHTML) + }, + + _itemsByID : function(list) { + var array = new Array() + var items = list.getElementsByTagName('li') + for (var i = 0, n = items.length; i < n; i++) { + var item = items[i] + array[ToolMan.junkdrawer()._identifier(item)] = item + } + return array + }, + + trim : function(text) { + if (text == null) return null + return text.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2') + } +} diff --git a/comiccontrol/draganddrop/css.js b/comiccontrol/draganddrop/css.js new file mode 100644 index 0000000..9ffe0a0 --- /dev/null +++ b/comiccontrol/draganddrop/css.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ + +// TODO: write unit tests +ToolMan._cssFactory = { + readStyle : function(element, property) { + if (element.style[property]) { + return element.style[property] + } else if (element.currentStyle) { + return element.currentStyle[property] + } else if (document.defaultView && document.defaultView.getComputedStyle) { + var style = document.defaultView.getComputedStyle(element, null) + return style.getPropertyValue(property) + } else { + return null + } + } +} diff --git a/comiccontrol/draganddrop/drag.js b/comiccontrol/draganddrop/drag.js new file mode 100644 index 0000000..861c7ea --- /dev/null +++ b/comiccontrol/draganddrop/drag.js @@ -0,0 +1,235 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ + +ToolMan._dragFactory = { + createSimpleGroup : function(element, handle) { + handle = handle ? handle : element + var group = this.createGroup(element) + group.setHandle(handle) + group.transparentDrag() + group.onTopWhileDragging() + return group + }, + + createGroup : function(element) { + var group = new _ToolManDragGroup(this, element) + + var position = ToolMan.css().readStyle(element, 'position') + if (position == 'static') { + element.style["position"] = 'relative' + } else if (position == 'absolute') { + /* for Safari 1.2 */ + ToolMan.coordinates().topLeftOffset(element).reposition(element) + } + + // TODO: only if ToolMan.isDebugging() + group.register('draginit', this._showDragEventStatus) + group.register('dragmove', this._showDragEventStatus) + group.register('dragend', this._showDragEventStatus) + + return group + }, + + _showDragEventStatus : function(dragEvent) { + window.status = dragEvent.toString() + }, + + constraints : function() { + return this._constraintFactory + }, + + _createEvent : function(type, event, group) { + return new _ToolManDragEvent(type, event, group) + } +} + +function _ToolManDragGroup(factory, element) { + this.factory = factory + this.element = element + this._handle = null + this._thresholdDistance = 0 + this._transforms = new Array() + // TODO: refactor into a helper object, move into events.js + this._listeners = new Array() + this._listeners['draginit'] = new Array() + this._listeners['dragstart'] = new Array() + this._listeners['dragmove'] = new Array() + this._listeners['dragend'] = new Array() +} + +_ToolManDragGroup.prototype = { + /* + * TODO: + * - unregister(type, func) + * - move custom event listener stuff into Event library + * - keyboard nudging of "selected" group + */ + + setHandle : function(handle) { + var events = ToolMan.events() + + handle.toolManDragGroup = this + events.register(handle, 'mousedown', this._dragInit) + handle.onmousedown = function() { return false } + + if (this.element != handle) + events.unregister(this.element, 'mousedown', this._dragInit) + }, + + register : function(type, func) { + this._listeners[type].push(func) + }, + + addTransform : function(transformFunc) { + this._transforms.push(transformFunc) + }, + + verticalOnly : function() { + this.addTransform(this.factory.constraints().vertical()) + }, + + horizontalOnly : function() { + this.addTransform(this.factory.constraints().horizontal()) + }, + + setThreshold : function(thresholdDistance) { + this._thresholdDistance = thresholdDistance + }, + + transparentDrag : function(opacity) { + var opacity = typeof(opacity) != "undefined" ? opacity : 0.75; + var originalOpacity = ToolMan.css().readStyle(this.element, "opacity") + + this.register('dragstart', function(dragEvent) { + var element = dragEvent.group.element + element.style.opacity = opacity + element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')' + }) + this.register('dragend', function(dragEvent) { + var element = dragEvent.group.element + element.style.opacity = originalOpacity + element.style.filter = 'alpha(opacity=100)' + }) + }, + + onTopWhileDragging : function(zIndex) { + var zIndex = typeof(zIndex) != "undefined" ? zIndex : 100000; + var originalZIndex = ToolMan.css().readStyle(this.element, "z-index") + + this.register('dragstart', function(dragEvent) { + dragEvent.group.element.style.zIndex = zIndex + }) + this.register('dragend', function(dragEvent) { + dragEvent.group.element.style.zIndex = originalZIndex + }) + }, + + _dragInit : function(event) { + event = ToolMan.events().fix(event) + var group = document.toolManDragGroup = this.toolManDragGroup + var dragEvent = group.factory._createEvent('draginit', event, group) + + group._isThresholdExceeded = false + group._initialMouseOffset = dragEvent.mouseOffset + group._grabOffset = dragEvent.mouseOffset.minus(dragEvent.topLeftOffset) + ToolMan.events().register(document, 'mousemove', group._drag) + document.onmousemove = function() { return false } + ToolMan.events().register(document, 'mouseup', group._dragEnd) + + group._notifyListeners(dragEvent) + }, + + _drag : function(event) { + event = ToolMan.events().fix(event) + var coordinates = ToolMan.coordinates() + var group = this.toolManDragGroup + if (!group) return + var dragEvent = group.factory._createEvent('dragmove', event, group) + + var newTopLeftOffset = dragEvent.mouseOffset.minus(group._grabOffset) + + // TODO: replace with DragThreshold object + if (!group._isThresholdExceeded) { + var distance = + dragEvent.mouseOffset.distance(group._initialMouseOffset) + if (distance < group._thresholdDistance) return + group._isThresholdExceeded = true + group._notifyListeners( + group.factory._createEvent('dragstart', event, group)) + } + + for (i in group._transforms) { + var transform = group._transforms[i] + newTopLeftOffset = transform(newTopLeftOffset, dragEvent) + } + + var dragDelta = newTopLeftOffset.minus(dragEvent.topLeftOffset) + var newTopLeftPosition = dragEvent.topLeftPosition.plus(dragDelta) + newTopLeftPosition.reposition(group.element) + dragEvent.transformedMouseOffset = newTopLeftOffset.plus(group._grabOffset) + + group._notifyListeners(dragEvent) + + var errorDelta = newTopLeftOffset.minus(coordinates.topLeftOffset(group.element)) + if (errorDelta.x != 0 || errorDelta.y != 0) { + coordinates.topLeftPosition(group.element).plus(errorDelta).reposition(group.element) + } + }, + + _dragEnd : function(event) { + event = ToolMan.events().fix(event) + var group = this.toolManDragGroup + var dragEvent = group.factory._createEvent('dragend', event, group) + + group._notifyListeners(dragEvent) + + this.toolManDragGroup = null + ToolMan.events().unregister(document, 'mousemove', group._drag) + document.onmousemove = null + ToolMan.events().unregister(document, 'mouseup', group._dragEnd) + }, + + _notifyListeners : function(dragEvent) { + var listeners = this._listeners[dragEvent.type] + for (i in listeners) { + listeners[i](dragEvent) + } + } +} + +function _ToolManDragEvent(type, event, group) { + this.type = type + this.group = group + this.mousePosition = ToolMan.coordinates().mousePosition(event) + this.mouseOffset = ToolMan.coordinates().mouseOffset(event) + this.transformedMouseOffset = this.mouseOffset + this.topLeftPosition = ToolMan.coordinates().topLeftPosition(group.element) + this.topLeftOffset = ToolMan.coordinates().topLeftOffset(group.element) +} + +_ToolManDragEvent.prototype = { + toString : function() { + return "mouse: " + this.mousePosition + this.mouseOffset + " " + + "xmouse: " + this.transformedMouseOffset + " " + + "left,top: " + this.topLeftPosition + this.topLeftOffset + } +} + +ToolMan._dragFactory._constraintFactory = { + vertical : function() { + return function(coordinate, dragEvent) { + var x = dragEvent.topLeftOffset.x + return coordinate.x != x + ? coordinate.factory.create(x, coordinate.y) + : coordinate + } + }, + + horizontal : function() { + return function(coordinate, dragEvent) { + var y = dragEvent.topLeftOffset.y + return coordinate.y != y + ? coordinate.factory.create(coordinate.x, y) + : coordinate + } + } +} diff --git a/comiccontrol/draganddrop/dragsort.js b/comiccontrol/draganddrop/dragsort.js new file mode 100644 index 0000000..2886c62 --- /dev/null +++ b/comiccontrol/draganddrop/dragsort.js @@ -0,0 +1,87 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ + +ToolMan._dragsortFactory = { + makeSortable : function(item) { + var group = ToolMan.drag().createSimpleGroup(item) + + group.register('dragstart', this._onDragStart) + group.register('dragmove', this._onDragMove) + group.register('dragend', this._onDragEnd) + + return group + }, + + /** + * Iterates over a list's items, making them sortable, applying + * optional functions to each item. + * + * example: makeListSortable(myList, myFunc1, myFunc2, ... , myFuncN) + */ + makeListSortable : function(list) { + var helpers = ToolMan.helpers() + var coordinates = ToolMan.coordinates() + var items = list.getElementsByTagName("li") + + helpers.map(items, function(item) { + var dragGroup = dragsort.makeSortable(item) + dragGroup.setThreshold(4) + var min, max + dragGroup.addTransform(function(coordinate, dragEvent) { + return coordinate.constrainTo(min, max) + }) + dragGroup.register('dragstart', function() { + var items = list.getElementsByTagName("li") + min = max = coordinates.topLeftOffset(items[0]) + for (var i = 1, n = items.length; i < n; i++) { + var offset = coordinates.topLeftOffset(items[i]) + min = min.min(offset) + max = max.max(offset) + } + }) + }) + for (var i = 1, n = arguments.length; i < n; i++) + helpers.map(items, arguments[i]) + }, + + _onDragStart : function(dragEvent) { + }, + + _onDragMove : function(dragEvent) { + var helpers = ToolMan.helpers() + var coordinates = ToolMan.coordinates() + + var item = dragEvent.group.element + var xmouse = dragEvent.transformedMouseOffset + var moveTo = null + + var previous = helpers.previousItem(item, item.nodeName) + while (previous != null) { + var bottomRight = coordinates.bottomRightOffset(previous) + if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) { + moveTo = previous + } + previous = helpers.previousItem(previous, item.nodeName) + } + if (moveTo != null) { + helpers.moveBefore(item, moveTo) + return + } + + var next = helpers.nextItem(item, item.nodeName) + while (next != null) { + var topLeft = coordinates.topLeftOffset(next) + if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) { + moveTo = next + } + next = helpers.nextItem(next, item.nodeName) + } + if (moveTo != null) { + helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName)) + return + } + }, + + _onDragEnd : function(dragEvent) { + ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element) + } +} diff --git a/comiccontrol/draganddrop/events.js b/comiccontrol/draganddrop/events.js new file mode 100644 index 0000000..90b2058 --- /dev/null +++ b/comiccontrol/draganddrop/events.js @@ -0,0 +1,43 @@ +/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ + +ToolMan._eventsFactory = { + fix : function(event) { + if (!event) event = window.event + + if (event.target) { + if (event.target.nodeType == 3) event.target = event.target.parentNode + } else if (event.srcElement) { + event.target = event.srcElement + } + + return event + }, + + register : function(element, type, func) { + if (element.addEventListener) { + element.addEventListener(type, func, false) + } else if (element.attachEvent) { + if (!element._listeners) element._listeners = new Array() + if (!element._listeners[type]) element._listeners[type] = new Array() + var workaroundFunc = function() { + func.apply(element, new Array()) + } + element._listeners[type][func] = workaroundFunc + element.attachEvent('on' + type, workaroundFunc) + } + }, + + unregister : function(element, type, func) { + if (element.removeEventListener) { + element.removeEventListener(type, func, false) + } else if (element.detachEvent) { + if (element._listeners + && element._listeners[type] + && element._listeners[type][func]) { + + element.detachEvent('on' + type, + element._listeners[type][func]) + } + } + } +} diff --git a/comiccontrol/edit.php b/comiccontrol/edit.php new file mode 100644 index 0000000..7cdb703 --- /dev/null +++ b/comiccontrol/edit.php @@ -0,0 +1,38 @@ +<? +//edit.php +//Initializes edit page script and directs to proper edit script based on page type + +//invoke header +include('includes/header.php'); + +//module is not selected +if($moduleid == "") +{ + echo $lang['pagetoedit']; +} + +//module is selected +else +{ + + //include proper script based on module type + $query="SELECT * FROM cc_".$tableprefix."modules where id='".$moduleid."' LIMIT 1"; + $module = fetch($query); + echo '<h1><a href="edit.php?moduleid=' . $module['id'] . '">' . $module['title'] . '</a></h1><div class="line"></div>'; + switch($module['type']) + { + case "page": + include("editpage.php"); + break; + case "gallery": + include("editgallery.php"); + break; + case "comic": + include("editcomic.php"); + break; + case "blog": + include("editblog.php"); + break; + } +} +include('includes/footer.php'); ?>
\ No newline at end of file diff --git a/comiccontrol/editblog.php b/comiccontrol/editblog.php new file mode 100644 index 0000000..8a8d71c --- /dev/null +++ b/comiccontrol/editblog.php @@ -0,0 +1,435 @@ +<? +//editblog.php +//Blog editing script +//Handles adding, editing, and deleting blog posts + +if(authCheck()){ + +//A post is selected for editing/action +if($do != "") +{ + //Figure out type of action enacted + switch($do) + { + //Deletion of post script + case "del": + + echo '<h2>' . $lang['deleteblogpost'] . '</h2>'; + + if(isset($_GET['blogid'])){ + $blogid = filterint($_GET['blogid']); + + //delete if form properly submitted, return to blog if not + if(isset($_POST['q']) && $_POST['q'] != "") + { + $query="DELETE FROM cc_" . $tableprefix . "blogs WHERE id='". $blogid ."' LIMIT 1"; + $z->query($query); + echo '<div class="successbox">' . $lang['postdeleted'] . '</div><div ><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addnewpost'] . '</div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + + //otherwise ask if you want to delete post + else{ + echo '<p style="text-align:center">' . $lang['wanttodeletepost'] . '</p><form method="post" do="edit.php?moduleid=' . $moduleid . '&do=del&blogid=' . $blogid . '"><p style="text-align:center"><input type="submit" name="q" value="' . $lang['yes'] . '" /><input type="button" value="' . $lang['no'] . '" onclick="self.location=\'edit.php?moduleid=' . $moduleid . '\'" /></p> + <p><br /></p></form>'; + } + } + + //Handle case for no post selected + else{ + echo '<p>' . $lang['nopostselected'] . '</p><div ><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addnewpost'] . '</div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + break; + + //Post editing script + case "ed": + + //display header + echo '<h2>' . $lang['editblogpost'] . '</h2>'; + + //check if blog post selected + if(isset($_GET['blogid'])){ + + //sanitize blog id + $blogid = filterint($_GET['blogid']); + + + //get comic info + $query = "SELECT * FROM `cc_" . $tableprefix . "blogs` WHERE blog='" . $module['id'] . "' AND id='" . $blogid . "' LIMIT 1"; + $result = $z->query($query); + $blogpost = $result->fetch_assoc(); + + //If submitted, change info for post + if(isset($_POST['submit'])) + { + $sValue = sanitize( $_POST['content'] ) ; + $title = sanitizeText( $_POST['title'] ) ; + $theDate = $_POST['publishyear'] . "-" . $_POST['publishmonth'] . "-" . $_POST['publishday'] . " " . $_POST['publishhour'] . ":" . $_POST['publishminute']; + $publishtime = strtotime($theDate); + + //create slug + $slug = preg_replace("/[^A-Za-z0-9 ]/", "", $title); + $slug = str_replace(" ","-",$slug); + $slug = str_replace("--","-",$slug); + $slug = strtolower($slug); + $slugfinal = $slug; + $slugcount = 2; + $query = "SELECT * FROM `cc_" . $tableprefix . "blogs` WHERE blog='" . $module['id'] . "' AND slug='" . $slugfinal . "' AND id!='" . $blogpost['id'] . "' LIMIT 1"; + $result = $z->query($query); + while($result->num_rows > 0 || $slugfinal=="page" || $slugfinal=="search"){ + $slugfinal = $slug . "-" . $slugcount; + $slugcount++; + $query = "SELECT * FROM `cc_" . $tableprefix . "blogs` WHERE blog='" . $module['id'] . "' AND slug='" . $slugfinal . "' LIMIT 1"; + $result = $z->query($query); + } + + $query="UPDATE cc_" . $tableprefix . "blogs SET content='". $sValue ."',title='". $title . "',publishtime='" . $publishtime . "',slug='" . $slugfinal . "' WHERE id='". $blogid . "'"; + $result=$z->query($query); + + //delete existing tags and insert new ones + $query = "DELETE FROM cc_".$tableprefix . "blogs_tags WHERE blogid='" . $blogpost['id'] . "' AND blog='" . $module['id'] . "'"; + $z->query($query); + $tags = str_replace(", ",",",$_POST['tags']); + $tags = explode(",",$tags); + foreach($tags as $value){ + if($value != ""){ + $value = sanitizeText($value); + $value = trim($value); + $query = "INSERT INTO cc_".$tableprefix . "blogs_tags(blog,blogid,tag,publishtime) VALUES('" . $blogpost['blog'] . "','" . $blogid . "','" . $value . "','" . $publishtime . "')"; + $z->query($query); + } + } + + echo '<div class="successbox">' . $lang['postedited'] . '</div>'; + ?> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$siteroot?><?=$module['slug']?>/<?=$blogpost['slug']?>"><?=$lang['clicktopreview']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addnewpost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=ed&blogid=<?=$blogid?>"><?=$lang['editthispost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + <? + } + + + + //SHOW BLOG POST EDIT FORM + else{ + //get blog info + $query = "SELECT * FROM cc_".$tableprefix . "blogs WHERE blog='" . $module['id'] . "' AND id='" . $blogid . "' LIMIT 1"; + $result = $z->query($query); + $blogpost = $result->fetch_assoc(); + + //display form box ?> + <form name="editpost" do="edit.php?moduleid=<?=$moduleid?>&do=ed&blogid=<?=$blogpost['id']?>" method="post"><div class="formbox"> + + <? //display time dropdowns ?> + <? // set number of days in month with javascript ?> + <script> + function daysInMonth(month,year) { + return new Date(year, month, 0).getDate(); + } + function updateDays(){ + var f = document.forms[0]; + if(f.publishyear.value != "" && f.publishmonth.value != ""){ + var codes = ""; + var addit = ""; + var numdays = daysInMonth(f.publishmonth.value,f.publishyear.value); + for(i=1;i<=numdays;i++){ + addit = '<option value="' + i + '">' + i + '</option>'; + codes += addit; + } + f.publishday.innerHTML = codes; + } + } + </script> + + <div class="formline"><div class="forminput"><?=$lang['publishdate']?>:</div><div class="forminput"> + <select name="publishyear" onChange="updateDays()"> + <? + $year = 1996; + while($year != (date('Y',time())+4)){ + echo '<option value="' . $year . '"'; + if(date('Y',$blogpost['publishtime']) == sprintf('%02d', $year)) echo ' SELECTED'; + echo '>' . $year . '</option>'; + $year++; + } + ?> + </select> + <select name="publishmonth" onChange="updateDays()"> + <? + $month = 1; + while($month < 13){ + echo '<option value="' . $month . '"'; + if(date('n',$blogpost['publishtime']) == $month) echo ' SELECTED'; + echo '>' . date('F', mktime(0, 0, 0, $month, 10)) . '</option>'; + $month++; + } + ?> + </select> + <select name="publishday"> + <? + $day = 1; + $numdays = date("t",$blogpost['publishtime']); + while($day <= $numdays){ + echo '<option value="' . $day . '"'; + if(date('j',$blogpost['publishtime']) == $day) echo ' SELECTED'; + echo '>' . $day . '</option>'; + $day++; + } + ?> + </select></div> + <div class="forminput"> <?=$lang['publishtime']?> (<?=$timezoneshort?>): </div><div class="forminput"> + <select name="publishhour"> + <? + $hour = 0; + while($hour != 24){ + echo '<option value="' . $hour . '"'; + if(date('H',$blogpost['publishtime']) == sprintf('%02d', $hour)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $hour) . '</option>'; + $hour++; + } + ?> + </select>: + <select name="publishminute"> + <? + $minute = 0; + while($minute != 60){ + echo '<option value="' . $minute . '"'; + if(date('i',$blogpost['publishtime']) == sprintf('%02d', $minute)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $minute) . '</option>'; + $minute++; + } + ?> + </select> + </div> + </div> + + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['title']?>:</label><div class="forminput"><input type="text" name="title" style="width:400px;" value="<?=$blogpost['title']?>" /></div></div> + <div class="formline"><label><?=$lang['tagssepbycomma']?>:</label><div class="forminput"><input type="text" name="tags" style="width:400px;" value="<? + $query = "SELECT * FROM cc_" . $tableprefix . "blogs_tags WHERE blog='" . $module['id'] . "' AND blogid='" . $blogpost['id'] . "'"; + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + echo $row['tag'] . ","; + } + ?>" /></div></div> + <p><?=$lang['content']?>:<br /><br /> + <textarea name="content"><?=$blogpost['content'];?></textarea> + <p style="text-align:center;"><input type="submit" id="submitted" name="submit" value="<?=$lang['submit']?>" /><br /></p> + </div><div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$siteroot?><?=$module['slug']?>/<?=$blogpost['slug']?>"><?=$lang['clicktopreview']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addnewpost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + </form> + <? + } + } + break; + + //Post addition script + case "add": + + //display header + echo '<h2>' . $lang['addnewblogpost'] . '</h2>'; + + //If submitted, add post to database + if(isset($_POST['submit'])) + { + $sValue = sanitize( $_POST['content'] ) ; + $title = sanitizeText( $_POST['title'] ) ; + $theDate = $_POST['publishyear'] . "-" . $_POST['publishmonth'] . "-" . $_POST['publishday'] . " " . $_POST['publishhour'] . ":" . $_POST['publishminute']; + $publishtime = strtotime($theDate); + + //create slug + $slug = preg_replace("/[^A-Za-z0-9 ]/", "", $title); + $slug = str_replace(" ","-",$slug); + $slug = str_replace("--","-",$slug); + $slug = strtolower($slug); + $slugfinal = $slug; + $slugcount = 2; + $query = "SELECT * FROM `cc_" . $tableprefix . "blogs` WHERE blog='" . $module['id'] . "' AND slug='" . $slugfinal . "' AND id!='" . $blogpost['id'] . "' LIMIT 1"; + $result = $z->query($query); + while($result->num_rows > 0 || $slugfinal == "page" || $slugfinal=="search"){ + $slugfinal = $slug . "-" . $slugcount; + $slugcount++; + $query = "SELECT * FROM `cc_" . $tableprefix . "blogs` WHERE blog='" . $module['id'] . "' AND slug='" . $slugfinal . "' LIMIT 1"; + $result = $z->query($query); + } + + $query="INSERT INTO cc_" . $tableprefix . "blogs(blog,content,title,publishtime,slug) VALUES('" . $module['id'] . "','" . $sValue . "','" . $title . "','" . $publishtime . "','" . $slug . "')"; + $result=$z->query($query); + $newid=$z->insert_id; + + //create comment id and update table + $commentid = $module['slug'] . '-' . $newid; + $query="UPDATE cc_" . $tableprefix . "blogs SET commentid='" . $commentid . "' WHERE id='" . $newid . "'"; + $z->query($query); + + //insert new tags + $tags = str_replace(", ",",",$_POST['tags']); + $tags = explode(",",$tags); + foreach($tags as $value){ + if($value != ""){ + $value = sanitizeText($value); + $value = trim($value); + $query = "INSERT INTO cc_".$tableprefix . "blogs_tags(blog,blogid,tag,publishtime) VALUES('" . $module['id'] . "','" . $newid . "','" . $value . "','" . $publishtime . "')"; + $z->query($query); + } + } + + echo '<div class="successbox">' . $lang['postadded'] . '</div>'; + ?> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$siteroot?><?=$module['slug']?>/<?=$slugfinal?>"><?=$lang['clicktopreview']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addnewpost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=ed&blogid=<?=$newid?>"><?=$lang['editthispost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + <? + } + + + + //SHOW BLOG POST ADD FORM + else{ + + //display form box ?> + <form name="addpost" do="edit.php?moduleid=<?=$moduleid?>&do=add" method="post"><div class="formbox"> + + <? //display time dropdowns ?> + <? // set number of days in month with javascript ?> + <script> + function daysInMonth(month,year) { + return new Date(year, month, 0).getDate(); + } + function updateDays(){ + var f = document.forms[0]; + if(f.publishyear.value != "" && f.publishmonth.value != ""){ + var codes = ""; + var addit = ""; + var numdays = daysInMonth(f.publishmonth.value,f.publishyear.value); + for(i=1;i<=numdays;i++){ + addit = '<option value="' + i + '">' + i + '</option>'; + codes += addit; + } + f.publishday.innerHTML = codes; + } + } + </script> + + <div class="formline"><div class="forminput"><?=$lang['publishdate']?>:</div><div class="forminput"> + <select name="publishyear" onChange="updateDays()"> + <? + $year = 1996; + while($year != (date('Y',time())+4)){ + echo '<option value="' . $year . '"'; + if(date('Y',time()) == sprintf('%02d', $year)) echo ' SELECTED'; + echo '>' . $year . '</option>'; + $year++; + } + ?> + </select> + <select name="publishmonth" onChange="updateDays()"> + <? + $month = 1; + while($month < 13){ + echo '<option value="' . $month . '"'; + if(date('n',time()) == $month) echo ' SELECTED'; + echo '>' . date('F', mktime(0, 0, 0, $month, 10)) . '</option>'; + $month++; + } + ?> + </select> + <select name="publishday"> + <? + $day = 1; + $numdays = date("t",time()); + while($day <= $numdays){ + echo '<option value="' . $day . '"'; + if(date('j',time()) == $day) echo ' SELECTED'; + echo '>' . $day . '</option>'; + $day++; + } + ?> + </select></div> + <div class="forminput"> <?=$lang['publishtime']?> (<?=$timezoneshort?>): </div><div class="forminput"> + <select name="publishhour"> + <? + $hour = 0; + while($hour != 24){ + echo '<option value="' . $hour . '"'; + if(date('H',time()) == sprintf('%02d', $hour)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $hour) . '</option>'; + $hour++; + } + ?> + </select>: + <select name="publishminute"> + <? + $minute = 0; + while($minute != 60){ + echo '<option value="' . $minute . '"'; + if(date('i',time()) == sprintf('%02d', $minute)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $minute) . '</option>'; + $minute++; + } + ?> + </select> + </div> + </div> + + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['title']?>:</label><div class="forminput"><input type="text" name="title" style="width:400px;" /></div></div> + <div class="formline"><label><?=$lang['tagssepbycomma']?>:</label><div class="forminput"><input type="text" name="tags" style="width:400px;" /></div></div> + <p><?=$lang['content']?>:<br /><br /> + <textarea name="content"></textarea> + <p style="text-align:center;"><input type="submit" id="submitted" name="submit" value="<?=$lang['submit']?>" /><br /></p> + </div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addnewpost']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + </form> + <? + } + break; + }//switch +}//action + +//If no action selected, display list of blog posts +else{ + //Select blog posts to show (1-20) + if(isset($_GET['dp'])) $dp=filterint($_GET['dp']); + else $dp=1; + $ds =(($dp-1)*20); + $query="SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $moduleid . "' ORDER BY publishtime DESC LIMIT ". $ds .",20"; + $result=$z->query($query); + $numposts=$result->num_rows; + + //Handle case for no posts + if($numposts == 0) echo '<p>' . $lang['noblogposts'] . '</p>'; + + //Display list of posts + else{ + + echo '<p>' . $lang['postlist'] . '</p><table border="0">'; + while($row=$result->fetch_assoc()){ + echo '<tr><td>' . date("Y-m-d g:i:s",$row['publishtime']) . '</td><td width="470px">' . $row['title'] . '</td><td><a href="' . $siteroot . $module['slug'] .'/'.$row['slug'].'">' .$lang['preview']. '</a></td><td><a href="?moduleid=' . $moduleid . '&do=ed&blogid=' . $row['id'] . '">Edit</a></td><td><a href="?moduleid=' . $moduleid . '&do=del&blogid=' . $row['id'] . '">Delete</a></td></tr>'; + } + echo '</table>'; + + //Prev/next page + $query="SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $moduleid . "'"; + $result=$z->query($query); + $numposts=$result->num_rows; + $pagecount = ($numposts/20); + if($numposts%20!=0 && $numposts > 20) $pagecount++; + if($pagecount > 1) + { + $count = 1; + echo '<div class="dashtextwrap">' . $lang['page']; + while($count <= $pagecount){ + echo ' '; + if($count!=$dp) echo '<a href="edit.php?moduleid=' . $moduleid . '&dp=' . $count . '">'; + else echo '<span style="font-weight:bold;">'; + echo $count . ' '; + if($count!=$dp) echo '</a>'; + else echo '</span>'; + $count++; + } + echo '</div>'; + } + } + + //Add post link + echo '<div style="height:15px;"></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addnewpost'] . '</a></div></div>'; +}//no action + +} + +?>
\ No newline at end of file diff --git a/comiccontrol/editcomic.php b/comiccontrol/editcomic.php new file mode 100644 index 0000000..9937572 --- /dev/null +++ b/comiccontrol/editcomic.php @@ -0,0 +1,38 @@ +<? +//edit/comic.php +//Comic editing script: switch page based on $do + +if(authCheck()){ + +//if action is set, include that action +if($do != ""){ + switch($do) + { + case "add": + include("editcomicadd.php"); + break; + case "edit": + include("editcomicedit.php"); + break; + case "manage": + include("editcomicmanage.php"); + break; + } +} +//if action is not set, give options +else{ + ?> + <div class="blockborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['add']?></span><br /><?=$lang['acomic']?></a> + </div> + <div class="blockborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['edit']?></span><br /><?=$lang['comicslow']?></a> + </div> + <div class="blocknoborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=manage"><?=$lang['manage']?></span><br /><?=$lang['storylineslow']?></a> + </div> + <? +} + +} +?>
\ No newline at end of file diff --git a/comiccontrol/editcomicadd.php b/comiccontrol/editcomicadd.php new file mode 100644 index 0000000..19d145b --- /dev/null +++ b/comiccontrol/editcomicadd.php @@ -0,0 +1,253 @@ +<? +//editcomicadd.php +//Comic add script: add a comic page + +//ADD COMIC PAGE + +if(authCheck()){ + +//show header +echo '<h2>' . $lang['addcomicheader'] . '</h2>'; + +//SUBMIT COMIC FORM +if(isset($_POST['comictitle']) && $_POST['comictitle'] != ""){ + + //upload images + ini_set('upload_tmp_dir','/tmp/'); + $fieldname = "comicfile"; + if($_FILES[$fieldname]['tmp_name'] != "" && getimagesize($_FILES[$fieldname]['tmp_name'])) + { + include('comicupload.php'); + $imgname = $uploadReg; + $comichighres = $uploadHighres; + $comicthumb = $uploadThumb; + }else{ + $imgname = ""; + } + + //sanitize and assign submitted comic fields + $theDate = $_POST['publishyear'] . "-" . $_POST['publishmonth'] . "-" . $_POST['publishday'] . " " . $_POST['publishhour'] . ":" . $_POST['publishminute']; + $publishtime = strtotime($theDate); + $comicname = sanitizeText($_POST['comictitle']); + $hovertext = sanitizeText($_POST['hovertext']); + $newstitle = sanitizeText($_POST['newstitle']); + $newscontent = sanitize( $_POST['newscontent'] ) ; + $transcript = sanitize( $_POST['transcript'] ) ; + $storyline = filterint($_POST['storyline']); + + //create slug + $slug = preg_replace("/[^A-Za-z0-9\- ]/", "", $comicname); + $slug = str_replace(" ","-",$slug); + $slug = str_replace("--","-",$slug); + $slug = strtolower($slug); + $slugfinal = $slug; + $slugcount = 2; + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND slug='" . $slugfinal . "' AND id!='" . $comic['id'] . "' LIMIT 1"; + $result = $z->query($query); + while($result->num_rows > 0 || $slugfinal == "archive" || $slugfinal == "search"){ + $slugfinal = $slug . "-" . $slugcount; + $slugcount++; + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND slug='" . $slugfinal . "' LIMIT 1"; + $result = $z->query($query); + } + + //get image info + if($imgname != ""){ + $imginfo = getimagesize("../comicshighres/" . $imgname); + $width=$imginfo[0]; + $height=$imginfo[1]; + $mime=$imginfo['mime']; + }else{ + $width = 0; + $height = 0; + $mime = ""; + } + + //update the table + $query = "INSERT INTO cc_".$tableprefix . "comics (comic,imgname,comichighres,comicthumb,publishtime,comicname,newstitle,newscontent,transcript,storyline,slug,hovertext,width,height,mime,commentid) VALUES('" . $module['id'] . "','" . $imgname . "','" . $comichighres . "','" . $comicthumb . "','" . $publishtime . "','" . $comicname . "','" . $newstitle . "','" . $newscontent . "','" . $transcript . "','" . $storyline . "','" . $slugfinal . "','" . $hovertext . "','" . $width . "','" . $height . "','" . $mime . "','')"; + $z->query($query) or die(mysqli_error($z)); + $newid = $z->insert_id; + $commentid = $module['slug'] . "-" . $newid; + $query = "UPDATE cc_" . $tableprefix . "comics SET commentid='" . $commentid . "' WHERE id='" . $newid . "'"; + $z->query($query); + + //insert tags + $tags = str_replace(", ",",",$_POST['tags']); + $tags = explode(",",$tags); + foreach($tags as $value){ + if($value != ""){ + $value = sanitizeText($value); + $value = trim($value); + $query = "INSERT INTO cc_".$tableprefix . "comics_tags(comic,comicid,tag,publishtime) VALUES('" . $module['id'] . "','" . $newid . "','" . $value . "','" . $publishtime . "')"; + $z->query($query); + } + } + + //success message + echo '<div class="successbox">' . $lang['addsuccess'] . '</div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $siteroot . $module['slug'] . '/' . $slugfinal . '/">' . $lang['clicktopreview'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit&comicid=' . $newid . '&edit=edit">' . $lang['editthiscomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit">' . $lang['editanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; +} + + +//SHOW COMIC ADD FORM +else{ + + //display form box ?> + <form name="addcomic" action="edit.php?moduleid=<?=$moduleid?>&do=add" method="post" enctype="multipart/form-data" onsubmit="loading()"> + <div class="formbox"><div class="formline"><label><?=$lang['comicfile']?></label><div class="forminput"><input type="file" name="comicfile" id="comicfile" style="width:400px" /></div><br /></div> + + <? //display time dropdowns ?> + <? // set number of days in month with javascript ?> + <script> + function daysInMonth(month,year) { + return new Date(year, month, 0).getDate(); + } + function updateDays(){ + var f = document.forms[0]; + if(f.publishyear.value != "" && f.publishmonth.value != ""){ + var codes = ""; + var addit = ""; + var numdays = daysInMonth(f.publishmonth.value,f.publishyear.value); + for(i=1;i<=numdays;i++){ + addit = '<option value="' + i + '">' + i + '</option>'; + codes += addit; + } + f.publishday.innerHTML = codes; + } + } + </script> + + <div class="formline"><div class="forminput"><?=$lang['publishdate']?>:</div><div class="forminput"> + <select name="publishyear" onChange="updateDays()"> + <? + $year = 1996; + while($year != (date('Y',time())+4)){ + echo '<option value="' . $year . '"'; + if(date('Y',time()) == sprintf('%02d', $year)) echo ' SELECTED'; + echo '>' . $year . '</option>'; + $year++; + } + ?> + </select> + <select name="publishmonth" onChange="updateDays()"> + <? + $month = 1; + while($month < 13){ + echo '<option value="' . $month . '"'; + if(date('n',time()) == $month) echo ' SELECTED'; + echo '>' . date('F', mktime(0, 0, 0, $month, 10)) . '</option>'; + $month++; + } + ?> + </select> + <select name="publishday"> + <? + $day = 1; + $numdays = date("t",time()); + while($day <= $numdays){ + echo '<option value="' . $day . '"'; + if(date('j',time()) == $day) echo ' SELECTED'; + echo '>' . $day . '</option>'; + $day++; + } + ?> + </select></div> + <div class="forminput"> <?=$lang['publishtime']?> (<?=$timezoneshort?>): </div><div class="forminput"> + <select name="publishhour"> + <? + $hour = 0; + while($hour != 24){ + echo '<option value="' . $hour . '"'; + if(date('H',time()) == sprintf('%02d', $hour)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $hour) . '</option>'; + $hour++; + } + ?> + </select>: + <select name="publishminute"> + <? + $minute = 0; + while($minute != 60){ + echo '<option value="' . $minute . '"'; + if(date('i',time()) == sprintf('%02d', $minute)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $minute) . '</option>'; + $minute++; + } + ?> + </select> + </div> + </div> + + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['comictitle']?>:</label><div class="forminput"><input type="text" name="comictitle" style="width:400px;" /></div></div> + <div class="formline"><label><?=$lang['newstitle']?>:</label><div class="forminput"><input type="text" name="newstitle" style="width:400px;" /></div></div> + + <? //display storyline dropdown ?> + <div class="formline"><label><?=$lang['storyline']?>:</label><div class="forminput"><select name="storyline" style="width:400px;"> + <? + $query = "SELECT * FROM cc_". $tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='0' ORDER BY sorder ASC"; + $result = $z->query($query); + $count = array(); + $numrows = array(); + $parent = 0; + $results = array(); + $rows = array(); + $temp = 0; + while($row = $result->fetch_assoc()){ + $parent = $row['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + $count[$parent] = 0; + echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>'; + $spacecount = 1; + while($count[$parent] < $numrows[$parent]){ + $currspace = 0; + $count[$parent]++; + $row2 = $results[$parent] -> fetch_assoc(); + echo '<option value="' . $row2['id'] . '">'; + while($currspace < $spacecount){ + echo ' '; + $currspace++; + } + echo $row2['name']; + echo '</option>'; + $temp = $parent; + $parent = $row2['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "'"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + if($numrows[$parent] == 0){ + $parent = $temp; + }else{ + $count[$parent] = 0; + $spacecount++; + } + if($count[$parent] == $numrows[$parent]){ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND id='" . $parent . "'"; + $tempresult = $z->query($query); + $temprow = $tempresult -> fetch_assoc(); + $parent = $temprow['parent']; + $spacecount--; + } + } + } + ?> + </select></div></div> + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['hovertext']?>:</label><div class="forminput"><input type="text" name="hovertext" style="width:400px;" /></div></div> + <div class="formline"><label><?=$lang['tagssepbycomma']?>:</label><div class="forminput"><input type="text" name="tags" style="width:400px;" /></div></div> + <p><?=$lang['newscontent']?>:<br /><br /> + <textarea name="newscontent"></textarea> + <p><?=$lang['transcript']?>:<br /><br /> + <textarea name="transcript"></textarea> + <p style="text-align:center;"><input type="submit" id="submitted" name="submit" value="<?=$lang['submit']?>" /><br /></p> + </div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['editanothercomic']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanothercomic']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + </form> + <? +} + +} + +?>
\ No newline at end of file diff --git a/comiccontrol/editcomicedit.php b/comiccontrol/editcomicedit.php new file mode 100644 index 0000000..56ce461 --- /dev/null +++ b/comiccontrol/editcomicedit.php @@ -0,0 +1,385 @@ +<? +//editcomicedit.php +//Comic editing script: edit a comic page +//Includes editing and deleting comics as well as displays comics that can be edited in nested list format + +if(authCheck()){ + +//show header +echo '<h2>' . $lang['editcomicheader'] . '</h2>'; + +//Functions for editing single comic -- add, edit, delete +if(isset($_GET['comicid']) && $_GET['comicid'] != ""){ + + //sanitize getcomicid + $getcomicid = filterint($_GET['comicid']); + + + //EDIT COMIC PAGE + + //SUBMIT COMIC FORM + if(isset($_POST['comictitle']) && $_POST['comictitle'] != ""){ + + //get comic info + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND id='" . $getcomicid . "' LIMIT 1"; + $result = $z->query($query); + $comic = $result->fetch_assoc(); + + //upload images + ini_set('upload_tmp_dir','/tmp/'); + $fieldname = "comicfile"; + if($_FILES[$fieldname]['tmp_name'] != "" && getimagesize($_FILES[$fieldname]['tmp_name'])) + { + include('comicupload.php'); + $imgname = $uploadReg; + $comichighres = $uploadHighres; + $comicthumb = $uploadThumb; + }else{ + $imgname = $comic['imgname']; + $comichighres = $comic['comichighres']; + $comicthumb = $comic['comicthumb']; + } + + //sanitize and assign submitted comic fields + $theDate = $_POST['publishyear'] . "-" . $_POST['publishmonth'] . "-" . $_POST['publishday'] . " " . $_POST['publishhour'] . ":" . $_POST['publishminute']; + $publishtime = strtotime($theDate); + $comicname = sanitizeText($_POST['comictitle']); + $hovertext = sanitizeText($_POST['hovertext']); + $newstitle = sanitizeText($_POST['newstitle']); + $newscontent = sanitize($_POST['newscontent']); + $transcript = sanitize($_POST['transcript']); + $storyline = filterint($_POST['storyline']); + + //create slug + $slug = preg_replace("/[^A-Za-z0-9\- ]/", "", $comicname); + $slug = str_replace(" ","-",$slug); + $slug = str_replace("--","-",$slug); + $slug = strtolower($slug); + $slugfinal = $slug; + $slugcount = 2; + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND slug='" . $slugfinal . "' AND id!='" . $comic['id'] . "' LIMIT 1"; + $result = $z->query($query); + while($result->num_rows > 0 || $slugfinal == "archive" || $slugfinal == "search"){ + $slugfinal = $slug . "-" . $slugcount; + $slugcount++; + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND slug='" . $slugfinal . "' LIMIT 1"; + $result = $z->query($query); + } + + //get image info + if($imgname != ""){ + $imginfo = getimagesize("../comicshighres/" . $imgname); + $width=$imginfo[0]; + $height=$imginfo[1]; + $mime=$imginfo['mime']; + }else{ + $width = 0; + $height = 0; + $mime = ""; + } + + //update the table + $query = "UPDATE cc_".$tableprefix . "comics SET imgname='" . $imgname . "',comichighres='" . $comichighres . "',comicthumb='" . $comicthumb . "',publishtime='" . $publishtime . "',comicname='" . $comicname . "',newstitle='" . $newstitle . "',newscontent='" . $newscontent . "',transcript='" . $transcript . "',storyline='" . $storyline . "',hovertext='" . $hovertext . "',slug='" . $slugfinal . "',width='" . $width . "',height='" . $height . "',mime='" . $mime . "' WHERE comic='" . $module['id'] . "' AND id='" . $comic['id'] . "'"; + $z->query($query) or die(mysqli_error($z)); + + //delete existing tags and insert new ones + $query = "DELETE FROM cc_".$tableprefix . "comics_tags WHERE comicid='" . $comic['id'] . "' AND comic='" . $module['id'] . "'"; + $z->query($query); + $tags = str_replace(", ",",",$_POST['tags']); + $tags = explode(",",$tags); + foreach($tags as $value){ + if($value != ""){ + $value = sanitizeText($value); + $value = trim($value); + $query = "INSERT INTO cc_".$tableprefix . "comics_tags(comic,comicid,tag,publishtime) VALUES('" . $comic['comic'] . "','" . $comic['id'] . "','" . $value . "','" . $publishtime . "')"; + $z->query($query); + } + } + + //success message + echo '<div class="successbox">' . $lang['editsuccess'] . '</div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $siteroot . $module['slug'] . '/' . $slugfinal . '/">' . $lang['clicktopreview'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit&comicid=' . $comic['id'] . '&edit=edit">' . $lang['editthiscomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit">' . $lang['editanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + + + //SHOW COMIC EDIT FORM + else{ + if(isset($_GET['edit']) && $_GET['edit'] == "edit"){ + + //get comic info + $query = "SELECT * FROM cc_".$tableprefix . "comics WHERE comic='" . $module['id'] . "' AND id='" . $getcomicid . "' LIMIT 1"; + $result = $z->query($query); + $comic = $result->fetch_assoc(); + + //display preview button and comic image ?> + <p><a href="<?=$siteroot?><?=$module['slug']?>/<?=$comic['slug']?>" class="ccbutton" style="width:300px;"><?=$lang['clicktopreview']?></a></p> + <form name="editcomic" action="edit.php?moduleid=<?=$moduleid?>&do=edit&comicid=<?=$comic['id']?>" method="post" enctype="multipart/form-data" onsubmit="loading()"> + <p style="text-align:center"><?=$lang['currentcomicimage']?></p><p style="text-align:center"><img src="../comics/<?=$comic['imgname']?>" /><br /><br /></p> + + <? //display form box ?> + <div class="formbox"><div class="formline"><label><?=$lang['newfile']?></label><div class="forminput"><input type="file" name="comicfile" id="comicfile" style="width:400px" /></div><br /></div> + + <? //display time dropdowns ?> + <? // set number of days in month with javascript ?> + <script> + function daysInMonth(month,year) { + return new Date(year, month, 0).getDate(); + } + function updateDays(){ + var f = document.forms[0]; + if(f.publishyear.value != "" && f.publishmonth.value != ""){ + var codes = ""; + var addit = ""; + var numdays = daysInMonth(f.publishmonth.value,f.publishyear.value); + for(i=1;i<=numdays;i++){ + addit = '<option value="' + i + '">' + i + '</option>'; + codes += addit; + } + f.publishday.innerHTML = codes; + } + } + </script> + + <div class="formline"><div class="forminput"><?=$lang['publishdate']?>:</div><div class="forminput"> + <select name="publishyear" onChange="updateDays()"> + <? + $year = 1996; + while($year != (date('Y',time())+4)){ + echo '<option value="' . $year . '"'; + if(date('Y',$comic['publishtime']) == sprintf('%02d', $year)) echo ' SELECTED'; + echo '>' . $year . '</option>'; + $year++; + } + ?> + </select> + <select name="publishmonth" onChange="updateDays()"> + <? + $month = 1; + while($month < 13){ + echo '<option value="' . $month . '"'; + if(date('n',$comic['publishtime']) == $month) echo ' SELECTED'; + echo '>' . date('F', mktime(0, 0, 0, $month, 10)) . '</option>'; + $month++; + } + ?> + </select> + <select name="publishday"> + <? + $day = 1; + $numdays = date("t",$comic['publishtime']); + while($day <= $numdays){ + echo '<option value="' . $day . '"'; + if(date('j',$comic['publishtime']) == $day) echo ' SELECTED'; + echo '>' . $day . '</option>'; + $day++; + } + ?> + </select></div> + <div class="forminput"> <?=$lang['publishtime']?> (<?=$timezoneshort?>): </div><div class="forminput"> + <select name="publishhour"> + <? + $hour = 0; + while($hour != 24){ + echo '<option value="' . $hour . '"'; + if(date('H',$comic['publishtime']) == sprintf('%02d', $hour)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $hour) . '</option>'; + $hour++; + } + ?> + </select>: + <select name="publishminute"> + <? + $minute = 0; + while($minute != 60){ + echo '<option value="' . $minute . '"'; + if(date('i',$comic['publishtime']) == sprintf('%02d', $minute)) echo ' SELECTED'; + echo '>' . sprintf('%02d', $minute) . '</option>'; + $minute++; + } + ?> + </select> + </div> + </div> + + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['comictitle']?>:</label><div class="forminput"><input type="text" name="comictitle" style="width:400px;" value="<?=$comic['comicname']?>" /></div></div> + <div class="formline"><label><?=$lang['newstitle']?>:</label><div class="forminput"><input type="text" name="newstitle" style="width:400px;" value="<?=$comic['newstitle']?>" /></div></div> + + <? //display storyline dropdown ?> + <div class="formline"><label><?=$lang['storyline']?>:</label><div class="forminput"><select name="storyline" style="width:400px;"> + <? + $query = "SELECT * FROM cc_". $tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='0' ORDER BY sorder ASC"; + $result = $z->query($query); + $count = array(); + $numrows = array(); + $parent = 0; + $results = array(); + $rows = array(); + $temp = 0; + while($row = $result->fetch_assoc()){ + $parent = $row['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + $count[$parent] = 0; + echo '<option value="' . $row['id'] . '"'; + if($row['id'] == $comic['storyline']) echo ' SELECTED'; + echo '>' . $row['name'] . '</option>'; + $spacecount = 1; + while($count[$parent] < $numrows[$parent]){ + $currspace = 0; + $count[$parent]++; + $row2 = $results[$parent] -> fetch_assoc(); + echo '<option value="' . $row2['id'] . '"'; + if($row2['id'] == $comic['storyline']) echo ' SELECTED'; + echo '>'; + while($currspace < $spacecount){ + echo ' '; + $currspace++; + } + echo $row2['name']; + echo '</option>'; + $temp = $parent; + $parent = $row2['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "'"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + if($numrows[$parent] == 0){ + $parent = $temp; + }else{ + $count[$parent] = 0; + $spacecount++; + } + if($count[$parent] == $numrows[$parent]){ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND id='" . $parent . "'"; + $tempresult = $z->query($query); + $temprow = $tempresult -> fetch_assoc(); + $parent = $temprow['parent']; + $spacecount--; + } + } + } + ?> + </select></div></div> + + <? //display rest of form box ?> + <div class="formline"><label><?=$lang['hovertext']?>:</label><div class="forminput"><input type="text" name="hovertext" style="width:400px;" value="<?=$comic['hovertext']?>" /></div></div> + <div class="formline"><label><?=$lang['tagssepbycomma']?>:</label><div class="forminput"><input type="text" name="tags" style="width:400px;" value="<? + $query = "SELECT * FROM cc_" . $tableprefix . "comics_tags WHERE comic='" . $module['id'] . "' AND comicid='" . $comic['id'] . "'"; + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + echo $row['tag'] . ","; + } + ?>" /></div></div> + <p><?=$lang['newscontent']?>:<br /><br /> + <textarea name="newscontent"><?=$comic['newscontent'];?></textarea></p> + <p><?=$lang['transcript']?>:<br /><br /> + <textarea name="transcript"><?=$comic['transcript'];?></textarea></p> + <p style="text-align:center;"><input type="submit" id="submitted" name="submit" value="<?=$lang['submit']?>" /><br /></p> + </div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['editanothercomic']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanothercomic']?></a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto']?><?=$module['title']?></a></div></div> + </form> + <? + }else + + + + + //DELETE COMIC + if(isset($_GET['edit']) && $_GET['edit'] == "delete"){ + if(isset($getcomicid) && $getcomicid != ""){ + + $query = "SELECT * FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND id='" . $getcomicid . "' LIMIT 1"; + $result = $z->query($query); + $comic = $result->fetch_assoc(); + + //COMIC DELETED + if(isset($_POST['delete']) && $_POST['delete'] != ""){ + $query = "DELETE FROM `cc_" . $tableprefix . "comics` WHERE comic='" . $module['id'] . "' AND id='" . $comic['id'] . "'"; + $result = $z->query($query); + $query = "DELETE FROM cc_" . $tableprefix . "comics_tags WHERE comic='" . $module['id'] . "' AND comicid='" . $comic['id'] . "'"; + $z->query($query); + echo '<div class="successbox">' . $lang['deletesuccess'] . '</div>'; + } + //ASK TO DELETE COMIC + else{ + ?> + <p style="text-align:center"><?=$lang['asktodelete']?><?=$comic['comicname']?>?</p> + <form method="post" action="edit.php?moduleid=<?=$moduleid?>&do=edit&edit=delete&comicid=<?=$getcomicid?>" name="deletecomic"> + <p style="text-align:center"><input type="submit" name="delete" value="Yes" /> <input type="button" value="No" onclick="self.location='edit.php?moduleid=<?=$moduleid?>&do=edit'" /></p> + <p><br /></p> + </form> + <? + } + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit">' . $lang['editanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addanothercomic'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + } + } + + + + +//DISPLAY COMICS FOR EDITING +}else{ + + //FUNCTION TO DISPLAY COMICS IN STORYLINE + function listPages($thiscomic){ + global $module; + global $tableprefix; + global $siteroot; + global $lang; + global $z; + $query = "SELECT * FROM cc_".$tableprefix . "comics WHERE comic='" . $module['id'] . "' AND storyline='" . $thiscomic . "' ORDER BY publishtime ASC"; + $result2 = $z->query($query); + while($page = $result2->fetch_assoc()){ + echo '<li>' . $page['comicname'] . ' <a href="edit.php?moduleid=' . $module['id'] . '&do=edit&comicid=' . $page['id'] . '&edit=edit">' . $lang['edit'] . '</a> | <a href="edit.php?moduleid=' . $module['id'] . '&do=edit&comicid=' . $page['id'] . '&edit=delete">' . $lang['delete'] . '</a> | <a href="' . $siteroot . $module['slug'] . '/' . $page['slug'] . '">' . $lang['preview'] . '</a></li>'; + } + } + + //DISPLAY COMICS FOR EDITING + echo '<ul>'; + $count = array(); + $numstories = array(); + $parent = 0; + $substories = array(); + $parentstory = array(); + $rows = array(); + $temp = 0; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $substories[$parent] = $z->query($query); + $numstories[$parent] = $substories[$parent]->num_rows; + $count[$parent] = 0; + $currid=0; + $ended = false; + while($row = $substories[$currid]->fetch_assoc()){ + echo '<li><a style="cursor:pointer" onclick="$(\'#storyline' . $row['id'] . '\').slideToggle(\'fast\');">' . $row['name'] . '</a><br /><ul id="storyline' . $row['id'] . '" style="display:none">'; + $currid = $row['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $currid . "' ORDER BY sorder ASC"; + if(!array_key_exists($currid,$substories)) $substories[$currid] = $z->query($query); + if(!array_key_exists($currid,$numstories)) $numstories[$currid] = $substories[$currid]->num_rows; + if(!array_key_exists($currid,$parentstory)) $parentstory[$currid] = $row['parent']; + if(!array_key_exists($currid,$count)) $count[$currid] = 0; + while($count[$currid] == $numstories[$currid]){ + listPages($currid); + echo '</ul>'; + $currid = $parentstory[$currid]; + $ended = true; + } + $count[$currid] ++; + $ended = false; + } + $query = "SELECT * FROM cc_" . $tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "'"; + $result = $z->query($query); + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $module['id'] . "'"; + while($row = $result->fetch_assoc()){ + $query .= " AND storyline!='" . $row['id'] . "'"; + } + echo '<li><a style="cursor:pointer" onclick="$(\'#uncategorized\').slideToggle(\'fast\');">' . $lang['uncategorized'] . '<br /><ul id="uncategorized" style="display:none">'; + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + echo '<li>' . $row['comicname'] . ' <a href="edit.php?moduleid=' . $module['id'] . '&do=edit&comicid=' . $row['id'] . '&edit=edit">' . $lang['edit'] . '</a> | <a href="edit.php?moduleid=' . $module['id'] . '&do=edit&comicid=' . $row['id'] . '&edit=delete">' . $lang['delete'] . '</a> | <a href="' . $siteroot . $module['slug'] . '/' . $row['comicname'] . '">' . $lang['preview'] . '</a></li>'; + } + echo '</ul>'; +} + +} +?>
\ No newline at end of file diff --git a/comiccontrol/editcomicmanage.php b/comiccontrol/editcomicmanage.php new file mode 100644 index 0000000..a4e31b3 --- /dev/null +++ b/comiccontrol/editcomicmanage.php @@ -0,0 +1,336 @@ +<? +//editcomicmanage.php +//Manage comic storylines + +if(authCheck()){ + +//set storylineid +$storylineid = sanitizeAlphanumeric($_GET['storylineid']); +$query = "SELECT * FROM cc_" . $tableprefix . "comics_storyline WHERE id='" . $storylineid . "' LIMIT 1"; +$result = $z->query($query); +if($result->num_rows == 0){ + $storylineid = 0; +} + +//drop in css and javascript for drag and drop boxes ?> +<style type="text/css"><!-- + + #boxes { + font-family: Arial, sans-serif; + list-style-type: none; + margin: 0 auto; + text-align:center; + padding: 0px; + width: 820px; + } + #boxes li { + cursor: move; + background: #bbbbbb; + margin:20px; + position: relative; + width: 520px; + padding: 10px; + text-align: center; + padding-top: 5px; + text-align: center; + } + .leftboxes{ + width:600px; + float:left; + } +</style> +<script language="JavaScript" type="text/javascript" src="draganddrop/core.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/events.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/css.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/coordinates.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/drag.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/dragsort.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/cookies.js"></script> +<script language="JavaScript" type="text/javascript"><!-- +var dragsort = ToolMan.dragsort() +var junkdrawer = ToolMan.junkdrawer() + +window.onload = function() { + junkdrawer.restoreListOrder("boxes") + dragsort.makeListSortable(document.getElementById("boxes"), + saveOrder) +} + +function verticalOnly(item) { + item.toolManDragGroup.verticalOnly() +} + +function speak(id, what) { + var element = document.getElementById(id); + element.innerHTML = 'Clicked ' + what; +} + +function saveOrder(item) { + var group = item.toolManDragGroup + //alert(group.factory); + var list = group.element.parentNode + var id = list.getAttribute("id") + if (id == null) return + group.register('dragend', function() { + ToolMan.cookies().set("list-" + id, + junkdrawer.serializeList(list), 365) + }) +} + +function getphotos(f){ + f.setAttribute('target','_self'); + f.setAttribute('action','edit.php?moduleid=<?=$moduleid?>&do=manage&storylineid=<?=$storylineid?>'); + var order = junkdrawer.serializeList(document.getElementById('boxes')); + var newnums = order[0]; + for(i=1; i<order.length; i++){ + newnums += ","; + newnums += order[i]; + } + var neworder = document.createElement('input'); + neworder.type = "hidden"; + neworder.name = "order"; + neworder.value = newnums; + f.appendChild(neworder); + f.submit(); +} +</script> + +<? + +//save storyline order if submitted +if(isset($_POST['savechanges']) && $_POST['savechanges'] != ""){ + $order = explode(",",$_POST['order']); + $count = 0; + foreach($order as $value){ + $query = "UPDATE cc_" . $tableprefix . "comics_storyline SET sorder='" . $count . "' WHERE id='" . $value . "'"; + $z->query($query) or die(mysqli_error($z)); + $count++; + } + echo '<div class="successbox">' . $lang['changessaved'] . '</div>'; +} + +//switch between functions based on manage +switch($_GET['manage']) +{ + + + //storyline addition + case "add": + echo '<h2>' . $lang['addstoryline'] . '</h2>'; + //add storyline if name submitted + if(isset($_POST['storylinename']) && $_POST['storylinename'] != ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics_storyline WHERE parent='" . $storylineid . "' AND comic='" . $moduleid . "' ORDER BY sorder DESC LIMIT 1"; + $latestchapter = fetch($query); + $storylinename = sanitizeText($_POST['storylinename']); + $parent = filterint($_POST['parent']); + $query = "INSERT INTO `cc_" . $tableprefix . "comics_storyline` (`name`, `sorder`,`parent`,`comic`) VALUES ('" . $storylinename . "', '" . ($latestchapter['sorder']+1) . "','" . $parent . "','" . $module['id'] . "')"; + $result = $z->query($query); + echo '<div class="successbox">' . $lang['storylineadded'] . '</div>'; + + //show nav buttons + echo '<p></p><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=manage&manage=add&storylineid=' . $storylineid . '">' . $lang['addanotherstoryline'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=manage">' . $lang['returnto'] . $lang['storylinemanagement'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + + //show storyline addition form + else{ + ?> + <form method="post" action="edit.php?moduleid=<?=$moduleid?>&do=manage&manage=add&storylineid=<?=$storylineid?>" name="addstoryline"> + <p></p><div class="formline"><label><?=$lang['storylinename']?>: </label><div class="forminput"><input type="text" style="width:300px;" name="storylinename" /></div></div> + <? //display storyline dropdown ?> + <div class="formline"><label><?=$lang['parentstoryline']?>:</label><div class="forminput"><select name="parent" style="width:400px;"><option value="0"><?=$lang['noparent']?></option> + <? + $query = "SELECT * FROM cc_". $tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='0' ORDER BY sorder ASC"; + $result = $z->query($query); + $count = array(); + $numrows = array(); + $parent = 0; + $results = array(); + $rows = array(); + $temp = 0; + while($currrow = $result->fetch_assoc()){ + $parent = $currrow['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + $count[$parent] = 0; + echo '<option value="' . $currrow['id'] . '"'; + if($storylineid == $currrow['id']) echo ' SELECTED'; + echo '>' . $currrow['name'] . '</option>'; + $spacecount = 1; + while($count[$parent] < $numrows[$parent]){ + $currspace = 0; + $count[$parent]++; + $currrow2 = $results[$parent] -> fetch_assoc(); + echo '<option value="' . $currrow2['id'] . '"'; + if($storylineid == $currrow['id']) echo ' SELECTED'; + echo '>'; + while($currspace < $spacecount){ + echo ' '; + $currspace++; + } + echo $currrow2['name']; + echo '</option>'; + $temp = $parent; + $parent = $currrow2['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "'"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + if($numrows[$parent] == 0){ + $parent = $temp; + }else{ + $count[$parent] = 0; + $spacecount++; + } + if($count[$parent] == $numrows[$parent]){ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND id='" . $parent . "'"; + $tempresult = $z->query($query); + $temprow = $tempresult -> fetch_assoc(); + $parent = $temprow['parent']; + $spacecount--; + } + } + } + ?> + </select></div></div> + <p style="text-align:center"><input type="submit" name="submit" value="<?=$lang['addstoryline']?>" /></p> + </form> + <? + + //show nav buttons + echo '<p></p><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=manage">' . $lang['returnto'] . $lang['storylinemanagement'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + } + + break; + + //storyline editing + case "edit": + + //display header + echo '<h2>' . $lang['editstoryline'] . '</h2>'; + + //save edits if form submitted + if(isset($_POST['storylinename']) && $_POST['storylinename'] != ""){ + $storylinename = sanitizeText($_POST['storylinename']); + $parent = filterint($_POST['parent']); + $query = "UPDATE `cc_" . $tableprefix . "comics_storyline` SET name='" . $storylinename . "', parent='" . $parent . "' WHERE id='" . $storylineid . "' AND comic='" . $moduleid . "'"; + $result = $z->query($query); + echo '<div class="successbox">' . $lang['storylineedited'] . '</div>'; + } + + //show storyline edit form + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE id='" . $storylineid . "' AND comic='" . $moduleid . "'"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + ?> + <form method="post" action="edit.php?moduleid=<?=$moduleid?>&do=manage&manage=edit&storylineid=<?=$row['id']?>" name="editstoryline"> + <div class="formline"><label><?=$lang['storylinename']?>: </label><div class="forminput"><input type="text" style="width:300px;" name="storylinename" value="<?=$row['name']?>" /></div></div> + <? //display storyline dropdown ?> + <div class="formline"><label><?=$lang['parentstoryline']?>:</label><div class="forminput"><select name="parent" style="width:400px;"><option value="0"><?=$lang['noparent']?></option> + <? + $query = "SELECT * FROM cc_". $tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='0' ORDER BY sorder ASC"; + $result = $z->query($query); + $count = array(); + $numrows = array(); + $parent = 0; + $results = array(); + $rows = array(); + $temp = 0; + while($currrow = $result->fetch_assoc()){ + $parent = $currrow['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + $count[$parent] = 0; + echo '<option value="' . $currrow['id'] . '"'; + if($currrow['id'] == $row['parent']) echo ' SELECTED'; + echo '>' . $currrow['name'] . '</option>'; + $spacecount = 1; + while($count[$parent] < $numrows[$parent]){ + $currspace = 0; + $count[$parent]++; + $currrow2 = $results[$parent] -> fetch_assoc(); + echo '<option value="' . $currrow2['id'] . '"'; + if($currrow2['id'] == $row['parent']) echo ' SELECTED'; + echo '>'; + while($currspace < $spacecount){ + echo ' '; + $currspace++; + } + echo $currrow2['name']; + echo '</option>'; + $temp = $parent; + $parent = $currrow2['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND parent='" . $parent . "'"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + if($numrows[$parent] == 0){ + $parent = $temp; + }else{ + $count[$parent] = 0; + $spacecount++; + } + if($count[$parent] == $numrows[$parent]){ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $module['id'] . "' AND id='" . $parent . "'"; + $tempresult = $z->query($query); + $temprow = $tempresult -> fetch_assoc(); + $parent = $temprow['parent']; + $spacecount--; + } + } + } + ?> + </select></div></div> + <p style="text-align:center"><input type="submit" name="submit" value="<?=$lang['editstoryline']?>" /></p></form> + + <? + break; + + //delete storyline + case "delete": + //display header + echo '<h2>' . $lang['deletestoryline'] . '</h2>'; + + if(isset($storylineid) && $storylineid != ""){ + + //delete storyline if yes said + if(isset($_POST['delete']) && $_POST['delete'] != ""){ + $query = "DELETE FROM `cc_" . $tableprefix . "comics_storyline` WHERE id='" . $storylineid . "' AND comic='" . $moduleid . "'"; + $z->query($query); + echo '<div class="successbox">' . $lang['storylinedeleted'] . '</div>'; + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=manage">' . $lang['returnto'] . $lang['storylinemanagement'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; + + //ask if you're deleting storyline + }else{ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE id='" . $storylineid . "' AND comic='" . $moduleid . "'"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + ?> + <p style="text-align:center"><?=$lang['wanttodelete']?><?=$row['name']?>?</p> + <form method="post" action="edit.php?moduleid=<?=$moduleid?>&do=manage&manage=delete&storylineid=<?=$row['id']?>" name="deletestoryline"> + <p style="text-align:center;"><input type="submit" name="delete" value="<?=$lang['yes']?>" /> <input type="button" value="<?=$lang['no']?>" onclick="self.location='edit.php?do=manage&moduleid=<?=$moduleid?>'" /></p> + </form><div style="clear:both; height:20px;"></div> + <? + } + } + break; + } + +if($_GET['manage'] != "delete" && $_GET['manage'] != "add"){ + //loop through photos to display them with edit options and rearrange + echo '<p>' . $lang['rearrangestorylines'] . '</p> + <form method="post" onsubmit="getphotos(this)" action="" class="leftboxes"><ul id="boxes">'; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE parent='" . $storylineid . "' AND comic='" . $moduleid . "' ORDER BY sorder ASC"; + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + echo '<li class="box" id="' . $row['id'] . '">' .$row['name'] . ' <a href="edit.php?moduleid=' . $moduleid . '&do=manage&manage=edit&storylineid=' . $row['id'] . '">[edit]</a> <a href="edit.php?moduleid=' . $moduleid . '&do=manage&manage=delete&storylineid=' . $row['id'] . '">[delete]</a></li>'; + } + echo '</ul><div style="clear:left"></div><br /><br /><p style="text-align:center"><input type="submit" name="savechanges" value="' . $lang['savechanges'] . '" /></p></form><form name="capform" action="edit.php?moduleid=' . $moduleid . '" method="post" style="text-align:center"></form><div style="float:left; width:200px;"><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=manage&manage=add&storylineid=' . $storylineid . '">' . $lang['addstoryline'] . '</a></div></div>'; + if($storylineid != 0){ + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=manage">' . $lang['returntostoryline'] . '</a></div></div>'; + } + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '">' . $lang['returnto'] . $module['title'] . '</a></div></div>'; +} + +} + +?>
\ No newline at end of file diff --git a/comiccontrol/editgallery.php b/comiccontrol/editgallery.php new file mode 100644 index 0000000..e00e84b --- /dev/null +++ b/comiccontrol/editgallery.php @@ -0,0 +1,38 @@ +<? +//editgallery.php +//Photo albums editing script + +if(authCheck()){ + +if($do != ""){ + switch($do) + { + case "add": + include("editgalleryadd.php"); + break; + case "edit": + include("editgalleryedit.php"); + break; + case "rearrange": + include("editgalleryrearrange.php"); + break; + } +} +//if action is not set, give options +else{ + ?> + <div class="blockborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['add']?></span><br /><?=$lang['animage']?></a> + </div> + <div class="blockborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['edit']?></span><br /><?=$lang['images']?></a> + </div> + <div class="blocknoborder"> + <span style="font-variant:small-caps"><a href="edit.php?moduleid=<?=$moduleid?>&do=rearrange"><?=$lang['rearrange']?></span><br /><?=$lang['images']?></a> + </div> + <? +} + +} + +?>
\ No newline at end of file diff --git a/comiccontrol/editgalleryadd.php b/comiccontrol/editgalleryadd.php new file mode 100644 index 0000000..80ea8e4 --- /dev/null +++ b/comiccontrol/editgalleryadd.php @@ -0,0 +1,56 @@ +<? +//editgalleryadd.php +//image upload script +if(authCheck()){ +//get gallery info +$query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $moduleid . "'"; +$gallery = fetch($query); + +//display header +echo '<h2>' . $lang['addtogallery'] . '</h2>'; + +//upload images +if(isset($_POST['submit'])){ + + //upload images + ini_set('upload_tmp_dir','/tmp/'); + $files = array(); + $fieldname = "image"; + if($_FILES[$fieldname]['tmp_name'] != "") + { + include('upload.php'); + $imgname = $now.'-'.$_FILES[$fieldname]['name']; + $thumbname = $now2.'-thumb-'.$_FILES[$fieldname]['name']; + $query = "SELECT * FROM cc_".$tableprefix . "galleries WHERE gallery='" . $gallery['id'] . "'"; + $result = $z->query($query); + $caption = sanitizeText($_POST['caption']); + $count = $result->num_rows; + $query = "INSERT INTO cc_".$tableprefix . "galleries(gallery,imgname,thumbname,caption,porder) VALUES('" . $gallery['id'] . "','$imgname','$thumbname','$caption','" . ($count+1) . "')"; + $result = $z->query($query); + $newimg = $z->insert_id; + ?> + <div class="successbox"><?=$lang['imageaddsuccess']?></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=edit&imageid=<?=$newimg?>"><?=$lang['editthisimage'];?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanotherimage'];?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=rearrange"><?=$lang['rearrangeimages'];?></a></div></div> + <? + } +}//end image upload + +//display upload form if image not submitted +else{ +?> + <? //display form box ?> + <form name="addimage" action="edit.php?moduleid=<?=$moduleid?>&do=add" method="post" enctype="multipart/form-data" onsubmit="loading()"> + <div class="formbox"> + <div class="formline"><label><?=$lang['imagefile']?>:</label><div class="forminput"><input type="file" name="image" style="width:400px" /></div></div> + <p style="text-align:center;"><?=$lang['caption']?>:<br /><br /><textarea name="caption" style="width:400px"></textarea></p> + <p><input type="submit" name="submit" value="<?=$lang['submit']?>" /></p> + </div> +<? +} +?> +<div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto'];?><?=$module['title']?></a></div></div> +<? +} +?>
\ No newline at end of file diff --git a/comiccontrol/editgalleryedit.php b/comiccontrol/editgalleryedit.php new file mode 100644 index 0000000..5d08b87 --- /dev/null +++ b/comiccontrol/editgalleryedit.php @@ -0,0 +1,145 @@ +<? +//editgalleryedit.php +//image editing script + +if(authCheck()){ +//get gallery info +$query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $moduleid . "' LIMIT 1"; +$gallery = fetch($query); + +//sanitize get variables +$imageid = filterint($_GET['imageid']); +$edit = sanitizeAlphanumeric($_GET['edit']); + +//perform action based on $edit +if($edit != ""){ + switch($edit){ + + //edit selected image + case "edit": + + //display header + echo '<h2>' . $lang['editgalleryimage'] . '</h2>'; + + //get image info + $query = "SELECT * FROM cc_" . $tableprefix . "galleries WHERE id='" . $imageid . "' AND gallery='" . $moduleid . "' LIMIT 1"; + $result = $z->query($query); + + if($result->num_rows == 1){ + $image = $result->fetch_assoc(); + + + //edit image if submitted + if(isset($_POST['submit'])){ + + //upload images + ini_set('upload_tmp_dir','/tmp/'); + $files = array(); + $fieldname = "image"; + if($_FILES[$fieldname]['tmp_name'] != "") + { + include('upload.php'); + $imgname = $now.'-'.$_FILES[$fieldname]['name']; + $thumbname = $now2.'-thumb-'.$_FILES[$fieldname]['name']; + }else{ + $imgname=$image['imgname']; + $thumbname = $image['thumbname']; + } + $caption = sanitizeText($_POST['caption']); + $query = "UPDATE cc_" . $tableprefix . "galleries SET imgname='" . $imgname . "',thumbname='" . $thumbname . "',caption='" . $caption . "' WHERE id='" . $image['id'] . "'"; + $result = $z->query($query); + ?> + <div class="successbox"><?=$lang['imageeditsuccess']?></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=edit&edit=edit&imageid=<?=$image['id']?>"><?=$lang['editthisimage'];?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['editanotherimage'];?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanotherimage'];?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=rearrange"><?=$lang['rearrangeimages'];?></a></div></div> + <? + }//end image upload + + //display upload form if image not submitted + else{ + ?> + <? //display form box ?> + <p style="text-align:center"><?=$lang['currentimage']?>:</p><p style="text-align:center"><img src="../uploads/<?=$image['imgname']?>" /><br /><br /></p> + <form name="editimage" action="edit.php?moduleid=<?=$moduleid?>&do=edit&edit=edit&imageid=<?=$image['id']?>" method="post" enctype="multipart/form-data" onsubmit="loading()"> + <div class="formbox"> + <div class="formline"><label><?=$lang['newimage']?>:</label><div class="forminput"><input type="file" name="image" style="width:400px" /></div></div> + <p style="text-align:center;"><?=$lang['caption']?>:<br /><br /><textarea name="caption" style="width:400px"><?=$image['caption']?></textarea></p> + <p><input type="submit" name="submit" value="<?=$lang['submit']?>" /></p> + </div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['editanotherimage'];?></a></div></div> + <? + } + } + break; + + //delete image + case "delete": + + //display header + echo '<h2>' . $lang['deletegalleryimage'] . '</h2>'; + + //check if id is actually selected + if(isset($imageid) && $imageid != ""){ + + $query = "SELECT * FROM `cc_" . $tableprefix . "galleries` WHERE gallery='" . $module['id'] . "' AND id='" . $imageid . "' LIMIT 1"; + $result = $z->query($query); + $image = $result->fetch_assoc(); + + //IMAGE DELETED + if(isset($_POST['delete']) && $_POST['delete'] != ""){ + $query = "DELETE FROM `cc_" . $tableprefix . "galleries` WHERE gallery='" . $module['id'] . "' AND id='" . $image['id'] . "'"; + $result = $z->query($query); + echo '<div class="successbox">' . $lang['imagedeleted'] . '</div>'; + } + //ASK TO DELETE COMIC + else{ + ?> + <p style="text-align:center"><?=$lang['asktodelete']?><?=$lang['thisimage']?>?</p> + <form method="post" action="edit.php?moduleid=<?=$moduleid?>&do=edit&edit=delete&imageid=<?=$imageid?>" name="deleteimage"> + <p style="text-align:center"><input type="submit" name="delete" value="Yes" /> <input type="button" value="No" onclick="self.location='edit.php?moduleid=<?=$moduleid?>&do=edit'" /></p> + <p><br /></p> + </form> + <? + } + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=edit">' . $lang['editanotherimage'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="edit.php?moduleid=' . $moduleid . '&do=add">' . $lang['addanotherimage'] . '</a></div></div>'; + } + break; + } +} + +//if no $edit set, display images to edit +else{ + + + //display header + echo '<h2>' . $lang['editgalleryimage'] . '</h2>'; + + //select photos for editing + $query = "SELECT * FROM cc_".$tableprefix . "galleries WHERE gallery='" . $module['id'] . "' ORDER BY porder ASC"; + $result = $z->query($query); + + //throw error if no images + if($result->num_rows == 0){ + echo '<p>' . $lang['noimages'] . '</p>'; + } + + //loop through photos to display them with edit options and rearrange + else{ + echo '<p>' . $lang['selectimageedit'] . '</p><table><tr><td>' . $lang['thumbnail'] . '</td><td>' . $lang['caption'] . '</td><td></td></tr>'; + while($row=$result->fetch_assoc()){ + echo '<tr><td width="120px" style="text-align:center"><img src="../uploads/' . $row['thumbname'] . '" /></td><td width="590px">' . $row['caption'] . '</td><td><a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=edit&edit=edit&imageid=' . $row['id'] . '">' . $lang['edit'] . '</a> | <a href="' . $root . 'edit.php?moduleid=' . $module['id'] . '&do=edit&edit=delete&imageid=' . $row['id'] . '">' . $lang['delete'] . '</a></td></tr>'; + } + echo '</table>'; + echo '<div style="clear:both; height:20px;"></div>'; + ?> <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanimage']?></a></div></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=rearrange"><?=$lang['rearrangeimages'];?></a></div></div> <? + } + +} + ?> +<div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto'];?><?=$module['title']?></a></div></div> +<? +} +?>
\ No newline at end of file diff --git a/comiccontrol/editgalleryrearrange.php b/comiccontrol/editgalleryrearrange.php new file mode 100644 index 0000000..32fce01 --- /dev/null +++ b/comiccontrol/editgalleryrearrange.php @@ -0,0 +1,142 @@ +<? +//editgalleryedit.php +//image editing script + +if(authCheck()){ + +//get gallery info +$query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $moduleid . "' LIMIT 1"; +$gallery = fetch($query); + +//display header +echo '<h2>' . $lang['rearrangegalleryimages'] . '</h2>'; + +//drag and drop styles +?> +<style type="text/css"><!-- + + #boxes { + font-family: Arial, sans-serif; + list-style-type: none; + margin: 0 auto; + text-align:center; + padding: 0px; + width: 642px; + } + #boxes li { + cursor: move; + position: relative; + float: left; + margin: 15px; + width: 130px; + height: 130px; + text-align: center; + padding-top: 5px; + text-align: center; + } + td{ + border-bottom: 1px solid black; + } +</style> + +<? //drag and drop js ?> +<script language="JavaScript" type="text/javascript" src="draganddrop/core.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/events.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/css.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/coordinates.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/drag.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/dragsort.js"></script> +<script language="JavaScript" type="text/javascript" src="draganddrop/cookies.js"></script> +<script language="JavaScript" type="text/javascript"><!-- + var dragsort = ToolMan.dragsort() + var junkdrawer = ToolMan.junkdrawer() + + window.onload = function() { + junkdrawer.restoreListOrder("boxes") + dragsort.makeListSortable(document.getElementById("boxes"), + saveOrder) + } + + function verticalOnly(item) { + item.toolManDragGroup.verticalOnly() + } + + function speak(id, what) { + var element = document.getElementById(id); + element.innerHTML = 'Clicked ' + what; + } + + function saveOrder(item) { + var group = item.toolManDragGroup + //alert(group.factory); + var list = group.element.parentNode + var id = list.getAttribute("id") + if (id == null) return + group.register('dragend', function() { + ToolMan.cookies().set("list-" + id, + junkdrawer.serializeList(list), 365) + }) + } + + function getphotos(f){ + f.setAttribute('target','_self'); + f.setAttribute('action','edit.php?moduleid=<?=$moduleid?>&do=rearrange'); + var order = junkdrawer.serializeList(document.getElementById('boxes')); + var newnums = order[0]; + for(i=1; i<order.length; i++){ + newnums += ","; + newnums += order[i]; + } + var neworder = document.createElement('input'); + neworder.type = "hidden"; + neworder.name = "order"; + neworder.value = newnums; + f.appendChild(neworder); + f.submit(); + } +</script> + +<? + +//rearrange photos if form submitted +if(isset($_POST['savechanges'])){ + + $order = explode(",",$_POST['order']); + $count = 1; + foreach($order as $value){ + $query = "UPDATE cc_".$tableprefix . "galleries SET porder='" . $count . "' WHERE id='" . $value . "' AND gallery='" . $module['id'] . "'"; + $z->query($query); + $count++; + } + echo '<div class="successbox">' . $lang['changessaved'] . '</div>'; + +} + +//get all images in gallery +$query = "SELECT * FROM cc_" . $tableprefix . "galleries WHERE gallery='" . $module['id'] . "' ORDER BY porder ASC"; +$result = $z->query($query); + +//if no images, throw error +if($result->num_rows == 0){ + echo '<p>' . $lang['noimages'] . '</p>'; +} + +//otherwise, output images for rearranging +else{ + ?> + <p><?=$lang['canrearrange'];?></p><div class="formbox"><form method="post" onsubmit="getphotos(this)" action=""><ul id="boxes"> + <? + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + echo '<li class="box" id="' . $row['id'] . '"><img src="../uploads/' . $row['thumbname'] . '" /></li>'; + } + echo '</ul><div style="clear:left"></div><br /><br /><p style="text-align:center"><input type="submit" name="savechanges" value="Save Changes" /></p></form></div>'; +} + +?> +<div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=edit"><?=$lang['editanimage']?></a></div></div> +<div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>&do=add"><?=$lang['addanimage']?></a></div></div> +<div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>edit.php?moduleid=<?=$moduleid?>"><?=$lang['returnto'];?><?=$module['title']?></a></div></div> +<? +} +?>
\ No newline at end of file diff --git a/comiccontrol/editpage.php b/comiccontrol/editpage.php new file mode 100644 index 0000000..02ce8ef --- /dev/null +++ b/comiccontrol/editpage.php @@ -0,0 +1,23 @@ +<? +//editpage.php +//Page editing script +if(authCheck()){ +//If submitted, input information to table +if(isset($_POST['submit'])) +{ + $sValue = sanitize( $_POST['contentarea'] ) ; + $query="UPDATE cc_".$tableprefix . "pages SET content='". $sValue ."' WHERE id='". $moduleid . "'"; + $z->query($query); + echo '<div class="successbox">' . $lang['pageedited'] . '</div>'; +} + +//Display editor +$query="SELECT * FROM cc_".$tableprefix . "pages WHERE id='".$moduleid."'"; +$result=$z->query($query); +$page=$result->fetch_assoc(); +echo '<p>' . $lang['editthispagetext']; +echo '<form method="post" action="edit.php?moduleid=' . $moduleid . '">'; +echo '<textarea name="contentarea">' . $page['content'] . '</textarea>'; +echo '<br /><br /><input name="submit" value="' . $lang['submit'] . '" type="submit" /></form>'; +} +?>
\ No newline at end of file diff --git a/comiccontrol/fileload.php b/comiccontrol/fileload.php new file mode 100644 index 0000000..f0505de --- /dev/null +++ b/comiccontrol/fileload.php @@ -0,0 +1 @@ +<script src="<?=$root?>includes/jquery.js"></script> diff --git a/comiccontrol/functions.php b/comiccontrol/functions.php new file mode 100644 index 0000000..106fab2 --- /dev/null +++ b/comiccontrol/functions.php @@ -0,0 +1,1131 @@ +<? + +//lightbox is not loaded. +$galleryloaded = false; + +//comicDisplay() - displays comic in #comicbody div +function comicDisplay($comicid, $slug = "", $preview=false){ + global $tableprefix; + global $dateformat; + global $timeformat; + global $lang; + global $siteroot; + global $z; + global $usemaxwidth; + global $root; + global $maxwidth; + + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + + //get comic that will be displayed + + //no comic selected, get most recent + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //comic selected, get comic + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview){ + $query .= " AND publishtime <= " . time(); + } + $query .= " LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //DISPLAY COMIC + echo '<div id="cc-comicbody">'; + + //no comic found; throw error + if($numrows == 0){ + echo '<p style="float:left; clear:both; width:500px; margin: 0 auto; text-align:center;">' . $lang['thereisnocomic'] . '</p>'; + } + + //display comic + else{ + + //get next comic for link + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND publishtime > " . $row['publishtime']; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime ASC LIMIT 1"; + $result = $z->query($query); + $numrows2 = $result->num_rows; + if($row['hovertext'] == "") $hovertext=$row['comicname']; else $hovertext=$row['hovertext']; + + //determine if showing lightbox for high res comic + $isWide = false; + if($usemaxwidth == "yes"){ + if($row['width'] > $maxwidth){ + $isWide = true; + ?> + <script type="text/javascript" src="<?=$root?>includes/jquery.js"></script> + <script type="text/javascript" src="<?=$root?>includes/lightGallery.js"></script> + <link rel="stylesheet" href="<?=$root?>includes/lightGallery.css" type="text/css" media="screen" /> + + <style type="text/css"> + .cc-showbig{ + list-style: none outside none; + padding:0; + } + .cc-showbig li{ + display:block; + } + .cc-showbig li a { + cursor:pointer; + } + </style> + <script> + $(document).ready(function() { + $(".cc-showbig").lightGallery(); + }); + </script> + <? + } + } + + //if mobile, generate code to display hovertext on tap + $mobile = isMobile(); + if($row['hovertext'] == "") $mobile = false; + if($mobile && !$isWide){ + ?> + <script> + function showHovertext(){ + var coverup = document.getElementById("cc-coverup"); + if(coverup.style.display=="none"){ + coverup.style.display="block"; + }else{ + coverup.style.display="none"; + } + } + </script> + <style> + #cc-comicbody{ + position:relative; + } + #cc-coverup{ + /* Fallback for web browsers that don't support RGBa */ + background-color: rgb(0, 0, 0); + /* RGBa with 0.6 opacity */ + background-color: rgba(0, 0, 0, 0.6); + /* For IE 5.5 - 7*/ + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); + /* For IE 8*/ + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; + display:none; + width:100%; + height:100%; + position:absolute; + top:0; + left:0; + } + #cc-hoverdiv{ + position:absolute; + width:60%; + padding:3%; + margin-left:17%; + margin-top:35%; + background:#fff; + color:#000; + font-size:2em; + border-radius:10px; + } + </style> + <? } + + //display link if not mobile + if($numrows2 > 0 && !$mobile && !$isWide){ + $row2 = $result->fetch_assoc(); + echo '<a href="' . $siteroot . $comicinfo['slug'] . "/" . $row2['slug'] . '">'; + } + + //handle case for swf + if($row['mime'] == "application/x-shockwave-flash"){ + echo '<div id="cc-comic" style="height:' . $row['height'] . 'px; width:' . $row['width'] . 'px; display:inline-block;">'; + echo '<object height="' . $row['height'] . '" width="' . $row['row'] . '"> + <param name="movie" value="' . $row['imgname'] . '"> + <embed src="' . $row['imgname'] . '" type="application/x-shockwave-flash" height="' . $row['height'] . '" width="' . $row['width'] . '"></object>'; + echo '</div>'; + } + + //if not swf, display image + else{ + if($isWide){ + echo '<ul class="cc-showbig">'; + echo '<li data-src="' . $siteroot . "comicshighres/" . $row['comichighres'] . '"><a><img src="' . $siteroot . "comics/" . $row['imgname'] . '" /></a></li>'; + echo '</ul>'; + } + else{ + echo '<img title="' . $hovertext . '" src="' . $siteroot . 'comics/' . $row['imgname'] . '" id="cc-comic" border="0"'; + if($mobile && !$isWide) echo ' onclick="showHovertext()"'; + echo ' /><br />'; + $comicfile = "comics/" . $row['imgname']; + if($numrows2 > 0 && !$mobile){ + echo '</a>'; + } + + //display hovertext div for mobile + if($mobile){ + ?> + + <div id="cc-coverup" onclick="showHovertext()"><div id="cc-hoverdiv"><?=$hovertext?></div></div> + <? + } + } + } + } + echo '</div>'; +} + + +//displayNews() take comic id and slug and display news +function displayNews($comicid, $slug = "",$preview=false){ + global $tableprefix; + global $disqusname; + global $dateformat; + global $timeformat; + global $newsmode; + global $siteroot; + global $lang; + global $z; + + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + $numrows = 0; + + + //if no slug, get most recent news id + if($slug == ""){ + $query = "SELECT id FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //if slug, get news id + else{ + $query = "SELECT id FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview){ + $query .= " AND publishtime <= " . time(); + } + $query .= " LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //GET MOST RECENT NEWS IF IN LATEST NEWS MODE + if($newsmode == "latestnews"){ + $query = "SELECT id FROM cc_" . $tableprefix . "comics WHERE publishtime<=" . $row['publishtime'] . " AND newscontent!='' AND comic='" . $comicid . "' ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + if($result->num_rows > 0){ + $row = $result->fetch_assoc(); + $id = $row['id']; + } + } + + //display news + echo '<div class="cc-newsarea">'; + if($numrows != 0){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND id='" . $id . "' LIMIT 1"; + $result = $z->query($query); + $news = $result->fetch_assoc(); + echo '<div class="cc-newsheader">'; + if($slug == ""){ + echo '<a href="' . $siteroot . $comicinfo['slug'] . '/' . $news['slug'] . '/">' . $news['newstitle']. '</a>'; + }else{ + echo $news['newstitle']; + } + echo '</div><div class="cc-publishtime">posted ' . date($dateformat,$news['publishtime']) . ' at ' . date($timeformat,$news['publishtime']) . '<br /></div>'; + echo '<div class="cc-newsbody">'; + echo $news['newscontent'] . ''; + echo '</div></div>'; + } + + //throw error if no news id was retrieved + else{ + echo '<p>' . $lang['thereisnonews'] . '</p></div>'; + } +} + + +//displayComments +function displayComments($comicid, $slug = "", $preview=false, $showonindex=false){ + global $tableprefix; + global $disqusname; + global $dateformat; + global $timeformat; + global $siteroot; + global $z; + + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + //get comic info + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + $numrows = 0; + + //get comic id for comments + + //get latest comic if no slug + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + //if slug, get comic id + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview){ + $query .= " AND publishtime <= " . time(); + } + $query .= " LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //get latest news id if in latestnews mode + if($newsmode == "latestnews"){ + $query = "SELECT id FROM cc_" . $tableprefix . "comics WHERE publishtime<=" . $row['publishtime'] . " AND newscontent!='' AND comic='" . $comicid . "' ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + if($result->num_rows > 0){ + $row = $result->fetch_assoc(); + $id = $row['id']; + } + } + + //if slug is not set, display comment link + if(($slug == "" && $numrows != 0) && !$showonindex){ + echo '<div class="cc-commentlink"><a href="' . $siteroot . $comicinfo['slug'] . '/' . $row['slug'] . '#disqus_thread" data-disqus-identifier="' . $row['commentid'] . '">View/Post Comments</a></div>'; + ?> + <script type="text/javascript"> + var disqus_shortname = '<?=$disqusname?>'; + var disqus_identifier = '<?=$row['commentid']?>'; + (function () { + var s = document.createElement('script'); s.async = true; + s.type = 'text/javascript'; + s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); + }()); + </script> + <? + } + + //if slug is set, display comments + else if($numrows > 0){ + echo '<div class="cc-commentheader">Comments</div><div class="cc-commentbody">'; + ?> + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname = '<?=$disqusname?>'; + var disqus_url = '<?=$siteroot?><?=$comicinfo['slug']?>/<?=$row['slug']?>'; + var disqus_identifier = '<?=$row['commentid']?>'; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> + <? + echo '</div>'; + } +} + +function navDisplay($comicid, $slug="", $preview = false){ + global $tableprefix; + global $siteroot; + global $navaux; + global $navorder; + global $z; + + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + //get comic info + $comicinfo = fetch("SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"); + + //get comic id of latest if slug not set + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + $numrows = $result->num_rows; + } + + //get comic id if slug set + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " LIMIT 1"; + $result = $z->query($query); + $numrows = $result->num_rows; + } + + //only display if comic was found + if($numrows != 0){ + $current = $result->fetch_assoc(); + + //first + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <=" . time(); + $query .= " ORDER BY publishtime ASC LIMIT 1"; + $first = fetch($query); + + //prev + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND publishtime < " . $current['publishtime']; + if(!$preview) $query .= " AND publishtime <=" . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $prev = fetch($query); + + //next + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND publishtime > " . $current['publishtime']; + if(!$preview) $query .= " AND publishtime <=" . time(); + $query .= " ORDER BY publishtime ASC LIMIT 1"; + $next = fetch($query); + + //last + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <=" . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $last = fetch($query); + + //get real numrows + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime < " . time(); + $result = $z->query($query); + $numrows = $result->num_rows; + + //BUTTON HTML + if($current['id'] != $first['id'] && $numrows > 1){ + $firstbutton = '<a href="' . $siteroot . $comicinfo['slug'] . '/' . $first['slug'] . '" class="first" rel="start"></a>'; + $prevbutton = '<a href="' . $siteroot . $comicinfo['slug'] . '/' . $prev['slug'] . '" class="prev" rel="prev"></a>'; + }else{ + $firstbutton = '<div class="firstdis"></div>'; + $prevbutton = '<div class="prevdis"></div>'; + } + $auxbutton = '<a href="' . $siteroot . $navaux . '" class="navaux" rel="rss"></a>'; + if($current['id'] != $last['id'] && $numrows > 1){ + $nextbutton = '<a href="' . $siteroot . $comicinfo['slug'] . '/' . $next['slug'] . '" class="next" rel="next"></a>'; + $lastbutton = '<a href="' . $siteroot . $comicinfo['slug'] . '/' . $last['slug'] . '" class="last" rel="index"></a>'; + }else{ + $nextbutton = '<div class="nextdis"></div>'; + $lastbutton = '<div class="lastdis"></div>'; + } + + //output buttons in their assigned order + $navorderarr = explode("|",$navorder); + $buttons = '<div class="nav">'; + foreach($navorderarr as $value){ + switch($value){ + case "first": + $buttons .= $firstbutton; + break; + case "prev": + $buttons .= $prevbutton; + break; + case "next": + $buttons .= $nextbutton; + break; + case "last": + $buttons .= $lastbutton; + break; + case "aux": + $buttons .= $auxbutton; + break; + } + } + $buttons .= '</div>'; + echo $buttons; + } +} + +function displayTags($comicid,$slug="",$preview=false){ + global $tableprefix; + global $z; + global $lang; + global $siteroot; + + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $result = $z->query($query); + $comicinfo = $result->fetch_assoc(); + + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC"; + }else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE slug='" . $slug . "' AND comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + } + $result = $z->query($query); + $comic = $result->fetch_assoc(); + + $query = "SELECT DISTINCT tag FROM cc_" . $tableprefix . "comics_tags WHERE comicid='" . $comic['id'] . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $result = $z->query($query); + $divided = false; + if($result->num_rows > 0){ + echo '<div class="cc-tagline">' . $lang['tagline'] . ': '; + while($tag = $result->fetch_assoc()){ + if($divided) echo ", "; + $divided = true; + echo '<a href="' . $siteroot . $comicinfo['slug'] . "/search/" . $tag['tag'] . '">' . $tag['tag'] . '</a>'; + } + echo '</div>'; + } +} + +function displayTranscript($comicid,$slug="",$preview=false){ + global $tableprefix; + global $z; + + //sanitize arguments + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + //get comic info + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + + //if no slug, get latest comic + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //if slug is assigned, get comic + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview){ + $query .= " AND publishtime <= " . time(); + } + $query .= " LIMIT 1"; + $result = $z->query($query); + $row = $result->fetch_assoc(); + $id = $row['id']; + $numrows = $result->num_rows; + } + + //output transcript + echo '<div class="cc-transcript">' . $row['transcript'] . '</div>'; +} + + +function displayTitle($comicid,$slug = "",$preview=false){ + global $tableprefix; + global $slugarr; + global $lang; + global $z; + + //sanitize arguments + $comicid = filterint($comicid); + $slug = sanitizeSlug($slug); + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $moduleinfo = fetch($query); + + if($moduleinfo['type'] == "comic" || $moduleinfo['type'] == "blog"){ + //if no slug, get latest comic + if($slug == ""){ + $query = "SELECT * FROM cc_" . $tableprefix . $moduleinfo['type'] . "s WHERE " . $moduleinfo['type'] . "='" . $comicid . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " ORDER BY publishtime DESC LIMIT 1"; + } + + else if($slugarr[1] == "archive"){ + echo $lang['archive']; + } + + else if($slugarr[1] == "search"){ + echo $lang['search']; + } + + //if slug is assigned, get comic or blog + else{ + $query = "SELECT * FROM cc_" . $tableprefix . $moduleinfo['type'] . "s WHERE " . $moduleinfo['type'] . "='" . $comicid . "' AND slug='" . $slug . "'"; + if(!$preview) $query .= " AND publishtime <= " . time(); + $query .= " LIMIT 1"; + } + $result = $z->query($query); + $numrows = $result->num_rows; + $row = $result->fetch_assoc(); + if($moduleinfo['type'] == "comic") echo $row['comicname']; else echo $row['title']; + }else{ + echo $moduleinfo['title']; + } + + //output title + $row['comicname']; +} +function displayDropdown($comicid){ + global $tableprefix; + global $dateformat; + global $timeformat; + global $siteroot; + global $z; + + //sanitize arguments + $comicid = filterint($comicid); + + //get comic info + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + + //output dropdown for comic + ?> + <script language="javascript"> + function changePage(comic,slug){ + var location = "<?=$siteroot?>" + comic + "/" + slug; + window.location.href=location; + } + </script> + <select name="comic" onChange="changePage('<?=$comicinfo['slug']?>',this.value)" width="100"><option value="">Select a comic...</option> + <? + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $comicid . "' AND publishtime <= " . time() . " ORDER BY publishtime ASC"; + $result = $z->query($query); + while($row=$result->fetch_assoc()){ + echo '<option value="' . $row['slug'] . '">' . date($dateformat,$row['publishtime']) . ' - ' . $row['comicname'] . '</option>'; + } + ?> + </select> + <? +} +function displayChapters($comicid){ + global $tableprefix; + global $dateformat; + global $timeformat; + global $siteroot; + global $z; + + //sanitize arguments + $comicid = filterint($comicid); + + //get comic info + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "' LIMIT 1"; + $comicinfo = fetch($query); + + //display storylines in hierarchical order + $query = "SELECT * FROM cc_". $tableprefix . "comics_storyline WHERE comic='" . $comicid . "' AND parent='0' ORDER BY sorder ASC"; + $result = $z->query($query); + $count = array(); + $numrows = array(); + $parent = 0; + $results = array(); + $rows = array(); + $temp = 0; + while($row = $result->fetch_assoc()){ + $parent = $row['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $comicid . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + $count[$parent] = 0; + $spacecount = 1; + $haspages = false; + $hasstorylines = false; + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE storyline='" . $parent . "' AND publishtime <=" . time() . " ORDER BY publishtime ASC LIMIT 1"; + $currresult = $z->query($query); + if($currresult->num_rows > 0){ + $haspages = true; + $firstpage = $currresult->fetch_assoc(); + } + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics_storyline WHERE parent='" . $parent . "' ORDER BY sorder ASC LIMIT 1"; + $currresult = $z->query($query); + if($currresult->num_rows > 0) $hasstorylines = true; + } + if($hasstorylines || $haspages){ + echo '<div class="cc-chapterrow">'; + if($haspages) echo '<a href="' . $siteroot . $comicinfo['slug'] . "/" . $firstpage['slug'] . '">'; + echo $row['name']; + if($haspages) echo '</a>'; + echo '</div>'; + } + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $comicid . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + while($count[$parent] < $numrows[$parent]){ + $haspages = false; + $hasstorylines = false; + $currspace = 0; + $count[$parent]++; + $row2 = $results[$parent] -> fetch_assoc(); + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE storyline='" . $row2['id'] . "' AND publishtime <=" . time() . " ORDER BY publishtime ASC LIMIT 1"; + $currresult = $z->query($query); + if($currresult->num_rows > 0){ + $haspages = true; + $firstpage = $currresult->fetch_assoc(); + } + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "comics_storyline WHERE parent='" . $row2['id'] . "' ORDER BY sorder ASC LIMIT 1"; + $currresult = $z->query($query); + if($currresult->num_rows > 0) $hasstorylines = true; + } + if($hasstorylines || $haspages){ + echo '<div class="cc-chapterrow" style="margin-left:' . ($spacecount*50) . 'px">'; + if($haspages) echo '<a href="' . $siteroot . $comicinfo['slug'] . "/" . $firstpage['slug'] . '">'; + echo $row2['name']; + if($haspages) echo '</a>'; + echo '</div>'; + } + $temp = $parent; + $parent = $row2['id']; + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $comicid . "' AND parent='" . $parent . "' ORDER BY sorder ASC"; + $results[$parent] = $z->query($query); + $numrows[$parent] = $results[$parent]->num_rows; + if($numrows[$parent] == 0){ + $parent = $temp; + }else{ + $count[$parent] = 0; + $spacecount++; + } + if($count[$parent] == $numrows[$parent]){ + $query = "SELECT * FROM cc_".$tableprefix . "comics_storyline WHERE comic='" . $comicid . "' AND id='" . $parent . "' ORDER BY sorder ASC"; + $tempresult = $z->query($query); + $temprow = $tempresult -> fetch_assoc(); + $parent = $temprow['parent']; + $spacecount--; + } + } + } +} +function displayPage($pageid,$showtitle=false){ + global $tableprefix; + global $z; + + $pageid = filterint($pageid); + + $query = "SELECT * FROM cc_" . $tableprefix . "pages WHERE id='" . $pageid . "'"; + $result = $z->query($query); + if($result ->num_rows >0){ + $page = $result->fetch_assoc(); + if($showtitle) echo '<h1>' . $page['title'] . '</h1>'; + echo $page['content']; + }else{ + echo '<div class="cc-nopage">' . $lang['nopage'] . '</p>'; + } +} +function displayGallery($slug,$showtitle=false){ + global $tableprefix; + global $galleryloaded; + global $siteroot; + global $root; + global $z; + + $slug = sanitizeSlug($slug); + + //don't load lightbox iff lightbox already loaded + if(!$galleryloaded){ + ?> + <script type="text/javascript" src="<?=$root?>includes/jquery.js"></script> + <script type="text/javascript" src="<?=$root?>includes/lightGallery.js"></script> + <link rel="stylesheet" href="<?=$root?>includes/lightGallery.css" type="text/css" media="screen" /> + + <style type="text/css"> + .cc-gallery{ + list-style: none outside none; + } + .cc-gallery li{ + margin: 10px 10px 0px 0px; + float:left; + width: 125px; + height:125px; + text-align:center; + display:block; + } + .cc-gallery li a { + height: 125px; + width: 125px; + cursor:pointer; + } + .customHtml{ + font-size:12px; + } + .customHtml a{ + color:#fff; + } + </style> + <script> + $(document).ready(function() { + $(".cc-gallery").lightGallery(); + }); + </script> + + <? + $galleryloaded = true; + } + + $query = "SELECT * FROM cc_" . $tableprefix ."modules WHERE slug='" . $slug . "'"; + $result = $z->query($query); + $gallery=$result->fetch_assoc(); + if($showtitle){ + echo '<h1>' . $gallery['title'] . '</h1>'; + } + $query = "SELECT * FROM cc_" . $tableprefix . "galleries WHERE gallery='" . $gallery['id'] . "' ORDER BY porder ASC"; + $result = $z->query($query); + if($result->num_rows == 0){ + echo '<div class="noimages">' . $lang['therearenoimages'] . '</div>'; + }else{ + echo '<ul class="cc-gallery">'; + while($row=$result->fetch_assoc()){ + echo '<li data-src="' . $siteroot . "uploads/" . $row['imgname'] . '" data-sub-html="<div class=\'customHtml\'>' . $row['caption'] . '</div>"><a><img src="' . $siteroot . "uploads/" . $row['thumbname'] . '" /></a></li>'; + } + echo '<div style="clear:left"></div>'; + echo '</ul>'; + } +} +function displaySinglePost($tableid,$blogid,$comments="nocomments"){ + global $tableprefix; + global $dateformat; + global $timeformat; + global $disqusname; + global $siteroot; + global $lang; + global $z; + + $tableid = filterint($tableid); + $blogid = filterint($blogid); + + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $tableid . "' AND id='" . $blogid . "' LIMIT 1"; + $result = $z->query($query); + + //display blog post + if($result->num_rows == 1){ + //get blog info + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $tableid . "' LIMIT 1"; + $bloginfo = fetch($query); + + //display blog + $blogpost = $result->fetch_assoc(); + echo '<div class="cc-blogtitle">'; + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/" . $blogpost['slug'] . '">'; + echo $blogpost['title'] . '</div>'; + echo '</a>'; + echo '<div class="cc-blogpublishtime">' . date($dateformat,$blogpost['publishtime']) . $lang['at'] . date($timeformat,$blogpost['publishtime']) . '</div>'; + echo '<div class="cc-blogcontent">' . $blogpost['content'] . '</div>'; + + $query = "SELECT DISTINCT tag FROM cc_" . $tableprefix . "blogs_tags WHERE blogid='" . $blogpost['id'] . "'"; + $result = $z->query($query); + if($result->num_rows > 0){ + $divided = false; + echo '<div class="cc-tagline">' . $lang['tagline'] . ': '; + while($tag = $result->fetch_assoc()){ + if($divided) echo ", "; + $divided = true; + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/search/" . $tag['tag'] . '">' . $tag['tag'] . '</a>'; + } + echo '</div>'; + } + + switch($comments){ + case "displaycomments": + echo '<div class="cc-blogcommentheader">Comments</div>'; + echo '<div class="cc-blogcommentbody">'; + ?> + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname = '<?=$disqusname?>'; + var disqus_identifier = '<?=$blogpost['commentid']?>'; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> + </div> + <? + break; + case "commentline": + echo '<div class="cc-blogcommentlink"><a href="' . $siteroot . $bloginfo['slug'] . '/' . $blogpost['slug'] . '#disqus_thread" data-disqus-identifier="' . $blogpost['commentid'] . '">View/Post Comments</a></div>'; + ?> + <script type="text/javascript"> + var disqus_shortname = '<?=$disqusname?>'; + var disqus_identifier = '<?=$blogpost['commentid']?>'; + (function () { + var s = document.createElement('script'); s.async = true; + s.type = 'text/javascript'; + s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); + }()); + </script> + <? + break; + } + } + + //no post found, throw error + else{ + echo '<div class="cc-nopost">' . $lang['thereisnopost'] . '</div>'; + } + +} +function displayBlog($tableid,$perpage,$slug,$preview=false,$comments=false,$page=1){ + global $tableprefix; + global $lang; + global $siteroot; + global $z; + + $slug = sanitizeSlug($slug); + $page = filterint($page); + $perpage = filterint($perpage); + $tableid = filterint($tableid); + if($page == "") $page = 1; + if($slug == "page") $slug == ""; + + //search for slug + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE slug LIKE '" . $slug . "'"; + if(!$preview){ $query .= " AND publishtime <=" . time(); } + $query .= " LIMIT 1"; + $result = $z->query($query); + + //if slug found, display single blog post + if($result->num_rows == 1){ + $row = $result->fetch_assoc(); + if($comments){ + $commentarg = "displaycomments"; + }else{ + $commentarg = "nocomments"; + } + displaySinglePost($tableid,$row['id'],$commentarg); + } + + //if slug not found, display blog page + else{ + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $tableid . "'"; + if(!$preview){ $query .= " AND publishtime <=" . time(); } + $allresults = $z->query($query); + + $pagecount = floor($allresults->num_rows / $perpage) + 1; + + //display posts + echo '<div class="cc-blogpage">'; + displayPosts($tableid,($perpage*($page-1)),$perpage,$preview,$comments); + echo '</div>'; + + //display page navigations + if($pagecount > 1){ + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $tableid . "' LIMIT 1"; + $bloginfo = fetch($query); + + echo '<div class="cc-blogprevnext">'; + if($page > 1){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/page/" . ($page-1) . '">' . $lang['blogprev'] . '</a>'; + } + echo ' '; + if($page < $pagecount){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/page/" . ($page+1) . '">' . $lang['blognext'] . '</a>'; + } + echo '</div><div class="cc-blogpages">' . $lang['userpage'] . ' '; + for($i=1;$i<=$pagecount;$i++){ + if($page != $i){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/page/" . $i . '">'; + } + echo $i; + if($page != $i){ + echo '</a> '; + }else{ + echo ' '; + } + } + echo '</div>'; + } + } + +} +function displayPosts($tableid,$start,$numposts,$preview=false,$comments=false){ + global $disqusname; + global $tableprefix; + global $dateformat; + global $timeformat; + global $lang; + global $z; + + $start = filterint($start); + $numposts = filterint($numposts); + $tableid = filterint($tableid); + + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $tableid . "'"; + if(!$preview){ $query .= " AND publishtime <=" . time(); } + $query .= " ORDER BY publishtime DESC LIMIT " . $start . "," . $numposts; + $result = $z->query($query); + + //throw error if no blog posts exist + if($result->num_rows==0){ + echo '<div class="cc-nopost">' . $lang['noblogpostsuser'] . '</div>'; + }else{ + $divided = false; + while($row = $result->fetch_assoc()){ + if($divided){ + echo '<div class="cc-postdivider"></div>'; + } + else{ + $divided = true; + } + if($comments){ + $commentarg = "commentline"; + }else{ + $commentarg = "nocomments"; + } + displaySinglePost($tableid,$row['id'],$commentarg); + } + } +} +//COMIC SEARCH +function comicSearch($comicid,$tag,$numresults,$page=1){ + global $z; + global $tableprefix; + global $lang; + global $siteroot; + + $tag = str_replace("20"," ",$tag); + $tag = sanitize($tag); + $page = filterint($page); + $numresults = filterint($numresults); + $comicid = filterint($comicid); + if($page == "") $page = 1; + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $comicid . "'"; + $comicinfo = fetch($query); + $query = "SELECT DISTINCT comicid FROM cc_" . $tableprefix . "comics_tags WHERE tag='" . $tag . "' AND comic='" . $comicid . "' AND publishtime <=" . time(); + $allresults = $z->query($query); + $query = "SELECT DISTINCT comicid FROM cc_" . $tableprefix . "comics_tags WHERE tag='" . $tag . "' AND comic='" . $comicid . "' AND publishtime <=" . time() . " ORDER BY publishtime ASC LIMIT " . ($numresults*($page-1)) . "," . $numresults . ""; + $result = $z->query($query); + + $pagecount = floor($allresults->num_rows / $numresults); + if(($allresults->num_rows % $numresults) != 0) $pagecount++; + + echo '<div class="cc-searchheader">' . $lang['comicstagged'] . '"' . $tag . '" - ' . $lang['page'] . ' ' . $page . '</div><div class="cc-searchbody">'; + if($result->num_rows==0){ + echo $lang['noresultsfound']; + }else{ + while($row = $result->fetch_assoc()){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE id='" . $row['comicid'] . "' AND comic='" . $comicid . "' AND publishtime <= " . time(); + $comic = fetch($query); + echo '<div class="cc-searchbox"><a href="' . $siteroot . $comicinfo['slug'] . '/' . $comic['slug'] . '"><div class="cc-searchcomicname">' . $comic['comicname'] . '</div><div class="cc-searchcomicimgbox"><img class="cc-searchcomicimage" src="' . $siteroot . 'comics/' . $comic['imgname'] . '" /></div></a></div>'; + } + } + echo '</div><div style="clear:both"></div>'; + + if($pagecount > 1){ + echo '<div class="cc-searchprevnext">'; + if($page > 1){ + echo '<a href="' . $siteroot . $comicinfo['slug'] . "/search/" . $tag . "/" . ($page-1) . '">' . $lang['searchprev'] . '</a>'; + } + echo ' '; + if($page < $pagecount){ + echo '<a href="' . $siteroot . $comicinfo['slug'] . "/search/" . $tag . "/" . ($page+1) . '">' . $lang['searchnext'] . '</a>'; + } + echo '</div><div class="cc-searchpages">' . $lang['page'] . ' '; + for($i=1;$i<=$pagecount;$i++){ + echo ' '; + if($page != $i){ + echo '<a href="' . $siteroot . $comicinfo['slug'] . "/search/" . $tag . "/" . $i . '">'; + } + echo $i; + if($page != $i){ + echo '</a>'; + } + } + echo '</div>'; + } +} +//BLOG SEARCH +function blogSearch($blogid,$tag,$numresults,$page=1){ + global $z; + global $tableprefix; + global $lang; + global $siteroot; + global $dateformat; + + $tag = sanitizeAlphanumeric($tag); + $page = filterint($page); + $numresults = filterint($numresults); + $blogid = filterint($blogid); + if($page == "") $page = 1; + + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='" . $blogid . "'"; + $bloginfo = fetch($query); + $query = "SELECT DISTINCT blogid FROM cc_" . $tableprefix . "blogs_tags WHERE tag='" . $tag . "' AND blog='" . $blogid . "' AND publishtime <=" . time(); + $allresults = $z->query($query); + $query = "SELECT DISTINCT blogid FROM cc_" . $tableprefix . "blogs_tags WHERE tag='" . $tag . "' AND blog='" . $blogid . "' AND publishtime <=" . time() . " ORDER BY publishtime ASC LIMIT " . ($numresults*($page-1)) . "," . $numresults . ""; + $result = $z->query($query); + + $pagecount = floor($allresults->num_rows / $numresults); + if(($allresults->num_rows % $numresults) != 0) $pagecount++; + + echo '<div class="cc-searchheader">' . $lang['blogstagged'] . '"' . $tag . '" - ' . $lang['page'] . ' ' . $page . '</div><div class="cc-searchbody">'; + if($result->num_rows==0){ + echo $lang['noresultsfound']; + }else{ + while($row = $result->fetch_assoc()){ + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE id='" . $row['blogid'] . "' AND blog='" . $blogid . "' AND publishtime <= " . time(); + $blog = fetch($query); + echo '<div class="cc-searchblogtitle"><a href="' . $siteroot . $bloginfo['slug'] . '/' . $blog['slug'] . '">' . $blog['title'] . ' - ' . date($dateformat,$blog['publishtime']) . '</a></div>'; + } + } + echo '</div><div style="clear:both"></div>'; + + if($pagecount > 1){ + echo '<div class="cc-searchprevnext">'; + if($page > 1){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/search/" . $tag . "/" . ($page-1) . '">' . $lang['searchprev'] . '</a>'; + } + echo ' '; + if($page < $pagecount){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/search/" . $tag . "/" . ($page+1) . '">' . $lang['searchnext'] . '</a>'; + } + echo '</div><div class="cc-searchpages">' . $lang['page'] . ' '; + for($i=1;$i<=$pagecount;$i++){ + echo ' '; + if($page != $i){ + echo '<a href="' . $siteroot . $bloginfo['slug'] . "/search/" . $tag . "/" . $i . '">'; + } + echo $i; + if($page != $i){ + echo '</a>'; + } + } + echo '</div>'; + } +} + +?>
\ No newline at end of file diff --git a/comiccontrol/imageupload.php b/comiccontrol/imageupload.php new file mode 100644 index 0000000..ad31715 --- /dev/null +++ b/comiccontrol/imageupload.php @@ -0,0 +1,114 @@ +<? +//imageupload.php +//store, upload, and manage files<? + +//invoke header +include('includes/header.php'); + +//sanitize get variables +$imageid = filterint($_GET['imageid']); + +echo '<h2>' . $lang['imageupload'] . '</h2>'; + +//perform action based on $do +if($do != ""){ + switch($do){ + + //add image + case "add": + //upload image if form submitted + if(isset($_POST['submit'])){ + //upload image + ini_set('upload_tmp_dir','/tmp/'); + $files = array(); + $fieldname = "image"; + if($_FILES[$fieldname]['tmp_name'] != "") + { + include('mediaupload.php'); + echo $thumbname; + $query = "INSERT INTO cc_".$tableprefix . "images(thumbname,imgname) VALUES('" . $thumbname . "','" . $imgname . "')"; + $result = $z->query($query); + $newimg = $z->insert_id; + ?> + <div class="successbox"><?=$lang['imageaddsuccess']?></div> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>imageupload.php?do=add"><?=$lang['addanotherimage'];?></a></div></div> + <? + } + }//end image upload + + //display upload form if image not submitted + else{ + ?> + <? //display form box ?> + <form name="addimage" action="imageupload.php?do=add" method="post" enctype="multipart/form-data" onsubmit="loading()"> + <div class="formbox"> + <div class="formline"><label><?=$lang['imagefile']?>:</label><div class="forminput"><input type="file" name="image" style="width:400px" /></div></div> + <p><input type="submit" name="submit" value="<?=$lang['submit']?>" /></p> + </div> + <? + } + ?> + <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>imageupload.php"><?=$lang['returnto'];?><?=$lang['imageupload']?></a></div></div> + <? + break; + + + //delete image + case "delete": + + //check if id is actually selected + if(isset($imageid) && $imageid != ""){ + + $query = "SELECT * FROM `cc_" . $tableprefix . "images` WHERE id='" . $imageid . "' LIMIT 1"; + $result = $z->query($query); + $image = $result->fetch_assoc(); + + //IMAGE DELETED + if(isset($_POST['delete']) && $_POST['delete'] != ""){ + $query = "DELETE FROM `cc_" . $tableprefix . "images` WHERE id='" . $image['id'] . "'"; + $result = $z->query($query); + unlink("../uploads/" . $image['imgname']); + unlink("../uploads/" . $image['thumbname']); + echo '<div class="successbox">' . $lang['imagedeleted'] . '</div>'; + } + //ASK TO DELETE IMAGE + else{ + ?> + <p style="text-align:center"><?=$lang['asktodelete']?><?=$lang['thisimage']?>?</p> + <form method="post" action="imageupload.php?do=delete&imageid=<?=$imageid?>" name="deleteimage"> + <p style="text-align:center"><input type="submit" name="delete" value="<?=$lang['yes']?>" /> <input type="button" value="<?=$lang['no']?>" onclick="self.location='imageupload.php'" /></p> + <p><br /></p> + </form> + <? + } + echo '<div class="ccbuttoncont"><div class="ccbutton"><a href="imageupload.php?do=add">' . $lang['addanotherimage'] . '</a></div></div><div class="ccbuttoncont"><div class="ccbutton"><a href="imageupload.php">' . $lang['returnto'] . $lang['imageupload'] . '</a></div></div>'; + } + break; + } +} + +//if no $do set, display image to edit +else{ + //show all uploaded images + $query = "SELECT * FROM cc_".$tableprefix . "images"; + $result = $z->query($query); + + //throw error if no image + if($result->num_rows == 0){ + echo '<p>' . $lang['noimageuploads'] . '</p>'; + } + + //loop through photos to display them with edit options and rearrange + else{ + echo '<table><tr><td>' . $lang['thumbnail'] . '</td><td>' . $lang['permalink'] . '</td><td></td></tr>'; + while($row=$result->fetch_assoc()){ + echo '<tr><td width="120px" style="text-align:center"><img src="../uploads/' . $row['thumbname'] . '" /></td><td width="590px">' . $siteroot . "uploads/" . $row['imgname'] . '</td><td><a href="' . $root . 'imageupload.php?do=delete&imageid=' . $row['id'] . '">' . $lang['delete'] . '</a></td></tr>'; + } + echo '</table>'; + echo '<div style="clear:both; height:20px;"></div>'; + } + ?> <div class="ccbuttoncont"><div class="ccbutton"><a href="<?=$root?>imageupload.php?do=add"><?=$lang['addanimage']?></a></div></div> <? + +} + +include('includes/footer.php'); ?> diff --git a/comiccontrol/includes/chart.js b/comiccontrol/includes/chart.js new file mode 100644 index 0000000..ecb869f --- /dev/null +++ b/comiccontrol/includes/chart.js @@ -0,0 +1,7068 @@ +/* + * ChartNew.js + * + * Vancoppenolle Francois - January 2014 + * francois.vancoppenolle@favomo.be + * + * Source location : http:\\www.favomo.be\graphjs + * GitHub community : https://github.com/FVANCOP/ChartNew.js + * + * This file is originally an adaptation of the chart.js source developped by Nick Downie (2013) + * https://github.com/nnnick/Chart.js. But since june 2014, Nick puts a new version with a + * refunded code. Current code of ChartNew.js is no more comparable to the code of Chart.js + * + * new charts compared to Chart.js + * + * horizontalBar + * horizontalStackedBar + * + * Added items compared to Chart.js: + * + * Title, Subtitle, footnotes, axis labels, unit label + * Y Axis on the right and/or the left + * canvas Border + * Legend + * crossText, crossImage + * graphMin, graphMax + * logarithmic y-axis (for line and bar) + * rotateLabels + * and lot of others... + * + */ +// non standard functions; + +var chartJSLineStyle=[]; + +chartJSLineStyle["solid"]=[]; +chartJSLineStyle["dotted"]=[1,4]; +chartJSLineStyle["shortDash"]=[2,1]; +chartJSLineStyle["dashed"]=[4,2]; +chartJSLineStyle["dashSpace"]=[4,6]; +chartJSLineStyle["longDashDot"]=[7,2,1,2]; +chartJSLineStyle["longDashShortDash"]=[10,4,4,4]; +chartJSLineStyle["gradient"]=[1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1]; + +function lineStyleFn(data) +{ +if ((typeof chartJSLineStyle[data]) === "object")return chartJSLineStyle[data]; +else return chartJSLineStyle["solid"]; +}; + +if (typeof String.prototype.trim !== 'function') { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + } +}; +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function(searchElement /*, fromIndex */ ) { + "use strict"; + if (this == null) { + throw new TypeError(); + } + var t = Object(this); + var len = t.length >>> 0; + if (len === 0) { + return -1; + } + var n = 0; + if (arguments.length > 0) { + n = Number(arguments[1]); + if (n != n) { // shortcut for verifying if it's NaN + n = 0; + } else if (n != 0 && n != Infinity && n != -Infinity) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + } + if (n >= len) { + return -1; + } + var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); + for (; k < len; k++) { + if (k in t && t[k] === searchElement) { + return k; + } + } + return -1; + } +}; +var charJSPersonalDefaultOptions = {}; +var charJSPersonalDefaultOptionsLine = {} ; +var charJSPersonalDefaultOptionsRadar = {} ; +var charJSPersonalDefaultOptionsPolarArea = {} ; +var charJSPersonalDefaultOptionsPie = {}; +var charJSPersonalDefaultOptionsDoughnut = {}; +var charJSPersonalDefaultOptionsBar = {}; +var charJSPersonalDefaultOptionsStackedBar = {}; +var charJSPersonalDefaultOptionsHorizontalBar = {}; +var charJSPersonalDefaultOptionsHorizontalStackedBar = {}; + ///////// FUNCTIONS THAN CAN BE USED IN THE TEMPLATES /////////////////////////////////////////// + +function roundToWithThousands(config, num, place) { + var newval = 1 * unFormat(config, num); + if (typeof(newval) == "number" && place != "none") { + var roundVal; + if (place <= 0) { + roundVal = -place; + newval = +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal); + } else { + roundVal = place; + var divval = "1e+" + roundVal; + newval = +(Math.round(newval / divval)) * divval; + } + } + newval = fmtChartJS(config, newval, "none"); + return (newval); +}; + +function unFormat(config, num) { + if ((config.decimalSeparator != "." || config.thousandSeparator != "") && typeof(num) == "string") { + var v1 = "" + num; + if (config.thousandSeparator != "") { + while (v1.indexOf(config.thousandSeparator) >= 0) v1 = "" + v1.replace(config.thousandSeparator, ""); + } + if (config.decimalSeparator != ".") v1 = "" + v1.replace(config.decimalSeparator, ".") + return 1 * v1; + } else { + return num; + } +}; +///////// ANNOTATE PART OF THE SCRIPT /////////////////////////////////////////// +/******************************************************************************** +Copyright (C) 1999 Thomas Brattli +This script is made by and copyrighted to Thomas Brattli +Visit for more great scripts. This may be used freely as long as this msg is intact! +I will also appriciate any links you could give me. +Distributed by Hypergurl +********************************************************************************/ +var cachebis = {}; + +function fmtChartJSPerso(config, value, fmt) { + switch (fmt) { + case "SampleJS_Format": + if (typeof(value) == "number") return_value = "My Format : " + value.toString() + " $"; + else return_value = value + "XX"; + break; + case "Change_Month": + if (typeof(value) == "string") return_value = value.toString() + " 2014"; + else return_value = value.toString() + "YY"; + break; + default: + return_value = value; + break; + } + return (return_value); +}; + +function fmtChartJS(config, value, fmt) { + var return_value; + if (fmt == "notformatted") { + return_value = value; + } else if (fmt == "none" && typeof(value) == "number") { + if (config.roundNumber != "none") { + var roundVal; + if (config.roundNumber <= 0) { + roundVal = -config.roundNumber; + value = +(Math.round(value + "e+" + roundVal) + "e-" + roundVal); + } else { + roundVal = config.roundNumber; + var divval = "1e+" + roundVal; + value = +(Math.round(value / divval)) * divval; + } + } + if (config.decimalSeparator != "." || config.thousandSeparator != "") { + return_value = value.toString().replace(/\./g, config.decimalSeparator); + if (config.thousandSeparator != "") { + var part1 = return_value; + var part2 = ""; + var posdec = part1.indexOf(config.decimalSeparator); + if (posdec >= 0) { + part2 = part1.substring(posdec + 1, part1.length); + part2 = part2.split('').reverse().join(''); // reverse string + part1 = part1.substring(0, posdec); + } + part1 = part1.toString().replace(/\B(?=(\d{3})+(?!\d))/g, config.thousandSeparator); + part2 = part2.split('').reverse().join(''); // reverse string + return_value = part1 + if (part2 != "") return_value = return_value + config.decimalSeparator + part2; + } + } else return_value = value; + } else if (fmt != "none" && fmt != "notformatted") { + return_value = fmtChartJSPerso(config, value, fmt); + } else { + return_value = value; + } + return (return_value); +}; + +function addParameters2Function(data, fctName, fctList) { + var mathFunctions = { + mean: { + data: data.data, + datasetNr: data.v11 + }, + varianz: { + data: data.data, + datasetNr: data.v11 + }, + stddev: { + data: data.data, + datasetNr: data.v11 + }, + cv: { + data: data.data, + datasetNr: data.v11 + }, + median: { + data: data.data, + datasetNr: data.v11 + } + }; + // difference to current value (v3) + dif = false; + if (fctName.substr(-3) == "Dif") { + fctName = fctName.substr(0, fctName.length - 3); + dif = true; + } + if (typeof eval(fctName) == "function") { + var parameter = eval(fctList + "." + fctName); + if (dif) { + // difference between v3 (current value) and math function + return data.v3 - window[fctName](parameter); + } + return window[fctName](parameter); + } + return null; +}; + +function isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +}; + +function tmplbis(str, data,config) { + newstr=str; + if(newstr.substr(0,config.templatesOpenTag.length)==config.templatesOpenTag)newstr="<%="+newstr.substr(config.templatesOpenTag.length,newstr.length-config.templatesOpenTag.length); + if(newstr.substr(newstr.length-config.templatesCloseTag.length,config.templatesCloseTag.length)==config.templatesCloseTag)newstr=newstr.substr(0,newstr.length-config.templatesCloseTag.length)+"%>"; + return tmplter(newstr,data); +} + +function tmplter(str, data) { + var mathFunctionList = ["mean", "varianz", "stddev", "cv", "median"]; + var regexMath = new RegExp('<%=((?:(?:.*?)\\W)??)((?:' + mathFunctionList.join('|') + ')(?:Dif)?)\\(([0-9]*?)\\)(.*?)%>', 'g'); + while (regexMath.test(str)) { + str = str.replace(regexMath, function($0, $1, $2, $3, $4) { + var rndFac; + if ($3) rndFac = $3; + else rndFac = 2; + var value = addParameters2Function(data, $2, "mathFunctions"); + if (isNumber(value)) + return '<%=' + $1 + '' + Math.round(Math.pow(10, rndFac) * value) / Math.pow(10, rndFac) + '' + $4 + '%>'; + return '<%= %>'; + }); + } + // Figure out if we're getting a template, or if we need to + // load the template - and be sure to cache the result. + // first check if it's can be an id + var fn = /^[A-Za-z][-A-Za-z0-9_:.]*$/.test(str) ? cachebis[str] = cachebis[str] || + tmplter(document.getElementById(str).innerHTML) : + // Generate a reusable function that will serve as a template + // generator (and which will be cached). + new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + // Convert the template into pure JavaScript + str + .replace(/[\r\n]/g, "\\n") + .replace(/[\t]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + "');}return p.join('');"); + // Provide some basic currying to the user + return data ? fn(data) : fn; +}; +if (typeof CanvasRenderingContext2D !== 'undefined') { + /** + * ctx.prototype + * fillText option for canvas Multiline Support + * @param text string \n for newline + * @param x x position + * @param y y position + * @param yLevel = "bottom" => last line has this y-Pos [default], = "middle" => the middle line has this y-Pos) + * @param lineHeight lineHeight + * @param horizontal horizontal + */ + CanvasRenderingContext2D.prototype.fillTextMultiLine = function(text, x, y, yLevel, lineHeight,horizontal) { + var lines = ("" + text).split("\n"); + // if its one line => in the middle + // two lines one above the mid one below etc. + if (yLevel == "middle") { + if(horizontal)y -= ((lines.length - 1) / 2) * lineHeight; + } else if (yLevel == "bottom") { // default + if(horizontal)y -= (lines.length - 1) * lineHeight; + } + for (var i = 0; i < lines.length; i++) { + this.fillText(lines[i], x, y); + y += lineHeight; + } + }; + CanvasRenderingContext2D.prototype.measureTextMultiLine = function(text, lineHeight) { + var textWidth = 0; + var lg; + var lines = ("" + text).split("\n"); + var textHeight = lines.length * lineHeight; + // if its one line => in the middle + // two lines one above the mid one below etc. + for (var i = 0; i < lines.length; i++) { + lg = this.measureText(lines[i]).width; + if (lg > textWidth) textWidth = lg; + } + return { + textWidth: textWidth, + textHeight: textHeight + }; + }; + if (typeof CanvasRenderingContext2D.prototype.setLineDash !== 'function') { + CanvasRenderingContext2D.prototype.setLineDash = function( listdash) { + return 0; + }; + }; +}; +cursorDivCreated = false; + +function createCursorDiv() { + if (cursorDivCreated == false) { + var div = document.createElement('divCursor'); + div.id = 'divCursor'; + div.style.position = 'absolute'; + document.body.appendChild(div); + cursorDivCreated = true; + } +}; + +initChartJsResize = false; +var jsGraphResize = new Array(); + +function addResponsiveChart(id,ctx,data,config) { + initChartResize(); + var newSize=resizeGraph(ctx,config); + if(typeof ctx.prevWidth != "undefined") { + resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); + ctx.prevWidth=newSize.newWidth; + } else if (config.responsiveScaleContent && config.responsiveWindowInitialWidth) { + ctx.initialWidth =newSize.newWidth; + } + + ctx.prevWidth=newSize.newWidth; + ctx.prevHeight=newSize.newHeight; + jsGraphResize[jsGraphResize.length]= [id,ctx.tpchart,ctx,data,config]; +}; + +function initChartResize() { + if(initChartJsResize==false) { + if (window.addEventListener) { + window.addEventListener("resize", chartJsResize); + } else { + window.attachEvent("resize", chartJsResize); + } + } +}; + +var container; +function getMaximumWidth(domNode){ + if(domNode.parentNode!=null) + if(domNode.parentNode!=undefined) + container = domNode.parentNode; + return container.clientWidth; +}; + +function getMaximumHeight(domNode){ + if(domNode.parentNode!=null) + if(domNode.parentNode!=undefined) + container = domNode.parentNode; + return container.clientHeight; +}; + +function resizeCtx(ctx,newWidth,newHeight,config) +{ + if (window.devicePixelRatio) { // Retina device + ctx.canvas.style.width = newWidth/window.devicePixelRatio + "px"; + ctx.canvas.style.height = newHeight/window.devicePixelRatio + "px"; + ctx.canvas.height = newHeight/window.devicePixelRatio * window.devicePixelRatio; + ctx.canvas.width = newWidth/window.devicePixelRatio * window.devicePixelRatio; + ctx.scale(window.devicePixelRatio, window.devicePixelRatio); + if(typeof ctx.chartTextScale != "undefined" && config.responsiveScaleContent) { + ctx.chartTextScale=config.chartTextScale*(newWidth/ctx.initialWidth); + ctx.chartLineScale=config.chartLineScale*(newWidth/ctx.initialWidth); + ctx.chartSpaceScale=config.chartSpaceScale*(newWidth/ctx.initialWidth); + } + } else { + ctx.canvas.height = newHeight ; + ctx.canvas.width = newWidth; + /* new ratio */ + if(typeof ctx.chartTextScale != "undefined" && config.responsiveScaleContent) { + ctx.chartTextScale=config.chartTextScale*(newWidth/ctx.initialWidth); + ctx.chartLineScale=config.chartLineScale*(newWidth/ctx.initialWidth); + ctx.chartSpaceScale=config.chartSpaceScale*(newWidth/ctx.initialWidth); + } + } +}; + +function resizeGraph(ctx,config) { + if(typeof config.maintainAspectRatio == "undefined")config.maintainAspectRatio=true; + if(typeof config.responsiveMinWidth == "undefined")config.responsiveMinWidth=0; + if(typeof config.responsiveMinHeight == "undefined")config.responsiveMinHeight=0; + if(typeof config.responsiveMaxWidth == "undefined")config.responsiveMaxWidth=9999999; + if(typeof config.responsiveMaxHeight == "undefined")config.responsiveMaxHeight=9999999; + var canvas = ctx.canvas; + if(typeof ctx.aspectRatio == "undefined") { + ctx.aspectRatio = canvas.width / canvas.height; + } + + var newWidth = getMaximumWidth(canvas); + var newHeight = config.maintainAspectRatio ? newWidth / ctx.aspectRatio : getMaximumHeight(canvas); + newWidth=Math.min(config.responsiveMaxWidth,Math.max(config.responsiveMinWidth,newWidth)); + newHeight=Math.min(config.responsiveMaxHeight,Math.max(config.responsiveMinHeight,newHeight)); + return { newWidth : parseInt(newWidth), newHeight : parseInt(newHeight)}; +}; + + + +function chartJsResize() { + for (var i=0;i<jsGraphResize.length;i++) { + if(typeof jsGraphResize[i][2].firstPass != "undefined") { + if(jsGraphResize[i][2].firstPass == 5)jsGraphResize[i][2].firstPass=6; + } + subUpdateChart(jsGraphResize[i][2],jsGraphResize[i][3],jsGraphResize[i][4]); + } +}; + +function testRedraw(ctx,data,config) { + if (ctx.firstPass==2 || ctx.firstPass==4 || ctx.firstPass==9) { + ctx.firstPass=6; + subUpdateChart(ctx,data,config) ; + return true; + } else { + ctx.firstPass=5; + return false; + } +}; + +function updateChart(ctx,data,config,animation,runanimationcompletefunction) { + if (ctx.firstPass==5) + { + ctx.runanimationcompletefunction=runanimationcompletefunction; + if(animation)ctx.firstPass=0; + else if (config.responsive) ctx.firstPass=7; + else ctx.firstPass=7; + subUpdateChart(ctx,data,config) ; + + } +}; + +function subUpdateChart(ctx,data,config) { + // ctx.firstPass==undefined => graph never drawn + // ctx.firstPass==0 => graph is drawn but need to be redrawn with animation + // ctx.firstPass==1 => graph is drawn with animation + // ctx.firstPass==2 => graph is in animation but at the end the graph need perhaps to be redrawn; + // ctx.firstPass==3 => graph currently drawing without animation; + // ctx.firstPass==4 => graph currently drawing without animationb but at the end, the graph need perhaps to be redrawn; + // ctx.firstPass==5 => graph is displayed ; + // ctx.firstPass==6 => graph is displayed but need to be redraw without animation (because of a resize); + // ctx.firstPass==7 => graph is displayed but need to be redraw without responsivity; + if(!dynamicFunction(data, config, ctx)) { return; } + var newSize; + if(typeof ctx.firstPass == "undefined") { + ctx.firstPass=1; + newSize=resizeGraph(ctx,config); + if(config.responsive) { + resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); + ctx.prevWidth=newSize.newWidth; + ctx.prevHeight=newSize.newHeight; + } else { + ctx.prevWidth=0; + ctx.prevHeight=0; + } + ctx.runanimationcompletefunction=true; + redrawGraph(ctx,data,config); + } else if(ctx.firstPass == 0) { + ctx.firstPass=1; + newSize=resizeGraph(ctx,config); + if(config.responsive) { + resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); + ctx.prevWidth=newSize.newWidth; + ctx.prevHeight=newSize.newHeight; + } else { + ctx.prevWidth=0; + ctx.prevHeight=0; + } + redrawGraph(ctx,data,config); + } else if(ctx.firstPass==1 || ctx.firstPass==2) { + ctx.firstPass=2; + } else if (ctx.firstPass==3 || ctx.firstPass==4) { + ctx.firstPass=4; + } else if(ctx.firstPass==5) { + ctx.firstPass=1; + redrawGraph(ctx,data,config); + } else if(ctx.firstPass==6) { + newSize=resizeGraph(ctx,config); + if (newSize.newWidth!=ctx.prevWidth || newSize.newHeight != ctx.prevHeight) { + ctx.firstPass=3; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + if(config.responsive) { + resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); + ctx.prevWidth=newSize.newWidth; + ctx.prevHeight=newSize.newHeight; + } else { + ctx.prevWidth=0; + ctx.prevHeight=0; + } + redrawGraph(ctx,data,config); + } else ctx.firstPass=5; + } else if(ctx.firstPass==7) { + newSize=resizeGraph(ctx,config); + ctx.firstPass=3; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + if(config.responsive) { + resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); + ctx.prevWidth=newSize.newWidth; + ctx.prevHeight=newSize.newHeight; + } else { + ctx.prevWidth=0; + ctx.prevHeight=0; + } + redrawGraph(ctx,data,config); + } +}; + +function redrawGraph(ctx,data,config) { + var myGraph = new Chart(ctx); + switch (ctx.tpchart) { + case "Bar": + myGraph.Bar(data,config); + break; + case "Pie": + myGraph.Pie(data,config); + break; + case "Doughnut": + myGraph.Doughnut(data,config); + break; + case "Radar": + myGraph.Radar(data,config); + break; + case "PolarArea": + myGraph.PolarArea(data,config); + break; + case "HorizontalBar": + myGraph.HorizontalBar(data,config); + break; + case "StackedBar": + myGraph.StackedBar(data,config); + break; + case "HorizontalStackedBar": + myGraph.HorizontalStackedBar(data,config); + break; + case "Line": + myGraph.Line(data,config); + break; + } +}; + + +//Default browsercheck, added to all scripts! +function checkBrowser() { + this.ver = navigator.appVersion + this.dom = document.getElementById ? 1 : 0 + this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0; + this.ie4 = (document.all && !this.dom) ? 1 : 0; + this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0; + this.ns4 = (document.layers && !this.dom) ? 1 : 0; + this.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns5) + return this +}; +bw = new checkBrowser(); +//Set these variables: +fromLeft = 10; // How much from the left of the cursor should the div be? +fromTop = 10; // How much from the top of the cursor should the div be? +/******************************************************************** +Initilizes the objects +*********************************************************************/ +function cursorInit() { + scrolled = bw.ns4 || bw.ns5 ? "window.pageYOffset" : "document.body.scrollTop" + if (bw.ns4) document.captureEvents(Event.MOUSEMOVE) +}; +/******************************************************************** +Contructs the cursorobjects +*********************************************************************/ +function makeCursorObj(obj, nest) { + createCursorDiv(); + nest = (!nest) ? '' : 'document.' + nest + '.' + this.css = bw.dom ? document.getElementById(obj).style : bw.ie4 ? document.all[obj].style : bw.ns4 ? eval(nest + "document.layers." + obj) : 0; + this.moveIt = b_moveIt; + cursorInit(); + return this +}; + +function b_moveIt(x, y) { + this.x = x; + this.y = y; + this.css.left = this.x + "px"; + this.css.top = this.y + "px"; +}; + +function isIE() { + var myNav = navigator.userAgent.toLowerCase(); + return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; +}; + +function mergeChartConfig(defaults, userDefined) { + var returnObj = {}; + for (var attrname in defaults) { + returnObj[attrname] = defaults[attrname]; + } + for (var attrnameBis in userDefined) { + returnObj[attrnameBis] = userDefined[attrnameBis]; + } + return returnObj; +}; + +function sleep(ms) { + var dt = new Date(); + dt.setTime(dt.getTime() + ms); + while (new Date().getTime() < dt.getTime()) {}; +}; + +function saveCanvas(ctx, data, config) { + cvSave = ctx.getImageData(0, 0, ctx.canvas.width, ctx.canvas.height); + var saveCanvasConfig = { + savePng: false, + annotateDisplay: false, + animation: false, + dynamicDisplay: false + }; + var savePngConfig = mergeChartConfig(config, saveCanvasConfig); + savePngConfig.clearRect = false; + /* And ink them */ + + redrawGraph(ctx,data,savePngConfig); + var image; + if (config.savePngOutput == "NewWindow") { + image = ctx.canvas.toDataURL(); + ctx.putImageData(cvSave, 0, 0); + window.open(image, '_blank'); + } + if (config.savePngOutput == "CurrentWindow") { + image = ctx.canvas.toDataURL(); + ctx.putImageData(cvSave, 0, 0); + window.location.href = image; + } + if (config.savePngOutput == "Save") { + image = ctx.canvas.toDataURL(); + var downloadLink = document.createElement("a"); + downloadLink.href = image; + downloadLink.download = config.savePngName + ".png"; + document.body.appendChild(downloadLink); + downloadLink.click(); + document.body.removeChild(downloadLink); + } +}; +if (typeof String.prototype.trim !== 'function') { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + } +}; +var dynamicDisplay = new Array(); +var dynamicDisplayList = new Array(); + +function dynamicFunction(data, config, ctx) { + + if (isIE() < 9 && isIE() != false) return(true); + + + if (config.dynamicDisplay) { + if (ctx.canvas.id == "") { + var cvdate = new Date(); + var cvmillsec = cvdate.getTime(); + ctx.canvas.id = "Canvas_" + cvmillsec; + } + if (typeof(dynamicDisplay[ctx.canvas.id]) == "undefined") { + dynamicDisplayList[dynamicDisplayList["length"]] = ctx.canvas.id; + dynamicDisplay[ctx.canvas.id] = [ctx, false, false, data, config, ctx.canvas]; + dynamicDisplay[ctx.canvas.id][1] = isScrolledIntoView(ctx.canvas); + window.onscroll = scrollFunction; + } else if (dynamicDisplay[ctx.canvas.id][2] == false) { + dynamicDisplay[ctx.canvas.id][1] = isScrolledIntoView(ctx.canvas); + } + if (dynamicDisplay[ctx.canvas.id][1] == false && dynamicDisplay[ctx.canvas.id][2] == false) { + return false; + } + dynamicDisplay[ctx.canvas.id][2] = true; + } + return true; +}; + +function isScrolledIntoView(element) { + var xPosition = 0; + var yPosition = 0; + elem = element; + while (elem) { + xPosition += (elem.offsetLeft - elem.scrollLeft + elem.clientLeft); + yPosition += (elem.offsetTop - elem.scrollTop + elem.clientTop); + elem = elem.offsetParent; + } + if (xPosition + element.width / 2 >= window.pageXOffset && + xPosition + element.width / 2 <= window.pageXOffset + window.innerWidth && + yPosition + element.height / 2 >= window.pageYOffset && + yPosition + element.height / 2 <= window.pageYOffset + window.innerHeight + ) return (true); + else return false; +}; + +function scrollFunction() { + for (var i = 0; i < dynamicDisplayList["length"]; i++) { + if (isScrolledIntoView(dynamicDisplay[dynamicDisplayList[i]][5]) && dynamicDisplay[dynamicDisplayList[i]][2] == false) { + dynamicDisplay[dynamicDisplayList[i]][1] = true; + redrawGraph(dynamicDisplay[dynamicDisplayList[i]][0],dynamicDisplay[dynamicDisplayList[i]][3], dynamicDisplay[dynamicDisplayList[i]][4]); + } + } +}; + +var jsGraphAnnotate = new Array(); + +function clearAnnotate(ctxid) { + jsGraphAnnotate[ctxid] = []; +}; + +function getMousePos(canvas, evt) { + var rect = canvas.getBoundingClientRect(); + return { + x: evt.clientX - rect.left, + y: evt.clientY - rect.top + }; +}; + +function doMouseAction(config, ctx, event, data, action, funct) { + + var onData = false; + var textMsr; + + if (action == "annotate") { + var annotateDIV = document.getElementById('divCursor'); + var show = false; + annotateDIV.className = (config.annotateClassName) ? config.annotateClassName : ''; + annotateDIV.style.border = (config.annotateClassName) ? '' : config.annotateBorder; + annotateDIV.style.padding = (config.annotateClassName) ? '' : config.annotatePadding; + annotateDIV.style.borderRadius = (config.annotateClassName) ? '' : config.annotateBorderRadius; + annotateDIV.style.backgroundColor = (config.annotateClassName) ? '' : config.annotateBackgroundColor; + annotateDIV.style.color = (config.annotateClassName) ? '' : config.annotateFontColor; + annotateDIV.style.fontFamily = (config.annotateClassName) ? '' : config.annotateFontFamily; + annotateDIV.style.fontSize = (config.annotateClassName) ? '' : (Math.ceil(ctx.chartTextScale*config.annotateFontSize)).toString() + "pt"; + annotateDIV.style.fontStyle = (config.annotateClassName) ? '' : config.annotateFontStyle; + annotateDIV.style.zIndex = 999; + ctx.save(); + ctx.font= annotateDIV.style.fontStyle+" "+ annotateDIV.style.fontSize+" "+annotateDIV.style.fontFamily; + var rect = ctx.canvas.getBoundingClientRect(); + } + if (action=="annotate") { + show=false; + annotateDIV.style.display = show ? '' : 'none'; + } + canvas_pos = getMousePos(ctx.canvas, event); + for (var i = 0; i < jsGraphAnnotate[ctx.ChartNewId]["length"]; i++) { + if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "ARC") { + myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]]; + distance = Math.sqrt((canvas_pos.x - myStatData.midPosX) * (canvas_pos.x - myStatData.midPosX) + (canvas_pos.y - myStatData.midPosY) * (canvas_pos.y - myStatData.midPosY)); + if (distance > myStatData.int_radius && distance < myStatData.radiusOffset) { + angle = (Math.acos((canvas_pos.x - myStatData.midPosX) / distance) % (2* Math.PI) + 2*Math.PI) % (2*Math.PI); + if (canvas_pos.y < myStatData.midPosY) angle = -angle; + angle = (((angle + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + myStatData.startAngle=(((myStatData.startAngle + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); + myStatData.endAngle=(((myStatData.endAngle + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); + if(myStatData.endAngle<myStatData.startAngle)myStatData.endAngle+=2 * Math.PI; + if ((angle > myStatData.startAngle && angle < myStatData.endAngle) || (angle > myStatData.startAngle - 2 * Math.PI && angle < myStatData.endAngle - 2 * Math.PI) || (angle > myStatData.startAngle + 2 * Math.PI && angle < myStatData.endAngle + 2 * Math.PI)) { + myStatData.graphPosX = canvas_pos.x; + myStatData.graphPosY = canvas_pos.y; + onData = true; + if (action == "annotate") { + dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],-1,{otherVal:true}), myStatData,config); + textMsr=ctx.measureTextMultiLine(dispString); + ctx.restore(); + annotateDIV.innerHTML = dispString; + show = true; + } else { + funct(event, ctx, config, data, myStatData ); + } + if (action == "annotate") { + x = bw.ns4 || bw.ns5 ? event.pageX : event.x; + y = bw.ns4 || bw.ns5 ? event.pageY : event.y; + if (bw.ie4 || bw.ie5) y = y + eval(scrolled); + if(config.annotateRelocate && x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-10) oCursor.moveIt(x + fromLeft-textMsr.textWidth, y + fromTop); + else oCursor.moveIt(x + fromLeft, y + fromTop); + } + } + } + } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "RECT") { + myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]]; + + if (canvas_pos.x > Math.min(myStatData.xPosLeft,myStatData.xPosRight) && canvas_pos.x < Math.max(myStatData.xPosLeft,myStatData.xPosRight) && canvas_pos.y < Math.max(myStatData.yPosBottom,myStatData.yPosTop) && canvas_pos.y > Math.min(myStatData.yPosBottom,myStatData.yPosTop)) { + myStatData.graphPosX = canvas_pos.x; + myStatData.graphPosY = canvas_pos.y; + onData = true; + if (action == "annotate") { + dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],{otherVal:true}), myStatData,config); + textMsr=ctx.measureTextMultiLine(dispString); + ctx.restore(); + annotateDIV.innerHTML = dispString; + show = true; + } else { + funct(event, ctx, config, data, myStatData ); + } + if (action == "annotate") { + x = bw.ns4 || bw.ns5 ? event.pageX : event.x; + y = bw.ns4 || bw.ns5 ? event.pageY : event.y; + if (bw.ie4 || bw.ie5) y = y + eval(scrolled); + if(config.annotateRelocate && x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-10) oCursor.moveIt(x + fromLeft-textMsr.textWidth, y + fromTop); + else oCursor.moveIt(x + fromLeft, y + fromTop); + } + } + } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "POINT") { + myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]]; + var distance; + if(config.detectAnnotateOnFullLine) { + if(canvas_pos.x < Math.min(myStatData.annotateStartPosX,myStatData.annotateEndPosX)-Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius) || canvas_pos.x > Math.max(myStatData.annotateStartPosX,myStatData.annotateEndPosX)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius) || canvas_pos.y < Math.min(myStatData.annotateStartPosY,myStatData.annotateEndPosY)-Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius) || canvas_pos.y > Math.max(myStatData.annotateStartPosY,myStatData.annotateEndPosY)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)) { + distance=Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)+1; + } else { + if(typeof myStatData.D1A=="undefined") { + distance=Math.abs(canvas_pos.x-myStatData.posX); + } else if(typeof myStatData.D2A=="undefined") { + distance=Math.abs(canvas_pos.y-myStatData.posY); + } else { + var D2B=-myStatData.D2A*canvas_pos.x+canvas_pos.y; + var g=-(myStatData.D1B-D2B)/(myStatData.D1A-myStatData.D2A); + var h=myStatData.D2A*g+D2B; + distance=Math.sqrt((canvas_pos.x - g) * (canvas_pos.x - g) + (canvas_pos.y - h) * (canvas_pos.y - h)); + } + + } + + } else { + distance = Math.sqrt((canvas_pos.x - myStatData.posX) * (canvas_pos.x - myStatData.posX) + (canvas_pos.y - myStatData.posY) * (canvas_pos.y - myStatData.posY)); + } + if (distance < Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)) { + myStatData.graphPosX = canvas_pos.x; + myStatData.graphPosY = canvas_pos.y; + onData = true; + if (action == "annotate") { + dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],{otherVal:true}), myStatData,config); + textMsr=ctx.measureTextMultiLine(dispString); + ctx.restore(); + annotateDIV.innerHTML = dispString; + show = true; + } else { + funct(event, ctx, config, data, myStatData); + } + if (action == "annotate") { + x = bw.ns4 || bw.ns5 ? event.pageX : event.x; + y = bw.ns4 || bw.ns5 ? event.pageY : event.y; + if (bw.ie4 || bw.ie5) y = y + eval(scrolled); + if(config.annotateRelocate && x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-10) oCursor.moveIt(x + fromLeft-textMsr.textWidth, y + fromTop); + else oCursor.moveIt(x + fromLeft, y + fromTop); + } + } + } + if (action == "annotate") { + annotateDIV.style.display = show ? '' : 'none'; + } + } + if (onData == false && action != "annotate") { + funct(event, ctx, config, data, null); + } +}; +///////// GRAPHICAL PART OF THE SCRIPT /////////////////////////////////////////// +//Define the global Chart Variable as a class. +window.Chart = function(context) { + var chart = this; + //Easing functions adapted from Robert Penner's easing equations + //http://www.robertpenner.com/easing/ + var animationOptions = { + linear: function(t) { + return t; + }, + easeInQuad: function(t) { + return t * t; + }, + easeOutQuad: function(t) { + return -1 * t * (t - 2); + }, + easeInOutQuad: function(t) { + if ((t /= 1 / 2) < 1) return 1 / 2 * t * t; + return -1 / 2 * ((--t) * (t - 2) - 1); + }, + easeInCubic: function(t) { + return t * t * t; + }, + easeOutCubic: function(t) { + return 1 * ((t = t / 1 - 1) * t * t + 1); + }, + easeInOutCubic: function(t) { + if ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t; + return 1 / 2 * ((t -= 2) * t * t + 2); + }, + easeInQuart: function(t) { + return t * t * t * t; + }, + easeOutQuart: function(t) { + return -1 * ((t = t / 1 - 1) * t * t * t - 1); + }, + easeInOutQuart: function(t) { + if ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t * t; + return -1 / 2 * ((t -= 2) * t * t * t - 2); + }, + easeInQuint: function(t) { + return 1 * (t /= 1) * t * t * t * t; + }, + easeOutQuint: function(t) { + return 1 * ((t = t / 1 - 1) * t * t * t * t + 1); + }, + easeInOutQuint: function(t) { + if ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t * t * t; + return 1 / 2 * ((t -= 2) * t * t * t * t + 2); + }, + easeInSine: function(t) { + return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1; + }, + easeOutSine: function(t) { + return 1 * Math.sin(t / 1 * (Math.PI / 2)); + }, + easeInOutSine: function(t) { + return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1); + }, + easeInExpo: function(t) { + return (t == 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1)); + }, + easeOutExpo: function(t) { + return (t == 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1); + }, + easeInOutExpo: function(t) { + if (t == 0) return 0; + if (t == 1) return 1; + if ((t /= 1 / 2) < 1) return 1 / 2 * Math.pow(2, 10 * (t - 1)); + return 1 / 2 * (-Math.pow(2, -10 * --t) + 2); + }, + easeInCirc: function(t) { + if (t >= 1) return t; + return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1); + }, + easeOutCirc: function(t) { + return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t); + }, + easeInOutCirc: function(t) { + if ((t /= 1 / 2) < 1) return -1 / 2 * (Math.sqrt(1 - t * t) - 1); + return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1); + }, + easeInElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t == 0) return 0; + if ((t /= 1) == 1) return 1; + if (!p) p = 1 * .3; + if (a < Math.abs(1)) { + a = 1; + s = p / 4; + } else s = p / (2 * Math.PI) * Math.asin(1 / a); + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p)); + }, + easeOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t == 0) return 0; + if ((t /= 1) == 1) return 1; + if (!p) p = 1 * .3; + if (a < Math.abs(1)) { + a = 1; + s = p / 4; + } else s = p / (2 * Math.PI) * Math.asin(1 / a); + return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1; + }, + easeInOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t == 0) return 0; + if ((t /= 1 / 2) == 2) return 1; + if (!p) p = 1 * (.3 * 1.5); + if (a < Math.abs(1)) { + a = 1; + s = p / 4; + } else s = p / (2 * Math.PI) * Math.asin(1 / a); + if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p)); + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * .5 + 1; + }, + easeInBack: function(t) { + var s = 1.70158; + return 1 * (t /= 1) * t * ((s + 1) * t - s); + }, + easeOutBack: function(t) { + var s = 1.70158; + return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1); + }, + easeInOutBack: function(t) { + var s = 1.70158; + if ((t /= 1 / 2) < 1) return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)); + return 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2); + }, + easeInBounce: function(t) { + return 1 - animationOptions.easeOutBounce(1 - t); + }, + easeOutBounce: function(t) { + if ((t /= 1) < (1 / 2.75)) { + return 1 * (7.5625 * t * t); + } else if (t < (2 / 2.75)) { + return 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + .75); + } else if (t < (2.5 / 2.75)) { + return 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375); + } else { + return 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375); + } + }, + easeInOutBounce: function(t) { + if (t < 1 / 2) return animationOptions.easeInBounce(t * 2) * .5; + return animationOptions.easeOutBounce(t * 2 - 1) * .5 + 1 * .5; + } + }; + //Variables global to the chart + var width = context.canvas.width; + var height = context.canvas.height; + //High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale. + if (window.devicePixelRatio) { + context.canvas.style.width = width + "px"; + context.canvas.style.height = height + "px"; + context.canvas.height = height * window.devicePixelRatio; + context.canvas.width = width * window.devicePixelRatio; + context.scale(window.devicePixelRatio, window.devicePixelRatio); + }; + this.PolarArea = function(data, options) { + chart.PolarArea.defaults = { + inGraphDataShow: false, + inGraphDataPaddingRadius: 5, + inGraphDataPaddingAngle: 0, + inGraphDataTmpl: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataVAlign: "off-center", // "bottom", "center", "top", "off-center" or "to-center" + inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataRadiusPosition: 3, + inGraphDataAnglePosition: 2, + scaleOverlay: true, + scaleOverride: false, + scaleOverride2: false, + scaleGridLinesStep : 1, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleShowLine: true, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineWidth: 1, + scaleLineStyle: "solid", + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowLabelBackdrop: true, + scaleBackdropColor: "rgba(255,255,255,0.75)", + scaleBackdropPaddingY: 2, + scaleBackdropPaddingX: 2, + segmentShowStroke: true, + segmentStrokeColor: "#fff", + segmentStrokeStyle: "solid", + segmentStrokeWidth: 2, + animation: true, + animationByData : "ByArc", + animationSteps: 100, + animationEasing: "easeOutBounce", + animateRotate: true, + animateScale: false, + onAnimationComplete: null, + annotateLabel: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + startAngle: 90 + }; + chart.PolarArea.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.PolarArea.defaults); + chart.PolarArea.defaults = mergeChartConfig(chart.PolarArea.defaults, charJSPersonalDefaultOptions); + chart.PolarArea.defaults = mergeChartConfig(chart.PolarArea.defaults, charJSPersonalDefaultOptionsPolarArea); + var config = (options) ? mergeChartConfig(chart.PolarArea.defaults, options) : chart.PolarArea.defaults; + return new PolarArea(data, config, context); + }; + this.Radar = function(data, options) { + chart.Radar.defaults = { + inGraphDataShow: false, + inGraphDataPaddingRadius: 5, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataVAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataRadiusPosition: 3, + yAxisMinimumInterval: "none", + scaleGridLinesStep : 1, + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleShowLine: true, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: false, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowLabelBackdrop: true, + scaleBackdropColor: "rgba(255,255,255,0.75)", + scaleBackdropPaddingY: 2, + scaleBackdropPaddingX: 2, + angleShowLineOut: true, + angleLineColor: "rgba(0,0,0,.1)", + angleLineStyle: "solid", + angleLineWidth: 1, + pointLabelFontFamily: "'Arial'", + pointLabelFontStyle: "normal", + pointLabelFontSize: 12, + pointLabelFontColor: "#666", + pointDot: true, + pointDotRadius: 3, + pointDotStrokeWidth: 1, + pointDotStrokeStyle:"solid", + datasetFill: true, + datasetStrokeWidth: 2, + datasetStrokeStyle:"solid", + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + onAnimationComplete: null, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>", + pointHitDetectionRadius : 10, + startAngle: 90 + }; + // merge annotate defaults + chart.Radar.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Radar.defaults); + chart.Radar.defaults = mergeChartConfig(chart.Radar.defaults, charJSPersonalDefaultOptions); + chart.Radar.defaults = mergeChartConfig(chart.Radar.defaults, charJSPersonalDefaultOptionsRadar); + var config = (options) ? mergeChartConfig(chart.Radar.defaults, options) : chart.Radar.defaults; + return new Radar(data, config, context); + }; + this.Pie = function(data, options) { + chart.Pie.defaults = { + inGraphDataShow: false, + inGraphDataPaddingRadius: 5, + inGraphDataPaddingAngle: 0, + inGraphDataTmpl: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataVAlign: "off-center", // "bottom", "center", "top", "off-center" or "to-center" + inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataRadiusPosition: 3, + inGraphDataAnglePosition: 2, + inGraphDataMinimumAngle : 0, + segmentShowStroke: true, + segmentStrokeColor: "#fff", + segmentStrokeStyle: "solid", + segmentStrokeWidth: 2, + animation: true, + animationByData : false, + animationSteps: 100, + animationEasing: "easeOutBounce", + animateRotate: true, + animateScale: false, + onAnimationComplete: null, + annotateLabel: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + startAngle: 90, + radiusScale: 1 + }; + // merge annotate defaults + chart.Pie.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Pie.defaults); + chart.Pie.defaults = mergeChartConfig(chart.Pie.defaults, charJSPersonalDefaultOptions); + chart.Pie.defaults = mergeChartConfig(chart.Pie.defaults, charJSPersonalDefaultOptionsPie); + var config = (options) ? mergeChartConfig(chart.Pie.defaults, options) : chart.Pie.defaults; + return new Pie(data, config, context); + }; + this.Doughnut = function(data, options) { + chart.Doughnut.defaults = { + inGraphDataShow: false, + inGraphDataPaddingRadius: 5, + inGraphDataPaddingAngle: 0, + inGraphDataTmpl: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataVAlign: "off-center", // "bottom", "middle", "top", "off-center" or "to-center" + inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataRadiusPosition: 3, + inGraphDataAnglePosition: 2, + inGraphDataMinimumAngle : 0, + segmentShowStroke: true, + segmentStrokeColor: "#fff", + segmentStrokeStyle: "solid", + segmentStrokeWidth: 2, + percentageInnerCutout: 50, + animation: true, + animationByData : false, + animationSteps: 100, + animationEasing: "easeOutBounce", + animateRotate: true, + animateScale: false, + onAnimationComplete: null, + annotateLabel: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", + startAngle: 90, + radiusScale: 1 + }; + // merge annotate defaults + chart.Doughnut.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Doughnut.defaults); + chart.Doughnut.defaults = mergeChartConfig(chart.Doughnut.defaults, charJSPersonalDefaultOptions); + chart.Doughnut.defaults = mergeChartConfig(chart.Doughnut.defaults, charJSPersonalDefaultOptionsDoughnut); + var config = (options) ? mergeChartConfig(chart.Doughnut.defaults, options) : chart.Doughnut.defaults; + return new Doughnut(data, config, context); + }; + this.Line = function(data, options) { + chart.Line.defaults = { + inGraphDataShow: false, + inGraphDataPaddingX: 3, + inGraphDataPaddingY: 3, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "left", + inGraphDataVAlign: "bottom", + inGraphDataRotate: 0, + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + drawXScaleLine: [{ + position: "bottom" + }], + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleSteps2: null, + scaleStepWidth2: null, + scaleStartValue2: null, + scaleLabel2 : "<%=value%>", + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowGridLines: true, + scaleXGridLinesStep: 1, + scaleYGridLinesStep: 1, + scaleGridLineColor: "rgba(0,0,0,.05)", + scaleGridLineStyle: "solid", + scaleGridLineWidth: 1, + showYAxisMin: true, // Show the minimum value on Y axis (in original version, this minimum is not displayed - it can overlap the X labels) + rotateLabels: "smart", // smart <=> 0 degre if space enough; otherwise 45 degres if space enough otherwise90 degre; + // you can force an integer value between 0 and 180 degres + logarithmic: false, // can be 'fuzzy',true and false ('fuzzy' => if the gap between min and maximum is big it's using a logarithmic y-Axis scale + logarithmic2: false, // can be 'fuzzy',true and false ('fuzzy' => if the gap between min and maximum is big it's using a logarithmic y-Axis scale + scaleTickSizeLeft: 5, + scaleTickSizeRight: 5, + scaleTickSizeBottom: 5, + scaleTickSizeTop: 5, + bezierCurve: true, + bezierCurveTension : 0.4, + pointDot: true, + pointDotRadius: 4, + pointDotStrokeStyle: "solid", + pointDotStrokeWidth: 2, + datasetStrokeStyle: "solid", + datasetStrokeWidth: 2, + datasetFill: true, + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + extrapolateMissingData: true, + onAnimationComplete: null, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>", + pointHitDetectionRadius : 10 + }; + // merge annotate defaults + chart.Line.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Line.defaults); + chart.Line.defaults = mergeChartConfig(chart.defaults.xyAxisCommonOptions, chart.Line.defaults); + chart.Line.defaults = mergeChartConfig(chart.Line.defaults, charJSPersonalDefaultOptions); + chart.Line.defaults = mergeChartConfig(chart.Line.defaults, charJSPersonalDefaultOptionsLine); + var config = (options) ? mergeChartConfig(chart.Line.defaults, options) : chart.Line.defaults; + return new Line(data, config, context); + }; + this.StackedBar = function(data, options) { + chart.StackedBar.defaults = { + inGraphDataShow: false, + inGraphDataPaddingX: 0, + inGraphDataPaddingY: -3, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "center", + inGraphDataVAlign: "top", + inGraphDataRotate: 0, + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataXPosition: 2, + inGraphDataYPosition: 3, + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowGridLines: true, + scaleXGridLinesStep: 1, + scaleYGridLinesStep: 1, + scaleGridLineColor: "rgba(0,0,0,.05)", + scaleGridLineStyle: "solid", + scaleGridLineWidth: 1, + showYAxisMin: true, // Show the minimum value on Y axis (in original version, this minimum is not displayed - it can overlap the X labels) + rotateLabels: "smart", // smart <=> 0 degre if space enough; otherwise 45 degres if space enough otherwise90 degre; + // you can force an integer value between 0 and 180 degres + scaleTickSizeLeft: 5, + scaleTickSizeRight: 5, + scaleTickSizeBottom: 5, + scaleTickSizeTop: 5, + pointDot: true, + pointDotRadius: 4, + pointDotStrokeStyle: "solid", + pointDotStrokeWidth: 2, + barShowStroke: true, +// barStrokeStyle: "solid", + barStrokeWidth: 2, + barValueSpacing: 5, + barDatasetSpacing: 1, + spaceBetweenBar : 0, + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + onAnimationComplete: null, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>", + pointHitDetectionRadius : 10 + }; + // merge annotate defaults + chart.StackedBar.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.StackedBar.defaults); + chart.StackedBar.defaults = mergeChartConfig(chart.defaults.xyAxisCommonOptions, chart.StackedBar.defaults); + chart.StackedBar.defaults = mergeChartConfig(chart.StackedBar.defaults, charJSPersonalDefaultOptions); + chart.StackedBar.defaults = mergeChartConfig(chart.StackedBar.defaults, charJSPersonalDefaultOptionsStackedBar); + var config = (options) ? mergeChartConfig(chart.StackedBar.defaults, options) : chart.StackedBar.defaults; + return new StackedBar(data, config, context); + }; + this.HorizontalStackedBar = function(data, options) { + chart.HorizontalStackedBar.defaults = { + inGraphDataShow: false, + inGraphDataPaddingX: -3, + inGraphDataPaddingY: 0, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "right", + inGraphDataVAlign: "middle", + inGraphDataRotate: 0, + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataXPosition: 3, + inGraphDataYPosition: 2, + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowGridLines: true, + scaleXGridLinesStep: 1, + scaleYGridLinesStep: 1, + scaleGridLineColor: "rgba(0,0,0,.05)", + scaleGridLineStyle: "solid", + scaleGridLineWidth: 1, + scaleTickSizeLeft: 5, + scaleTickSizeRight: 5, + scaleTickSizeBottom: 5, + scaleTickSizeTop: 5, + showYAxisMin: true, // Show the minimum value on Y axis (in original version, this minimum is not displayed - it can overlap the X labels) + rotateLabels: "smart", // smart <=> 0 degre if space enough; otherwise 45 degres if space enough otherwise90 degre; + barShowStroke: true, +// barStrokeStyle: "solid", + barStrokeWidth: 2, + barValueSpacing: 5, + barDatasetSpacing: 1, + spaceBetweenBar : 0, + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + onAnimationComplete: null, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>", + reverseOrder: false + }; + // merge annotate defaults + chart.HorizontalStackedBar.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.HorizontalStackedBar.defaults); + chart.HorizontalStackedBar.defaults = mergeChartConfig(chart.defaults.xyAxisCommonOptions, chart.HorizontalStackedBar.defaults); + chart.HorizontalStackedBar.defaults = mergeChartConfig(chart.HorizontalStackedBar.defaults, charJSPersonalDefaultOptions); + chart.HorizontalStackedBar.defaults = mergeChartConfig(chart.HorizontalStackedBar.defaults, charJSPersonalDefaultOptionsHorizontalStackedBar); + var config = (options) ? mergeChartConfig(chart.HorizontalStackedBar.defaults, options) : chart.HorizontalStackedBar.defaults; + return new HorizontalStackedBar(data, config, context); + }; + this.Bar = function(data, options) { + chart.Bar.defaults = { + inGraphDataShow: false, + inGraphDataPaddingX: 0, + inGraphDataPaddingY: 3, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "center", + inGraphDataVAlign: "bottom", + inGraphDataRotate: 0, + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataXPosition: 2, + inGraphDataYPosition: 3, + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleSteps2: null, + scaleStepWidth2: null, + scaleStartValue2: null, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleLabel2: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowGridLines: true, + scaleXGridLinesStep: 1, + scaleYGridLinesStep: 1, + scaleGridLineColor: "rgba(0,0,0,.05)", + scaleGridLineWidth: 1, + scaleGridLineStyle: "solid", + showYAxisMin: true, // Show the minimum value on Y axis (in original version, this minimum is not displayed - it can overlap the X labels) + rotateLabels: "smart", // smart <=> 0 degre if space enough; otherwise 45 degres if space enough otherwise90 degre; + // you can force an integer value between 0 and 180 degres + logarithmic: false, // can be 'fuzzy',true and false ('fuzzy' => if the gap between min and maximum is big it's using a logarithmic y-Axis scale + logarithmic2: false, // can be 'fuzzy',true and false ('fuzzy' => if the gap between min and maximum is big it's using a logarithmic y-Axis scale + scaleTickSizeLeft: 5, + scaleTickSizeRight: 5, + scaleTickSizeBottom: 5, + scaleTickSizeTop: 5, + barShowStroke: true, +// barStrokeStyle: "solid", + barStrokeWidth: 2, + barValueSpacing: 5, + barDatasetSpacing: 1, + barBorderRadius: 0, + pointDot: true, + pointDotRadius: 4, + pointDotStrokeStyle: "solid", + pointDotStrokeWidth: 2, + extrapolateMissingData: true, + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + onAnimationComplete: null, + bezierCurve: true, + bezierCurveTension : 0.4, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>", + pointHitDetectionRadius : 10 + }; + // merge annotate defaults + chart.Bar.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Bar.defaults); + chart.Bar.defaults = mergeChartConfig(chart.defaults.xyAxisCommonOptions, chart.Bar.defaults); + chart.Bar.defaults = mergeChartConfig(chart.Bar.defaults, charJSPersonalDefaultOptions); + chart.Bar.defaults = mergeChartConfig(chart.Bar.defaults, charJSPersonalDefaultOptionsBar); + var config = (options) ? mergeChartConfig(chart.Bar.defaults, options) : chart.Bar.defaults; + return new Bar(data, config, context); + }; + this.HorizontalBar = function(data, options) { + chart.HorizontalBar.defaults = { + inGraphDataShow: false, + inGraphDataPaddingX: 3, + inGraphDataPaddingY: 0, + inGraphDataTmpl: "<%=v3%>", + inGraphDataAlign: "left", + inGraphDataVAlign: "middle", + inGraphDataRotate: 0, + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataXPosition: 3, + inGraphDataYPosition: 2, + scaleOverlay: false, + scaleOverride: false, + scaleOverride2: false, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineStyle: "solid", + scaleLineWidth: 1, + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowGridLines: true, + scaleXGridLinesStep: 1, + scaleYGridLinesStep: 1, + scaleGridLineColor: "rgba(0,0,0,.05)", + scaleGridLineStyle: "solid", + scaleGridLineWidth: 1, + scaleTickSizeLeft: 5, + scaleTickSizeRight: 5, + scaleTickSizeBottom: 5, + scaleTickSizeTop: 5, + showYAxisMin: true, // Show the minimum value on Y axis (in original version, this minimum is not displayed - it can overlap the X labels) + rotateLabels: "smart", // smart <=> 0 degre if space enough; otherwise 45 degres if space enough otherwise90 degre; + barShowStroke: true, +// barStrokeStyle: "solid", + barStrokeWidth: 2, + barValueSpacing: 5, + barDatasetSpacing: 1, + barBorderRadius: 0, + animation: true, + animationSteps: 60, + animationEasing: "easeOutQuart", + onAnimationComplete: null, + annotateLabel: "<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>", + reverseOrder: false + }; + // merge annotate defaults + chart.HorizontalBar.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.HorizontalBar.defaults); + chart.HorizontalBar.defaults = mergeChartConfig(chart.defaults.xyAxisCommonOptions, chart.HorizontalBar.defaults); + chart.HorizontalBar.defaults = mergeChartConfig(chart.HorizontalBar.defaults, charJSPersonalDefaultOptions); + chart.HorizontalBar.defaults = mergeChartConfig(chart.HorizontalBar.defaults, charJSPersonalDefaultOptionsHorizontalBar); + var config = (options) ? mergeChartConfig(chart.HorizontalBar.defaults, options) : chart.HorizontalBar.defaults; + return new HorizontalBar(data, config, context); + }; + chart.defaults = {}; + chart.defaults.commonOptions = { + chartTextScale : 1, + chartLineScale : 1, + chartSpaceScale : 1, + multiGraph: false, + clearRect: true, // do not change clearRect options; for internal use only + dynamicDisplay: false, + graphSpaceBefore: 5, + graphSpaceAfter: 5, + canvasBorders: false, + canvasBackgroundColor: "none", + canvasBordersWidth: 3, + canvasBordersStyle: "solid", + canvasBordersColor: "black", + zeroValue : 0.0000000001, + graphTitle: "", + graphTitleFontFamily: "'Arial'", + graphTitleFontSize: 24, + graphTitleFontStyle: "bold", + graphTitleFontColor: "#666", + graphTitleSpaceBefore: 5, + graphTitleSpaceAfter: 5, + graphTitleBorders : false, + graphTitleBordersColor : "black", + graphTitleBordersXSpace : 3, + graphTitleBordersYSpace : 3, + graphTitleBordersWidth : 1, + graphTitleBordersStyle : "solid", + graphTitleBackgroundColor : "none", + graphSubTitle: "", + graphSubTitleFontFamily: "'Arial'", + graphSubTitleFontSize: 18, + graphSubTitleFontStyle: "normal", + graphSubTitleFontColor: "#666", + graphSubTitleSpaceBefore: 5, + graphSubTitleSpaceAfter: 5, + graphSubTitleBorders : false, + graphSubTitleBordersColor : "black", + graphSubTitleBordersXSpace : 3, + graphSubTitleBordersYSpace : 3, + graphSubTitleBordersWidth : 1, + graphSubTitleBordersStyle : "solid", + graphSubTitleBackgroundColor : "none", + footNote: "", + footNoteFontFamily: "'Arial'", + footNoteFontSize: 8, + footNoteFontStyle: "bold", + footNoteFontColor: "#666", + footNoteSpaceBefore: 5, + footNoteSpaceAfter: 5, + footNoteBorders : false, + footNoteBordersColor : "black", + footNoteBordersXSpace : 3, + footNoteBordersYSpace : 3, + footNoteBordersWidth : 1, + footNoteBordersStyle : "solid", + footNoteBackgroundColor : "none", + legend : false, + showSingleLegend: false, + maxLegendCols : 999, + legendPosY :4, + legendPosX : -2, + legendFontFamily: "'Arial'", + legendFontSize: 12, + legendFontStyle: "normal", + legendFontColor: "#666", + legendBlockSize: 15, + legendBorders: true, + legendBordersStyle: "solid", + legendBordersWidth: 1, + legendBordersColors: "#666", + legendBordersSpaceBefore: 5, + legendBordersSpaceAfter: 5, + legendBordersSpaceLeft: 5, + legendBordersSpaceRight: 5, + legendSpaceBeforeText: 5, + legendSpaceAfterText: 5, + legendSpaceLeftText: 5, + legendSpaceRightText: 5, + legendSpaceBetweenTextVertical: 5, + legendSpaceBetweenTextHorizontal: 5, + legendSpaceBetweenBoxAndText: 5, + legendFillColor : "rgba(0,0,0,0)", + legendXPadding : 0, + legendYPadding : 0, + inGraphDataBorders : false, + inGraphDataBordersColor : "black", + inGraphDataBordersXSpace : 3, + inGraphDataBordersYSpace : 3, + inGraphDataBordersWidth : 1, + inGraphDataBordersStyle : "solid", + inGraphDataBackgroundColor : "none", + annotateDisplay: false, + annotateRelocate: false, + savePng: false, + savePngOutput: "NewWindow", // Allowed values : "NewWindow", "CurrentWindow", "Save" + savePngFunction: "mousedown right", + savePngBackgroundColor: 'WHITE', + annotateFunction: "mousemove", + annotateFontFamily: "'Arial'", + annotateBorder: 'none', + annotateBorderRadius: '2px', + annotateBackgroundColor: 'rgba(0,0,0,0.8)', + annotateFontSize: 12, + annotateFontColor: 'white', + annotateFontStyle: "normal", + annotatePadding: "3px", + annotateClassName: "", + crossText: [""], + crossTextIter: ["all"], + crossTextOverlay: [true], + crossTextFontFamily: ["'Arial'"], + crossTextFontSize: [12], + crossTextFontStyle: ["normal"], + crossTextFontColor: ["rgba(220,220,220,1)"], + crossTextRelativePosX: [2], + crossTextRelativePosY: [2], + crossTextBaseline: ["middle"], + crossTextAlign: ["center"], + crossTextPosX: [0], + crossTextPosY: [0], + crossTextAngle: [0], + crossTextFunction: null, + crossTextBorders : [false], + crossTextBordersColor : ["black"], + crossTextBordersXSpace : [3], + crossTextBordersYSpace : [3], + crossTextBordersWidth : [1], + crossTextBordersStyle : ["solid"], + crossTextBackgroundColor : ["none"], + crossImage: [undefined], + crossImageIter: ["all"], + crossImageOverlay: [true], + crossImageRelativePosX: [2], + crossImageRelativePosY: [2], + crossImageBaseline: ["middle"], + crossImageAlign: ["center"], + crossImagePosX: [0], + crossImagePosY: [0], + crossImageAngle: [0], + spaceTop: 0, + spaceBottom: 0, + spaceRight: 0, + spaceLeft: 0, + decimalSeparator: ".", + thousandSeparator: "", + roundNumber: "none", + roundPct: -1, + templatesOpenTag : "<%=", + templatesCloseTag : "%>", + fmtV1: "none", + fmtV2: "none", + fmtV3: "none", + fmtV4: "none", + fmtV5: "none", + fmtV6: "none", + fmtV6T: "none", + fmtV7: "none", + fmtV8: "none", + fmtV8T: "none", + fmtV9: "none", + fmtV10: "none", + fmtV11: "none", + fmtV12: "none", + fmtV13: "none", + fmtXLabel: "none", + fmtYLabel: "none", + fmtYLabel2: "none", + fmtLegend: "none", + animationStartValue: 0, + animationStopValue: 1, + animationCount: 1, + animationPauseTime: 5, + animationBackward: false, + animationStartWithDataset: 1, + animationStartWithData: 1, + animationLeftToRight: false, + animationByDataset: false, + defaultStrokeColor: "rgba(220,220,220,1)", + defaultFillColor: "rgba(220,220,220,0.5)", + defaultLineWidth : 2, + graphMaximized: false, + mouseDownRight: null, + mouseDownLeft: null, + mouseDownMiddle: null, + mouseMove: null, + mouseOut: null, + mouseWheel : null, + savePngName: "canvas", + responsive : false, + responsiveMinWidth : 0, + responsiveMinHeight : 0, + responsiveMaxWidth : 9999999, + responsiveMaxHeight : 9999999, + maintainAspectRatio: true, + responsiveScaleContent : false, + responsiveWindowInitialWidth : false, + pointMarker : "circle" // "circle","cross","plus","diamond","triangle","square" + }; + chart.defaults.xyAxisCommonOptions = { + yAxisMinimumInterval: "none", + yAxisMinimumInterval2: "none", + yScaleLabelsMinimumWidth: 0, + xScaleLabelsMinimumWidth: 0, + yAxisLeft: true, + yAxisRight: false, + xAxisBottom: true, + xAxisTop: false, + xAxisSpaceBetweenLabels: 5, + fullWidthGraph: false, + yAxisLabel: "", + yAxisLabel2: "", + yAxisFontFamily: "'Arial'", + yAxisFontSize: 16, + yAxisFontStyle: "normal", + yAxisFontColor: "#666", + yAxisLabelSpaceRight: 5, + yAxisLabelSpaceLeft: 5, + yAxisSpaceRight: 5, + yAxisSpaceLeft: 5, + yAxisLabelBorders : false, + yAxisLabelBordersColor : "black", + yAxisLabelBordersXSpace : 3, + yAxisLabelBordersYSpace : 3, + yAxisLabelBordersWidth : 1, + yAxisLabelBordersStyle : "solid", + yAxisLabelBackgroundColor : "none", + xAxisLabel: "", + xAxisFontFamily: "'Arial'", + xAxisFontSize: 16, + xAxisFontStyle: "normal", + xAxisFontColor: "#666", + xAxisLabelSpaceBefore: 5, + xAxisLabelSpaceAfter: 5, + xAxisSpaceBefore: 5, + xAxisSpaceAfter: 5, + xAxisLabelBorders : false, + xAxisLabelBordersColor : "black", + xAxisLabelBordersXSpace : 3, + xAxisLabelBordersYSpace : 3, + xAxisLabelBordersWidth : 1, + xAxisLabelBordersStyle : "solid", + xAxisLabelBackgroundColor : "none", + yAxisUnit: "", + yAxisUnit2: "", + yAxisUnitFontFamily: "'Arial'", + yAxisUnitFontSize: 8, + yAxisUnitFontStyle: "normal", + yAxisUnitFontColor: "#666", + yAxisUnitSpaceBefore: 5, + yAxisUnitSpaceAfter: 5, + yAxisUnitBorders : false, + yAxisUnitBordersColor : "black", + yAxisUnitBordersXSpace : 3, + yAxisUnitBordersYSpace : 3, + yAxisUnitBordersWidth : 1, + yAxisUnitBordersStyle : "solid", + yAxisUnitBackgroundColor : "none" + }; + var clear = function(c) { + c.clearRect(0, 0, width, height); + }; + + function init_and_start(ctx,data,config) { + + if (typeof ctx.initialWidth == "undefined") { + ctx.initialWidth =ctx.canvas.width; + } + if (typeof ctx.chartTextScale == "undefined") { + ctx.chartTextScale=config.chartTextScale; + } + if (typeof ctx.chartLineScale == "undefined") { + ctx.chartLineScale=config.chartLineScale; + } + if (typeof ctx.chartSpaceScale == "undefined") { + ctx.chartSpaceScale=config.chartSpaceScale; + } + if (typeof ctx.ChartNewId == "undefined") { + + ctx.runanimationcompletefunction=true; + var cvdate = new Date(); + var cvmillsec = cvdate.getTime(); + ctx.ChartNewId = ctx.tpchart + '_' + cvmillsec; + ctx._eventListeners = {}; + } + if (!dynamicFunction(data, config, ctx)) { + if(config.responsive && typeof ctx.firstPass == "undefined") { if(!config.multiGraph) { addResponsiveChart(ctx.ChartNewId,ctx,data,config); } } + return false; + } + if(config.responsive && typeof ctx.firstPass == "undefined") { + if(!config.multiGraph) { + addResponsiveChart(ctx.ChartNewId,ctx,data,config); + subUpdateChart(ctx,data,config); + return false; + } else { ctx.firstPass=1; } + } + + if (typeof jsGraphAnnotate[ctx.ChartNewId] == "undefined") jsGraphAnnotate[ctx.ChartNewId] = new Array(); + else if (!config.multiGraph) clearAnnotate(ctx.ChartNewId); + + defMouse(ctx, data, config); + + setRect(ctx, config); + + return true; + } ; + + var PolarArea = function(data, config, ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, msr, midPosX, midPosY; + ctx.tpchart="PolarArea"; + + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + + valueBounds = getValueBounds(); + + config.logarithmic = false; + config.logarithmic2 = false; + + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, false, false, true, "PolarArea"); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + graphMax: scaleStartValue + scaleSteps * scaleStepWidth, + labels: [] + } + populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, false, false, true, "PolarArea"); + } + + midPosX = msr.leftNotUsableSize + (msr.availableWidth / 2); + midPosY = msr.topNotUsableSize + (msr.availableHeight / 2); + scaleHop = Math.floor(((Min([msr.availableHeight, msr.availableWidth]) / 2) - 5) / calculatedScale.steps); + //Wrap in an animation loop wrapper + if(scaleHop > 0) { + initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPosX,midPosY : midPosY,int_radius : 0,ext_radius : scaleHop*calculatedScale.steps, calculatedScale : calculatedScale, scaleHop : scaleHop}); + animationLoop(config, drawScale, drawAllSegments, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPosX, midPosY, midPosX - ((Min([msr.availableHeight, msr.availableWidth]) / 2) - 5), midPosY + ((Min([msr.availableHeight, msr.availableWidth]) / 2) - 5), data); + } else { + testRedraw(ctx,data,config); + } + + function drawAllSegments(animationDecimal) { + + for (var i = 0; i < data.length; i++) { + var scaleAnimation = 1, + rotateAnimation = 1; + + if (config.animation) { + if (config.animateScale) { + scaleAnimation = animationDecimal; + } + if (config.animateRotate) { + rotateAnimation = animationDecimal; + } + } + correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, 0).mainVal; + if (!(typeof(data[i].value) == 'undefined')) { + ctx.beginPath(); + if(config.animationByData == "ByArc") { + endAngle=statData[i].startAngle+correctedRotateAnimation*statData[i].segmentAngle; + ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].startAngle, endAngle, false); + } else if(config.animationByData) { + if(statData[i].startAngle-statData[i].firstAngle < correctedRotateAnimation*2*Math.PI ) { + endAngle=statData[i].endAngle; + if((statData[i].endAngle-statData[i].firstAngle)> correctedRotateAnimation*2*Math.PI) endAngle=statData[i].firstAngle+correctedRotateAnimation*2*Math.PI; + ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].startAngle, endAngle, false); + + } + else continue; + } else { + ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle)); + } + ctx.lineTo(midPosX, midPosY); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fill(); + if (config.segmentShowStroke) { + ctx.strokeStyle = config.segmentStrokeColor; + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",ctx,data,statData,data[i].segmentStrokeStyle,config.segmentStrokeStyle,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); + ctx.stroke(); + ctx.setLineDash([]); + } + } + } + + + if (animationDecimal >= config.animationStopValue) { + for (i = 0; i < data.length; i++) { + if (typeof(data[i].value) == 'undefined') continue; + if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,-1,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["ARC", i, -1,statData]; + } + if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,-1,{nullValue : true})) { + if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = statData[i].realStartAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = (2*statData[i].realStartAngle - statData[i].segmentAngle) / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = statData[i].realStartAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) labelRadius = 0 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) labelRadius = statData[i].radiusOffset / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) labelRadius = statData[i].radiusOffset + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 4) labelRadius = scaleHop * calculatedScale.steps + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + ctx.save() + if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "left"; + else ctx.textAlign = "right"; + } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); + if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); + ctx.translate(midPosX + labelRadius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle)); + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); + else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); + else ctx.rotate(2 * Math.PI - posAngle); + } else ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ), true); + ctx.restore(); + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"PolarArea"); + }; + + function drawScale() { + for (var i = 0; i < calculatedScale.steps; i++) { + if (config.scaleShowLine && (i+1) % config.scaleGridLinesStep==0) { + ctx.beginPath(); + ctx.arc(midPosX, midPosY, scaleHop * (i + 1), 0, (Math.PI * 2), true); + ctx.strokeStyle = config.scaleLineColor; + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + + ctx.stroke(); + ctx.setLineDash([]); + } + if (config.scaleShowLabels) { + ctx.textAlign = "center"; + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + var label = calculatedScale.labels[i + 1]; + if (config.scaleShowLabelBackdrop) { + var textWidth = ctx.measureTextMultiLine(label, Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + ctx.fillStyle = config.scaleBackdropColor; + ctx.beginPath(); + ctx.rect( + Math.round(midPosX - textWidth / 2 - Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingX)), //X + Math.round(midPosY - (scaleHop * (i + 1)) - (Math.ceil(ctx.chartTextScale*config.scaleFontSize)) * 0.5 - Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingY)), //Y + Math.round(textWidth + (Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingX) * 2)), //Width + Math.round((Math.ceil(ctx.chartTextScale*config.scaleFontSize)) + (Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingY) * 2)) //Height + ); + ctx.fill(); + } + ctx.textBaseline = "middle"; + ctx.fillStyle = config.scaleFontColor; + ctx.fillTextMultiLine(label, midPosX, midPosY - (scaleHop * (i + 1)), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + for (var i = 0; i < data.length; i++) { + if(typeof data[i].value == "undefined") continue; + if (1 * data[i].value > upperValue) { + upperValue = 1 * data[i].value; + } + if (1 * data[i].value < lowerValue) { + lowerValue = 1 * data[i].value; + } + }; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + if(typeof config.graphMin=="function") lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + var Radar = function(data, config, ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, msr, midPosX, midPosY; + + ctx.tpchart="Radar"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + valueBounds = getValueBounds(); + + config.logarithmic = false; + config.logarithmic2 = false; + //If no labels are defined set to an empty array, so referencing length for looping doesn't blow up. + if (!data.labels) data.labels = []; + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, false, true, config.datasetFill, "Radar"); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + graphMax: scaleStartValue + scaleSteps * scaleStepWidth, + labels: [] + } + populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, false, true, config.datasetFill, "Radar"); + } + + calculateDrawingSizes(); + midPosY = msr.topNotUsableSize + (msr.availableHeight / 2); + scaleHop = maxSize / (calculatedScale.steps); + //Wrap in an animation loop wrapper + initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPosX, midPosY : midPosY, calculatedScale: calculatedScale, scaleHop: scaleHop, maxSize:maxSize}); + animationLoop(config, drawScale, drawAllDataPoints, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPosX, midPosY, midPosX - maxSize, midPosY + maxSize, data); + //Radar specific functions. + function drawAllDataPoints(animationDecimal) { + var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length; + ctx.save(); + //We accept multiple data sets for radar charts, so show loop through each set + for (var i = 0; i < data.datasets.length; i++) { + var fPt = -1; + for (var j = 0; j < data.datasets[i].data.length; j++) { + var currentAnimPc = animationCorrection(animationDecimal, data, config, i, j, 1).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + if (fPt == -1) { + ctx.beginPath(); + ctx.moveTo(midPosX + currentAnimPc * statData[i][j].offsetX, midPosY - currentAnimPc * statData[i][j].offsetY); + fPt = j; + } else { + ctx.lineTo(midPosX + currentAnimPc * statData[i][j].offsetX, midPosY - currentAnimPc * statData[i][j].offsetY); + } + } + } + ctx.closePath(); + if (config.datasetFill) { + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,-1,{animationValue : currentAnimPc, midPosX : statData[i][0].midPosX, midPosY : statData[i][0].midPosY, ext_radius : (config.animationLeftToRight ? 1 : currentAnimPc) * (statData[i][0].calculated_offset_max)} ); + } else ctx.fillStyle = "rgba(0,0,0,0)"; + + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,-1,{nullvalue : null} ); + + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); + ctx.fill(); +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + if (config.pointDot && (!config.animationLeftToRight || (config.animationLeftToRight && animationDecimal >= 1))) { + ctx.beginPath(); + ctx.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,i,-1,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,i,-1,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,i,-1,{nullvalue: true} ); + + for (var k = 0; k < data.datasets[i].data.length; k++) { + if (!(typeof(data.datasets[i].data[k]) == 'undefined')) { + ctx.beginPath(); + var markerShape=setOptionValue(1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,i,j,{nullvalue: true} ); + var markerRadius=setOptionValue(ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,i,j,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,i,j,{nullvalue: true} ); + drawMarker(ctx,midPosX + currentAnimPc * statData[i][k].offsetX, midPosY - currentAnimPc * statData[i][k].offsetY, markerShape,markerRadius,markerStrokeStyle); + } + } + } + } + ctx.restore(); + if (animationDecimal >= config.animationStopValue) { + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i,j,statData]; + } + if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + + + ctx.save(); + ctx.beginPath(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); + if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "left"; + else ctx.textAlign = "right"; + } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); + if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { + if ((config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { + if ((config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); + var radiusPrt; + if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) radiusPrt = 0 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) radiusPrt = (statData[i][j].calculated_offset) / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) radiusPrt = (statData[i][j].calculated_offset) + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + if(statData[i][j].calculated_offset>0) { + ctx.translate(midPosX + statData[i][j].offsetX * (radiusPrt/statData[i][j].calculated_offset), midPosY - statData[i][j].offsetY * (radiusPrt/statData[i][j].calculated_offset)); + } else { + ctx.translate(midPosX, midPosY); + } + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") ctx.rotate(j * rotationDegree); + else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((j * rotationDegree + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (j * rotationDegree + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI + j * rotationDegree); + else ctx.rotate(2 * Math.PI + j * rotationDegree); + } else ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180)); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i][j],config); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); + ctx.restore(); + } + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Radar"); + }; + + function drawScale() { + var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length; + ctx.save(); + ctx.translate(midPosX, midPosY); + ctx.rotate((90 - config.startAngle) * Math.PI / 180); + if (config.angleShowLineOut) { + ctx.strokeStyle = config.angleLineColor; + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.angleLineWidth); + for (var h = 0; h < data.datasets[0].data.length; h++) { + ctx.rotate(rotationDegree); + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.lineTo(0, -maxSize); +// ctx.setLineDash(lineStyleFn(config.angleLineStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"ANGLELINESTYLE",ctx,data,statData,undefined,config.angleLineStyle,h,-1,{nullValue : true} ))); + ctx.stroke(); + ctx.setLineDash([]); + } + } + for (var i = 0; i < calculatedScale.steps; i++) { + ctx.beginPath(); + if (config.scaleShowLine && (i+1) % config.scaleGridLinesStep == 0 ) { + ctx.strokeStyle = config.scaleLineColor; + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.moveTo(0, -scaleHop * (i + 1)); + for (var j = 0; j < data.datasets[0].data.length; j++) { + ctx.rotate(rotationDegree); + ctx.lineTo(0, -scaleHop * (i + 1)); + } + ctx.closePath(); + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.stroke(); + ctx.setLineDash([]); + } + } + ctx.rotate(-(90 - config.startAngle) * Math.PI / 180); + if (config.scaleShowLabels) { + for (i = 0; i < calculatedScale.steps; i++) { + ctx.textAlign = 'center'; + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + ctx.textBaseline = "middle"; + if (config.scaleShowLabelBackdrop) { + var textWidth = ctx.measureTextMultiLine(calculatedScale.labels[i + 1], (Math.ceil(ctx.chartTextScale*config.scaleFontSize))).textWidth; + ctx.fillStyle = config.scaleBackdropColor; + ctx.beginPath(); + ctx.rect( + Math.round(Math.cos(config.startAngle * Math.PI / 180) * (scaleHop * (i + 1)) - textWidth / 2 - Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingX)), //X + Math.round((-Math.sin(config.startAngle * Math.PI / 180) * scaleHop * (i + 1)) - (Math.ceil(ctx.chartTextScale*config.scaleFontSize)) * 0.5 - Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingY)), //Y + Math.round(textWidth + (Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingX) * 2)), //Width + Math.round((Math.ceil(ctx.chartTextScale*config.scaleFontSize)) + (Math.ceil(ctx.chartSpaceScale*config.scaleBackdropPaddingY) * 2)) //Height + ); + ctx.fill(); + } + ctx.fillStyle = config.scaleFontColor; + ctx.fillTextMultiLine(calculatedScale.labels[i + 1], Math.cos(config.startAngle * Math.PI / 180) * (scaleHop * (i + 1)), -Math.sin(config.startAngle * Math.PI / 180) * scaleHop * (i + 1), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + for (var k = 0; k < data.labels.length; k++) { + ctx.font = config.pointLabelFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.pointLabelFontSize)).toString() + "px " + config.pointLabelFontFamily; + ctx.fillStyle = config.pointLabelFontColor; + var opposite = Math.sin((90 - config.startAngle) * Math.PI / 180 + rotationDegree * k) * (maxSize + (Math.ceil(ctx.chartTextScale*config.pointLabelFontSize))); + var adjacent = Math.cos((90 - config.startAngle) * Math.PI / 180 + rotationDegree * k) * (maxSize + (Math.ceil(ctx.chartTextScale*config.pointLabelFontSize))); + var vangle = (90 - config.startAngle) * Math.PI / 180 + rotationDegree * k; + while (vangle < 0) vangle = vangle + 2 * Math.PI; + while (vangle > 2 * Math.PI) vangle = vangle - 2 * Math.PI; + if (vangle == Math.PI || vangle == 0) { + ctx.textAlign = "center"; + } else if (vangle > Math.PI) { + ctx.textAlign = "right"; + } else { + ctx.textAlign = "left"; + } + ctx.textBaseline = "middle"; + ctx.fillTextMultiLine(data.labels[k], opposite, -adjacent, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.pointLabelFontSize)),true); + } + ctx.restore(); + }; + + function calculateDrawingSizes() { + var midX, mxlb, maxL, maxR, iter, nbiter, prevMaxSize, prevMidX,i,textMeasurement; + var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length; + var rotateAngle = config.startAngle * Math.PI / 180; + // Compute range for Mid Point of graph + ctx.font = config.pointLabelFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.pointLabelFontSize)).toString() + "px " + config.pointLabelFontFamily; + if (!config.graphMaximized) { + maxR = msr.availableWidth / 2; + maxL = msr.availableWidth / 2; + nbiter = 1; + } else { + maxR = msr.availableWidth / 2; + maxL = msr.availableWidth / 2; + nbiter = 40; + for (i = 0; i < data.labels.length; i++) { + textMeasurement = ctx.measureTextMultiLine(data.labels[i], (Math.ceil(ctx.chartTextScale*config.scaleFontSize))).textWidth + ctx.measureTextMultiLine(data.labels[i], (Math.ceil(ctx.chartTextScale*config.scaleFontSize))).textHeight; + mxlb = (msr.availableWidth - textMeasurement) / (1 + Math.abs(Math.cos(rotateAngle))); + if ((rotateAngle < Math.PI / 2 && rotateAngle > -Math.PI / 2) || rotateAngle > 3 * Math.PI / 2) { + if (mxlb < maxR) maxR = mxlb; + } else if (Math.cos(rotateAngle) != 0) { + if (mxlb < maxL) maxL = mxlb; + } + rotateAngle -= rotationDegree; + } + } + // compute max Radius and midPoint in that range + prevMaxSize = 0; + prevMidX = 0; + midPosX = maxR + msr.rightNotUsableSize; + for (midX = maxR, iter = 0; iter < nbiter; ++iter, midX += (msr.availableWidth - maxL - maxR) / nbiter) { + maxSize = Max([midX, msr.availableWidth - midX]); + rotateAngle = config.startAngle * Math.PI / 180; + mxlb = msr.available; + for (i = 0; i < data.labels.length; i++) { + textMeasurement = ctx.measureTextMultiLine(data.labels[i], (Math.ceil(ctx.chartTextScale*config.scaleFontSize))).textWidth + ctx.measureTextMultiLine(data.labels[i], (Math.ceil(ctx.chartTextScale*config.scaleFontSize))).textHeight; + if ((rotateAngle < Math.PI / 2 && rotateAngle > -Math.PI / 2) || rotateAngle > 3 * Math.PI / 2) { + mxlb = ((msr.availableWidth - midX) - textMeasurement) / Math.abs(Math.cos(rotateAngle)); + } else if (Math.cos(rotateAngle != 0)) { + mxlb = (midX - textMeasurement) / Math.abs(Math.cos(rotateAngle)); + } + if (mxlb < maxSize) maxSize = mxlb; + if (Math.sin(rotateAngle) * msr.availableHeight / 2 > msr.availableHeight / 2 - (Math.ceil(ctx.chartTextScale*config.scaleFontSize)) * 2) { + mxlb = Math.sin(rotateAngle) * msr.availableHeight / 2 - 1.5 * (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + if (mxlb < maxSize) maxSize = mxlb; + } + rotateAngle -= rotationDegree; + } + if (maxSize > prevMaxSize) { + prevMaxSize = maxSize; + midPosX = midX + msr.rightNotUsableSize; + } + } + maxSize = prevMaxSize - (Math.ceil(ctx.chartTextScale*config.scaleFontSize)) / 2; + //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. + labelHeight = Default(labelHeight, 5); + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(typeof data.datasets[i].data[j]=="undefined")continue; + if (1 * data.datasets[i].data[j] > upperValue) { + upperValue = 1 * data.datasets[i].data[j] + } + if (1 * data.datasets[i].data[j] < lowerValue) { + lowerValue = 1 * data.datasets[i].data[j] + } + } + } + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue){ upperValue = .9;lowerValue=-.9;} + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + if(typeof config.graphMin=="function") lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + + + var Pie = function(data, config, ctx) { + var msr, midPieX, midPieY, pieRadius; + + ctx.tpchart="Pie"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + config.logarithmic = false; + config.logarithmic2 = false; + msr = setMeasures(data, config, ctx, height, width, "none", null, true, false, false, false, true, "Pie"); + calculateDrawingSize(); + if(pieRadius > 0) { + initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPieX,midPosY : midPieY,int_radius : 0,ext_radius : pieRadius}); + animationLoop(config, null, drawPieSegments, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPieX, midPieY, midPieX - pieRadius, midPieY + pieRadius, data); + } else { + testRedraw(ctx,data,config); + } + function drawPieSegments(animationDecimal) { + for (var i = 0; i < data.length; i++) { + var scaleAnimation = 1, + rotateAnimation = 1; + + if (config.animation) { + if (config.animateScale) { + scaleAnimation = animationDecimal; + } + if (config.animateRotate) { + rotateAnimation = animationDecimal; + } + } + correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, 0).mainVal; + if (!(typeof(data[i].value) == 'undefined')&& 1*data[i].value >=0) { + ctx.beginPath(); + if(config.animationByData == "ByArc") { + endAngle=statData[i].startAngle+correctedRotateAnimation*statData[i].segmentAngle; + ctx.arc(midPieX, midPieY, scaleAnimation * pieRadius, statData[i].startAngle, endAngle); + } else if(config.animationByData) { + if(statData[i].startAngle-statData[i].firstAngle < correctedRotateAnimation*2*Math.PI ) { + endAngle=statData[i].endAngle; + if((statData[i].endAngle-statData[i].firstAngle)> correctedRotateAnimation*2*Math.PI) endAngle=statData[i].firstAngle+correctedRotateAnimation*2*Math.PI; + ctx.arc(midPieX, midPieY, scaleAnimation * pieRadius, statData[i].startAngle, endAngle); + + } + else continue; + } else { + ctx.arc(midPieX, midPieY, scaleAnimation * pieRadius, statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle)); + } + ctx.lineTo(midPieX, midPieY); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fill(); + if (config.segmentShowStroke) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); + ctx.strokeStyle = config.segmentStrokeColor; + ctx.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",ctx,data,statData,data[i].segmentStrokeStyle,config.segmentStrokeStyle,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); + ctx.stroke(); + ctx.setLineDash([]); + } + } + } + if (animationDecimal >= config.animationStopValue) { + for (i = 0; i < data.length; i++) { + if (typeof(data[i].value) == 'undefined' || 1*data[i].value<0) continue; + if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,-1,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["ARC", i,-1,statData]; + } + if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,-1,{nullValue : true}) && statData[i]["segmentAngle"] >= (Math.PI/180) * setOptionValue(1,"INGRAPHDATAMINIMUMANGLE",ctx,data,statData,undefined,config.inGraphDataMinimumAngle,i,-1,{nullValue : true} )) { + if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = statData[i].realStartAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = statData[i].realStartAngle - statData[i]["segmentAngle"] / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = statData[i].realStartAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) labelRadius = 0 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) labelRadius = pieRadius / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) labelRadius = pieRadius + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + ctx.save(); + if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "left"; + else ctx.textAlign = "right"; + } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); + if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); + ctx.translate(midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); + else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); + else ctx.rotate(2 * Math.PI - posAngle); + } else ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); + ctx.restore(); + } + } + + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Pie"); + }; + + function calculateDrawingSize() { + midPieX = msr.leftNotUsableSize + (msr.availableWidth / 2); + midPieY = msr.topNotUsableSize + (msr.availableHeight / 2); + pieRadius = Min([msr.availableHeight / 2, msr.availableWidth / 2]) - 5; + // Computerange Pie Radius + if (isBooleanOptionTrue(undefined,config.inGraphDataShow) && setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,0,-1,{nullValue : true} ) == 3 && setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,0,-1,{nullValue: true }) == "off-center" && setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,0,-1,{nullValue : true} ) == 0) { + pieRadius = Min([msr.availableHeight / 2, msr.availableWidth / 2]) - setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,0,-1,{nullValue: true} ) - 5; + var realCumulativeAngle = ((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2*Math.PI) + 2*Math.PI) % (2*Math.PI); + for (var i = 0; i < data.length; i++) { + if (!(typeof(data[i].value) == 'undefined') && 1*data[i].value>=0) { + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segmentAngle / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + realCumulativeAngle -= statData[i].segmentAngle; + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); + var textMeasurement = ctx.measureText(dispString).width; + var MaxRadiusX = Math.abs((msr.availableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ) - 5; + if (MaxRadiusX < pieRadius) pieRadius = MaxRadiusX; + } + } + } + pieRadius = pieRadius * config.radiusScale; + }; + }; + var Doughnut = function(data, config, ctx) { + var msr, midPieX, midPieY, doughnutRadius; + + ctx.tpchart="Doughnut"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + + var realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + config.logarithmic = false; + config.logarithmic2 = false; + msr = setMeasures(data, config, ctx, height, width, "none", null, true, false, false, false, true, "Doughnut"); + calculateDrawingSize(); + + var cutoutRadius = doughnutRadius * (config.percentageInnerCutout / 100); + if(doughnutRadius > 0) { + initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPieX,midPosY : midPieY ,int_radius : cutoutRadius ,ext_radius : doughnutRadius}); + animationLoop(config, null, drawPieSegments, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPieX, midPieY, midPieX - doughnutRadius, midPieY + doughnutRadius, data); + } else { + testRedraw(ctx,data,config); + } + + + function drawPieSegments(animationDecimal) { + var cumulativeAngle = (((-config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + + for (var i = 0; i < data.length; i++) { + var scaleAnimation = 1, + rotateAnimation = 1; + + if (config.animation) { + if (config.animateScale) { + scaleAnimation = animationDecimal; + } + if (config.animateRotate) { + rotateAnimation = animationDecimal; + } + } + correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, 0).mainVal; + if (!(typeof(data[i].value) == 'undefined') && 1*data[i].value >=0) { + ctx.beginPath(); + if (config.animationByData == "ByArc") { + endAngle=statData[i].startAngle+correctedRotateAnimation*statData[i].segmentAngle; + ctx.arc(midPieX, midPieY, scaleAnimation * doughnutRadius, statData[i].startAngle, endAngle,false); + ctx.arc(midPieX, midPieY, scaleAnimation * cutoutRadius, endAngle,statData[i].startAngle, true); + } else if(config.animationByData) { + if(statData[i].startAngle-statData[i].firstAngle < correctedRotateAnimation*2*Math.PI ) { + endAngle=statData[i].endAngle; + if((statData[i].endAngle-statData[i].firstAngle)> correctedRotateAnimation*2*Math.PI) endAngle=statData[i].firstAngle+correctedRotateAnimation*2*Math.PI; + ctx.arc(midPieX, midPieY, scaleAnimation * doughnutRadius, statData[i].startAngle, endAngle,false); + ctx.arc(midPieX, midPieY, scaleAnimation * cutoutRadius, endAngle,statData[i].startAngle, true); + + } + else continue; + } else { + ctx.arc(midPieX, midPieY, scaleAnimation * doughnutRadius, statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle),false); + ctx.arc(midPieX, midPieY, scaleAnimation * cutoutRadius, statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), true); + } + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fill(); + if (config.segmentShowStroke) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); + ctx.strokeStyle = config.segmentStrokeColor; + ctx.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",ctx,data,statData,data[i].segmentStrokeStyle,config.segmentStrokeStyle,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); + ctx.stroke(); + ctx.setLineDash([]); + } + } + } + if (animationDecimal >= config.animationStopValue) { + for (i = 0; i < data.length; i++) { + if (typeof(data[i].value) == 'undefined' || 1*data[i].value<0) continue; + if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,-1,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["ARC", i,-1,statData]; + } + if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,-1,{nullValue : true}) && statData[i].segmentAngle >= (Math.PI/180) * setOptionValue(1,"INGRAPHDATAMINIMUMANGLE",ctx,data,statData,undefined,config.inGraphDataMinimumAngle,i,-1,{nullValue : true} )) { + if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = statData[i].realStartAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = statData[i].realStartAngle- statData[i].segmentAngle / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = statData[i].realStartAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) labelRadius = cutoutRadius + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) labelRadius = cutoutRadius + (doughnutRadius - cutoutRadius) / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) labelRadius = doughnutRadius + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + ctx.save(); + if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "left"; + else ctx.textAlign = "right"; + } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); + if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); + ctx.translate(midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); + if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); + else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); + else ctx.rotate(2 * Math.PI - posAngle); + } else ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); + ctx.restore(); + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Doughnut"); + }; + + function calculateDrawingSize() { + midPieX = msr.leftNotUsableSize + (msr.availableWidth / 2); + midPieY = msr.topNotUsableSize + (msr.availableHeight / 2); + doughnutRadius = Min([msr.availableHeight / 2, msr.availableWidth / 2]) - 5; + // Computerange Pie Radius + if (isBooleanOptionTrue(undefined,config.inGraphDataShow) && setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,0,-1,{nullValue : true} ) == 3 && setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,0,-1,{nullValue: true }) == "off-center" && setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,0,-1,{nullValue : true} ) == 0) { + doughnutRadius = Min([msr.availableHeight / 2, msr.availableWidth / 2]) - setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,0,-1,{nullValue: true} ) - 5; + var realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + var posAngle; + for (var i = 0; i < data.length; i++) { + if (!(typeof(data[i].value) == 'undefined') && 1*data[i].value>=0) { + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); + if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segmentAngle / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); + realCumulativeAngle -= statData[i].segmentAngle; + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); + var textMeasurement = ctx.measureText(dispString).width; + var MaxRadiusX = Math.abs((msr.availableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ) - 5; + if (MaxRadiusX < doughnutRadius) doughnutRadius = MaxRadiusX; + } + } + } + doughnutRadius = doughnutRadius * config.radiusScale; + }; + }; + var Line = function(data, config, ctx) { + var maxSize, scaleHop, scaleHop2, calculatedScale, calculatedScale2, labelHeight, scaleHeight, valueBounds, labelTemplateString, labelTemplateString2; + var valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, rotateLabels = 0, + msr; + var zeroY = 0; + var zeroY2 = 0; + ctx.tpchart="Line"; + if (!init_and_start(ctx,data,config)) return; + // adapt data when length is 1; + var mxlgt = 0; + for (var i = 0; i < data.datasets.length; i++) {mxlgt = Max([mxlgt, data.datasets[i].data.length]);} + if (mxlgt == 1) { + if (typeof(data.labels[0]) == "string") data.labels = ["", data.labels[0], ""]; + for (i = 0; i < data.datasets.length; i++) { + if (typeof(data.datasets[i].data[0] != "undefined")) data.datasets[i].data = [undefined, data.datasets[i].data[0], undefined]; + } + mxlgt=3; + } + var statData=initPassVariableData_part1(data,config,ctx); + for (i = 0; i < data.datasets.length; i++) statData[i][0].tpchart="Line"; + msr = setMeasures(data, config, ctx, height, width, "nihil", [""], false, false, true, true, config.datasetFill, "Line"); + valueBounds = getValueBounds(); + // true or fuzzy (error for negativ values (included 0)) + if (config.logarithmic !== false) { + if (valueBounds.minValue <= 0) { + config.logarithmic = false; + } + } + if (config.logarithmic2 !== false) { + if (valueBounds.minValue2 <= 0) { + config.logarithmic2 = false; + } + } + // Check if logarithmic is meanigful + var OrderOfMagnitude = calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.maxValue) + 1)) - calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.minValue))); + if ((config.logarithmic == 'fuzzy' && OrderOfMagnitude < 4) || config.scaleOverride) { + config.logarithmic = false; + } + // Check if logarithmic is meanigful + var OrderOfMagnitude2 = calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.maxValue2) + 1)) - calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.minValue2))); + if ((config.logarithmic2 == 'fuzzy' && OrderOfMagnitude2 < 4) || config.scaleOverride2) { + config.logarithmic2 = false; + } + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + labelTemplateString2 = (config.scaleShowLabels2) ? config.scaleLabel2 : ""; + if (!config.scaleOverride) { + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + } + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + graphMax: scaleStartValue + scaleSteps * scaleStepWidth, + labels: [] + } + populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); + } + + if (valueBounds.dbAxis) { + if (!config.scaleOverride2) { + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + calculatedScale2 = calculateScale(2, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue2, valueBounds.minValue2, labelTemplateString); + } + } else { + var scaleStartValue2= setOptionValue(1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,-1,-1,{nullValue : true} ); + var scaleSteps2 =setOptionValue(1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,-1,-1,{nullValue : true} ); + var scaleStepWidth2 = setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,-1,-1,{nullValue : true} ); + + calculatedScale2 = { + steps: scaleSteps2, + stepValue: scaleStepWidth2, + graphMin: scaleStartValue2, + graphMax: scaleStartValue2 + scaleSteps2 * scaleStepWidth2, + labels: [] + } + populateLabels(2, config, labelTemplateString2, calculatedScale2.labels, calculatedScale2.steps, scaleStartValue2, calculatedScale2.graphMax, scaleStepWidth2); + } + } else { + calculatedScale2 = { + steps: 0, + stepValue: 0, + graphMin: 0, + graphMax: 0, + labels: null + } + } + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, calculatedScale2.labels, false, false, true, true, config.datasetFill, "Line"); + var prevHeight=msr.availableHeight; + msr.availableHeight = msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + msr.availableWidth = msr.availableWidth - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight); + scaleHop = Math.floor(msr.availableHeight / calculatedScale.steps); + scaleHop2 = Math.floor(msr.availableHeight / calculatedScale2.steps); + valueHop = Math.floor(msr.availableWidth / (data.labels.length - 1)); + if (valueHop == 0 || config.fullWidthGraph) valueHop = (msr.availableWidth / (data.labels.length - 1)); + msr.clrwidth = msr.clrwidth - (msr.availableWidth - (data.labels.length - 1) * valueHop); + msr.availableWidth = (data.labels.length - 1) * valueHop; + msr.availableHeight = (calculatedScale.steps) * scaleHop; + msr.xLabelPos+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + msr.clrheight+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + drawLabels(); + if (valueBounds.minValue < 0) { + zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); + } + if (valueBounds.minValue2 < 0) { + zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); + } + initPassVariableData_part2(statData,data,config,ctx,{ + xAxisPosY : xAxisPosY, + yAxisPosX : yAxisPosX, + valueHop : valueHop, + nbValueHop : data.labels.length - 1, + scaleHop : scaleHop, + zeroY : zeroY, + calculatedScale : calculatedScale, + logarithmic : config.logarithmic, + scaleHop2: scaleHop2, + zeroY2: zeroY2, + msr : msr, + calculatedScale2: calculatedScale2, + logarithmic2: config.logarithmic2} ); + animationLoop(config, drawScale, drawLines, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, yAxisPosX + msr.availableWidth / 2, xAxisPosY - msr.availableHeight / 2, yAxisPosX, xAxisPosY, data); + } else { + testRedraw(ctx,data,config); + } + + + function drawLines(animPc) { + + drawLinesDataset(animPc, data, config, ctx, statData,{xAxisPosY : xAxisPosY,yAxisPosX : yAxisPosX, valueHop : valueHop, nbValueHop : data.labels.length - 1 }); + if (animPc >= 1) { + if (typeof drawMath == "function") { + drawMath(ctx, config, data, msr, { + xAxisPosY: xAxisPosY, + yAxisPosX: yAxisPosX, + valueHop: valueHop, + scaleHop: scaleHop, + zeroY: zeroY, + calculatedScale: calculatedScale, + calculateOffset: calculateOffset, + statData : statData + + }); + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Line"); + }; + + function drawScale() { + //X axis line + // if the xScale should be drawn + if (config.drawXScaleLine !== false) { + for (var s = 0; s < config.drawXScaleLine.length; s++) { + // get special lineWidth and lineColor for this xScaleLine + ctx.lineWidth = config.drawXScaleLine[s].lineWidth ? config.drawXScaleLine[s].lineWidth : Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.drawXScaleLine[s].lineColor ? config.drawXScaleLine[s].lineColor : config.scaleLineColor; + ctx.beginPath(); + var yPosXScale; + switch (config.drawXScaleLine[s].position) { + case "bottom": + yPosXScale = xAxisPosY; + break; + case "top": + yPosXScale = xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + break; + case "0": + case 0: + // check if zero exists + if (zeroY != 0) { + yPosXScale = xAxisPosY - zeroY; + } + break; + } + // draw the scale line + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), yPosXScale); + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), yPosXScale); + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.stroke(); + ctx.setLineDash([]); + + } + } + for (var i = 0; i < data.labels.length; i++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + //Check i isnt 0, so we dont go over the Y axis twice. + if (config.scaleShowGridLines && i > 0 && i % config.scaleXGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + } else { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY); + } + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + ctx.stroke(); + ctx.setLineDash([]); + } + //Y axis + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.beginPath(); + ctx.moveTo(yAxisPosX, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineTo(yAxisPosX, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.stroke(); + ctx.setLineDash([]); + for (var j = 0; j < calculatedScale.steps; j++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY - ((j + 1) * scaleHop)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + if (config.scaleShowGridLines && (j+1) % config.scaleYGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY - ((j + 1) * scaleHop)); + } else { + ctx.lineTo(yAxisPosX, xAxisPosY - ((j + 1) * scaleHop)); + } + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + ctx.stroke(); + ctx.setLineDash([]); + } + }; + + function drawLabels() { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + //X Labels + if (config.xAxisTop || config.xAxisBottom) { + ctx.textBaseline = "top"; + if (msr.rotateLabels > 90) { + ctx.save(); + ctx.textAlign = "left"; + } else if (msr.rotateLabels > 0) { + ctx.save(); + ctx.textAlign = "right"; + } else { + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + if (config.xAxisBottom) { + for (var i = 0; i < data.labels.length; i++) { + ctx.save(); + if (msr.rotateLabels > 0) { + ctx.translate(yAxisPosX + i * valueHop - msr.highestXLabel / 2, msr.xLabelPos); + ctx.rotate(-(msr.rotateLabels * (Math.PI / 180))); + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } else { + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), yAxisPosX + i * valueHop, msr.xLabelPos, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + ctx.restore(); + } + } + } + //Y Labels + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale.steps; j++) { + if (config.scaleShowLabels) { + if (config.yAxisLeft) { + ctx.textAlign = "right"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX - (Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + if (config.yAxisRight && !valueBounds.dbAxis) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + } + if (config.yAxisRight && valueBounds.dbAxis) { + for (j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale2.steps; j++) { + if (config.scaleShowLabels) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(calculatedScale2.labels[j + 1], yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop2), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + var upperValue2 = -Number.MAX_VALUE; + var lowerValue2 = Number.MAX_VALUE; + var secondAxis = false; + var firstAxis = false; + for (var i = 0; i < data.datasets.length; i++) { + var mathFctName = data.datasets[i].drawMathDeviation; + var mathValueHeight = 0; + if (typeof eval(mathFctName) == "function") { + var parameter = { + data: data, + datasetNr: i + }; + mathValueHeight = window[mathFctName](parameter); + } + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(typeof data.datasets[i].data[j] == "undefined") continue; + if (data.datasets[i].axis == 2) { + secondAxis = true; + if (1 * data.datasets[i].data[j] + mathValueHeight > upperValue2) { + upperValue2 = 1 * data.datasets[i].data[j] + mathValueHeight + }; + if (1 * data.datasets[i].data[j] - mathValueHeight < lowerValue2) { + lowerValue2 = 1 * data.datasets[i].data[j] - mathValueHeight + }; + } else { + firstAxis = true; + if (1 * data.datasets[i].data[j] + mathValueHeight > upperValue) { + upperValue = 1 * data.datasets[i].data[j] + mathValueHeight + }; + if (1 * data.datasets[i].data[j] - mathValueHeight < lowerValue) { + lowerValue = 1 * data.datasets[i].data[j] - mathValueHeight + }; + } + } + }; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + + } + if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + + if (secondAxis) { + if(upperValue2<lowerValue2){upperValue2=0;lowerValue2=0;} + if (Math.abs(upperValue2 - lowerValue2) < config.zeroValue) { + if(Math.abs(upperValue2)< config.zeroValue) upperValue2 = .9; + if(upperValue2>0) { + upperValue2=upperValue2*1.1; + lowerValue2=lowerValue2*0.9; + } else { + upperValue2=upperValue2*0.9; + lowerValue2=lowerValue2*1.1; + } + } + if(typeof config.graphMin2=="function")lowerValue2= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin2,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin2)) lowerValue2 = config.graphMin2; + if(typeof config.graphMax2=="function") upperValue2= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax2,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax2)) upperValue2 = config.graphMax2; + } + + if (!firstAxis && secondAxis) { + upperValue = upperValue2; + lowerValue = lowerValue2; + } + + labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + scaleHeight = msr.availableHeight; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxValue2: upperValue2, + minValue2: lowerValue2, + dbAxis: secondAxis, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + var StackedBar = function(data, config, ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, + msr; + ctx.tpchart="StackedBar"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + + config.logarithmic = false; + msr = setMeasures(data, config, ctx, height, width, "nihil", [""], true, false, true, true, true, "StackedBar"); + valueBounds = getValueBounds(); + + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + labels: [] + } + for (var i = 0; i <= calculatedScale.steps; i++) { + if (labelTemplateString) { + calculatedScale.labels.push(tmpl(labelTemplateString, { + value: fmtChartJS(config, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleStepWidth))), config.fmtYLabel) + },config)); + } + } + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); + } + + var prevHeight=msr.availableHeight; + + msr.availableHeight = msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + msr.availableWidth = msr.availableWidth - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight); + scaleHop = Math.floor(msr.availableHeight / calculatedScale.steps); + valueHop = Math.floor(msr.availableWidth / (data.labels.length)); + if (valueHop == 0 || config.fullWidthGraph) valueHop = (msr.availableWidth / data.labels.length); + msr.clrwidth = msr.clrwidth - (msr.availableWidth - ((data.labels.length) * valueHop)); + msr.availableWidth = (data.labels.length) * valueHop; + msr.availableHeight = (calculatedScale.steps) * scaleHop; + msr.xLabelPos+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + msr.clrheight+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + + yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + barWidth = (valueHop - Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth) * 2 - (Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) * 2) - (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2) - 1); + if(barWidth>=0 && barWidth<=1)barWidth=1; + if(barWidth<0 && barWidth>=-1)barWidth=-1; + + drawLabels(); + initPassVariableData_part2(statData,data,config,ctx,{ + calculatedScale : calculatedScale, + scaleHop : scaleHop, + valueHop : valueHop, + yAxisPosX : yAxisPosX, + xAxisPosY : xAxisPosY, + barWidth : barWidth + }); + animationLoop(config, drawScale, drawBars, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, yAxisPosX + msr.availableWidth / 2, xAxisPosY - msr.availableHeight / 2, yAxisPosX, xAxisPosY, data); + } else { + testRedraw(ctx,data,config); + } + function drawBars(animPc) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + if ((typeof data.datasets[i].data[j] == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; + var botBar, topBar; + if(config.animationByDataset) { + botBar=statData[i][j].yPosBottom; + topBar=statData[i][j].yPosTop; + topBar=botBar+currentAnimPc*(topBar-botBar); + } else { + botBar=statData[statData[i][j].firstNotMissing][j].yPosBottom - currentAnimPc*(statData[statData[i][j].firstNotMissing][j].yPosBottom-statData[i][j].yPosBottom); + topBar=statData[statData[i][j].firstNotMissing][j].yPosBottom - currentAnimPc*(statData[statData[i][j].firstNotMissing][j].yPosBottom-statData[i][j].yPosTop); + } + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : botBar, xPosRight : statData[i][j].xPosRight, yPosTop : topBar} ); + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + + if(currentAnimPc !=0 && botBar!=topBar) { + ctx.beginPath(); + ctx.moveTo(statData[i][j].xPosLeft, botBar); + ctx.lineTo(statData[i][j].xPosLeft, topBar); + ctx.lineTo(statData[i][j].xPosRight, topBar); + ctx.lineTo(statData[i][j].xPosRight, botBar); + if (config.barShowStroke) { + ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + }; + ctx.closePath(); + ctx.fill(); + } + } + } + if (animPc >= config.animationStopValue) { + var yPos = 0, + xPos = 0; + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i, j, statData]; + } + if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + ctx.save(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.beginPath(); + ctx.beginPath(); + yPos = 0; + xPos = 0; + if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosLeft+ barWidth + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } + if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { + yPos = (statData[i][j].yPosTop + statData[i][j].yPosBottom)/2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } + if(yPos>msr.topNotUsableSize) { + ctx.translate(xPos, yPos); + ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); + } + ctx.restore(); + } + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"StackedBar"); + }; + + function drawScale() { + //X axis line + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY); + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY); + ctx.stroke(); + ctx.setLineDash([]); + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var i = 0; i < data.labels.length; i++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + //Check i isnt 0, so we dont go over the Y axis twice. + if (config.scaleShowGridLines && i > 0 && i % config.scaleXGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + } else { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY); + } + ctx.stroke(); + } + ctx.setLineDash([]); + + //Y axis + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineTo(yAxisPosX, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + ctx.stroke(); + ctx.setLineDash([]); + + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale.steps; j++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY - ((j + 1) * scaleHop)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + if (config.scaleShowGridLines && (j+1) % config.scaleYGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY - ((j + 1) * scaleHop)); + } else { + ctx.lineTo(yAxisPosX, xAxisPosY - ((j + 1) * scaleHop)); + } + ctx.stroke(); + } + ctx.setLineDash([]); + }; + + function drawLabels() { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + //X axis labels + if (config.xAxisTop || config.xAxisBottom) { + ctx.textBaseline = "top"; + if (msr.rotateLabels > 90) { + ctx.save(); + ctx.textAlign = "left"; + } else if (msr.rotateLabels > 0) { + ctx.save(); + ctx.textAlign = "right"; + } else { + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + if (config.xAxisBottom) { + for (var i = 0; i < data.labels.length; i++) { + ctx.save(); + if (msr.rotateLabels > 0) { + ctx.translate(yAxisPosX + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) + i * valueHop + (barWidth / 2) - msr.highestXLabel / 2, msr.xLabelPos); + ctx.rotate(-(msr.rotateLabels * (Math.PI / 180))); + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } else { + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), yAxisPosX + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) + i * valueHop + (barWidth / 2), msr.xLabelPos, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + ctx.restore(); + } + } + } + //Y axis + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale.steps; j++) { + if (config.scaleShowLabels) { + if (config.yAxisLeft) { + ctx.textAlign = "right"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX - (Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + if (config.yAxisRight) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + var minvl = new Array(data.datasets.length); + var maxvl = new Array(data.datasets.length); + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + var k = i; + var tempp = 0; + var tempn = 0; + if (!(typeof(data.datasets[0].data[j]) == 'undefined')) { + if(1 * data.datasets[0].data[j] > 0) { + tempp += 1 * data.datasets[0].data[j]; + if (tempp > upperValue) { + upperValue = tempp; + }; + if (tempp < lowerValue) { + lowerValue = tempp; + }; + } else { + tempn += 1 * data.datasets[0].data[j]; + if (tempn > upperValue) { + upperValue = tempn; + }; + if (tempn < lowerValue) { + lowerValue = tempn; + }; + } + } + while (k > 0) { //get max of stacked data + if (!(typeof(data.datasets[k].data[j]) == 'undefined')) { + if(1 * data.datasets[k].data[j] > 0) { + tempp += 1 * data.datasets[k].data[j]; + if (tempp > upperValue) { + upperValue = tempp; + }; + if (tempp < lowerValue) { + lowerValue = tempp; + }; + } else { + tempn += 1 * data.datasets[k].data[j]; + if (tempn > upperValue) { + upperValue = tempn; + }; + if (tempn < lowerValue) { + lowerValue = tempn; + }; + } + } + k--; + } + } + }; + if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + scaleHeight = msr.availableHeight; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + /** + * Reverse the data structure for horizontal charts + * - reverse labels and every array inside datasets + * @param {object} data datasets and labels for the chart + * @return return the reversed data + */ + function reverseData(data) { + data.labels = data.labels.reverse(); + for (var i = 0; i < data.datasets.length; i++) { + for (var key in data.datasets[i]) { + if (Array.isArray(data.datasets[i][key])) { + data.datasets[i][key] = data.datasets[i][key].reverse(); + } + } + } + return data; + }; + var HorizontalStackedBar = function(data, config, ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, + msr; + + if (config.reverseOrder && typeof ctx.reversed == "undefined") { + ctx.reversed=true; + data = reverseData(data); + } + + ctx.tpchart="HorizontalStackedBar"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + + config.logarithmic = false; + msr = setMeasures(data, config, ctx, height, width, "nihil", [""], true, true, true, true, true, "HorizontalStackedBar"); + valueBounds = getValueBounds(); + + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + labels: [] + } + for (var i = 0; i <= calculatedScale.steps; i++) { + if (labelTemplateString) { + calculatedScale.labels.push(tmpl(labelTemplateString, { + value: fmtChartJS(config, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleStepWidth))), config.fmtYLabel) + },config)); + } + } + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); + } + msr.availableHeight = msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + msr.availableWidth = msr.availableWidth - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight); + scaleHop = Math.floor(msr.availableHeight / data.labels.length); + valueHop = Math.floor(msr.availableWidth / (calculatedScale.steps)); + if (valueHop == 0 || config.fullWidthGraph) valueHop = (msr.availableWidth / (calculatedScale.steps)); + msr.clrwidth = msr.clrwidth - (msr.availableWidth - (calculatedScale.steps * valueHop)); + msr.availableWidth = (calculatedScale.steps) * valueHop; + msr.availableHeight = (data.labels.length) * scaleHop; + yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + barWidth = (scaleHop - Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth) * 2 - (Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) * 2) - (Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing) * data.datasets.length - 1) - (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2) - 1); + if(barWidth>=0 && barWidth<=1)barWidth=1; + if(barWidth<0 && barWidth>=-1)barWidth=-1; + drawLabels(); + zeroY= HorizontalCalculateOffset(0 , calculatedScale, scaleHop); + initPassVariableData_part2(statData,data,config,ctx,{ + yAxisPosX : yAxisPosX, + xAxisPosY : xAxisPosY, + barWidth : barWidth, + zeroY : zeroY, + scaleHop : scaleHop, + valueHop : valueHop, + calculatedScale : calculatedScale + }); + + animationLoop(config, drawScale, drawBars, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, yAxisPosX + msr.availableWidth / 2, xAxisPosY - msr.availableHeight / 2, yAxisPosX, xAxisPosY, data); + } else { + testRedraw(ctx,data,config); + } + function HorizontalCalculateOffset(val, calculatedScale, scaleHop) { + var outerValue = calculatedScale.steps * calculatedScale.stepValue; + var adjustedValue = val - calculatedScale.graphMin; + var scalingFactor = CapValue(adjustedValue / outerValue, 1, 0); + return (scaleHop * calculatedScale.steps) * scalingFactor; + }; + + function drawBars(animPc) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + if ((typeof(data.datasets[i].data[j]) == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; + var leftBar, rightBar; + if(config.animationByDataset) { + leftBar= statData[i][j].xPosLeft; + rightBar= statData[i][j].xPosRight; + rightBar=leftBar+currentAnimPc*(rightBar-leftBar); + } else { + leftBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosLeft-statData[statData[i][j].firstNotMissing][j].xPosLeft); + rightBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosRight-statData[statData[i][j].firstNotMissing][j].xPosLeft); + } + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : leftBar, yPosBottom : statData[i][j].yPosBottom, xPosRight : rightBar, yPosTop : statData[i][j].yPosBottom} ); + + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + + if(currentAnimPc !=0 && statData[i][j].xPosLeft!=statData[i][j].xPosRight ) { + ctx.beginPath(); + ctx.moveTo(leftBar, statData[i][j].yPosTop); + ctx.lineTo(rightBar, statData[i][j].yPosTop); + ctx.lineTo(rightBar, statData[i][j].yPosBottom); + ctx.lineTo(leftBar, statData[i][j].yPosBottom); + ctx.lineTo(leftBar, statData[i][j].yPosTop); + if (config.barShowStroke){ + ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + } + ctx.closePath(); + ctx.fill(); + } + } + } + if (animPc >= config.animationStopValue) { + var yPos = 0, + xPos = 0; + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if ((typeof(data.datasets[i].data[j]) == 'undefined')) continue; + if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j, statData]; + } + if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + ctx.save(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ),statData[i][j],config); + ctx.beginPath(); + yPos = 0; + xPos = 0; + if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + (statData[i][j].xPosRight-statData[i][j].xPosLeft)/2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosRight + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } + if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { + yPos = statData[i][j].yPosBottom - barWidth / 2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } +// if(xPos<=msr.availableWidth+msr.leftNotUsableSize) { + ctx.translate(xPos, yPos); + ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); + ctx.restore(); +// } + } + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"HorizontalStackedBar"); + }; + + function drawScale() { + //X axis line + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY); + ctx.lineTo(yAxisPosX + msr.availableWidth, xAxisPosY); + ctx.stroke(); + ctx.setLineDash([]); + + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var i = ((config.showYAxisMin) ? -1 : 0); i < calculatedScale.steps; i++) { + if (i >= 0) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + //Check i isnt 0, so we dont go over the Y axis twice. + if (config.scaleShowGridLines && i > 0 && i % config.scaleXGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + } else { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY); + } + ctx.stroke(); + } + ctx.setLineDash([]); + } + //Y axis + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineTo(yAxisPosX, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + ctx.stroke(); + ctx.setLineDash([]); + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var j = 0; j < data.labels.length; j++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY - ((j + 1) * scaleHop)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + if (config.scaleShowGridLines && (j+1) % config.scaleYGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + msr.availableWidth, xAxisPosY - ((j + 1) * scaleHop)); + } else { + ctx.lineTo(yAxisPosX, xAxisPosY - ((j + 1) * scaleHop)); + } + ctx.stroke(); + } + ctx.setLineDash([]); + }; + + function drawLabels() { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + //X axis line + if (config.scaleShowLabels && (config.xAxisTop || config.xAxisBottom)) { + ctx.textBaseline = "top"; + if (msr.rotateLabels > 90) { + ctx.save(); + ctx.textAlign = "left"; + } else if (msr.rotateLabels > 0) { + ctx.save(); + ctx.textAlign = "right"; + } else { + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + if (config.xAxisBottom) { + for (var i = ((config.showYAxisMin) ? -1 : 0); i < calculatedScale.steps; i++) { + ctx.save(); + if (msr.rotateLabels > 0) { + ctx.translate(yAxisPosX + (i + 1) * valueHop - msr.highestXLabel / 2, msr.xLabelPos); + ctx.rotate(-(msr.rotateLabels * (Math.PI / 180))); + ctx.fillTextMultiLine(calculatedScale.labels[i + 1], 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } else { + ctx.fillTextMultiLine(calculatedScale.labels[i + 1], yAxisPosX + ((i + 1) * valueHop), msr.xLabelPos, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + ctx.restore(); + } + } + } + //Y axis + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j = 0; j < data.labels.length; j++) { + if (config.yAxisLeft) { + ctx.textAlign = "right"; + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[j], config.fmtXLabel), yAxisPosX - (Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop) + barWidth / 2, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + if (config.yAxisRight) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[j], config.fmtXLabel), yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop) + barWidth / 2, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + var minvl = new Array(data.datasets.length); + var maxvl = new Array(data.datasets.length); + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + var k = i; + var tempp = 0; + var tempn = 0; + if (!(typeof(data.datasets[0].data[j]) == 'undefined')) { + if(1 * data.datasets[0].data[j] > 0) { + tempp += 1 * data.datasets[0].data[j]; + if (tempp > upperValue) { + upperValue = tempp; + }; + if (tempp < lowerValue) { + lowerValue = tempp; + }; + } else { + tempn += 1 * data.datasets[0].data[j]; + if (tempn > upperValue) { + upperValue = tempn; + }; + if (tempn < lowerValue) { + lowerValue = tempn; + }; + } + } + while (k > 0) { //get max of stacked data + if (!(typeof(data.datasets[k].data[j]) == 'undefined')) { + if(1 * data.datasets[k].data[j] > 0) { + tempp += 1 * data.datasets[k].data[j]; + if (tempp > upperValue) { + upperValue = tempp; + }; + if (tempp < lowerValue) { + lowerValue = tempp; + }; + } else { + tempn += 1 * data.datasets[k].data[j]; + if (tempn > upperValue) { + upperValue = tempn; + }; + if (tempn < lowerValue) { + lowerValue = tempn; + }; + } + } + k--; + } + } + }; + if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + scaleHeight = msr.availableHeight; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxSteps: maxSteps, + minSteps: minSteps + }; + + + }; + }; + var Bar = function(data, config, ctx) { + var maxSize, scaleHop, scaleHop2, calculatedScale, calculatedScale2, labelHeight, scaleHeight, valueBounds, labelTemplateString, labelTemplateString2, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, + msr; + + ctx.tpchart="Bar"; + if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); + + var nrOfBars = data.datasets.length; + for (var i = 0; i < data.datasets.length; i++) { + if (data.datasets[i].type == "Line") { statData[i][0].tpchart="Line";nrOfBars--;} + else statData[i][0].tpchart="Bar"; + } + + + // change the order (at first all bars then the lines) (form of BubbleSort) + var bufferDataset, l = 0; + + + msr = setMeasures(data, config, ctx, height, width, "nihil", [""], true, false, true, true, true, "Bar"); + valueBounds = getValueBounds(); + if(valueBounds.minValue<=0)config.logarithmic=false; + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + + // true or fuzzy (error for negativ values (included 0)) + if (config.logarithmic !== false) { + if (valueBounds.minValue <= 0) { + config.logarithmic = false; + } + } + if (config.logarithmic2 !== false) { + if (valueBounds.minValue2 <= 0) { + config.logarithmic2 = false; + } + } + // Check if logarithmic is meanigful + var OrderOfMagnitude = calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.maxValue) + 1)) - calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.minValue))); + if ((config.logarithmic == 'fuzzy' && OrderOfMagnitude < 4) || config.scaleOverride) { + config.logarithmic = false; + } + // Check if logarithmic is meanigful + var OrderOfMagnitude2 = calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.maxValue2) + 1)) - calculateOrderOfMagnitude(Math.pow(10, calculateOrderOfMagnitude(valueBounds.minValue2))); + if ((config.logarithmic2 == 'fuzzy' && OrderOfMagnitude2 < 4) || config.scaleOverride2) { + config.logarithmic2 = false; + } + + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + labelTemplateString2 = (config.scaleShowLabels2) ? config.scaleLabel2 : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + graphMax: scaleStartValue + scaleSteps * scaleStepWidth, + labels: [] + } + populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); + } + if (valueBounds.dbAxis) { + if (!config.scaleOverride2) { + calculatedScale2 = calculateScale(2, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue2, valueBounds.minValue2, labelTemplateString); + } else { + var scaleStartValue2= setOptionValue(1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,-1,-1,{nullValue : true} ); + var scaleSteps2 =setOptionValue(1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,-1,-1,{nullValue : true} ); + var scaleStepWidth2 = setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,-1,-1,{nullValue : true} ); + + calculatedScale2 = { + steps: scaleSteps2, + stepValue: scaleStepWidth2, + graphMin: scaleStartValue2, + graphMax: scaleStartValue2 + scaleSteps2 * scaleStepWidth2, + labels: [] + } + populateLabels(2, config, labelTemplateString2, calculatedScale2.labels, calculatedScale2.steps, scaleStartValue2, calculatedScale2.graphMax, scaleStepWidth2); + } + } else { + calculatedScale2 = { + steps: 0, + stepValue: 0, + graphMin: 0, + graphMax: 0, + labels: null + } + } + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, calculatedScale2.labels, true, false, true, true, true, "Bar"); + + var prevHeight=msr.availableHeight; + + msr.availableHeight = msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + msr.availableWidth = msr.availableWidth - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight); + scaleHop = Math.floor(msr.availableHeight / calculatedScale.steps); + scaleHop2 = Math.floor(msr.availableHeight / calculatedScale2.steps); + valueHop = Math.floor(msr.availableWidth / (data.labels.length)); + if (valueHop == 0 || config.fullWidthGraph) valueHop = (msr.availableWidth / data.labels.length); + msr.clrwidth = msr.clrwidth - (msr.availableWidth - ((data.labels.length) * valueHop)); + msr.availableWidth = (data.labels.length) * valueHop; + msr.availableHeight = (calculatedScale.steps) * scaleHop; + msr.xLabelPos+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + msr.clrheight+=(Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop) - (prevHeight-msr.availableHeight)); + + yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + barWidth = (valueHop - Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth) * 2 - (Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) * 2) - (Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing) * nrOfBars - 1) - ((Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2) * nrOfBars - 1)) / nrOfBars; + if(barWidth>=0 && barWidth<=1)barWidth=1; + if(barWidth<0 && barWidth>=-1)barWidth=-1; + var zeroY = 0; + var zeroY2 = 0; + if (valueBounds.minValue < 0) { + zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); + } + if (valueBounds.minValue2 < 0) { + zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); + } + initPassVariableData_part2(statData,data,config,ctx,{ + msr: msr, + yAxisPosX : yAxisPosX, + xAxisPosY : xAxisPosY, + valueHop : valueHop, + barWidth : barWidth, + zeroY : zeroY, + zeroY2 : zeroY2, + calculatedScale : calculatedScale, + calculatedScale2 : calculatedScale2, + scaleHop : scaleHop, + scaleHop2 : scaleHop2 + }); + drawLabels(); + animationLoop(config, drawScale, drawBars, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, yAxisPosX + msr.availableWidth / 2, xAxisPosY - msr.availableHeight / 2, yAxisPosX, xAxisPosY, data); + } else { + testRedraw(ctx,data,config); + } + + function drawBars(animPc) { + var t1, t2, t3; + + + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + for (var i = 0; i < data.datasets.length; i++) { + if(data.datasets[i].type=="Line") continue; + for (var j = 0; j < data.datasets[i].data.length; j++) { + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + var barHeight = currentAnimPc * (statData[i][j].barHeight) + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} ); + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + roundRect(ctx, statData[i][j].xPosLeft, statData[i][j].yPosBottom, barWidth, barHeight, config.barShowStroke, config.barBorderRadius,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); + } + } + } + drawLinesDataset(animPc, data, config, ctx, statData,{xAxisPosY : xAxisPosY,yAxisPosX : yAxisPosX, valueHop : valueHop, nbValueHop : data.labels.length }); + + if (animPc >= config.animationStopValue) { + + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + if (data.datasets[i].type == "Line") continue; + if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i , j, statData]; + if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + ctx.save(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + t1 = statData[i][j].yPosBottom; + t2 = statData[i][j].yPosTop; + ctx.beginPath(); + var yPos = 0, + xPos = 0; + if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosLeft + barWidth + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } + if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { + yPos = (statData[i][j].yPosBottom+statData[i][j].yPosTop)/2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } + ctx.translate(xPos, yPos); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); + ctx.restore(); + } + } + } + } + if (animPc >= 1 && typeof drawMath == "function") { + drawMath(ctx, config, data, msr, { + xAxisPosY: xAxisPosY, + yAxisPosX: yAxisPosX, + valueHop: valueHop, + scaleHop: scaleHop, + zeroY: zeroY, + calculatedScale: calculatedScale, + calculateOffset: calculateOffset, + barWidth: barWidth + }); + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Bar"); + }; + + function roundRect(ctx, x, y, w, h, stroke, radius,i,j,fact) { + ctx.beginPath(); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.moveTo(x + radius, y); + ctx.lineTo(x + w - radius, y); + ctx.quadraticCurveTo(x + w, y, x + w, y); + ctx.lineTo(x + w, y - h + fact*radius); + ctx.quadraticCurveTo(x + w, y - h, x + w - radius, y - h); + ctx.lineTo(x + radius, y - h); + ctx.quadraticCurveTo(x, y - h, x, y - h + fact*radius); + ctx.lineTo(x, y); + ctx.quadraticCurveTo(x, y, x + radius, y); + if (stroke) ctx.stroke(); + ctx.closePath(); + ctx.fill(); + ctx.setLineDash([]); + }; + + function drawScale() { + //X axis line + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY); + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY); + ctx.stroke(); + ctx.setLineDash([]); + + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var i = 0; i < data.labels.length; i++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + //Check i isnt 0, so we dont go over the Y axis twice. + if (config.scaleShowGridLines && i > 0 && i % config.scaleXGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + } else { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY); + } + ctx.stroke(); + } + ctx.setLineDash([]); + + //Y axis + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineTo(yAxisPosX, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + ctx.stroke(); + ctx.setLineDash([]); + + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var j = 0; j < calculatedScale.steps; j++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY - ((j + 1) * scaleHop)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + if (config.scaleShowGridLines && (j+1) % config.scaleYGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY - ((j + 1) * scaleHop)); + } else { + ctx.lineTo(yAxisPosX, xAxisPosY - ((j + 1) * scaleHop)); + } + ctx.stroke(); + } + ctx.setLineDash([]); + }; + + function drawLabels() { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + //X axis line + if (config.xAxisTop || config.xAxisBottom) { + ctx.textBaseline = "top"; + if (msr.rotateLabels > 90) { + ctx.save(); + ctx.textAlign = "left"; + } else if (msr.rotateLabels > 0) { + ctx.save(); + ctx.textAlign = "right"; + } else { + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + if (config.xAxisBottom) { + for (var i = 0; i < data.labels.length; i++) { + ctx.save(); + if (msr.rotateLabels > 0) { + + ctx.translate(yAxisPosX + i * valueHop + (valueHop / 2) - msr.highestXLabel / 2, msr.xLabelPos); + ctx.rotate(-(msr.rotateLabels * (Math.PI / 180))); + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } else { + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), yAxisPosX + i * valueHop + (valueHop / 2), msr.xLabelPos, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + ctx.restore(); + } + } + } + //Y axis + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale.steps; j++) { + if (config.scaleShowLabels) { + if (config.yAxisLeft) { + ctx.textAlign = "right"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX - (Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + if (config.yAxisRight && !valueBounds.dbAxis) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(calculatedScale.labels[j + 1], yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + } + if (config.yAxisRight && valueBounds.dbAxis) { + for (j = ((config.showYAxisMin) ? -1 : 0); j < calculatedScale2.steps; j++) { + if (config.scaleShowLabels) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(calculatedScale2.labels[j + 1], yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - ((j + 1) * scaleHop2), ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + var upperValue2 = -Number.MAX_VALUE; + var lowerValue2 = Number.MAX_VALUE; + var secondAxis = false; + var firstAxis = false; + + for (var i = 0; i < data.datasets.length; i++) { + var mathFctName = data.datasets[i].drawMathDeviation; + var mathValueHeight = 0; + if (typeof eval(mathFctName) == "function") { + var parameter = { + data: data, + datasetNr: i + }; + mathValueHeight = window[mathFctName](parameter); + } + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(typeof data.datasets[i].data[j]=="undefined")continue; + if (data.datasets[i].axis == 2) { + secondAxis = true; + if (1 * data.datasets[i].data[j] + mathValueHeight > upperValue2) { + upperValue2 = 1 * data.datasets[i].data[j] + mathValueHeight; + }; + if (1 * data.datasets[i].data[j] - mathValueHeight < lowerValue2) { + lowerValue2 = 1 * data.datasets[i].data[j] - mathValueHeight; + }; + } else { + firstAxis=true; + if (1 * data.datasets[i].data[j] + mathValueHeight > upperValue) { + upperValue = 1 * data.datasets[i].data[j] + mathValueHeight; + }; + if (1 * data.datasets[i].data[j] - mathValueHeight < lowerValue) { + lowerValue = 1 * data.datasets[i].data[j] - mathValueHeight; + }; + } + } + }; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + + if (secondAxis) { + if(upperValue2<lowerValue2){upperValue2=0;lowerValue2=0;} + if (Math.abs(upperValue2 - lowerValue2) < config.zeroValue) { + if(Math.abs(upperValue2)< config.zeroValue) upperValue2 = .9; + if(upperValue2>0) { + upperValue2=upperValue2*1.1; + lowerValue2=lowerValue2*0.9; + } else { + upperValue2=upperValue2*0.9; + lowerValue2=lowerValue2*1.1; + } + } + if(typeof config.graphMin2=="function")lowerValue2= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin2,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin2)) lowerValue2 = config.graphMin2; + if(typeof config.graphMax2=="function") upperValue2= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax2,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax2)) upperValue2 = config.graphMax2; + } + if (!firstAxis && secondAxis) { + upperValue = upperValue2; + lowerValue = lowerValue2; + } + + labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + scaleHeight = msr.availableHeight; + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxValue2: upperValue2, + minValue2: lowerValue2, + dbAxis: secondAxis, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + + var HorizontalBar = function(data, config, ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, + msr; + ctx.tpchart="HorizontalBar"; + if (!init_and_start(ctx,data,config)) return; + + if (config.reverseOrder && typeof ctx.reversed == "undefined") { + ctx.reversed=true; + data = reverseData(data); + } + + var statData=initPassVariableData_part1(data,config,ctx); + + msr = setMeasures(data, config, ctx, height, width, "nihil", [""], true, true, true, true, true, "StackedBar"); + valueBounds = getValueBounds(); + if(valueBounds.minValue<=0)config.logarithmic=false; + if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { + if (config.logarithmic !== false) { + if (valueBounds.minValue <= 0) { + config.logarithmic = false; + } + } + //Check and set the scale + labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; + if (!config.scaleOverride) { + calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); + } else { + var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + + calculatedScale = { + steps: scaleSteps, + stepValue: scaleStepWidth, + graphMin: scaleStartValue, + graphMax: scaleStartValue + scaleSteps * scaleStepWidth, + labels: [] + } + populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); + msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); + } + msr.availableHeight = msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + msr.availableWidth = msr.availableWidth - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) - Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight); + scaleHop = Math.floor(msr.availableHeight / data.labels.length); + valueHop = Math.floor(msr.availableWidth / (calculatedScale.steps)); + if (valueHop == 0 || config.fullWidthGraph) valueHop = (msr.availableWidth / calculatedScale.steps); + msr.clrwidth = msr.clrwidth - (msr.availableWidth - (calculatedScale.steps * valueHop)); + msr.availableWidth = (calculatedScale.steps) * valueHop; + msr.availableHeight = (data.labels.length) * scaleHop; + yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); + barWidth = (scaleHop - Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth) * 2 - (Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) * 2) - (Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing) * data.datasets.length - 1) - ((Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2) * data.datasets.length - 1)) / data.datasets.length; + if(barWidth>=0 && barWidth<=1)barWidth=1; + if(barWidth<0 && barWidth>=-1)barWidth=-1; + var zeroY = 0; + if (valueBounds.minValue < 0) { + zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, valueHop); + } + drawLabels(); + initPassVariableData_part2(statData,data,config,ctx,{ + yAxisPosX : yAxisPosX, + xAxisPosY : xAxisPosY, + barWidth : barWidth, + zeroY : zeroY, + scaleHop : scaleHop, + valueHop : valueHop, + calculatedScale : calculatedScale + }); + animationLoop(config, drawScale, drawBars, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, yAxisPosX + msr.availableWidth / 2, xAxisPosY - msr.availableHeight / 2, yAxisPosX, xAxisPosY, data); + } else { + testRedraw(ctx,data,config); + } + + function drawBars(animPc) { + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + var barHeight = currentAnimPc * statData[i][j].barWidth + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barHeight, yPosTop : statData[i][j].yPosBottom} ); + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + roundRect(ctx, statData[i][j].yPosTop, statData[i][j].xPosLeft , barWidth, barHeight, config.barShowStroke, config.barBorderRadius, 0,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); + } + } + } + if (animPc >= config.animationStopValue) { + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j ,statData]; + } + if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + ctx.save(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + ctx.beginPath(); + var yPos = 0, + xPos = 0; + if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ) + barWidth; + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { + yPos = statData[i][j].yPosTop + barWidth / 2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + } + if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { + xPos = (statData[i][j].xPosLeft+statData[i][j].xPosRight)/2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosRight + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + } + ctx.translate(xPos, yPos); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); + ctx.restore(); + } + } + } + } + if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"HorizontalBar"); + }; + + function roundRect(ctx, x, y, w, h, stroke, radius, zeroY,i,j,fact) { + ctx.beginPath(); + ctx.moveTo(y + zeroY, x + radius); + ctx.lineTo(y + zeroY, x + w - radius); + ctx.quadraticCurveTo(y + zeroY, x + w, y + zeroY, x + w); + ctx.lineTo(y + h - fact*radius, x + w); + ctx.quadraticCurveTo(y + h, x + w, y + h, x + w - radius); + ctx.lineTo(y + h, x + radius); + ctx.quadraticCurveTo(y + h, x, y + h - fact*radius, x); + ctx.lineTo(y + zeroY, x); + ctx.quadraticCurveTo(y + zeroY, x, y + zeroY, x + radius); + if (stroke) { + ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + }; + ctx.closePath(); + ctx.fill(); + }; + + function drawScale() { + //X axis line + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY); + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY); + ctx.stroke(); + ctx.setLineDash([]); + + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var i = ((config.showYAxisMin) ? -1 : 0); i < calculatedScale.steps; i++) { + if (i >= 0) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + //Check i isnt 0, so we dont go over the Y axis twice. + if (config.scaleShowGridLines && i > 0 && i % config.scaleXGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + } else { + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY); + } + ctx.stroke(); + } + + } + ctx.setLineDash([]); + //Y axis + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleLineWidth); + ctx.strokeStyle = config.scaleLineColor; + ctx.setLineDash(lineStyleFn(config.scaleLineStyle)); + ctx.beginPath(); + ctx.moveTo(yAxisPosX, xAxisPosY + Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)); + ctx.lineTo(yAxisPosX, xAxisPosY - msr.availableHeight - Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)); + ctx.stroke(); + ctx.setLineDash([]); + ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)); + for (var j = 0; j < data.labels.length; j++) { + ctx.beginPath(); + ctx.moveTo(yAxisPosX - Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft), xAxisPosY - ((j + 1) * scaleHop)); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth); + ctx.strokeStyle = config.scaleGridLineColor; + if (config.scaleShowGridLines && (j+1) % config.scaleYGridLinesStep == 0) { + ctx.lineTo(yAxisPosX + msr.availableWidth + Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight), xAxisPosY - ((j + 1) * scaleHop)); + } else { + ctx.lineTo(yAxisPosX, xAxisPosY - ((j + 1) * scaleHop)); + } + ctx.stroke(); + } + ctx.setLineDash([]); + }; + + function drawLabels() { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + //X axis line + if (config.scaleShowLabels && (config.xAxisTop || config.xAxisBottom)) { + ctx.textBaseline = "top"; + if (msr.rotateLabels > 90) { + ctx.save(); + ctx.textAlign = "left"; + } else if (msr.rotateLabels > 0) { + ctx.save(); + ctx.textAlign = "right"; + } else { + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + if (config.xAxisBottom) { + for (var i = ((config.showYAxisMin) ? -1 : 0); i < calculatedScale.steps; i++) { + ctx.save(); + if (msr.rotateLabels > 0) { + ctx.translate(yAxisPosX + (i + 1) * valueHop - msr.highestXLabel / 2, msr.xLabelPos); + ctx.rotate(-(msr.rotateLabels * (Math.PI / 180))); + ctx.fillTextMultiLine(calculatedScale.labels[i + 1], 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } else { + ctx.fillTextMultiLine(calculatedScale.labels[i + 1], yAxisPosX + (i + 1) * valueHop, msr.xLabelPos, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + ctx.restore(); + } + } + } + //Y axis + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j = 0; j < data.labels.length; j++) { + if (config.yAxisLeft) { + ctx.textAlign = "right"; + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[j], config.fmtXLabel), yAxisPosX - (Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - (j * scaleHop) - scaleHop / 2, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + if (config.yAxisRight) { + ctx.textAlign = "left"; + ctx.fillTextMultiLine(fmtChartJS(config, data.labels[j], config.fmtXLabel), yAxisPosX + msr.availableWidth + (Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)), xAxisPosY - (j * scaleHop) - scaleHop / 2, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.scaleFontSize)),true); + } + } + }; + + function getValueBounds() { + var upperValue = -Number.MAX_VALUE; + var lowerValue = Number.MAX_VALUE; + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(typeof data.datasets[i].data[j]=="undefined")continue; + if (1 * data.datasets[i].data[j] > upperValue) { + upperValue = 1 * data.datasets[i].data[j] + }; + if (1 * data.datasets[i].data[j] < lowerValue) { + lowerValue = 1 * data.datasets[i].data[j] + }; + } + }; + if(upperValue<lowerValue){upperValue=0;lowerValue=0;} + if (Math.abs(upperValue - lowerValue) < config.zeroValue) { + if(Math.abs(upperValue)< config.zeroValue) upperValue = .9; + if(upperValue>0) { + upperValue=upperValue*1.1; + lowerValue=lowerValue*0.9; + } else { + upperValue=upperValue*0.9; + lowerValue=lowerValue*1.1; + } + } + // AJOUT CHANGEMENT + if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMax)) upperValue = config.graphMax; + + labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); + scaleHeight = msr.availableHeight; + + var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); + return { + maxValue: upperValue, + minValue: lowerValue, + maxSteps: maxSteps, + minSteps: minSteps + }; + }; + }; + + function calculateOffset(logarithmic, val, calculatedScale, scaleHop) { + if (!logarithmic) { // no logarithmic scale + var outerValue = calculatedScale.steps * calculatedScale.stepValue; + var adjustedValue = val - calculatedScale.graphMin; + var scalingFactor = CapValue(adjustedValue / outerValue, 1, 0); + return (scaleHop * calculatedScale.steps) * scalingFactor; + } else { // logarithmic scale +// return CapValue(log10(val) * scaleHop - calculateOrderOfMagnitude(calculatedScale.graphMin) * scaleHop, undefined, 0); + return CapValue(log10(val) * scaleHop - log10(calculatedScale.graphMin) * scaleHop, undefined, 0); + } + }; + + function animationLoop(config, drawScale, drawData, ctx, clrx, clry, clrwidth, clrheight, midPosX, midPosY, borderX, borderY, data) { + var cntiter = 0; + var animationCount = 1; + var multAnim = 1; + if (config.animationStartValue < 0 || config.animationStartValue > 1) config.animation.StartValue = 0; + if (config.animationStopValue < 0 || config.animationStopValue > 1) config.animation.StopValue = 1; + if (config.animationStopValue < config.animationStartValue) config.animationStopValue = config.animationStartValue; + if (isIE() < 9 && isIE() != false) config.animation = false; + var animFrameAmount = (config.animation) ? 1 / CapValue(config.animationSteps, Number.MAX_VALUE, 1) : 1, + easingFunction = animationOptions[config.animationEasing], + percentAnimComplete = (config.animation) ? 0 : 1; + if (config.animation && config.animationStartValue > 0 && config.animationStartValue <= 1) { + while (percentAnimComplete < config.animationStartValue) { + cntiter++; + percentAnimComplete += animFrameAmount; + } + } + var beginAnim = cntiter; + var beginAnimPct = percentAnimComplete; + if (typeof drawScale !== "function") drawScale = function() {}; + if (config.clearRect) requestAnimFrame(animLoop); + else animLoop(); + + function animateFrame() { + var easeAdjustedAnimationPercent = (config.animation) ? CapValue(easingFunction(percentAnimComplete), null, 0) : 1; + if (1 * cntiter >= 1 * CapValue(config.animationSteps, Number.MAX_VALUE, 1) || config.animation == false || ctx.firstPass==3 || ctx.firstPass==4 || ctx.firstPass==8 || ctx.firstPass==9) easeAdjustedAnimationPercent = 1; + else if (easeAdjustedAnimationPercent >= 1) easeAdjustedAnimationPercent = 0.9999; + if (config.animation && !(isIE() < 9 && isIE() != false) && config.clearRect) ctx.clearRect(clrx, clry, clrwidth, clrheight); + dispCrossImage(ctx, config, midPosX, midPosY, borderX, borderY, false, data, easeAdjustedAnimationPercent, cntiter); + dispCrossText(ctx, config, midPosX, midPosY, borderX, borderY, false, data, easeAdjustedAnimationPercent, cntiter); + if (config.scaleOverlay) { + drawData(easeAdjustedAnimationPercent); + drawScale(); + } else { + drawScale(); + drawData(easeAdjustedAnimationPercent); + } + dispCrossImage(ctx, config, midPosX, midPosY, borderX, borderY, true, data, easeAdjustedAnimationPercent, cntiter); + dispCrossText(ctx, config, midPosX, midPosY, borderX, borderY, true, data, easeAdjustedAnimationPercent, cntiter); + }; + + function animLoop() { + //We need to check if the animation is incomplete (less than 1), or complete (1). + cntiter += multAnim; + percentAnimComplete += multAnim * animFrameAmount; + if (cntiter == config.animationSteps || config.animation == false || ctx.firstPass==3 || ctx.firstPass==4 || ctx.firstPass==8 || ctx.firstPass==9) percentAnimComplete = 1; + else if (percentAnimComplete >= 1) percentAnimComplete = 0.999; + animateFrame(); + //Stop the loop continuing forever + if (multAnim == -1 && cntiter <= beginAnim) { + if (typeof config.onAnimationComplete == "function" && ctx.runanimationcompletefunction==true) config.onAnimationComplete(ctx, config, data, 0, animationCount + 1); + multAnim = 1; + requestAnimFrame(animLoop); + } else if (percentAnimComplete < config.animationStopValue) { + requestAnimFrame(animLoop); + } else { + if ((animationCount < config.animationCount || config.animationCount == 0) && (ctx.firstPass ==1 || ctx.firstPass!=2)) { + animationCount++; + if (config.animationBackward && multAnim == 1) { + percentAnimComplete -= animFrameAmount; + multAnim = -1; + } else { + multAnim = 1; + cntiter = beginAnim - 1; + percentAnimComplete = beginAnimPct - animFrameAmount; + } + window.setTimeout(animLoop, config.animationPauseTime*1000); + } else { + if(!testRedraw(ctx,data,config) ) { + if (typeof config.onAnimationComplete == "function" && ctx.runanimationcompletefunction==true) { + config.onAnimationComplete(ctx, config, data, 1, animationCount + 1); + ctx.runanimationcompletefunction=false; + } + } + } + + } + }; + }; + //Declare global functions to be called within this namespace here. + // shim layer with setTimeout fallback + var requestAnimFrame = (function() { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000 / 60); + }; + })(); + + function calculateScale(axis, config, maxSteps, minSteps, maxValue, minValue, labelTemplateString) { + var graphMin, graphMax, graphRange, stepValue, numberOfSteps, valueRange, rangeOrderOfMagnitude, decimalNum; + var logarithmic, yAxisMinimumInterval; + if (axis == 2) { + logarithmic = config.logarithmic2; + yAxisMinimumInterval = config.yAxisMinimumInterval2; + } else { + logarithmic = config.logarithmic; + yAxisMinimumInterval = config.yAxisMinimumInterval; + } + + if (!logarithmic) { // no logarithmic scale + valueRange = maxValue - minValue; + rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange); + if(Math.abs(minValue)>config.zeroValue)graphMin = Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); + else graphMin=0; + if(Math.abs(maxValue)>config.zeroValue)graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); + else graphMax=0; + if (typeof yAxisMinimumInterval == "number") { + if(graphMax>=0) { + graphMin = graphMin - (graphMin % yAxisMinimumInterval); + while (graphMin > minValue) graphMin = graphMin - yAxisMinimumInterval; + if (graphMax % yAxisMinimumInterval > config.zeroValue && graphMax % yAxisMinimumInterval < yAxisMinimumInterval - config.zeroValue) { + graphMax = roundScale(config, (1 + Math.floor(graphMax / yAxisMinimumInterval)) * yAxisMinimumInterval); + } + while (graphMax < maxValue) graphMax = graphMax + yAxisMinimumInterval; + } + } + } else { // logarithmic scale + if(minValue==maxValue)maxValue=maxValue+1; + if(minValue==0)minValue=0.01; + var minMag = calculateOrderOfMagnitude(minValue); + var maxMag = calculateOrderOfMagnitude(maxValue) + 1; + graphMin = Math.pow(10, minMag); + graphMax = Math.pow(10, maxMag); + rangeOrderOfMagnitude = maxMag - minMag; + } + graphRange = graphMax - graphMin; + stepValue = Math.pow(10, rangeOrderOfMagnitude); + numberOfSteps = Math.round(graphRange / stepValue); + if (!logarithmic) { // no logarithmic scale + //Compare number of steps to the max and min for that size graph, and add in half steps if need be. + var stopLoop = false; + while (!stopLoop && (numberOfSteps < minSteps || numberOfSteps > maxSteps)) { + if (numberOfSteps < minSteps) { + if (typeof yAxisMinimumInterval == "number") { + if (stepValue / 2 < yAxisMinimumInterval) stopLoop = true; + } + if (!stopLoop) { + stepValue /= 2; + numberOfSteps = Math.round(graphRange / stepValue); + } + } else { + stepValue *= 2; + numberOfSteps = Math.round(graphRange / stepValue); + } + } + + if (typeof yAxisMinimumInterval == "number") { + if (stepValue < yAxisMinimumInterval) { + stepValue = yAxisMinimumInterval; + numberOfSteps = Math.ceil(graphRange / stepValue); + } + if (stepValue % yAxisMinimumInterval > config.zeroValue && stepValue % yAxisMinimumInterval < yAxisMinimumInterval - config.zeroValue) { + if ((2 * stepValue) % yAxisMinimumInterval < config.zeroValue || (2 * stepValue) % yAxisMinimumInterval > yAxisMinimumInterval - config.zeroValue) { + stepValue = 2 * stepValue; + numberOfSteps = Math.ceil(graphRange / stepValue); + } else { + stepValue = roundScale(config, (1 + Math.floor(stepValue / yAxisMinimumInterval)) * yAxisMinimumInterval); + numberOfSteps = Math.ceil(graphRange / stepValue); + } + } + } + if(config.graphMaximized==true || config.graphMaximized=="bottom" || typeof config.graphMin!=="undefined") { + while (graphMin+stepValue < minValue && numberOfSteps>=3){graphMin+=stepValue;numberOfSteps--}; + } + if(config.graphMaximized==true || config.graphMaximized=="top" || typeof config.graphMax!=="undefined") { + + while (graphMin+(numberOfSteps-1)*stepValue >= maxValue && numberOfSteps>=3) numberOfSteps--; + } + } else { // logarithmic scale + numberOfSteps = rangeOrderOfMagnitude; // so scale is 10,100,1000,... + } + var labels = []; + populateLabels(1, config, labelTemplateString, labels, numberOfSteps, graphMin, graphMax, stepValue); + return { + steps: numberOfSteps, + stepValue: stepValue, + graphMin: graphMin, + labels: labels, + maxValue: maxValue + } + }; + + function roundScale(config, value) { + var scldec = 0; + var sscl = "" + config.yAxisMinimumInterval; + if (sscl.indexOf(".") > 0) { + scldec = sscl.substr(sscl.indexOf(".")).length; + } + return (Math.round(value * Math.pow(10, scldec)) / Math.pow(10, scldec)); + } ; + + function calculateOrderOfMagnitude(val) { + if (val==0)return 0; + return Math.floor(Math.log(val) / Math.LN10); + }; + //Populate an array of all the labels by interpolating the string. + function populateLabels(axis, config, labelTemplateString, labels, numberOfSteps, graphMin, graphMax, stepValue) { + var logarithmic; + if (axis == 2) { + logarithmic = config.logarithmic2; + fmtYLabel = config.fmtYLabel2; + } else { + logarithmic = config.logarithmic; + fmtYLabel = config.fmtYLabel; + } + if (labelTemplateString) { + //Fix floating point errors by setting to fixed the on the same decimal as the stepValue. + var i; + if (!logarithmic) { // no logarithmic scale + for (i = 0; i < numberOfSteps + 1; i++) { + labels.push(tmpl(labelTemplateString, { + value: fmtChartJS(config, 1 * ((graphMin + (stepValue * i)).toFixed(getDecimalPlaces(stepValue))), fmtYLabel) + },config)); + } + } else { // logarithmic scale 10,100,1000,... + var value = graphMin; + for (i = 0; i < numberOfSteps + 1; i++) { + labels.push(tmpl(labelTemplateString, { + value: fmtChartJS(config, 1 * value.toFixed(getDecimalPlaces(value)), fmtYLabel) + },config)); + value *= 10; + } + } + } + }; + //Max value from array + function Max(array) { + return Math.max.apply(Math, array); + }; + //Min value from array + function Min(array) { + return Math.min.apply(Math, array); + }; + //Default if undefined + function Default(userDeclared, valueIfFalse) { + if (!userDeclared) { + return valueIfFalse; + } else { + return userDeclared; + } + }; + //Apply cap a value at a high or low number + function CapValue(valueToCap, maxValue, minValue) { + if (isNumber(maxValue)) { + if (valueToCap > maxValue) { + return maxValue; + } + } + if (isNumber(minValue)) { + if (valueToCap < minValue) { + return minValue; + } + } + return valueToCap; + }; + + function getDecimalPlaces(num) { + var match = (''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); + if (!match) { + return 0; + } + return Math.max( + 0, + (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0) + ); + }; + + function mergeChartConfig(defaults, userDefined) { + var returnObj = {}; + for (var attrname in defaults) { + returnObj[attrname] = defaults[attrname]; + } + for (var attrnameBis in userDefined) { + returnObj[attrnameBis] = userDefined[attrnameBis]; + } + return returnObj; + }; + //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/ + var cache = {}; + + function tmpl(str, data,config) { + newstr=str; + if(newstr.substr(0,config.templatesOpenTag.length)==config.templatesOpenTag)newstr="<%="+newstr.substr(config.templatesOpenTag.length,newstr.length-config.templatesOpenTag.length); + if(newstr.substr(newstr.length-config.templatesCloseTag.length,config.templatesCloseTag.length)==config.templatesCloseTag)newstr=newstr.substr(0,newstr.length-config.templatesCloseTag.length)+"%>"; + return tmplpart2(newstr,data); + } + + function tmplpart2(str, data) { + // Figure out if we're getting a template, or if we need to + // load the template - and be sure to cache the result. + var fn = !/\W/.test(str) ? + cache[str] = cache[str] || + tmplpart2(document.getElementById(str).innerHTML) : + // Generate a reusable function that will serve as a template + // generator (and which will be cached). + new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + // Convert the template into pure JavaScript + str + .replace(/[\r\t\n]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + "');}return p.join('');"); + // Provide some basic currying to the user + return data ? fn(data) : fn; + }; + + function dispCrossText(ctx, config, posX, posY, borderX, borderY, overlay, data, animPC, cntiter) { + var i, disptxt, txtposx, txtposy, textAlign, textBaseline; + for (i = 0; i < config.crossText.length; i++) { + if (config.crossText[i] != "" && config.crossTextOverlay[Min([i, config.crossTextOverlay.length - 1])] == overlay && ((cntiter == 1 && config.crossTextIter[Min([i, config.crossTextIter.length - 1])] == "first") || config.crossTextIter[Min([i, config.crossTextIter.length - 1])] == cntiter || config.crossTextIter[Min([i, config.crossTextIter.length - 1])] == "all" || (animPC == 1 && config.crossTextIter[Min([i, config.crossTextIter.length - 1])] == "last"))) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.crossTextFontStyle[Min([i, config.crossTextFontStyle.length - 1])] + " " + (Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])])).toString() + "px " + config.crossTextFontFamily[Min([i, config.crossTextFontFamily.length - 1])]; + ctx.fillStyle = config.crossTextFontColor[Min([i, config.crossTextFontColor.length - 1])]; + textAlign = config.crossTextAlign[Min([i, config.crossTextAlign.length - 1])]; + textBaseline = config.crossTextBaseline[Min([i, config.crossTextBaseline.length - 1])]; + txtposx = 1 * Math.ceil(ctx.chartSpaceScale*config.crossTextPosX[Min([i, config.crossTextPosX.length - 1])]); + txtposy = 1 * Math.ceil(ctx.chartSpaceScale*config.crossTextPosY[Min([i, config.crossTextPosY.length - 1])]); + switch (1 * config.crossTextRelativePosX[Min([i, config.crossTextRelativePosX.length - 1])]) { + case 0: + if (textAlign == "default") textAlign = "left"; + break; + case 1: + txtposx += borderX; + if (textAlign == "default") textAlign = "right"; + break; + case 2: + txtposx += posX; + if (textAlign == "default") textAlign = "center"; + break; + case -2: + txtposx += context.canvas.width / 2; + if (textAlign == "default") textAlign = "center"; + break; + case 3: + txtposx += txtposx + 2 * posX - borderX; + if (textAlign == "default") textAlign = "left"; + break; + case 4: + txtposx += context.canvas.width; + if (textAlign == "default") textAlign = "right"; + break; + default: + txtposx += posX; + if (textAlign == "default") textAlign = "center"; + break; + } + switch (1 * config.crossTextRelativePosY[Min([i, config.crossTextRelativePosY.length - 1])]) { + case 0: + if (textBaseline == "default") textBaseline = "top"; + break; + case 3: + txtposy += borderY; + if (textBaseline == "default") textBaseline = "top"; + break; + case 2: + txtposy += posY; + if (textBaseline == "default") textBaseline = "middle"; + break; + case -2: + txtposy += context.canvas.height / 2; + if (textBaseline == "default") textBaseline = "middle"; + break; + case 1: + txtposy += txtposy + 2 * posY - borderY; + if (textBaseline == "default") textBaseline = "bottom"; + break; + case 4: + txtposy += context.canvas.height; + if (textBaseline == "default") textBaseline = "bottom"; + break; + default: + txtposy += posY; + if (textBaseline == "default") textBaseline = "middle"; + break; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + ctx.translate(1 * txtposx, 1 * txtposy); + ctx.rotate(Math.PI * config.crossTextAngle[Min([i, config.crossTextAngle.length - 1])] / 180); + if (config.crossText[i].substring(0, 1) == "%") { + if (typeof config.crossTextFunction == "function") disptxt = config.crossTextFunction(i, config.crossText[i], ctx, config, posX, posY, borderX, borderY, overlay, data, animPC); + } else disptxt = config.crossText[i]; + + setTextBordersAndBackground(ctx,disptxt,Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),0,0,config.crossTextBorders[Min([i, config.crossTextBorders.length - 1])],config.crossTextBordersColor[Min([i, config.crossTextBordersColor.length - 1])],Math.ceil(ctx.chartLineScale*config.crossTextBordersWidth[Min([i, config.crossTextBordersWidth.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersXSpace[Min([i, config.crossTextBordersXSpace.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersYSpace[Min([i, config.crossTextBordersYSpace.length - 1])]),config.crossTextBordersStyle[Min([i, config.crossTextBordersStyle.length - 1])],config.crossTextBackgroundColor[Min([i, config.crossTextBackgroundColor.length - 1])],"CROSSTEXT"); + ctx.fillTextMultiLine(disptxt, 0, 0, ctx.textBaseline, Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),true); + ctx.restore(); + } + } + }; + + function dispCrossImage(ctx, config, posX, posY, borderX, borderY, overlay, data, animPC, cntiter) { + var i, disptxt, imageposx, imageposy, imageAlign, imageBaseline; + for (i = 0; i < config.crossImage.length; i++) { + if (typeof config.crossImage[i] != "undefined" && config.crossImageOverlay[Min([i, config.crossImageOverlay.length - 1])] == overlay && ((cntiter == -1 && config.crossImageIter[Min([i, config.crossImageIter.length - 1])] == "background") || (cntiter == 1 && config.crossImageIter[Min([i, config.crossImageIter.length - 1])] == "first") || config.crossImageIter[Min([i, config.crossImageIter.length - 1])] == cntiter || (cntiter != -1 && config.crossImageIter[Min([i, config.crossImageIter.length - 1])] == "all") || (animPC == 1 && config.crossImageIter[Min([i, config.crossImageIter.length - 1])] == "last"))) { + ctx.save(); + ctx.beginPath(); + imageAlign = config.crossImageAlign[Min([i, config.crossImageAlign.length - 1])]; + imageBaseline = config.crossImageBaseline[Min([i, config.crossImageBaseline.length - 1])]; + imageposx = 1 * Math.ceil(ctx.chartSpaceScale*config.crossImagePosX[Min([i, config.crossImagePosX.length - 1])]); + imageposy = 1 * Math.ceil(ctx.chartSpaceScale*config.crossImagePosY[Min([i, config.crossImagePosY.length - 1])]); + switch (1 * config.crossImageRelativePosX[Min([i, config.crossImageRelativePosX.length - 1])]) { + case 0: + if (imageAlign == "default") imageAlign = "left"; + break; + case 1: + imageposx += borderX; + if (imageAlign == "default") imageAlign = "right"; + break; + case 2: + imageposx += posX; + if (imageAlign == "default") imageAlign = "center"; + break; + case -2: + imageposx += context.canvas.width / 2; + if (imageAlign == "default") imageAlign = "center"; + break; + case 3: + imageposx += imageposx + 2 * posX - borderX; + if (imageAlign == "default") imageAlign = "left"; + break; + case 4: + imageposx += context.canvas.width; + if (imageAlign == "default") imageAlign = "right"; + break; + default: + imageposx += posX; + if (imageAlign == "default") imageAlign = "center"; + break; + } + switch (1 * config.crossImageRelativePosY[Min([i, config.crossImageRelativePosY.length - 1])]) { + case 0: + if (imageBaseline == "default") imageBaseline = "top"; + break; + case 3: + imageposy += borderY; + if (imageBaseline == "default") imageBaseline = "top"; + break; + case 2: + imageposy += posY; + if (imageBaseline == "default") imageBaseline = "middle"; + break; + case -2: + imageposy += context.canvas.height / 2; + if (imageBaseline == "default") imageBaseline = "middle"; + break; + case 1: + imageposy += imageposy + 2 * posY - borderY; + if (imageBaseline == "default") imageBaseline = "bottom"; + break; + case 4: + imageposy += context.canvas.height; + if (imageBaseline == "default") imageBaseline = "bottom"; + break; + default: + imageposy += posY; + if (imageBaseline == "default") imageBaseline = "middle"; + break; + } + var imageWidth = config.crossImage[i].width; + switch (imageAlign) { + case "left": + break; + case "right": + imageposx -= imageWidth; + break; + case "center": + imageposx -= (imageWidth / 2); + break; + default: + break; + } + var imageHeight = config.crossImage[i].height; + switch (imageBaseline) { + case "top": + break; + case "bottom": + imageposy -= imageHeight; + break; + case "middle": + imageposy -= (imageHeight / 2); + break; + default: + break; + } + ctx.translate(1 * imageposx, 1 * imageposy); + ctx.rotate(Math.PI * config.crossImageAngle[Min([i, config.crossImageAngle.length - 1])] / 180); + ctx.drawImage(config.crossImage[i], 0, 0); + ctx.restore(); + } + } + }; + //**************************************************************************************** + function setMeasures(data, config, ctx, height, width, ylabels, ylabels2, reverseLegend, reverseAxis, drawAxis, drawLegendOnData, legendBox, typegraph) { + if (config.canvasBackgroundColor != "none") ctx.canvas.style.background = config.canvasBackgroundColor; + var borderWidth = 0; + var xAxisLabelPos = 0; + var graphTitleHeight = 0; + var graphTitlePosY = 0; + var graphSubTitleHeight = 0; + var graphSubTitlePosY = 0; + var footNoteHeight = 0; + var footNotePosY = 0; + var yAxisUnitHeight = 0; + var yAxisUnitPosY = 0; + var widestLegend = 0; + var nbeltLegend = 0; + var nbLegendLines = 0; + var nbLegendCols = 0; + var spaceLegendHeight = 0; + var xFirstLegendTextPos = 0; + var yFirstLegendTextPos = 0; + var xLegendBorderPos = 0; + var yLegendBorderPos = 0; + var yAxisLabelWidth = 0; + var yAxisLabelPosLeft = 0; + var yAxisLabelPosRight = 0; + var xAxisLabelHeight = 0; + var xLabelHeight = 0; + var widestXLabel = 1; + var highestXLabel = 1; + var widestYLabel = 0; + var highestYLabel = 1; + var widestYLabel2 = 0; + var highestYLabel2 = 1; + var leftNotUsableSize = 0; + var rightNotUsableSize = 0; + var rotateLabels = 0; + var xLabelPos = 0; + var legendBorderWidth = 0; + var legendBorderHeight = 0; + + ctx.widthAtSetMeasures=width; + ctx.heightAtSetMeasures=height; + + // Borders + if (config.canvasBorders) borderWidth = Math.ceil(ctx.chartLineScale*config.canvasBordersWidth); + // compute widest X label + var textMsr,i; + if (drawAxis) { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + for (i = 0; i < data.labels.length; i++) { + textMsr = ctx.measureTextMultiLine(fmtChartJS(config, data.labels[i], config.fmtXLabel), (Math.ceil(ctx.chartTextScale*config.scaleFontSize))); + //If the text length is longer - make that equal to longest text! + widestXLabel = (textMsr.textWidth > widestXLabel) ? textMsr.textWidth : widestXLabel; + highestXLabel = (textMsr.textHeight > highestXLabel) ? textMsr.textHeight : highestXLabel; + } + if (widestXLabel < Math.ceil(ctx.chartTextScale*config.xScaleLabelsMinimumWidth)) { + widestXLabel = Math.ceil(ctx.chartTextScale*config.xScaleLabelsMinimumWidth); + } + } + // compute Y Label Width + if (drawAxis) { + widestYLabel = 1; + if (ylabels != null && ylabels != "nihil") { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + for (i = ylabels.length - 1; i >= 0; i--) { + if (typeof(ylabels[i]) == "string") { + if (ylabels[i].trim() != "") { + textMsr = ctx.measureTextMultiLine(fmtChartJS(config, ylabels[i], config.fmtYLabel), (Math.ceil(ctx.chartTextScale*config.scaleFontSize))); + //If the text length is longer - make that equal to longest text! + widestYLabel = (textMsr.textWidth > widestYLabel) ? textMsr.textWidth : widestYLabel; + highestYLabel = (textMsr.textHeight > highestYLabel) ? textMsr.textHeight : highestYLabel; + } + } + } + } + if (widestYLabel < Math.ceil(ctx.chartTextScale*config.yScaleLabelsMinimumWidth)) { + widestYLabel = Math.ceil(ctx.chartTextScale*config.yScaleLabelsMinimumWidth); + } + widestYLabel2 = 1; + if (ylabels2 != null && config.yAxisRight) { + ctx.font = config.scaleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.scaleFontSize)).toString() + "px " + config.scaleFontFamily; + for (i = ylabels2.length - 1; i >= 0; i--) { + if (typeof(ylabels2[i]) == "string") { + if (ylabels2[i].trim() != "") { + textMsr = ctx.measureTextMultiLine(fmtChartJS(config, ylabels2[i], config.fmtYLabel2), (Math.ceil(ctx.chartTextScale*config.scaleFontSize))); + //If the text length is longer - make that equal to longest text! + widestYLabel2 = (textMsr.textWidth > widestYLabel2) ? textMsr.textWidth : widestYLabel2; + highestYLabel2 = (textMsr.textHeight > highestYLabel2) ? textMsr.textHeight : highestYLabel2; + } + } + } + } else { + widestYLabel2 = widestYLabel; + } + if (widestYLabel2 < Math.ceil(ctx.chartTextScale*config.yScaleLabelsMinimumWidth)) { + widestYLabel2 = Math.ceil(ctx.chartTextScale*config.yScaleLabelsMinimumWidth); + } + } + // yAxisLabel + leftNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + rightNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceRight); + if (drawAxis) { + if (typeof(config.yAxisLabel) != "undefined") { + if (config.yAxisLabel.trim() != "") { + yAxisLabelWidth = (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)) * (config.yAxisLabel.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.yAxisLabelSpaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisLabelSpaceRight); + yAxisLabelPosLeft = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisLabelSpaceLeft) + (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)); + yAxisLabelPosRight = width - borderWidth - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - Math.ceil(ctx.chartSpaceScale*config.yAxisLabelSpaceLeft) - (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)); + } + if(config.yAxisLabelBackgroundColor !="none" || config.yAxisLabelBorders) { + yAxisLabelWidth+=2*(Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace)); + yAxisLabelPosLeft+=Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace); + yAxisLabelPosRight-=Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace); + } + + if(config.graphTitleBorders) { + yAxisLabelWidth+=2*(Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth)); + yAxisLabelPosLeft+=Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth); + yAxisLabelPosRight-=Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth); + } + } + if (config.yAxisLeft) { + if (reverseAxis == false) leftNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + yAxisLabelWidth + widestYLabel + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight); + else leftNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + yAxisLabelWidth + widestXLabel + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight); + } + if (config.yAxisRight) { + if (reverseAxis == false) rightNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceRight) + yAxisLabelWidth + widestYLabel2 + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight); + else rightNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceRight) + yAxisLabelWidth + widestXLabel + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceLeft) + Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight); + } + } + availableWidth = width - leftNotUsableSize - rightNotUsableSize; + // Title + if (config.graphTitle.trim() != "") { + graphTitleHeight = (Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)) * (config.graphTitle.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.graphTitleSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.graphTitleSpaceAfter); + graphTitlePosY = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceTop) + graphTitleHeight - Math.ceil(ctx.chartSpaceScale*config.graphTitleSpaceAfter); + if(config.graphTitleBackgroundColor !="none" || config.graphTitleBorders) { + graphTitleHeight+=2*(Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersYSpace)); + graphTitlePosY+=Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersYSpace); + } + + if(config.graphTitleBorders) { + graphTitleHeight+=2*(Math.ceil(ctx.chartLineScale*config.graphTitleBordersWidth)); + graphTitlePosY+=Math.ceil(ctx.chartLineScale*config.graphTitleBordersWidth); + } + } + // subTitle + if (config.graphSubTitle.trim() != "") { + graphSubTitleHeight = (Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)) * (config.graphSubTitle.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.graphSubTitleSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.graphSubTitleSpaceAfter); + graphSubTitlePosY = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceTop) + graphTitleHeight + graphSubTitleHeight - Math.ceil(ctx.chartSpaceScale*config.graphSubTitleSpaceAfter); + if(config.graphSubTitleBackgroundColor !="none" || config.graphSubTitleBorders) { + graphSubTitleHeight+=2*(Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersYSpace)); + graphSubTitlePosY+=Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersYSpace); + } + + if(config.graphSubTitleBorders) { + graphSubTitleHeight+=2*(Math.ceil(ctx.chartLineScale*config.graphSubTitleBordersWidth)); + graphSubTitlePosY+=Math.ceil(ctx.chartLineScale*config.graphSubTitleBordersWidth); + } + } + // yAxisUnit + if (drawAxis) { + if (config.yAxisUnit.trim() != "") { + yAxisUnitHeight = (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)) * (config.yAxisUnit.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.yAxisUnitSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.yAxisUnitSpaceAfter); + yAxisUnitPosY = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceTop) + graphTitleHeight + graphSubTitleHeight + yAxisUnitHeight - Math.ceil(ctx.chartSpaceScale*config.yAxisUnitSpaceAfter); + } + if(config.yAxisUnitBackgroundColor !="none" || config.yAxisUnitBorders) { + yAxisUnitHeight+=2*(Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace)); + yAxisUnitPosY+=Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace); + } + + if(config.yAxisUnitBorders) { + yAxisUnitHeight+=2*(Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth)); + yAxisUnitPosY+=Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth); + } + + + } + topNotUsableSize = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceTop) + graphTitleHeight + graphSubTitleHeight + yAxisUnitHeight + Math.ceil(ctx.chartTextScale*config.graphSpaceBefore); + // footNote + if (typeof(config.footNote) != "undefined") { + if (config.footNote.trim() != "") { + footNoteHeight = (Math.ceil(ctx.chartTextScale*config.footNoteFontSize)) * (config.footNote.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.footNoteSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.footNoteSpaceAfter); + footNotePosY = height - Math.ceil(ctx.chartSpaceScale*config.spaceBottom) - borderWidth - Math.ceil(ctx.chartSpaceScale*config.footNoteSpaceAfter); + if(config.footNoteBackgroundColor !="none" || config.footNoteBorders) { + footNoteHeight+=2*(Math.ceil(ctx.chartSpaceScale*config.footNoteBordersYSpace)); + footNotePosY-=Math.ceil(ctx.chartSpaceScale*config.footNoteBordersYSpace); + } + if(config.footNoteBorders) { + footNoteHeight+=2*(Math.ceil(ctx.chartLineScale*config.footNoteBordersWidth)); + footNotePosY-=Math.ceil(ctx.chartLineScale*config.footNoteBordersWidth); + } + } + } + + // xAxisLabel + if (drawAxis) { + if (typeof(config.xAxisLabel) != "undefined") { + if (config.xAxisLabel.trim() != "") { + xAxisLabelHeight = (Math.ceil(ctx.chartTextScale*config.xAxisFontSize)) * (config.xAxisLabel.split("\n").length || 1) + Math.ceil(ctx.chartSpaceScale*config.xAxisLabelSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.xAxisLabelSpaceAfter); + xAxisLabelPos = height - borderWidth - Math.ceil(ctx.chartSpaceScale*config.spaceBottom) - footNoteHeight - Math.ceil(ctx.chartSpaceScale*config.xAxisLabelSpaceAfter); + if(config.xAxisLabelBackgroundColor !="none" || config.footNoteBorders) { + xAxisLabelHeight+=2*(Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersYSpace)); + xAxisLabelPos-=Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersYSpace); + } + if(config.footNoteBorders) { + xAxisLabelHeight+=2*(Math.ceil(ctx.chartLineScale*config.xAxisLabelBordersWidth)); + xAxisLabelPos-=Math.ceil(ctx.chartLineScale*config.xAxisLabelBordersWidth); + } + } + } + } + + bottomNotUsableHeightWithoutXLabels = borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceBottom) + footNoteHeight + xAxisLabelHeight + Math.ceil(ctx.chartTextScale*config.graphSpaceAfter); + + // compute space for Legend + if (typeof(config.legend) != "undefined") { + if (config.legend == true) { + ctx.font = config.legendFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.legendFontSize)).toString() + "px " + config.legendFontFamily; + var textLength; + if (drawLegendOnData) { + for (i = data.datasets.length - 1; i >= 0; i--) { + if (typeof(data.datasets[i].title) == "string") { + if (data.datasets[i].title.trim() != "") { + nbeltLegend++; + textLength = ctx.measureText(fmtChartJS(config, data.datasets[i].title, config.fmtLegend)).width; + //If the text length is longer - make that equal to longest text! + widestLegend = (textLength > widestLegend) ? textLength : widestLegend; + } + } + } + } else { + for (i = data.length - 1; i >= 0; i--) { + if (typeof(data[i].title) == "string") { + if (data[i].title.trim() != "") { + nbeltLegend++; + textLength = ctx.measureText(fmtChartJS(config, data[i].title, config.fmtLegend)).width; + //If the text length is longer - make that equal to longest text! + widestLegend = (textLength > widestLegend) ? textLength : widestLegend; + } + } + } + } + if (nbeltLegend > 1 || (nbeltLegend == 1 && config.showSingleLegend)) { + widestLegend += Math.ceil(ctx.chartTextScale*config.legendBlockSize) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenBoxAndText); + if(config.legendPosY==1 || config.legendPosY==2 || config.legendPosY==3) { + availableLegendWidth = availableWidth- Math.ceil(ctx.chartSpaceScale*Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText)) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText); + } else { + availableLegendWidth = width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - 2 * (borderWidth) - Math.ceil(ctx.chartSpaceScale*Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText)) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText); + } + if (config.legendBorders == true) availableLegendWidth -= 2 * (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceRight); + maxLegendOnLine = Min([Math.floor((availableLegendWidth + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))),config.maxLegendCols]); + nbLegendLines = Math.ceil(nbeltLegend / maxLegendOnLine); + nbLegendCols = Math.ceil(nbeltLegend / nbLegendLines); + + var legendHeight = nbLegendLines * ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextVertical)) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextVertical) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceAfterText); + + switch (config.legendPosY) { + case 0: + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + spaceLegendHeight = legendHeight; + if (config.legendBorders == true) { + yLegendBorderPos = topNotUsableSize + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2); + yFirstLegendTextPos = yLegendBorderPos + (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText)+(Math.ceil(ctx.chartTextScale*config.legendFontSize)); + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } else { + yFirstLegendTextPos = topNotUsableSize + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2); + } + if(yAxisUnitHeight>0) { + yAxisUnitPosY+=spaceLegendHeight; + if(config.legendBorders==true)yLegendBorderPos-=yAxisUnitHeight; + yFirstLegendTextPos-=yAxisUnitHeight; + } + topNotUsableSize += spaceLegendHeight; + break; + case 1: + spaceLegendHeight = legendHeight; + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + yFirstLegendTextPos = topNotUsableSize + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText)+(Math.ceil(ctx.chartTextScale*config.legendFontSize)); + if (config.legendBorders == true) { + yFirstLegendTextPos += Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore)+Math.ceil(ctx.chartLineScale*config.legendBordersWidth); + yLegendBorderPos = yFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) - (Math.ceil(ctx.chartTextScale*config.legendFontSize)) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) /2 ); + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } + break; + case 2: + spaceLegendHeight = legendHeight; + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + yFirstLegendTextPos = topNotUsableSize + (height - topNotUsableSize - bottomNotUsableHeightWithoutXLabels - spaceLegendHeight) /2 + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText)+(Math.ceil(ctx.chartTextScale*config.legendFontSize)); + if (config.legendBorders == true) { + yFirstLegendTextPos += Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + yLegendBorderPos = yFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) - (Math.ceil(ctx.chartTextScale*config.legendFontSize)) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) /2 ); + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } + break; + case -2: + spaceLegendHeight = legendHeight; + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + yFirstLegendTextPos = (height - spaceLegendHeight) /2 + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText)+(Math.ceil(ctx.chartTextScale*config.legendFontSize)); + if (config.legendBorders == true) { + yFirstLegendTextPos += Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + yLegendBorderPos = yFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) - (Math.ceil(ctx.chartTextScale*config.legendFontSize)) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) /2 ); + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } + break; + case 3: + spaceLegendHeight = legendHeight; + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + availableHeight = height - topNotUsableSize - bottomNotUsableHeightWithoutXLabels; + yFirstLegendTextPos = topNotUsableSize + availableHeight - spaceLegendHeight + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText)+(Math.ceil(ctx.chartTextScale*config.legendFontSize)); + if (config.legendBorders == true) { + yFirstLegendTextPos -= (Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter)+Math.ceil(ctx.chartLineScale*config.legendBordersWidth)); + yLegendBorderPos = yFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) - (Math.ceil(ctx.chartTextScale*config.legendFontSize)) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) /2 ); + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } + break; + default: + spaceLegendHeight = legendHeight; + yFirstLegendTextPos = height - borderWidth - Math.ceil(ctx.chartSpaceScale*config.spaceBottom) - footNoteHeight - spaceLegendHeight + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBeforeText) + (Math.ceil(ctx.chartTextScale*config.legendFontSize)); + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + if (config.legendBorders == true) { + spaceLegendHeight += 2 * Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + yFirstLegendTextPos -= (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter)); + yLegendBorderPos = Math.floor(height - borderWidth - Math.ceil(ctx.chartSpaceScale*config.spaceBottom) - footNoteHeight - spaceLegendHeight + (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore)); + xLegendBorderPos = Math.floor(xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) - (Math.ceil(ctx.chartLineScale*config.legendBordersWidth) / 2)); + legendBorderHeight = Math.ceil(spaceLegendHeight - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceBefore) - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceAfter); + legendBorderWidth = Math.ceil(nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal))) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) + Math.ceil(ctx.chartLineScale*config.legendBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + } + xAxisLabelPos -= spaceLegendHeight; + bottomNotUsableHeightWithoutXLabels +=spaceLegendHeight; + break; + } + var fullLegendWidth=Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) + nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) +Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + if (config.legendBorders == true) { + fullLegendWidth+=2*Math.ceil(ctx.chartLineScale*config.legendBordersWidth)+Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft)+Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceRight); + } + + switch (config.legendPosX) { + case 0: + xFirstLegendTextPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + config.canvasBorders * Math.ceil(ctx.chartLineScale*config.canvasBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + if (config.legendBorders == true) { + xFirstLegendTextPos += (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2)+Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft); + xLegendBorderPos = Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + config.canvasBorders * Math.ceil(ctx.chartLineScale*config.canvasBordersWidth) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft); + } + if((config.legendPosY>=1 && config.legendPosY <=3) || config.legendPosY==-2) { + leftNotUsableSize+=fullLegendWidth; + yAxisLabelPosLeft+=fullLegendWidth; + } + break; + case 1: + xFirstLegendTextPos = leftNotUsableSize + Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText); + if (config.legendBorders == true) { + xLegendBorderPos = xFirstLegendTextPos; + xFirstLegendTextPos += (Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2) +Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft); + } + break; + case 2: + xFirstLegendTextPos = leftNotUsableSize + (width - rightNotUsableSize - leftNotUsableSize)/2 - (Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText)-Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText)) - (nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) / 2; + if (config.legendBorders == true) { + xFirstLegendTextPos -= ((Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceRight)); + xLegendBorderPos = xFirstLegendTextPos - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2 - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) ; + } + break; + case 3: + + xFirstLegendTextPos = width - rightNotUsableSize - Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) / 2; + if (config.legendBorders == true) { + xFirstLegendTextPos -= ((Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2) + Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceRight)); + xLegendBorderPos = xFirstLegendTextPos - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2 - Math.ceil(ctx.chartSpaceScale*config.legendSpaceLeftText) ; + } + break; + case 4: + xFirstLegendTextPos = width - Math.ceil(ctx.chartSpaceScale*config.spaceRight) - config.canvasBorders * Math.ceil(ctx.chartLineScale*config.canvasBordersWidth) - Math.ceil(ctx.chartSpaceScale*config.legendSpaceRightText) - nbLegendCols * (widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal) / 2; + if (config.legendBorders == true) { + xFirstLegendTextPos -= ((Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2)+Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceRight)); + xLegendBorderPos = xFirstLegendTextPos - Math.ceil(ctx.chartSpaceScale*config.legendBordersSpaceLeft) - Math.ceil(ctx.chartLineScale*config.legendBordersWidth)/2; + } + if((config.legendPosY>=1 && config.legendPosY <=3) || config.legendPosY==-2) { + rightNotUsableSize+=fullLegendWidth; + yAxisLabelPosRight-=fullLegendWidth; + } + break; + + default: + break; + } + if(config.legendBorders==true) { + yLegendBorderPos+=Math.ceil(ctx.chartSpaceScale*config.legendYPadding); + xLegendBorderPos+=Math.ceil(ctx.chartSpaceScale*config.legendXPadding); + + } + yFirstLegendTextPos+=Math.ceil(ctx.chartSpaceScale*config.legendYPadding); + xFirstLegendTextPos+=Math.ceil(ctx.chartSpaceScale*config.legendXPadding); + + } + } + } + xLabelWidth = 0; + bottomNotUsableHeightWithXLabels = bottomNotUsableHeightWithoutXLabels; + if (drawAxis && (config.xAxisBottom || config.xAxisTop)) { + var widestLabel,highestLabel; + if (reverseAxis == false) { + widestLabel = widestXLabel; + highestLabel = highestXLabel; + nblab = data.labels.length; + } else { + widestLabel = widestYLabel; + highestLabel = highestYLabel; + nblab = ylabels.length; + } + if (config.rotateLabels == "smart") { + rotateLabels = 0; + if ((availableWidth + Math.ceil(ctx.chartTextScale*config.xAxisSpaceBetweenLabels)) / nblab < (widestLabel + Math.ceil(ctx.chartTextScale*config.xAxisSpaceBetweenLabels))) { + rotateLabels = 45; + if (availableWidth / nblab < Math.abs(Math.cos(rotateLabels * Math.PI / 180) * widestLabel)) { + rotateLabels = 90; + } + } + } else { + rotateLabels = config.rotateLabels + if (rotateLabels < 0) rotateLabels = 0; + if (rotateLabels > 180) rotateLabels = 180; + } + if (rotateLabels > 90) rotateLabels += 180; + xLabelHeight = Math.abs(Math.sin(rotateLabels * Math.PI / 180) * widestLabel) + Math.abs(Math.sin((rotateLabels + 90) * Math.PI / 180) * highestLabel) + Math.ceil(ctx.chartSpaceScale*config.xAxisSpaceBefore) + Math.ceil(ctx.chartSpaceScale*config.xAxisSpaceAfter); + xLabelPos = height - borderWidth - Math.ceil(ctx.chartSpaceScale*config.spaceBottom) - footNoteHeight - xAxisLabelHeight - (xLabelHeight - Math.ceil(ctx.chartSpaceScale*config.xAxisSpaceBefore)) - Math.ceil(ctx.chartTextScale*config.graphSpaceAfter); + xLabelWidth = Math.abs(Math.cos(rotateLabels * Math.PI / 180) * widestLabel) + Math.abs(Math.cos((rotateLabels + 90) * Math.PI / 180) * highestLabel); + leftNotUsableSize = Max([leftNotUsableSize, borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + xLabelWidth / 2]); + rightNotUsableSize = Max([rightNotUsableSize, borderWidth + Math.ceil(ctx.chartSpaceScale*config.spaceRight) + xLabelWidth / 2]); + availableWidth = width - leftNotUsableSize - rightNotUsableSize; + if (config.legend && config.xAxisBottom && config.legendPosY==4) { + xLabelPos-=spaceLegendHeight; + } + bottomNotUsableHeightWithXLabels = bottomNotUsableHeightWithoutXLabels + xLabelHeight ; + } else { + availableWidth = width - leftNotUsableSize - rightNotUsableSize; + } + + availableHeight = height - topNotUsableSize - bottomNotUsableHeightWithXLabels; + + // ----------------------- DRAW EXTERNAL ELEMENTS ------------------------------------------------- + dispCrossImage(ctx, config, width / 2, height / 2, width / 2, height / 2, false, data, -1, -1); + if (ylabels != "nihil") { + // Draw Borders + if (borderWidth > 0) { + ctx.save(); + ctx.beginPath(); + ctx.lineWidth = 2 * borderWidth; + ctx.setLineDash(lineStyleFn(config.canvasBordersStyle)); + ctx.strokeStyle = config.canvasBordersColor; + ctx.moveTo(0, 0); + ctx.lineTo(0, height); + ctx.lineTo(width, height); + ctx.lineTo(width, 0); + ctx.lineTo(0, 0); + ctx.stroke(); + ctx.setLineDash([]); + ctx.restore(); + } + // Draw Graph Title + if (graphTitleHeight > 0) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.graphTitleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)).toString() + "px " + config.graphTitleFontFamily; + ctx.fillStyle = config.graphTitleFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + + setTextBordersAndBackground(ctx,config.graphTitle,(Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphTitlePosY,config.graphTitleBorders,config.graphTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersYSpace),config.graphTitleBordersStyle,config.graphTitleBackgroundColor,"GRAPHTITLE"); + + ctx.translate(Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphTitlePosY); + ctx.fillTextMultiLine(config.graphTitle, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)),true); + + ctx.stroke(); + ctx.restore(); + } + // Draw Graph Sub-Title + if (graphSubTitleHeight > 0) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.graphSubTitleFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)).toString() + "px " + config.graphSubTitleFontFamily; + ctx.fillStyle = config.graphSubTitleFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + setTextBordersAndBackground(ctx,config.graphSubTitle,(Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphSubTitlePosY,config.graphSubTitleBorders,config.graphSubTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphSubTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersYSpace),config.graphSubTitleBordersStyle,config.graphSubTitleBackgroundColor,"GRAPHSUBTITLE"); + + ctx.translate(Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphSubTitlePosY); + ctx.fillTextMultiLine(config.graphSubTitle, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)),true); + ctx.stroke(); + ctx.restore(); + } + // Draw Y Axis Unit + if (yAxisUnitHeight > 0) { + if (config.yAxisLeft) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.yAxisUnitFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)).toString() + "px " + config.yAxisUnitFontFamily; + ctx.fillStyle = config.yAxisUnitFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + + setTextBordersAndBackground(ctx,config.yAxisUnit,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),leftNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT"); + ctx.translate(leftNotUsableSize, yAxisUnitPosY); + ctx.fillTextMultiLine(config.yAxisUnit, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),true); + ctx.stroke(); + ctx.restore(); + } + if (config.yAxisRight) { + if (config.yAxisUnit2 == '') config.yAxisUnit2 = config.yAxisUnit; + ctx.save(); + ctx.beginPath(); + ctx.font = config.yAxisUnitFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)).toString() + "px " + config.yAxisUnitFontFamily; + ctx.fillStyle = config.yAxisUnitFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + setTextBordersAndBackground(ctx,config.yAxisUnit2,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),width - rightNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT"); + ctx.translate(width - rightNotUsableSize, yAxisUnitPosY); + ctx.fillTextMultiLine(config.yAxisUnit2, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),true); + ctx.stroke(); + ctx.restore(); + } + } + // Draw Y Axis Label + if (yAxisLabelWidth > 0) { + if (config.yAxisLeft) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.yAxisFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)).toString() + "px " + config.yAxisFontFamily; + ctx.fillStyle = config.yAxisFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + + ctx.translate(yAxisLabelPosLeft, topNotUsableSize + (availableHeight / 2)); + ctx.rotate(-(90 * (Math.PI / 180))); + setTextBordersAndBackground(ctx,config.yAxisLabel,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT"); + ctx.fillTextMultiLine(config.yAxisLabel, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)),false); + ctx.stroke(); + ctx.restore(); + } + if (config.yAxisRight) { + if (config.yAxisLabel2 == '') config.yAxisLabel2 = config.yAxisLabel; + ctx.save(); + ctx.beginPath(); + ctx.font = config.yAxisFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)).toString() + "px " + config.yAxisFontFamily; + ctx.fillStyle = config.yAxisFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + ctx.translate(yAxisLabelPosRight, topNotUsableSize + (availableHeight / 2)); + ctx.rotate(+(90 * (Math.PI / 180))); + setTextBordersAndBackground(ctx,config.yAxisLabel2,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT"); + ctx.fillTextMultiLine(config.yAxisLabel2, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)),false); + ctx.stroke(); + ctx.restore(); + } + } + // Draw X Axis Label + if (xAxisLabelHeight > 0) { + if (config.xAxisBottom) { + ctx.save(); + ctx.beginPath(); + ctx.font = config.xAxisFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.xAxisFontSize)).toString() + "px " + config.xAxisFontFamily; + ctx.fillStyle = config.xAxisFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + setTextBordersAndBackground(ctx,config.xAxisLabel,(Math.ceil(ctx.chartTextScale*config.xAxisFontSize)),leftNotUsableSize + (availableWidth / 2), xAxisLabelPos,config.xAxisLabelBorders,config.xAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.xAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersYSpace),config.xAxisLabelBordersStyle,config.xAxisLabelBackgroundColor,"XAXISLABEL"); + ctx.translate(leftNotUsableSize + (availableWidth / 2), xAxisLabelPos); + ctx.fillTextMultiLine(config.xAxisLabel, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.xAxisFontSize)),true); + ctx.stroke(); + ctx.restore(); + } + } + // Draw Legend + var legendMsr; + if (nbeltLegend > 1 || (nbeltLegend == 1 && config.showSingleLegend)) { + legendMsr={dispLegend : true, xLegendBorderPos : xLegendBorderPos, + yLegendBorderPos : yLegendBorderPos, legendBorderWidth : legendBorderWidth, legendBorderHeight : legendBorderHeight, + nbLegendCols: nbLegendCols, xFirstLegendTextPos : xFirstLegendTextPos , yFirstLegendTextPos : yFirstLegendTextPos, + drawLegendOnData : drawLegendOnData, reverseLegend : reverseLegend, legendBox : legendBox, widestLegend : widestLegend }; + if(config.legendPosY==0 || config.legendPosY==4 || config.legendPosX==0 || config.legendPosX==4) { + + drawLegend(legendMsr,data,config,ctx,typegraph); + legendMsr={dispLegend : false}; + } + } else { + legendMsr={dispLegend : false }; + } + // Draw FootNote + if (config.footNote.trim() != "") { + ctx.save(); + ctx.font = config.footNoteFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.footNoteFontSize)).toString() + "px " + config.footNoteFontFamily; + ctx.fillStyle = config.footNoteFontColor; + ctx.textAlign = "center"; + ctx.textBaseline = "bottom"; + + setTextBordersAndBackground(ctx,config.footNote,(Math.ceil(ctx.chartTextScale*config.footNoteFontSize)),leftNotUsableSize + (availableWidth / 2), footNotePosY,config.footNoteBorders,config.footNoteBordersColor,Math.ceil(ctx.chartLineScale*config.footNoteBordersWidth),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersYSpace),config.footNoteBordersStyle,config.footNoteBackgroundColor,"FOOTNOTE"); + + ctx.translate(leftNotUsableSize + (availableWidth / 2), footNotePosY); + ctx.fillTextMultiLine(config.footNote, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.footNoteFontSize)),true); + ctx.stroke(); + ctx.restore(); + } + } + clrx = leftNotUsableSize; + clrwidth = availableWidth; + clry = topNotUsableSize; + clrheight = availableHeight; + return { + leftNotUsableSize: leftNotUsableSize, + rightNotUsableSize: rightNotUsableSize, + availableWidth: availableWidth, + topNotUsableSize: topNotUsableSize, + bottomNotUsableHeightWithoutXLabels: bottomNotUsableHeightWithoutXLabels, + bottomNotUsableHeightWithXLabels: bottomNotUsableHeightWithXLabels, + availableHeight: availableHeight, + widestXLabel: widestXLabel, + highestXLabel: highestXLabel, + widestYLabel: widestYLabel, + widestYLabel2: widestYLabel2, + highestYLabel: highestYLabel, + rotateLabels: rotateLabels, + xLabelPos: xLabelPos, + clrx: clrx, + clry: clry, + clrwidth: clrwidth, + clrheight: clrheight, + legendMsr : legendMsr + }; + }; + + // Function for drawing lines (BarLine|Line) + + function drawLinesDataset(animPc, data, config, ctx, statData,vars) { + var y1,y2,y3,diffnb,diffnbj,fact, currentAnimPc; + var pts=[]; + + for (var i = 0; i < data.datasets.length; i++) { + if(statData[i][0].tpchart!="Line")continue; + if (statData[i].length == 0) continue; + if (statData[i][0].firstNotMissing == -1) continue; + + ctx.save(); + ctx.beginPath(); + + prevAnimPc={ mainVal:0 , subVal : 0,animVal : 0 }; + var firstpt=-1; + var lastxPos=-1; + for (var j = statData[i][0].firstNotMissing; j <= statData[i][0].lastNotMissing; j++) { + if(prevAnimPc.animVal==0 && j>statData[i][0].firstNotMissing) continue; + currentAnimPc = animationCorrection(animPc, data, config, i, j, 0); + if (currentAnimPc.mainVal == 0 && (prevAnimPc.mainVal > 0 && firstpt !=-1)) { + +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + if(config.extrapolateMissingData) { + y1=statData[i][statData[i][j].prevNotMissing].yAxisPos - prevAnimPc.mainVal*statData[i][statData[i][j].prevNotMissing].yPosOffset; + y2=statData[i][j].yAxisPos - prevAnimPc.mainVal*statData[i][statData[i][j-1].nextNotMissing].yPosOffset; + diffnb=statData[i][j-1].nextNotMissing-statData[i][j].prevNotMissing; + diffnbj=(j-1)-statData[i][j].prevNotMissing; + fact=(diffnbj+prevAnimPc.subVal)/diffnb; + y3=y1+fact*(y2-y1); + traceLine(pts,ctx,statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , y3,config,data,statData,i); + closebz(pts,ctx,config,i); +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + ctx.strokeStyle = "rgba(0,0,0,0)"; + if(config.datasetFill) { + ctx.lineTo(statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , statData[i][j].yAxisPos ); + ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fill(); + firstpt=-1; + } + } else if (!(typeof statData[i][j].value == "undefined")) { + traceLine(pts,ctx,statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , statData[i][j].yAxisPos - prevAnimPc.mainVal*statData[i][statData[i][j-1].nextNotMissing].yPosOffset,config,data,statData,i); + closebz(pts,ctx,config,i); +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + ctx.strokeStyle = "rgba(0,0,0,0)"; + if(config.datasetFill) { + ctx.lineTo(statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , statData[i][j].yAxisPos ); + ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fill(); + } + } + prevAnimPc = currentAnimPc; + continue; + } else if(currentAnimPc.totVal ==0) { +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + ctx.strokeStyle = "rgba(0,0,0,0)"; + } else { +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + } + + prevAnimPc = currentAnimPc; + + switch(typeof data.datasets[i].data[j]) { + case "undefined" : + if (!config.extrapolateMissingData) { + if(firstpt==-1) continue; + closebz(pts,ctx,config,i); +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + if (config.datasetFill && firstpt != -1) { + lastxPos=-1; + ctx.strokeStyle = "rgba(0,0,0,0)"; + ctx.lineTo(statData[i][j-1].xPos, statData[i][j-1].yAxisPos); + ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].yAxisPos); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fill(); + } + ctx.beginPath(); + prevAnimPc={ mainVal:0 , subVal : 0 }; + firstpt=-1; + } else if (currentAnimPc.subVal > 0) { + lastxPos=statData[i][j].xPos + currentAnimPc.subVal*(statData[i][j+1].xPos-statData[i][j].xPos); + y1=statData[i][statData[i][j+1].prevNotMissing].yAxisPos - statData[i][statData[i][j+1].prevNotMissing].yPosOffset; + y2=statData[i][statData[i][j].nextNotMissing].yAxisPos - statData[i][statData[i][j].nextNotMissing].yPosOffset; + diffnb=statData[i][j].nextNotMissing-statData[i][j+1].prevNotMissing; + diffnbj=(j)-statData[i][j+1].prevNotMissing; + fact=(diffnbj+prevAnimPc.subVal)/diffnb; + y3=y1+fact*(y2-y1); + traceLine(pts,ctx,statData[i][j].xPos + currentAnimPc.subVal*(statData[i][j+1].xPos-statData[i][j].xPos), y3,config,data,statData,i); + } + break; + default : + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); + if (firstpt==-1) { + firstpt=j; + ctx.beginPath(); + ctx.moveTo(statData[i][j].xPos, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset); + initbz(pts,statData[i][j].xPos, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset,i); + lastxPos=statData[i][j].xPos; + } else { + lastxPos=statData[i][j].xPos; + traceLine(pts,ctx,statData[i][j].xPos, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset,config,data,statData,i); + } + + if (currentAnimPc.subVal > 0 && statData[i][j].nextNotMissing !=-1 && (config.extrapolateMissing || statData[i][j].nextNotMissing==j+1)) { + lastxPos=statData[i][j].xPos + currentAnimPc.subVal*(statData[i][j+1].xPos-statData[i][j].xPos); + y1=statData[i][statData[i][j+1].prevNotMissing].yAxisPos - statData[i][statData[i][j+1].prevNotMissing].yPosOffset; + y2=statData[i][statData[i][j].nextNotMissing].yAxisPos - statData[i][statData[i][j].nextNotMissing].yPosOffset; + y3=y1+currentAnimPc.subVal*(y2-y1); + traceLine(pts,ctx,statData[i][j].xPos + currentAnimPc.subVal*(statData[i][j+1].xPos-statData[i][j].xPos), y3,config,data,statData,i); + } + break + } + } + closebz(pts,ctx,config,i); +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.stroke(); + ctx.setLineDash([]); + if (config.datasetFill) { + if (firstpt>=0 ) { + ctx.strokeStyle = "rgba(0,0,0,0)"; + ctx.lineTo(lastxPos, statData[i][0].xAxisPosY-statData[i][0].zeroY); + ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); + ctx.closePath(); + ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,-1,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fill(); + } + } + ctx.restore(); + if (config.pointDot && animPc >= 1) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + currentAnimPc = animationCorrection(animPc, data, config, i, j, 0); + if (currentAnimPc.mainVal > 0 || !config.animationLeftToRight) { + ctx.beginPath(); + ctx.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,i,j,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,i,j,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,i,j,{nullvalue: true} ); + var markerShape=setOptionValue(1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,i,j,{nullvalue: true} ); + var markerRadius=setOptionValue(ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,i,j,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,i,j,{nullvalue: true} ); + drawMarker(ctx, statData[i][j].xPos , statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset, markerShape,markerRadius,markerStrokeStyle); + } + } + } + } + + if (animPc >= config.animationStopValue) { + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData]; + } + if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { + ctx.save(); + ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); + ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + var paddingTextX = setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ), + paddingTextY = setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.translate(statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY); + ctx.rotate(setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180)); + setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); + ctx.restore(); + } + } + } + }; + + + + function initbz(pts,xpos,ypos,i) { + if (setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + pts.length=0; + pts.push(xpos);pts.push(ypos); + } + } ; + + function traceLine(pts,ctx,xpos,ypos,config,data,statData,i) { + if (setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + pts.push(xpos); pts.push(ypos); + } else { + ctx.lineTo(xpos,ypos); + } + } ; + + function closebz(pts,ctx,config,i){ + + if(setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + minimumpos= statData[i][0].xAxisPosY; + maximumpos= statData[i][0].xAxisPosY - statData[i][0].calculatedScale.steps*statData[i][0].scaleHop; + drawSpline(ctx,pts,setOptionValue(1,"BEZIERCURVETENSION",ctx,data,statData,undefined,config.bezierCurveTension,i,-1,{nullValue : true}),minimumpos,maximumpos); + pts.length=0; + } + }; + + //Props to Rob Spencer at scaled innovation for his post on splining between points + //http://scaledinnovation.com/analytics/splines/aboutSplines.html + + function getControlPoints(x0,y0,x1,y1,x2,y2,t){ + // x0,y0,x1,y1 are the coordinates of the end (knot) pts of this segment + // x2,y2 is the next knot -- not connected here but needed to calculate p2 + // p1 is the control point calculated here, from x1 back toward x0. + // p2 is the next control point, calculated here and returned to become the + // next segment's p1. + // t is the 'tension' which controls how far the control points spread. + + // Scaling factors: distances from this knot to the previous and following knots. + var d01=Math.sqrt(Math.pow(x1-x0,2)+Math.pow(y1-y0,2)); + var d12=Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2)); + + var fa=t*d01/(d01+d12); + var fb=t-fa; + + var p1x=x1+fa*(x0-x2); + var p1y=y1+fa*(y0-y2); + + var p2x=x1-fb*(x0-x2); + var p2y=y1-fb*(y0-y2); + + return [p1x,p1y,p2x,p2y] + }; + + function drawSpline(ctx,pts,t,minimumpos,maximumpos){ + var cp=[]; // array of control points, as x0,y0,x1,y1,... + var n=pts.length; + + pts.push(2*pts[n-2]-pts[n-4]); + pts.push(2*pts[n-1]-pts[n-3]); + + if (n==4){ + ctx.moveTo(pts[0],pts[1]); + ctx.lineTo(pts[2],pts[3]); + return; + } + // Draw an open curve, not connected at the ends + for(var ti=0;ti<n-2;ti+=2){ + cp=cp.concat(getControlPoints(pts[ti],pts[ti+1],pts[ti+2],pts[ti+3],pts[ti+4],pts[ti+5],t)); + } + // For first is a simple quadratics. + + ctx.beginPath(); + ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); + ctx.moveTo(pts[0],pts[1]); + ctx.quadraticCurveTo(cp[0],Math.max(Math.min(cp[1],minimumpos),maximumpos),pts[2],pts[3]); + +// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + for(ti=2;ti<pts.length-3;ti+=2){ + y1=Math.max(Math.min(cp[2*ti-1],minimumpos),maximumpos); + y2=Math.max(Math.min(cp[2*ti+1],minimumpos),maximumpos); + ctx.bezierCurveTo(cp[2*ti-2],y1,cp[2*ti],y2,pts[ti+2],pts[ti+3]); + } + ctx.stroke(); + }; + ctx.setLineDash([]); + }; + + function log10(val) { + return Math.log(val) / Math.LN10; + }; + + function setRect(ctx, config) { + if (config.clearRect) { + if (!config.multiGraph) { + clear(ctx); + ctx.clearRect(0, 0, width, height); + } + } else { + clear(ctx); + ctx.clearRect(0, 0, width, height); + + ctx.fillStyle = config.savePngBackgroundColor; + ctx.strokeStyle = config.savePngBackgroundColor; + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.lineTo(0, ctx.canvas.height); + ctx.lineTo(ctx.canvas.width, ctx.canvas.height); + ctx.lineTo(ctx.canvas.width, 0); + ctx.lineTo(0, 0); + ctx.stroke(); + ctx.fill(); + } + }; + + function defMouse(ctx, data, config) { + var todoannotate=false; + if(typeof config.annotateDisplay=="function") { todoannotate=true; + } else if(typeof config.annotateDisplay == "object") { + for(var j=0;j<config.annotateDisplay.length;j++) if (config.annotateDisplay[j]) todoannotate=true; + } else todoannotage=config.annotateDisplay; + + if (isBooleanOptionTrue(undefined,config.annotateDisplay)) { + if (cursorDivCreated == false) oCursor = new makeCursorObj('divCursor'); + if (isIE() < 9 && isIE() != false) ctx.canvas.attachEvent("on" + config.annotateFunction.split(' ')[0], function(event) { + if ((config.annotateFunction.split(' ')[1] == "left" && event.which == 1) || + (config.annotateFunction.split(' ')[1] == "middle" && event.which == 2) || + (config.annotateFunction.split(' ')[1] == "right" && event.which == 3) || + (typeof(config.annotateFunction.split(' ')[1]) != "string")) doMouseAction(config, ctx, event, data, "annotate", config.mouseDownRight) + }); + else ctx.canvas.addEventListener(config.annotateFunction.split(' ')[0], function(event) { + if ((config.annotateFunction.split(' ')[1] == "left" && event.which == 1) || + (config.annotateFunction.split(' ')[1] == "middle" && event.which == 2) || + (config.annotateFunction.split(' ')[1] == "right" && event.which == 3) || + (typeof(config.annotateFunction.split(' ')[1]) != "string")) doMouseAction(config, ctx, event, data, "annotate", config.mouseDownRight) + }, false); + } + if (config.savePng) { + if (isIE() < 9 && isIE() != false) ctx.canvas.attachEvent("on" + config.savePngFunction.split(' ')[0], function(event) { + if ((config.savePngFunction.split(' ')[1] == "left" && event.which == 1) || + (config.savePngFunction.split(' ')[1] == "middle" && event.which == 2) || + (config.savePngFunction.split(' ')[1] == "right" && event.which == 3) || + (typeof(config.savePngFunction.split(' ')[1]) != "string")) saveCanvas(ctx, data, config); + }); + else ctx.canvas.addEventListener(config.savePngFunction.split(' ')[0], function(event) { + if ((config.savePngFunction.split(' ')[1] == "left" && event.which == 1) || + (config.savePngFunction.split(' ')[1] == "middle" && event.which == 2) || + (config.savePngFunction.split(' ')[1] == "right" && event.which == 3) || + (typeof(config.savePngFunction.split(' ')[1]) != "string")) saveCanvas(ctx, data, config); + }, false); + } + + if (isIE() < 9 && isIE() != false) ctx.canvas.attachEvent("onmousewheel", function(event) { + if (cursorDivCreated) document.getElementById('divCursor').style.display = 'none'; + }); + else ctx.canvas.addEventListener("DOMMouseScroll", function(event) { + if (cursorDivCreated) document.getElementById('divCursor').style.display = 'none'; + }, false); + + function add_event_listener(type, func, chk) + { + if(typeof func != 'function') + return; + + function do_func(event) { + if (chk == null || chk(event)) doMouseAction(config,ctx,event,data,"mouseaction",func); + }; + + var hash = type+' '+func.name; + if(hash in ctx._eventListeners) { + if(ctx.canvas.removeEventListener) + ctx.canvas.removeEventListener(type, ctx._eventListeners[hash]); + else if(ctx.canvas.detachEvent) + ctx.canvas.detachEvent(type, ctx._eventListeners[hash]); + } + + ctx._eventListeners[hash] = do_func; + + if(ctx.canvas.addEventListener) { + if(type=="mousewheel") type="DOMMouseScroll"; + ctx.canvas.addEventListener(type, do_func, false); + } else if(ctx.canvas.attachEvent) { + ctx.canvas.attachEvent("on"+type, do_func); + } + }; + + add_event_listener("mousedown", config.mouseDownLeft, function(e) { return e.which == 1; }); + add_event_listener("mousedown", config.mouseDownMiddle, function(e) { return e.which == 2; }); + add_event_listener("mousedown", config.mouseDownRight, function(e) { return e.which == 3; }); + add_event_listener("mousemove", config.mouseMove); + add_event_listener("mouseout", config.mouseOut); + add_event_listener("mousewheel", config.mouseWheel); + }; +}; + + + +function animationCorrection(animationValue, data, config, vdata, vsubdata, addone) { + var animValue = animationValue; + var animSubValue = 0; + if (vsubdata != -1) { + if (animValue < 1 && (vdata < (config.animationStartWithDataset - 1) && (config.animationStartWithDataset - 1) != -1)) { + animValue = 1; + } + if (animValue < 1 && (vsubdata < (config.animationStartWithData - 1) && (config.animationStartWithData - 1) != -1)) { + animValue = 1; + } + var totreat = 1; + var newAnimationValue = animationValue; + if (animValue < 1 && config.animationByDataset) { + animValue = 0; + totreat = 0; + var startDataset = (config.animationStartWithDataset - 1); + if ((config.animationStartWithDataset - 1) == -1) startDataset = 0 + var nbstepsperdatasets = config.animationSteps / (data.datasets.length - startDataset); + if (animationValue >= (vdata - startDataset + 1) * nbstepsperdatasets / config.animationSteps) animValue = 1; + else if (animationValue >= (vdata - startDataset) * nbstepsperdatasets / config.animationSteps) { + var redAnimationValue = animationValue - (vdata - startDataset) * nbstepsperdatasets / config.animationSteps; + if (!config.animationLeftToRight) { + animValue = redAnimationValue * (data.datasets.length - startDataset); + } else { + newAnimationValue = redAnimationValue * (data.datasets.length - startDataset); + } + totreat = 1; + } + } + if (totreat == 1 && animValue < 1 && config.animationLeftToRight) { + animValue = 0; + var startSub = (config.animationStartWithData - 1); + if ((config.animationStartWithData - 1) == -1) startSub = 0 + var nbstepspervalue = config.animationSteps / (data.datasets[vdata].data.length - startSub - 1 + addone); + if (newAnimationValue >= (vsubdata - startSub) * nbstepspervalue / config.animationSteps) { + animValue = 1; + if (newAnimationValue <= (vsubdata + 1 - startSub) * nbstepspervalue / config.animationSteps) { + animSubValue = (data.datasets[vdata].data.length - startSub - 1) * (newAnimationValue - ((vsubdata - startSub) * nbstepspervalue / config.animationSteps)); + } + } + } + } else { + if (animValue < 1 && (vdata < (config.animationStartWithData - 1))) { + animValue = 1; + } + } + return { + mainVal: animValue, + subVal: animSubValue, + animVal: animValue + animSubValue + }; +}; + + +function drawLegend(legendMsr,data,config,ctx,typegraph) { + if (config.legendBorders == true) { + ctx.save(); + ctx.setLineDash(lineStyleFn(config.legendBordersStyle)); + ctx.beginPath(); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.legendBordersWidth); + ctx.strokeStyle = config.legendBordersColors; + ctx.moveTo(legendMsr.xLegendBorderPos, legendMsr.yLegendBorderPos); + ctx.lineTo(legendMsr.xLegendBorderPos, legendMsr.yLegendBorderPos + legendMsr.legendBorderHeight); + ctx.lineTo(legendMsr.xLegendBorderPos + legendMsr.legendBorderWidth, legendMsr.yLegendBorderPos + legendMsr.legendBorderHeight); + ctx.lineTo(legendMsr.xLegendBorderPos + legendMsr.legendBorderWidth, legendMsr.yLegendBorderPos); + ctx.lineTo(legendMsr.xLegendBorderPos, legendMsr.yLegendBorderPos); + //ctx.lineTo(legendMsr.xLegendBorderPos + legendMsr.legendBorderWidth, legendMsr.yLegendBorderPos); + //ctx.lineTo(legendMsr.xLegendBorderPos, legendMsr.yLegendBorderPos); + //ctx.lineTo(legendMsr.xLegendBorderPos, legendMsr.yLegendBorderPos + legendMsr.legendBorderHeight); + + + ctx.stroke(); + ctx.closePath(); + ctx.setLineDash([]); + + ctx.fillStyle = "rgba(0,0,0,0)"; // config.legendFillColor; + ctx.fillStyle = config.legendFillColor; + ctx.fill(); + ctx.restore(); + } + nbcols = legendMsr.nbLegendCols - 1; + ypos = legendMsr.yFirstLegendTextPos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextVertical)); + xpos = 0; + if (legendMsr.drawLegendOnData) fromi = data.datasets.length; + else fromi = data.length; + for (var i = fromi - 1; i >= 0; i--) { + orderi = i; + if (legendMsr.reverseLegend) { + if (legendMsr.drawLegendOnData) orderi = data.datasets.length - i - 1; + else orderi = data.length - i - 1; + } + if (legendMsr.drawLegendOnData) tpof = typeof(data.datasets[orderi].title); + else tpof = typeof(data[orderi].title) + if (tpof == "string") { + if (legendMsr.drawLegendOnData) lgtxt = fmtChartJS(config, data.datasets[orderi].title, config.fmtLegend).trim(); + else lgtxt = fmtChartJS(config, data[orderi].title, config.fmtLegend).trim(); + if (lgtxt != "") { + nbcols++; + if (nbcols == legendMsr.nbLegendCols) { + nbcols = 0; + xpos = legendMsr.xFirstLegendTextPos; + ypos += (Math.ceil(ctx.chartTextScale*config.legendFontSize)) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextVertical); + } else { + xpos += legendMsr.widestLegend + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenTextHorizontal); + } + ctx.save(); + ctx.beginPath(); + var lgdbox=legendMsr.legendBox; + if(ctx.tpchart=="Bar") if (data.datasets[orderi].type=="Line" && !config.datasetFill) lgdbox=false; + if (lgdbox) { + ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); + ctx.beginPath(); + if (legendMsr.drawLegendOnData) { + ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + + } else { + ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + } + ctx.moveTo(xpos, ypos); + ctx.lineTo(xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), ypos); + ctx.lineTo(xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))); + ctx.lineTo(xpos, ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))); + ctx.lineTo(xpos, ypos); + ctx.stroke(); + ctx.closePath(); + if (legendMsr.drawLegendOnData) { + ctx.fillStyle=setOptionValue(1,"LEGENDFILLCOLOR",ctx,data,undefined,data.datasets[orderi].fillColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + } else { + ctx.fillStyle=setOptionValue(1,"LEGENDFILLCOLOR",ctx,data,undefined,data[orderi].color,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + } + ctx.fill(); + } else { + ctx.lineWidth = config.legendColorIndicatorStrokeWidth ? + config.legendColorIndicatorStrokeWidth : Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); + if (config.legendColorIndicatorStrokeWidth && config.legendColorIndicatorStrokeWidth > (Math.ceil(ctx.chartTextScale*config.legendFontSize))) { + ctx.lineWidth = (Math.ceil(ctx.chartTextScale*config.legendFontSize)); + } + if (legendMsr.drawLegendOnData) { + ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + } else { + ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + } + + ctx.moveTo(xpos + 2, ypos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) / 2)); + ctx.lineTo(xpos + 2 + Math.ceil(ctx.chartTextScale*config.legendBlockSize), ypos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) / 2)); + ctx.stroke(); + + + ctx.fill(); + + if(config.pointDot) { + ctx.beginPath(); + ctx.fillStyle=setOptionValue(1,"LEGENDMARKERFILLCOLOR",ctx,data,undefined,data.datasets[orderi].pointColor,config.defaultStrokeColor,orderi,-1,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointStrokeColor,config.defaultStrokeColor,orderi,-1,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(ctx.chartLineScale,"LEGENDMARKERLINEWIDTH",ctx,data,undefined,data.datasets[orderi].pointDotStrokeWidth,config.pointDotStrokeWidth,orderi,-1,{nullvalue: true} ); + + var markerShape=setOptionValue(1,"LEGENDMARKERSHAPE",ctx,data,undefined,data.datasets[orderi].markerShape,config.markerShape,orderi,-1,{nullvalue: true} ); + var markerRadius=setOptionValue(ctx.chartSpaceScale,"LEGENDMARKERRADIUS",ctx,data,undefined,data.datasets[orderi].pointDotRadius,config.pointDotRadius,orderi,-1,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointDotStrokeStyle,config.pointDotStrokeStyle,orderi,-1,{nullvalue: true} ); + drawMarker(ctx,xpos + 2 + Math.ceil(ctx.chartTextScale*config.legendBlockSize)/2, ypos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) / 2), markerShape,markerRadius,markerStrokeStyle); + } + ctx.fill(); + + } + ctx.restore(); + ctx.save(); + ctx.beginPath(); + ctx.font = config.legendFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.legendFontSize)).toString() + "px " + config.legendFontFamily; + ctx.fillStyle = setOptionValue(1,"LEGENDFONTCOLOR",ctx,data,undefined,undefined,config.legendFontColor,orderi,-1,{nullvalue: true} ); + ctx.textAlign = "left"; + ctx.textBaseline = "bottom"; + ctx.translate(xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenBoxAndText), ypos); + ctx.fillText(lgtxt, 0, 0); + ctx.restore(); + } + } + } +}; + +function drawMarker(ctx,xpos,ypos,marker,markersize,markerStrokeStyle) { + ctx.setLineDash(lineStyleFn(markerStrokeStyle)); + switch (marker) { + case "square": + ctx.rect(xpos-markersize,ypos-markersize,2*markersize,2*markersize); + ctx.stroke(); + ctx.fill(); + ctx.setLineDash([]); + break; + case "triangle": + pointA_x=0; + pointA_y=2/3*markersize; + ctx.moveTo(xpos,ypos-pointA_y); + ctx.lineTo(xpos+pointA_y*Math.sin(4/3),ypos+pointA_y*Math.cos(4/3)); + ctx.lineTo(xpos-pointA_y*Math.sin(4/3),ypos+pointA_y*Math.cos(4/3)); + ctx.lineTo(xpos,ypos-pointA_y); + ctx.stroke(); + ctx.fill(); + ctx.setLineDash([]); + break; + case "diamond": + ctx.moveTo(xpos, ypos+markersize); + ctx.lineTo(xpos+markersize, ypos); + ctx.lineTo(xpos, ypos-markersize); + ctx.lineTo(xpos-markersize, ypos); + ctx.lineTo(xpos, ypos+markersize); + ctx.stroke(); + ctx.fill(); + ctx.setLineDash([]); + break; + case "plus": + ctx.moveTo(xpos, ypos-markersize); + ctx.lineTo(xpos, ypos+markersize); + ctx.moveTo(xpos-markersize, ypos); + ctx.lineTo(xpos+markersize, ypos); + ctx.stroke(); + ctx.setLineDash([]); + break; + case "cross": + ctx.moveTo(xpos-markersize, ypos-markersize); + ctx.lineTo(xpos+markersize, ypos+markersize); + ctx.moveTo(xpos-markersize, ypos+markersize); + ctx.lineTo(xpos+markersize, ypos-markersize); + ctx.stroke(); + ctx.setLineDash([]); + break; + case "circle": + default: + ctx.arc(xpos, ypos, markersize, 0, 2*Math.PI * 1, true); + ctx.stroke(); + ctx.fill(); + ctx.setLineDash([]); + break; + } +}; + +function initPassVariableData_part1(data,config,ctx) { +var i,j,result, mxvalue ,mnvalue, cumvalue, totvalue,lmaxvalue,lminvalue,lgtxt,lgtxt2,tp,prevpos,firstNotMissingi,lastNotMissingi,firstNotMissingj,lastNotMissingj,grandtotal; +switch(ctx.tpchart) { + case "Pie" : + case "Doughnut" : + case "PolarArea" : + + result=[]; + var segmentAngle,cumulativeAngle,realCumulativeAngle; + + cumulativeAngle = (((-config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; + + startAngle=cumulativeAngle; + totvalue = 0; + notemptyval=0; + var firstNotMissing = -1; + var lastNotMissing = -1; + var prevNotMissing = -1; + mxvalue=-Number.MAX_VALUE; + mnvalue=Number.MAX_VALUE; + for (i = 0; i < data.length; i++) { + if(ctx.tpchart != "PolarArea" && 1*data[i].value<0)continue; + if (!(typeof(data[i].value) == 'undefined')) { + if(firstNotMissing==-1)firstNotMissing=i; + mxvalue=Math.max(mxvalue,1*data[i].value); + mnvalue=Math.min(mnvalue,1*data[i].value); + notemptyval++; + totvalue += 1 * data[i].value; + lastNotMissing=i; + } + } + + cumvalue=0; + var prevMissing=-1; + for(i=0;i<data.length;i++) { + if (typeof(data[i].title) == "string") lgtxt = data[i].title.trim(); + else lgtxt = ""; + if (!(typeof(data[i].value) == 'undefined') && (ctx.tpchart == "PolarArea" || 1*data[i].value>=0)) { + if(ctx.tpchart=="PolarArea") { if(notemptyval>0)segmentAngle= (Math.PI *2)/notemptyval; else segmentAngle=0; } + else segmentAngle = (1 * data[i].value / totvalue) * (Math.PI * 2); + if (segmentAngle >= Math.PI * 2) segmentAngle = Math.PI * 2 - 0.001; // bug on Android when segmentAngle is >= 2*PI; + cumvalue += 1 * data[i].value; + result[i]= { + config: config, + v1: fmtChartJS(config, lgtxt, config.fmtV1), + v2: fmtChartJS(config, 1 * data[i].value, config.fmtV2), + v3: fmtChartJS(config, cumvalue, config.fmtV3), + v4: fmtChartJS(config, totvalue, config.fmtV4), + v5: fmtChartJS(config, segmentAngle, config.fmtV5), + v6: roundToWithThousands(config, fmtChartJS(config, 100 * data[i].value / totvalue, config.fmtV6), config.roundPct), + v7 : 0, + v8 : 0, + v9 : 0, + v10 : 0, + v11: fmtChartJS(config, cumulativeAngle - segmentAngle, config.fmtV11), + v12: fmtChartJS(config, cumulativeAngle, config.fmtV12), + v13: fmtChartJS(config, i, config.fmtV13), + lgtxt: lgtxt, + datavalue: 1 * data[i].value, + cumvalue: cumvalue, + totvalue: totvalue, + segmentAngle: segmentAngle, + firstAngle : startAngle, + pctvalue: 100 * data[i].value / totvalue, + startAngle: cumulativeAngle, + realStartAngle : realCumulativeAngle, + endAngle: cumulativeAngle+segmentAngle, + maxvalue : mxvalue, + minvalue : mnvalue, + i: i, + firstNotMissing : firstNotMissing, + lastNotMissing : lastNotMissing, + prevNotMissing : prevNotMissing, + prevMissing : prevMissing, + nextNotMissing : -1, + radiusOffset : 0, + midPosX : 0, + midPosY : 0, + int_radius : 0, + ext_radius : 0, + data: data + }; + cumulativeAngle += segmentAngle; + realCumulativeAngle -= segmentAngle; + if(prevNotMissing != -1) result[prevNotMissing].nextNotMissing=i; + prevNotMissing = i; + } else { + result[i]={ + v1:lgtxt, + maxvalue : mxvalue, + minvalue : mnvalue, + i: i, + firstNotMissing : firstNotMissing, + lastNotMissing : lastNotMissing, + prevNotMissing : prevNotMissing + }; + prevMissing=i; + } + } + break; + case "Bar" : + case "Line" : + case "HorizontalBar" : + case "StackedBar" : + case "HorizontalStackedBar" : + case "Radar" : + var axis; + result=[]; + mxvalue=[]; + mxvalue[0]=[]; + mxvalue[1]=[]; + mnvalue=[]; + mnvalue[0]=[]; + mnvalue[1]=[]; + cumvalue=[]; + cumvalue[0]=[]; + cumvalue[1]=[]; + totvalue=[]; + totvalue[0]=[]; + totvalue[1]=[]; + lmaxvalue=[]; + lmaxvalue[0]=[]; + lmaxvalue[1]=[]; + lminvalue=[]; + lminvalue[0]=[]; + lminvalue[1]=[]; + prevpos=[]; + firstNotMissingi=[]; + lastNotMissingi=[]; + firstNotMissingj=[]; + lastNotMissingj=[]; + prevpos[0]=[]; + prevpos[1]=[]; + grandtotal=0; + + for (i = 0; i < data.datasets.length; i++) { + // BUG when all data are missing ! + if (typeof data.datasets[i].xPos != "undefined" && tpdraw(ctx,data.datasets[i])=="Line") { + for(j=data.datasets[i].data.length;j<data.datasets[i].xPos.length;j++)data.datasets[i].data.push(undefined); + } else { + for(j=data.datasets[i].data.length;j<data.labels.length;j++)data.datasets[i].data.push(undefined); + } + + + if(data.datasets[i].axis == 2) axis=0;else axis=1; + result[i]=[]; + lmaxvalue[0][i]=-Number.MAX_VALUE; + lmaxvalue[1][i]=-Number.MAX_VALUE; + lminvalue[0][i]=Number.MAX_VALUE; + lminvalue[1][i]=Number.MAX_VALUE; + firstNotMissingi[i]=-1; + lastNotMissingi[i]=-1; + for (j = 0; j < data.datasets[i].data.length; j++) { + + if(typeof firstNotMissingj[j]== "undefined"){ + firstNotMissingj[j]=-1; + lastNotMissingj[j]=-1; + totvalue[0][j] = 0; + mxvalue[0][j]=-Number.MAX_VALUE; + mnvalue[0][j]=Number.MAX_VALUE; + totvalue[1][j] = 0; + mxvalue[1][j]=-Number.MAX_VALUE; + mnvalue[1][j]=Number.MAX_VALUE; + } + if (!(typeof data.datasets[i].data[j] == 'undefined')) { + grandtotal += 1 * data.datasets[i].data[j]; + if(firstNotMissingi[i]==-1)firstNotMissingi[i]=j; + lastNotMissingi[i]=j; + if(firstNotMissingj[j]==-1)firstNotMissingj[j]=i; + lastNotMissingj[j]=i; + totvalue[axis][j] += 1 * data.datasets[i].data[j]; + mxvalue[axis][j] =Math.max(mxvalue[axis][j],1 * data.datasets[i].data[j]); + mnvalue[axis][j] =Math.min(mnvalue[axis][j],1 * data.datasets[i].data[j]); + lmaxvalue[axis][i] =Math.max(lmaxvalue[axis][i],1 * data.datasets[i].data[j]); + lminvalue[axis][i] =Math.min(lminvalue[axis][i],1 * data.datasets[i].data[j]); + } + } + } + + for (i = 0; i < data.datasets.length; i++) { + if(data.datasets[i].axis == 2) axis=0;else axis=1; + if (typeof(data.datasets[i].title) == "string") lgtxt = data.datasets[i].title.trim(); + else lgtxt = ""; + var prevnotemptyj=-1; + var prevemptyj=-1; + for (j = 0; j < data.datasets[i].data.length; j++) { + + if(typeof cumvalue[0][j]== "undefined"){cumvalue[0][j] = 0; prevpos[0][j]=-1;cumvalue[1][j] = 0; prevpos[1][j]=-1; } + lgtxt2 = ""; + if (typeof data.datasets[i].xPos != "undefined") { + if (!(typeof data.datasets[i].xPos[j] == "undefined")) lgtxt2 = data.datasets[i].xPos[j]; + } + if (lgtxt2 == "" && !(typeof(data.labels[j]) == "undefined")) lgtxt2 = data.labels[j]; + if (typeof lgtxt2 == "string") lgtxt2 = lgtxt2.trim(); + +// if (!(typeof(data.datasets[i].data[j]) == 'undefined') && data.datasets[i].data[j] != 0) { + if (!(typeof(data.datasets[i].data[j]) == 'undefined') ) { + cumvalue[axis][j]+=1*data.datasets[i].data[j]; + switch(tpdraw(ctx,data.datasets[i])) { + case "Bar" : + case "StackedBar" : + case "HorizontalBar" : + case "HorizontalStackedBar" : + result[i][j]= { + config: config, + v1: fmtChartJS(config, lgtxt, config.fmtV1), + v2: fmtChartJS(config, lgtxt2, config.fmtV2), + v3: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV3), + v4: fmtChartJS(config, cumvalue[axis][j], config.fmtV4), + v5: fmtChartJS(config, totvalue[axis][j], config.fmtV5), + v6: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[axis][j], config.fmtV6), config.roundPct), + v6T: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / grandtotal, config.fmtV6T), config.roundPct), + v11: fmtChartJS(config, i, config.fmtV11), + v12: fmtChartJS(config, j, config.fmtV12), + lgtxt: lgtxt, + lgtxt2: lgtxt2, + datavalue: 1 * data.datasets[i].data[j], + cumvalue: cumvalue[axis][j], + totvalue: totvalue[axis][j], + pctvalue: 100 * data.datasets[i].data[j] / totvalue[axis][j], + pctvalueT: 100 * data.datasets[i].data[j] / grandtotal, + maxvalue : mxvalue[axis][j], + minvalue : mnvalue[axis][j], + lmaxvalue : lmaxvalue[axis][i], + lminvalue : lminvalue[axis][i], + grandtotal : grandtotal, + firstNotMissing : firstNotMissingj[j], + lastNotMissing : lastNotMissingj[j], + prevNotMissing : prevnotemptyj, + prevMissing : prevemptyj, + nextNotMissing : -1, + j: j, + i: i, + data: data + }; + if(1 * data.datasets[i].data[j]==0 && (tpdraw(ctx,data.datasets[i])=="HorizontalStackedBar" || tpdraw(ctx,data.datasets[i])=="StackedBar"))result[i][j].v3=""; + break; + case "Line" : + case "Radar" : + result[i][j]= { + config: config, + v1: fmtChartJS(config, lgtxt, config.fmtV1), + v2: fmtChartJS(config, lgtxt2, config.fmtV2), + v3: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV3), + v5: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV5), + v6: fmtChartJS(config, mxvalue[axis][j], config.fmtV6), + v7: fmtChartJS(config, totvalue[axis][j], config.fmtV7), + v8: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[axis][j], config.fmtV8), config.roundPct), + v8T: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / grandtotal, config.fmtV8T), config.roundPct), + v11: fmtChartJS(config, i, config.fmtV11), + v12: fmtChartJS(config, j, config.fmtV12), + lgtxt: lgtxt, + lgtxt2: lgtxt2, + datavalue: 1 * data.datasets[i].data[j], + diffnext: 1 * data.datasets[i].data[j], + pctvalue: 100 * data.datasets[i].data[j] / totvalue[axis][j], + pctvalueT: 100 * data.datasets[i].data[j] / grandtotal, + totvalue : totvalue[axis][j], + cumvalue: cumvalue[axis][j], + maxvalue : mxvalue[axis][j], + minvalue : mnvalue[axis][j], + lmaxvalue : lmaxvalue[axis][i], + lminvalue : lminvalue[axis][i], + grandtotal : grandtotal, + firstNotMissing : firstNotMissingi[i], + lastNotMissing : lastNotMissingi[i], + prevNotMissing : prevnotemptyj, + prevMissing : prevemptyj, + nextNotMissing : -1, + j: j, + i: i, + data: data + }; + if(prevpos[axis][j]>=0){ + result[i][j].v4=fmtChartJS(config, (prevpos[axis][j] != -1 ? 1 * data.datasets[i].data[j]-result[prevpos[axis][j]][j].datavalue : 1 * data.datasets[i].data[j]), config.fmtV4); + result[i][j].diffprev=(prevpos[axis][j] != -1 ? 1 * data.datasets[i].data[j]-result[prevpos[axis][j]][j].datavalue : 1 * data.datasets[i].data[j]); + result[prevpos[axis][j]][j].diffnext=data.datasets[prevpos[axis][j]].data[j] - data.datasets[i].data[j]; + result[prevpos[axis][j]][j].v5=result[prevpos[axis][j]][j].diffnext; + } else { + result[i][j].v4=1 * data.datasets[i].data[j]; + + } + prevpos[axis][j]=i; + break; + default: + break; + } + if(!(typeof(data.datasets[i].data[j]) == 'undefined')) { + if(prevnotemptyj!= -1) {for(k=prevnotemptyj;k<j;k++) result[i][k].nextNotMissing=j;} + prevnotemptyj=j; + } + } else { + prevemptyj=j; + switch(tpdraw(ctx,data.datasets[i])) { + case "Bar" : + case "StackedBar" : + case "HorizontalBar" : + case "HorizontalStackedBar" : + result[i][j] ={ + v1:lgtxt, + lmaxvalue : lmaxvalue[axis][i], + lminvalue : lminvalue[axis][i], + firstNotMissing : firstNotMissingj[j], + lastNotMissing : lastNotMissingj[j], + prevNotMissing : prevnotemptyj, + prevMissing : prevemptyj, + grandtotal : grandtotal + }; + break; + case "Line" : + case "Radar" : + result[i][j] ={ + v1:lgtxt, + lmaxvalue : lmaxvalue[axis][i], + lminvalue : lminvalue[axis][i], + firstNotMissing : firstNotMissingi[i], + lastNotMissing : lastNotMissingi[i], + prevNotMissing : prevnotemptyj, + prevMissing : prevemptyj, + grandtotal : grandtotal + }; + break; + } + } + } + } + break; + default: + break; + } + + +return result; + +}; + +function initPassVariableData_part2(statData,data,config,ctx,othervars) { + +var realbars=0; +var i,j; +switch(ctx.tpchart) { + case "Pie" : + case "Doughnut" : + case "PolarArea" : + for(i=0;i<data.length;i++) { + statData[i].v7= fmtChartJS(config, othervars.midPosX, config.fmtV7); + statData[i].v8= fmtChartJS(config, othervars.midPosY, config.fmtV8), + statData[i].v9= fmtChartJS(config, othervars.int_radius, config.fmtV9); + statData[i].v10= fmtChartJS(config, othervars.ext_radius, config.fmtV10); + if(ctx.tpchart=="PolarArea") { + statData[i].radiusOffset= calculateOffset(config.logarithmic, 1 * data[i].value, othervars.calculatedScale, othervars.scaleHop); + statData[i].v10= fmtChartJS(config, statData[i].radiusOffset, config.fmtV10); + } + else { + statData[i].v10= fmtChartJS(config, othervars.ext_radius, config.fmtV10); + statData[i].radiusOffset=othervars.ext_radius; + } + statData[i].midPosX= othervars.midPosX; + statData[i].midPosY= othervars.midPosY; + statData[i].int_radius= othervars.int_radius; + statData[i].ext_radius= othervars.ext_radius; + } + break; + case "Radar" : + case "Line" : + case "Bar" : + case "StackedBar" : + case "HorizontalBar" : + case "HorizontalStackedBar" : + var tempp = new Array(data.datasets.length); + var tempn = new Array(data.datasets.length); + for (i = 0; i < data.datasets.length; i++) { + switch(tpdraw(ctx,data.datasets[i])) { + case "Line" : + for (j = 0; j < data.datasets[i].data.length; j++) { + statData[i][j].xAxisPosY = othervars.xAxisPosY; + statData[i][j].yAxisPosX = othervars.yAxisPosX; + statData[i][j].valueHop = othervars.valueHop; + statData[i][j].nbValueHop = othervars.nbValueHop; + if (data.datasets[i].axis == 2) { + statData[i][j].scaleHop = othervars.scaleHop2; + statData[i][j].zeroY = othervars.zeroY2; + statData[i][j].calculatedScale = othervars.calculatedScale2; + statData[i][j].logarithmic = othervars.logarithmic2; + } else { + statData[i][j].scaleHop = othervars.scaleHop; + statData[i][j].zeroY = othervars.zeroY; + statData[i][j].calculatedScale = othervars.calculatedScale; + statData[i][j].logarithmic = othervars.logarithmic; + } + statData[i][j].xPos=xPos(i,j,data,othervars.yAxisPosX,othervars.valueHop,othervars.nbValueHop); + statData[i][j].yAxisPos=othervars.xAxisPosY - statData[i][j].zeroY; + if(ctx.tpchart=="Bar") { + statData[i][j].xPos+=(othervars.valueHop/2); + statData[i][j].yAxisPosX += (othervars.valueHop/2); + } + if(j==0) { + statData[i][j].lmaxvalue_offset=calculateOffset(statData[i][j].logarithmic, statData[i][j].lmaxvalue, statData[i][j].calculatedScale, statData[i][j].scaleHop) - statData[i][j].zeroY; + statData[i][j].lminvalue_offset=calculateOffset(statData[i][j].logarithmic, statData[i][j].lminvalue, statData[i][j].calculatedScale, statData[i][j].scaleHop) - statData[i][j].zeroY; + } else { + statData[i][j].lmaxvalue_offset=statData[i][0].lmaxvalue_offset; + statData[i][j].lminvalue_offset=statData[i][0].lminvalue_offset; + } + + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + statData[i][j].yPosOffset= calculateOffset(statData[i][j].logarithmic, data.datasets[i].data[j], statData[i][j].calculatedScale, statData[i][j].scaleHop) - statData[i][j].zeroY; + statData[i][j].posY=statData[i][j].yAxisPos - statData[i][j].yPosOffset; + } + statData[i][j].posX=statData[i][j].xPos; + statData[i][j].v9= statData[i][j].xPos; + statData[i][j].v10=statData[i][j].posY; + + statData[i][j].annotateStartPosX = statData[i][j].xPos; + statData[i][j].annotateEndPosX = statData[i][j].xPos; + statData[i][j].annotateStartPosY = othervars.xAxisPosY; + statData[i][j].annotateEndPosY = othervars.xAxisPosY-othervars.msr.availableHeight; + statData[i][j].D1A=undefined; + statData[i][j].D1B=undefined; + } + break; + case "Radar" : + var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length; + for (j = 0; j < data.datasets[i].data.length; j++) { + statData[i][j].midPosX = othervars.midPosX; + statData[i][j].midPosY = othervars.midPosY; + statData[i][j].int_radius= 0; + statData[i][j].ext_radius= othervars.maxSize; + statData[i][j].radiusOffset= othervars.maxSize; + statData[i][j].calculated_offset= calculateOffset(config.logarithmic, data.datasets[i].data[j], othervars.calculatedScale, othervars.scaleHop); + statData[i][j].offsetX=Math.cos(config.startAngle * Math.PI / 180 - j * rotationDegree) * statData[i][j].calculated_offset; + statData[i][j].offsetY=Math.sin(config.startAngle * Math.PI / 180 - j * rotationDegree) * statData[i][j].calculated_offset; + statData[i][j].v9=statData[i][j].midPosX + statData[i][j].offsetX; + statData[i][j].v10=statData[i][j].midPosY - statData[i][j].offsetY; + statData[i][j].posX=statData[i][j].midPosX + statData[i][j].offsetX; + statData[i][j].posY=statData[i][j].midPosY - statData[i][j].offsetY; + if(j==0)statData[i][j].calculated_offset_max=calculateOffset(config.logarithmic, statData[i][j].lmaxvalue, othervars.calculatedScale, othervars.scaleHop); + else statData[i][j].calculated_offset_max=statData[0][j].calculated_offset_max; + statData[i][j].annotateStartPosX = othervars.midPosX; + statData[i][j].annotateEndPosX = othervars.midPosX+Math.cos(config.startAngle * Math.PI / 180 - j * rotationDegree) * othervars.maxSize; + statData[i][j].annotateStartPosY = othervars.midPosY; + statData[i][j].annotateEndPosY = othervars.midPosY-Math.sin(config.startAngle * Math.PI / 180 - j * rotationDegree) * othervars.maxSize; + if(Math.abs(statData[i][j].annotateStartPosX-statData[i][j].annotateEndPosX)<config.zeroValue) { + statData[i][j].D1A=undefined; + statData[i][j].D1B=undefined; + statData[i][j].D2A=0; + } else { + statData[i][j].D1A=(statData[i][j].annotateStartPosY-statData[i][j].annotateEndPosY)/(statData[i][j].annotateStartPosX-statData[i][j].annotateEndPosX); + statData[i][j].D1B=-statData[i][j].D1A*statData[i][j].annotateStartPosX+statData[i][j].annotateStartPosY; + if(Math.abs(statData[i][j].D1A)>=config.zeroValue)statData[i][j].D2A=-(1/statData[i][j].D1A); + else statData[i][j].D2A=undefined; + } + + } + break; + case "Bar" : + for (j = 0; j < data.datasets[i].data.length; j++) { + statData[i][j].xPosLeft= othervars.yAxisPosX + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) + othervars.valueHop * j + othervars.barWidth * realbars + Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing) * realbars + Math.ceil(ctx.chartLineScale*config.barStrokeWidth) * realbars; + statData[i][j].xPosRight = statData[i][j].xPosLeft + othervars.barWidth; + statData[i][j].yPosBottom =othervars.xAxisPosY - othervars.zeroY + statData[i][j].barHeight=calculateOffset(config.logarithmic, 1 * data.datasets[i].data[j], othervars.calculatedScale, othervars.scaleHop) - othervars.zeroY; + if (data.datasets[i].axis == 2) { + statData[i][j].yPosBottom =othervars.xAxisPosY - othervars.zeroY2; + statData[i][j].barHeight=calculateOffset(config.logarithmic2, 1 * data.datasets[i].data[j], othervars.calculatedScale2, othervars.scaleHop2) - othervars.zeroY2; + } else { + statData[i][j].yPosBottom =othervars.xAxisPosY - othervars.zeroY + statData[i][j].barHeight=calculateOffset(config.logarithmic, 1 * data.datasets[i].data[j], othervars.calculatedScale, othervars.scaleHop) - othervars.zeroY; + } + statData[i][j].yPosTop = statData[i][j].yPosBottom - statData[i][j].barHeight + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); + statData[i][j].v7=statData[i][j].xPosLeft; + statData[i][j].v8=statData[i][j].yPosBottom; + statData[i][j].v9=statData[i][j].xPosRight; + statData[i][j].v10=statData[i][j].yPosTop; + + } + realbars++; + break; + case "StackedBar" : + for (j = 0; j < data.datasets[i].data.length; j++) { + if (typeof tempp[j]=="undefined") { + tempp[j]=0; + tempn[j]=0; + zeroY= calculateOffset(config.logarithmic, 0 , othervars.calculatedScale, othervars.scaleHop); + } + if ((typeof data.datasets[i].data[j] == 'undefined')) continue; + statData[i][j].xPosLeft= othervars.yAxisPosX + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) + othervars.valueHop * j; + if (1*data.datasets[i].data[j]<0) { + statData[i][j].botval=tempn[j]; + statData[i][j].topval=tempn[j]+1*data.datasets[i].data[j] ; + tempn[j]=tempn[j]+1*data.datasets[i].data[j] ; + } else { + statData[i][j].botval=tempp[j]; + statData[i][j].topval=tempp[j]+1*data.datasets[i].data[j] ; + tempp[j]=tempp[j]+1*data.datasets[i].data[j] ; + } + statData[i][j].xPosRight = statData[i][j].xPosLeft + othervars.barWidth; + statData[i][j].botOffset = calculateOffset(config.logarithmic, statData[i][j].botval , othervars.calculatedScale, othervars.scaleHop); + statData[i][j].topOffset = calculateOffset(config.logarithmic, statData[i][j].topval , othervars.calculatedScale, othervars.scaleHop); + statData[i][j].yPosBottom =othervars.xAxisPosY - statData[i][j].botOffset; + statData[i][j].yPosTop = othervars.xAxisPosY - statData[i][j].topOffset; + // treat spaceBetweenBar + if(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar) > 0) + { + if(1*data.datasets[i].data[j]<0) { + statData[i][j].yPosBottom+=Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar); + if(tempn[j]==1*data.datasets[i].data[j])statData[i][j].yPosBottom-=(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar)/2); + if(statData[i][j].yPosTop<statData[i][j].yPosBottom)statData[i][j].yPosBottom=statData[i][j].yPosTop; + } else if (1*data.datasets[i].data[j]>0) { + statData[i][j].yPosBottom-=Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar); + if(tempp[j]==1*data.datasets[i].data[j])statData[i][j].yPosBottom+=(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar)/2); + if(statData[i][j].yPosTop>statData[i][j].yPosBottom)statData[i][j].yPosBottom=statData[i][j].yPosTop; + } + } + statData[i][j].v7=statData[i][j].xPosLeft; + statData[i][j].v8=statData[i][j].yPosBottom; + statData[i][j].v9=statData[i][j].xPosRight; + statData[i][j].v10=statData[i][j].yPosTop; + } + break; + case "HorizontalBar" : + for (j = 0; j < data.datasets[i].data.length; j++) { + statData[i][j].xPosLeft= othervars.yAxisPosX + othervars.zeroY; + statData[i][j].yPosTop=othervars.xAxisPosY + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) - othervars.scaleHop * (j + 1) + othervars.barWidth * i + Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing) * i + Math.ceil(ctx.chartLineScale*config.barStrokeWidth) * i; + statData[i][j].yPosBottom=statData[i][j].yPosTop+othervars.barWidth; + statData[i][j].barWidth = calculateOffset(config.logarithmic, 1 * data.datasets[i].data[j], othervars.calculatedScale, othervars.valueHop) - othervars.zeroY; + statData[i][j].xPosRight = statData[i][j].xPosLeft + statData[i][j].barWidth; + + statData[i][j].v7=statData[i][j].xPosLeft; + statData[i][j].v8=statData[i][j].yPosBottom; + statData[i][j].v9=statData[i][j].xPosRight; + statData[i][j].v10=statData[i][j].yPosTop; + } + break; + case "HorizontalStackedBar" : + for (j = 0; j < data.datasets[i].data.length; j++) { + if (i == 0) { + tempp[j]=0; + tempn[j]=0; + } + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; +// if ((typeof(data.datasets[i].data[j]) == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; + + statData[i][j].xPosLeft= othervars.yAxisPosX + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) + othervars.valueHop * j; + if (1*data.datasets[i].data[j]<0) { + statData[i][j].leftval=tempn[j]; + statData[i][j].rightval=tempn[j]+1*data.datasets[i].data[j] ; + tempn[j]=tempn[j]+1*data.datasets[i].data[j] ; + } else { + statData[i][j].leftval=tempp[j]; + statData[i][j].rightval=tempp[j]+1*data.datasets[i].data[j] ; + tempp[j]=tempp[j]+1*data.datasets[i].data[j] ; + } + statData[i][j].rightOffset = HorizontalCalculateOffset(statData[i][j].rightval , othervars.calculatedScale, othervars.valueHop); + statData[i][j].leftOffset = HorizontalCalculateOffset(statData[i][j].leftval , othervars.calculatedScale, othervars.valueHop); + statData[i][j].xPosRight = othervars.yAxisPosX + statData[i][j].rightOffset; + statData[i][j].xPosLeft = othervars.yAxisPosX + statData[i][j].leftOffset; + statData[i][j].yPosTop =othervars.xAxisPosY + Math.ceil(ctx.chartSpaceScale*config.barValueSpacing) - othervars.scaleHop * (j + 1); + statData[i][j].yPosBottom = statData[i][j].yPosTop+othervars.barWidth; + // treat spaceBetweenBar + if(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar) > 0) + { + if(1*data.datasets[i].data[j]<0) { + statData[i][j].xPosLeft-=Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar); + if(tempn[j]==1*data.datasets[i].data[j])statData[i][j].xPosLeft+=(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar)/2); + if(statData[i][j].xPosLeft<statData[i][j].xPosRight)statData[i][j].xPosLeft=statData[i][j].xPosRight; + } else if (1*data.datasets[i].data[j]>0) { + statData[i][j].xPosLeft+=Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar); + if(tempp[j]==1*data.datasets[i].data[j])statData[i][j].xPosLeft-=(Math.ceil(ctx.chartSpaceScale*config.spaceBetweenBar)/2); + if(statData[i][j].xPosLeft>statData[i][j].xPosRight)statData[i][j].xPosLeft=statData[i][j].xPosRight; + } + } + + statData[i][j].v7=statData[i][j].xPosLeft; + statData[i][j].v8=statData[i][j].yPosBottom; + statData[i][j].v9=statData[i][j].xPosRight; + statData[i][j].v10=statData[i][j].yPosTop; + } + break; + default : + break; + } + } + +} ; + + + + function xPos(ival, iteration, data,yAxisPosX,valueHop,nbValueHop) { + if (typeof data.datasets[ival].xPos == "object") { + if (!(typeof data.datasets[ival].xPos[Math.floor(iteration + config.zeroValue)] == "undefined")) { + var width = valueHop * nbValueHop; + var deb = (typeof data.xBegin != "undefined") ? data.xBegin : 1 * data.labels[0]; + var fin = (typeof data.xEnd != "undefined") ? data.xEnd : 1 * data.labels[data.labels.length - 1]; + if (fin <= deb) fin = deb + 100; + if (1 * data.datasets[ival].xPos[Math.floor(iteration + config.zeroValue)] >= deb && data.datasets[ival].xPos[Math.floor(iteration + config.zeroValue)] <= fin) { + var p1 = yAxisPosX + width * ((1 * data.datasets[ival].xPos[Math.floor(iteration + config.zeroValue)] - deb) / (fin - deb)); + var p2 = p1; + if (Math.abs(iteration - Math.floor(iteration + config.zeroValue)) > config.zeroValue) { + p2 = xPos(ival, Math.ceil(iteration - config.zeroValue), data); + } + return p1 + (iteration - Math.floor(iteration + config.zeroValue)) * (p2 - p1); + } + } + } + return yAxisPosX + (valueHop * iteration); + }; + + + function calculateOrderOfMagnitude(val) { + return Math.floor(Math.log(val) / Math.LN10); + }; + + function calculateOffset(logarithmic, val, calculatedScale, scaleHop) { + if (!logarithmic) { // no logarithmic scale + var outerValue = calculatedScale.steps * calculatedScale.stepValue; + var adjustedValue = val - calculatedScale.graphMin; + var scalingFactor = CapValue(adjustedValue / outerValue, 1, 0); + return (scaleHop * calculatedScale.steps) * scalingFactor; + } else { // logarithmic scale +// return CapValue(log10(val) * scaleHop - calculateOrderOfMagnitude(calculatedScale.graphMin) * scaleHop, undefined, 0); + return CapValue(log10(val) * scaleHop - log10(calculatedScale.graphMin) * scaleHop, undefined, 0); + } + }; + + function HorizontalCalculateOffset(val, calculatedScale, scaleHop) { + var outerValue = calculatedScale.steps * calculatedScale.stepValue; + var adjustedValue = val - calculatedScale.graphMin; + var scalingFactor = CapValue(adjustedValue / outerValue, 1, 0); + return (scaleHop * calculatedScale.steps) * scalingFactor; + }; + + //Apply cap a value at a high or low number + function CapValue(valueToCap, maxValue, minValue) { + if (isNumber(maxValue)) { + if (valueToCap > maxValue) { + return maxValue; + } + } + if (isNumber(minValue)) { + if (valueToCap < minValue) { + return minValue; + } + } + return valueToCap; + }; + function log10(val) { + return Math.log(val) / Math.LN10; + }; +}; + +function isBooleanOptionTrue(optionVar,defaultvalue) { + var j; + if(typeof optionvar == "undefined") { + if(typeof defaultvalue=="function") return true; + else if(typeof defaultvalue == "object") { + for(j=0;j<defaultvalue.length;j++) if (defaultvalue[j])return true; + return false; + } + else return defaultvalue; + } + if(typeof optionvar=="function") return true; + else if(typeof optionvar == "object") { + for(j=0;j<optionvar.length;j++) if (optionvar[j])return true; + return false; + } else return optionvar; +}; + +function setOptionValue(rescale,reference,ctx,data,statData,optionvar,defaultvalue,posi,posj,othervars) { + var rv; + if(typeof optionvar == "undefined") { + if(typeof defaultvalue=="function") return defaultvalue(reference,ctx,data,statData,posi,posj,othervars); + else if(typeof defaultvalue == "object") { + if(posj==-1)rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posi))]; + else rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posj))]; + } + else { + rv=defaultvalue; + } + if(rescale!=1)rv=Math.ceil(rv*rescale); + return rv; + } + if(typeof optionvar=="function") rv=optionvar(reference,ctx,data,statData,posi,posj,othervars); + else if(typeof optionvar == "object") { + if (posj==-1)rv=optionvar[Math.min(optionvar.length-1,Math.max(0,posi))]; + else rv=optionvar[Math.min(optionvar.length-1,Math.max(0,posj))]; + } + else rv=optionvar; + if(rescale!=1)rv=Math.ceil(rv*rescale); + return rv; + +}; + +function tpdraw(ctx,dataval) { + switch(ctx.tpchart) { + case "Bar" : + if (dataval.type=="Line") { tp="Line";} + else {tp=ctx.tpchart;} + break; + default : + tp=ctx.tpchart; + break; + } + return tp; +}; + +function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borderscolor,borderswidth,bordersxspace,bordersyspace,bordersstyle,backgroundcolor,optiongroup) { + var textHeight,textWidth; + // compute text width and text height; + if(typeof text != "string") { + var txt=text.toString(); + textHeight= fontsize * (txt.split("\n").length || 1); + textWidth = ctx.measureText(txt).width; + } else { + textHeight= fontsize * (text.split("\n").length || 1); + textWidth = ctx.measureText(text).width; + } + + + // compute xright, xleft, ytop, ybot; + + var xright, xleft, ytop, ybot; + if(ctx.textAlign=="center") { + xright=-textWidth/2; + xleft=textWidth/2; + } else if(ctx.textAlign=="left") { + xright=0; + xleft=textWidth; + } else if(ctx.textAlign=="right") { + xright=-textWidth; + xleft=0; + } + + if(ctx.textBaseline=="top") { + ytop=0; + ybottom=textHeight; + } else if (ctx.textBaseline=="center" || ctx.textBaseline=="middle") { + ytop=-textHeight/2; + ybottom=textHeight/2; + } else if (ctx.textBaseline=="bottom") { + ytop=-textHeight; + ybottom=0; + } + + ctx.save(); + ctx.beginPath(); + ctx.translate(xpos,ypos); + + if(backgroundcolor != "none") { + + ctx.save(); + ctx.fillStyle=backgroundcolor; + ctx.fillRect(xright-bordersxspace,ybottom+bordersyspace,xleft-xright+2*bordersxspace,ytop-ybottom-2*bordersyspace); + ctx.stroke(); + ctx.restore(); + ctx.fillStyle="black"; + } + + // draw border; + if (borders) { + ctx.save(); + ctx.lineWidth = borderswidth; + ctx.strokeStyle= borderscolor; + ctx.fillStyle= borderscolor; + ctx.setLineDash(lineStyleFn(bordersstyle)); + ctx.rect(xright-borderswidth/2-bordersxspace,ytop-borderswidth/2-bordersyspace,xleft-xright+borderswidth+2*bordersxspace,ybottom-ytop+borderswidth+2*bordersyspace); + ctx.stroke(); + ctx.setLineDash([]); + ctx.restore(); + } + + ctx.restore(); +}; diff --git a/comiccontrol/includes/dragndrop.js b/comiccontrol/includes/dragndrop.js new file mode 100644 index 0000000..90cb38d --- /dev/null +++ b/comiccontrol/includes/dragndrop.js @@ -0,0 +1,56 @@ +//drag and drop script + +document.onmousemove = mouseMove; +document.onmouseup = mouseUp; + +var dragObject = null; +var mouseOffset = null; + +function getMouseOffset(target, ev){ + ev = ev || window.event; + + var docPos = getPosition(target); + var mousePos = mouseCoords(ev); + return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y}; +} + +function getPosition(e){ + var left = 0; + var top = 0; + + while (e.offsetParent){ + left += e.offsetLeft; + top += e.offsetTop; + e = e.offsetParent; + } + + left += e.offsetLeft; + top += e.offsetTop; + + return {x:left, y:top}; +} + +function mouseMove(ev){ + ev = ev || window.event; + var mousePos = mouseCoords(ev); + + if(dragObject){ + dragObject.style.position = 'absolute'; + dragObject.style.top = mousePos.y - mouseOffset.y; + dragObject.style.left = mousePos.x - mouseOffset.x; + + return false; + } +} +function mouseUp(){ + dragObject = null; +} + +function makeDraggable(item){ + if(!item) return; + item.onmousedown = function(ev){ + dragObject = this; + mouseOffset = getMouseOffset(this, ev); + return false; + } +} diff --git a/comiccontrol/includes/footer.php b/comiccontrol/includes/footer.php new file mode 100644 index 0000000..9943ff0 --- /dev/null +++ b/comiccontrol/includes/footer.php @@ -0,0 +1,3 @@ +</div> +</body> +</html> diff --git a/comiccontrol/includes/header.php b/comiccontrol/includes/header.php new file mode 100644 index 0000000..b54522a --- /dev/null +++ b/comiccontrol/includes/header.php @@ -0,0 +1,67 @@ +<? +include('dbconfig.php'); +include('initialize.php'); +include('functions.php'); +if(!authCheck()) header("Location:" . $root . "login.php"); +//set $_GET variables + +$moduleid = sanitizeAlphanumeric($_GET['moduleid']); +$do = sanitizeAlphanumeric($_GET['do']); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>ComicControl.</title> +<link rel="stylesheet" type="text/css" href="<?=$root?>comiccontrol.css" /> +<script type="text/javascript" src="<?=$root?>includes/jquery.js"></script> +<script type="text/javascript" src="<?=$root?>tinymce/js/tinymce/tinymce.min.js"></script> +<script type="text/javascript"> +tinymce.init({ + selector: "textarea", + menubar: "tools table format view insert edit", + plugins: "image link table textcolor media jbimages code", + height : 400, + menu : { + edit : {title : 'Edit' , items : 'code | undo redo | cut copy paste pastetext | selectall'}, + insert : {title : 'Insert', items : 'link media image jbimages | hr'}, + view : {title : 'View' , items : 'visualaid'}, + format : {title : 'Format', items : 'bold italic underline strikethrough superscript subscript | formats | removeformat'}, + table : {title : 'Table' , items : 'inserttable tableprops deletetable | cell row column'}, + tools : {title : 'Tools' , items : 'spellchecker code'} + }, + relative_urls: false + }); +</script> +</head> +<body> +<div id="header"><a href="index.php">ComicControl.</a><a id="logout" href="login.php?action=logout">Logout</div></div> +<div id="menu"> +<ul> +<? + $break = Explode('/', $_SERVER['PHP_SELF']); + $pfile = $break[count($break) - 1]; + $query="SELECT * FROM cc_" . $tableprefix . "modules"; + $result=$z->query($query); + while($row = $result->fetch_assoc()) + { + if($row['type'] != "custom"){ + if(isset($_GET['id']) && $_GET['id'] == $row['id']) + { echo '<li class="selected"><a href="edit.php?moduleid='.$row['id'].'">'.$row['title'].'</a></li>'; } + else + { echo '<li><a href="edit.php?moduleid='.$row['id'].'">'.$row['title'].'</a></li>'; } + } + } + echo '<li'; + if($pfile == "imageupload.php") echo ' class="selected"'; + echo '><a href="imageupload.php">Image Upload</a></li>'; + $filearr = explode("/",dirname(__FILE__)); + $inputfilename = "/" . $filearr[1] . "/" . $filearr[2] . "/inputaddata.php"; + if(file_exists($inputfilename)){ + echo '<li><a href="viewadstats.php">' . $lang['adstats'] . '</a></li>'; + } +?> +</ul> +</div> +<div id="content">
\ No newline at end of file diff --git a/comiccontrol/includes/jquery.js b/comiccontrol/includes/jquery.js new file mode 100644 index 0000000..e5ace11 --- /dev/null +++ b/comiccontrol/includes/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b)) +},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n}); diff --git a/comiccontrol/includes/lightGallery.css b/comiccontrol/includes/lightGallery.css new file mode 100644 index 0000000..ce9ab4d --- /dev/null +++ b/comiccontrol/includes/lightGallery.css @@ -0,0 +1,629 @@ +/*clearfix*/ +.group { + *zoom: 1; +} +.group:before, .group:after { + display: table; + content: ""; + line-height: 0; +} +.group:after { + clear: both; +} +/*/clearfix*/ + + +/** /font-icons if you are not using font icons you can just remove this part/**/ +@font-face { + font-family: 'Slide-icons'; + src: url('../fonts/Slide-icons.eot'); +} +@font-face { + font-family: 'Slide-icons'; + src: url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAWcAAsAAAAACSgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAAm4AAAQxqzjSYEZGVE0AAAN4AAAAGgAAABxmWaSOR0RFRgAAA5QAAAAdAAAAIAAzAARPUy8yAAADtAAAAEsAAABgL/bcQGNtYXAAAAQAAAAAPQAAAVLgL/LNaGVhZAAABEAAAAAuAAAANv3vdhloaGVhAAAEcAAAAB4AAAAkBBD/5GhtdHgAAASQAAAAEgAAABIFOwBxbWF4cAAABKQAAAAGAAAABgAGUABuYW1lAAAErAAAAOEAAAGw7pftcnBvc3QAAAWQAAAADAAAACAAAwAAeJx9VE1oE1EQnpfsJutmSWNMQoUoWxB/qmIKnkKJWKvXQlOwhx5E7SEo9WCEHNKAJqVbn8RLzvEgKEUPCgoiIi3YHkWw2mO9CBb8O1SzurXjvLfrJiqEhXkzwzffm/nee8tAUYAxZuQvFs5PHi6cuzR1GVgAGORsM2D3Be1ehRtBbii7ddiZjyPnvmOE+QW7YRfVNNzpSQPE0vBwexqMtNIbh7Dg0KAHUrAL9sARyF6ZKpzKZDK0nMwMHHeXIXc54S7DHU109gPAZpnF5th1xiEkiANgsFpgNDATPB3ldlHZbNiNcBTZ/JNRZBPFZ0nE6mw/GT6MUC6tiPCgihA6Vkb8sXCNI35bGxRuTcYa4vqZIWlUP1sVoCx3Yyqd1gTNIUH4RhJ6rILAxw9yN/bwghVSt56rLoCyFY6gmy8kwENJwjYrlItPVauOuDWyhqDEzlKFIuvIIrAHfTJbr2uSWpgFOVvFHVDQc5dftK751P3CeyuNp8Uf/DL3tal5rFKLuiX2MxGdL00azJHKOWLcrZF3MmtZWhThNRWwx62XSYTF/d8Rc6sR2iFyNYS4MWNSzaeJA+RWfkqjCYBO5tV71bIkjTssUVe5bykrhrXqWqnZ1m9a6rfk61emfu+Px8iIA8zf/SrDNr4s8csd+Gbzn+mXOtWK3rPHkqbeGkuZuvNIGudo9wRdvDkald0Yj9HFy89vtvsgjw7/Pxm9Kf+SEfGj86HU/frlVn6RwgP7CLVRTZDCFZt6j99edcWGSPmz5h4BLO5d73bIzVL7OdTkc8j6O5MIdiPBkzcNnZ7zDvF/2OYkWvSFI78BSE0QpgAAeJxjYGBgZACCk535hiD6XIbUOhgNAD+3BfAAAHicY2BkYGDgA2IJBhBgYmAEQlYgZgHzGAAEgQA4AAAAeJxjYGZiYJzAwMrAwejDmMbAwOAOpb8ySDK0MDAwMbAyM8CBAILJEJDmmsLg8EDqAwPjg/8PGPQYHzAoNDAwMMIVKAAhIwATaAw5AHicY2BgYGaAYBkGRgYQ8AHyGMF8FgYDIM0BhEwgiQeyHxj+/wezpCAs+RcCjFBdYMDIxoDMHZEAAP1aCcoAAAB4nGNgZGBgAGLNvbqy8fw2Xxm4mRhA4FyG1DoE/f8BEwPjAyCXgwEsDQAB0gmnAAB4nGNgZGBgfPD/AYMeEwMDwz8GIAkUQQHMAG3nA/YAAAIAAAAAAAAAAgAAUQClACAAlgAAAABQAAAGAAB4nI2PMW7CQBBFn8FGIkQpo5RbIFHZsjciEhyAMg0SFwALrYS8kuEMOQLH4BgcgGPkAKnz7UxBkYKVVvPmz5/ZWeCZMwndSZjwZjwgozQeMuPLOJXnapyJv41HTJIXOZN0LOW17+p4wBNT4yGffBin8lyMM/HNeCT+Yc2BwI6aXHFLpOEI60PY1XnYxkbJnW7Kqs9PfWzZq9vhKfQPx1L3/6l/Nc9c6kLXy1/xrnGxOa1iu6+dL0q3dHevK/PzfJH7spLxkW03qrZSQ191eqHbi03dHkNsXFWUD835BcvqQqwAAAB4nGNgZsALAAB9AAQ=) format('woff'), url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTWZZpI4AAAboAAAAHEdERUYANQAGAAAGyAAAACBPUy8yL9TcHwAAAVgAAABWY21hcOAx89QAAAHMAAABUmdhc3D//wADAAAGwAAAAAhnbHlmlq1ZxgAAAzQAAAGAaGVhZP3vdhkAAADcAAAANmhoZWEEEP/mAAABFAAAACRobXR4BeoAcQAAAbAAAAAabG9jYQEyAOAAAAMgAAAAEm1heHAAUwAnAAABOAAAACBuYW1l7pftcgAABLQAAAGwcG9zdCBfgkMAAAZkAAAAWgABAAAAAQAAZVgBDF8PPPUACwIAAAAAAM5oGq4AAAAAzmgargAA/+ACAAHgAAAACAACAAAAAAAAAAEAAAHg/+AALgIAAAD+AAIAAAEAAAAAAAAAAAAAAAAAAAAFAAEAAAAIACQACQAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQIAAZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQMAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUGZFZABA4BrwAAHg/+AALgHgACCAAAABAAAAAAAAAgAAAAAAAAAAqgAAAAAAAAIAAFEAqgAgAJYAAAAAAAMAAAADAAAAHAABAAAAAABMAAMAAQAAABwABAAwAAAACAAIAAIAAAAA4B3wAP//AAAAAOAa8AD//wAAH+oQAwABAAAAAAAAAAAAAAEGAAABAAAAAAAAAAECAAAAAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAEIAZACeAMAAAAABAAD/4AIAAeAAAgAAEQEhAgD+AAHg/gAAAAAAAQBRADYBrwGKAB0AAAE2NC8BJg8BJyYPAQYUHwEHBh8BFj8BFxY/ATYvAQGqBAQXCwx8fAwLFwQEfX0LCxcLDHx8DAsXCwt9AVwFDQUXCwt9fQsLFwUNBXx8DAsXCwt9fQsLFwsMfAABAKoABQGeAbYAEQAAEyYPAQYfAQcGHwEWMj8BNjQn1AwLEwsLrKwLCxMFDQXBCAgBtgsLEwsMrKwMCxMFBcEJGAkAAAkAIAAAAeABwAADAAcACwAPABMAFwAbAB8AIwAAEzMVIyUzFSMnMxUjBzMVIyUzFSMnMxUjBzMVIyUzFSMnMxUjIICAAUCAgKCAgKCAgAFAgICggICggIABQICAoICAAcCAgICAgCCAgICAgCCAgICAgAAAAQCWAAoBjwG2ABEAAAE2LwEmDwEGFB8BFj8BNjQvAQGKCwsTDAvBCQnBCwsUBAStAYwMCxMLC8EJGAnBCwsTBQ0FrAAAAAwAlgABAAAAAAABAAsAGAABAAAAAAACAAUAMAABAAAAAAADACcAhgABAAAAAAAEAAsAxgABAAAAAAAFAAsA6gABAAAAAAAGAAsBDgADAAEECQABABYAAAADAAEECQACAAoAJAADAAEECQADAE4ANgADAAEECQAEABYArgADAAEECQAFABYA0gADAAEECQAGABYA9gBTAGwAaQBkAGUALQBpAGMAbwBuAHMAAFNsaWRlLWljb25zAABpAGMAbwBuAHMAAGljb25zAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAFMAbABpAGQAZQAtAGkAYwBvAG4AcwAgADoAIAAyADUALQA5AC0AMgAwADEAMwAARm9udEZvcmdlIDIuMCA6IFNsaWRlLWljb25zIDogMjUtOS0yMDEzAABTAGwAaQBkAGUALQBpAGMAbwBuAHMAAFNsaWRlLWljb25zAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABTAGwAaQBkAGUALQBpAGMAbwBuAHMAAFNsaWRlLWljb25zAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAABAAIBAgEDAQQBBQEGB3VuaUYwMDAHdW5pRTAxQQd1bmlFMDFCB3VuaUUwMUMHdW5pRTAxRAAAAAAAAf//AAIAAQAAAA4AAAAYAAAAAAACAAEAAwAHAAEABAAAAAIAAAAAAAEAAAAAyYlvMQAAAADOaBquAAAAAM5oGq4=) format('truetype'); + font-weight: normal; + font-style: normal; +} +[data-icon]:before { + font-family: 'Slide-icons'; + content: attr(data-icon); + speak: none; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/** / End of font-icons /**/ + + + + +.lightGallery { + overflow: hidden!important; +} +#lightGallery-Gallery img { + border: none!important; +} +#lightGallery-outer { + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 99999!important; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + opacity: 1; + -webkit-transition: opacity 0.35s ease; + -moz-transition: opacity 0.35s ease; + -o-transition: opacity 0.35s ease; + -ms-transition: opacity 0.35s ease; + transition: opacity 0.35s ease; + background: #0d0d0d; +} +#lightGallery-outer .lightGallery-slide{ + position: relative; +} +/*lightGallery starting effects*/ +#lightGallery-Gallery.opacity { + opacity: 1; + transition: opacity 1s ease 0s; + -moz-transition: opacity 1s ease 0s; + -webkit-transition: opacity 1s ease 0s; + -o-transition: opacity 1s ease 0s; + -ms-transition: opacity 1s ease 0s; +} +#lightGallery-Gallery.opacity .thumb_cont { + opacity: 1; +} +#lightGallery-Gallery.fadeM { + opacity: 0; + transition: opacity 0.5s ease 0s; + -moz-transition: opacity 0.5s ease 0s; + -webkit-transition: opacity 0.5s ease 0s; + -o-transition: opacity 0.5s ease 0s; + -ms-transition: opacity 0.5s ease 0s; +} +/*lightGallery starting effects*/ + + +/*lightGallery core*/ +#lightGallery-Gallery { + height: 100%; + opacity: 0; + width: 100%; + position: relative; + transition: opacity 1s ease 0s; + -moz-transition: opacity 1s ease 0s; + -webkit-transition: opacity 1s ease 0s; + -o-transition: opacity 1s ease 0s; + -ms-transition: opacity 1s ease 0s; +} +/**/ +#lightGallery-slider { + height: 100%; + left: 0; + top: 0; + width: 100%; + position: absolute; + white-space: nowrap; +} +/**/ +#lightGallery-slider .lightGallery-slide { + background: url(../img/loading.gif) no-repeat scroll center center transparent; + display: inline-block; + height: 100%; + text-align: center; + width: 100%; +} +#lightGallery-slider .lightGallery-slide.complete { + background-image: none; +} +#lightGallery-Gallery.showAfterLoad .lightGallery-slide > * { + opacity: 0; +} +#lightGallery-Gallery.showAfterLoad .lightGallery-slide.complete > * { + opacity: 1; +} +#lightGallery-slider.slide .lightGallery-slide, #lightGallery-slider.useLeft .lightGallery-slide { + position: absolute; + opacity: 0.4; +} +#lightGallery-slider.fadeM .lightGallery-slide { + position: absolute; + left: 0; + opacity: 0; +} +#lightGallery-slider.animate .lightGallery-slide { + position: absolute; + left: 0; +} +#lightGallery-slider.fadeM .current { + opacity: 1; + z-index: 9; +} +#lightGallery-slider .lightGallery-slide:before { + content: ""; + display: inline-block; + height: 50%; + width: 1px; + margin-right: -1px; +} +#lightGallery-Gallery.opacity .lightGallery-slide .object{ + transform: scale3d(1, 1, 1); + -moz-transform: scale3d(1, 1, 1); + -ms-transform: scale3d(1, 1, 1); + -webkit-transform: scale3d(1, 1, 1); + -o-transform: scale3d(1, 1, 1); +} +.lightGallery-slide .object{ + transform: scale3d(0.5, 0.5, 0.5); + -moz-transform: scale3d(0.5, 0.5, 0.5); + -ms-transform: scale3d(0.5, 0.5, 0.5); + -webkit-transform: scale3d(0.5, 0.5, 0.5); + -o-transform: scale3d(0.5, 0.5, 0.5); + -webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.5s ease 0s; + -moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.5s ease 0s; + -o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.5s ease 0s; + -ms-transition: -ms-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.5s ease 0s; + transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.5s ease 0s; +} +#lightGallery-Gallery.fadeM .lightGallery-slide .object{ + transform: scale3d(0.5, 0.5, 0.5); + -moz-transform: scale3d(0.5, 0.5, 0.5); + -ms-transform: scale3d(0.5, 0.5, 0.5); + -webkit-transform: scale3d(0.5, 0.5, 0.5); + -o-transform: scale3d(0.5, 0.5, 0.5); +} +#lightGallery-slider.fadeM.on .current { + opacity: 1; + transition: opacity 0.5s ease 0s; + -moz-transition: opacity 0.5s ease 0s; + -webkit-transition: opacity 0.5s ease 0s; + -o-transition: opacity 0.5s ease 0s; + -ms-transition: opacity 0.5s ease 0s; +} +#lightGallery-slider.fadeM .lightGallery-slide { + transition: opacity 0.4s ease 0s; + -moz-transition: opacity 0.4s ease 0s; + -webkit-transition: opacity 0.4s ease 0s; + -o-transition: opacity 0.4s ease 0s; + -ms-transition: opacity 0.4s ease 0s; +} +#lightGallery-slider.slide .lightGallery-slide { + transform: translate3d(100%, 0px, 0px); + -moz-transform: translate3d(100%, 0px, 0px); + -ms-transform: translate3d(100%, 0px, 0px); + -webkit-transform: translate3d(100%, 0px, 0px); + -o-transform: translate3d(100%, 0px, 0px); +} +#lightGallery-slider.slide.on .lightGallery-slide { + opacity: 0; +} +#lightGallery-slider.slide .lightGallery-slide.current { + opacity: 1 !important; + transform: translate3d(0px, 0px, 0px) !important; + -moz-transform: translate3d(0px, 0px, 0px) !important; + -ms-transform: translate3d(0px, 0px, 0px) !important; + -webkit-transform: translate3d(0px, 0px, 0px) !important; + -o-transform: translate3d(0px, 0px, 0px) !important; +} +#lightGallery-slider.slide .lightGallery-slide.prevSlide { + opacity: 0; + transform: translate3d(-100%, 0px, 0px); + -moz-transform: translate3d(-100%, 0px, 0px); + -ms-transform: translate3d(-100%, 0px, 0px); + -webkit-transform: translate3d(-100%, 0px, 0px); + -o-transform: translate3d(-100%, 0px, 0px); +} +#lightGallery-slider.slide .lightGallery-slide.nextSlide { + opacity: 0; + transform: translate3d(100%, 0px, 0px); + -moz-transform: translate3d(100%, 0px, 0px); + -ms-transform: translate3d(100%, 0px, 0px); + -webkit-transform: translate3d(100%, 0px, 0px); + -o-transform: translate3d(100%, 0px, 0px); +} +#lightGallery-slider.useLeft .lightGallery-slide { + left: 100%; +} +#lightGallery-slider.useLeft.on .lightGallery-slide { + opacity: 0; +} +#lightGallery-slider.useLeft .lightGallery-slide.current { + opacity: 1 !important; + left: 0% !important; +} +#lightGallery-slider.useLeft .lightGallery-slide.prevSlide { + opacity: 0; + left: -100%; +} +#lightGallery-slider.useLeft .lightGallery-slide.nextSlide { + opacity: 0; + left: 100%; +} +#lightGallery-slider.slide.on .lightGallery-slide, #lightGallery-slider.slide.on .current, #lightGallery-slider.slide.on .prevSlide, #lightGallery-slider.slide.on .nextSlide { + -webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s; + -moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s; + -o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s; + -ms-transition: -ms-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s; + transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s; +} +#lightGallery-slider.speed .lightGallery-slide, #lightGallery-slider.speed .current, #lightGallery-slider.speed .prevSlide, #lightGallery-slider.speed .nextSlide { + transition-duration: inherit !important; + -moz-transition-duration: inherit !important; + -webkit-transition-duration: inherit !important; + -o-transition-duration: inherit !important; + -ms-transition-duration: inherit !important; +} +#lightGallery-slider.timing .lightGallery-slide, #lightGallery-slider.timing .current, #lightGallery-slider.timing .prevSlide, #lightGallery-slider.timing .nextSlide { + transition-timing-function: inherit !important; + -moz-transition-timing-function: inherit !important; + -webkit-transition-timing-function: inherit !important; + -o-transition-timing-function: inherit !important; + -ms-transition-timing-function: inherit !important; +} +#lightGallery-slider .lightGallery-slide img { + display: inline-block; + max-height: 100%; + max-width: 100%; + cursor: -moz-grabbing; + cursor: grab; + cursor: -webkit-grab; + margin: 0; + padding: 0; + width: auto; + height: auto; + vertical-align: middle; +} +#lightGallery-Gallery .thumb_cont .thumb_inner { + -webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s; + -moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s; + -o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s; + -ms-transition: -ms-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s; + transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s; +} + @-webkit-keyframes rightEnd { + 0% { +left: 0; +} + 50% { +left: -30px; +} + 100% { +left: 0; +} +} +@keyframes rightEnd { + 0% { +left: 0; +} + 50% { +left: -30px; +} + 100% { +left: 0; +} +} +@-webkit-keyframes leftEnd { + 0% { +left: 0; +} + 50% { +left: 30px; +} + 100% { +left: 0; +} +} +@keyframes leftEnd { + 0% { +left: 0; +} + 50% { +left: 30px; +} + 100% { +left: 0; +} +} +.lightGallery-slide .object.rightEnd { + -webkit-animation: rightEnd 0.3s; + animation: rightEnd 0.3s; + position: relative; +} +.lightGallery-slide .object.leftEnd { + -webkit-animation: leftEnd 0.3s; + animation: leftEnd 0.3s; + position: relative; +} +/*lightGallery core*/ + + +/*action*/ +#lightGallery-action { + bottom: 20px; + position: fixed; + left: 50%; + margin-left: -30px; + z-index: 9; + -webkit-backface-visibility: hidden; +} +#lightGallery-action.hasThumb { + margin-left: -46px; +} + +#lightGallery-action a { + margin: 0 3px 0 0 !important; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + position: relative; + top: auto; + left: auto; + bottom: auto; + right: auto; + display: inline-block !important; + display: inline-block; + vertical-align: middle; + *display: inline; + *zoom: 1; + background-color: #000; + background-color: rgba(0, 0, 0, 0.65); + font-size: 16px; + width: 28px; + height: 28px; + font-family: 'Slide-icons'; + color: #FFF; + cursor: pointer; +} +#lightGallery-action a.disabled { + opacity: 0.6; + filter: alpha(opacity=60); + cursor: default; + background-color: #000; + background-color: rgba(0, 0, 0, 0.65) !important; +} +#lightGallery-action a:hover, #lightGallery-action a:focus { + background-color: #000; + background-color: rgba(0, 0, 0, 0.85); +} +#lightGallery-action a#lightGallery-prev:before, #lightGallery-action a#lightGallery-next:after { + left: 5px; + bottom: 3px; + position: absolute; +} +#lightGallery-action a#lightGallery-prev:before { + content: "\e01d"; +} +#lightGallery-action a#lightGallery-next:after { + content: "\e01b"; +} +#lightGallery-action a.cLthumb:after { + font-family: 'Slide-icons'; + content: "\e01c"; + left: 6px; + bottom: 4px; + font-size: 16px; + position: absolute; +} +/*action*/ + +/*counter*/ +#lightGallery_counter { + bottom: 52px; + text-align: center; + width: 100%; + position: absolute; + z-index: 9; + color: #FFFFFF; +} +/*lightGallery Thumb*/ +#lightGallery-Gallery .thumb_cont { + position: absolute; + bottom: 0; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + background-color: #000000; + -webkit-transition: max-height 0.4s ease-in-out; + -moz-transition: max-height 0.4s ease-in-out; + -o-transition: max-height 0.4s ease-in-out; + -ms-transition: max-height 0.4s ease-in-out; + transition: max-height 0.4s ease-in-out; + z-index: 9; + max-height: 0; + opacity: 0; +} +#lightGallery-Gallery.open .thumb_cont { + max-height: 350px; +} +#lightGallery-Gallery .thumb_cont .thumb_inner { + margin-left: -12px; + padding: 12px; + max-height: 290px; + overflow-y: auto; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +#lightGallery-Gallery .thumb_cont .thumb_info { + background-color: #333; + padding: 7px 20px; +} +#lightGallery-Gallery .thumb_cont .thumb_info .count { + color: #ffffff; + font-weight: bold; + font-size: 12px; +} +#lightGallery-Gallery .thumb_cont .thumb_info .close { + color: #FFFFFF; + display: block; + float: right !important; + width: 28px; + position: relative; + height: 28px; + border-radius: 2px; + margin-top: -4px; + background-color: #000; + background-color: rgba(0, 0, 0, 0.65); + -webkit-transition: background-color 0.3s ease 0s; + -moz-transition: background-color 0.3s ease 0s; + -o-transition: background-color 0.3s ease 0s; + -ms-transition: background-color 0.3s ease 0s; + transition: background-color 0.3s ease 0s; + z-index: 1090; + cursor: pointer; +} +#lightGallery-Gallery .thumb_cont .thumb_info .close i:after { + left: 6px; + position: absolute; + top: 4px; +} +#lightGallery-Gallery .thumb_cont .thumb_info .close i:after, #lightGallery-close:after { + content: "\e01a"; + font-family: 'Slide-icons'; + font-style: normal; + font-size: 16px; +} +#lightGallery-Gallery .thumb_cont .thumb_info .close:hover { + text-decoration: none; + background-color: #000; + background-color: rgba(0, 0, 0, 1); +} +#lightGallery-Gallery .thumb_cont .thumb { + display: inline-block !important; + vertical-align: middle; + text-align: center; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-bottom: 4px; + height: 50px; + width: 50px; + opacity: 0.6; + filter: alpha(opacity=60); + overflow: hidden; + border-radius: 3px; + cursor: pointer; + -webkit-transition: border-color linear .2s, opacity linear .2s; + -moz-transition: border-color linear .2s, opacity linear .2s; + -o-transition: border-color linear .2s, opacity linear .2s; + -ms-transition: border-color linear .2s, opacity linear .2s; + transition: border-color linear .2s, opacity linear .2s; +} +@media (min-width: 800px) { +#lightGallery-Gallery .thumb_cont .thumb { + width: 94px; + height: 94px; +} +} +#lightGallery-Gallery .thumb_cont .thumb > img { + height: auto; + max-width: 100%; +} +#lightGallery-Gallery .thumb_cont .thumb.active, #lightGallery-Gallery .thumb_cont .thumb:hover { + opacity: 1; + filter: alpha(opacity=100); + border-color: #ffffff; +} +/*lightGallery Thumb*/ + +/*lightGallery Video*/ +#lightGallery-slider .video_cont { + display: inline-block; + max-height: 100%; + max-width: 100%; + margin: 0; + padding: 0; + width: auto; + height: auto; + vertical-align: middle; +} +#lightGallery-slider .video_cont { + background: none; + max-width: 1140px; + max-height: 100%; + width: 100%; + box-sizing: border-box; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; +} +#lightGallery-slider .video { + width: 100%; + height: 0; + padding-bottom: 56.25%; + overflow: hidden; + position: relative; +} +#lightGallery-slider .video .object { + width: 100%!important; + height: 100%!important; + position: absolute; + top: 0; + left: 0; +} +/*lightGallery Video*/ + + + + + + +/*lightGallery Close*/ +#lightGallery-close { + color: #FFFFFF; + height: 28px; + position: absolute; + right: 20px; + top: 20px; + width: 28px; + z-index: 1090; + cursor: pointer; + background-color: #000; + border-radius: 2px; + background-color: #000; + background-color: rgba(0, 0, 0, 0.65); + -webkit-transition: background-color 0.3s ease; + -moz-transition: background-color 0.3s ease; + -o-transition: background-color 0.3s ease; + -ms-transition: background-color 0.3s ease; + transition: background-color 0.3s ease; + -webkit-backface-visibility: hidden; +} +#lightGallery-close:after { + position: absolute; + right: 6px; + top: 3px; +} +#lightGallery-close:hover { + text-decoration: none; + background-color: #000; +} +.customHtml { + background: none repeat scroll 0 0 black; + background: none repeat scroll 0 0 rgba(0, 0, 0, 0.75); + color: #fff; + font-family: Arial, sans-serif; + height: 70px; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 9; +} +.customHtml p { + font-size: 14px; +} +.customHtml > h4 { + font-family: Arial, sans-serif; + font-weight: bold; + margin-bottom: 5px; + margin-top: 15px; +} diff --git a/comiccontrol/includes/lightGallery.js b/comiccontrol/includes/lightGallery.js new file mode 100644 index 0000000..3d934e3 --- /dev/null +++ b/comiccontrol/includes/lightGallery.js @@ -0,0 +1,781 @@ +/** ========================================================== + +* jquery lightGallery.js v1.1.4 +* http://sachinchoolur.github.io/lightGallery/ +* Released under the MIT License - http://opensource.org/licenses/mit-license.html ---- FREE ---- + +=========================================================/**/ +; +(function($) { + "use strict"; + $.fn.lightGallery = function(options) { + var defaults = { + mode: 'slide', + useCSS: true, + cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',// + easing: 'linear', //'for jquery animation',// + speed: 600, + addClass: '', + + closable: true, + loop: false, + auto: false, + pause: 4000, + escKey: true, + controls: true, + hideControlOnEnd: false, + + preload: 1, //number of preload slides. will exicute only after the current slide is fully loaded. ex:// you clicked on 4th image and if preload = 1 then 3rd slide and 5th slide will be loaded in the background after the 4th slide is fully loaded.. if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... + showAfterLoad: true, + selector: null, + index: false, + + lang: { + allPhotos: 'All photos' + }, + counter: false, + + exThumbImage: false, + thumbnail: true, + showThumbByDefault:false, + animateThumb: true, + currentPagerPosition: 'middle', + thumbWidth: 100, + thumbMargin: 5, + + + mobileSrc: false, + mobileSrcMaxWidth: 640, + swipeThreshold: 50, + enableTouch: true, + enableDrag: true, + + vimeoColor: 'CCCCCC', + videoAutoplay: true, + videoMaxWidth: '855px', + + dynamic: false, + dynamicEl: [], + //callbacks + + onOpen: function(plugin) {}, + onSlideBefore: function(plugin) {}, + onSlideAfter: function(plugin) {}, + onSlideNext: function(plugin) {}, + onSlidePrev: function(plugin) {}, + onBeforeClose: function(plugin) {}, + onCloseAfter: function(plugin) {} + }, + el = $(this), + plugin = this, + $children = null, + index = 0, + isActive = false, + lightGalleryOn = false, + isTouch = document.createTouch !== undefined || ('ontouchstart' in window) || ('onmsgesturechange' in window) || navigator.msMaxTouchPoints, + $gallery, $galleryCont, $slider, $slide, $prev, $next, prevIndex, $thumb_cont, $thumb, windowWidth, interval, usingThumb = false, + aTiming = false, + aSpeed = false; + var settings = $.extend(true, {}, defaults, options); + var lightGallery = { + init: function() { + el.each(function() { + var $this = $(this); + if (settings.dynamic) { + $children = settings.dynamicEl; + index = 0; + prevIndex = index; + setUp.init(index); + } else { + if (settings.selector !== null) { + $children = $(settings.selector); + } else { + $children = $this.children(); + } + $children.on('click', function(e) { + if (settings.selector !== null) { + $children = $(settings.selector); + } else { + $children = $this.children(); + } + e.preventDefault(); + e.stopPropagation(); + index = $children.index(this); + prevIndex = index; + setUp.init(index); + }); + } + }); + } + }; + var setUp = { + init: function() { + isActive = true; + this.structure(); + this.getWidth(); + this.closeSlide(); + this.autoStart(); + this.counter(); + this.slideTo(); + this.buildThumbnail(); + this.keyPress(); + if (settings.index) { + this.slide(settings.index); + this.animateThumb(settings.index); + } else { + this.slide(index); + this.animateThumb(index); + } + if (settings.enableDrag) { + this.touch(); + }; + if (settings.enableTouch) { + this.enableTouch(); + } + + setTimeout(function() { + $gallery.addClass('opacity'); + }, 50); + }, + structure: function() { + $('body').append('<div id="lightGallery-outer" class="' + settings.addClass + '"><div id="lightGallery-Gallery"><div id="lightGallery-slider"></div><a id="lightGallery-close" class="close"></a></div></div>').addClass('lightGallery'); + $galleryCont = $('#lightGallery-outer'); + $gallery = $('#lightGallery-Gallery'); + if (settings.showAfterLoad === true) { + $gallery.addClass('showAfterLoad'); + } + $slider = $gallery.find('#lightGallery-slider'); + var slideList = ''; + if (settings.dynamic) { + for (var i = 0; i < settings.dynamicEl.length; i++) { + slideList += '<div class="lightGallery-slide"></div>'; + } + } else { + $children.each(function() { + slideList += '<div class="lightGallery-slide"></div>'; + }); + } + $slider.append(slideList); + $slide = $gallery.find('.lightGallery-slide'); + }, + closeSlide: function() { + var $this = this; + if (settings.closable) { + $('#lightGallery-outer') + .on('click', function(event) { + if ($(event.target).is('.lightGallery-slide')) { + plugin.destroy(false); + } + }); + } + $('#lightGallery-close').bind('click touchend', function() { + plugin.destroy(false); + }); + }, + getWidth: function() { + var resizeWindow = function() { + windowWidth = $(window).width(); + }; + $(window).bind('resize.lightGallery', resizeWindow()); + }, + doCss: function() { + var support = function() { + var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; + var root = document.documentElement; + for (var i = 0; i < transition.length; i++) { + if (transition[i] in root.style) { + return true; + } + } + }; + if (settings.useCSS && support()) { + return true; + } + return false; + }, + enableTouch: function() { + var $this = this; + if (isTouch) { + var startCoords = {}, + endCoords = {}; + $('body').on('touchstart.lightGallery', function(e) { + endCoords = e.originalEvent.targetTouches[0]; + startCoords.pageX = e.originalEvent.targetTouches[0].pageX; + startCoords.pageY = e.originalEvent.targetTouches[0].pageY; + }); + $('body').on('touchmove.lightGallery', function(e) { + var orig = e.originalEvent; + endCoords = orig.targetTouches[0]; + e.preventDefault(); + }); + $('body').on('touchend.lightGallery', function(e) { + var distance = endCoords.pageX - startCoords.pageX, + swipeThreshold = settings.swipeThreshold; + if (distance >= swipeThreshold) { + $this.prevSlide(); + clearInterval(interval); + } else if (distance <= -swipeThreshold) { + $this.nextSlide(); + clearInterval(interval); + } + }); + } + }, + touch: function() { + var xStart, xEnd; + var $this = this; + $('.lightGallery').bind('mousedown', function(e) { + e.stopPropagation(); + e.preventDefault(); + xStart = e.pageX; + }); + $('.lightGallery').bind('mouseup', function(e) { + e.stopPropagation(); + e.preventDefault(); + xEnd = e.pageX; + if (xEnd - xStart > 20) { + $this.prevSlide(); + } else if (xStart - xEnd > 20) { + $this.nextSlide(); + } + }); + }, + isVideo: function(src, index) { + var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9_\-]+)/i); + var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); + var iframe = false; + if (settings.dynamic) { + if (settings.dynamicEl[index].iframe == 'true') { + iframe = true; + } + } else { + if ($children.eq(index).attr('data-iframe') == 'true') { + iframe = true; + } + } + if (youtube || vimeo || iframe) { + return true; + } + }, + loadVideo: function(src, _id) { + var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9_\-]+)/i); + var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); + var video = ''; + var a = ''; + if (youtube) { + if (settings.videoAutoplay === true && lightGalleryOn === false) { + a = '?autoplay=1&rel=0&wmode=opaque'; + } else { + a = '?wmode=opaque'; + } + video = '<iframe class="object" width="560" height="315" src="//www.youtube.com/embed/' + youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>'; + } else if (vimeo) { + if (settings.videoAutoplay === true && lightGalleryOn === false) { + a = 'autoplay=1&'; + } else { + a = ''; + } + video = '<iframe class="object" id="video' + _id + '" width="560" height="315" src="http://player.vimeo.com/video/' + vimeo[1] + '?' + a + 'byline=0&portrait=0&color=' + settings.vimeoColor + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; + } else { + video = '<iframe class="object" frameborder="0" src="' + src + '" allowfullscreen="true"></iframe>'; + } + return '<div class="video_cont" style="max-width:' + settings.videoMaxWidth + ' !important;"><div class="video">' + video + '</div></div>'; + }, + addHtml: function(index) { + var dataSubHtml = null; + if (settings.dynamic) { + dataSubHtml = settings.dynamicEl[index]['sub-html']; + } else { + dataSubHtml = $children.eq(index).attr('data-sub-html'); + } + if (typeof dataSubHtml !== 'undefined' && dataSubHtml !== null) { + var fL = dataSubHtml.substring(0, 1); + if (fL == '.' || fL == '#') { + dataSubHtml = $(dataSubHtml).html(); + } else { + dataSubHtml = dataSubHtml; + } + $slide.eq(index).append(dataSubHtml); + } + }, + preload: function(index) { + var newIndex = index; + for (var k = 0; k <= settings.preload; k++) { + if (k >= $children.length - index) { + break; + } + this.loadContent(newIndex + k, true); + } + for (var h = 0; h <= settings.preload; h++) { + if (newIndex - h < 0) { + break; + } + this.loadContent(newIndex - h, true); + } + }, + loadObj: function(r, index) { + var $this = this; + $slide.eq(index).find('.object').on('load error', function() { + $slide.eq(index).addClass('complete'); + }); + if (r === false) { + if (!$slide.eq(index).hasClass('complete')) { + $slide.eq(index).find('.object').on('load error', function() { + $this.preload(index); + }); + } else { + $this.preload(index); + } + } + }, + loadContent: function(index, rec) { + var $this = this; + var i, j, l = $children.length - index; + var src; + + if (settings.preload > $children.length) { + settings.preload = $children.length; + } + if (settings.mobileSrc === true && windowWidth <= settings.mobileSrcMaxWidth) { + if (settings.dynamic) { + src = settings.dynamicEl[index].mobileSrc; + } else { + src = $children.eq(index).attr('data-responsive-src'); + } + } else { + if (settings.dynamic) { + src = settings.dynamicEl[index].src; + } else { + src = $children.eq(index).attr('data-src'); + } + } + var time = 0; + if (rec === true) { + time = settings.speed + 400; + } + + + + + if (typeof src !== 'undefined' && src !== '') { + if (!$this.isVideo(src, index)) { + setTimeout(function() { + if (!$slide.eq(index).hasClass('loaded')) { + $slide.eq(index).prepend('<img class="object" src="' + src + '" />'); + $this.addHtml(index); + $slide.eq(index).addClass('loaded'); + } + $this.loadObj(rec, index); + }, time); + } else { + setTimeout(function() { + if (!$slide.eq(index).hasClass('loaded')) { + $slide.eq(index).prepend($this.loadVideo(src, index)); + $this.addHtml(index); + $slide.eq(index).addClass('loaded'); + + if (settings.auto && settings.videoAutoplay === true) { + clearInterval(interval); + } + } + $this.loadObj(rec, index); + }, time); + + } + } else { + setTimeout(function() { + if (!$slide.eq(index).hasClass('loaded')) { + var dataHtml = null; + if (settings.dynamic) { + dataHtml = settings.dynamicEl[index].html; + } else { + dataHtml = $children.eq(index).attr('data-html'); + } + if (typeof dataHtml !== 'undefined' && dataHtml !== null) { + var fL = dataHtml.substring(0, 1); + if (fL == '.' || fL == '#') { + dataHtml = $(dataHtml).html(); + } else { + dataHtml = dataHtml; + } + } + if (typeof dataHtml !== 'undefined' && dataHtml !== null) { + $slide.eq(index).append('<div class="video_cont" style="max-width:' + settings.videoMaxWidth + ' !important;"><div class="video">'+dataHtml+'</div></div>'); + } + $this.addHtml(index); + $slide.eq(index).addClass('loaded complete'); + + if (settings.auto && settings.videoAutoplay === true) { + clearInterval(interval); + } + } + $this.loadObj(rec, index); + }, time); + } + + }, + counter: function() { + if (settings.counter === true) { + var slideCount = $("#lightGallery-slider > div").length; + $gallery.append("<div id='lightGallery_counter'><span id='lightGallery_counter_current'></span> / <span id='lightGallery_counter_all'>" + slideCount + "</span></div>"); + } + }, + buildThumbnail: function() { + if (settings.thumbnail === true && $children.length > 1) { + var $this = this, + $close = ''; + if (!settings.showThumbByDefault) { + $close = '<span class="close ib"><i class="bUi-iCn-rMv-16" aria-hidden="true"></i></span>'; + } + $gallery.append('<div class="thumb_cont"><div class="thumb_info">'+$close+'</div><div class="thumb_inner"></div></div>'); + $thumb_cont = $gallery.find('.thumb_cont'); + $prev.after('<a class="cLthumb"></a>'); + $prev.parent().addClass('hasThumb'); + $gallery.find('.cLthumb').bind('click touchend', function() { + $gallery.addClass('open'); + if ($this.doCss() && settings.mode === 'slide') { + $slide.eq(index).prevAll().removeClass('nextSlide').addClass('prevSlide'); + $slide.eq(index).nextAll().removeClass('prevSlide').addClass('nextSlide'); + } + }); + $gallery.find('.thumb_cont .close').bind('click touchend', function() { + $gallery.removeClass('open'); + }); + var thumbInfo = $gallery.find('.thumb_info'); + var $thumb_inner = $gallery.find('.thumb_inner'); + var thumbList = ''; + var thumbImg; + if (settings.dynamic) { + for (var i = 0; i < settings.dynamicEl.length; i++) { + thumbImg = settings.dynamicEl[i].thumb; + thumbList += '<div class="thumb"><img src="' + thumbImg + '" /></div>'; + } + } else { + $children.each(function() { + if (settings.exThumbImage === false || typeof $(this).attr(settings.exThumbImage) == 'undefined' || $(this).attr(settings.exThumbImage) === null) { + thumbImg = $(this).find('img').attr('src'); + } else { + thumbImg = $(this).attr(settings.exThumbImage); + } + thumbList += '<div class="thumb"><img src="' + thumbImg + '" /></div>'; + }); + } + $thumb_inner.append(thumbList); + $thumb = $thumb_inner.find('.thumb'); + $thumb.css({ + 'margin-right': settings.thumbMargin + 'px', + 'width': settings.thumbWidth + 'px' + }); + if (settings.animateThumb === true) { + var width = ($children.length * (settings.thumbWidth + settings.thumbMargin)); + $gallery.find('.thumb_inner').css({ + 'width': width + 'px', + 'position': 'relative', + 'transition-duration': settings.speed + 'ms' + }); + } + $thumb.bind('click touchend', function() { + usingThumb = true; + var index = $(this).index(); + $thumb.removeClass('active'); + $(this).addClass('active'); + $this.slide(index); + $this.animateThumb(index); + clearInterval(interval); + }); + thumbInfo.prepend('<span class="ib count">' + settings.lang.allPhotos + ' (' + $thumb.length + ')</span>'); + if (settings.showThumbByDefault) { + $gallery.addClass('open'); + } + } + }, + animateThumb: function(index) { + if (settings.animateThumb === true) { + var thumb_contW = $gallery.find('.thumb_cont').width(); + var position; + switch (settings.currentPagerPosition) { + case 'left': + position = 0; + break; + case 'middle': + position = (thumb_contW / 2) - (settings.thumbWidth / 2); + break; + case 'right': + position = thumb_contW - settings.thumbWidth; + } + var left = ((settings.thumbWidth + settings.thumbMargin) * index - 1) - position; + var width = ($children.length * (settings.thumbWidth + settings.thumbMargin)); + if (left > (width - thumb_contW)) { + left = width - thumb_contW; + } + if (left < 0) { + left = 0; + } + if (this.doCss()) { + $gallery.find('.thumb_inner').css('transform', 'translate3d(-' + left + 'px, 0px, 0px)'); + } else { + $gallery.find('.thumb_inner').animate({ + left: -left + "px" + }, settings.speed); + } + } + }, + slideTo: function() { + var $this = this; + if (settings.controls === true && $children.length > 1) { + $gallery.append('<div id="lightGallery-action"><a id="lightGallery-prev"></a><a id="lightGallery-next"></a></div>'); + $prev = $gallery.find('#lightGallery-prev'); + $next = $gallery.find('#lightGallery-next'); + $prev.bind('click', function() { + $this.prevSlide(); + clearInterval(interval); + }); + $next.bind('click', function() { + $this.nextSlide(); + clearInterval(interval); + }); + } + }, + autoStart: function() { + var $this = this; + if (settings.auto === true) { + interval = setInterval(function() { + if (index + 1 < $children.length) { + index = index; + } else { + index = -1; + } + index++; + $this.slide(index); + }, settings.pause); + } + }, + keyPress: function() { + var $this = this; + $(window).bind('keyup.lightGallery', function(e) { + e.preventDefault(); + e.stopPropagation(); + if (e.keyCode === 37) { + $this.prevSlide(); + clearInterval(interval); + } + if (e.keyCode === 38 && settings.thumbnail === true && $children.length > 1) { + if (!$gallery.hasClass('open')) { + if ($this.doCss() && settings.mode === 'slide') { + $slide.eq(index).prevAll().removeClass('nextSlide').addClass('prevSlide'); + $slide.eq(index).nextAll().removeClass('prevSlide').addClass('nextSlide'); + } + $gallery.addClass('open'); + } + } else if (e.keyCode === 39) { + $this.nextSlide(); + clearInterval(interval); + } + if (e.keyCode === 40 && settings.thumbnail === true && $children.length > 1 && !settings.showThumbByDefault) { + if ($gallery.hasClass('open')) { + $gallery.removeClass('open'); + } + } else if (settings.escKey === true && e.keyCode === 27) { + if (!settings.showThumbByDefault && $gallery.hasClass('open')) { + $gallery.removeClass('open'); + } else { + plugin.destroy(false); + } + } + }); + }, + nextSlide: function() { + var $this = this; + index = $slide.index($slide.eq(prevIndex)); + if (index + 1 < $children.length) { + index++; + $this.slide(index); + } else { + if (settings.loop) { + index = 0; + $this.slide(index); + } else if (settings.thumbnail === true && $children.length > 1 && !settings.showThumbByDefault) { + $gallery.addClass('open'); + } else { + $slide.eq(index).find('.object').addClass('rightEnd'); + setTimeout(function() { + $slide.find('.object').removeClass('rightEnd'); + }, 400); + } + } + $this.animateThumb(index); + settings.onSlideNext.call(this, plugin); + }, + prevSlide: function() { + var $this = this; + index = $slide.index($slide.eq(prevIndex)); + if (index > 0) { + index--; + $this.slide(index); + } else { + if (settings.loop) { + index = $children.length - 1; + $this.slide(index); + } else if (settings.thumbnail === true && $children.length > 1 && !settings.showThumbByDefault) { + $gallery.addClass('open'); + } else{ + $slide.eq(index).find('.object').addClass('leftEnd'); + setTimeout(function() { + $slide.find('.object').removeClass('leftEnd'); + }, 400); + } + } + $this.animateThumb(index); + settings.onSlidePrev.call(this, plugin); + }, + slide: function(index) { + var $this = this; + if (lightGalleryOn) { + setTimeout(function() { + $this.loadContent(index, false); + }, settings.speed + 400); + if (!$slider.hasClass('on')) { + $slider.addClass('on'); + } + if (this.doCss() && settings.speed !== '') { + if (!$slider.hasClass('speed')) { + $slider.addClass('speed'); + } + if (aSpeed === false) { + $slider.css('transition-duration', settings.speed + 'ms'); + aSpeed = true; + } + } + if (this.doCss() && settings.cssEasing !== '') { + if (!$slider.hasClass('timing')) { + $slider.addClass('timing'); + } + if (aTiming === false) { + $slider.css('transition-timing-function', settings.cssEasing); + aTiming = true; + } + } + settings.onSlideBefore.call(this, plugin); + } else { + $this.loadContent(index, false); + } + if (settings.mode === 'slide') { + var isiPad = navigator.userAgent.match(/iPad/i) !== null; + if (this.doCss() && !$slider.hasClass('slide') && !isiPad) { + $slider.addClass('slide'); + } else if (this.doCss() && !$slider.hasClass('useLeft') && isiPad) { + $slider.addClass('useLeft'); + } + /* if(this.doCss()){ + $slider.css({ 'transform' : 'translate3d('+(-index*100)+'%, 0px, 0px)' }); + }*/ + if (!this.doCss() && !lightGalleryOn) { + $slider.css({ + left: (-index * 100) + '%' + }); + //$slide.eq(index).css('transition','none'); + } else if (!this.doCss() && lightGalleryOn) { + $slider.animate({ + left: (-index * 100) + '%' + }, settings.speed, settings.easing); + } + } else if (settings.mode === 'fade') { + if (this.doCss() && !$slider.hasClass('fadeM')) { + $slider.addClass('fadeM'); + } else if (!this.doCss() && !$slider.hasClass('animate')) { + $slider.addClass('animate'); + } + if (!this.doCss() && !lightGalleryOn) { + $slide.fadeOut(100); + $slide.eq(index).fadeIn(100); + } else if (!this.doCss() && lightGalleryOn) { + $slide.eq(prevIndex).fadeOut(settings.speed, settings.easing); + $slide.eq(index).fadeIn(settings.speed, settings.easing); + } + } + if (index + 1 >= $children.length && settings.auto && settings.loop === false) { + clearInterval(interval); + } + $slide.eq(prevIndex).removeClass('current'); + $slide.eq(index).addClass('current'); + if (this.doCss() && settings.mode === 'slide') { + if (usingThumb === false) { + $('.prevSlide').removeClass('prevSlide'); + $('.nextSlide').removeClass('nextSlide'); + $slide.eq(index - 1).addClass('prevSlide'); + $slide.eq(index + 1).addClass('nextSlide'); + } else { + $slide.eq(index).prevAll().removeClass('nextSlide').addClass('prevSlide'); + $slide.eq(index).nextAll().removeClass('prevSlide').addClass('nextSlide'); + } + } + if (settings.thumbnail === true && $children.length > 1) { + $thumb.removeClass('active'); + $thumb.eq(index).addClass('active'); + } + if (settings.controls && settings.hideControlOnEnd && settings.loop === false && $children.length > 1) { + var l = $children.length; + l = parseInt(l) - 1; + if (index === 0) { + $prev.addClass('disabled'); + $next.removeClass('disabled'); + } else if (index === l) { + $prev.removeClass('disabled'); + $next.addClass('disabled'); + } else { + $prev.add($next).removeClass('disabled'); + } + } + prevIndex = index; + lightGalleryOn === false ? settings.onOpen.call(this, plugin) : settings.onSlideAfter.call(this, plugin); + setTimeout(function() { + lightGalleryOn = true; + }); + usingThumb = false; + if (settings.counter) { + $("#lightGallery_counter_current").text(index + 1); + } + $(window).bind('resize.lightGallery', function() { + setTimeout(function() { + $this.animateThumb(index); + }, 200); + }); + } + }; + plugin.isActive = function() { + if (isActive === true) { + return true; + } else { + return false; + } + + }; + plugin.destroy = function(d) { + isActive = false; + d = typeof d !== 'undefined' ? false : true; + settings.onBeforeClose.call(this, plugin); + var lightGalleryOnT = lightGalleryOn; + lightGalleryOn = false; + aTiming = false; + aSpeed = false; + usingThumb = false; + clearInterval(interval); + if (d === true) { + $children.off('click touch touchstart'); + } + $('.lightGallery').off('mousedown mouseup'); + $('body').off('touchstart.lightGallery touchmove.lightGallery touchend.lightGallery'); + $(window).off('resize.lightGallery keyup.lightGallery'); + if (lightGalleryOnT === true) { + $gallery.addClass('fadeM'); + setTimeout(function() { + $galleryCont.remove(); + $('body').removeClass('lightGallery'); + }, 500); + } + settings.onCloseAfter.call(this, plugin); + }; + lightGallery.init(); + return this; + }; +}(jQuery));
\ No newline at end of file diff --git a/comiccontrol/index.php b/comiccontrol/index.php new file mode 100644 index 0000000..b3aa346 --- /dev/null +++ b/comiccontrol/index.php @@ -0,0 +1,6 @@ +<? +include('includes/header.php'); ?> + +<? echo $lang['selectmodule']; ?> + +<? include('includes/footer.php'); ?>
\ No newline at end of file diff --git a/comiccontrol/initialize.php b/comiccontrol/initialize.php new file mode 100644 index 0000000..a846fcb --- /dev/null +++ b/comiccontrol/initialize.php @@ -0,0 +1,312 @@ +<? +//initialize.php +//Initialization script: create sanitization functions and assign configuration variables +//Includes editing and deleting comics as well as displays comics that can be edited in nested list format + +$preview = false; + +//DATA MANAGEMENT AND AUXILIARY FUNCTIONS + +//sanitize() - standard input sanitization function for mysql +function sanitize($input){ + global $z; + $input = mysqli_real_escape_string($z,$input); + return $input; +} + +//filterint() - filter integers +function filterint($input){ + $input = filter_var($input,FILTER_SANITIZE_NUMBER_INT); + return $input; +} + +//sanitizeText() - sanitize text that has to be outputted as html +function sanitizeText($input){ + global $z; + $input = str_replace("'","'",$input); + $input = str_replace("’","'",$input); + $input = str_replace("’","'",$input); + $input = str_replace('"',""",$input); + $input = mysqli_real_escape_string($z,$input); + return $input; +} + +//sanitizeAlphanumeric() - remove all except alphanumeric for ULTIMATE SANITIZATION +function sanitizeAlphanumeric($input){ + $sanitized = preg_replace("/[^A-Za-z0-9 ]/", '', $input); + return $sanitized; +} + +//sanitizeSlug() - remove all except alphanumeric and hyphens +function sanitizeSlug($input){ + return preg_replace('/[^A-Za-z0-9\-]/', '', $input); +} + +//fetch() - get one result from query +function fetch($query){ + global $z; + + $result = $z->query($query); + $row = $result->fetch_assoc(); + return $row; +} + +//isMobile() - check if user is mobile user +function isMobile(){ + global $_SERVER; + + $useragent=$_SERVER['HTTP_USER_AGENT']; + if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){ + return true; + }else{ + return false; + } + +} + +//log in user +function authCheck(){ + global $tableprefix; + global $z; + global $_COOKIE; + global $_SERVER; + + if(isset($_POST['username'])) + { + $password = sanitize($_POST['password']); + $username = sanitize($_POST['username']); + $query = "SELECT * FROM cc_" . $tableprefix . "users WHERE username='" . $username . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows == 1){ + $userinfo = $result->fetch_assoc(); + $query="SELECT * FROM cc_" . $tableprefix . "users WHERE username='".$username."' AND password='" . md5($password . $userinfo['salt']) . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows == 1){ + $userinfo = $result->fetch_assoc(); + $characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; + $randstr = ''; + for ($i = 0; $i < 32; $i++) { + $randstr .= $characters[rand(0, strlen($characters) - 1)]; + } + $query = "UPDATE cc_" . $tableprefix . "users SET loginhash='" . sha1($userinfo['username'] . $userinfo['salt'] . $randstr) . "' WHERE id='" . $userinfo['id'] . "' LIMIT 1"; + $z->query($query); + setcookie('loginhash', $randstr, time() + (432000), "/", $_SERVER['HTTP_HOST']); + setcookie('username', $username, time() + (432000), "/", $_SERVER['HTTP_HOST']); + setcookie('hashtime', time(), time() + (432000), "/", $_SERVER['HTTP_HOST']); + return true; + } + } + } + else if(isset($_COOKIE['username']) && isset($_COOKIE['loginhash']) && isset($_COOKIE['hashtime'])){ + $loginhash = sanitize($_COOKIE['loginhash']); + $username = sanitize($_COOKIE['username']); + $query = "SELECT * FROM cc_" . $tableprefix . "users WHERE username='" . $username . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows == 1){ + $userinfo = $result->fetch_assoc(); + $query = "SELECT * FROM cc_" . $tableprefix . "users WHERE username='" . $userinfo['username'] . "' AND loginhash='" . sha1($userinfo['username'] . $userinfo['salt'] . $loginhash) . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows == 1){ + if((time() - $_COOKIE['hashtime']) > 3600){ + $characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; + $randstr = ''; + for ($i = 0; $i < 32; $i++) { + $randstr .= $characters[rand(0, strlen($characters) - 1)]; + } + $query = "UPDATE cc_" . $tableprefix . "users SET loginhash='" . sha1($userinfo['username'] . $userinfo['salt'] . $randstr) . "' WHERE id='" . $userinfo['id'] . "' LIMIT 1"; + $z->query($query); + setcookie('loginhash', $randstr, time() + (432000), "/", $_SERVER['HTTP_HOST']); + setcookie('username', $username, time() + (432000), "/", $_SERVER['HTTP_HOST']); + setcookie('hashtime', time(), time() + (432000), "/", $_SERVER['HTTP_HOST']); + } + return true; + } + } + } + return false; +} + + +//QUERY FUNCTION +function fetchoption($optionname){ + global $z; + global $tableprefix; + + $optionname=sanitizeAlphanumeric($optionname); + + $query = "SELECT * FROM cc_" . $tableprefix . "options WHERE optionname='" . $optionname . "' LIMIT 1"; + + $result = $z->query($query); + $row = $result->fetch_assoc(); + return $row['optionvalue']; + +} + +//SITE INFO +$sitetitle = fetchoption("sitetitle"); +$disqusname = fetchoption("disqusname"); +if($_GET['id'] > 0 && $_GET['id'] < 73){ $disqusname = "works-in-progress"; } +$root = fetchoption("root"); +$siteroot = fetchoption("siteroot"); +$relativeroot = fetchoption("relativeroot"); + +//TIMEZONE +$timezone = fetchoption("timezone"); +$timezoneshort = fetchoption("timezoneshort"); + +date_default_timezone_set($timezone); + +//OPTIONS +$dateformat = fetchoption("dateformat"); +$timeformat = fetchoption("timeformat"); +$navaux = fetchoption("navaux"); +$previewpage = fetchoption("preview"); +$language = fetchoption("language"); +$navorder = fetchoption("navorder"); +$maxwidth = fetchoption("maxwidth"); +$usemaxwidth = fetchoption("usemaxwidth"); +$thumbwidth = fetchoption("thumbwidth"); +$thumbheight = fetchoption("thumbheight"); + +//SLUG PARSING +$url = "$_SERVER[REQUEST_URI]"; +$url = substr($url,(strlen($relativeroot)+1)); +$slug = preg_replace('/[^a-zA-Z0-9\-\/.?=]/', '', $url); +$slugarr = explode("/",$slug); +foreach($slugarr as $key=>$value){ + if(strpos($value,"?") > -1) { + $str = substr($value,0,strpos($value,"?")); + $slugarr[$key] = $str; + } +} + +//MATCH TO OLD MODULES +$query = "SELECT * FROM cc_" . $tableprefix . "modules"; +$result = $z->query($query); +while($row = $result->fetch_assoc()){ + if($slugarr[0] == ""){ + $slugarr[0] = "index.php"; + } + if($slugarr[0] == $row['filename']){ + $slugarr[0] = $row['slug']; + if($row['type'] == "comic"){ + $id = preg_replace('[\D]', '', $_GET['id']); + if($id != ""){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $row['id'] . "' AND id='" . $id . "' AND publishtime < " . time() . " LIMIT 1"; + $result = $z->query($query); + if($result->num_rows > 0){ + $row = $result->fetch_assoc(); + $slugarr[1] = $row['slug']; + } + } + } + } +} + +//SET MODULE +$query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE slug='" . $slugarr[0] . "' LIMIT 1"; +$moduleinfo = fetch($query); + + +//SET LANGUAGE VARIABLES +include('languages/' . $language . '.php'); +if($moduleinfo != "") include('languages/user-' . $moduleinfo['language'] . '.php'); + +//BUILD PREVIEW BAR IF LOGGED IN + +if(authCheck()){ + $previewbar='<style> + html{ + width:100% !important; + margin-top:40px !important; + } + .cc-previewbar{ + width:100%; + height:40px; + background:#000; + color:#fff; + font-family:Georgia, "Times New Roman", Times, serif; + position:fixed; + top:0; + z-index:100; + } + .cc-leftside{ + float:left; + width:20%; + font-size:20px; + padding:10px; + } + .cc-rightside{ + float:right; + width:75%; + font-size:14px; + text-align:right; + padding:10px; + } + .cc-previewbar a{ + color:#fff; + text-decoration:none; + } + </style> + <div class="cc-previewbar"><div class="cc-leftside"><a href="' . $root . '">ComicControl.</a></div><div class="cc-rightside">'; + + + switch($moduleinfo['type']){ + case "comic": + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $moduleinfo['id'] . "' AND slug='" . $slugarr[1] . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows > 0){ + $comicinfo = $result->fetch_assoc(); + if($comicinfo['publishtime'] > time()){ + $previewbar .= $lang['previewbar'] . " - "; + }else{ + $preview = false; + } + $previewbar .= $comicinfo['comicname'] .' - <a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '&do=add">' . $lang['addanothercomic'] . '</a> | <a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '&do=edit&comicid=' . $comicinfo['id'] . '&edit=edit">' . $lang['editthiscomic'] . '</a> | '; + }else{ + $previewbar .= '<a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '&do=add">' . $lang['addanothercomic'] . '</a> | '; + } + $previewbar .= '<a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '">' . $lang['returnto'] . $moduleinfo['title'] . '</a>'; + $previewbar .= '</div></div>'; + break; + case "blog": + $query = "SELECT * FROM cc_" . $tableprefix . "blogs WHERE blog='" . $moduleinfo['id'] . "' AND slug='" . $slugarr[1] . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows > 0){ + $bloginfo = $result->fetch_assoc(); + if($bloginfo['publishtime'] > time()){ + $previewbar .= $lang['previewbar'] . " - "; + } + $previewbar .= $bloginfo['title'] . ' - '; + } + $previewbar .= '<a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '&action=add">' . $lang['addanotherpost'] . '</a> | '; + if($bloginfo != "") $previewbar .= '<a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '&action=ed&blogid=' . $bloginfo['id'] . '">' . $lang['editthispost'] . '</a> | '; + $previewbar .= '<a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '">' . $lang['returnto'] . $moduleinfo['title'] . '</a></div></div>'; + break; + case "gallery": + $prevmid = $moduleinfo['title'] . ' - <a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '">' . $lang['addanotherimage'] . '</a> | <a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '">' . $lang['returnto'] . $moduleinfo['title'] . '</a>'; + $previewbar .= $prevmid; + $previewbar .= '</div></div>'; + break; + case "page": + $prevmid = $moduleinfo['title'] . ' - <a href="' . $root . 'edit.php?moduleid=' . $moduleinfo['id'] . '">' . $lang['editthispage'] . '</a>'; + $previewbar .= $prevmid; + $previewbar .= '</div></div>'; + break; + default: + $previewbar .= '</div></div>'; + break; + } +}else{ + if($moduleinfo['type'] == "comic" && $slugarr[1] != "" && $slugarr[1] != "archive"){ + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $moduleinfo['id'] . "' AND slug='" . $slugarr[1] . "' LIMIT 1"; + $result = $z->query($query); + if($result->num_rows <= 0){ + header("HTTP/1.0 404 Not Found"); + http_response_code(404); + include('404.php'); + die(); + } + } +} +?>
\ No newline at end of file diff --git a/comiccontrol/languages/en.php b/comiccontrol/languages/en.php new file mode 100644 index 0000000..f06aed4 --- /dev/null +++ b/comiccontrol/languages/en.php @@ -0,0 +1,135 @@ +<?php + +$lang = array(); +$lang['adstats'] = "Ad Statistics"; +$lang['editsuccess'] = "Comic successfully edited!"; +$lang['clicktopreview'] = "Click here to preview"; +$lang['postedited'] = "Post successfully edited!"; +$lang['postadded'] = "Post successfully added!"; +$lang['editanothercomic'] = "Edit another comic"; +$lang['addanothercomic'] = "Add another comic"; +$lang['editthiscomic'] = "Edit this comic"; +$lang['returnto'] = "Return to "; +$lang['currentcomicimg'] = "Current image file:"; +$lang['newfile'] = "New file:"; +$lang['newfile'] = "Comic file:"; +$lang['publishdate'] = "Publish Date"; +$lang['publishtime'] = "Publish Time"; +$lang['comictitle'] = "Comic Title"; +$lang['newstitle'] = "News Title"; +$lang['storyline'] = "Storyline"; +$lang['hovertext'] = "Hover Text"; +$lang['tagssepbycomma'] = "Tags (separated by comma)"; +$lang['newscontent'] = "News Content"; +$lang['submit'] = "Submit"; +$lang['deletesuccess'] = "Comic successfully deleted!"; +$lang['addsuccess'] = "Comic successfully added!"; +$lang['asktodelete'] = "Are you sure you want to delete "; +$lang['addanotherpost'] = "Add another post"; +$lang['editthispost'] = "Edit this post"; +$lang['transcript'] = "Transcript"; +$lang['pagetoedit'] = 'Please select a page to edit.'; +$lang['selectmodule'] = 'Please select a section to the left to edit.'; +$lang['loggedout'] = 'You have been logged out.'; +$lang['loginincorrect'] = 'Your login information was incorrect. Please try again.'; +$lang['pleaselogin'] = 'Please log in below.'; +$lang['username'] = 'Username'; +$lang['password'] = 'Password'; +$lang['add'] = 'Add'; +$lang['edit'] = 'Edit'; +$lang['delete'] = 'Delete'; +$lang['preview'] = 'Preview'; +$lang['manage'] = 'Manage'; +$lang['storylineslow'] = 'storylines'; +$lang['comicslow'] = 'comics'; +$lang['acomic'] = 'a comic'; +$lang['storylineadded'] = 'Storyline successfully added!'; +$lang['storylinename'] = 'Storyline title'; +$lang['addstoryline'] = 'Add Storyline'; +$lang['addcomicheader'] = 'Add Comic'; +$lang['editcomicheader'] = 'Edit Comic'; +$lang['storylinemanagement'] = 'storyline management'; +$lang['addanotherstoryline'] = 'Add another storyline'; +$lang['storylineedited'] = 'Storyline successfully edited!'; +$lang['editstoryline'] = 'Edit Storyline'; +$lang['rearrangestorylines'] = 'You can rearrange the storyline sections in this arc below.'; +$lang['changessaved'] = 'Your changes have been saved.'; +$lang['returntostoryline'] = 'Return to storyline management'; +$lang['savechanges'] = 'Save Changes'; +$lang['storylinedeleted'] = 'Storyline successfully deleted!'; +$lang['wanttodelete'] = 'Are you sure you want to delete '; +$lang['yes'] = 'Yes'; +$lang['no'] = 'No'; +$lang['deletestoryline'] = 'Delete Storyline'; +$lang['pageedited'] = 'Page successfully edited!'; +$lang['editthispage'] = 'Edit this page'; +$lang['editthispagetext'] = 'You can edit this page using the editor below.'; +$lang['postlist'] = 'Posts in this blog section are listed below.'; +$lang['noblogposts'] = 'There are currently no blog posts.'; +$lang['addnewpost'] = 'Add a new post'; +$lang['postdeleted'] = 'Post successfully deleted!'; +$lang['wanttodeletepost'] = 'Are you sure you wish to delete this blog post?'; +$lang['nopostselected'] = 'You have not selected a blog post.'; +$lang['deleteblogpost'] = 'Delete Blog Post'; +$lang['title'] = 'Title'; +$lang['content'] = 'Content'; +$lang['previewbar'] = "PREVIEW"; +$lang['addnewblogpost'] = "Add New Blog Post"; +$lang['editblogpost'] = "Edit Blog Post"; +$lang['animage'] = "an image"; +$lang['images'] = "images"; +$lang['rearrange'] = "Rearrange"; +$lang['imageaddsuccess'] = "Image added successfully!"; +$lang['imageeditsuccess'] = "Image edited successfully!"; +$lang['imagedeleted'] = "Image deleted successfully!"; +$lang['addanotherimage'] = "Add another image"; +$lang['editanotherimage'] = "Edit another image"; +$lang['addanimage'] = "Add an image"; +$lang['editanimage'] = "Edit an image"; +$lang['editthisimage'] = "Edit this image"; +$lang['rearrangeimages'] = "Rearrange images"; +$lang['caption'] = "Caption"; +$lang['imagefile'] = "Image file"; +$lang['currentimage'] = "Current image"; +$lang['thisimage'] = "this image"; +$lang['selectimageedit'] = 'You can select an image to edit or delete below.'; +$lang['thumbnail'] = 'Thumbnail'; +$lang['newimage'] = 'New image'; +$lang['canrearrange'] = 'You can rearrange images below.'; +$lang['noimages'] = 'There are no images in this gallery.'; +$lang['noimageuploads'] = 'There are no uploaded images.'; +$lang['nomodules'] = 'There are no modules created.'; +$lang['nopage'] = 'There is no page with this slug.'; +$lang['imageupload'] = "Image Upload"; +$lang['permalink'] = "Permalink"; +$lang['addtogallery'] = "Add Image to Gallery"; +$lang['editgalleryimage'] = "Edit Gallery Image"; +$lang['deletegalleryimage'] = "Delete Gallery Image"; +$lang['rearrangegalleryimages'] = "Rearrange Gallery Images"; +$lang['managemodule'] = "Manage Modules"; +$lang['addmodule'] = "Add a Module"; +$lang['moduletitle'] = "Module Title"; +$lang['moduletype'] = "Module Type"; +$lang['userlanguage'] = "User Language"; +$lang['comic'] = "Comic"; +$lang['page'] = "Page"; +$lang['blog'] = "Blog"; +$lang['gallery'] = "Gallery"; +$lang['moduleaddsuccess'] = "Module successfully added!"; +$lang['moduleeditsuccess'] = "Module successfully edited!"; +$lang['moduledeleted'] = "Module successfully deleteed!"; +$lang['addmodule'] = "Add a Module"; +$lang['editmodule'] = "Edit a Module"; +$lang['managemodules'] = "Manage Modules"; +$lang['noparent'] = "No Parent Storyline"; +$lang['parentstoryline'] = "Parent Storyline"; +$lang['uncategorized'] = "Uncategorized"; +$lang['adimpressions'] = "Ad Impressions"; +$lang['estimatedrevenue'] = "Estimated Revenue"; +$lang['estadstats'] = "Estimated Ad Statistics"; +$lang['impressions'] = "Impressions"; +$lang['dollars'] = "Dollars"; +$lang['estrevenue'] = "Estimated Revenue"; +$lang['date'] = "Date"; + +?>
\ No newline at end of file diff --git a/comiccontrol/languages/user-en.php b/comiccontrol/languages/user-en.php new file mode 100644 index 0000000..74a3278 --- /dev/null +++ b/comiccontrol/languages/user-en.php @@ -0,0 +1,22 @@ +<? + +$lang['thereisnocomic'] = 'There is no comic with this ID.'; +$lang['thereisnonews'] = 'There is no news post with this ID.'; +$lang['at'] = " at "; +$lang['noblogpostsuser'] = "There are no posts in this blog."; +$lang['userpage'] = "Page"; +$lang['searchprev'] = "< Previous"; +$lang['searchnext'] = "Next >"; +$lang['blogprev'] = "< Previous"; +$lang['blognext'] = "Next >"; +$lang['therearenoimages'] = 'There are no images in this gallery.'; +$lang['archive'] = "Archive"; +$lang['search'] = "Search"; +$lang['tagline'] = "Tags"; +$lang['comicstagged'] = "Comics tagged with "; +$lang['blogstagged'] = "Posts tagged with "; +$lang['noresultsfound'] = "No results found."; +$lang['page'] = "Page"; +$lang['thereisnopost'] = "There is no post with this ID."; + +?>
\ No newline at end of file diff --git a/comiccontrol/login.php b/comiccontrol/login.php new file mode 100644 index 0000000..26da597 --- /dev/null +++ b/comiccontrol/login.php @@ -0,0 +1,42 @@ +<? +//initialize needed configuration +include("dbconfig.php"); +include('initialize.php'); + +//logout +if($_GET['action'] == "logout"){ + setcookie('loginhash', "", time() - 3600, "/", $_SERVER['HTTP_HOST']); + setcookie('username', "", time() - 3600, "/", $_SERVER['HTTP_HOST']); $logout = true; } + +//go to index.php if not logging out and authorization does not check out +if(authCheck() && !$logout) header("Location:" . $root . "index.php"); +if(isset($_POST['submit'])) $submitted = true; else $submitted = false; + +//display login page + ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>ComicControl.</title> +<link rel="stylesheet" type="text/css" href="comiccontrol.css" /> +</head> +<body> +<div id="loginwrapper"> +<div id="loginheader"></div> +<? +if($logout){ + echo '<p class="successbox">' . $lang['loggedout'] . '</p>'; +} +if($submitted){ + echo '<p class="errorbox">' . $lang['loginincorrect'] . '</p>'; +} +?> +<p><?=$lang['pleaselogin'];?></p> +<form method="post" action="login.php"><br /> +<label for="username"><?=$lang['username']?>: </label><input name="username" type="text" size="30" /><br /><br /> +<label for="password"><?=$lang['password']?>: </label><input name="password" type="password" size="30" /><br /><br /> +<input name="submit" type="submit" value="<?=$lang['submit']?>" /> +</form> +<div id="loginfooter"></div> +</div>
\ No newline at end of file diff --git a/comiccontrol/mediaupload.php b/comiccontrol/mediaupload.php new file mode 100644 index 0000000..ad9d976 --- /dev/null +++ b/comiccontrol/mediaupload.php @@ -0,0 +1,93 @@ +<? +if(authCheck()){ +ini_set("memory_limit","512M"); +set_time_limit(60); + // make a note of the current working directory, relative to root. +$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); + +// make a note of the directory that will recieve the uploaded file +$uploadsDirectory = '../uploads/'; + +// possible PHP upload errors +$errors = array(1 => 'php.ini max file size exceeded', + 2 => 'html form max file size exceeded', + 3 => 'file upload was only partial', + 4 => 'no file was attached'); + +// check the upload form was actually submitted else print the form +isset($_POST['submit']) + or error('the upload form is neaded', $uploadForm); + +// check for PHP's built-in uploading errors +($_FILES[$fieldname]['error'] == 0) + or error($errors[$_FILES[$fieldname]['error']], $uploadForm); + +// check that the file we are working on really was the subject of an HTTP upload +is_uploaded_file($_FILES[$fieldname]['tmp_name']) + or error('not an HTTP upload', $uploadForm); + +// validation... since this is an image upload script we should run a check +// to make sure the uploaded file is in fact an image. Here is a simple check: +// getimagesize() returns false if the file tested is not an image. +getimagesize($_FILES[$fieldname]['tmp_name']) + or error('only image uploads are allowed', $uploadForm); + +// make a unique filename for the uploaded file and check it is not already +// taken... if it is already taken keep trying until we find a vacant one +// sample filename: 1140732936-filename.jpg +$realname = substr($_FILES[$fieldname]['name'],0,(strrpos($_FILES[$fieldname]['name'],"."))) . ".png"; +$now = time(); +while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$realname)) +{ + $now++; +} +$imgname=$now.'-'.$realname; +$sourceImg = @imagecreatefromstring(@file_get_contents($_FILES[$fieldname]['tmp_name'])); +if ($sourceImg === false) +{ + throw new Exception("{$source}: Invalid image."); +} +$width = imagesx($sourceImg); +$height = imagesy($sourceImg); +$targetImg = imagecreatetruecolor($width, $height); +imagecopy($targetImg, $sourceImg, 0, 0, 0, 0, $width, $height); +imagepng($targetImg, $uploadFilename); +$x = imagesx($sourceImg); +$y = imagesy($sourceImg); +$w = 120; +$h = 120; +if($x > $w) { + if($y > $h){ + if(($x/$y)<=($w/$h)){ + $w = round(($h / $y) * $x); + }else{ + $h = round(($w/$x)*$y); + $w = $x; + } + }else{ + $h = round(($w/$x)*$y); + } +}else{ + if($y > $h){ + $w = round(($h / $y) * $x); + }else{ + $w = $x; + $h = $y; + } +} +$now = time(); +while(file_exists($uploadFilenameThumb = $uploadsDirectory.$now.'-thumb-'.$realname)) +{ + $now++; +} +$thumbname=$now.'-thumb-'.$realname; +echo $thumbname; +$targetImg = @imagecreatetruecolor($w, $h); +imagecopyresampled($targetImg, $sourceImg, 0, 0, 0, 0, $w, $h,$x,$y); +imagedestroy($sourceImg); +imagepng($targetImg, $uploadFilenameThumb); +imagedestroy($targetImg); +} + + +?>
\ No newline at end of file diff --git a/comiccontrol/tinymce/LICENSE.TXT b/comiccontrol/tinymce/LICENSE.TXT new file mode 100644 index 0000000..1837b0a --- /dev/null +++ b/comiccontrol/tinymce/LICENSE.TXT @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/comiccontrol/tinymce/changelog.txt b/comiccontrol/tinymce/changelog.txt new file mode 100644 index 0000000..485f39c --- /dev/null +++ b/comiccontrol/tinymce/changelog.txt @@ -0,0 +1,598 @@ +Version 4.1.0 (2014-06-18) + Added new file_picker_callback option to replace the old file_browser_callback the latter will still work though. + Added new custom colors to textcolor plugin will be displayed if a color picker is provided also shows the latest colors. + Added new color_picker_callback option to enable you to add custom color pickers to the editor. + Added new advanced tabs to table/cell/row dialogs to enable you to select colors for border/background. + Added new colorpicker plugin that lets you select colors from a hsv color picker. + Added new tinymce.util.Color class to handle color parsing and converting. + Added new colorpicker UI widget element lets you add a hsv color picker to any form/window. + Added new textpattern plugin that allows you to use markdown like text patterns to format contents. + Added new resize helper element that shows the current width & height while resizing. + Added new "once" method to Editor and EventDispatcher enables since callback execution events. + Added new jQuery like class under tinymce.dom.DomQuery it's exposed on editor instances (editor.$) and globally under (tinymce.$). + Fixed so the default resize method for images are proportional shift/ctrl can be used to make an unproportional size. + Fixed bug where the image_dimensions option of the image plugin would cause exceptions when it tried to update the size. + Fixed bug where table cell dialog class field wasn't properly updated when editing an a table cell with an existing class. + Fixed bug where Safari on Mac would produce webkit-fake-url for pasted images so these are now removed. + Fixed bug where the nodeChange event would get fired before the selection was changed when clicking inside the current selection range. + Fixed bug where valid_classes option would cause exception when it removed internal prefixed classes like mce-item-. + Fixed bug where backspace would cause navigation in IE 8 on an inline element and after a caret formatting was applied. + Fixed so placeholder images produced by the media plugin gets selected when inserted/edited. + Fixed so it's possible to drag in images when the paste_data_images option is enabled. Might be useful for mail clients. + Fixed so images doesn't get a width/height applied if the image_dimensions option is set to false useful for responsive contents. + Fixed so it's possible to pass in an optional arguments object for the nodeChanged function to be passed to all nodechange event listeners. + Fixed bug where media plugin embed code didn't update correctly. +Version 4.0.28 (2014-05-27) + Fixed critical issue with empty urls producing an exception when converted into absolute urls due to resent bug fix in tinymce.util.URI. +Version 4.0.27 (2014-05-27) + Added support for definition lists to lists plugin and enter key logic. This can now created by the format menu. + Added cmd option for the style_formats menu enables you to toggle commands on/off using the formats menu for example lists. + Added definition lists to visualblocks plugin so these are properly visualized like other list elements. + Added new paste_merge_formats option that reduces the number of nested text format elements produced on paste. Enabled by default. + Added better support for nested link_list/image_list menu items each item can now have a "menu" item with subitems. + Added "Add to Dictionary" support to spellchecker plugin when the backend tells that this feature is available. + Added new table_default_attributes/table_default_styles options patch contributed by Dan Villiom Podlaski Christiansen. + Added new table_class_list/table_cell_class_list/table_row_class_list options to table plugin. + Added new invalid_styles/valid_classes options to better control what gets returned for the style/class attribute. + Added new file_browser_callback_types option that allows you to specify where to display the picker based on dialog type. + Fixed so the selected state is properly handled on nested menu items in listboxes patch contributed by Jelle Kralt. + Fixed so the invisiblity css value for TinyMCE gets set to inherit instead of visible to better support dialog scripts like reveal. + Fixed bug where Gecko would remove anchors when pasting since the their default built in logic removes empty nodes. + Fixed bug where it wasn't possible to paste on Chrome Andoid since it doesn't properly support the Clipboard API yet. + Fixed bug where user defined type attribute value of text/javascript didn't get properly serialized. + Fixed bug where space in span elements would removed when the element was considered empty. + Fixed bug where the undo/redo button states didn't change if you removed all undo levels using undoManager.clear. + Fixed bug where unencoded links inside query strings or hash values would get processed by the relative urls logic. + Fixed bug where contextmenu would automatically close in inline editing mode on Firefox running on Mac. + Fixed bug where Gecko/IE would produce multiple BR elements when forced_root_block was set to false and a table was the last child of body. + Fixed bug where custom queryCommandState handlers didn't properly handle boolean states. + Fixed bug where auto closing float panels link menus wasn't automatically closed when the window was resized. + Fixed bug where the image plugin wouldn't update image dimensions when the current image was changed using the image_list select box. + Fixed bug with paste plugin not properly removing paste bin on Safari Mac when using the cmd+shift+v keyboard command. + Fixed bug where the paste plugin wouln't properly strip trailing br elements under very specific scenarios. + Fixed bug where enter key wouldn't properly place the caret on Gecko when pressing enter in a text block with a br ended line inside. + Fixed bug where Safari Mac shortcuts like Cmd+Opt+L didn't get passed through to the browser due to a Quirks fix. + Fixed so plain text mode works better when it converts rich text to plain text when pasting from for example Word. + Fixed so numeric keycodes can be used in the shortcut format enabling support for any key to be specified. + Fixed so table cells can be navigated with tab key and new rows gets automatically added when you are at the last cell. + Fixed bug where formatting before cursor gets removed when toggled off for continued content. +Version 4.0.26 (2014-05-06) + Fixed bug in media plugin where changing existing url did not use media regex patterns to create protocol neutral url. + Fixed bug where selection wasn't properly restored on IE 11 due to a browser bug with Element.contains. +Version 4.0.25 (2014-04-30) + Fixed bug where it wasn't possible to submit forms with editor instances on WebKit/Blink. +Version 4.0.24 (2014-04-30) + Added new event_root setting for inline editors. Lets you bind all editor events on a parent container. + Fixed bug where show/hide/isHidden didn't work properly for inline editor instances. + Fixed bug where preview plugin dialog didn't handle relative urls properly. + Fixed bug where the autolink plugin would remove the trailing space after an inserted link. + Fixed bug in paste plugin where pasting in a page with scrollbars would scroll to top of page in webkit browsers. + Fixed bug where the paste plugin on WebKit would remove styles from pasted source code with style attributes. + Fixed so image_list/link_list can be a function that allows custom async calls to populate these lists. +Version 4.0.23 (2014-04-24) + Added isSameOrigin method to tinymce.util.URI it handles default protocol port numbers better. Patch contributed by Matt Whelan. + Fixed bug where IE 11 would add br elements to the end of the editor body element each time it was shown/hidden. + Fixed bug where the autolink plugin would produce an index out of range exception for some very specific HTML. + Fixed bug where the charmap plugin wouldn't properly insert non breaking space characters when selected. + Fixed bug where pasting from Excel 2011 on Mac didn't produce a proper table when using the paste plugin. + Fixed bug where drag/dropping inside a table wouldn't properly end the table cell selection. + Fixed bug where drag/dropping images within tables on Safari on Mac wouldn't work properly. + Fixed bug where editors couldn't be re-initialized if they where externally destroyed. + Fixed bug where inline editors would produce a range index exception when clicking on buttons like bold. + Fixed bug where the preview plugin wouldn't properly handle non encoded upper UTF-8 characters. + Fixed so document.currentScript is used when detecting the current script location. Patch contributed by Mickael Desgranges. + Fixed issue with the paste_webkit_styles option so is disabled by default since it might produce a lot of extra styles. +Version 4.0.22 (2014-04-16) + Added lastLevel to BeforeAddUndo level event so it's easier to block undo level creation based. + Fixed so multiple list elements can be indented properly. Patch contributed by Dan Villiom Podlaski Christiansen. + Fixed bug where the selection would be at the wrong location sometimes for inline editor instances. + Fixed bug where drag/dropping content into an inline editor would fail on WebKit/Blink. + Fixed bug where table grid wouldn't work properly when the UI was rendered in for RTL mode. + Fixed bug where range normalization wouldn't handle mixed contentEditable nodes properly. + Fixed so the media plugin doesn't override the existing element rules you now need to manually whitelist non standard attributes. + Fixed so old language packs get properly loaded when the new longer language code format is used. + Fixed so all track changes junk such as comments, deletes etc gets removed when pasting from Word. + Fixed so non image data urls is blocked by default since they might contain scripts. + Fixed so it's possible to import styles from the current page stylesheets into an inline editor by using the importcss_file_filter. + Fixed bug where the spellchecker plugin wouldn't add undo levels for each suggestion replacement. + Reworked the default spellchecker RPC API to match the new PHP Spellchecker package. Fallback documented in the TinyMCE docs. +Version 4.0.21 (2014-04-01) + Added new getCssText method to formatter to get the preview css text value for a format to be used in UI. + Added new table_grid option that allows you to disable the table grid and use a dialog. + Added new image_description, image_dimensions options to image plugin. Patch contributed by Pat O'Neill. + Added new media_alt_source, media_poster, media_dimensions options to media plugin. Patch contributed by Pat O'Neill. + Added new ability to specify high/low dpi versions custom button images for retina displays. + Added new getWindows method to WindowManager makes it easier to control the currently opened windows. + Added new paste_webkit_styles option to paste plugin to control the styles that gets retained on WebKit. + Added preview of classes for the selectboxes used by the link_class_list/image_class_list options. + Added support for Sauce Labs browser testing using the new saucelabs-tests build target. + Added title input field to link dialog for a11y reasons can be disabled by using the link_title option. + Fixed so the toolbar option handles an array as input for multiple toolbar rows. + Fixed so the editor renders in XHTML mode apparently some people still use this rendering mode. + Fixed so icons gets rendered better on Firefox on Mac OS X by applying -moz-osx-font-smoothing. + Fixed so the auto detected external media sources produced protocol relative urls. Patch contributed by Pat O'Neill. + Fixed so it's possible to update the text of a button after it's been rendered to page DOM. + Fixed bug where iOS 7.1 Safari would open linked when images where inserted into links. + Fixed bug where IE 11 would scroll to the top of inline editable elements when applying formatting. + Fixed bug where tabindex on elements within the editor contents would cause issues on some browsers. + Fixed bug where link text wouldn't be properly updated in gecko if you changed an existing link. + Fixed bug where it wasn't possible to close dialogs with the escape key if the focus was inside a textbox. + Fixed bug where Gecko wouldn't paste rich text contents from Word or other similar word processors. + Fixed bug where binding events after the control had been rendered could fail to produce a valid delegate. + Fixed bug where IE 8 would throw and error when removing editors with a cross domain content_css setting. + Fixed bug where IE 9 wouldn't be able to select text after an editor instance with caret focus was removed. + Fixed bug where the autoresize plugin wouldn't resize the editor if you inserted huge images. + Fixed bug where multiple calls to the same init would produce extra editor instances. + Fixed bug where fullscreen toggle while having the autoresize plugin enabled wouldn't produce scrollbars. + Fixed so screen readers use a dialog instead of the grid for inserting tables. + Fixed so Office 365 Word contents gets filtered the same way as content from desktop Office. + Fixed so it's possible to override the root container for UI elements defaults to document.body. + Fixed bug where tabIndex is set to -1 on inline editable elements. It now keeps the existing tabIndex intact. + Fixed issue where the UndoManager transact method couldn't be nested since it only had one lock. + Fixed issue where headings/heading where labeled incorrectly as headers/header. +Version 4.0.20 (2014-03-18) + Fixed so all unit tests can be executed in a headless phantomjs instance for CI testing. + Fixed so directionality setting gets applied to the preview dialog as well as the editor body element. + Fixed a performance issue with the "is" method in DOMUtils. Patch contributed by Paul Bosselaar. + Fixed bug where paste plugin wouldn't paste plain text properly when pasting using browser menus. + Fixed bug where focusable SVG elements would throw an error since className isn't a proper string. + Fixed bug where the preview plugin didn't properly support the document_base_url setting. + Fixed bug where the focusedEditor wouldn't be set to null when that editor was removed. + Fixed bug where Gecko would throw an exception when editors where removed. + Fixed bug where the FocusManager wouldn't handle selection restoration properly on older IE versions. + Fixed bug where the searchreplace plugin would produce an exception on very specific multiple searches. + Fixed bug where some events wasn't properly unbound when all editors where removed from page. + Fixed bug where tapping links on iOS 7.1 would open the link instead of placing the caret inside. + Fixed bug where holding the finger down on iOS 7.1 would open the link/image callout menu. + Fixed so the jQuery plugin returns null when getting the the tinymce instance of an element before it's initialized. + Fixed so selection normalization gets executed more often to reduce incorrect UI states on Gecko. + Fixed so the default action of closing the window on a form submission can be prevented using "preventDefault". +Version 4.0.19 (2014-03-11) + Added support for CSS selector expressions in object_resizing option. Allows you to control what to resize. + Added addToTop compatibility to compat3x plugin enables more legacy 3.x plugins to work properly. + Fixed bug on IE where it wasn't possible to align images when they where floated left. + Fixed bug where the indent/outdent buttons was enabled though readonly mode was enabled. + Fixed bug where the nodeChanged event was fired when readonly mode was enabled. + Fixed bug where events like blur could be fired to editor instances that where manually removed on IE 11. + Fixed bug where IE 11 would move focus to menubar/toolbar when using the tab key in a form with an editor. + Fixed bug where drag/drop in Safari on Mac didn't work properly due to lack of support for modern dataTransfer object. + Fixed bug where the remove event wasn't properly executed when the editor instances where removed. + Fixed bug where the selection change handler on inline editors would fail if the editor instance was removed. +Version 4.0.18 (2014-02-27) + Fixed bug where images would get class false/undefined when initially created. +Version 4.0.17 (2014-02-26) + Added much better wai-aria accessibility support when it comes to keyboard navigation of complex UI controls. + Added dfn,code,samp,kbd,var,cite,mark,q elements to the default remove formats list. Patch contributed by Naim Hammadi. + Added var,cite,dfn,code,mark,q,sup,sub to the list of elements that gets cloned on enter. Patch contributed by Naim Hammadi. + Added new visual_anchor_class option to specify a custom class for inline anchors. Patch contributed by Naim Hammadi. + Added support for paste_data_images on WebKit/Blink when the user pastes image data. + Added support for highlighting the video icon when a video is added that produces an iframe. Patch contributed by monkeydiane. + Added image_class_list/link_class_list options to image/link dialogs to let the user select classes. + Fixed bug where the ObjectResizeStart event didn't get fired properly by the ControlSelection class. + Fixed bug where the autolink plugin would steal focus when loaded on IE 9+. + Fixed bug where the editor save method would remove the current selection when called on an inline editor. + Fixed bug where the formatter would merge span elements with parent bookmarks if an id format was used. + Fixed bug where WebKit/Blink browsers would scroll to the top of the editor when pasting into an empty element. + Fixed bug where removing the editor would cause an error about wrong document on IE 11 under specific circumstances. + Fixed bug where Gecko would place the caret at an incorrect location when using backspace. + Fixed bug where Gecko would throw "Wrong Document Error" for ranges that pointing to removed nodes. + Fixed bug where it wasn't possible to properly update the title and encoding properties in the fullpage plugin. + Fixed bug where paste plugin would produce an extra undo level on IE. + Fixed bug where the formatter would apply inline formatting outside the current word in if the selection was collapsed. + Fixed bug where it wasn't possible to delete tables on Chrome if you placed the selection within all the contents of the table. + Fixed bug where older IE versions wouldn't properly insert contents into table cells when editor focus was lost. + Fixed bug where older IE versions would fire focus/blur events even though the editor focus didn't change. + Fixed bug where IE 11 would add two trailing BR elements to the editor iframe body if the editor was hidden. + Fixed bug where the visualchars plugin wouldn't display non breaking spaces if they where inserted while the state was enabled. + Fixed bug where the wordcount plugin would be very slow some HTML where to much backtracking occured. + Fixed so pagebreak elements in the editor breaks pages when printing. Patch contributed by penc. + Fixed so UndoManager events pass though the original event that created the undo level such as a keydown, blur etc. + Fixed so the inserttime button is callsed insertdatetime the same as the menu item and plugin name. + Fixed so the word count plugin handles counting properly on most languages on the planet. + Fixed bug where the auroreize plugin would throw an error if the editor was manually removed within a few seconds. + Fixed bug where the image dialog would get stuck if the src was removed. Patch contribued by monkeydiane. + Fixed bug where there is an extra br tag for IE 9/10 that isn't needed. Patch contributed by monkeydiane. + Fixed bug where drag/drop in a scrolled editor would fail since it didn't use clientX/clientY cordinates. Patch contributed by annettem. +Version 4.0.16 (2014-01-31) + Fixed bug where the editor wouldn't be properly rendered on IE 10 depending on the document.readyState. +Version 4.0.15 (2014-01-31) + Fixed bug where paste in inline mode would produce an exception if the contents was pasted inside non overflow element. +Version 4.0.14 (2014-01-30) + Fixed a bug in the image plugin where images couldn't be inserted if the image_advtab option wasn't set to true. +Version 4.0.13 (2014-01-30) + Added language selection menu to spellchecker button similar to the 3.x functionality. Patch contributed by threebytesfull. + Added new style_formats_merge option that enables you to append to the default formats instead of replaceing them. Patch contributed by PacificMorrowind. + Fixed bug where the DOMUtils getPos API function didn't properly handle the location of the root element. Patch contributed by Andrew Ozz. + Fixed bug where the spellchecker wouldn't properly place the spellchecker suggestions menu. Patch contributed by Andrew Ozz. + Fixed bug where the tabfocus plugin would prevent the user from suing Ctrl+Tab, Patch contributed by Andrew Ozz. + Fixed bug where table resize handles could sometimes be added to elements out side the editable inline element. + Fixed bug where the inline mode editor UI would render incorrectly when the stylesheets didn't finish loading on Chrome. + Fixed bug where IE 8 would insert the image outside the editor unless it was focused first. + Fixed bug where older IE versions would throw an exception on drag/drop since they don't support modern dataTransfer API. + Fixed bug where the blockquote button text wasn't properly translated since it had the wrong English key. + Fixed bug where the importcss plugin didn't import a.class rules properly as selector formats. + Fixed bug where the combobox control couldn't be disabled or set to a specific character size initially. + Fixed bug where the FormItem didn't inherit the disabled state from the control to be wrapped. + Fixed bug where adding a TinyMCE instance within a TinyMCE dialog wouldn't properly delegate the events. + Fixed bug where any overflow parent containers would automatically scroll to the left when pasting in Chrome. + Fixed bug where IE could throw an error when search/replacing contents due to an invalid selection being returned. + Fixed bug where WebKit would fire focus/blur events incorrectly if the editor was empty due to a WebKit focus bug. + Fixed bug where WebKit/Blink would scroll to the top of editor if the height was more than the viewport height. + Fixed bug where blurring and removing the editor could cause an exteption to be thrown by the FocusManager. + Fixed bug where the media plugin would override specified dimensions for url pattern matches. Patch contributed by penc. + Fixed bug where the autoresize plugin wouldn't take margins into account when calculating the body size. Patch contributed by lepoltj. + Fixed bug where the image plugin would throw errors some times on IE 8 when it preloaded the image to get it's dimensions. + Fixed bug where the image plugin wouldn't update the style if the user closed the dialog before focusing out. Patch contributed by jonparrott. + Fixed bug where bindOnReady in EventUtils wouldn't work properly for some edge cases on older IE versions. Patch contributed by Godefroy. + Fixed bug where image selector formats wasn't properly handled by the importcss plugin. + Fixed bug where the dirty state of the editor wasn't set when editing an existing link URL. + Fixed bug where it wasn't possible to prevent paste from happening by blocking the default behavior when the paste plugin was enabled. + Fixed bug where text to display in the insert/edit link dialog wouldn't be properly entity encoded. + Fixed bug where Safari 7 on Mac OS X would delete contents if you pressed Cmd+C since it passes out a charCode for the event. + Fixed bug where bound drop events inside inline editors would get fired on all editor instances instead of the specific instance. + Fixed bug where images outlined selection border would be clipped when the autoresize plugin was enabled. + Fixed bug where image dimension constrains proportions wouldn't work properly if you altered a value and immediately clicked the submit button. + Fixed so you don't need to set language option to false when specifying a custom language_url. + Fixed so the link dialog "text to display" field gets automatically hidden if the selection isn't text contents. Patch contributed by Godefroy. + Fixed so the none option for the target field in the link dialog gets excluded when specifiying the target_list config option. + Fixed so outline styles are displayed by default in the formats preview. Patch contributed by nhammadi. + Fixed so the max characters for width/height is more than 3 in the media and image dialogs. + Fixed so the old mceSpellCheck command toggles the spellchecker on/off. + Fixed so the setupeditor event is fired before the setup callback setting to ease up compatibility with 3.x. + Fixed so auto url link creation in IE 9+ is disabled by default and re-enabled by the autolink plugin. + Removed the custom scrollbars for WebKit since the default browser scrollbars looks a lot better now days. +Version 4.0.12 (2013-12-18) + Added new media_scripts option to the media plugin. This makes it possible to embed videos using script elements. + Fixed bug where WebKit/Blink would produce random span elements and styles when deleting contents inside the editor. + Fixed bug where WebKit/Blink would produce span elements out of link elements when they where removed by the unlink command. + Fixed bug where div block formats in inline mode where applied to all paragraphs within the editor. + Fixed bug where div blocks where marked as an active format in inline mode when doing non collapsed selections. + Fixed bug where the importcss plugin wouldn't append styles if the style_formats option was configured. + Fixed bug where the importcss plugin would import styles into groups multiple times for different format menus. + Fixed bug where the paste plugin wouldn't properly remove the paste bin element on IE if a tried to paste a file. + Fixed bug where selection normalization wouldn't properly handle cases where a range point was after a element node. + Fixed bug where the default time format for the inserttime split button wasn't the first item in the list. + Fixed bug where the default text for the formatselect control wasn't properly translated by the language pack. + Fixed bug where links would be inserted incorrectly when auto detecting absolute urls/emails links in inline mode. + Fixed bug where IE 11 would insert contents in the wrong order due to focus/blur async problems. + Fixed bug where pasting contents on IE sometimes would place the contents at the end of the editor. + Fixed so drag/drop on non IE browsers gets filtered by the paste plugin. IE doesn't have the necessary APIs. + Fixed so the paste plugin better detects Word 2007 contents not marked with -mso junk. + Fixed so image button isn't set to an active state when selecting control/media placeholder items. +Version 4.0.11 (2013-11-20) + Added the possibility to update button icon after it's been rendered. + Added new autosave_prefix option allows you to set the prefix for the local storage keys. + Added new pagebreak_split_block option to make it easier to split block elements with a page break. + Fixed bug where IE would some times produce font elements when typing out side the body root blocks. + Fixed bug where IE wouldn't properly use the configured root block element but instead use the a paragraph. + Fixed bug where IE would throw a stack overflow if control selections non images was made in inline mode. + Fixed bug where IE 8 would render an extra enter element if the contents of the editor was empty. + Fixed bug where the caret wasn't moved to the first suitable element when updating the source. + Fixed bug where protocol relative urls would be forced into http protocol. + Fixed bug where internal images with data urls such as video elements would be removed by the paste_data_images option. + Fixed bug where the autoresize plugin wouldn't properly resize the editor to initial contents some times. + Fixed bug where the templates dialog wouldn't be properly rendered on IE 7. + Fixed bug where updating styles in the advanced tab under the image dialog would remove the style attribute on cancel. + Fixed bug where tinymce.full.min.js bundle script wasn't detected when looking for the tinymce root path. + Fixed bug where the SaxParser would throw a malformed URI sequence for inproperly encoded uris. + Fixed bug where enabling table caption wouldn't properly render the caption element on IE 10 and below. + Fixed bug where the scrollbar would be placed to the left and on top of the text of menu items in RTL mode. + Fixed bug where Firefox on Mac OS X would navigate forward/backward on CMD+Arrow keys. + Fixed bug where fullscreen toggle on fixed sized editors wouldn't be properly full screened. + Fixed bug where the unlink button would remove all links from the body element in inline mode under running in IE. + Fixed bug where iOS wasn't able to place the caret inside an empty editor when clicking below the first line. + Fixed so internal document anchors in Word documents are retained when pasting using the paste from word feature. + Fixed so menu shortcuts gets rendered with the Apple command icon patch contributed by Andy Keller. + Fixed so the CSS compression of styles like "border" is a bit better for mixed values. + Fixed so the template_popup_width/template_popup_height option works properly in the template plugin. + Fixed so the languages parameter for AddOnManager.requireLangPack works the same way as for 3.x. + Fixed so the autosave plugin uses the current page path, query string and editor id as it's default prefix. + Fixed so the fullpage plugin adds/removes any link style sheets to the current iframe document. +Version 4.0.10 (2013-10-28) + Added new forced_root_block_attrs option that allows you to specify attributes for the root block. + Fixed bug where the custom resize handles didn't work properly on IE 11. + Fixed bug where the code plugin would select all contents in IE when content was updated. + Fixed bug where the scroll position wouldn't get applied to floating toolbars. + Fixed bug where focusing in/out of the editor would move the caret to the top of the editor on IE 11. + Fixed bug where the listboxes for link and image lists wasn't updated when the url/src was changed. + Fixed bug where selection bookmark elements would be visible in the elements path list. +Version 4.0.9 (2013-10-24) + Added support for external template files to template plugin just set the templates option to a URL with JSON data. + Added new allow_script_urls option. Enabled by default, trims all script urls from attributes. + Fixed bug where IE would sometimes throw a "Permission denied" error unless the Sizzle doc was properly removed. + Fixed bug where lists plugin would remove outer list items if inline editable element was within a LI parent. + Fixed bug where insert table grid widget would insert a table on item to large when using a RTL language pack. + Fixed bug where fullscreen mode wasn't rendering properly on IE 7. + Fixed bug where resize handlers wasn't moved correctly when scrolling inline editable elements. + Fixed bug where it wasn't possible to paste from Excel and possible other applications due to Clipboard API bugs in browsers. + Fixed bug where Shift+Ctrl+V didn't produce a plain text paste on IE. + Fixed bug where IE would sometimes move the selection to the a previous location. + Fixed bug where the editor wasn't properly scrolled to the content insert location in inline mode. + Fixed bug where some comments would be parsed as HTML by the SaxParser. + Fixed bug where WebKit/Blink would render tables incorrectly if unapplying formats when having multiple table cells selected. + Fixed bug where the paste_data_images option wouldn't strip all kinds of data images. + Fixed bug where the GridLayout didn't render items correctly if the contents overflowed the layout container. + Fixed bug where the Window wasn't properly positioned if the size of the button bar or title bar was wider than the contents. + Fixed bug where psuedo selectors for finding UI controls didn't work properly. + Fixed bug where resized splitbuttons would throw an exception if it didn't contain an icon. + Fixed bug where setContent would move focus into the editor even though it wasn't active. + Fixed bug where IE 11 would sometimes throw an "Invalid function" error when calling setActive on the body element. + Fixed bug where the importcss plugin would import styles from CSS files not present in the content_css array. + Fixed bug where the jQuery plugin will initialize the editors twice if the core was loaded using the script_url option. + Fixed various bugs and issues related to indentation of OL/UL list elements. + Fixed so IE 7 renders the classic mode buttons the same size as other browsers. + Fixed so document.readyState is checked when loading and initializing TinyMCE manually after page load. +Version 4.0.8 (2013-10-10) + Added RTL support so all of the UI is rendered right to left if a language pack has a _dir property set to rtl. + Fixed bug where layout managers wouldn't handle subpixel values properly. When for example the browser was zoomed in. + Fixed bug where the importcss plugin wouldn't import classes from local stylesheets with remote @import rules on Gecko. + Fixed bug where Arabic characters wouldn't be properly counted in wordcount plugin. + Fixed bug where submit event would still fire even if it was unbound on IE 10. Now the event is simply ignored. + Fixed bug where IE 11 would return border-image: none when getting style attributes with borders in them. + Fixed various UI rendering issues on older IE versions. + Fixed so readonly option renderes the editor in inline mode with all UI elements disabled and all events blocked. +Version 4.0.7 (2013-10-02) + Added new importcss_selector_filter option to importcss plugin. Makes it easier to select specific classes to import. + Added new importcss_groups option to importcss plugin. Enables you separate classes into menu groups based on filters. + Added new PastePreProcess/PastePostProcess events and reintroduced paste_preprocess/paste_postprocess paste options. + Added new paste_word_valid_elements option lets you control what elements gets pasted when pasting from Word. + Fixed so panelbutton is easier to use. It's now possible to set the panel contents to any container type. + Fixed so editor.destroy calls editor.remove so that both destroy and remove can be used to remove an editor instance. + Fixed so the searchreplace plugin doesn't move focus into the editor until you close the dialog. + Fixed so the searchreplace plugin search for next item if you hit enter inside the dialog. + Fixed so importcss_selector_converter callback is executed with the scope set to importcss plugin instance. + Fixed so the default selector converter function is exposed in importcss plugin. + Fixed issue with the tabpanel not expanding properly when the tabs where wider than the body of the panel. + Fixed issue with the menubar option producing a JS exception if set to true. + Fixed bug where closing a dialog with an opened listbox would cause errors if new dialogs where opened. + Fixed bug where hidden input elements wasn't removed when inline editor instances where removed. + Fixed bug where editors wouldn't initialize some times due to event logic not working correctly. + Fixed bug where pre elements woudl cause searchreplace and spellchecker plugins to mark incorrect locations. + Fixed bug where embed elements wouldn't be properly resized if they where configured in using the video_template_callback. + Fixed bug where paste from word would remove all BR elements since it was missing in the default paste_word_valid_elements. + Fixed bug where paste filtering wouldn't work properly on old WebKit installations pre Clipboard API. + Fixed bug where linebreaks would be removed by paste plugin on IE since it didn't properly detect Word contents. + Fixed bug where paste plugin would convert some Word paragraphs that looked like lists into lists. + Fixed bug where editors wasn't properly initialized if the document.domain is set to the same as the current domain on IE. + Fixed bug where an exception was thrown when removing an editor after opening the context menu multiple times. + Fixed bug where paste as plain text on Gecko would add extra BR elements when pasting paragraphs. +Version 4.0.6 (2013-09-12) + Added new compat3x plugin that makes it possible to load most 3.x plugins. Only available in the development package. + Added new skin_url option enables you to load local skins when using the CDN version. + Added new theme_url option enables you to load local themes when using the CDN version. + Added new importcss_file_filter option to importcss to enable users to specify what files to import from. + Added new template_preview_replace_values option to template plugin to add example data for variables. + Added image option support for addMenuItem calls. Enables you to provide a custom image for menu items. + Fixed bug where editor.insertContent wouldn't set format and selection type on events. + Fixed bug where inserting BR elements on IE 8 would thrown an exception when the range is at a empty text node. + Fixed bug where outdent of single LI element within another LI would produce an empty list element OL/UL. + Fixed bug where the bullist/numlist buttons wouldn't be deselected when deleting all contents. + Fixed bug where toggling an empty list item off wouldn't produce a new empty block element. + Fixed bug where it wasn't possible to apply lists to mixed text blocks and br lines. + Fixed bug where it wasn't possible to paste contents on iOS when the paste plugin was enabled. + Fixed bug where it wasn't possible to delete HR elements on Gecko. + Fixed bug where scrolling and refocusing using the mouse would place the caret incorrectly on IE. + Fixed bug where you needed to hit the empty paragraph to get editor focus in IE 11. + Fixed bug where activeEditor wasn't set to the correct editor when opening windows. + Fixed bug where dirty state wasn't set to false when undoing to the first undo level. + Fixed bug where pasting in inline mode on Safari on Mac wouldn't work properly. + Fixed bug where content_css wasn't loaded into the insert template dialog. + Fixed bug where setting the contents of the editor to non text contents would produce an incorrect selection range. + Fixed so code dialog height gets smaller that the viewport height if it doesn't fit. + Fixed so inline editable regions scroll when pressing enter/return. + Fixed so inline toolbar gets positioned correctly when inline element is within a scrollable container. + Fixed various memory leaks when removing editor instances dynamically. + Removed CSS for BR elements in visualblocks due to problems with Chrome and IE. +Version 4.0.5 (2013-08-27) + Added visuals for UL, LI and BR to visualblocks plugin. Patch contributed by Dan Ransom. + Added new autosave_restore_when_empty option to autosave plugin. Enabled by default. + Fixed bug where an exception was thrown when inserting images if valid_elements didn't include an ID for the image. + Fixed bug where the advlist plugin wouldn't properly render the splitbutton controls. + Fixed bug where visual blocks menu item wouldn't be marked checked when using the visualblocks_default_state option. + Fixed bug where save button in save plugin wouldn't get properly enabled when contents was changed. + Fixed bug where it was possible to insert images without any value for it's source attribute. + Fixed bug where altering image attributes wouldn't add a new undo level. + Fixed bug where import rules in CSS files wouldn't be properly imported by the importcss plugin. + Fixed bug where selectors could be imported multiple times. Producing duplicate formats. + Fixed bug where IE would throw exception if selection was changed while the editor was hidden. + Fixed so complex rules like .class:before doesn't get imported by default in the importcss plugin. + Fixed so it's possible to remove images by setting the src attribute to a blank value. + Fixed so the save_enablewhendirty setting in the save plugin is enabled by default. + Fixed so block formats drop down for classic mode can be translated properly using language packs. + Fixed so hr menu item and toolbar button gets the same translation string. + Fixed so bullet list toolbar button gets the correct translation from language packs. + Fixed issue with Chrome logging CSS warning about border styling for combo boxes. + Fixed issue with Chrome logging warnings about deprecated keyLocation property. + Fixed issue where custom_elements would not remove the some of the default rules when cloning rules from div and span. +Version 4.0.4 (2013-08-21) + Added new importcss plugin. Lets you auto import classes from CSS files similar to the 3.x behavior. + Fixed bug where resize handles would be positioned incorrectly when inline element parent was using position: relative. + Fixed bug where IE 8 would throw Unknown runtime error if the editor was placed within a P tag. + Fixed bug where removing empty lists wouldn't produce blocks or brs where the old list was in the DOM. + Fixed bug where IE 10 wouldn't properly initialize template dialog due to async loading issues. + Fixed bug where autosave wouldn't properly display the warning about content not being saved due to isDirty changes. + Fixed bug where it wouldn't be possible to type if a touchstart event was bound to the parent document. + Fixed bug where code dialog in code plugin wouldn't wouldn't add a proper undo level. + Fixed issue where resizing the editor in vertical mode would set the iframe width to a pixel value. + Fixed issue with naming of insertdatetime settings. All are now prefixed with the plugin name. + Fixed so an initial change event is fired when the user types the first character into the editor. + Fixed so swf gets mapped to object element in media plugin. Enables embedding of flash with alternative poster. +Version 4.0.3 (2013-08-08) + Added new code_dialog_width/code_dialog_height options to control code dialog size. + Added missing pastetext button that works the same way as the pastetext menu item. + Added missing smaller browse button for the classical smaller toolbars. + Fixed bug where input method would produce new lines when inserting contents to an empty editor. + Fixed bug where pasting single indented list items from Word would cause a JS exception. + Fixed bug where applying block formats inside list elements in inline mode would apply them to whole document. + Fixed bug where link editing in inline mode would cause exception on IE/WebKit. + Fixed bug where IE 10 wouldn't render the last button group properly in inline mode due to wrapping. + Fixed bug where localStorage initialization would fail on Firefox/Chrome with disabled support. + Fixed bug where image elements would get an __mce id when undo/redo:ing to a level with image changes. + Fixed bug where too long template names wouldn't fit the listbox in template plugin. + Fixed bug where alignment format options would be marked disabled when forced_root_block was set to false. + Fixed bug where UI listboxes such as fontsize, fontfamily wouldn't update properly when switching editors in inline mode. + Fixed bug where the formats select box would mark the editable container DIV as a applied format in inline mode. + Fixed bug where IE 7/8 would scroll to empty editors when initialized. + Fixed bug where IE 7/8 wouldn't display previews of format options. + Fixed bug where UI states wasn't properly updated after code was changed in the code dialog. + Fixed bug with setting contents in IE would select all contents within the editor. + Fixed so the undoManages transact function disables any other undo levels from being added while within the transaction. + Fixed so sub/sup elements gets removed when the Clear formatting action is executed. + Fixed so text/javascript type value get removed by default from script elements to match the HTML5 spec. +Version 4.0.2 (2013-07-18) + Fixed bug where formatting using menus or toolbars wasn't possible on Opera 12.15. + Fixed bug where IE 8 keyboard input would break after paste using the paste plugin. + Fixed bug where IE 8 would throw an error when populating image size in image dialog. + Fixed bug where image resizing wouldn't work properly on latest IE 10.0.9 version. + Fixed bug where focus wasn't moved to the hovered menu button in a menubar container. + Fixed bug where paste would produce an extra uneeded undo level on IE and Gecko. + Fixed so anchors gets listed in the link dialog as they where in TinyMCE 3.x. + Fixed so sub, sup and strike though gets passed through when pasting from Word. + Fixed so Ctrl+P can be used to print the current document. Patch contributed by jashua212. +Version 4.0.1 (2013-06-26) + Added new paste_as_text config option to force paste as plaintext mode. + Added new pastetext menu item that lets you toggle paste as plain text mode on/off. + Added new insertdatetime_element option to insertdatetime plugin. Enables HTML5 time element support. + Added new spellchecker_wordchar_pattern option to allow configuration of language specific characters. + Added new marker to formats menu displaying the formats used at the current selection/caret location. + Fixed bug where the position of the text color picker would be wrong if you switched to fullscreen. + Fixed bug where the link plugin would ask to add the mailto: prefix multiple times. + Fixed bug where list outdent operation could produce empty list elements on specific selections. + Fixed bug where element path wouldn't properly select parent elements on IE. + Fixed bug where IE would sometimes throw an exception when extrancting the current selection range. + Fixed bug where line feeds wasn't properly rendered in source view on IE. + Fixed bug where word count wouldn't be properly rendered on IE 7. + Fixed bug where menubuttons/listboxes would have an incorrect height on IE 7. + Fixed bug where browser spellchecking was enabled while editing inline on IE 10. + Fixed bug where spellchecker wouldn't properly find non English words. + Fixed bug where deactivating inline editor instances would force padding-top: 0 on page body. + Fixed bug where jQuery would initialize editors multiple times since it didn't check if the editor already existed. + Fixed bug where it wasn't possible to paste contents on IE 10 in modern UI mode when paste filtering was enabled. + Fixed bug where tabfocus plugin wouldn't work properly on inline editor instances. + Fixed bug where fullpage plugin would clear the existing HTML head if contents where inserted into the editor. + Fixed bug where deleting all table rows/columns in a table would cause an exception to be thrown on IE. + Fixed so color button panels gets toggled on/off when activated/deactivated. + Fixed so format menu items that can't be applied to the current selection gets disabled. + Fixed so the icon parameter for addButton isn't automatically filled if a button text is provided. + Fixed so image size fields gets updated when selecting a new image in the image dialog. + Fixed so it doesn't load any language pack if the language option is set to "en". + Fixed so ctrl+shift+z works as an alternative redo shortcut to match a common Mac OS X shortcut. + Fixed so it's not possible to drag/drop in images in Gecko by default when paste plugin is enabled. + Fixed so format menu item texts gets translated using the specified language pack. + Fixed so the image dialog title is the same as the insert/edit image button text. + Fixed so paste as plain text produces BR:s in PRE block and when forced_root_block is disabled. +Version 4.0 (2013-06-13) + Added new insertdate_dateformat, insertdate_timeformat and insertdate_formats options to insertdatetime. + Added new font_formats, fontsize_formats and block_formats options to configure fontselect, fontsizeselect and formatselect. + Added new table_clone_elements option to table plugin. Enables you to specify what elements to clone when adding columns/rows. + Added new auto detect logic for site and email urls in link plugin to match the logic found in 3.x. + Added new getParams/setParams to WindowManager to make it easier to handle params to iframe based dialogs. Contributed by Ryan Demmer. + Added new textcolor options that enables you to specify the colors you want to display. Contributed by Jennifer Arsenault. + Added new external file support for link_list and image_list options. The file format is a simple JSON file. + Added new "both" mode for the resize option. Enables resizing in both width and height. + Added new paste_data_images option that allows you to enable/disable paste of data images. + Added new fixed_toolbar_container option that allows you to add a fixed container for the inline toolbar. + Fixed so font name, font size and block format select boxes gets updated with the current format. + Fixed so the resizeTo/resizeBy methods for the theme are exposed as it as in 3.x. + Fixed so the textcolor controls are splitbuttons as in 3.x. Patch contributed by toxalot/jashua212. + Fixed bug where the theme content css wasn't loaded into the preview dialog. + Fixed bug where the template description in template dialog wouldn't display the text correctly. + Fixed bug where various UI elements wasn't properly removed when an editor instance was removed. + Fixed bug where editing links in inline mode would fail on WebKit. + Fixed bug where the pagebreak_separator option in the pagebreak plugin wasn't working properly. + Fixed bug where the child panels of the float panel in inline mode wasn't properly placed. + Fixed bug where the float panel children of windows wasn't position fixed. + Fixed bug where the size of the ok button was hardcoded, caused issues with i18n. + Fixed bug where single comment in editor would cause exceptions due to resolve path logic not detecting elements only. + Fixed bug where switching alignment of tables in dialogs wouldn't properly remove existing alignments. + Fixed bug where the table properties dialog would show columns/rows textboxes. + Fixed bug where jQuery wasn't used instead of Sizzle in the jQuery version of TinyMCE. + Fixed bug where setting resize option to false whouldn't properly render the word count. + Fixed bug where table row type change would produce multiple table section elements. + Fixed bug where table row type change on multiple rows would add them in incorrect order. + Fixed bug where fullscreen plugin would maximize the editor on resize after toggling it off. + Fixed bug where context menu would be position at an incorrect coordinate in inline mode. + Fixed bug where inserting lists in inline mode on IE would produce errors since the body would be converted. + Fixed bug where the body couldn't be styled properly in custom content_css files. + Fixed bug where template plugins menu item would override the image menu item. + Fixed bug where IE 7-8 would render the text inside inputs at the wrong vertical location. + Fixed bug where IE configured to IE 7 compatibility mode wouldn't render the icons properly. + Fixed bug where editor.focus wouldn't properly fire the focusin event on WebKit. + Fixed bug where some keyboard shortcuts wouldn't work on IE 8. + Fixed bug where the undo state wasn't updated until the end of a typing level. + Fixed bug where keyboard shortcuts on Mac OS wasn't working correctly. + Fixed bug where empty inline elements would be created when toggling formatting of in empty block. + Fixed bug where applying styles on WebKit would fail in inline mode if the user released the mouse button outside the body. + Fixed bug where the visual aids menu item wasn't selected if the editor was empty. + Fixed so the isDirty/isNotDirty states gets updated to true/false on save() and change events. + Fixed so skins have separate CSS files for inline and iframe mode. + Fixed so menus and tool tips gets constrained to the current viewport. + Fixed so an error is thrown if users load jQuery after the jQuery version of TinyMCE. + Fixed so the filetype for media dialog passes out media instead of image as file type. + Fixed so it's possible to disable the toolbar by setting it to false. + Fixed so autoresize plugin isn't initialized when the editor is in inline mode. + Fixed so the inline editing toolbar will be rendered below elements if it doesn't fit above it. +Version 4.0b3 (2013-05-15) + Added new optional advanced tab for image dialog with hspace, vspace, border and style. + Added new change event that gets fired when undo levels are added to editor instances. + Added new removed_menuitems option enables you to list menu items to remove from menus. + Added new external_plugins option enables you to specify external locations for plugins. + Added new language_url option enables you to specify an external location for the language pack. + Added new table toolbar control that displays a menu for inserting/editing menus. + Fixed bug where IE 10 wouldn't load files properly from cache. + Fixed bug where image dialog wouldn't properly remove width/height if blanked. + Fixed bug where all events wasn't properly unbound when editor instances where removed. + Fixed bug where data- attributes wasn't working properly in the SaxParser. + Fixed bug where Gecko wouldn't properly render broken images. + Fixed bug where Gecko wouldn't produce the same error dialog on paste as other browsers. + Fixed bug where is wasn't possible to prevent execCommands in beforeExecCommand event. + Fixed bug where the fullpage_hide_in_source_view option wasn't working in the fullpage plugin. + Fixed bug where the WindowManager close method wouldn't properly close the top most window. + Fixed bug where it wasn't possible to paste in IE 10 due to JS exception. + Fixed bug where tab key didn't move to the right child control in tabpanels. + Fixed bug where enter inside a form would focus the first button like control in TinyMCE. + Fixed bug where it would match scripts that looked like the tinymce base directory incorrectly. + Fixed bug where the spellchecker wouldn't properly toggle off the spellcheck mode if no errors where found. + Fixed bug in searchreplace plugin where it would remove all spans instead of the marker spans. + Fixed issue where selector wouldn't disable existing mode setting. + Fixed so it's easier to configure the menu and menubar. + Fixed so bodyId/bodyClass is applied to preview as it's done to the editor iframe. +Version 4.0b2 (2013-04-24) + Added new rel_list option to link plugin. Enables you to specify values for a rel drop down. + Added new target_list option to link plugin. Enables you to add to or disable the link targets. + Added new link_list option to link plugin. Enables you to specify a list of links to pick from. + Added new image_list option to image pluigin. Enables you to specify a list of images to pick from. + Added new textcolor plugin. This plugin holds the text color and text background color buttons. + Fixed bug where alignment of images wasn't working properly on Firefox. + Fixed bug where IE 8 would throw error when inserting a table. + Fixed bug where IE 8 wouldn't render the element path properly. + Fixed bug where old IE versions would render a red focus border. + Fixed bug where old IE versions would render a frameborder for iframes. + Fixed bug where WebKit wouldn't properly open the cell properties dialog on edge case selection. + Fixed bug where charmap wouldn't correctly render all characters in grid. + Fixed bug where link dialog wouldn't update the link text properly. + Fixed bug where the focus/blur states on inline editors wasn't handled correctly on IE. + Fixed bug where IE would throw "unknown error" exception sometimes in ForceBlocks logic. + Fixed bug where IE would't properly render disabled buttons in button groups. + Fixed bug where tab key wouldn't properly move to next input field in dialogs. + Fixed bug where resize handles for tables and images would appear at wrong positions on IE 8. + Fixed bug where dialogs would produce stack overflow if title was wider than content. + Fixed bug with table cell/row menu items being enabled even if no cell was selected. + Fixed so the text to display is after the URL field in the link dialog. + Fixed so the width setting applies to the editor panel in modern theme. + Fixed so it's easier to make custom icons for buttons using plain old images. +Version 4.0b1 (2013-04-11) + Added new node.js based build process used uglify, amdlc, jake etc. + Added new package.json to enable easy installation of dependent npm packages used for building. + Added new link, image, charmap, anchor, code, hr plugins since these are now moved out of the theme. + Rewrote all plugins and themes from scratch so they match the new UI framework. + Replaced all events to use the more common <target>.on/off(<event>) methods instead of <target>.<event>.add/remove. + Rewrote the TinyMCE core to use AMD style modules. Gets compiled to an inline library using amdlc. + Rewrote all core logic to pass jshint rules. Each file has specific jshint rules. + Removed all IE6 specific logic since 4.x will no longer support such an old browser. + Reworked the file names and directory structure of the whole project to be more similar to other JS projects. + Replaced tinymce.util.Cookie with tinymce.util.LocalStorage. Fallback to userData for IE 7 native localStorage for the rest. + Replaced the old 3.x UI with a new modern UI framework. + Removed "simple" theme and added new "modern" theme. + Removed advhr, advimage, advlink, iespell, inlinepopups, xhtmlxtras and style plugins. + Updated Sizzle to the latest version. diff --git a/comiccontrol/tinymce/js/tinymce/langs/readme.md b/comiccontrol/tinymce/js/tinymce/langs/readme.md new file mode 100644 index 0000000..a52bf03 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/langs/readme.md @@ -0,0 +1,3 @@ +This is where language files should be placed. + +Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/comiccontrol/tinymce/js/tinymce/license.txt b/comiccontrol/tinymce/js/tinymce/license.txt new file mode 100644 index 0000000..1837b0a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/comiccontrol/tinymce/js/tinymce/plugins/advlist/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/advlist/plugin.min.js new file mode 100644 index 0000000..a4db7cc --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/advlist/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("advlist",function(t){function e(t,e){var n=[];return tinymce.each(e.split(/[ ,]/),function(t){n.push({text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"==t?"":t})}),n}function n(e,n){var o,l=t.dom,a=t.selection;o=l.getParent(a.getNode(),"ol,ul"),o&&o.nodeName==e&&n!==!1||t.execCommand("UL"==e?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?i[e]:n,i[e]=n,o=l.getParent(a.getNode(),"ol,ul"),o&&(l.setStyle(o,"listStyleType",n),o.removeAttribute("data-mce-style")),t.focus()}function o(e){var n=t.dom.getStyle(t.dom.getParent(t.selection.getNode(),"ol,ul"),"listStyleType")||"";e.control.items().each(function(t){t.active(t.settings.data===n)})}var l,a,i={};l=e("OL",t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),a=e("UL",t.getParam("advlist_bullet_styles","default,circle,disc,square")),t.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:l,onshow:o,onselect:function(t){n("OL",t.control.settings.data)},onclick:function(){n("OL",!1)}}),t.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:a,onshow:o,onselect:function(t){n("UL",t.control.settings.data)},onclick:function(){n("UL",!1)}})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/anchor/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/anchor/plugin.min.js new file mode 100644 index 0000000..058e686 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/anchor/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("anchor",function(n){function e(){var e=n.selection.getNode();n.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:e.name||e.id},onsubmit:function(e){n.execCommand("mceInsertContent",!1,n.dom.createHTML("a",{id:e.data.name}))}})}n.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:e,stateSelector:"a:not([href])"}),n.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:e})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/autolink/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/autolink/plugin.min.js new file mode 100644 index 0000000..10bc717 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/autolink/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autolink",function(n){function t(n){o(n,-1,"(",!0)}function e(n){o(n,0,"",!0)}function i(n){o(n,-1,"",!1)}function o(n,t,e){function i(n,t){if(0>t&&(t=0),3==n.nodeType){var e=n.data.length;t>e&&(t=e)}return t}function o(n,t){f.setStart(n,i(n,t))}function r(n,t){f.setEnd(n,i(n,t))}var f,d,a,s,c,l,u,g,h,C;if(f=n.selection.getRng(!0).cloneRange(),f.startOffset<5){if(g=f.endContainer.previousSibling,!g){if(!f.endContainer.firstChild||!f.endContainer.firstChild.nextSibling)return;g=f.endContainer.firstChild.nextSibling}if(h=g.length,o(g,h),r(g,h),f.endOffset<5)return;d=f.endOffset,s=g}else{if(s=f.endContainer,3!=s.nodeType&&s.firstChild){for(;3!=s.nodeType&&s.firstChild;)s=s.firstChild;3==s.nodeType&&(o(s,0),r(s,s.nodeValue.length))}d=1==f.endOffset?2:f.endOffset-1-t}a=d;do o(s,d>=2?d-2:0),r(s,d>=1?d-1:0),d-=1,C=f.toString();while(" "!=C&&""!==C&&160!=C.charCodeAt(0)&&d-2>=0&&C!=e);f.toString()==e||160==f.toString().charCodeAt(0)?(o(s,d),r(s,a),d+=1):0===f.startOffset?(o(s,0),r(s,a)):(o(s,d),r(s,a)),l=f.toString(),"."==l.charAt(l.length-1)&&r(s,a-1),l=f.toString(),u=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),u&&("www."==u[1]?u[1]="http://www.":/@$/.test(u[1])&&!/^mailto:/.test(u[1])&&(u[1]="mailto:"+u[1]),c=n.selection.getBookmark(),n.selection.setRng(f),n.execCommand("createlink",!1,u[1]+u[2]),n.selection.moveToBookmark(c),n.nodeChanged())}var r;return n.on("keydown",function(t){return 13==t.keyCode?i(n):void 0}),tinymce.Env.ie?void n.on("focus",function(){if(!r){r=!0;try{n.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(n.on("keypress",function(e){return 41==e.keyCode?t(n):void 0}),void n.on("keyup",function(t){return 32==t.keyCode?e(n):void 0}))});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/autoresize/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/autoresize/plugin.min.js new file mode 100644 index 0000000..fed1d4f --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/autoresize/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function i(n){var s,r,g,u,l,m,h,d,f=tinymce.DOM;if(r=e.getDoc()){if(g=r.body,u=r.documentElement,l=o.autoresize_min_height,!g||n&&"setcontent"===n.type&&n.initial||t())return void(g&&u&&(g.style.overflowY="auto",u.style.overflowY="auto"));h=e.dom.getStyle(g,"margin-top",!0),d=e.dom.getStyle(g,"margin-bottom",!0),m=g.offsetHeight+parseInt(h,10)+parseInt(d,10),(isNaN(m)||0>=m)&&(m=tinymce.Env.ie?g.scrollHeight:tinymce.Env.webkit&&0===g.clientHeight?0:g.offsetHeight),m>o.autoresize_min_height&&(l=m),o.autoresize_max_height&&m>o.autoresize_max_height?(l=o.autoresize_max_height,g.style.overflowY="auto",u.style.overflowY="auto"):(g.style.overflowY="hidden",u.style.overflowY="hidden",g.scrollTop=0),l!==a&&(s=l-a,f.setStyle(f.get(e.id+"_ifr"),"height",l+"px"),a=l,tinymce.isWebKit&&0>s&&i(n))}}function n(e,t,o){setTimeout(function(){i({}),e--?n(e,t,o):o&&o()},t)}var o=e.settings,a=0;e.settings.inline||(o.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),o.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t=e.getParam("autoresize_overflow_padding",1);e.dom.setStyles(e.getBody(),{paddingBottom:e.getParam("autoresize_bottom_margin",50),paddingLeft:t,paddingRight:t})}),e.on("nodechange setcontent keyup FullscreenStateChanged",i),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){n(20,100,function(){n(5,1e3)})}),e.addCommand("mceAutoResize",i))});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/autosave/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/autosave/plugin.min.js new file mode 100644 index 0000000..bb41975 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/autosave/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(l.getItem(d+"time"),10)||0;return(new Date).getTime()-e>v.autosave_retention?(a(!1),!1):!0}function a(t){l.removeItem(d+"draft"),l.removeItem(d+"time"),t!==!1&&e.fire("RemoveDraft")}function r(){!c()&&e.isDirty()&&(l.setItem(d+"draft",e.getContent({format:"raw",no_events:!0})),l.setItem(d+"time",(new Date).getTime()),e.fire("StoreDraft"))}function o(){n()&&(e.setContent(l.getItem(d+"draft"),{format:"raw"}),e.fire("RestoreDraft"))}function i(){m||(setInterval(function(){e.removed||r()},v.autosave_interval),m=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),i()}function u(){e.undoManager.beforeChange(),o(),a(),e.undoManager.add()}function f(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e}function c(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+"[^>]*>((Â | |[ ]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(t)}var d,m,v=e.settings,l=tinymce.util.LocalStorage;d=v.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",d=d.replace(/\{path\}/g,document.location.pathname),d=d.replace(/\{query\}/g,document.location.search),d=d.replace(/\{id\}/g,e.id),v.autosave_interval=t(v.autosave_interval,"30s"),v.autosave_retention=t(v.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:u,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:u,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&o()}),e.on("saveContent",function(){a()})),window.onbeforeunload=f,this.hasDraft=n,this.storeDraft=r,this.restoreDraft=o,this.removeDraft=a,this.isEmpty=c});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/bbcode/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/bbcode/plugin.min.js new file mode 100644 index 0000000..78c37cd --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/bbcode/plugin.min.js @@ -0,0 +1 @@ +!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(o){var e=this,t=o.getParam("bbcode_dialect","punbb").toLowerCase();o.on("beforeSetContent",function(o){o.content=e["_"+t+"_bbcode2html"](o.content)}),o.on("postProcess",function(o){o.set&&(o.content=e["_"+t+"_bbcode2html"](o.content)),o.get&&(o.content=e["_"+t+"_html2bbcode"](o.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(o){function e(e,t){o=o.replace(e,t)}return o=tinymce.trim(o),e(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/<font>(.*?)<\/font>/gi,"$1"),e(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),e(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),e(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),e(/<u>/gi,"[u]"),e(/<blockquote[^>]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/<br \/>/gi,"\n"),e(/<br\/>/gi,"\n"),e(/<br>/gi,"\n"),e(/<p>/gi,""),e(/<\/p>/gi,"\n"),e(/ |\u00a0/gi," "),e(/"/gi,'"'),e(/</gi,"<"),e(/>/gi,">"),e(/&/gi,"&"),o},_punbb_bbcode2html:function(o){function e(e,t){o=o.replace(e,t)}return o=tinymce.trim(o),e(/\n/gi,"<br />"),e(/\[b\]/gi,"<strong>"),e(/\[\/b\]/gi,"</strong>"),e(/\[i\]/gi,"<em>"),e(/\[\/i\]/gi,"</em>"),e(/\[u\]/gi,"<u>"),e(/\[\/u\]/gi,"</u>"),e(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),e(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),e(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),e(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),e(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),e(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),o}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/charmap/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/charmap/plugin.min.js new file mode 100644 index 0000000..46fce44 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/charmap/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("charmap",function(e){function a(){function a(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var t,r,o,n;t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var l=25;for(o=0;10>o;o++){for(t+="<tr>",r=0;l>r;r++){var s=i[o*l+r];t+='<td title="'+s[1]+'"><div tabindex="-1" title="'+s[1]+'" role="button">'+(s?String.fromCharCode(parseInt(s[0],10)):" ")+"</div></td>"}t+="</tr>"}t+="</tbody></table>";var c={type:"container",html:t,onclick:function(a){var i=a.target;"TD"==i.tagName&&(i=i.firstChild),"DIV"==i.tagName&&(e.execCommand("mceInsertContent",!1,i.firstChild.data),a.ctrlKey||n.close())},onmouseover:function(e){var i=a(e.target);i&&n.find("#preview").text(i.firstChild.firstChild.data)}};n=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[c,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){n.close()}}]})}var i=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:a}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:a,context:"insert"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/code/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/code/plugin.min.js new file mode 100644 index 0000000..6aaecd9 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/code/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("code",function(e){function o(){var o=e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(o){e.focus(),e.undoManager.transact(function(){e.setContent(o.data.code)}),e.selection.setCursorLocation(),e.nodeChanged()}});o.find("#code").value(e.getContent({source_view:!0}))}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js new file mode 100644 index 0000000..d50c7cc --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("colorpicker",function(e){function n(n,a){function i(e){var n=new tinymce.util.Color(e),a=n.toRgb();l.fromJSON({r:a.r,g:a.g,b:a.b,hex:n.toHex().substr(1)}),t(n.toHex())}function t(e){l.find("#preview")[0].getEl().style.background=e}var l=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:a,onchange:function(){var e=this.rgb();l&&(l.find("#r").value(e.r),l.find("#g").value(e.g),l.find("#b").value(e.b),l.find("#hex").value(this.value().substr(1)),t(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,a=l.find("colorpicker")[0];return e=this.name(),n=this.value(),"hex"==e?(n="#"+n,i(n),void a.value(n)):(n={r:l.find("#r").value(),g:l.find("#g").value(),b:l.find("#b").value()},a.value(n),void i(n))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+this.toJSON().hex)}});i(a)}e.settings.color_picker_callback||(e.settings.color_picker_callback=n)});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js new file mode 100644 index 0000000..06f0d4b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("contextmenu",function(e){var n,t=e.settings.contextmenu_never_use_native;e.on("contextmenu",function(i){var o;if(!i.ctrlKey||t){if(i.preventDefault(),o=e.settings.contextmenu||"link image inserttable | cell row column deletetable",n)n.show();else{var c=[];tinymce.each(o.split(/[ ,]/),function(n){var t=e.menuItems[n];"|"==n&&(t={text:n}),t&&(t.shortcut="",c.push(t))});for(var a=0;a<c.length;a++)"|"==c[a].text&&(0===a||a==c.length-1)&&c.splice(a,1);n=new tinymce.ui.Menu({items:c,context:"contextmenu"}).addClass("contextmenu").renderTo(),e.on("remove",function(){n.remove(),n=null})}var l={x:i.pageX,y:i.pageY};e.inline||(l=tinymce.DOM.getPos(e.getContentAreaContainer()),l.x+=i.clientX,l.y+=i.clientY),n.moveTo(l.x,l.y)}})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/directionality/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/directionality/plugin.min.js new file mode 100644 index 0000000..2994eb6 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/directionality/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("directionality",function(t){function e(e){var i,n=t.dom,r=t.selection.getSelectedBlocks();r.length&&(i=n.getAttrib(r[0],"dir"),tinymce.each(r,function(t){n.getParent(t.parentNode,"*[dir='"+e+"']",n.getRoot())||(i!=e?n.setAttrib(t,"dir",e):n.setAttrib(t,"dir",null))}),t.nodeChanged())}function i(t){var e=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(i){e.push(i+"[dir="+t+"]")}),e.join(",")}t.addCommand("mceDirectionLTR",function(){e("ltr")}),t.addCommand("mceDirectionRTL",function(){e("rtl")}),t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:i("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:i("rtl")})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif Binary files differnew file mode 100644 index 0000000..ba90cc3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif Binary files differnew file mode 100644 index 0000000..74d897a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif Binary files differnew file mode 100644 index 0000000..963a96b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif Binary files differnew file mode 100644 index 0000000..c7cf101 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif Binary files differnew file mode 100644 index 0000000..716f55e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif Binary files differnew file mode 100644 index 0000000..334d49e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif Binary files differnew file mode 100644 index 0000000..4efd549 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif Binary files differnew file mode 100644 index 0000000..82c5b18 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif Binary files differnew file mode 100644 index 0000000..ca2451e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif Binary files differnew file mode 100644 index 0000000..fe66220 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif Binary files differnew file mode 100644 index 0000000..fd27edf --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif Binary files differnew file mode 100644 index 0000000..0cc9bb7 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif Binary files differnew file mode 100644 index 0000000..2075dc1 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif Binary files differnew file mode 100644 index 0000000..bef7e25 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif Binary files differnew file mode 100644 index 0000000..0631c76 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif Binary files differnew file mode 100644 index 0000000..648e6e8 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/emoticons/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/plugin.min.js new file mode 100644 index 0000000..737083f --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/emoticons/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("emoticons",function(t,e){function a(){var t;return t='<table role="list" class="mce-grid">',tinymce.each(i,function(a){t+="<tr>",tinymce.each(a,function(a){var i=e+"/img/smiley-"+a+".gif";t+='<td><a href="#" data-mce-url="'+i+'" data-mce-alt="'+a+'" tabindex="-1" role="option" aria-label="'+a+'"><img src="'+i+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),t+="</tr>"}),t+="</table>"}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];t.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:a,onclick:function(e){var a=t.dom.getParent(e.target,"a");a&&(t.insertContent('<img src="'+a.getAttribute("data-mce-url")+'" alt="'+a.getAttribute("data-mce-alt")+'" />'),this.hide())}},tooltip:"Emoticons"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/example/dialog.html b/comiccontrol/tinymce/js/tinymce/plugins/example/dialog.html new file mode 100644 index 0000000..565f06f --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/example/dialog.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<html> +<body> + <h3>Custom dialog</h3> + Input some text: <input id="content"> + <button onclick="top.tinymce.activeEditor.windowManager.getWindows()[0].close();">Close window</button> +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/example/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/example/plugin.min.js new file mode 100644 index 0000000..00a262e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/example/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("example",function(t,e){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:e+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var e=t.windowManager.getWindows()[0];t.insertContent(e.getContentWindow().document.getElementById("content").value),e.close()}},{text:"Close",onclick:"close"}]})}})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js new file mode 100644 index 0000000..e61bf47 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("example_dependency",function(){},["example"]);
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/fullpage/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/fullpage/plugin.min.js new file mode 100644 index 0000000..1da17c9 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/fullpage/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){l(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,l,a=i(),r={};return r.fontface=e.getParam("fullpage_default_fontface",""),r.fontsize=e.getParam("fullpage_default_fontsize",""),n=a.firstChild,7==n.type&&(r.xml_pi=!0,l=/encoding="([^"]+)"/.exec(n.value),l&&(r.docencoding=l[1])),n=a.getAll("#doctype")[0],n&&(r.doctype="<!DOCTYPE"+n.value+">"),n=a.getAll("title")[0],n&&n.firstChild&&(r.title=n.firstChild.value),s(a.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?r[n.toLowerCase()]=e.attr("content"):"Content-Type"==l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(r.docencoding=t[1]))}),n=a.getAll("html")[0],n&&(r.langcode=t(n,"lang")||t(n,"xml:lang")),r.stylesheets=[],tinymce.each(a.getAll("link"),function(e){"stylesheet"==e.attr("rel")&&r.stylesheets.push(e.attr("href"))}),n=a.getAll("body")[0],n&&(r.langdir=t(n,"dir"),r.style=t(n,"style"),r.visited_color=t(n,"vlink"),r.link_color=t(n,"link"),r.active_color=t(n,"alink")),r}function l(t){function n(e,t,n){e.attr(t,n?n:void 0)}function l(e){r.firstChild?r.insert(e,r.firstChild):r.append(e)}var a,r,o,c,u,f=e.dom;a=i(),r=a.getAll("head")[0],r||(c=a.getAll("html")[0],r=new m("head",1),c.firstChild?c.insert(r,c.firstChild,!0):c.append(r)),c=a.firstChild,t.xml_pi?(u='version="1.0"',t.docencoding&&(u+=' encoding="'+t.docencoding+'"'),7!=c.type&&(c=new m("xml",7),a.insert(c,a.firstChild,!0)),c.value=u):c&&7==c.type&&c.remove(),c=a.getAll("#doctype")[0],t.doctype?(c||(c=new m("#doctype",10),t.xml_pi?a.insert(c,a.firstChild):l(c)),c.value=t.doctype.substring(9,t.doctype.length-1)):c&&c.remove(),c=null,s(a.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(c=e)}),t.docencoding?(c||(c=new m("meta",1),c.attr("http-equiv","Content-Type"),c.shortEnded=!0,l(c)),c.attr("content","text/html; charset="+t.docencoding)):c.remove(),c=a.getAll("title")[0],t.title?(c?c.empty():(c=new m("title",1),l(c)),c.append(new m("#text",3)).value=t.title):c&&c.remove(),s("keywords,description,author,copyright,robots".split(","),function(e){var n,i,r=a.getAll("meta"),o=t[e];for(n=0;n<r.length;n++)if(i=r[n],i.attr("name")==e)return void(o?i.attr("content",o):i.remove());o&&(c=new m("meta",1),c.attr("name",e),c.attr("content",o),c.shortEnded=!0,l(c))});var g={};tinymce.each(a.getAll("link"),function(e){"stylesheet"==e.attr("rel")&&(g[e.attr("href")]=e)}),tinymce.each(t.stylesheets,function(e){g[e]||(c=new m("link",1),c.attr({rel:"stylesheet",text:"text/css",href:e}),c.shortEnded=!0,l(c)),delete g[e]}),tinymce.each(g,function(e){e.remove()}),c=a.getAll("body")[0],c&&(n(c,"dir",t.langdir),n(c,"style",t.style),n(c,"vlink",t.visited_color),n(c,"link",t.link_color),n(c,"alink",t.active_color),f.setAttribs(e.getBody(),{style:t.style,dir:t.dir,vLink:t.visited_color,link:t.link_color,aLink:t.active_color})),c=a.getAll("html")[0],c&&(n(c,"lang",t.langcode),n(c,"xml:lang",t.langcode)),r.firstChild||r.remove(),o=new tinymce.html.Serializer({validate:!1,indent:!0,apply_source_formatting:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(a),d=o.substring(0,o.indexOf("</body>"))}function i(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(d)}function a(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var l,a,o,m,u=t.content,f="",g=e.dom;if(!t.selection&&!("raw"==t.format&&d||t.source_view&&e.getParam("fullpage_hide_in_source_view"))){u=u.replace(/<(\/?)BODY/gi,"<$1body"),l=u.indexOf("<body"),-1!=l?(l=u.indexOf(">",l),d=n(u.substring(0,l+1)),a=u.indexOf("</body",l),-1==a&&(a=u.length),t.content=u.substring(l+1,a),c=n(u.substring(a))):(d=r(),c="\n</body>\n</html>"),o=i(),s(o.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),m=o.getAll("body")[0],m&&g.setAttribs(e.getBody(),{style:m.attr("style")||"",dir:m.attr("dir")||"",vLink:m.attr("vlink")||"",link:m.attr("link")||"",aLink:m.attr("alink")||""}),g.remove("fullpage_styles");var y=e.getDoc().getElementsByTagName("head")[0];f&&(g.add(y,"style",{id:"fullpage_styles"},f),m=g.get("fullpage_styles"),m.styleSheet&&(m.styleSheet.cssText=f));var h={};tinymce.each(y.getElementsByTagName("link"),function(e){"stylesheet"==e.rel&&e.getAttribute("data-mce-fullpage")&&(h[e.href]=e)}),tinymce.each(o.getAll("link"),function(e){var t=e.attr("href");h[t]||"stylesheet"!=e.attr("rel")||g.add(y,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete h[t]}),tinymce.each(h,function(e){e.parentNode.removeChild(e)})}}function r(){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='<?xml version="1.0" encoding="'+e.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),n+=e.getParam("fullpage_default_doctype","<!DOCTYPE html>"),n+="\n<html>\n<head>\n",(t=e.getParam("fullpage_default_title"))&&(n+="<title>"+t+"</title>\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=e.getParam("fullpage_default_font_family"))&&(l+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="</head>\n<body"+(l?' style="'+l+'"':"")+">\n"}function o(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(d)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(c))}var d,c,s=tinymce.each,m=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",a),e.on("GetContent",o)});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js new file mode 100644 index 0000000..1bb1940 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,l=i.body;return l.offsetWidth&&(e=l.offsetWidth,t=l.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){d.setStyle(a,"height",t().h-(h.clientHeight-a.clientHeight))}var u,h,a,f,m=document.body,g=document.documentElement;s=!s,h=e.getContainer(),u=h.style,a=e.getContentAreaContainer().firstChild,f=a.style,s?(i=f.width,l=f.height,f.width=f.height="100%",c=u.width,o=u.height,u.width=u.height="",d.addClass(m,"mce-fullscreen"),d.addClass(g,"mce-fullscreen"),d.addClass(h,"mce-fullscreen"),d.bind(window,"resize",n),n(),r=n):(f.width=i,f.height=l,c&&(u.width=c),o&&(u.height=o),d.removeClass(m,"mce-fullscreen"),d.removeClass(g,"mce-fullscreen"),d.removeClass(h,"mce-fullscreen"),d.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:s})}var i,l,r,c,o,s=!1,d=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&d.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return s}})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/hr/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/hr/plugin.min.js new file mode 100644 index 0000000..e5ff6f3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/hr/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("hr",function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")}),n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/image/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/image/plugin.min.js new file mode 100644 index 0000000..14e5bbd --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/image/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("image",function(e){function t(e,t){function i(e,i){n.parentNode&&n.parentNode.removeChild(n),t({width:e,height:i})}var n=document.createElement("img");n.onload=function(){i(n.clientWidth,n.clientHeight)},n.onerror=function(){i()};var a=n.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(n),n.src=e}function i(e,t,i){function n(e,i){return i=i||[],tinymce.each(e,function(e){var a={text:e.text||e.title};e.menu?a.menu=n(e.menu):(a.value=e.value,t(a)),i.push(a)}),i}return n(e,i||[])}function n(t){return function(){var i=e.settings.image_list;"string"==typeof i?tinymce.util.XHR.send({url:i,success:function(e){t(tinymce.util.JSON.parse(e))}}):"function"==typeof i?i(t):t(i)}}function a(n){function a(){var e,t,i,n;e=c.find("#width")[0],t=c.find("#height")[0],e&&t&&(i=e.value(),n=t.value(),c.find("#constrain")[0].checked()&&d&&u&&i&&n&&(d!=i?(n=Math.round(i/d*n),t.value(n)):(i=Math.round(n/u*i),e.value(i))),d=i,u=n)}function l(){function t(t){function i(){t.onload=t.onerror=null,e.selection&&(e.selection.select(t),e.nodeChanged())}t.onload=function(){m.width||m.height||!y||p.setAttribs(t,{width:t.clientWidth,height:t.clientHeight}),i()},t.onerror=i}s(),a(),m=tinymce.extend(m,c.toJSON()),m.alt||(m.alt=""),""===m.width&&(m.width=null),""===m.height&&(m.height=null),m.style||(m.style=null),m={src:m.src,alt:m.alt,width:m.width,height:m.height,style:m.style,"class":m["class"]},e.undoManager.transact(function(){return m.src?(f?p.setAttribs(f,m):(m.id="__mcenew",e.focus(),e.selection.setContent(p.createHTML("img",m)),f=p.get("__mcenew"),p.setAttrib(f,"id",null)),void t(f)):void(f&&(p.remove(f),e.focus(),e.nodeChanged()))})}function o(e){return e&&(e=e.replace(/px$/,"")),e}function r(i){var n=i.meta||{};g&&g.value(e.convertURL(this.value(),"src")),tinymce.each(n,function(e,t){c.find("#"+t).value(e)}),n.width||n.height||t(this.value(),function(e){e.width&&e.height&&y&&(d=e.width,u=e.height,c.find("#width").value(d),c.find("#height").value(u))})}function s(){function t(e){return e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e}if(e.settings.image_advtab){var i=c.toJSON(),n=p.parseStyle(i.style);delete n.margin,n["margin-top"]=n["margin-bottom"]=t(i.vspace),n["margin-left"]=n["margin-right"]=t(i.hspace),n["border-width"]=t(i.border),c.find("#style").value(p.serializeStyle(p.parseStyle(p.serializeStyle(n))))}}var c,d,u,g,h,m={},p=e.dom,f=e.selection.getNode(),y=e.settings.image_dimensions!==!1;d=p.getAttrib(f,"width"),u=p.getAttrib(f,"height"),"IMG"!=f.nodeName||f.getAttribute("data-mce-object")||f.getAttribute("data-mce-placeholder")?f=null:m={src:p.getAttrib(f,"src"),alt:p.getAttrib(f,"alt"),"class":p.getAttrib(f,"class"),width:d,height:u},n&&(g={type:"listbox",label:"Image list",values:i(n,function(t){t.value=e.convertURL(t.value||t.url,"src")},[{text:"None",value:""}]),value:m.src&&e.convertURL(m.src,"src"),onselect:function(e){var t=c.find("#alt");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),c.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){g=this}}),e.settings.image_class_list&&(h={name:"class",type:"listbox",label:"Class",values:i(e.settings.image_class_list,function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[t.value]})})})});var b=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:r},g];e.settings.image_description!==!1&&b.push({name:"alt",type:"textbox",label:"Image description"}),y&&b.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:a,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:a,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),b.push(h),e.settings.image_advtab?(f&&(m.hspace=o(f.style.marginLeft||f.style.marginRight),m.vspace=o(f.style.marginTop||f.style.marginBottom),m.border=o(f.style.borderWidth),m.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(f,"style")))),c=e.windowManager.open({title:"Insert/edit image",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:b},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:s},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:l})):c=e.windowManager.open({title:"Insert/edit image",data:m,body:b,onSubmit:l})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(a),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(a),context:"insert",prependToContext:!0}),e.addCommand("mceImage",n(a))});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/importcss/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/importcss/plugin.min.js new file mode 100644 index 0000000..5dd1d44 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/importcss/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("importcss",function(t){function e(t){return"string"==typeof t?function(e){return-1!==e.indexOf(t)}:t instanceof RegExp?function(e){return t.test(e)}:t}function n(e,n){function i(t,e){var c,o=t.href;if(o&&n(o,e)){s(t.imports,function(t){i(t,!0)});try{c=t.cssRules||t.rules}catch(a){}s(c,function(t){t.styleSheet?i(t.styleSheet,!0):t.selectorText&&s(t.selectorText.split(","),function(t){r.push(tinymce.trim(t))})})}}var r=[],c={};s(t.contentCSS,function(t){c[t]=!0}),n||(n=function(t,e){return e||c[t]});try{s(e.styleSheets,function(t){i(t)})}catch(o){}return r}function i(e){var n,i=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(i){var r=i[1],s=i[2].substr(1).split(".").join(" "),c=tinymce.makeMap("a,img");return i[1]?(n={title:e},t.schema.getTextBlockElements()[r]?n.block=r:t.schema.getBlockElements()[r]||c[r.toLowerCase()]?n.selector=r:n.inline=r):i[2]&&(n={inline:"span",title:e.substr(1),classes:s}),t.settings.importcss_merge_classes!==!1?n.classes=s:n.attributes={"class":s},n}}var r=this,s=tinymce.each;t.on("renderFormatsMenu",function(c){var o=t.settings,a={},l=o.importcss_selector_converter||i,f=e(o.importcss_selector_filter),m=c.control;t.settings.importcss_append||m.items().remove();var u=[];tinymce.each(o.importcss_groups,function(t){t=tinymce.extend({},t),t.filter=e(t.filter),u.push(t)}),s(n(c.doc||t.getDoc(),e(o.importcss_file_filter)),function(e){if(-1===e.indexOf(".mce-")&&!a[e]&&(!f||f(e))){var n,i=l.call(r,e);if(i){var s=i.name||tinymce.DOM.uniqueId();if(u)for(var c=0;c<u.length;c++)if(!u[c].filter||u[c].filter(e)){u[c].item||(u[c].item={text:u[c].title,menu:[]}),n=u[c].item.menu;break}t.formatter.register(s,i);var o=tinymce.extend({},m.settings.itemDefaults,{text:i.title,format:s});n?n.push(o):m.add(o)}a[e]=!0}}),s(u,function(t){m.add(t.item)}),c.control.renderNew()}),r.convertSelectorToFormat=i});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js new file mode 100644 index 0000000..6b17008 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("insertdatetime",function(e){function t(t,a){function n(e,t){if(e=""+e,e.length<t)for(var a=0;a<t-e.length;a++)e="0"+e;return e}return a=a||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+a.getFullYear()),t=t.replace("%y",""+a.getYear()),t=t.replace("%m",n(a.getMonth()+1,2)),t=t.replace("%d",n(a.getDate(),2)),t=t.replace("%H",""+n(a.getHours(),2)),t=t.replace("%M",""+n(a.getMinutes(),2)),t=t.replace("%S",""+n(a.getSeconds(),2)),t=t.replace("%I",""+((a.getHours()+11)%12+1)),t=t.replace("%p",""+(a.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(m[a.getMonth()])),t=t.replace("%b",""+e.translate(c[a.getMonth()])),t=t.replace("%A",""+e.translate(d[a.getDay()])),t=t.replace("%a",""+e.translate(i[a.getDay()])),t=t.replace("%%","%")}function a(a){var n=t(a);if(e.settings.insertdatetime_element){var r;r=t(/%[HMSIp]/.test(a)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),n='<time datetime="'+r+'">'+n+"</time>";var i=e.dom.getParent(e.selection.getStart(),"time");if(i)return void e.dom.setOuterHTML(i,n)}e.insertContent(n)}var n,r,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),u=[];e.addCommand("mceInsertDate",function(){a(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){a(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){a(n||r)},menu:u}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){r||(r=e),u.push({text:t(e),onclick:function(){n=e,a(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:u,context:"insert"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/.htaccess b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/.htaccess new file mode 100644 index 0000000..14249c5 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/.htaccess @@ -0,0 +1 @@ +Deny from all
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/autoload.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/autoload.php new file mode 100644 index 0000000..53129c9 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/autoload.php @@ -0,0 +1,116 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| AUTO-LOADER +| ------------------------------------------------------------------- +| This file specifies which systems should be loaded by default. +| +| In order to keep the framework as light-weight as possible only the +| absolute minimal resources are loaded by default. For example, +| the database is not connected to automatically since no assumption +| is made regarding whether you intend to use it. This file lets +| you globally define which systems you would like loaded with every +| request. +| +| ------------------------------------------------------------------- +| Instructions +| ------------------------------------------------------------------- +| +| These are the things you can load automatically: +| +| 1. Packages +| 2. Libraries +| 3. Helper files +| 4. Custom config files +| 5. Language files +| 6. Models +| +*/ + +/* +| ------------------------------------------------------------------- +| Auto-load Packges +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared'); +| +*/ + +$autoload['packages'] = array(); + + +/* +| ------------------------------------------------------------------- +| Auto-load Libraries +| ------------------------------------------------------------------- +| These are the classes located in the system/libraries folder +| or in your application/libraries folder. +| +| Prototype: +| +| $autoload['libraries'] = array('database', 'session', 'xmlrpc'); +*/ + +$autoload['libraries'] = array(); + + +/* +| ------------------------------------------------------------------- +| Auto-load Helper Files +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['helper'] = array('url', 'file'); +*/ + +$autoload['helper'] = array(); + + +/* +| ------------------------------------------------------------------- +| Auto-load Config files +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['config'] = array('config1', 'config2'); +| +| NOTE: This item is intended for use ONLY if you have created custom +| config files. Otherwise, leave it blank. +| +*/ + +$autoload['config'] = array(); + + +/* +| ------------------------------------------------------------------- +| Auto-load Language files +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['language'] = array('lang1', 'lang2'); +| +| NOTE: Do not include the "_lang" part of your file. For example +| "codeigniter_lang.php" would be referenced as array('codeigniter'); +| +*/ + +$autoload['language'] = array(); + + +/* +| ------------------------------------------------------------------- +| Auto-load Models +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['model'] = array('model1', 'model2'); +| +*/ + +$autoload['model'] = array(); + + +/* End of file autoload.php */ +/* Location: ./application/config/autoload.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/config.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/config.php new file mode 100644 index 0000000..1ec6543 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/config.php @@ -0,0 +1,362 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +/* +|-------------------------------------------------------------------------- +| Base Site URL +|-------------------------------------------------------------------------- +| +| URL to your CodeIgniter root. Typically this will be your base URL, +| WITH a trailing slash: +| +| http://example.com/ +| +| If this is not set then CodeIgniter will guess the protocol, domain and +| path to your installation. +| +*/ +$config['base_url'] = ''; + +/* +|-------------------------------------------------------------------------- +| Index File +|-------------------------------------------------------------------------- +| +| Typically this will be your index.php file, unless you've renamed it to +| something else. If you are using mod_rewrite to remove the page set this +| variable so that it is blank. +| +*/ +$config['index_page'] = 'index.php'; + +/* +|-------------------------------------------------------------------------- +| URI PROTOCOL +|-------------------------------------------------------------------------- +| +| This item determines which server global should be used to retrieve the +| URI string. The default setting of 'AUTO' works for most servers. +| If your links do not seem to work, try one of the other delicious flavors: +| +| 'AUTO' Default - auto detects +| 'PATH_INFO' Uses the PATH_INFO +| 'QUERY_STRING' Uses the QUERY_STRING +| 'REQUEST_URI' Uses the REQUEST_URI +| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO +| +*/ +$config['uri_protocol'] = 'AUTO'; + +/* +|-------------------------------------------------------------------------- +| URL suffix +|-------------------------------------------------------------------------- +| +| This option allows you to add a suffix to all URLs generated by CodeIgniter. +| For more information please see the user guide: +| +| http://codeigniter.com/user_guide/general/urls.html +*/ + +$config['url_suffix'] = ''; + +/* +|-------------------------------------------------------------------------- +| Default Language +|-------------------------------------------------------------------------- +| +| This determines which set of language files should be used. Make sure +| there is an available translation if you intend to use something other +| than english. +| +*/ +$config['language'] = 'english'; + +/* +|-------------------------------------------------------------------------- +| Default Character Set +|-------------------------------------------------------------------------- +| +| This determines which character set is used by default in various methods +| that require a character set to be provided. +| +*/ +$config['charset'] = 'UTF-8'; + +/* +|-------------------------------------------------------------------------- +| Enable/Disable System Hooks +|-------------------------------------------------------------------------- +| +| If you would like to use the 'hooks' feature you must enable it by +| setting this variable to TRUE (boolean). See the user guide for details. +| +*/ +$config['enable_hooks'] = FALSE; + + +/* +|-------------------------------------------------------------------------- +| Class Extension Prefix +|-------------------------------------------------------------------------- +| +| This item allows you to set the filename/classname prefix when extending +| native libraries. For more information please see the user guide: +| +| http://codeigniter.com/user_guide/general/core_classes.html +| http://codeigniter.com/user_guide/general/creating_libraries.html +| +*/ +$config['subclass_prefix'] = 'MY_'; + + +/* +|-------------------------------------------------------------------------- +| Allowed URL Characters +|-------------------------------------------------------------------------- +| +| This lets you specify with a regular expression which characters are permitted +| within your URLs. When someone tries to submit a URL with disallowed +| characters they will get a warning message. +| +| As a security measure you are STRONGLY encouraged to restrict URLs to +| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- +| +| Leave blank to allow all characters -- but only if you are insane. +| +| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! +| +*/ +$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; + + +/* +|-------------------------------------------------------------------------- +| Enable Query Strings +|-------------------------------------------------------------------------- +| +| By default CodeIgniter uses search-engine friendly segment based URLs: +| example.com/who/what/where/ +| +| By default CodeIgniter enables access to the $_GET array. If for some +| reason you would like to disable it, set 'allow_get_array' to FALSE. +| +| You can optionally enable standard query string based URLs: +| example.com?who=me&what=something&where=here +| +| Options are: TRUE or FALSE (boolean) +| +| The other items let you set the query string 'words' that will +| invoke your controllers and its functions: +| example.com/index.php?c=controller&m=function +| +| Please note that some of the helpers won't work as expected when +| this feature is enabled, since CodeIgniter is designed primarily to +| use segment based URLs. +| +*/ +$config['allow_get_array'] = TRUE; +$config['enable_query_strings'] = FALSE; +$config['controller_trigger'] = 'c'; +$config['function_trigger'] = 'm'; +$config['directory_trigger'] = 'd'; // experimental not currently in use + +/* +|-------------------------------------------------------------------------- +| Error Logging Threshold +|-------------------------------------------------------------------------- +| +| If you have enabled error logging, you can set an error threshold to +| determine what gets logged. Threshold options are: +| You can enable error logging by setting a threshold over zero. The +| threshold determines what gets logged. Threshold options are: +| +| 0 = Disables logging, Error logging TURNED OFF +| 1 = Error Messages (including PHP errors) +| 2 = Debug Messages +| 3 = Informational Messages +| 4 = All Messages +| +| For a live site you'll usually only enable Errors (1) to be logged otherwise +| your log files will fill up very fast. +| +*/ +$config['log_threshold'] = 0; + +/* +|-------------------------------------------------------------------------- +| Error Logging Directory Path +|-------------------------------------------------------------------------- +| +| Leave this BLANK unless you would like to set something other than the default +| application/logs/ folder. Use a full server path with trailing slash. +| +*/ +$config['log_path'] = ''; + +/* +|-------------------------------------------------------------------------- +| Date Format for Logs +|-------------------------------------------------------------------------- +| +| Each item that is logged has an associated date. You can use PHP date +| codes to set your own date formatting +| +*/ +$config['log_date_format'] = 'Y-m-d H:i:s'; + +/* +|-------------------------------------------------------------------------- +| Cache Directory Path +|-------------------------------------------------------------------------- +| +| Leave this BLANK unless you would like to set something other than the default +| system/cache/ folder. Use a full server path with trailing slash. +| +*/ +$config['cache_path'] = ''; + +/* +|-------------------------------------------------------------------------- +| Encryption Key +|-------------------------------------------------------------------------- +| +| If you use the Encryption class or the Session class you +| MUST set an encryption key. See the user guide for info. +| +*/ +$config['encryption_key'] = ''; + +/* +|-------------------------------------------------------------------------- +| Session Variables +|-------------------------------------------------------------------------- +| +| 'sess_cookie_name' = the name you want for the cookie +| 'sess_expiration' = the number of SECONDS you want the session to last. +| by default sessions last 7200 seconds (two hours). Set to zero for no expiration. +| 'sess_expire_on_close' = Whether to cause the session to expire automatically +| when the browser window is closed +| 'sess_encrypt_cookie' = Whether to encrypt the cookie +| 'sess_use_database' = Whether to save the session data to a database +| 'sess_table_name' = The name of the session database table +| 'sess_match_ip' = Whether to match the user's IP address when reading the session data +| 'sess_match_useragent' = Whether to match the User Agent when reading the session data +| 'sess_time_to_update' = how many seconds between CI refreshing Session Information +| +*/ +$config['sess_cookie_name'] = 'ci_session'; +$config['sess_expiration'] = 7200; +$config['sess_expire_on_close'] = FALSE; +$config['sess_encrypt_cookie'] = FALSE; +$config['sess_use_database'] = FALSE; +$config['sess_table_name'] = 'ci_sessions'; +$config['sess_match_ip'] = FALSE; +$config['sess_match_useragent'] = TRUE; +$config['sess_time_to_update'] = 300; + +/* +|-------------------------------------------------------------------------- +| Cookie Related Variables +|-------------------------------------------------------------------------- +| +| 'cookie_prefix' = Set a prefix if you need to avoid collisions +| 'cookie_domain' = Set to .your-domain.com for site-wide cookies +| 'cookie_path' = Typically will be a forward slash +| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists. +| +*/ +$config['cookie_prefix'] = ""; +$config['cookie_domain'] = ""; +$config['cookie_path'] = "/"; +$config['cookie_secure'] = FALSE; + +/* +|-------------------------------------------------------------------------- +| Global XSS Filtering +|-------------------------------------------------------------------------- +| +| Determines whether the XSS filter is always active when GET, POST or +| COOKIE data is encountered +| +*/ +$config['global_xss_filtering'] = FALSE; + +/* +|-------------------------------------------------------------------------- +| Cross Site Request Forgery +|-------------------------------------------------------------------------- +| Enables a CSRF cookie token to be set. When set to TRUE, token will be +| checked on a submitted form. If you are accepting user data, it is strongly +| recommended CSRF protection be enabled. +| +| 'csrf_token_name' = The token name +| 'csrf_cookie_name' = The cookie name +| 'csrf_expire' = The number in seconds the token should expire. +*/ +$config['csrf_protection'] = FALSE; +$config['csrf_token_name'] = 'csrf_test_name'; +$config['csrf_cookie_name'] = 'csrf_cookie_name'; +$config['csrf_expire'] = 7200; + +/* +|-------------------------------------------------------------------------- +| Output Compression +|-------------------------------------------------------------------------- +| +| Enables Gzip output compression for faster page loads. When enabled, +| the output class will test whether your server supports Gzip. +| Even if it does, however, not all browsers support compression +| so enable only if you are reasonably sure your visitors can handle it. +| +| VERY IMPORTANT: If you are getting a blank page when compression is enabled it +| means you are prematurely outputting something to your browser. It could +| even be a line of whitespace at the end of one of your scripts. For +| compression to work, nothing can be sent before the output buffer is called +| by the output class. Do not 'echo' any values with compression enabled. +| +*/ +$config['compress_output'] = FALSE; + +/* +|-------------------------------------------------------------------------- +| Master Time Reference +|-------------------------------------------------------------------------- +| +| Options are 'local' or 'gmt'. This pref tells the system whether to use +| your server's local time as the master 'now' reference, or convert it to +| GMT. See the 'date helper' page of the user guide for information +| regarding date handling. +| +*/ +$config['time_reference'] = 'local'; + + +/* +|-------------------------------------------------------------------------- +| Rewrite PHP Short Tags +|-------------------------------------------------------------------------- +| +| If your PHP installation does not have short tag support enabled CI +| can rewrite the tags on-the-fly, enabling you to utilize that syntax +| in your view files. Options are TRUE or FALSE (boolean) +| +*/ +$config['rewrite_short_tags'] = FALSE; + + +/* +|-------------------------------------------------------------------------- +| Reverse Proxy IPs +|-------------------------------------------------------------------------- +| +| If your server is behind a reverse proxy, you must whitelist the proxy IP +| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR +| header in order to properly identify the visitor's IP address. +| Comma-delimited, e.g. '10.0.1.200,10.0.1.201' +| +*/ +$config['proxy_ips'] = ''; + + +/* End of file config.php */ +/* Location: ./application/config/config.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/constants.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/constants.php new file mode 100644 index 0000000..4a879d3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/constants.php @@ -0,0 +1,41 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +/* +|-------------------------------------------------------------------------- +| File and Directory Modes +|-------------------------------------------------------------------------- +| +| These prefs are used when checking and setting modes when working +| with the file system. The defaults are fine on servers with proper +| security, but you may wish (or even need) to change the values in +| certain environments (Apache running a separate process for each +| user, PHP under CGI with Apache suEXEC, etc.). Octal values should +| always be used to set the mode correctly. +| +*/ +define('FILE_READ_MODE', 0644); +define('FILE_WRITE_MODE', 0666); +define('DIR_READ_MODE', 0755); +define('DIR_WRITE_MODE', 0777); + +/* +|-------------------------------------------------------------------------- +| File Stream Modes +|-------------------------------------------------------------------------- +| +| These modes are used when working with fopen()/popen() +| +*/ + +define('FOPEN_READ', 'rb'); +define('FOPEN_READ_WRITE', 'r+b'); +define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care +define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care +define('FOPEN_WRITE_CREATE', 'ab'); +define('FOPEN_READ_WRITE_CREATE', 'a+b'); +define('FOPEN_WRITE_CREATE_STRICT', 'xb'); +define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); + + +/* End of file constants.php */ +/* Location: ./application/config/constants.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/database.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/database.php new file mode 100644 index 0000000..b4b34bf --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/database.php @@ -0,0 +1,69 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| DATABASE CONNECTIVITY SETTINGS +| ------------------------------------------------------------------- +| This file will contain the settings needed to access your database. +| +| For complete instructions please consult the 'Database Connection' +| page of the User Guide. +| +| ------------------------------------------------------------------- +| EXPLANATION OF VARIABLES +| ------------------------------------------------------------------- +| +| ['hostname'] The hostname of your database server. +| ['username'] The username used to connect to the database +| ['password'] The password used to connect to the database +| ['database'] The name of the database you want to connect to +| ['dbdriver'] The database type. ie: mysql. Currently supported: + mysql, mysqli, postgre, odbc, mssql, sqlite, oci8 +| ['dbprefix'] You can add an optional prefix, which will be added +| to the table name when using the Active Record class +| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection +| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. +| ['cache_on'] TRUE/FALSE - Enables/disables query caching +| ['cachedir'] The path to the folder where cache files should be stored +| ['char_set'] The character set used in communicating with the database +| ['dbcollat'] The character collation used in communicating with the database +| NOTE: For MySQL and MySQLi databases, this setting is only used +| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 +| (and in table creation queries made with DB Forge). +| There is an incompatibility in PHP with mysql_real_escape_string() which +| can make your site vulnerable to SQL injection if you are using a +| multi-byte character set and are running versions lower than these. +| Sites using Latin-1 or UTF-8 database character set and collation are unaffected. +| ['swap_pre'] A default table prefix that should be swapped with the dbprefix +| ['autoinit'] Whether or not to automatically initialize the database. +| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections +| - good for ensuring strict SQL while developing +| +| The $active_group variable lets you choose which connection group to +| make active. By default there is only one group (the 'default' group). +| +| The $active_record variables lets you determine whether or not to load +| the active record class +*/ + +$active_group = 'default'; +$active_record = TRUE; + +$db['default']['hostname'] = 'localhost'; +$db['default']['username'] = ''; +$db['default']['password'] = ''; +$db['default']['database'] = ''; +$db['default']['dbdriver'] = 'mysql'; +$db['default']['dbprefix'] = ''; +$db['default']['pconnect'] = TRUE; +$db['default']['db_debug'] = TRUE; +$db['default']['cache_on'] = FALSE; +$db['default']['cachedir'] = ''; +$db['default']['char_set'] = 'utf8'; +$db['default']['dbcollat'] = 'utf8_general_ci'; +$db['default']['swap_pre'] = ''; +$db['default']['autoinit'] = TRUE; +$db['default']['stricton'] = FALSE; + + +/* End of file database.php */ +/* Location: ./application/config/database.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/doctypes.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/doctypes.php new file mode 100644 index 0000000..f7e1d19 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/doctypes.php @@ -0,0 +1,15 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +$_doctypes = array( + 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', + 'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', + 'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', + 'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', + 'html5' => '<!DOCTYPE html>', + 'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', + 'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', + 'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">' + ); + +/* End of file doctypes.php */ +/* Location: ./application/config/doctypes.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/foreign_chars.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/foreign_chars.php new file mode 100644 index 0000000..14b0d73 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/foreign_chars.php @@ -0,0 +1,64 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| Foreign Characters +| ------------------------------------------------------------------- +| This file contains an array of foreign characters for transliteration +| conversion used by the Text helper +| +*/ +$foreign_characters = array( + '/ä|æ|ǽ/' => 'ae', + '/ö|Å“/' => 'oe', + '/ü/' => 'ue', + '/Ä/' => 'Ae', + '/Ü/' => 'Ue', + '/Ö/' => 'Oe', + '/À|Ã|Â|Ã|Ä|Ã…|Ǻ|Ä€|Ä‚|Ä„|Ç/' => 'A', + '/à |á|â|ã|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', + '/Ç|Ć|Ĉ|ÄŠ|ÄŒ/' => 'C', + '/ç|ć|ĉ|Ä‹|Ä/' => 'c', + '/Ã|ÄŽ|Ä/' => 'D', + '/ð|Ä|Ä‘/' => 'd', + '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', + '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›/' => 'e', + '/Äœ|Äž|Ä |Ä¢/' => 'G', + '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', + '/Ĥ|Ħ/' => 'H', + '/Ä¥|ħ/' => 'h', + '/ÃŒ|Ã|ÃŽ|Ã|Ĩ|Ī|Ĭ|Ç|Ä®|İ/' => 'I', + '/ì|Ã|î|ï|Ä©|Ä«|Ä|Ç|į|ı/' => 'i', + '/Ä´/' => 'J', + '/ĵ/' => 'j', + '/Ķ/' => 'K', + '/Ä·/' => 'k', + '/Ĺ|Ä»|Ľ|Ä¿|Å/' => 'L', + '/ĺ|ļ|ľ|Å€|Å‚/' => 'l', + '/Ñ|Ń|Å…|Ň/' => 'N', + '/ñ|Å„|ņ|ň|ʼn/' => 'n', + '/Ã’|Ó|Ô|Õ|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', + '/ò|ó|ô|õ|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', + '/Å”|Å–|Ř/' => 'R', + '/Å•|Å—|Å™/' => 'r', + '/Åš|Åœ|Åž|Å /' => 'S', + '/Å›|Å|ÅŸ|Å¡|Å¿/' => 's', + '/Å¢|Ť|Ŧ/' => 'T', + '/Å£|Å¥|ŧ/' => 't', + '/Ù|Ú|Û|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', + '/ù|ú|û|Å©|Å«|Å|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', + '/Ã|Ÿ|Ŷ/' => 'Y', + '/ý|ÿ|Å·/' => 'y', + '/Å´/' => 'W', + '/ŵ/' => 'w', + '/Ź|Å»|Ž/' => 'Z', + '/ź|ż|ž/' => 'z', + '/Æ|Ǽ/' => 'AE', + '/ß/'=> 'ss', + '/IJ/' => 'IJ', + '/ij/' => 'ij', + '/Å’/' => 'OE', + '/Æ’/' => 'f' +); + +/* End of file foreign_chars.php */ +/* Location: ./application/config/foreign_chars.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/hooks.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/hooks.php new file mode 100644 index 0000000..a4ad2be --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/hooks.php @@ -0,0 +1,16 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------------- +| Hooks +| ------------------------------------------------------------------------- +| This file lets you define "hooks" to extend CI without hacking the core +| files. Please see the user guide for info: +| +| http://codeigniter.com/user_guide/general/hooks.html +| +*/ + + + +/* End of file hooks.php */ +/* Location: ./application/config/hooks.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/migration.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/migration.php new file mode 100644 index 0000000..df42a3c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/migration.php @@ -0,0 +1,41 @@ +<?php defined('BASEPATH') OR exit('No direct script access allowed'); +/* +|-------------------------------------------------------------------------- +| Enable/Disable Migrations +|-------------------------------------------------------------------------- +| +| Migrations are disabled by default but should be enabled +| whenever you intend to do a schema migration. +| +*/ +$config['migration_enabled'] = FALSE; + + +/* +|-------------------------------------------------------------------------- +| Migrations version +|-------------------------------------------------------------------------- +| +| This is used to set migration version that the file system should be on. +| If you run $this->migration->latest() this is the version that schema will +| be upgraded / downgraded to. +| +*/ +$config['migration_version'] = 0; + + +/* +|-------------------------------------------------------------------------- +| Migrations Path +|-------------------------------------------------------------------------- +| +| Path to your migrations folder. +| Typically, it will be within your application path. +| Also, writing permission is required within the migrations path. +| +*/ +$config['migration_path'] = APPPATH . 'migrations/'; + + +/* End of file migration.php */ +/* Location: ./application/config/migration.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/mimes.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/mimes.php new file mode 100644 index 0000000..100f7d4 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/mimes.php @@ -0,0 +1,106 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| MIME TYPES +| ------------------------------------------------------------------- +| This file contains an array of mime types. It is used by the +| Upload class to help identify allowed file types. +| +*/ + +$mimes = array( 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => array('application/octet-stream', 'application/x-msdownload'), + 'class' => 'application/octet-stream', + 'psd' => 'application/x-photoshop', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => array('application/pdf', 'application/x-download'), + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), + 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'), + 'bmp' => array('image/bmp', 'image/x-windows-bmp'), + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => array('text/plain', 'text/x-log'), + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'), + 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'), + 'word' => array('application/msword', 'application/octet-stream'), + 'xl' => 'application/excel', + 'eml' => 'message/rfc822', + 'json' => array('application/json', 'text/json') + ); + + +/* End of file mimes.php */ +/* Location: ./application/config/mimes.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/profiler.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/profiler.php new file mode 100644 index 0000000..f8a5b1a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/profiler.php @@ -0,0 +1,17 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------------- +| Profiler Sections +| ------------------------------------------------------------------------- +| This file lets you determine whether or not various sections of Profiler +| data are displayed when the Profiler is enabled. +| Please see the user guide for info: +| +| http://codeigniter.com/user_guide/general/profiling.html +| +*/ + + + +/* End of file profiler.php */ +/* Location: ./application/config/profiler.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/routes.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/routes.php new file mode 100644 index 0000000..c75d0ae --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/routes.php @@ -0,0 +1,48 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------------- +| URI ROUTING +| ------------------------------------------------------------------------- +| This file lets you re-map URI requests to specific controller functions. +| +| Typically there is a one-to-one relationship between a URL string +| and its corresponding controller class/method. The segments in a +| URL normally follow this pattern: +| +| example.com/class/method/id/ +| +| In some instances, however, you may want to remap this relationship +| so that a different class/function is called than the one +| corresponding to the URL. +| +| Please see the user guide for complete details: +| +| http://codeigniter.com/user_guide/general/routing.html +| +| ------------------------------------------------------------------------- +| RESERVED ROUTES +| ------------------------------------------------------------------------- +| +| There area two reserved routes: +| +| $route['default_controller'] = 'welcome'; +| +| This route indicates which controller class should be loaded if the +| URI contains no data. In the above example, the "welcome" class +| would be loaded. +| +| $route['404_override'] = 'errors/page_missing'; +| +| This route will tell the Router what URI segments to use if those provided +| in the URL cannot be matched to a valid route. +| +*/ + +$route['default_controller'] = "uploader"; +$route['404_override'] = ''; + +$route['(:any)'] = "uploader/$1"; + + +/* End of file routes.php */ +/* Location: ./application/config/routes.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/smileys.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/smileys.php new file mode 100644 index 0000000..25d28b2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/smileys.php @@ -0,0 +1,66 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| SMILEYS +| ------------------------------------------------------------------- +| This file contains an array of smileys for use with the emoticon helper. +| Individual images can be used to replace multiple simileys. For example: +| :-) and :) use the same image replacement. +| +| Please see user guide for more info: +| http://codeigniter.com/user_guide/helpers/smiley_helper.html +| +*/ + +$smileys = array( + +// smiley image name width height alt + + ':-)' => array('grin.gif', '19', '19', 'grin'), + ':lol:' => array('lol.gif', '19', '19', 'LOL'), + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), + ':)' => array('smile.gif', '19', '19', 'smile'), + ';-)' => array('wink.gif', '19', '19', 'wink'), + ';)' => array('wink.gif', '19', '19', 'wink'), + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), + ':-S' => array('confused.gif', '19', '19', 'confused'), + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), + ':long:' => array('longface.gif', '19', '19', 'long face'), + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), + ':down:' => array('downer.gif', '19', '19', 'downer'), + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), + ':sick:' => array('sick.gif', '19', '19', 'sick'), + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), + '>:(' => array('mad.gif', '19', '19', 'mad'), + ':mad:' => array('mad.gif', '19', '19', 'mad'), + '>:-(' => array('angry.gif', '19', '19', 'angry'), + ':angry:' => array('angry.gif', '19', '19', 'angry'), + ':zip:' => array('zip.gif', '19', '19', 'zipper'), + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), + ':snake:' => array('snake.gif', '19', '19', 'snake'), + ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), + ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item + + ); + +/* End of file smileys.php */ +/* Location: ./application/config/smileys.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/uploader_settings.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/uploader_settings.php new file mode 100644 index 0000000..cb0720c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/uploader_settings.php @@ -0,0 +1,10 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +/* This config is a wrapper for the file below: */ + +require('../config.php'); + + + +/* End of file uploader_settings.php */ +/* Location: ./system/application/config/uploader_settings.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/user_agents.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/user_agents.php new file mode 100644 index 0000000..e2d3c3a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/config/user_agents.php @@ -0,0 +1,178 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/* +| ------------------------------------------------------------------- +| USER AGENT TYPES +| ------------------------------------------------------------------- +| This file contains four arrays of user agent data. It is used by the +| User Agent Class to help identify browser, platform, robot, and +| mobile device data. The array keys are used to identify the device +| and the array values are used to set the actual name of the item. +| +*/ + +$platforms = array ( + 'windows nt 6.0' => 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 4.0' => 'Windows NT 4.0', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + 'unix' => 'Unknown Unix OS' + ); + + +// The order of this array should NOT be changed. Many browsers return +// multiple browser types so we want to identify the sub-type first. +$browsers = array( + 'Flock' => 'Flock', + 'Chrome' => 'Chrome', + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', + 'Internet Explorer' => 'Internet Explorer', + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Safari' => 'Safari', + 'Mozilla' => 'Mozilla', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' + ); + +$mobiles = array( + // legacy array, old values commented out + 'mobileexplorer' => 'Mobile Explorer', +// 'openwave' => 'Open Wave', +// 'opera mini' => 'Opera Mini', +// 'operamini' => 'Opera Mini', +// 'elaine' => 'Palm', + 'palmsource' => 'Palm', +// 'digital paths' => 'Palm', +// 'avantgo' => 'Avantgo', +// 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', +// 'nokia' => 'Nokia', +// 'ericsson' => 'Ericsson', +// 'blackberry' => 'BlackBerry', +// 'motorola' => 'Motorola' + + // Phones and Manufacturers + 'motorola' => "Motorola", + 'nokia' => "Nokia", + 'palm' => "Palm", + 'iphone' => "Apple iPhone", + 'ipad' => "iPad", + 'ipod' => "Apple iPod Touch", + 'sony' => "Sony Ericsson", + 'ericsson' => "Sony Ericsson", + 'blackberry' => "BlackBerry", + 'cocoon' => "O2 Cocoon", + 'blazer' => "Treo", + 'lg' => "LG", + 'amoi' => "Amoi", + 'xda' => "XDA", + 'mda' => "MDA", + 'vario' => "Vario", + 'htc' => "HTC", + 'samsung' => "Samsung", + 'sharp' => "Sharp", + 'sie-' => "Siemens", + 'alcatel' => "Alcatel", + 'benq' => "BenQ", + 'ipaq' => "HP iPaq", + 'mot-' => "Motorola", + 'playstation portable' => "PlayStation Portable", + 'hiptop' => "Danger Hiptop", + 'nec-' => "NEC", + 'panasonic' => "Panasonic", + 'philips' => "Philips", + 'sagem' => "Sagem", + 'sanyo' => "Sanyo", + 'spv' => "SPV", + 'zte' => "ZTE", + 'sendo' => "Sendo", + + // Operating Systems + 'symbian' => "Symbian", + 'SymbianOS' => "SymbianOS", + 'elaine' => "Palm", + 'palm' => "Palm", + 'series60' => "Symbian S60", + 'windows ce' => "Windows CE", + + // Browsers + 'obigo' => "Obigo", + 'netfront' => "Netfront Browser", + 'openwave' => "Openwave Browser", + 'mobilexplorer' => "Mobile Explorer", + 'operamini' => "Opera Mini", + 'opera mini' => "Opera Mini", + + // Other + 'digital paths' => "Digital Paths", + 'avantgo' => "AvantGo", + 'xiino' => "Xiino", + 'novarra' => "Novarra Transcoder", + 'vodafone' => "Vodafone", + 'docomo' => "NTT DoCoMo", + 'o2' => "O2", + + // Fallback + 'mobile' => "Generic Mobile", + 'wireless' => "Generic Mobile", + 'j2me' => "Generic Mobile", + 'midp' => "Generic Mobile", + 'cldc' => "Generic Mobile", + 'up.link' => "Generic Mobile", + 'up.browser' => "Generic Mobile", + 'smartphone' => "Generic Mobile", + 'cellphone' => "Generic Mobile" + ); + +// There are hundreds of bots but these are the most common. +$robots = array( + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos' + ); + +/* End of file user_agents.php */ +/* Location: ./application/config/user_agents.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/uploader.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/uploader.php new file mode 100644 index 0000000..25ccad5 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/controllers/uploader.php @@ -0,0 +1,130 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +class Uploader extends CI_Controller { + + /* Constructor */ + + public function __construct() + { + parent::__construct(); + $this->load->helper(array('jbimages','language')); + + // is_allowed is a helper function which is supposed to return False if upload operation is forbidden + // [See jbimages/is_alllowed.php] + + if (is_allowed() === FALSE) + { + exit; + } + + // User configured settings + $this->config->load('uploader_settings', TRUE); + } + + /* Language set */ + + private function _lang_set($lang) + { + // We accept any language set as lang_id in **_dlg.js + // Therefore an error will occur if language file doesn't exist + + $this->config->set_item('language', $lang); + $this->lang->load('jbstrings', $lang); + } + + /* Default upload routine */ + + public function upload ($lang='english') + { + // Set language + $this->_lang_set($lang); + + // Get configuartion data (we fill up 2 arrays - $config and $conf) + + $conf['img_path'] = $this->config->item('img_path', 'uploader_settings'); + $conf['allow_resize'] = $this->config->item('allow_resize', 'uploader_settings'); + + $config['allowed_types'] = $this->config->item('allowed_types', 'uploader_settings'); + $config['max_size'] = $this->config->item('max_size', 'uploader_settings'); + $config['encrypt_name'] = $this->config->item('encrypt_name', 'uploader_settings'); + $config['overwrite'] = $this->config->item('overwrite', 'uploader_settings'); + $config['upload_path'] = $this->config->item('upload_path', 'uploader_settings'); + + if (!$conf['allow_resize']) + { + $config['max_width'] = $this->config->item('max_width', 'uploader_settings'); + $config['max_height'] = $this->config->item('max_height', 'uploader_settings'); + } + else + { + $conf['max_width'] = $this->config->item('max_width', 'uploader_settings'); + $conf['max_height'] = $this->config->item('max_height', 'uploader_settings'); + + if ($conf['max_width'] == 0 and $conf['max_height'] == 0) + { + $conf['allow_resize'] = FALSE; + } + } + + // Load uploader + $this->load->library('upload', $config); + + if ($this->upload->do_upload()) // Success + { + // General result data + $result = $this->upload->data(); + + // Shall we resize an image? + if ($conf['allow_resize'] and $conf['max_width'] > 0 and $conf['max_height'] > 0 and (($result['image_width'] > $conf['max_width']) or ($result['image_height'] > $conf['max_height']))) + { + // Resizing parameters + $resizeParams = array + ( + 'source_image' => $result['full_path'], + 'new_image' => $result['full_path'], + 'width' => $conf['max_width'], + 'height' => $conf['max_height'] + ); + + // Load resize library + $this->load->library('image_lib', $resizeParams); + + // Do resize + $this->image_lib->resize(); + } + + // Add our stuff + $result['result'] = "file_uploaded"; + $result['resultcode'] = 'ok'; + $result['file_name'] = $conf['img_path'] . '/' . $result['file_name']; + + // Output to user + $this->load->view('ajax_upload_result', $result); + } + else // Failure + { + // Compile data for output + $result['result'] = $this->upload->display_errors(' ', ' '); + $result['resultcode'] = 'failed'; + + // Output to user + $this->load->view('ajax_upload_result', $result); + } + } + + /* Blank Page (default source for iframe) */ + + public function blank($lang='english') + { + $this->_lang_set($lang); + $this->load->view('blank'); + } + + public function index($lang='english') + { + $this->blank($lang); + } +} + +/* End of file uploader.php */ +/* Location: ./application/controllers/uploader.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_404.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_404.php new file mode 100644 index 0000000..792726a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_404.php @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<title>404 Page Not Found</title> +<style type="text/css"> + +::selection{ background-color: #E13300; color: white; } +::moz-selection{ background-color: #E13300; color: white; } +::webkit-selection{ background-color: #E13300; color: white; } + +body { + background-color: #fff; + margin: 40px; + font: 13px/20px normal Helvetica, Arial, sans-serif; + color: #4F5155; +} + +a { + color: #003399; + background-color: transparent; + font-weight: normal; +} + +h1 { + color: #444; + background-color: transparent; + border-bottom: 1px solid #D0D0D0; + font-size: 19px; + font-weight: normal; + margin: 0 0 14px 0; + padding: 14px 15px 10px 15px; +} + +code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#container { + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; +} + +p { + margin: 12px 15px 12px 15px; +} +</style> +</head> +<body> + <div id="container"> + <h1><?php echo $heading; ?></h1> + <?php echo $message; ?> + </div> +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_db.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_db.php new file mode 100644 index 0000000..b396cda --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_db.php @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<title>Database Error</title> +<style type="text/css"> + +::selection{ background-color: #E13300; color: white; } +::moz-selection{ background-color: #E13300; color: white; } +::webkit-selection{ background-color: #E13300; color: white; } + +body { + background-color: #fff; + margin: 40px; + font: 13px/20px normal Helvetica, Arial, sans-serif; + color: #4F5155; +} + +a { + color: #003399; + background-color: transparent; + font-weight: normal; +} + +h1 { + color: #444; + background-color: transparent; + border-bottom: 1px solid #D0D0D0; + font-size: 19px; + font-weight: normal; + margin: 0 0 14px 0; + padding: 14px 15px 10px 15px; +} + +code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#container { + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; +} + +p { + margin: 12px 15px 12px 15px; +} +</style> +</head> +<body> + <div id="container"> + <h1><?php echo $heading; ?></h1> + <?php echo $message; ?> + </div> +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_general.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_general.php new file mode 100644 index 0000000..fd63ce2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_general.php @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<title>Error</title> +<style type="text/css"> + +::selection{ background-color: #E13300; color: white; } +::moz-selection{ background-color: #E13300; color: white; } +::webkit-selection{ background-color: #E13300; color: white; } + +body { + background-color: #fff; + margin: 40px; + font: 13px/20px normal Helvetica, Arial, sans-serif; + color: #4F5155; +} + +a { + color: #003399; + background-color: transparent; + font-weight: normal; +} + +h1 { + color: #444; + background-color: transparent; + border-bottom: 1px solid #D0D0D0; + font-size: 19px; + font-weight: normal; + margin: 0 0 14px 0; + padding: 14px 15px 10px 15px; +} + +code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#container { + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; +} + +p { + margin: 12px 15px 12px 15px; +} +</style> +</head> +<body> + <div id="container"> + <h1><?php echo $heading; ?></h1> + <?php echo $message; ?> + </div> +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php new file mode 100644 index 0000000..f085c20 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php @@ -0,0 +1,10 @@ +<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> + +<h4>A PHP Error was encountered</h4> + +<p>Severity: <?php echo $severity; ?></p> +<p>Message: <?php echo $message; ?></p> +<p>Filename: <?php echo $filepath; ?></p> +<p>Line Number: <?php echo $line; ?></p> + +</div>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/jbimages_helper.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/jbimages_helper.php new file mode 100644 index 0000000..e6bb0b3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/helpers/jbimages_helper.php @@ -0,0 +1,6 @@ +<?php +/* + This Helper is a wrapper of the file below +*/ + +include("../is_allowed.php");
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/jbstrings_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/jbstrings_lang.php new file mode 100644 index 0000000..7422619 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/english/jbstrings_lang.php @@ -0,0 +1,6 @@ +<?php + +$lang['jb_blankpage_message'] = "The Upload process had not started, or started, but had not finished yet, or your browser could not reach the remote server."; + +/* End of file jbstrings_lang.php */ +/* Location: ./application/language/english/jbstrings_lang.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/imglib_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/imglib_lang.php new file mode 100644 index 0000000..18129af --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/imglib_lang.php @@ -0,0 +1,24 @@ +<?php defined('BASEPATH') OR exit('No direct script access allowed'); + +$lang['imglib_source_image_required'] = "Vous devez spécifier une image source dans vos préférences."; +$lang['imglib_gd_required'] = "La librairie GD est requise pour cette fonctionnalité."; +$lang['imglib_gd_required_for_props'] = "Votre serveur doit supporter la librairie d\'images GD pour déterminer les propriétés de l\'image"; +$lang['imglib_unsupported_imagecreate'] = "Votre serveur ne dispose pas de la fonction GD nécessaire pour traiter ce type d\'image."; +$lang['imglib_gif_not_supported'] = "Le format GIF est souvent inutilisable du fait de restrictions de licence. Vous devriez utiliser le format JPG ou PNG à la place."; +$lang['imglib_jpg_not_supported'] = "Le format JPG n\'est pas supporté."; +$lang['imglib_png_not_supported'] = "Le format PNG n\'est pas supporté."; +$lang['imglib_jpg_or_png_required'] = "Le protocole de redimensionnement spécifié dans vos préférences ne fonctionne qu\'avec les formats d\'image JPG ou PNG."; +$lang['imglib_copy_error'] = "Une erreur est survenue lors du remplacement du fichier. Veuillez vérifier les permissions d\'écriture de votre répertoire."; +$lang['imglib_rotate_unsupported'] = "Votre serveur ne supporte apparemment pas la rotation d\'images."; +$lang['imglib_libpath_invalid'] = "Le chemin d\'accès à votre librairie de traitement d\'image n\'est pas correct. Veuillez indiquer le chemin correct dans vos préférences."; +$lang['imglib_image_process_failed'] = "Le traitement de l\'image a échoué. Veuillez vérifier que votre serveur supporte le protocole choisi et que le chemin d\'accès à votre librairie de traitement d\'image est correct."; +$lang['imglib_rotation_angle_required'] = "Un angle de rotation doit être indiqué pour effectuer cette transformation sur l\'image."; +$lang['imglib_writing_failed_gif'] = "Image GIF "; +$lang['imglib_invalid_path'] = "Le chemin d\'accès à l\'image est incorrect."; +$lang['imglib_copy_failed'] = "Le processus de copie d\'image a échoué."; +$lang['imglib_missing_font'] = "Impossible de trouver une police de caractères utilisable."; +$lang['imglib_save_failed'] = "Impossible d\'enregistrer l\'image. Vérifiez que l\'image et le dossier disposent des droits d\'écriture."; + + +/* End of file imglib_lang.php */ +/* Location: ./application/language/french/imglib_lang.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/jbstrings_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/jbstrings_lang.php new file mode 100644 index 0000000..4951c0b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/jbstrings_lang.php @@ -0,0 +1,6 @@ +<?php + +$lang['jb_blankpage_message'] = "Le processus de téléchargement n\'a pas encore commencé"; // Google translate)) + +/* End of file jbstrings_lang.php */ +/* Location: ./application/language/french/jbstrings_lang.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/upload_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/upload_lang.php new file mode 100644 index 0000000..cc1ffff --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/french/upload_lang.php @@ -0,0 +1,22 @@ +<?php defined('BASEPATH') OR exit('No direct script access allowed'); + +$lang['upload_userfile_not_set'] = "Impossible de trouver une variable de type POST nommée userfile."; +$lang['upload_file_exceeds_limit'] = "Le fichier envoyé dépasse la taille limite définie dans votre fichier de configuration PHP."; +$lang['upload_file_exceeds_form_limit'] = "Le fichier chargé dépasse la taille limite définie par le formulaire de soumission."; +$lang['upload_file_partial'] = "Le fichier n\'a été que partiellement envoyé."; +$lang['upload_no_temp_directory'] = "Le dossier temporaire manque."; +$lang['upload_unable_to_write_file'] = "Incapable d\'écrire le fichier sur disque."; +$lang['upload_stopped_by_extension'] = "Le chargement du fichier a été arrêté par une extension."; +$lang['upload_no_file_selected'] = "Vous n\'avez pas sélectionné de fichier à envoyer."; +$lang['upload_invalid_filetype'] = "Le type de fichier que vous tentez d\'envoyer n\'est pas autorisé."; +$lang['upload_invalid_filesize'] = "Le fichier que vous tentez d\'envoyer est plus gros que la taille autorisée."; +$lang['upload_invalid_dimensions'] = "L\'image que vous tentez d\'envoyer dépasse les valeurs maximales autorisées pour la hauteur ou la largeur."; +$lang['upload_destination_error'] = "Une erreur est survenue lors du déplacement du fichier envoyé vers sa destination finale."; +$lang['upload_no_filepath'] = "Le chemin de destination semble invalide."; +$lang['upload_no_file_types'] = "Vous n\'avez pas spécifié les types de fichier autorisés."; +$lang['upload_bad_filename'] = "Un fichier avec le même nom que celui que vous avez envoyé existe déjà sur le serveur."; +$lang['upload_not_writable'] = "Le répertoire de destination ne semble pas être accessible en écriture."; + + +/* End of file upload_lang.php */ +/* Location: ./application/language/french/upload_lang.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/imglib_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/imglib_lang.php new file mode 100644 index 0000000..66505da --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/imglib_lang.php @@ -0,0 +1,24 @@ +<?php + +$lang['imglib_source_image_required'] = "You must specify a source image in your preferences."; +$lang['imglib_gd_required'] = "The GD image library is required for this feature."; +$lang['imglib_gd_required_for_props'] = "Your server must support the GD image library in order to determine the image properties."; +$lang['imglib_unsupported_imagecreate'] = "Your server does not support the GD function required to process this type of image."; +$lang['imglib_gif_not_supported'] = "GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead."; +$lang['imglib_jpg_not_supported'] = "JPG images are not supported."; +$lang['imglib_png_not_supported'] = "PNG images are not supported."; +$lang['imglib_jpg_or_png_required'] = "The image resize protocol specified in your preferences only works with JPEG or PNG image types."; +$lang['imglib_copy_error'] = "An error was encountered while attempting to replace the file. Please make sure your file directory is writable."; +$lang['imglib_rotate_unsupported'] = "Image rotation does not appear to be supported by your server."; +$lang['imglib_libpath_invalid'] = "The path to your image library is not correct. Please set the correct path in your image preferences."; +$lang['imglib_image_process_failed'] = "Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct."; +$lang['imglib_rotation_angle_required'] = "An angle of rotation is required to rotate the image."; +$lang['imglib_writing_failed_gif'] = "GIF image."; +$lang['imglib_invalid_path'] = "The path to the image is not correct."; +$lang['imglib_copy_failed'] = "The image copy routine failed."; +$lang['imglib_missing_font'] = "Unable to find a font to use."; +$lang['imglib_save_failed'] = "Unable to save the image. Please make sure the image and file directory are writable."; + + +/* End of file imglib_lang.php */ +/* Location: ./system/language/english/imglib_lang.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/jbstrings_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/jbstrings_lang.php new file mode 100644 index 0000000..5d6277e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/jbstrings_lang.php @@ -0,0 +1,6 @@ +<?php + +$lang['jb_blankpage_message'] = "ПроцеÑÑ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ еще не началÑÑ, либо началÑÑ Ð¸ еще не завершилÑÑ, либо проÑто нет ÑвÑзи Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð½Ñ‹Ð¼ Ñервером."; + +/* End of file jbstrings_lang.php */ +/* Location: ./application/language/russian/jbstrings_lang.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/upload_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/upload_lang.php new file mode 100644 index 0000000..de471b1 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/language/russian/upload_lang.php @@ -0,0 +1,22 @@ +<?php + +$lang['upload_userfile_not_set'] = "Ðе найдена Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ POST[userfile]."; +$lang['upload_file_exceeds_limit'] = "Размер файла Ñлишком большой Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸."; +$lang['upload_file_exceeds_form_limit'] = "Размер файла Ñлишком большой."; +$lang['upload_file_partial'] = "Файл загрузилÑÑ Ð½ÐµÐ¿Ð¾Ð»Ð½Ð¾Ñтью."; +$lang['upload_no_temp_directory'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Проблемы Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ папкой."; +$lang['upload_unable_to_write_file'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Проблемы Ñ Ð·Ð°Ð¿Ð¸Ñью на диÑк."; +$lang['upload_stopped_by_extension'] = "Загрузка прервана по неизвеÑтной причине."; +$lang['upload_no_file_selected'] = "ПожалуйÑта, выберите файл Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸."; +$lang['upload_invalid_filetype'] = "Тип файла запрещен Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸."; +$lang['upload_invalid_filesize'] = "Ваш файл больше разрешенного размера."; +$lang['upload_invalid_dimensions'] = "Изображение которое вы пытаетеÑÑŒ загрузить превоÑходит макÑимально допуÑтимые ширину/выÑоту."; +$lang['upload_destination_error'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Проблема Ñ Ð¿ÐµÑ€ÐµÐ½Ð¾Ñом файла в конечную папку."; +$lang['upload_no_filepath'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Указанный путь Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ неверен."; +$lang['upload_no_file_types'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Ðе указан перечень разрешенных Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ типов."; +$lang['upload_bad_filename'] = "Файл уже ÑущеÑтвует."; +$lang['upload_not_writable'] = "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. ÐšÐ¾Ð½ÐµÑ‡Ð½Ð°Ñ Ð¿Ð°Ð¿ÐºÐ° не предÑтавлÑетÑÑ Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð½Ð¾Ð¹ Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи."; + + +/* End of file upload_lang.php */ +/* Location: ./application/language/russian/upload_lang.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/ajax_upload_result.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/ajax_upload_result.php new file mode 100644 index 0000000..1fb96c4 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/ajax_upload_result.php @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>JustBoil's Result Page</title> +<script language="javascript" type="text/javascript"> + window.parent.window.jbImagesDialog.uploadFinish({ + filename:'<?php echo $file_name; ?>', + result: '<?php echo $result; ?>', + resultCode: '<?php echo $resultcode; ?>' + }); +</script> +<style type="text/css"> + body {font-family: Courier, "Courier New", monospace; font-size:11px;} +</style> +</head> + +<body> + +Result: <?php echo $result; ?> + +</body> +</html> diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/blank.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/blank.php new file mode 100644 index 0000000..bfe32c2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/blank.php @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>JustBoil's Blank</title> +<style type="text/css"> + body {font-family: Courier, "Courier New", monospace; font-size:11px;} +</style> +</head> + +<body> + +<p><?=lang('jb_blankpage_message') ?></p> + +</body> +</html> diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/application/views/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/index.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/index.php new file mode 100644 index 0000000..54e5e60 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/index.php @@ -0,0 +1,205 @@ +<?php + +/* + *--------------------------------------------------------------- + * APPLICATION ENVIRONMENT + *--------------------------------------------------------------- + * + * You can load different configurations depending on your + * current environment. Setting the environment also influences + * things like logging and error reporting. + * + * This can be set to anything, but default usage is: + * + * development + * testing + * production + * + * NOTE: If you change these, also change the error_reporting() code below + * + */ + define('ENVIRONMENT', 'production'); +/* + *--------------------------------------------------------------- + * ERROR REPORTING + *--------------------------------------------------------------- + * + * Different environments will require different levels of error reporting. + * By default development will show errors but testing and live will hide them. + */ + +if (defined('ENVIRONMENT')) +{ + switch (ENVIRONMENT) + { + case 'development': + error_reporting(E_ALL); + break; + + case 'testing': + case 'production': + error_reporting(0); + break; + + default: + exit('The application environment is not set correctly.'); + } +} + +/* + *--------------------------------------------------------------- + * SYSTEM FOLDER NAME + *--------------------------------------------------------------- + * + * This variable must contain the name of your "system" folder. + * Include the path if the folder is not in the same directory + * as this file. + * + */ + $system_path = 'system'; + +/* + *--------------------------------------------------------------- + * APPLICATION FOLDER NAME + *--------------------------------------------------------------- + * + * If you want this front controller to use a different "application" + * folder then the default one you can set its name here. The folder + * can also be renamed or relocated anywhere on your server. If + * you do, use a full server path. For more info please see the user guide: + * http://codeigniter.com/user_guide/general/managing_apps.html + * + * NO TRAILING SLASH! + * + */ + $application_folder = 'application'; + +/* + * -------------------------------------------------------------------- + * DEFAULT CONTROLLER + * -------------------------------------------------------------------- + * + * Normally you will set your default controller in the routes.php file. + * You can, however, force a custom routing by hard-coding a + * specific controller class/function here. For most applications, you + * WILL NOT set your routing here, but it's an option for those + * special instances where you might want to override the standard + * routing in a specific front controller that shares a common CI installation. + * + * IMPORTANT: If you set the routing here, NO OTHER controller will be + * callable. In essence, this preference limits your application to ONE + * specific controller. Leave the function name blank if you need + * to call functions dynamically via the URI. + * + * Un-comment the $routing array below to use this feature + * + */ + // The directory name, relative to the "controllers" folder. Leave blank + // if your controller is not in a sub-folder within the "controllers" folder + // $routing['directory'] = ''; + + // The controller class file name. Example: Mycontroller + // $routing['controller'] = ''; + + // The controller function you wish to be called. + // $routing['function'] = ''; + + +/* + * ------------------------------------------------------------------- + * CUSTOM CONFIG VALUES + * ------------------------------------------------------------------- + * + * The $assign_to_config array below will be passed dynamically to the + * config class when initialized. This allows you to set custom config + * items or override any default config values found in the config.php file. + * This can be handy as it permits you to share one application between + * multiple front controller files, with each file containing different + * config values. + * + * Un-comment the $assign_to_config array below to use this feature + * + */ + // $assign_to_config['name_of_config_item'] = 'value of config item'; + + + +// -------------------------------------------------------------------- +// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE +// -------------------------------------------------------------------- + +/* + * --------------------------------------------------------------- + * Resolve the system path for increased reliability + * --------------------------------------------------------------- + */ + + // Set the current directory correctly for CLI requests + if (defined('STDIN')) + { + chdir(dirname(__FILE__)); + } + + if (realpath($system_path) !== FALSE) + { + $system_path = realpath($system_path).'/'; + } + + // ensure there's a trailing slash + $system_path = rtrim($system_path, '/').'/'; + + // Is the system path correct? + if ( ! is_dir($system_path)) + { + exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME)); + } + +/* + * ------------------------------------------------------------------- + * Now that we know the path, set the main path constants + * ------------------------------------------------------------------- + */ + // The name of THIS file + define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); + + // The PHP file extension + // this global constant is deprecated. + define('EXT', '.php'); + + // Path to the system folder + define('BASEPATH', str_replace("\\", "/", $system_path)); + + // Path to the front controller (this file) + define('FCPATH', str_replace(SELF, '', __FILE__)); + + // Name of the "system folder" + define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); + + + // The path to the "application" folder + if (is_dir($application_folder)) + { + define('APPPATH', $application_folder.'/'); + } + else + { + if ( ! is_dir(BASEPATH.$application_folder.'/')) + { + exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF); + } + + define('APPPATH', BASEPATH.$application_folder.'/'); + } + +/* + * -------------------------------------------------------------------- + * LOAD THE BOOTSTRAP FILE + * -------------------------------------------------------------------- + * + * And away we go... + * + */ +require_once BASEPATH.'core/CodeIgniter.php'; + +/* End of file index.php */ +/* Location: ./index.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/.htaccess b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/.htaccess new file mode 100644 index 0000000..14249c5 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/.htaccess @@ -0,0 +1 @@ +Deny from all
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Benchmark.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Benchmark.php new file mode 100644 index 0000000..a200727 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Benchmark.php @@ -0,0 +1,118 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Benchmark Class + * + * This class enables you to mark points and calculate the time difference + * between them. Memory consumption can also be displayed. + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/benchmark.html + */ +class CI_Benchmark { + + /** + * List of all benchmark markers and when they were added + * + * @var array + */ + var $marker = array(); + + // -------------------------------------------------------------------- + + /** + * Set a benchmark marker + * + * Multiple calls to this function can be made so that several + * execution points can be timed + * + * @access public + * @param string $name name of the marker + * @return void + */ + function mark($name) + { + $this->marker[$name] = microtime(); + } + + // -------------------------------------------------------------------- + + /** + * Calculates the time difference between two marked points. + * + * If the first parameter is empty this function instead returns the + * {elapsed_time} pseudo-variable. This permits the full system + * execution time to be shown in a template. The output class will + * swap the real value for this variable. + * + * @access public + * @param string a particular marked point + * @param string a particular marked point + * @param integer the number of decimal places + * @return mixed + */ + function elapsed_time($point1 = '', $point2 = '', $decimals = 4) + { + if ($point1 == '') + { + return '{elapsed_time}'; + } + + if ( ! isset($this->marker[$point1])) + { + return ''; + } + + if ( ! isset($this->marker[$point2])) + { + $this->marker[$point2] = microtime(); + } + + list($sm, $ss) = explode(' ', $this->marker[$point1]); + list($em, $es) = explode(' ', $this->marker[$point2]); + + return number_format(($em + $es) - ($sm + $ss), $decimals); + } + + // -------------------------------------------------------------------- + + /** + * Memory Usage + * + * This function returns the {memory_usage} pseudo-variable. + * This permits it to be put it anywhere in a template + * without the memory being calculated until the end. + * The output class will swap the real value for this variable. + * + * @access public + * @return string + */ + function memory_usage() + { + return '{memory_usage}'; + } + +} + +// END CI_Benchmark class + +/* End of file Benchmark.php */ +/* Location: ./system/core/Benchmark.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/CodeIgniter.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/CodeIgniter.php new file mode 100644 index 0000000..c16c79c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/CodeIgniter.php @@ -0,0 +1,402 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * System Initialization File + * + * Loads the base classes and executes the request. + * + * @package CodeIgniter + * @subpackage codeigniter + * @category Front-controller + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/ + */ + +/** + * CodeIgniter Version + * + * @var string + * + */ + define('CI_VERSION', '2.1.3'); + +/** + * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) + * + * @var boolean + * + */ + define('CI_CORE', FALSE); + +/* + * ------------------------------------------------------ + * Load the global functions + * ------------------------------------------------------ + */ + require(BASEPATH.'core/Common.php'); + +/* + * ------------------------------------------------------ + * Load the framework constants + * ------------------------------------------------------ + */ + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) + { + require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); + } + else + { + require(APPPATH.'config/constants.php'); + } + +/* + * ------------------------------------------------------ + * Define a custom error handler so we can log PHP errors + * ------------------------------------------------------ + */ + set_error_handler('_exception_handler'); + + if ( ! is_php('5.3')) + { + @set_magic_quotes_runtime(0); // Kill magic quotes + } + +/* + * ------------------------------------------------------ + * Set the subclass_prefix + * ------------------------------------------------------ + * + * Normally the "subclass_prefix" is set in the config file. + * The subclass prefix allows CI to know if a core class is + * being extended via a library in the local application + * "libraries" folder. Since CI allows config items to be + * overriden via data set in the main index. php file, + * before proceeding we need to know if a subclass_prefix + * override exists. If so, we will set this value now, + * before any classes are loaded + * Note: Since the config file data is cached it doesn't + * hurt to load it here. + */ + if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '') + { + get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); + } + +/* + * ------------------------------------------------------ + * Set a liberal script execution time limit + * ------------------------------------------------------ + */ + if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) + { + @set_time_limit(300); + } + +/* + * ------------------------------------------------------ + * Start the timer... tick tock tick tock... + * ------------------------------------------------------ + */ + $BM =& load_class('Benchmark', 'core'); + $BM->mark('total_execution_time_start'); + $BM->mark('loading_time:_base_classes_start'); + +/* + * ------------------------------------------------------ + * Instantiate the hooks class + * ------------------------------------------------------ + */ + $EXT =& load_class('Hooks', 'core'); + +/* + * ------------------------------------------------------ + * Is there a "pre_system" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('pre_system'); + +/* + * ------------------------------------------------------ + * Instantiate the config class + * ------------------------------------------------------ + */ + $CFG =& load_class('Config', 'core'); + + // Do we have any manually set config items in the index.php file? + if (isset($assign_to_config)) + { + $CFG->_assign_to_config($assign_to_config); + } + +/* + * ------------------------------------------------------ + * Instantiate the UTF-8 class + * ------------------------------------------------------ + * + * Note: Order here is rather important as the UTF-8 + * class needs to be used very early on, but it cannot + * properly determine if UTf-8 can be supported until + * after the Config class is instantiated. + * + */ + + $UNI =& load_class('Utf8', 'core'); + +/* + * ------------------------------------------------------ + * Instantiate the URI class + * ------------------------------------------------------ + */ + $URI =& load_class('URI', 'core'); + +/* + * ------------------------------------------------------ + * Instantiate the routing class and set the routing + * ------------------------------------------------------ + */ + $RTR =& load_class('Router', 'core'); + $RTR->_set_routing(); + + // Set any routing overrides that may exist in the main index file + if (isset($routing)) + { + $RTR->_set_overrides($routing); + } + +/* + * ------------------------------------------------------ + * Instantiate the output class + * ------------------------------------------------------ + */ + $OUT =& load_class('Output', 'core'); + +/* + * ------------------------------------------------------ + * Is there a valid cache file? If so, we're done... + * ------------------------------------------------------ + */ + if ($EXT->_call_hook('cache_override') === FALSE) + { + if ($OUT->_display_cache($CFG, $URI) == TRUE) + { + exit; + } + } + +/* + * ----------------------------------------------------- + * Load the security class for xss and csrf support + * ----------------------------------------------------- + */ + $SEC =& load_class('Security', 'core'); + +/* + * ------------------------------------------------------ + * Load the Input class and sanitize globals + * ------------------------------------------------------ + */ + $IN =& load_class('Input', 'core'); + +/* + * ------------------------------------------------------ + * Load the Language class + * ------------------------------------------------------ + */ + $LANG =& load_class('Lang', 'core'); + +/* + * ------------------------------------------------------ + * Load the app controller and local controller + * ------------------------------------------------------ + * + */ + // Load the base controller class + require BASEPATH.'core/Controller.php'; + + function &get_instance() + { + return CI_Controller::get_instance(); + } + + + if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php')) + { + require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; + } + + // Load the local application controller + // Note: The Router class automatically validates the controller path using the router->_validate_request(). + // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. + if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php')) + { + show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); + } + + include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'); + + // Set a mark point for benchmarking + $BM->mark('loading_time:_base_classes_end'); + +/* + * ------------------------------------------------------ + * Security check + * ------------------------------------------------------ + * + * None of the functions in the app controller or the + * loader class can be called via the URI, nor can + * controller functions that begin with an underscore + */ + $class = $RTR->fetch_class(); + $method = $RTR->fetch_method(); + + if ( ! class_exists($class) + OR strncmp($method, '_', 1) == 0 + OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) + ) + { + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.'.php'); + } + } + else + { + show_404("{$class}/{$method}"); + } + } + +/* + * ------------------------------------------------------ + * Is there a "pre_controller" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('pre_controller'); + +/* + * ------------------------------------------------------ + * Instantiate the requested controller + * ------------------------------------------------------ + */ + // Mark a start point so we can benchmark the controller + $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); + + $CI = new $class(); + +/* + * ------------------------------------------------------ + * Is there a "post_controller_constructor" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('post_controller_constructor'); + +/* + * ------------------------------------------------------ + * Call the requested method + * ------------------------------------------------------ + */ + // Is there a "remap" function? If so, we call it instead + if (method_exists($CI, '_remap')) + { + $CI->_remap($method, array_slice($URI->rsegments, 2)); + } + else + { + // is_callable() returns TRUE on some versions of PHP 5 for private and protected + // methods, so we'll use this workaround for consistent behavior + if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) + { + // Check and see if we are using a 404 override and use it. + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.'.php'); + unset($CI); + $CI = new $class(); + } + } + else + { + show_404("{$class}/{$method}"); + } + } + + // Call the requested method. + // Any URI segments present (besides the class/function) will be passed to the method for convenience + call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); + } + + + // Mark a benchmark end point + $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); + +/* + * ------------------------------------------------------ + * Is there a "post_controller" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('post_controller'); + +/* + * ------------------------------------------------------ + * Send the final rendered output to the browser + * ------------------------------------------------------ + */ + if ($EXT->_call_hook('display_override') === FALSE) + { + $OUT->_display(); + } + +/* + * ------------------------------------------------------ + * Is there a "post_system" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('post_system'); + +/* + * ------------------------------------------------------ + * Close the DB connection if one exists + * ------------------------------------------------------ + */ + if (class_exists('CI_DB') AND isset($CI->db)) + { + $CI->db->close(); + } + + +/* End of file CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Common.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Common.php new file mode 100644 index 0000000..07534c5 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Common.php @@ -0,0 +1,564 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Common Functions + * + * Loads the base classes and executes the request. + * + * @package CodeIgniter + * @subpackage codeigniter + * @category Common Functions + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/ + */ + +// ------------------------------------------------------------------------ + +/** +* Determines if the current version of PHP is greater then the supplied value +* +* Since there are a few places where we conditionally test for PHP > 5 +* we'll set a static variable. +* +* @access public +* @param string +* @return bool TRUE if the current version is $version or higher +*/ +if ( ! function_exists('is_php')) +{ + function is_php($version = '5.0.0') + { + static $_is_php; + $version = (string)$version; + + if ( ! isset($_is_php[$version])) + { + $_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE; + } + + return $_is_php[$version]; + } +} + +// ------------------------------------------------------------------------ + +/** + * Tests for file writability + * + * is_writable() returns TRUE on Windows servers when you really can't write to + * the file, based on the read-only attribute. is_writable() is also unreliable + * on Unix servers if safe_mode is on. + * + * @access private + * @return void + */ +if ( ! function_exists('is_really_writable')) +{ + function is_really_writable($file) + { + // If we're on a Unix server with safe_mode off we call is_writable + if (DIRECTORY_SEPARATOR == '/' AND @ini_get("safe_mode") == FALSE) + { + return is_writable($file); + } + + // For windows servers and safe_mode "on" installations we'll actually + // write a file then read it. Bah... + if (is_dir($file)) + { + $file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100)); + + if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) + { + return FALSE; + } + + fclose($fp); + @chmod($file, DIR_WRITE_MODE); + @unlink($file); + return TRUE; + } + elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) + { + return FALSE; + } + + fclose($fp); + return TRUE; + } +} + +// ------------------------------------------------------------------------ + +/** +* Class registry +* +* This function acts as a singleton. If the requested class does not +* exist it is instantiated and set to a static variable. If it has +* previously been instantiated the variable is returned. +* +* @access public +* @param string the class name being requested +* @param string the directory where the class should be found +* @param string the class name prefix +* @return object +*/ +if ( ! function_exists('load_class')) +{ + function &load_class($class, $directory = 'libraries', $prefix = 'CI_') + { + static $_classes = array(); + + // Does the class exist? If so, we're done... + if (isset($_classes[$class])) + { + return $_classes[$class]; + } + + $name = FALSE; + + // Look for the class first in the local application/libraries folder + // then in the native system/libraries folder + foreach (array(APPPATH, BASEPATH) as $path) + { + if (file_exists($path.$directory.'/'.$class.'.php')) + { + $name = $prefix.$class; + + if (class_exists($name) === FALSE) + { + require($path.$directory.'/'.$class.'.php'); + } + + break; + } + } + + // Is the request a class extension? If so we load it too + if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php')) + { + $name = config_item('subclass_prefix').$class; + + if (class_exists($name) === FALSE) + { + require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'); + } + } + + // Did we find the class? + if ($name === FALSE) + { + // Note: We use exit() rather then show_error() in order to avoid a + // self-referencing loop with the Excptions class + exit('Unable to locate the specified class: '.$class.'.php'); + } + + // Keep track of what we just loaded + is_loaded($class); + + $_classes[$class] = new $name(); + return $_classes[$class]; + } +} + +// -------------------------------------------------------------------- + +/** +* Keeps track of which libraries have been loaded. This function is +* called by the load_class() function above +* +* @access public +* @return array +*/ +if ( ! function_exists('is_loaded')) +{ + function &is_loaded($class = '') + { + static $_is_loaded = array(); + + if ($class != '') + { + $_is_loaded[strtolower($class)] = $class; + } + + return $_is_loaded; + } +} + +// ------------------------------------------------------------------------ + +/** +* Loads the main config.php file +* +* This function lets us grab the config file even if the Config class +* hasn't been instantiated yet +* +* @access private +* @return array +*/ +if ( ! function_exists('get_config')) +{ + function &get_config($replace = array()) + { + static $_config; + + if (isset($_config)) + { + return $_config[0]; + } + + // Is the config file in the environment folder? + if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php')) + { + $file_path = APPPATH.'config/config.php'; + } + + // Fetch the config file + if ( ! file_exists($file_path)) + { + exit('The configuration file does not exist.'); + } + + require($file_path); + + // Does the $config array exist in the file? + if ( ! isset($config) OR ! is_array($config)) + { + exit('Your config file does not appear to be formatted correctly.'); + } + + // Are any values being dynamically replaced? + if (count($replace) > 0) + { + foreach ($replace as $key => $val) + { + if (isset($config[$key])) + { + $config[$key] = $val; + } + } + } + + return $_config[0] =& $config; + } +} + +// ------------------------------------------------------------------------ + +/** +* Returns the specified config item +* +* @access public +* @return mixed +*/ +if ( ! function_exists('config_item')) +{ + function config_item($item) + { + static $_config_item = array(); + + if ( ! isset($_config_item[$item])) + { + $config =& get_config(); + + if ( ! isset($config[$item])) + { + return FALSE; + } + $_config_item[$item] = $config[$item]; + } + + return $_config_item[$item]; + } +} + +// ------------------------------------------------------------------------ + +/** +* Error Handler +* +* This function lets us invoke the exception class and +* display errors using the standard error template located +* in application/errors/errors.php +* This function will send the error page directly to the +* browser and exit. +* +* @access public +* @return void +*/ +if ( ! function_exists('show_error')) +{ + function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered') + { + $_error =& load_class('Exceptions', 'core'); + echo $_error->show_error($heading, $message, 'error_general', $status_code); + exit; + } +} + +// ------------------------------------------------------------------------ + +/** +* 404 Page Handler +* +* This function is similar to the show_error() function above +* However, instead of the standard error template it displays +* 404 errors. +* +* @access public +* @return void +*/ +if ( ! function_exists('show_404')) +{ + function show_404($page = '', $log_error = TRUE) + { + $_error =& load_class('Exceptions', 'core'); + $_error->show_404($page, $log_error); + exit; + } +} + +// ------------------------------------------------------------------------ + +/** +* Error Logging Interface +* +* We use this as a simple mechanism to access the logging +* class and send messages to be logged. +* +* @access public +* @return void +*/ +if ( ! function_exists('log_message')) +{ + function log_message($level = 'error', $message, $php_error = FALSE) + { + static $_log; + + if (config_item('log_threshold') == 0) + { + return; + } + + $_log =& load_class('Log'); + $_log->write_log($level, $message, $php_error); + } +} + +// ------------------------------------------------------------------------ + +/** + * Set HTTP Status Header + * + * @access public + * @param int the status code + * @param string + * @return void + */ +if ( ! function_exists('set_status_header')) +{ + function set_status_header($code = 200, $text = '') + { + $stati = array( + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + + 400 => 'Bad Request', + 401 => 'Unauthorized', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported' + ); + + if ($code == '' OR ! is_numeric($code)) + { + show_error('Status codes must be numeric', 500); + } + + if (isset($stati[$code]) AND $text == '') + { + $text = $stati[$code]; + } + + if ($text == '') + { + show_error('No status text available. Please check your status code number or supply your own message text.', 500); + } + + $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE; + + if (substr(php_sapi_name(), 0, 3) == 'cgi') + { + header("Status: {$code} {$text}", TRUE); + } + elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') + { + header($server_protocol." {$code} {$text}", TRUE, $code); + } + else + { + header("HTTP/1.1 {$code} {$text}", TRUE, $code); + } + } +} + +// -------------------------------------------------------------------- + +/** +* Exception Handler +* +* This is the custom exception handler that is declaired at the top +* of Codeigniter.php. The main reason we use this is to permit +* PHP errors to be logged in our own log files since the user may +* not have access to server logs. Since this function +* effectively intercepts PHP errors, however, we also need +* to display errors based on the current error_reporting level. +* We do that with the use of a PHP error template. +* +* @access private +* @return void +*/ +if ( ! function_exists('_exception_handler')) +{ + function _exception_handler($severity, $message, $filepath, $line) + { + // We don't bother with "strict" notices since they tend to fill up + // the log file with excess information that isn't normally very helpful. + // For example, if you are running PHP 5 and you use version 4 style + // class functions (without prefixes like "public", "private", etc.) + // you'll get notices telling you that these have been deprecated. + if ($severity == E_STRICT) + { + return; + } + + $_error =& load_class('Exceptions', 'core'); + + // Should we display the error? We'll get the current error_reporting + // level and add its bits with the severity bits to find out. + if (($severity & error_reporting()) == $severity) + { + $_error->show_php_error($severity, $message, $filepath, $line); + } + + // Should we log the error? No? We're done... + if (config_item('log_threshold') == 0) + { + return; + } + + $_error->log_exception($severity, $message, $filepath, $line); + } +} + +// -------------------------------------------------------------------- + +/** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('remove_invisible_characters')) +{ + function remove_invisible_characters($str, $url_encoded = TRUE) + { + $non_displayables = array(); + + // every control character except newline (dec 10) + // carriage return (dec 13), and horizontal tab (dec 09) + + if ($url_encoded) + { + $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15 + $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31 + } + + $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 + + do + { + $str = preg_replace($non_displayables, '', $str, -1, $count); + } + while ($count); + + return $str; + } +} + +// ------------------------------------------------------------------------ + +/** +* Returns HTML escaped variable +* +* @access public +* @param mixed +* @return mixed +*/ +if ( ! function_exists('html_escape')) +{ + function html_escape($var) + { + if (is_array($var)) + { + return array_map('html_escape', $var); + } + else + { + return htmlspecialchars($var, ENT_QUOTES, config_item('charset')); + } + } +} + +/* End of file Common.php */ +/* Location: ./system/core/Common.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Config.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Config.php new file mode 100644 index 0000000..5dffbf3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Config.php @@ -0,0 +1,379 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Config Class + * + * This class contains functions that enable config files to be managed + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/config.html + */ +class CI_Config { + + /** + * List of all loaded config values + * + * @var array + */ + var $config = array(); + /** + * List of all loaded config files + * + * @var array + */ + var $is_loaded = array(); + /** + * List of paths to search when trying to load a config file + * + * @var array + */ + var $_config_paths = array(APPPATH); + + /** + * Constructor + * + * Sets the $config data from the primary config.php file as a class variable + * + * @access public + * @param string the config file name + * @param boolean if configuration values should be loaded into their own section + * @param boolean true if errors should just return false, false if an error message should be displayed + * @return boolean if the file was successfully loaded or not + */ + function __construct() + { + $this->config =& get_config(); + log_message('debug', "Config Class Initialized"); + + // Set the base_url automatically if none was provided + if ($this->config['base_url'] == '') + { + if (isset($_SERVER['HTTP_HOST'])) + { + $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; + $base_url .= '://'. $_SERVER['HTTP_HOST']; + $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); + } + + else + { + $base_url = 'http://localhost/'; + } + + $this->set_item('base_url', $base_url); + } + } + + // -------------------------------------------------------------------- + + /** + * Load Config File + * + * @access public + * @param string the config file name + * @param boolean if configuration values should be loaded into their own section + * @param boolean true if errors should just return false, false if an error message should be displayed + * @return boolean if the file was loaded correctly + */ + function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { + $file = ($file == '') ? 'config' : str_replace('.php', '', $file); + $found = FALSE; + $loaded = FALSE; + + $check_locations = defined('ENVIRONMENT') + ? array(ENVIRONMENT.'/'.$file, $file) + : array($file); + + foreach ($this->_config_paths as $path) + { + foreach ($check_locations as $location) + { + $file_path = $path.'config/'.$location.'.php'; + + if (in_array($file_path, $this->is_loaded, TRUE)) + { + $loaded = TRUE; + continue 2; + } + + if (file_exists($file_path)) + { + $found = TRUE; + break; + } + } + + if ($found === FALSE) + { + continue; + } + + include($file_path); + + if ( ! isset($config) OR ! is_array($config)) + { + if ($fail_gracefully === TRUE) + { + return FALSE; + } + show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.'); + } + + if ($use_sections === TRUE) + { + if (isset($this->config[$file])) + { + $this->config[$file] = array_merge($this->config[$file], $config); + } + else + { + $this->config[$file] = $config; + } + } + else + { + $this->config = array_merge($this->config, $config); + } + + $this->is_loaded[] = $file_path; + unset($config); + + $loaded = TRUE; + log_message('debug', 'Config file loaded: '.$file_path); + break; + } + + if ($loaded === FALSE) + { + if ($fail_gracefully === TRUE) + { + return FALSE; + } + show_error('The configuration file '.$file.'.php does not exist.'); + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item + * + * + * @access public + * @param string the config item name + * @param string the index name + * @param bool + * @return string + */ + function item($item, $index = '') + { + if ($index == '') + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + + $pref = $this->config[$item]; + } + else + { + if ( ! isset($this->config[$index])) + { + return FALSE; + } + + if ( ! isset($this->config[$index][$item])) + { + return FALSE; + } + + $pref = $this->config[$index][$item]; + } + + return $pref; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item - adds slash after item (if item is not empty) + * + * @access public + * @param string the config item name + * @param bool + * @return string + */ + function slash_item($item) + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + if( trim($this->config[$item]) == '') + { + return ''; + } + + return rtrim($this->config[$item], '/').'/'; + } + + // -------------------------------------------------------------------- + + /** + * Site URL + * Returns base_url . index_page [. uri_string] + * + * @access public + * @param string the URI string + * @return string + */ + function site_url($uri = '') + { + if ($uri == '') + { + return $this->slash_item('base_url').$this->item('index_page'); + } + + if ($this->item('enable_query_strings') == FALSE) + { + $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); + return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix; + } + else + { + return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri); + } + } + + // ------------------------------------------------------------- + + /** + * Base URL + * Returns base_url [. uri_string] + * + * @access public + * @param string $uri + * @return string + */ + function base_url($uri = '') + { + return $this->slash_item('base_url').ltrim($this->_uri_string($uri), '/'); + } + + // ------------------------------------------------------------- + + /** + * Build URI string for use in Config::site_url() and Config::base_url() + * + * @access protected + * @param $uri + * @return string + */ + protected function _uri_string($uri) + { + if ($this->item('enable_query_strings') == FALSE) + { + if (is_array($uri)) + { + $uri = implode('/', $uri); + } + $uri = trim($uri, '/'); + } + else + { + if (is_array($uri)) + { + $i = 0; + $str = ''; + foreach ($uri as $key => $val) + { + $prefix = ($i == 0) ? '' : '&'; + $str .= $prefix.$key.'='.$val; + $i++; + } + $uri = $str; + } + } + return $uri; + } + + // -------------------------------------------------------------------- + + /** + * System URL + * + * @access public + * @return string + */ + function system_url() + { + $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); + return $this->slash_item('base_url').end($x).'/'; + } + + // -------------------------------------------------------------------- + + /** + * Set a config file item + * + * @access public + * @param string the config item key + * @param string the config item value + * @return void + */ + function set_item($item, $value) + { + $this->config[$item] = $value; + } + + // -------------------------------------------------------------------- + + /** + * Assign to Config + * + * This function is called by the front controller (CodeIgniter.php) + * after the Config class is instantiated. It permits config items + * to be assigned or overriden by variables contained in the index.php file + * + * @access private + * @param array + * @return void + */ + function _assign_to_config($items = array()) + { + if (is_array($items)) + { + foreach ($items as $key => $val) + { + $this->set_item($key, $val); + } + } + } +} + +// END CI_Config class + +/* End of file Config.php */ +/* Location: ./system/core/Config.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Controller.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Controller.php new file mode 100644 index 0000000..fddb81e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Controller.php @@ -0,0 +1,64 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Application Controller Class + * + * This class object is the super class that every library in + * CodeIgniter will be assigned to. + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/general/controllers.html + */ +class CI_Controller { + + private static $instance; + + /** + * Constructor + */ + public function __construct() + { + self::$instance =& $this; + + // Assign all the class objects that were instantiated by the + // bootstrap file (CodeIgniter.php) to local class variables + // so that CI can run as one big super object. + foreach (is_loaded() as $var => $class) + { + $this->$var =& load_class($class); + } + + $this->load =& load_class('Loader', 'core'); + + $this->load->initialize(); + + log_message('debug', "Controller Class Initialized"); + } + + public static function &get_instance() + { + return self::$instance; + } +} +// END Controller class + +/* End of file Controller.php */ +/* Location: ./system/core/Controller.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Exceptions.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Exceptions.php new file mode 100644 index 0000000..869739a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Exceptions.php @@ -0,0 +1,193 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Exceptions Class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Exceptions + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/exceptions.html + */ +class CI_Exceptions { + var $action; + var $severity; + var $message; + var $filename; + var $line; + + /** + * Nesting level of the output buffering mechanism + * + * @var int + * @access public + */ + var $ob_level; + + /** + * List if available error levels + * + * @var array + * @access public + */ + var $levels = array( + E_ERROR => 'Error', + E_WARNING => 'Warning', + E_PARSE => 'Parsing Error', + E_NOTICE => 'Notice', + E_CORE_ERROR => 'Core Error', + E_CORE_WARNING => 'Core Warning', + E_COMPILE_ERROR => 'Compile Error', + E_COMPILE_WARNING => 'Compile Warning', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', + E_STRICT => 'Runtime Notice' + ); + + + /** + * Constructor + */ + public function __construct() + { + $this->ob_level = ob_get_level(); + // Note: Do not log messages from this constructor. + } + + // -------------------------------------------------------------------- + + /** + * Exception Logger + * + * This function logs PHP generated error messages + * + * @access private + * @param string the error severity + * @param string the error string + * @param string the error filepath + * @param string the error line number + * @return string + */ + function log_exception($severity, $message, $filepath, $line) + { + $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; + + log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * 404 Page Not Found Handler + * + * @access private + * @param string the page + * @param bool log error yes/no + * @return string + */ + function show_404($page = '', $log_error = TRUE) + { + $heading = "404 Page Not Found"; + $message = "The page you requested was not found."; + + // By default we log this, but allow a dev to skip it + if ($log_error) + { + log_message('error', '404 Page Not Found --> '.$page); + } + + echo $this->show_error($heading, $message, 'error_404', 404); + exit; + } + + // -------------------------------------------------------------------- + + /** + * General Error Page + * + * This function takes an error message as input + * (either as a string or an array) and displays + * it using the specified template. + * + * @access private + * @param string the heading + * @param string the message + * @param string the template name + * @param int the status code + * @return string + */ + function show_error($heading, $message, $template = 'error_general', $status_code = 500) + { + set_status_header($status_code); + + $message = '<p>'.implode('</p><p>', ( ! is_array($message)) ? array($message) : $message).'</p>'; + + if (ob_get_level() > $this->ob_level + 1) + { + ob_end_flush(); + } + ob_start(); + include(APPPATH.'errors/'.$template.'.php'); + $buffer = ob_get_contents(); + ob_end_clean(); + return $buffer; + } + + // -------------------------------------------------------------------- + + /** + * Native PHP error handler + * + * @access private + * @param string the error severity + * @param string the error string + * @param string the error filepath + * @param string the error line number + * @return string + */ + function show_php_error($severity, $message, $filepath, $line) + { + $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; + + $filepath = str_replace("\\", "/", $filepath); + + // For safety reasons we do not show the full file path + if (FALSE !== strpos($filepath, '/')) + { + $x = explode('/', $filepath); + $filepath = $x[count($x)-2].'/'.end($x); + } + + if (ob_get_level() > $this->ob_level + 1) + { + ob_end_flush(); + } + ob_start(); + include(APPPATH.'errors/error_php.php'); + $buffer = ob_get_contents(); + ob_end_clean(); + echo $buffer; + } + + +} +// END Exceptions Class + +/* End of file Exceptions.php */ +/* Location: ./system/core/Exceptions.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Hooks.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Hooks.php new file mode 100644 index 0000000..33f1c03 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Hooks.php @@ -0,0 +1,248 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Hooks Class + * + * Provides a mechanism to extend the base system without hacking. + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/encryption.html + */ +class CI_Hooks { + + /** + * Determines wether hooks are enabled + * + * @var bool + */ + var $enabled = FALSE; + /** + * List of all hooks set in config/hooks.php + * + * @var array + */ + var $hooks = array(); + /** + * Determines wether hook is in progress, used to prevent infinte loops + * + * @var bool + */ + var $in_progress = FALSE; + + /** + * Constructor + * + */ + function __construct() + { + $this->_initialize(); + log_message('debug', "Hooks Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize the Hooks Preferences + * + * @access private + * @return void + */ + function _initialize() + { + $CFG =& load_class('Config', 'core'); + + // If hooks are not enabled in the config file + // there is nothing else to do + + if ($CFG->item('enable_hooks') == FALSE) + { + return; + } + + // Grab the "hooks" definition file. + // If there are no hooks, we're done. + + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); + } + elseif (is_file(APPPATH.'config/hooks.php')) + { + include(APPPATH.'config/hooks.php'); + } + + + if ( ! isset($hook) OR ! is_array($hook)) + { + return; + } + + $this->hooks =& $hook; + $this->enabled = TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Call Hook + * + * Calls a particular hook + * + * @access private + * @param string the hook name + * @return mixed + */ + function _call_hook($which = '') + { + if ( ! $this->enabled OR ! isset($this->hooks[$which])) + { + return FALSE; + } + + if (isset($this->hooks[$which][0]) AND is_array($this->hooks[$which][0])) + { + foreach ($this->hooks[$which] as $val) + { + $this->_run_hook($val); + } + } + else + { + $this->_run_hook($this->hooks[$which]); + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Run Hook + * + * Runs a particular hook + * + * @access private + * @param array the hook details + * @return bool + */ + function _run_hook($data) + { + if ( ! is_array($data)) + { + return FALSE; + } + + // ----------------------------------- + // Safety - Prevents run-away loops + // ----------------------------------- + + // If the script being called happens to have the same + // hook call within it a loop can happen + + if ($this->in_progress == TRUE) + { + return; + } + + // ----------------------------------- + // Set file path + // ----------------------------------- + + if ( ! isset($data['filepath']) OR ! isset($data['filename'])) + { + return FALSE; + } + + $filepath = APPPATH.$data['filepath'].'/'.$data['filename']; + + if ( ! file_exists($filepath)) + { + return FALSE; + } + + // ----------------------------------- + // Set class/function name + // ----------------------------------- + + $class = FALSE; + $function = FALSE; + $params = ''; + + if (isset($data['class']) AND $data['class'] != '') + { + $class = $data['class']; + } + + if (isset($data['function'])) + { + $function = $data['function']; + } + + if (isset($data['params'])) + { + $params = $data['params']; + } + + if ($class === FALSE AND $function === FALSE) + { + return FALSE; + } + + // ----------------------------------- + // Set the in_progress flag + // ----------------------------------- + + $this->in_progress = TRUE; + + // ----------------------------------- + // Call the requested class and/or function + // ----------------------------------- + + if ($class !== FALSE) + { + if ( ! class_exists($class)) + { + require($filepath); + } + + $HOOK = new $class; + $HOOK->$function($params); + } + else + { + if ( ! function_exists($function)) + { + require($filepath); + } + + $function($params); + } + + $this->in_progress = FALSE; + return TRUE; + } + +} + +// END CI_Hooks class + +/* End of file Hooks.php */ +/* Location: ./system/core/Hooks.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Input.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Input.php new file mode 100644 index 0000000..0c1f2b0 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Input.php @@ -0,0 +1,849 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Input Class + * + * Pre-processes global input data for security + * + * @package CodeIgniter + * @subpackage Libraries + * @category Input + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/input.html + */ +class CI_Input { + + /** + * IP address of the current user + * + * @var string + */ + var $ip_address = FALSE; + /** + * user agent (web browser) being used by the current user + * + * @var string + */ + var $user_agent = FALSE; + /** + * If FALSE, then $_GET will be set to an empty array + * + * @var bool + */ + var $_allow_get_array = TRUE; + /** + * If TRUE, then newlines are standardized + * + * @var bool + */ + var $_standardize_newlines = TRUE; + /** + * Determines whether the XSS filter is always active when GET, POST or COOKIE data is encountered + * Set automatically based on config setting + * + * @var bool + */ + var $_enable_xss = FALSE; + /** + * Enables a CSRF cookie token to be set. + * Set automatically based on config setting + * + * @var bool + */ + var $_enable_csrf = FALSE; + /** + * List of all HTTP request headers + * + * @var array + */ + protected $headers = array(); + + /** + * Constructor + * + * Sets whether to globally enable the XSS processing + * and whether to allow the $_GET array + * + * @return void + */ + public function __construct() + { + log_message('debug', "Input Class Initialized"); + + $this->_allow_get_array = (config_item('allow_get_array') === TRUE); + $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); + $this->_enable_csrf = (config_item('csrf_protection') === TRUE); + + global $SEC; + $this->security =& $SEC; + + // Do we need the UTF-8 class? + if (UTF8_ENABLED === TRUE) + { + global $UNI; + $this->uni =& $UNI; + } + + // Sanitize global arrays + $this->_sanitize_globals(); + } + + // -------------------------------------------------------------------- + + /** + * Fetch from array + * + * This is a helper function to retrieve values from global arrays + * + * @access private + * @param array + * @param string + * @param bool + * @return string + */ + function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) + { + if ( ! isset($array[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + return $this->security->xss_clean($array[$index]); + } + + return $array[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the GET array + * + * @access public + * @param string + * @param bool + * @return string + */ + function get($index = NULL, $xss_clean = FALSE) + { + // Check if a field has been provided + if ($index === NULL AND ! empty($_GET)) + { + $get = array(); + + // loop through the full _GET array + foreach (array_keys($_GET) as $key) + { + $get[$key] = $this->_fetch_from_array($_GET, $key, $xss_clean); + } + return $get; + } + + return $this->_fetch_from_array($_GET, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the POST array + * + * @access public + * @param string + * @param bool + * @return string + */ + function post($index = NULL, $xss_clean = FALSE) + { + // Check if a field has been provided + if ($index === NULL AND ! empty($_POST)) + { + $post = array(); + + // Loop through the full _POST array and return it + foreach (array_keys($_POST) as $key) + { + $post[$key] = $this->_fetch_from_array($_POST, $key, $xss_clean); + } + return $post; + } + + return $this->_fetch_from_array($_POST, $index, $xss_clean); + } + + + // -------------------------------------------------------------------- + + /** + * Fetch an item from either the GET array or the POST + * + * @access public + * @param string The index key + * @param bool XSS cleaning + * @return string + */ + function get_post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_POST[$index]) ) + { + return $this->get($index, $xss_clean); + } + else + { + return $this->post($index, $xss_clean); + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return string + */ + function cookie($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); + } + + // ------------------------------------------------------------------------ + + /** + * Set cookie + * + * Accepts six parameter, or you can submit an associative + * array in the first parameter containing all the values. + * + * @access public + * @param mixed + * @param string the value of the cookie + * @param string the number of seconds until expiration + * @param string the cookie domain. Usually: .yourdomain.com + * @param string the cookie path + * @param string the cookie prefix + * @param bool true makes the cookie secure + * @return void + */ + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) + { + if (is_array($name)) + { + // always leave 'name' in last place, as the loop will break otherwise, due to $$item + foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'name') as $item) + { + if (isset($name[$item])) + { + $$item = $name[$item]; + } + } + } + + if ($prefix == '' AND config_item('cookie_prefix') != '') + { + $prefix = config_item('cookie_prefix'); + } + if ($domain == '' AND config_item('cookie_domain') != '') + { + $domain = config_item('cookie_domain'); + } + if ($path == '/' AND config_item('cookie_path') != '/') + { + $path = config_item('cookie_path'); + } + if ($secure == FALSE AND config_item('cookie_secure') != FALSE) + { + $secure = config_item('cookie_secure'); + } + + if ( ! is_numeric($expire)) + { + $expire = time() - 86500; + } + else + { + $expire = ($expire > 0) ? time() + $expire : 0; + } + + setcookie($prefix.$name, $value, $expire, $path, $domain, $secure); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the SERVER array + * + * @access public + * @param string + * @param bool + * @return string + */ + function server($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_SERVER, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the IP Address + * + * @return string + */ + public function ip_address() + { + if ($this->ip_address !== FALSE) + { + return $this->ip_address; + } + + $proxy_ips = config_item('proxy_ips'); + if ( ! empty($proxy_ips)) + { + $proxy_ips = explode(',', str_replace(' ', '', $proxy_ips)); + foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP') as $header) + { + if (($spoof = $this->server($header)) !== FALSE) + { + // Some proxies typically list the whole chain of IP + // addresses through which the client has reached us. + // e.g. client_ip, proxy_ip1, proxy_ip2, etc. + if (strpos($spoof, ',') !== FALSE) + { + $spoof = explode(',', $spoof, 2); + $spoof = $spoof[0]; + } + + if ( ! $this->valid_ip($spoof)) + { + $spoof = FALSE; + } + else + { + break; + } + } + } + + $this->ip_address = ($spoof !== FALSE && in_array($_SERVER['REMOTE_ADDR'], $proxy_ips, TRUE)) + ? $spoof : $_SERVER['REMOTE_ADDR']; + } + else + { + $this->ip_address = $_SERVER['REMOTE_ADDR']; + } + + if ( ! $this->valid_ip($this->ip_address)) + { + $this->ip_address = '0.0.0.0'; + } + + return $this->ip_address; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * @access public + * @param string + * @param string ipv4 or ipv6 + * @return bool + */ + public function valid_ip($ip, $which = '') + { + $which = strtolower($which); + + // First check if filter_var is available + if (is_callable('filter_var')) + { + switch ($which) { + case 'ipv4': + $flag = FILTER_FLAG_IPV4; + break; + case 'ipv6': + $flag = FILTER_FLAG_IPV6; + break; + default: + $flag = ''; + break; + } + + return (bool) filter_var($ip, FILTER_VALIDATE_IP, $flag); + } + + if ($which !== 'ipv6' && $which !== 'ipv4') + { + if (strpos($ip, ':') !== FALSE) + { + $which = 'ipv6'; + } + elseif (strpos($ip, '.') !== FALSE) + { + $which = 'ipv4'; + } + else + { + return FALSE; + } + } + + $func = '_valid_'.$which; + return $this->$func($ip); + } + + // -------------------------------------------------------------------- + + /** + * Validate IPv4 Address + * + * Updated version suggested by Geert De Deckere + * + * @access protected + * @param string + * @return bool + */ + protected function _valid_ipv4($ip) + { + $ip_segments = explode('.', $ip); + + // Always 4 segments needed + if (count($ip_segments) !== 4) + { + return FALSE; + } + // IP can not start with 0 + if ($ip_segments[0][0] == '0') + { + return FALSE; + } + + // Check each segment + foreach ($ip_segments as $segment) + { + // IP segments must be digits and can not be + // longer than 3 digits or greater then 255 + if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Validate IPv6 Address + * + * @access protected + * @param string + * @return bool + */ + protected function _valid_ipv6($str) + { + // 8 groups, separated by : + // 0-ffff per group + // one set of consecutive 0 groups can be collapsed to :: + + $groups = 8; + $collapsed = FALSE; + + $chunks = array_filter( + preg_split('/(:{1,2})/', $str, NULL, PREG_SPLIT_DELIM_CAPTURE) + ); + + // Rule out easy nonsense + if (current($chunks) == ':' OR end($chunks) == ':') + { + return FALSE; + } + + // PHP supports IPv4-mapped IPv6 addresses, so we'll expect those as well + if (strpos(end($chunks), '.') !== FALSE) + { + $ipv4 = array_pop($chunks); + + if ( ! $this->_valid_ipv4($ipv4)) + { + return FALSE; + } + + $groups--; + } + + while ($seg = array_pop($chunks)) + { + if ($seg[0] == ':') + { + if (--$groups == 0) + { + return FALSE; // too many groups + } + + if (strlen($seg) > 2) + { + return FALSE; // long separator + } + + if ($seg == '::') + { + if ($collapsed) + { + return FALSE; // multiple collapsed + } + + $collapsed = TRUE; + } + } + elseif (preg_match("/[^0-9a-f]/i", $seg) OR strlen($seg) > 4) + { + return FALSE; // invalid segment + } + } + + return $collapsed OR $groups == 1; + } + + // -------------------------------------------------------------------- + + /** + * User Agent + * + * @access public + * @return string + */ + function user_agent() + { + if ($this->user_agent !== FALSE) + { + return $this->user_agent; + } + + $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; + + return $this->user_agent; + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Globals + * + * This function does the following: + * + * Unsets $_GET data (if query strings are not enabled) + * + * Unsets all globals if register_globals is enabled + * + * Standardizes newline characters to \n + * + * @access private + * @return void + */ + function _sanitize_globals() + { + // It would be "wrong" to unset any of these GLOBALS. + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', + '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', + 'system_folder', 'application_folder', 'BM', 'EXT', + 'CFG', 'URI', 'RTR', 'OUT', 'IN'); + + // Unset globals for securiy. + // This is effectively the same as register_globals = off + foreach (array($_GET, $_POST, $_COOKIE) as $global) + { + if ( ! is_array($global)) + { + if ( ! in_array($global, $protected)) + { + global $$global; + $$global = NULL; + } + } + else + { + foreach ($global as $key => $val) + { + if ( ! in_array($key, $protected)) + { + global $$key; + $$key = NULL; + } + } + } + } + + // Is $_GET data allowed? If not we'll set the $_GET to an empty array + if ($this->_allow_get_array == FALSE) + { + $_GET = array(); + } + else + { + if (is_array($_GET) AND count($_GET) > 0) + { + foreach ($_GET as $key => $val) + { + $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + } + + // Clean $_POST Data + if (is_array($_POST) AND count($_POST) > 0) + { + foreach ($_POST as $key => $val) + { + $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + + // Clean $_COOKIE Data + if (is_array($_COOKIE) AND count($_COOKIE) > 0) + { + // Also get rid of specially treated cookies that might be set by a server + // or silly application, that are of no use to a CI application anyway + // but that when present will trip our 'Disallowed Key Characters' alarm + // http://www.ietf.org/rfc/rfc2109.txt + // note that the key names below are single quoted strings, and are not PHP variables + unset($_COOKIE['$Version']); + unset($_COOKIE['$Path']); + unset($_COOKIE['$Domain']); + + foreach ($_COOKIE as $key => $val) + { + $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + + // Sanitize PHP_SELF + $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']); + + + // CSRF Protection check on HTTP requests + if ($this->_enable_csrf == TRUE && ! $this->is_cli_request()) + { + $this->security->csrf_verify(); + } + + log_message('debug', "Global POST and COOKIE data sanitized"); + } + + // -------------------------------------------------------------------- + + /** + * Clean Input Data + * + * This is a helper function. It escapes data and + * standardizes newline characters to \n + * + * @access private + * @param string + * @return string + */ + function _clean_input_data($str) + { + if (is_array($str)) + { + $new_array = array(); + foreach ($str as $key => $val) + { + $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + return $new_array; + } + + /* We strip slashes if magic quotes is on to keep things consistent + + NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and + it will probably not exist in future versions at all. + */ + if ( ! is_php('5.4') && get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + + // Clean UTF-8 if supported + if (UTF8_ENABLED === TRUE) + { + $str = $this->uni->clean_string($str); + } + + // Remove control characters + $str = remove_invisible_characters($str); + + // Should we filter the input data? + if ($this->_enable_xss === TRUE) + { + $str = $this->security->xss_clean($str); + } + + // Standardize newlines if needed + if ($this->_standardize_newlines == TRUE) + { + if (strpos($str, "\r") !== FALSE) + { + $str = str_replace(array("\r\n", "\r", "\r\n\n"), PHP_EOL, $str); + } + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Clean Keys + * + * This is a helper function. To prevent malicious users + * from trying to exploit keys we make sure that keys are + * only named with alpha-numeric text and a few other items. + * + * @access private + * @param string + * @return string + */ + function _clean_input_keys($str) + { + if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) + { + exit('Disallowed Key Characters.'); + } + + // Clean UTF-8 if supported + if (UTF8_ENABLED === TRUE) + { + $str = $this->uni->clean_string($str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Request Headers + * + * In Apache, you can simply call apache_request_headers(), however for + * people running other webservers the function is undefined. + * + * @param bool XSS cleaning + * + * @return array + */ + public function request_headers($xss_clean = FALSE) + { + // Look at Apache go! + if (function_exists('apache_request_headers')) + { + $headers = apache_request_headers(); + } + else + { + $headers['Content-Type'] = (isset($_SERVER['CONTENT_TYPE'])) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE'); + + foreach ($_SERVER as $key => $val) + { + if (strncmp($key, 'HTTP_', 5) === 0) + { + $headers[substr($key, 5)] = $this->_fetch_from_array($_SERVER, $key, $xss_clean); + } + } + } + + // take SOME_HEADER and turn it into Some-Header + foreach ($headers as $key => $val) + { + $key = str_replace('_', ' ', strtolower($key)); + $key = str_replace(' ', '-', ucwords($key)); + + $this->headers[$key] = $val; + } + + return $this->headers; + } + + // -------------------------------------------------------------------- + + /** + * Get Request Header + * + * Returns the value of a single member of the headers class member + * + * @param string array key for $this->headers + * @param boolean XSS Clean or not + * @return mixed FALSE on failure, string on success + */ + public function get_request_header($index, $xss_clean = FALSE) + { + if (empty($this->headers)) + { + $this->request_headers(); + } + + if ( ! isset($this->headers[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + return $this->security->xss_clean($this->headers[$index]); + } + + return $this->headers[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Is ajax Request? + * + * Test to see if a request contains the HTTP_X_REQUESTED_WITH header + * + * @return boolean + */ + public function is_ajax_request() + { + return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest'); + } + + // -------------------------------------------------------------------- + + /** + * Is cli Request? + * + * Test to see if a request was made from the command line + * + * @return bool + */ + public function is_cli_request() + { + return (php_sapi_name() === 'cli' OR defined('STDIN')); + } + +} + +/* End of file Input.php */ +/* Location: ./system/core/Input.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Lang.php new file mode 100644 index 0000000..5ac6718 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Lang.php @@ -0,0 +1,160 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Language Class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Language + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/language.html + */ +class CI_Lang { + + /** + * List of translations + * + * @var array + */ + var $language = array(); + /** + * List of loaded language files + * + * @var array + */ + var $is_loaded = array(); + + /** + * Constructor + * + * @access public + */ + function __construct() + { + log_message('debug', "Language Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Load a language file + * + * @access public + * @param mixed the name of the language file to be loaded. Can be an array + * @param string the language (english, etc.) + * @param bool return loaded array of translations + * @param bool add suffix to $langfile + * @param string alternative path to look for language file + * @return mixed + */ + function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') + { + $langfile = str_replace('.php', '', $langfile); + + if ($add_suffix == TRUE) + { + $langfile = str_replace('_lang.', '', $langfile).'_lang'; + } + + $langfile .= '.php'; + + if (in_array($langfile, $this->is_loaded, TRUE)) + { + return; + } + + $config =& get_config(); + + if ($idiom == '') + { + $deft_lang = ( ! isset($config['language'])) ? 'english' : $config['language']; + $idiom = ($deft_lang == '') ? 'english' : $deft_lang; + } + + // Determine where the language file is and load it + if ($alt_path != '' && file_exists($alt_path.'language/'.$idiom.'/'.$langfile)) + { + include($alt_path.'language/'.$idiom.'/'.$langfile); + } + else + { + $found = FALSE; + + foreach (get_instance()->load->get_package_paths(TRUE) as $package_path) + { + if (file_exists($package_path.'language/'.$idiom.'/'.$langfile)) + { + include($package_path.'language/'.$idiom.'/'.$langfile); + $found = TRUE; + break; + } + } + + if ($found !== TRUE) + { + show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile); + } + } + + + if ( ! isset($lang)) + { + log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); + return; + } + + if ($return == TRUE) + { + return $lang; + } + + $this->is_loaded[] = $langfile; + $this->language = array_merge($this->language, $lang); + unset($lang); + + log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a single line of text from the language array + * + * @access public + * @param string $line the language line + * @return string + */ + function line($line = '') + { + $value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; + + // Because killer robots like unicorns! + if ($value === FALSE) + { + log_message('error', 'Could not find the language line "'.$line.'"'); + } + + return $value; + } + +} +// END Language Class + +/* End of file Lang.php */ +/* Location: ./system/core/Lang.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Loader.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Loader.php new file mode 100644 index 0000000..6b7ee0c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Loader.php @@ -0,0 +1,1248 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Loader Class + * + * Loads views and files + * + * @package CodeIgniter + * @subpackage Libraries + * @author ExpressionEngine Dev Team + * @category Loader + * @link http://codeigniter.com/user_guide/libraries/loader.html + */ +class CI_Loader { + + // All these are set automatically. Don't mess with them. + /** + * Nesting level of the output buffering mechanism + * + * @var int + * @access protected + */ + protected $_ci_ob_level; + /** + * List of paths to load views from + * + * @var array + * @access protected + */ + protected $_ci_view_paths = array(); + /** + * List of paths to load libraries from + * + * @var array + * @access protected + */ + protected $_ci_library_paths = array(); + /** + * List of paths to load models from + * + * @var array + * @access protected + */ + protected $_ci_model_paths = array(); + /** + * List of paths to load helpers from + * + * @var array + * @access protected + */ + protected $_ci_helper_paths = array(); + /** + * List of loaded base classes + * Set by the controller class + * + * @var array + * @access protected + */ + protected $_base_classes = array(); // Set by the controller class + /** + * List of cached variables + * + * @var array + * @access protected + */ + protected $_ci_cached_vars = array(); + /** + * List of loaded classes + * + * @var array + * @access protected + */ + protected $_ci_classes = array(); + /** + * List of loaded files + * + * @var array + * @access protected + */ + protected $_ci_loaded_files = array(); + /** + * List of loaded models + * + * @var array + * @access protected + */ + protected $_ci_models = array(); + /** + * List of loaded helpers + * + * @var array + * @access protected + */ + protected $_ci_helpers = array(); + /** + * List of class name mappings + * + * @var array + * @access protected + */ + protected $_ci_varmap = array('unit_test' => 'unit', + 'user_agent' => 'agent'); + + /** + * Constructor + * + * Sets the path to the view files and gets the initial output buffering level + */ + public function __construct() + { + $this->_ci_ob_level = ob_get_level(); + $this->_ci_library_paths = array(APPPATH, BASEPATH); + $this->_ci_helper_paths = array(APPPATH, BASEPATH); + $this->_ci_model_paths = array(APPPATH); + $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); + + log_message('debug', "Loader Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize the Loader + * + * This method is called once in CI_Controller. + * + * @param array + * @return object + */ + public function initialize() + { + $this->_ci_classes = array(); + $this->_ci_loaded_files = array(); + $this->_ci_models = array(); + $this->_base_classes =& is_loaded(); + + $this->_ci_autoloader(); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Is Loaded + * + * A utility function to test if a class is in the self::$_ci_classes array. + * This function returns the object name if the class tested for is loaded, + * and returns FALSE if it isn't. + * + * It is mainly used in the form_helper -> _get_validation_object() + * + * @param string class being checked for + * @return mixed class object name on the CI SuperObject or FALSE + */ + public function is_loaded($class) + { + if (isset($this->_ci_classes[$class])) + { + return $this->_ci_classes[$class]; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Class Loader + * + * This function lets users load and instantiate classes. + * It is designed to be called from a user's app controllers. + * + * @param string the name of the class + * @param mixed the optional parameters + * @param string an optional object name + * @return void + */ + public function library($library = '', $params = NULL, $object_name = NULL) + { + if (is_array($library)) + { + foreach ($library as $class) + { + $this->library($class, $params); + } + + return; + } + + if ($library == '' OR isset($this->_base_classes[$library])) + { + return FALSE; + } + + if ( ! is_null($params) && ! is_array($params)) + { + $params = NULL; + } + + $this->_ci_load_class($library, $params, $object_name); + } + + // -------------------------------------------------------------------- + + /** + * Model Loader + * + * This function lets users load and instantiate models. + * + * @param string the name of the class + * @param string name for the model + * @param bool database connection + * @return void + */ + public function model($model, $name = '', $db_conn = FALSE) + { + if (is_array($model)) + { + foreach ($model as $babe) + { + $this->model($babe); + } + return; + } + + if ($model == '') + { + return; + } + + $path = ''; + + // Is the model in a sub-folder? If so, parse out the filename and path. + if (($last_slash = strrpos($model, '/')) !== FALSE) + { + // The path is in front of the last slash + $path = substr($model, 0, $last_slash + 1); + + // And the model name behind it + $model = substr($model, $last_slash + 1); + } + + if ($name == '') + { + $name = $model; + } + + if (in_array($name, $this->_ci_models, TRUE)) + { + return; + } + + $CI =& get_instance(); + if (isset($CI->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } + + $model = strtolower($model); + + foreach ($this->_ci_model_paths as $mod_path) + { + if ( ! file_exists($mod_path.'models/'.$path.$model.'.php')) + { + continue; + } + + if ($db_conn !== FALSE AND ! class_exists('CI_DB')) + { + if ($db_conn === TRUE) + { + $db_conn = ''; + } + + $CI->load->database($db_conn, FALSE, TRUE); + } + + if ( ! class_exists('CI_Model')) + { + load_class('Model', 'core'); + } + + require_once($mod_path.'models/'.$path.$model.'.php'); + + $model = ucfirst($model); + + $CI->$name = new $model(); + + $this->_ci_models[] = $name; + return; + } + + // couldn't find the model + show_error('Unable to locate the model you have specified: '.$model); + } + + // -------------------------------------------------------------------- + + /** + * Database Loader + * + * @param string the DB credentials + * @param bool whether to return the DB object + * @param bool whether to enable active record (this allows us to override the config setting) + * @return object + */ + public function database($params = '', $return = FALSE, $active_record = NULL) + { + // Grab the super object + $CI =& get_instance(); + + // Do we even need to load the database class? + if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) + { + return FALSE; + } + + require_once(BASEPATH.'database/DB.php'); + + if ($return === TRUE) + { + return DB($params, $active_record); + } + + // Initialize the db variable. Needed to prevent + // reference errors with some configurations + $CI->db = ''; + + // Load the DB class + $CI->db =& DB($params, $active_record); + } + + // -------------------------------------------------------------------- + + /** + * Load the Utilities Class + * + * @return string + */ + public function dbutil() + { + if ( ! class_exists('CI_DB')) + { + $this->database(); + } + + $CI =& get_instance(); + + // for backwards compatibility, load dbforge so we can extend dbutils off it + // this use is deprecated and strongly discouraged + $CI->load->dbforge(); + + require_once(BASEPATH.'database/DB_utility.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility.php'); + $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; + + $CI->dbutil = new $class(); + } + + // -------------------------------------------------------------------- + + /** + * Load the Database Forge Class + * + * @return string + */ + public function dbforge() + { + if ( ! class_exists('CI_DB')) + { + $this->database(); + } + + $CI =& get_instance(); + + require_once(BASEPATH.'database/DB_forge.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); + $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; + + $CI->dbforge = new $class(); + } + + // -------------------------------------------------------------------- + + /** + * Load View + * + * This function is used to load a "view" file. It has three parameters: + * + * 1. The name of the "view" file to be included. + * 2. An associative array of data to be extracted for use in the view. + * 3. TRUE/FALSE - whether to return the data or load it. In + * some cases it's advantageous to be able to return data so that + * a developer can process it in some way. + * + * @param string + * @param array + * @param bool + * @return void + */ + public function view($view, $vars = array(), $return = FALSE) + { + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Load File + * + * This is a generic file loader + * + * @param string + * @param bool + * @return string + */ + public function file($path, $return = FALSE) + { + return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Set Variables + * + * Once variables are set they become available within + * the controller class and its "view" files. + * + * @param array + * @param string + * @return void + */ + public function vars($vars = array(), $val = '') + { + if ($val != '' AND is_string($vars)) + { + $vars = array($vars => $val); + } + + $vars = $this->_ci_object_to_array($vars); + + if (is_array($vars) AND count($vars) > 0) + { + foreach ($vars as $key => $val) + { + $this->_ci_cached_vars[$key] = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Get Variable + * + * Check if a variable is set and retrieve it. + * + * @param array + * @return void + */ + public function get_var($key) + { + return isset($this->_ci_cached_vars[$key]) ? $this->_ci_cached_vars[$key] : NULL; + } + + // -------------------------------------------------------------------- + + /** + * Load Helper + * + * This function loads the specified helper file. + * + * @param mixed + * @return void + */ + public function helper($helpers = array()) + { + foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper) + { + if (isset($this->_ci_helpers[$helper])) + { + continue; + } + + $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; + + // Is this a helper extension request? + if (file_exists($ext_helper)) + { + $base_helper = BASEPATH.'helpers/'.$helper.'.php'; + + if ( ! file_exists($base_helper)) + { + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); + } + + include_once($ext_helper); + include_once($base_helper); + + $this->_ci_helpers[$helper] = TRUE; + log_message('debug', 'Helper loaded: '.$helper); + continue; + } + + // Try to load the helper + foreach ($this->_ci_helper_paths as $path) + { + if (file_exists($path.'helpers/'.$helper.'.php')) + { + include_once($path.'helpers/'.$helper.'.php'); + + $this->_ci_helpers[$helper] = TRUE; + log_message('debug', 'Helper loaded: '.$helper); + break; + } + } + + // unable to load the helper + if ( ! isset($this->_ci_helpers[$helper])) + { + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); + } + } + } + + // -------------------------------------------------------------------- + + /** + * Load Helpers + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @param array + * @return void + */ + public function helpers($helpers = array()) + { + $this->helper($helpers); + } + + // -------------------------------------------------------------------- + + /** + * Loads a language file + * + * @param array + * @param string + * @return void + */ + public function language($file = array(), $lang = '') + { + $CI =& get_instance(); + + if ( ! is_array($file)) + { + $file = array($file); + } + + foreach ($file as $langfile) + { + $CI->lang->load($langfile, $lang); + } + } + + // -------------------------------------------------------------------- + + /** + * Loads a config file + * + * @param string + * @param bool + * @param bool + * @return void + */ + public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { + $CI =& get_instance(); + $CI->config->load($file, $use_sections, $fail_gracefully); + } + + // -------------------------------------------------------------------- + + /** + * Driver + * + * Loads a driver library + * + * @param string the name of the class + * @param mixed the optional parameters + * @param string an optional object name + * @return void + */ + public function driver($library = '', $params = NULL, $object_name = NULL) + { + if ( ! class_exists('CI_Driver_Library')) + { + // we aren't instantiating an object here, that'll be done by the Library itself + require BASEPATH.'libraries/Driver.php'; + } + + if ($library == '') + { + return FALSE; + } + + // We can save the loader some time since Drivers will *always* be in a subfolder, + // and typically identically named to the library + if ( ! strpos($library, '/')) + { + $library = ucfirst($library).'/'.$library; + } + + return $this->library($library, $params, $object_name); + } + + // -------------------------------------------------------------------- + + /** + * Add Package Path + * + * Prepends a parent path to the library, model, helper, and config path arrays + * + * @param string + * @param boolean + * @return void + */ + public function add_package_path($path, $view_cascade=TRUE) + { + $path = rtrim($path, '/').'/'; + + array_unshift($this->_ci_library_paths, $path); + array_unshift($this->_ci_model_paths, $path); + array_unshift($this->_ci_helper_paths, $path); + + $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; + + // Add config file path + $config =& $this->_ci_get_component('config'); + array_unshift($config->_config_paths, $path); + } + + // -------------------------------------------------------------------- + + /** + * Get Package Paths + * + * Return a list of all package paths, by default it will ignore BASEPATH. + * + * @param string + * @return void + */ + public function get_package_paths($include_base = FALSE) + { + return $include_base === TRUE ? $this->_ci_library_paths : $this->_ci_model_paths; + } + + // -------------------------------------------------------------------- + + /** + * Remove Package Path + * + * Remove a path from the library, model, and helper path arrays if it exists + * If no path is provided, the most recently added path is removed. + * + * @param type + * @param bool + * @return type + */ + public function remove_package_path($path = '', $remove_config_path = TRUE) + { + $config =& $this->_ci_get_component('config'); + + if ($path == '') + { + $void = array_shift($this->_ci_library_paths); + $void = array_shift($this->_ci_model_paths); + $void = array_shift($this->_ci_helper_paths); + $void = array_shift($this->_ci_view_paths); + $void = array_shift($config->_config_paths); + } + else + { + $path = rtrim($path, '/').'/'; + foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) + { + if (($key = array_search($path, $this->{$var})) !== FALSE) + { + unset($this->{$var}[$key]); + } + } + + if (isset($this->_ci_view_paths[$path.'views/'])) + { + unset($this->_ci_view_paths[$path.'views/']); + } + + if (($key = array_search($path, $config->_config_paths)) !== FALSE) + { + unset($config->_config_paths[$key]); + } + } + + // make sure the application default paths are still in the array + $this->_ci_library_paths = array_unique(array_merge($this->_ci_library_paths, array(APPPATH, BASEPATH))); + $this->_ci_helper_paths = array_unique(array_merge($this->_ci_helper_paths, array(APPPATH, BASEPATH))); + $this->_ci_model_paths = array_unique(array_merge($this->_ci_model_paths, array(APPPATH))); + $this->_ci_view_paths = array_merge($this->_ci_view_paths, array(APPPATH.'views/' => TRUE)); + $config->_config_paths = array_unique(array_merge($config->_config_paths, array(APPPATH))); + } + + // -------------------------------------------------------------------- + + /** + * Loader + * + * This function is used to load views and files. + * Variables are prefixed with _ci_ to avoid symbol collision with + * variables made available to view files + * + * @param array + * @return void + */ + protected function _ci_load($_ci_data) + { + // Set the default data variables + foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val) + { + $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; + } + + $file_exists = FALSE; + + // Set the path to the requested file + if ($_ci_path != '') + { + $_ci_x = explode('/', $_ci_path); + $_ci_file = end($_ci_x); + } + else + { + $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); + $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; + + foreach ($this->_ci_view_paths as $view_file => $cascade) + { + if (file_exists($view_file.$_ci_file)) + { + $_ci_path = $view_file.$_ci_file; + $file_exists = TRUE; + break; + } + + if ( ! $cascade) + { + break; + } + } + } + + if ( ! $file_exists && ! file_exists($_ci_path)) + { + show_error('Unable to load the requested file: '.$_ci_file); + } + + // This allows anything loaded using $this->load (views, files, etc.) + // to become accessible from within the Controller and Model functions. + + $_ci_CI =& get_instance(); + foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) + { + if ( ! isset($this->$_ci_key)) + { + $this->$_ci_key =& $_ci_CI->$_ci_key; + } + } + + /* + * Extract and cache variables + * + * You can either set variables using the dedicated $this->load_vars() + * function or via the second parameter of this function. We'll merge + * the two types and cache them so that views that are embedded within + * other views can have access to these variables. + */ + if (is_array($_ci_vars)) + { + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars); + } + extract($this->_ci_cached_vars); + + /* + * Buffer the output + * + * We buffer the output for two reasons: + * 1. Speed. You get a significant speed boost. + * 2. So that the final rendered template can be + * post-processed by the output class. Why do we + * need post processing? For one thing, in order to + * show the elapsed page load time. Unless we + * can intercept the content right before it's sent to + * the browser and then stop the timer it won't be accurate. + */ + ob_start(); + + // If the PHP installation does not support short tags we'll + // do a little string replacement, changing the short tags + // to standard PHP echo statements. + + if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) + { + echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); + } + else + { + include($_ci_path); // include() vs include_once() allows for multiple views with the same name + } + + log_message('debug', 'File loaded: '.$_ci_path); + + // Return the file data if requested + if ($_ci_return === TRUE) + { + $buffer = ob_get_contents(); + @ob_end_clean(); + return $buffer; + } + + /* + * Flush the buffer... or buff the flusher? + * + * In order to permit views to be nested within + * other views, we need to flush the content back out whenever + * we are beyond the first level of output buffering so that + * it can be seen and included properly by the first included + * template and any subsequent ones. Oy! + * + */ + if (ob_get_level() > $this->_ci_ob_level + 1) + { + ob_end_flush(); + } + else + { + $_ci_CI->output->append_output(ob_get_contents()); + @ob_end_clean(); + } + } + + // -------------------------------------------------------------------- + + /** + * Load class + * + * This function loads the requested class. + * + * @param string the item that is being loaded + * @param mixed any additional parameters + * @param string an optional object name + * @return void + */ + protected function _ci_load_class($class, $params = NULL, $object_name = NULL) + { + // Get the class name, and while we're at it trim any slashes. + // The directory path can be included as part of the class name, + // but we don't want a leading slash + $class = str_replace('.php', '', trim($class, '/')); + + // Was the path included with the class name? + // We look for a slash to determine this + $subdir = ''; + if (($last_slash = strrpos($class, '/')) !== FALSE) + { + // Extract the path + $subdir = substr($class, 0, $last_slash + 1); + + // Get the filename from the path + $class = substr($class, $last_slash + 1); + } + + // We'll test for both lowercase and capitalized versions of the file name + foreach (array(ucfirst($class), strtolower($class)) as $class) + { + $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.'.php'; + + // Is this a class extension request? + if (file_exists($subclass)) + { + $baseclass = BASEPATH.'libraries/'.ucfirst($class).'.php'; + + if ( ! file_exists($baseclass)) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($subclass, $this->_ci_loaded_files)) + { + // Before we deem this to be a duplicate request, let's see + // if a custom object name is being supplied. If so, we'll + // return a new instance of the object + if ( ! is_null($object_name)) + { + $CI =& get_instance(); + if ( ! isset($CI->$object_name)) + { + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); + } + } + + $is_duplicate = TRUE; + log_message('debug', $class." class already loaded. Second attempt ignored."); + return; + } + + include_once($baseclass); + include_once($subclass); + $this->_ci_loaded_files[] = $subclass; + + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); + } + + // Lets search for the requested library file and load it. + $is_duplicate = FALSE; + foreach ($this->_ci_library_paths as $path) + { + $filepath = $path.'libraries/'.$subdir.$class.'.php'; + + // Does the file exist? No? Bummer... + if ( ! file_exists($filepath)) + { + continue; + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($filepath, $this->_ci_loaded_files)) + { + // Before we deem this to be a duplicate request, let's see + // if a custom object name is being supplied. If so, we'll + // return a new instance of the object + if ( ! is_null($object_name)) + { + $CI =& get_instance(); + if ( ! isset($CI->$object_name)) + { + return $this->_ci_init_class($class, '', $params, $object_name); + } + } + + $is_duplicate = TRUE; + log_message('debug', $class." class already loaded. Second attempt ignored."); + return; + } + + include_once($filepath); + $this->_ci_loaded_files[] = $filepath; + return $this->_ci_init_class($class, '', $params, $object_name); + } + + } // END FOREACH + + // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? + if ($subdir == '') + { + $path = strtolower($class).'/'.$class; + return $this->_ci_load_class($path, $params); + } + + // If we got this far we were unable to find the requested class. + // We do not issue errors if the load call failed due to a duplicate request + if ($is_duplicate == FALSE) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + } + + // -------------------------------------------------------------------- + + /** + * Instantiates a class + * + * @param string + * @param string + * @param bool + * @param string an optional object name + * @return null + */ + protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) + { + // Is there an associated config file for this class? Note: these should always be lowercase + if ($config === NULL) + { + // Fetch the config paths containing any package paths + $config_component = $this->_ci_get_component('config'); + + if (is_array($config_component->_config_paths)) + { + // Break on the first found file, thus package files + // are not overridden by default paths + foreach ($config_component->_config_paths as $path) + { + // We test for both uppercase and lowercase, for servers that + // are case-sensitive with regard to file names. Check for environment + // first, global next + if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) + { + include($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); + break; + } + elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) + { + include($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); + break; + } + elseif (file_exists($path .'config/'.strtolower($class).'.php')) + { + include($path .'config/'.strtolower($class).'.php'); + break; + } + elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) + { + include($path .'config/'.ucfirst(strtolower($class)).'.php'); + break; + } + } + } + } + + if ($prefix == '') + { + if (class_exists('CI_'.$class)) + { + $name = 'CI_'.$class; + } + elseif (class_exists(config_item('subclass_prefix').$class)) + { + $name = config_item('subclass_prefix').$class; + } + else + { + $name = $class; + } + } + else + { + $name = $prefix.$class; + } + + // Is the class name valid? + if ( ! class_exists($name)) + { + log_message('error', "Non-existent class: ".$name); + show_error("Non-existent class: ".$class); + } + + // Set the variable name we will assign the class to + // Was a custom class name supplied? If so we'll use it + $class = strtolower($class); + + if (is_null($object_name)) + { + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + } + else + { + $classvar = $object_name; + } + + // Save the class name and object name + $this->_ci_classes[$class] = $classvar; + + // Instantiate the class + $CI =& get_instance(); + if ($config !== NULL) + { + $CI->$classvar = new $name($config); + } + else + { + $CI->$classvar = new $name; + } + } + + // -------------------------------------------------------------------- + + /** + * Autoloader + * + * The config/autoload.php file contains an array that permits sub-systems, + * libraries, and helpers to be loaded automatically. + * + * @param array + * @return void + */ + private function _ci_autoloader() + { + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); + } + else + { + include(APPPATH.'config/autoload.php'); + } + + if ( ! isset($autoload)) + { + return FALSE; + } + + // Autoload packages + if (isset($autoload['packages'])) + { + foreach ($autoload['packages'] as $package_path) + { + $this->add_package_path($package_path); + } + } + + // Load any custom config file + if (count($autoload['config']) > 0) + { + $CI =& get_instance(); + foreach ($autoload['config'] as $key => $val) + { + $CI->config->load($val); + } + } + + // Autoload helpers and languages + foreach (array('helper', 'language') as $type) + { + if (isset($autoload[$type]) AND count($autoload[$type]) > 0) + { + $this->$type($autoload[$type]); + } + } + + // A little tweak to remain backward compatible + // The $autoload['core'] item was deprecated + if ( ! isset($autoload['libraries']) AND isset($autoload['core'])) + { + $autoload['libraries'] = $autoload['core']; + } + + // Load libraries + if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) + { + // Load the database driver. + if (in_array('database', $autoload['libraries'])) + { + $this->database(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); + } + + // Load all other libraries + foreach ($autoload['libraries'] as $item) + { + $this->library($item); + } + } + + // Autoload models + if (isset($autoload['model'])) + { + $this->model($autoload['model']); + } + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @param object + * @return array + */ + protected function _ci_object_to_array($object) + { + return (is_object($object)) ? get_object_vars($object) : $object; + } + + // -------------------------------------------------------------------- + + /** + * Get a reference to a specific library or model + * + * @param string + * @return bool + */ + protected function &_ci_get_component($component) + { + $CI =& get_instance(); + return $CI->$component; + } + + // -------------------------------------------------------------------- + + /** + * Prep filename + * + * This function preps the name of various items to make loading them more reliable. + * + * @param mixed + * @param string + * @return array + */ + protected function _ci_prep_filename($filename, $extension) + { + if ( ! is_array($filename)) + { + return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension)); + } + else + { + foreach ($filename as $key => $val) + { + $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension); + } + + return $filename; + } + } +} + +/* End of file Loader.php */ +/* Location: ./system/core/Loader.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Model.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Model.php new file mode 100644 index 0000000..e15ffbe --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Model.php @@ -0,0 +1,57 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Model Class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/config.html + */ +class CI_Model { + + /** + * Constructor + * + * @access public + */ + function __construct() + { + log_message('debug', "Model Class Initialized"); + } + + /** + * __get + * + * Allows models to access CI's loaded classes using the same + * syntax as controllers. + * + * @param string + * @access private + */ + function __get($key) + { + $CI =& get_instance(); + return $CI->$key; + } +} +// END Model Class + +/* End of file Model.php */ +/* Location: ./system/core/Model.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Output.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Output.php new file mode 100644 index 0000000..ccecafd --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Output.php @@ -0,0 +1,574 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Output Class + * + * Responsible for sending final output to browser + * + * @package CodeIgniter + * @subpackage Libraries + * @category Output + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/output.html + */ +class CI_Output { + + /** + * Current output string + * + * @var string + * @access protected + */ + protected $final_output; + /** + * Cache expiration time + * + * @var int + * @access protected + */ + protected $cache_expiration = 0; + /** + * List of server headers + * + * @var array + * @access protected + */ + protected $headers = array(); + /** + * List of mime types + * + * @var array + * @access protected + */ + protected $mime_types = array(); + /** + * Determines wether profiler is enabled + * + * @var book + * @access protected + */ + protected $enable_profiler = FALSE; + /** + * Determines if output compression is enabled + * + * @var bool + * @access protected + */ + protected $_zlib_oc = FALSE; + /** + * List of profiler sections + * + * @var array + * @access protected + */ + protected $_profiler_sections = array(); + /** + * Whether or not to parse variables like {elapsed_time} and {memory_usage} + * + * @var bool + * @access protected + */ + protected $parse_exec_vars = TRUE; + + /** + * Constructor + * + */ + function __construct() + { + $this->_zlib_oc = @ini_get('zlib.output_compression'); + + // Get mime types for later + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) + { + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; + } + else + { + include APPPATH.'config/mimes.php'; + } + + + $this->mime_types = $mimes; + + log_message('debug', "Output Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Get Output + * + * Returns the current output string + * + * @access public + * @return string + */ + function get_output() + { + return $this->final_output; + } + + // -------------------------------------------------------------------- + + /** + * Set Output + * + * Sets the output string + * + * @access public + * @param string + * @return void + */ + function set_output($output) + { + $this->final_output = $output; + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Append Output + * + * Appends data onto the output string + * + * @access public + * @param string + * @return void + */ + function append_output($output) + { + if ($this->final_output == '') + { + $this->final_output = $output; + } + else + { + $this->final_output .= $output; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Header + * + * Lets you set a server header which will be outputted with the final display. + * + * Note: If a file is cached, headers will not be sent. We need to figure out + * how to permit header data to be saved with the cache data... + * + * @access public + * @param string + * @param bool + * @return void + */ + function set_header($header, $replace = TRUE) + { + // If zlib.output_compression is enabled it will compress the output, + // but it will not modify the content-length header to compensate for + // the reduction, causing the browser to hang waiting for more data. + // We'll just skip content-length in those cases. + + if ($this->_zlib_oc && strncasecmp($header, 'content-length', 14) == 0) + { + return; + } + + $this->headers[] = array($header, $replace); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Content Type Header + * + * @access public + * @param string extension of the file we're outputting + * @return void + */ + function set_content_type($mime_type) + { + if (strpos($mime_type, '/') === FALSE) + { + $extension = ltrim($mime_type, '.'); + + // Is this extension supported? + if (isset($this->mime_types[$extension])) + { + $mime_type =& $this->mime_types[$extension]; + + if (is_array($mime_type)) + { + $mime_type = current($mime_type); + } + } + } + + $header = 'Content-Type: '.$mime_type; + + $this->headers[] = array($header, TRUE); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set HTTP Status Header + * moved to Common procedural functions in 1.7.2 + * + * @access public + * @param int the status code + * @param string + * @return void + */ + function set_status_header($code = 200, $text = '') + { + set_status_header($code, $text); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Enable/disable Profiler + * + * @access public + * @param bool + * @return void + */ + function enable_profiler($val = TRUE) + { + $this->enable_profiler = (is_bool($val)) ? $val : TRUE; + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Profiler Sections + * + * Allows override of default / config settings for Profiler section display + * + * @access public + * @param array + * @return void + */ + function set_profiler_sections($sections) + { + foreach ($sections as $section => $enable) + { + $this->_profiler_sections[$section] = ($enable !== FALSE) ? TRUE : FALSE; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Cache + * + * @access public + * @param integer + * @return void + */ + function cache($time) + { + $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Display Output + * + * All "view" data is automatically put into this variable by the controller class: + * + * $this->final_output + * + * This function sends the finalized output data to the browser along + * with any server headers and profile data. It also stops the + * benchmark timer so the page rendering speed and memory usage can be shown. + * + * @access public + * @param string + * @return mixed + */ + function _display($output = '') + { + // Note: We use globals because we can't use $CI =& get_instance() + // since this function is sometimes called by the caching mechanism, + // which happens before the CI super object is available. + global $BM, $CFG; + + // Grab the super object if we can. + if (class_exists('CI_Controller')) + { + $CI =& get_instance(); + } + + // -------------------------------------------------------------------- + + // Set the output data + if ($output == '') + { + $output =& $this->final_output; + } + + // -------------------------------------------------------------------- + + // Do we need to write a cache file? Only if the controller does not have its + // own _output() method and we are not dealing with a cache file, which we + // can determine by the existence of the $CI object above + if ($this->cache_expiration > 0 && isset($CI) && ! method_exists($CI, '_output')) + { + $this->_write_cache($output); + } + + // -------------------------------------------------------------------- + + // Parse out the elapsed time and memory usage, + // then swap the pseudo-variables with the data + + $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); + + if ($this->parse_exec_vars === TRUE) + { + $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; + + $output = str_replace('{elapsed_time}', $elapsed, $output); + $output = str_replace('{memory_usage}', $memory, $output); + } + + // -------------------------------------------------------------------- + + // Is compression requested? + if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE) + { + if (extension_loaded('zlib')) + { + if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) + { + ob_start('ob_gzhandler'); + } + } + } + + // -------------------------------------------------------------------- + + // Are there any server headers to send? + if (count($this->headers) > 0) + { + foreach ($this->headers as $header) + { + @header($header[0], $header[1]); + } + } + + // -------------------------------------------------------------------- + + // Does the $CI object exist? + // If not we know we are dealing with a cache file so we'll + // simply echo out the data and exit. + if ( ! isset($CI)) + { + echo $output; + log_message('debug', "Final output sent to browser"); + log_message('debug', "Total execution time: ".$elapsed); + return TRUE; + } + + // -------------------------------------------------------------------- + + // Do we need to generate profile data? + // If so, load the Profile class and run it. + if ($this->enable_profiler == TRUE) + { + $CI->load->library('profiler'); + + if ( ! empty($this->_profiler_sections)) + { + $CI->profiler->set_sections($this->_profiler_sections); + } + + // If the output data contains closing </body> and </html> tags + // we will remove them and add them back after we insert the profile data + if (preg_match("|</body>.*?</html>|is", $output)) + { + $output = preg_replace("|</body>.*?</html>|is", '', $output); + $output .= $CI->profiler->run(); + $output .= '</body></html>'; + } + else + { + $output .= $CI->profiler->run(); + } + } + + // -------------------------------------------------------------------- + + // Does the controller contain a function named _output()? + // If so send the output there. Otherwise, echo it. + if (method_exists($CI, '_output')) + { + $CI->_output($output); + } + else + { + echo $output; // Send it to the browser! + } + + log_message('debug', "Final output sent to browser"); + log_message('debug', "Total execution time: ".$elapsed); + } + + // -------------------------------------------------------------------- + + /** + * Write a Cache File + * + * @access public + * @param string + * @return void + */ + function _write_cache($output) + { + $CI =& get_instance(); + $path = $CI->config->item('cache_path'); + + $cache_path = ($path == '') ? APPPATH.'cache/' : $path; + + if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path)) + { + log_message('error', "Unable to write cache file: ".$cache_path); + return; + } + + $uri = $CI->config->item('base_url'). + $CI->config->item('index_page'). + $CI->uri->uri_string(); + + $cache_path .= md5($uri); + + if ( ! $fp = @fopen($cache_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) + { + log_message('error', "Unable to write cache file: ".$cache_path); + return; + } + + $expire = time() + ($this->cache_expiration * 60); + + if (flock($fp, LOCK_EX)) + { + fwrite($fp, $expire.'TS--->'.$output); + flock($fp, LOCK_UN); + } + else + { + log_message('error', "Unable to secure a file lock for file at: ".$cache_path); + return; + } + fclose($fp); + @chmod($cache_path, FILE_WRITE_MODE); + + log_message('debug', "Cache file written: ".$cache_path); + } + + // -------------------------------------------------------------------- + + /** + * Update/serve a cached file + * + * @access public + * @param object config class + * @param object uri class + * @return void + */ + function _display_cache(&$CFG, &$URI) + { + $cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path'); + + // Build the file path. The file name is an MD5 hash of the full URI + $uri = $CFG->item('base_url'). + $CFG->item('index_page'). + $URI->uri_string; + + $filepath = $cache_path.md5($uri); + + if ( ! @file_exists($filepath)) + { + return FALSE; + } + + if ( ! $fp = @fopen($filepath, FOPEN_READ)) + { + return FALSE; + } + + flock($fp, LOCK_SH); + + $cache = ''; + if (filesize($filepath) > 0) + { + $cache = fread($fp, filesize($filepath)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + // Strip out the embedded timestamp + if ( ! preg_match("/(\d+TS--->)/", $cache, $match)) + { + return FALSE; + } + + // Has the file expired? If so we'll delete it. + if (time() >= trim(str_replace('TS--->', '', $match['1']))) + { + if (is_really_writable($cache_path)) + { + @unlink($filepath); + log_message('debug', "Cache file has expired. File deleted"); + return FALSE; + } + } + + // Display the cache + $this->_display(str_replace($match['0'], '', $cache)); + log_message('debug', "Cache file is current. Sending it to browser."); + return TRUE; + } + + +} +// END Output Class + +/* End of file Output.php */ +/* Location: ./system/core/Output.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Router.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Router.php new file mode 100644 index 0000000..6da6674 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Router.php @@ -0,0 +1,522 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Router Class + * + * Parses URIs and determines routing + * + * @package CodeIgniter + * @subpackage Libraries + * @author ExpressionEngine Dev Team + * @category Libraries + * @link http://codeigniter.com/user_guide/general/routing.html + */ +class CI_Router { + + /** + * Config class + * + * @var object + * @access public + */ + var $config; + /** + * List of routes + * + * @var array + * @access public + */ + var $routes = array(); + /** + * List of error routes + * + * @var array + * @access public + */ + var $error_routes = array(); + /** + * Current class name + * + * @var string + * @access public + */ + var $class = ''; + /** + * Current method name + * + * @var string + * @access public + */ + var $method = 'index'; + /** + * Sub-directory that contains the requested controller class + * + * @var string + * @access public + */ + var $directory = ''; + /** + * Default controller (and method if specific) + * + * @var string + * @access public + */ + var $default_controller; + + /** + * Constructor + * + * Runs the route mapping function. + */ + function __construct() + { + $this->config =& load_class('Config', 'core'); + $this->uri =& load_class('URI', 'core'); + log_message('debug', "Router Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set the route mapping + * + * This function determines what should be served based on the URI request, + * as well as any "routes" that have been set in the routing config file. + * + * @access private + * @return void + */ + function _set_routing() + { + // Are query strings enabled in the config file? Normally CI doesn't utilize query strings + // since URI segments are more search-engine friendly, but they can optionally be used. + // If this feature is enabled, we will gather the directory/class/method a little differently + $segments = array(); + if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) + { + if (isset($_GET[$this->config->item('directory_trigger')])) + { + $this->set_directory(trim($this->uri->_filter_uri($_GET[$this->config->item('directory_trigger')]))); + $segments[] = $this->fetch_directory(); + } + + if (isset($_GET[$this->config->item('controller_trigger')])) + { + $this->set_class(trim($this->uri->_filter_uri($_GET[$this->config->item('controller_trigger')]))); + $segments[] = $this->fetch_class(); + } + + if (isset($_GET[$this->config->item('function_trigger')])) + { + $this->set_method(trim($this->uri->_filter_uri($_GET[$this->config->item('function_trigger')]))); + $segments[] = $this->fetch_method(); + } + } + + // Load the routes.php file. + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/routes.php'); + } + elseif (is_file(APPPATH.'config/routes.php')) + { + include(APPPATH.'config/routes.php'); + } + + $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; + unset($route); + + // Set the default controller so we can display it in the event + // the URI doesn't correlated to a valid controller. + $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); + + // Were there any query string segments? If so, we'll validate them and bail out since we're done. + if (count($segments) > 0) + { + return $this->_validate_request($segments); + } + + // Fetch the complete URI string + $this->uri->_fetch_uri_string(); + + // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. + if ($this->uri->uri_string == '') + { + return $this->_set_default_controller(); + } + + // Do we need to remove the URL suffix? + $this->uri->_remove_url_suffix(); + + // Compile the segments into an array + $this->uri->_explode_segments(); + + // Parse any custom routing that may exist + $this->_parse_routes(); + + // Re-index the segment array so that it starts with 1 rather than 0 + $this->uri->_reindex_segments(); + } + + // -------------------------------------------------------------------- + + /** + * Set the default controller + * + * @access private + * @return void + */ + function _set_default_controller() + { + if ($this->default_controller === FALSE) + { + show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); + } + // Is the method being specified? + if (strpos($this->default_controller, '/') !== FALSE) + { + $x = explode('/', $this->default_controller); + + $this->set_class($x[0]); + $this->set_method($x[1]); + $this->_set_request($x); + } + else + { + $this->set_class($this->default_controller); + $this->set_method('index'); + $this->_set_request(array($this->default_controller, 'index')); + } + + // re-index the routed segments array so it starts with 1 rather than 0 + $this->uri->_reindex_segments(); + + log_message('debug', "No URI present. Default controller set."); + } + + // -------------------------------------------------------------------- + + /** + * Set the Route + * + * This function takes an array of URI segments as + * input, and sets the current class/method + * + * @access private + * @param array + * @param bool + * @return void + */ + function _set_request($segments = array()) + { + $segments = $this->_validate_request($segments); + + if (count($segments) == 0) + { + return $this->_set_default_controller(); + } + + $this->set_class($segments[0]); + + if (isset($segments[1])) + { + // A standard method request + $this->set_method($segments[1]); + } + else + { + // This lets the "routed" segment array identify that the default + // index method is being used. + $segments[1] = 'index'; + } + + // Update our "routed" segment array to contain the segments. + // Note: If there is no custom routing, this array will be + // identical to $this->uri->segments + $this->uri->rsegments = $segments; + } + + // -------------------------------------------------------------------- + + /** + * Validates the supplied segments. Attempts to determine the path to + * the controller. + * + * @access private + * @param array + * @return array + */ + function _validate_request($segments) + { + if (count($segments) == 0) + { + return $segments; + } + + // Does the requested controller exist in the root folder? + if (file_exists(APPPATH.'controllers/'.$segments[0].'.php')) + { + return $segments; + } + + // Is the controller in a sub-folder? + if (is_dir(APPPATH.'controllers/'.$segments[0])) + { + // Set the directory and remove it from the segment array + $this->set_directory($segments[0]); + $segments = array_slice($segments, 1); + + if (count($segments) > 0) + { + // Does the requested controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php')) + { + if ( ! empty($this->routes['404_override'])) + { + $x = explode('/', $this->routes['404_override']); + + $this->set_directory(''); + $this->set_class($x[0]); + $this->set_method(isset($x[1]) ? $x[1] : 'index'); + + return $x; + } + else + { + show_404($this->fetch_directory().$segments[0]); + } + } + } + else + { + // Is the method being specified in the route? + if (strpos($this->default_controller, '/') !== FALSE) + { + $x = explode('/', $this->default_controller); + + $this->set_class($x[0]); + $this->set_method($x[1]); + } + else + { + $this->set_class($this->default_controller); + $this->set_method('index'); + } + + // Does the default controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.'.php')) + { + $this->directory = ''; + return array(); + } + + } + + return $segments; + } + + + // If we've gotten this far it means that the URI does not correlate to a valid + // controller class. We will now see if there is an override + if ( ! empty($this->routes['404_override'])) + { + $x = explode('/', $this->routes['404_override']); + + $this->set_class($x[0]); + $this->set_method(isset($x[1]) ? $x[1] : 'index'); + + return $x; + } + + + // Nothing else to do at this point but show a 404 + show_404($segments[0]); + } + + // -------------------------------------------------------------------- + + /** + * Parse Routes + * + * This function matches any routes that may exist in + * the config/routes.php file against the URI to + * determine if the class/method need to be remapped. + * + * @access private + * @return void + */ + function _parse_routes() + { + // Turn the segment array into a URI string + $uri = implode('/', $this->uri->segments); + + // Is there a literal match? If so we're done + if (isset($this->routes[$uri])) + { + return $this->_set_request(explode('/', $this->routes[$uri])); + } + + // Loop through the route array looking for wild-cards + foreach ($this->routes as $key => $val) + { + // Convert wild-cards to RegEx + $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); + + // Does the RegEx match? + if (preg_match('#^'.$key.'$#', $uri)) + { + // Do we have a back-reference? + if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) + { + $val = preg_replace('#^'.$key.'$#', $val, $uri); + } + + return $this->_set_request(explode('/', $val)); + } + } + + // If we got this far it means we didn't encounter a + // matching route so we'll set the site default route + $this->_set_request($this->uri->segments); + } + + // -------------------------------------------------------------------- + + /** + * Set the class name + * + * @access public + * @param string + * @return void + */ + function set_class($class) + { + $this->class = str_replace(array('/', '.'), '', $class); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current class + * + * @access public + * @return string + */ + function fetch_class() + { + return $this->class; + } + + // -------------------------------------------------------------------- + + /** + * Set the method name + * + * @access public + * @param string + * @return void + */ + function set_method($method) + { + $this->method = $method; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current method + * + * @access public + * @return string + */ + function fetch_method() + { + if ($this->method == $this->fetch_class()) + { + return 'index'; + } + + return $this->method; + } + + // -------------------------------------------------------------------- + + /** + * Set the directory name + * + * @access public + * @param string + * @return void + */ + function set_directory($dir) + { + $this->directory = str_replace(array('/', '.'), '', $dir).'/'; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the sub-directory (if any) that contains the requested controller class + * + * @access public + * @return string + */ + function fetch_directory() + { + return $this->directory; + } + + // -------------------------------------------------------------------- + + /** + * Set the controller overrides + * + * @access public + * @param array + * @return null + */ + function _set_overrides($routing) + { + if ( ! is_array($routing)) + { + return; + } + + if (isset($routing['directory'])) + { + $this->set_directory($routing['directory']); + } + + if (isset($routing['controller']) AND $routing['controller'] != '') + { + $this->set_class($routing['controller']); + } + + if (isset($routing['function'])) + { + $routing['function'] = ($routing['function'] == '') ? 'index' : $routing['function']; + $this->set_method($routing['function']); + } + } + + +} +// END Router Class + +/* End of file Router.php */ +/* Location: ./system/core/Router.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Security.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Security.php new file mode 100644 index 0000000..00089d7 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Security.php @@ -0,0 +1,876 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Security Class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Security + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/security.html + */ +class CI_Security { + + /** + * Random Hash for protecting URLs + * + * @var string + * @access protected + */ + protected $_xss_hash = ''; + /** + * Random Hash for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ + protected $_csrf_hash = ''; + /** + * Expiration time for Cross Site Request Forgery Protection Cookie + * Defaults to two hours (in seconds) + * + * @var int + * @access protected + */ + protected $_csrf_expire = 7200; + /** + * Token name for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ + protected $_csrf_token_name = 'ci_csrf_token'; + /** + * Cookie name for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ + protected $_csrf_cookie_name = 'ci_csrf_token'; + /** + * List of never allowed strings + * + * @var array + * @access protected + */ + protected $_never_allowed_str = array( + 'document.cookie' => '[removed]', + 'document.write' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', + 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '<!--' => '<!--', + '-->' => '-->', + '<![CDATA[' => '<![CDATA[', + '<comment>' => '<comment>' + ); + + /* never allowed, regex replacement */ + /** + * List of never allowed regex replacement + * + * @var array + * @access protected + */ + protected $_never_allowed_regex = array( + 'javascript\s*:', + 'expression\s*(\(|&\#40;)', // CSS and IE + 'vbscript\s*:', // IE, surprise! + 'Redirect\s+302', + "([\"'])?data\s*:[^\\1]*?base64[^\\1]*?,[^\\1]*?\\1?" + ); + + /** + * Constructor + * + * @return void + */ + public function __construct() + { + // Is CSRF protection enabled? + if (config_item('csrf_protection') === TRUE) + { + // CSRF config + foreach (array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key) + { + if (FALSE !== ($val = config_item($key))) + { + $this->{'_'.$key} = $val; + } + } + + // Append application specific cookie prefix + if (config_item('cookie_prefix')) + { + $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name; + } + + // Set the CSRF hash + $this->_csrf_set_hash(); + } + + log_message('debug', "Security Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Verify Cross Site Request Forgery Protection + * + * @return object + */ + public function csrf_verify() + { + // If it's not a POST request we will set the CSRF cookie + if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST') + { + return $this->csrf_set_cookie(); + } + + // Do the tokens exist in both the _POST and _COOKIE arrays? + if ( ! isset($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name])) + { + $this->csrf_show_error(); + } + + // Do the tokens match? + if ($_POST[$this->_csrf_token_name] != $_COOKIE[$this->_csrf_cookie_name]) + { + $this->csrf_show_error(); + } + + // We kill this since we're done and we don't want to + // polute the _POST array + unset($_POST[$this->_csrf_token_name]); + + // Nothing should last forever + unset($_COOKIE[$this->_csrf_cookie_name]); + $this->_csrf_set_hash(); + $this->csrf_set_cookie(); + + log_message('debug', 'CSRF token verified'); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Cross Site Request Forgery Protection Cookie + * + * @return object + */ + public function csrf_set_cookie() + { + $expire = time() + $this->_csrf_expire; + $secure_cookie = (config_item('cookie_secure') === TRUE) ? 1 : 0; + + if ($secure_cookie && (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) === 'off')) + { + return FALSE; + } + + setcookie($this->_csrf_cookie_name, $this->_csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), $secure_cookie); + + log_message('debug', "CRSF cookie Set"); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Show CSRF Error + * + * @return void + */ + public function csrf_show_error() + { + show_error('The action you have requested is not allowed.'); + } + + // -------------------------------------------------------------------- + + /** + * Get CSRF Hash + * + * Getter Method + * + * @return string self::_csrf_hash + */ + public function get_csrf_hash() + { + return $this->_csrf_hash; + } + + // -------------------------------------------------------------------- + + /** + * Get CSRF Token Name + * + * Getter Method + * + * @return string self::csrf_token_name + */ + public function get_csrf_token_name() + { + return $this->_csrf_token_name; + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented. This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts. Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission. It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://channel.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @param mixed string or array + * @param bool + * @return string + */ + public function xss_clean($str, $is_image = FALSE) + { + /* + * Is the string an array? + * + */ + if (is_array($str)) + { + while (list($key) = each($str)) + { + $str[$key] = $this->xss_clean($str[$key]); + } + + return $str; + } + + /* + * Remove Invisible Characters + */ + $str = remove_invisible_characters($str); + + // Validate Entities in URLs + $str = $this->_validate_entities($str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * <a href="http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D">Google</a> + * + * Note: Use rawurldecode() so it does not remove plus signs + * + */ + $str = rawurldecode($str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + + $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); + + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); + + /* + * Remove Invisible Characters Again! + */ + $str = remove_invisible_characters($str); + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * NOTE: we deal with spaces between characters later. + * NOTE: preg_replace was found to be amazingly slow here on + * large blocks of data, so we use str_replace. + */ + + if (strpos($str, "\t") !== FALSE) + { + $str = str_replace("\t", ' ', $str); + } + + /* + * Capture converted string for later comparison + */ + $converted_string = $str; + + // Remove Strings that are never allowed + $str = $this->_do_never_allowed($str); + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * <?xml + * + * But it doesn't seem to pose a problem. + */ + if ($is_image === TRUE) + { + // Images have a tendency to have the PHP short opening and + // closing tags every so often so we skip those and only + // do the long opening tags. + $str = preg_replace('/<\?(php)/i', "<?\\1", $str); + } + else + { + $str = str_replace(array('<?', '?'.'>'), array('<?', '?>'), $str); + } + + /* + * Compact any exploded words + * + * This corrects words like: j a v a s c r i p t + * These words are compacted back to their correct state. + */ + $words = array( + 'javascript', 'expression', 'vbscript', 'script', 'base64', + 'applet', 'alert', 'document', 'write', 'cookie', 'window' + ); + + foreach ($words as $word) + { + $temp = ''; + + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) + { + $temp .= substr($word, $i, 1)."\s*"; + } + + // We only want to do this when it is followed by a non-word character + // That way valid stuff like "dealer to" does not become "dealerto" + $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); + } + + /* + * Remove disallowed Javascript in links or img tags + * We used to do some version comparisons and use of stripos for PHP5, + * but it is dog slow compared to these simplified non-capturing + * preg_match(), especially if the pattern exists in the string + */ + do + { + $original = $str; + + if (preg_match("/<a/i", $str)) + { + $str = preg_replace_callback("#<a\s+([^>]*?)(>|$)#si", array($this, '_js_link_removal'), $str); + } + + if (preg_match("/<img/i", $str)) + { + $str = preg_replace_callback("#<img\s+([^>]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); + } + + if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) + { + $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); + } + } + while($original != $str); + + unset($original); + + // Remove evil attributes such as style, onclick and xmlns + $str = $this->_remove_evil_attributes($str, $is_image); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: <blink> + * Becomes: <blink> + */ + $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; + $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code un-executable. + * + * For example: eval('some code') + * Becomes: eval('some code') + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + + // Final clean up + // This adds a bit of extra precaution in case + // something got through the above filters + $str = $this->_do_never_allowed($str); + + /* + * Images are Handled in a Special Way + * - Essentially, we want to know that after all of the character + * conversion is done whether any unwanted, likely XSS, code was found. + * If not, we return TRUE, as the image is clean. + * However, if the string post-conversion does not matched the + * string post-removal of XSS, then it fails, as there was unwanted XSS + * code found and removed/changed during processing. + */ + + if ($is_image === TRUE) + { + return ($str == $converted_string) ? TRUE: FALSE; + } + + log_message('debug', "XSS Filtering completed"); + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Random Hash for protecting URLs + * + * @return string + */ + public function xss_hash() + { + if ($this->_xss_hash == '') + { + mt_srand(); + $this->_xss_hash = md5(time() + mt_rand(0, 1999999999)); + } + + return $this->_xss_hash; + } + + // -------------------------------------------------------------------- + + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * The reason we are not using html_entity_decode() by itself is because + * while it is not technically correct to leave out the semicolon + * at the end of an entity most browsers will still interpret the entity + * correctly. html_entity_decode() does not convert entities without + * semicolons, so we are left with our own little solution here. Bummer. + * + * @param string + * @param string + * @return string + */ + public function entity_decode($str, $charset='UTF-8') + { + if (stristr($str, '&') === FALSE) + { + return $str; + } + + $str = html_entity_decode($str, ENT_COMPAT, $charset); + $str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); + return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); + } + + // -------------------------------------------------------------------- + + /** + * Filename Security + * + * @param string + * @param bool + * @return string + */ + public function sanitize_filename($str, $relative_path = FALSE) + { + $bad = array( + "../", + "<!--", + "-->", + "<", + ">", + "'", + '"', + '&', + '$', + '#', + '{', + '}', + '[', + ']', + '=', + ';', + '?', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + if ( ! $relative_path) + { + $bad[] = './'; + $bad[] = '/'; + } + + $str = remove_invisible_characters($str, FALSE); + return stripslashes(str_replace($bad, '', $str)); + } + + // ---------------------------------------------------------------- + + /** + * Compact Exploded Words + * + * Callback function for xss_clean() to remove whitespace from + * things like j a v a s c r i p t + * + * @param type + * @return type + */ + protected function _compact_exploded_words($matches) + { + return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; + } + + // -------------------------------------------------------------------- + + /* + * Remove Evil HTML Attributes (like evenhandlers and style) + * + * It removes the evil attribute and either: + * - Everything up until a space + * For example, everything between the pipes: + * <a |style=document.write('hello');alert('world');| class=link> + * - Everything inside the quotes + * For example, everything between the pipes: + * <a |style="document.write('hello'); alert('world');"| class="link"> + * + * @param string $str The string to check + * @param boolean $is_image TRUE if this is an image + * @return string The string with the evil attributes removed + */ + protected function _remove_evil_attributes($str, $is_image) + { + // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns + $evil_attributes = array('on\w*', 'style', 'xmlns', 'formaction'); + + if ($is_image === TRUE) + { + /* + * Adobe Photoshop puts XML metadata into JFIF images, + * including namespacing, so we have to allow this for images. + */ + unset($evil_attributes[array_search('xmlns', $evil_attributes)]); + } + + do { + $count = 0; + $attribs = array(); + + // find occurrences of illegal attribute strings without quotes + preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s>]*)/is', $str, $matches, PREG_SET_ORDER); + + foreach ($matches as $attr) + { + + $attribs[] = preg_quote($attr[0], '/'); + } + + // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) + preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); + + foreach ($matches as $attr) + { + $attribs[] = preg_quote($attr[0], '/'); + } + + // replace illegal attribute strings that are inside an html tag + if (count($attribs) > 0) + { + $str = preg_replace("/<(\/?[^><]+?)([^A-Za-z<>\-])(.*?)(".implode('|', $attribs).")(.*?)([\s><])([><]*)/i", '<$1 $3$5$6$7', $str, -1, $count); + } + + } while ($count); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Naughty HTML + * + * Callback function for xss_clean() to remove naughty HTML elements + * + * @param array + * @return string + */ + protected function _sanitize_naughty_html($matches) + { + // encode opening brace + $str = '<'.$matches[1].$matches[2].$matches[3]; + + // encode captured opening or closing brace to prevent recursive vectors + $str .= str_replace(array('>', '<'), array('>', '<'), + $matches[4]); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * JS Link Removal + * + * Callback function for xss_clean() to sanitize links + * This limits the PCRE backtracks, making it more performance friendly + * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in + * PHP 5.2+ on link-heavy strings + * + * @param array + * @return string + */ + protected function _js_link_removal($match) + { + return str_replace( + $match[1], + preg_replace( + '#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|data\s*:)#si', + '', + $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])) + ), + $match[0] + ); + } + + // -------------------------------------------------------------------- + + /** + * JS Image Removal + * + * Callback function for xss_clean() to sanitize image tags + * This limits the PCRE backtracks, making it more performance friendly + * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in + * PHP 5.2+ on image tag heavy strings + * + * @param array + * @return string + */ + protected function _js_img_removal($match) + { + return str_replace( + $match[1], + preg_replace( + '#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si', + '', + $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])) + ), + $match[0] + ); + } + + // -------------------------------------------------------------------- + + /** + * Attribute Conversion + * + * Used as a callback for XSS Clean + * + * @param array + * @return string + */ + protected function _convert_attribute($match) + { + return str_replace(array('>', '<', '\\'), array('>', '<', '\\\\'), $match[0]); + } + + // -------------------------------------------------------------------- + + /** + * Filter Attributes + * + * Filters tag attributes for consistency and safety + * + * @param string + * @return string + */ + protected function _filter_attributes($str) + { + $out = ''; + + if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) + { + foreach ($matches[0] as $match) + { + $out .= preg_replace("#/\*.*?\*/#s", '', $match); + } + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * HTML Entity Decode Callback + * + * Used as a callback for XSS Clean + * + * @param array + * @return string + */ + protected function _decode_entity($match) + { + return $this->entity_decode($match[0], strtoupper(config_item('charset'))); + } + + // -------------------------------------------------------------------- + + /** + * Validate URL entities + * + * Called by xss_clean() + * + * @param string + * @return string + */ + protected function _validate_entities($str) + { + /* + * Protect GET variables in URLs + */ + + // 901119URL5918AMP18930PROTECT8198 + + $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str); + + /* + * Validate standard character entities + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str); + + /* + * Validate UTF16 two byte encoding (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); + + /* + * Un-Protect GET variables in URLs + */ + $str = str_replace($this->xss_hash(), '&', $str); + + return $str; + } + + // ---------------------------------------------------------------------- + + /** + * Do Never Allowed + * + * A utility function for xss_clean() + * + * @param string + * @return string + */ + protected function _do_never_allowed($str) + { + $str = str_replace(array_keys($this->_never_allowed_str), $this->_never_allowed_str, $str); + + foreach ($this->_never_allowed_regex as $regex) + { + $str = preg_replace('#'.$regex.'#is', '[removed]', $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Set Cross Site Request Forgery Protection Cookie + * + * @return string + */ + protected function _csrf_set_hash() + { + if ($this->_csrf_hash == '') + { + // If the cookie exists we will use it's value. + // We don't necessarily want to regenerate it with + // each page load since a page could contain embedded + // sub-pages causing this feature to fail + if (isset($_COOKIE[$this->_csrf_cookie_name]) && + preg_match('#^[0-9a-f]{32}$#iS', $_COOKIE[$this->_csrf_cookie_name]) === 1) + { + return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name]; + } + + return $this->_csrf_hash = md5(uniqid(rand(), TRUE)); + } + + return $this->_csrf_hash; + } + +} + +/* End of file Security.php */ +/* Location: ./system/libraries/Security.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/URI.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/URI.php new file mode 100644 index 0000000..a3ae20c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/URI.php @@ -0,0 +1,654 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * URI Class + * + * Parses URIs and determines routing + * + * @package CodeIgniter + * @subpackage Libraries + * @category URI + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/uri.html + */ +class CI_URI { + + /** + * List of cached uri segments + * + * @var array + * @access public + */ + var $keyval = array(); + /** + * Current uri string + * + * @var string + * @access public + */ + var $uri_string; + /** + * List of uri segments + * + * @var array + * @access public + */ + var $segments = array(); + /** + * Re-indexed list of uri segments + * Starts at 1 instead of 0 + * + * @var array + * @access public + */ + var $rsegments = array(); + + /** + * Constructor + * + * Simply globalizes the $RTR object. The front + * loads the Router class early on so it's not available + * normally as other classes are. + * + * @access public + */ + function __construct() + { + $this->config =& load_class('Config', 'core'); + log_message('debug', "URI Class Initialized"); + } + + + // -------------------------------------------------------------------- + + /** + * Get the URI String + * + * @access private + * @return string + */ + function _fetch_uri_string() + { + if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') + { + // Is the request coming from the command line? + if (php_sapi_name() == 'cli' or defined('STDIN')) + { + $this->_set_uri_string($this->_parse_cli_args()); + return; + } + + // Let's try the REQUEST_URI first, this will work in most situations + if ($uri = $this->_detect_uri()) + { + $this->_set_uri_string($uri); + return; + } + + // Is there a PATH_INFO variable? + // Note: some servers seem to have trouble with getenv() so we'll test it two ways + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if (trim($path, '/') != '' && $path != "/".SELF) + { + $this->_set_uri_string($path); + return; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if (trim($path, '/') != '') + { + $this->_set_uri_string($path); + return; + } + + // As a last ditch effort lets try using the $_GET array + if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') + { + $this->_set_uri_string(key($_GET)); + return; + } + + // We've exhausted all our options... + $this->uri_string = ''; + return; + } + + $uri = strtoupper($this->config->item('uri_protocol')); + + if ($uri == 'REQUEST_URI') + { + $this->_set_uri_string($this->_detect_uri()); + return; + } + elseif ($uri == 'CLI') + { + $this->_set_uri_string($this->_parse_cli_args()); + return; + } + + $path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); + $this->_set_uri_string($path); + } + + // -------------------------------------------------------------------- + + /** + * Set the URI String + * + * @access public + * @param string + * @return string + */ + function _set_uri_string($str) + { + // Filter out control characters + $str = remove_invisible_characters($str, FALSE); + + // If the URI contains only a slash we'll kill it + $this->uri_string = ($str == '/') ? '' : $str; + } + + // -------------------------------------------------------------------- + + /** + * Detects the URI + * + * This function will detect the URI automatically and fix the query string + * if necessary. + * + * @access private + * @return string + */ + private function _detect_uri() + { + if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME'])) + { + return ''; + } + + $uri = $_SERVER['REQUEST_URI']; + if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0) + { + $uri = substr($uri, strlen($_SERVER['SCRIPT_NAME'])); + } + elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0) + { + $uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME']))); + } + + // This section ensures that even on servers that require the URI to be in the query string (Nginx) a correct + // URI is found, and also fixes the QUERY_STRING server var and $_GET array. + if (strncmp($uri, '?/', 2) === 0) + { + $uri = substr($uri, 2); + } + $parts = preg_split('#\?#i', $uri, 2); + $uri = $parts[0]; + if (isset($parts[1])) + { + $_SERVER['QUERY_STRING'] = $parts[1]; + parse_str($_SERVER['QUERY_STRING'], $_GET); + } + else + { + $_SERVER['QUERY_STRING'] = ''; + $_GET = array(); + } + + if ($uri == '/' || empty($uri)) + { + return '/'; + } + + $uri = parse_url($uri, PHP_URL_PATH); + + // Do some final cleaning of the URI and return it + return str_replace(array('//', '../'), '/', trim($uri, '/')); + } + + // -------------------------------------------------------------------- + + /** + * Parse cli arguments + * + * Take each command line argument and assume it is a URI segment. + * + * @access private + * @return string + */ + private function _parse_cli_args() + { + $args = array_slice($_SERVER['argv'], 1); + + return $args ? '/' . implode('/', $args) : ''; + } + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) + { + // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards + // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern + if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str)) + { + show_error('The URI you submitted has disallowed characters.', 400); + } + } + + // Convert programatic characters to entities + $bad = array('$', '(', ')', '%28', '%29'); + $good = array('$', '(', ')', '(', ')'); + + return str_replace($bad, $good, $str); + } + + // -------------------------------------------------------------------- + + /** + * Remove the suffix from the URL if needed + * + * @access private + * @return void + */ + function _remove_url_suffix() + { + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + } + + // -------------------------------------------------------------------- + + /** + * Explode the URI Segments. The individual segments will + * be stored in the $this->segments array. + * + * @access private + * @return void + */ + function _explode_segments() + { + foreach (explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + { + $this->segments[] = $val; + } + } + } + + // -------------------------------------------------------------------- + /** + * Re-index Segments + * + * This function re-indexes the $this->segment array so that it + * starts at 1 rather than 0. Doing so makes it simpler to + * use functions like $this->uri->segment(n) since there is + * a 1:1 relationship between the segment array and the actual segments. + * + * @access private + * @return void + */ + function _reindex_segments() + { + array_unshift($this->segments, NULL); + array_unshift($this->rsegments, NULL); + unset($this->segments[0]); + unset($this->rsegments[0]); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment + * + * This function returns the URI segment based on the number provided. + * + * @access public + * @param integer + * @param bool + * @return string + */ + function segment($n, $no_result = FALSE) + { + return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI "routed" Segment + * + * This function returns the re-routed URI segment (assuming routing rules are used) + * based on the number provided. If there is no routing this function returns the + * same result as $this->segment() + * + * @access public + * @param integer + * @param bool + * @return string + */ + function rsegment($n, $no_result = FALSE) + { + return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string + * + * This function generates and associative array of URI data starting + * at the supplied segment. For example, if this is your URI: + * + * example.com/user/search/name/joe/location/UK/gender/male + * + * You can use this function to generate an array with this prototype: + * + * array ( + * name => joe + * location => UK + * gender => male + * ) + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + */ + function uri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'segment'); + } + /** + * Identical to above only it uses the re-routed segment array + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + * + */ + function ruri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string or Re-routed URI string + * + * @access private + * @param integer the starting segment number + * @param array an array of default values + * @param string which array we should use + * @return array + */ + function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') + { + if ($which == 'segment') + { + $total_segments = 'total_segments'; + $segment_array = 'segment_array'; + } + else + { + $total_segments = 'total_rsegments'; + $segment_array = 'rsegment_array'; + } + + if ( ! is_numeric($n)) + { + return $default; + } + + if (isset($this->keyval[$n])) + { + return $this->keyval[$n]; + } + + if ($this->$total_segments() < $n) + { + if (count($default) == 0) + { + return array(); + } + + $retval = array(); + foreach ($default as $val) + { + $retval[$val] = FALSE; + } + return $retval; + } + + $segments = array_slice($this->$segment_array(), ($n - 1)); + + $i = 0; + $lastval = ''; + $retval = array(); + foreach ($segments as $seg) + { + if ($i % 2) + { + $retval[$lastval] = $seg; + } + else + { + $retval[$seg] = FALSE; + $lastval = $seg; + } + + $i++; + } + + if (count($default) > 0) + { + foreach ($default as $val) + { + if ( ! array_key_exists($val, $retval)) + { + $retval[$val] = FALSE; + } + } + } + + // Cache the array for reuse + $this->keyval[$n] = $retval; + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Generate a URI string from an associative array + * + * + * @access public + * @param array an associative array of key/values + * @return array + */ + function assoc_to_uri($array) + { + $temp = array(); + foreach ((array)$array as $key => $val) + { + $temp[] = $key; + $temp[] = $val; + } + + return implode('/', $temp); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_segment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'segment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_rsegment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash - helper function + * + * @access private + * @param integer + * @param string + * @param string + * @return string + */ + function _slash_segment($n, $where = 'trailing', $which = 'segment') + { + $leading = '/'; + $trailing = '/'; + + if ($where == 'trailing') + { + $leading = ''; + } + elseif ($where == 'leading') + { + $trailing = ''; + } + + return $leading.$this->$which($n).$trailing; + } + + // -------------------------------------------------------------------- + + /** + * Segment Array + * + * @access public + * @return array + */ + function segment_array() + { + return $this->segments; + } + + // -------------------------------------------------------------------- + + /** + * Routed Segment Array + * + * @access public + * @return array + */ + function rsegment_array() + { + return $this->rsegments; + } + + // -------------------------------------------------------------------- + + /** + * Total number of segments + * + * @access public + * @return integer + */ + function total_segments() + { + return count($this->segments); + } + + // -------------------------------------------------------------------- + + /** + * Total number of routed segments + * + * @access public + * @return integer + */ + function total_rsegments() + { + return count($this->rsegments); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the entire URI string + * + * @access public + * @return string + */ + function uri_string() + { + return $this->uri_string; + } + + + // -------------------------------------------------------------------- + + /** + * Fetch the entire Re-routed URI string + * + * @access public + * @return string + */ + function ruri_string() + { + return '/'.implode('/', $this->rsegment_array()); + } + +} +// END URI Class + +/* End of file URI.php */ +/* Location: ./system/core/URI.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Utf8.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Utf8.php new file mode 100644 index 0000000..2a27d1f --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Utf8.php @@ -0,0 +1,165 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 2.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Utf8 Class + * + * Provides support for UTF-8 environments + * + * @package CodeIgniter + * @subpackage Libraries + * @category UTF-8 + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/utf8.html + */ +class CI_Utf8 { + + /** + * Constructor + * + * Determines if UTF-8 support is to be enabled + * + */ + function __construct() + { + log_message('debug', "Utf8 Class Initialized"); + + global $CFG; + + if ( + preg_match('/./u', 'é') === 1 // PCRE must support UTF-8 + AND function_exists('iconv') // iconv must be installed + AND ini_get('mbstring.func_overload') != 1 // Multibyte string function overloading cannot be enabled + AND $CFG->item('charset') == 'UTF-8' // Application charset must be UTF-8 + ) + { + log_message('debug', "UTF-8 Support Enabled"); + + define('UTF8_ENABLED', TRUE); + + // set internal encoding for multibyte string functions if necessary + // and set a flag so we don't have to repeatedly use extension_loaded() + // or function_exists() + if (extension_loaded('mbstring')) + { + define('MB_ENABLED', TRUE); + mb_internal_encoding('UTF-8'); + } + else + { + define('MB_ENABLED', FALSE); + } + } + else + { + log_message('debug', "UTF-8 Support Disabled"); + define('UTF8_ENABLED', FALSE); + } + } + + // -------------------------------------------------------------------- + + /** + * Clean UTF-8 strings + * + * Ensures strings are UTF-8 + * + * @access public + * @param string + * @return string + */ + function clean_string($str) + { + if ($this->_is_ascii($str) === FALSE) + { + $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Remove ASCII control characters + * + * Removes all ASCII control characters except horizontal tabs, + * line feeds, and carriage returns, as all others can cause + * problems in XML + * + * @access public + * @param string + * @return string + */ + function safe_ascii_for_xml($str) + { + return remove_invisible_characters($str, FALSE); + } + + // -------------------------------------------------------------------- + + /** + * Convert to UTF-8 + * + * Attempts to convert a string to UTF-8 + * + * @access public + * @param string + * @param string - input encoding + * @return string + */ + function convert_to_utf8($str, $encoding) + { + if (function_exists('iconv')) + { + $str = @iconv($encoding, 'UTF-8', $str); + } + elseif (function_exists('mb_convert_encoding')) + { + $str = @mb_convert_encoding($str, 'UTF-8', $encoding); + } + else + { + return FALSE; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Is ASCII? + * + * Tests if a string is standard 7-bit ASCII or not + * + * @access public + * @param string + * @return bool + */ + function _is_ascii($str) + { + return (preg_match('/[^\x00-\x7F]/S', $str) == 0); + } + + // -------------------------------------------------------------------- + +} +// End Utf8 Class + +/* End of file Utf8.php */ +/* Location: ./system/core/Utf8.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/core/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/language_helper.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/language_helper.php new file mode 100644 index 0000000..ac0d69d --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/helpers/language_helper.php @@ -0,0 +1,58 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Language Helpers + * + * @package CodeIgniter + * @subpackage Helpers + * @category Helpers + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/helpers/language_helper.html + */ + +// ------------------------------------------------------------------------ + +/** + * Lang + * + * Fetches a language variable and optionally outputs a form label + * + * @access public + * @param string the language line + * @param string the id of the form element + * @return string + */ +if ( ! function_exists('lang')) +{ + function lang($line, $id = '') + { + $CI =& get_instance(); + $line = $CI->lang->line($line); + + if ($id != '') + { + $line = '<label for="'.$id.'">'.$line."</label>"; + } + + return $line; + } +} + +// ------------------------------------------------------------------------ +/* End of file language_helper.php */ +/* Location: ./system/helpers/language_helper.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/imglib_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/imglib_lang.php new file mode 100644 index 0000000..66505da --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/imglib_lang.php @@ -0,0 +1,24 @@ +<?php + +$lang['imglib_source_image_required'] = "You must specify a source image in your preferences."; +$lang['imglib_gd_required'] = "The GD image library is required for this feature."; +$lang['imglib_gd_required_for_props'] = "Your server must support the GD image library in order to determine the image properties."; +$lang['imglib_unsupported_imagecreate'] = "Your server does not support the GD function required to process this type of image."; +$lang['imglib_gif_not_supported'] = "GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead."; +$lang['imglib_jpg_not_supported'] = "JPG images are not supported."; +$lang['imglib_png_not_supported'] = "PNG images are not supported."; +$lang['imglib_jpg_or_png_required'] = "The image resize protocol specified in your preferences only works with JPEG or PNG image types."; +$lang['imglib_copy_error'] = "An error was encountered while attempting to replace the file. Please make sure your file directory is writable."; +$lang['imglib_rotate_unsupported'] = "Image rotation does not appear to be supported by your server."; +$lang['imglib_libpath_invalid'] = "The path to your image library is not correct. Please set the correct path in your image preferences."; +$lang['imglib_image_process_failed'] = "Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct."; +$lang['imglib_rotation_angle_required'] = "An angle of rotation is required to rotate the image."; +$lang['imglib_writing_failed_gif'] = "GIF image."; +$lang['imglib_invalid_path'] = "The path to the image is not correct."; +$lang['imglib_copy_failed'] = "The image copy routine failed."; +$lang['imglib_missing_font'] = "Unable to find a font to use."; +$lang['imglib_save_failed'] = "Unable to save the image. Please make sure the image and file directory are writable."; + + +/* End of file imglib_lang.php */ +/* Location: ./system/language/english/imglib_lang.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/upload_lang.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/upload_lang.php new file mode 100644 index 0000000..4de9e9e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/english/upload_lang.php @@ -0,0 +1,22 @@ +<?php + +$lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile."; +$lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file."; +$lang['upload_file_exceeds_form_limit'] = "The uploaded file exceeds the maximum size allowed by the submission form."; +$lang['upload_file_partial'] = "The file was only partially uploaded."; +$lang['upload_no_temp_directory'] = "The temporary folder is missing."; +$lang['upload_unable_to_write_file'] = "The file could not be written to disk."; +$lang['upload_stopped_by_extension'] = "The file upload was stopped by extension."; +$lang['upload_no_file_selected'] = "You did not select a file to upload."; +$lang['upload_invalid_filetype'] = "The filetype you are attempting to upload is not allowed."; +$lang['upload_invalid_filesize'] = "The file you are attempting to upload is larger than the permitted size."; +$lang['upload_invalid_dimensions'] = "The image you are attempting to upload exceedes the maximum height or width."; +$lang['upload_destination_error'] = "A problem was encountered while attempting to move the uploaded file to the final destination."; +$lang['upload_no_filepath'] = "The upload path does not appear to be valid."; +$lang['upload_no_file_types'] = "You have not specified any allowed file types."; +$lang['upload_bad_filename'] = "The file name you submitted already exists on the server."; +$lang['upload_not_writable'] = "The upload destination folder does not appear to be writable."; + + +/* End of file upload_lang.php */ +/* Location: ./system/language/english/upload_lang.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/language/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Image_lib.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Image_lib.php new file mode 100644 index 0000000..21ec2cb --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Image_lib.php @@ -0,0 +1,1537 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * Image Manipulation class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Image_lib + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/image_lib.html + */ +class CI_Image_lib { + + var $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2 + var $library_path = ''; + var $dynamic_output = FALSE; // Whether to send to browser or write to disk + var $source_image = ''; + var $new_image = ''; + var $width = ''; + var $height = ''; + var $quality = '90'; + var $create_thumb = FALSE; + var $thumb_marker = '_thumb'; + var $maintain_ratio = TRUE; // Whether to maintain aspect ratio when resizing or use hard values + var $master_dim = 'auto'; // auto, height, or width. Determines what to use as the master dimension + var $rotation_angle = ''; + var $x_axis = ''; + var $y_axis = ''; + + // Watermark Vars + var $wm_text = ''; // Watermark text if graphic is not used + var $wm_type = 'text'; // Type of watermarking. Options: text/overlay + var $wm_x_transp = 4; + var $wm_y_transp = 4; + var $wm_overlay_path = ''; // Watermark image path + var $wm_font_path = ''; // TT font + var $wm_font_size = 17; // Font size (different versions of GD will either use points or pixels) + var $wm_vrt_alignment = 'B'; // Vertical alignment: T M B + var $wm_hor_alignment = 'C'; // Horizontal alignment: L R C + var $wm_padding = 0; // Padding around text + var $wm_hor_offset = 0; // Lets you push text to the right + var $wm_vrt_offset = 0; // Lets you push text down + var $wm_font_color = '#ffffff'; // Text color + var $wm_shadow_color = ''; // Dropshadow color + var $wm_shadow_distance = 2; // Dropshadow distance + var $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image + + // Private Vars + var $source_folder = ''; + var $dest_folder = ''; + var $mime_type = ''; + var $orig_width = ''; + var $orig_height = ''; + var $image_type = ''; + var $size_str = ''; + var $full_src_path = ''; + var $full_dst_path = ''; + var $create_fnc = 'imagecreatetruecolor'; + var $copy_fnc = 'imagecopyresampled'; + var $error_msg = array(); + var $wm_use_drop_shadow = FALSE; + var $wm_use_truetype = FALSE; + + /** + * Constructor + * + * @param string + * @return void + */ + public function __construct($props = array()) + { + if (count($props) > 0) + { + $this->initialize($props); + } + + log_message('debug', "Image Lib Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize image properties + * + * Resets values in case this class is used in a loop + * + * @access public + * @return void + */ + function clear() + { + $props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'image_type', 'size_str', 'quality', 'orig_width', 'orig_height', 'width', 'height', 'rotation_angle', 'x_axis', 'y_axis', 'create_fnc', 'copy_fnc', 'wm_overlay_path', 'wm_use_truetype', 'dynamic_output', 'wm_font_size', 'wm_text', 'wm_vrt_alignment', 'wm_hor_alignment', 'wm_padding', 'wm_hor_offset', 'wm_vrt_offset', 'wm_font_color', 'wm_use_drop_shadow', 'wm_shadow_color', 'wm_shadow_distance', 'wm_opacity'); + + foreach ($props as $val) + { + $this->$val = ''; + } + + // special consideration for master_dim + $this->master_dim = 'auto'; + } + + // -------------------------------------------------------------------- + + /** + * initialize image preferences + * + * @access public + * @param array + * @return bool + */ + function initialize($props = array()) + { + /* + * Convert array elements into class variables + */ + if (count($props) > 0) + { + foreach ($props as $key => $val) + { + $this->$key = $val; + } + } + + /* + * Is there a source image? + * + * If not, there's no reason to continue + * + */ + if ($this->source_image == '') + { + $this->set_error('imglib_source_image_required'); + return FALSE; + } + + /* + * Is getimagesize() Available? + * + * We use it to determine the image properties (width/height). + * Note: We need to figure out how to determine image + * properties using ImageMagick and NetPBM + * + */ + if ( ! function_exists('getimagesize')) + { + $this->set_error('imglib_gd_required_for_props'); + return FALSE; + } + + $this->image_library = strtolower($this->image_library); + + /* + * Set the full server path + * + * The source image may or may not contain a path. + * Either way, we'll try use realpath to generate the + * full server path in order to more reliably read it. + * + */ + if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) + { + $full_source_path = str_replace("\\", "/", realpath($this->source_image)); + } + else + { + $full_source_path = $this->source_image; + } + + $x = explode('/', $full_source_path); + $this->source_image = end($x); + $this->source_folder = str_replace($this->source_image, '', $full_source_path); + + // Set the Image Properties + if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) + { + return FALSE; + } + + /* + * Assign the "new" image name/path + * + * If the user has set a "new_image" name it means + * we are making a copy of the source image. If not + * it means we are altering the original. We'll + * set the destination filename and path accordingly. + * + */ + if ($this->new_image == '') + { + $this->dest_image = $this->source_image; + $this->dest_folder = $this->source_folder; + } + else + { + if (strpos($this->new_image, '/') === FALSE AND strpos($this->new_image, '\\') === FALSE) + { + $this->dest_folder = $this->source_folder; + $this->dest_image = $this->new_image; + } + else + { + if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) + { + $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); + } + else + { + $full_dest_path = $this->new_image; + } + + // Is there a file name? + if ( ! preg_match("#\.(jpg|jpeg|gif|png)$#i", $full_dest_path)) + { + $this->dest_folder = $full_dest_path.'/'; + $this->dest_image = $this->source_image; + } + else + { + $x = explode('/', $full_dest_path); + $this->dest_image = end($x); + $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path); + } + } + } + + /* + * Compile the finalized filenames/paths + * + * We'll create two master strings containing the + * full server path to the source image and the + * full server path to the destination image. + * We'll also split the destination image name + * so we can insert the thumbnail marker if needed. + * + */ + if ($this->create_thumb === FALSE OR $this->thumb_marker == '') + { + $this->thumb_marker = ''; + } + + $xp = $this->explode_name($this->dest_image); + + $filename = $xp['name']; + $file_ext = $xp['ext']; + + $this->full_src_path = $this->source_folder.$this->source_image; + $this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext; + + /* + * Should we maintain image proportions? + * + * When creating thumbs or copies, the target width/height + * might not be in correct proportion with the source + * image's width/height. We'll recalculate it here. + * + */ + if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) + { + $this->image_reproportion(); + } + + /* + * Was a width and height specified? + * + * If the destination width/height was + * not submitted we will use the values + * from the actual file + * + */ + if ($this->width == '') + $this->width = $this->orig_width; + + if ($this->height == '') + $this->height = $this->orig_height; + + // Set the quality + $this->quality = trim(str_replace("%", "", $this->quality)); + + if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) + $this->quality = 90; + + // Set the x/y coordinates + $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; + $this->y_axis = ($this->y_axis == '' OR ! is_numeric($this->y_axis)) ? 0 : $this->y_axis; + + // Watermark-related Stuff... + if ($this->wm_font_color != '') + { + if (strlen($this->wm_font_color) == 6) + { + $this->wm_font_color = '#'.$this->wm_font_color; + } + } + + if ($this->wm_shadow_color != '') + { + if (strlen($this->wm_shadow_color) == 6) + { + $this->wm_shadow_color = '#'.$this->wm_shadow_color; + } + } + + if ($this->wm_overlay_path != '') + { + $this->wm_overlay_path = str_replace("\\", "/", realpath($this->wm_overlay_path)); + } + + if ($this->wm_shadow_color != '') + { + $this->wm_use_drop_shadow = TRUE; + } + + if ($this->wm_font_path != '') + { + $this->wm_use_truetype = TRUE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Resize + * + * This is a wrapper function that chooses the proper + * resize function based on the protocol specified + * + * @access public + * @return bool + */ + function resize() + { + $protocol = 'image_process_'.$this->image_library; + + if (preg_match('/gd2$/i', $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('resize'); + } + + // -------------------------------------------------------------------- + + /** + * Image Crop + * + * This is a wrapper function that chooses the proper + * cropping function based on the protocol specified + * + * @access public + * @return bool + */ + function crop() + { + $protocol = 'image_process_'.$this->image_library; + + if (preg_match('/gd2$/i', $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('crop'); + } + + // -------------------------------------------------------------------- + + /** + * Image Rotate + * + * This is a wrapper function that chooses the proper + * rotation function based on the protocol specified + * + * @access public + * @return bool + */ + function rotate() + { + // Allowed rotation values + $degs = array(90, 180, 270, 'vrt', 'hor'); + + if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs)) + { + $this->set_error('imglib_rotation_angle_required'); + return FALSE; + } + + // Reassign the width and height + if ($this->rotation_angle == 90 OR $this->rotation_angle == 270) + { + $this->width = $this->orig_height; + $this->height = $this->orig_width; + } + else + { + $this->width = $this->orig_width; + $this->height = $this->orig_height; + } + + + // Choose resizing function + if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm') + { + $protocol = 'image_process_'.$this->image_library; + + return $this->$protocol('rotate'); + } + + if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') + { + return $this->image_mirror_gd(); + } + else + { + return $this->image_rotate_gd(); + } + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using GD/GD2 + * + * This function will resize or crop + * + * @access public + * @param string + * @return bool + */ + function image_process_gd($action = 'resize') + { + $v2_override = FALSE; + + // If the target width/height match the source, AND if the new file name is not equal to the old file name + // we'll simply make a copy of the original with the new name... assuming dynamic rendering is off. + if ($this->dynamic_output === FALSE) + { + if ($this->orig_width == $this->width AND $this->orig_height == $this->height) + { + if ($this->source_image != $this->new_image) + { + if (@copy($this->full_src_path, $this->full_dst_path)) + { + @chmod($this->full_dst_path, FILE_WRITE_MODE); + } + } + + return TRUE; + } + } + + // Let's set up our values based on the action + if ($action == 'crop') + { + // Reassign the source width/height if cropping + $this->orig_width = $this->width; + $this->orig_height = $this->height; + + // GD 2.0 has a cropping bug so we'll test for it + if ($this->gd_version() !== FALSE) + { + $gd_version = str_replace('0', '', $this->gd_version()); + $v2_override = ($gd_version == 2) ? TRUE : FALSE; + } + } + else + { + // If resizing the x/y axis must be zero + $this->x_axis = 0; + $this->y_axis = 0; + } + + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Create The Image + // + // old conditional which users report cause problems with shared GD libs who report themselves as "2.0 or greater" + // it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment + // below should that ever prove inaccurate. + // + // if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) + if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor')) + { + $create = 'imagecreatetruecolor'; + $copy = 'imagecopyresampled'; + } + else + { + $create = 'imagecreate'; + $copy = 'imagecopyresized'; + } + + $dst_img = $create($this->width, $this->height); + + if ($this->image_type == 3) // png we can actually preserve transparency + { + imagealphablending($dst_img, FALSE); + imagesavealpha($dst_img, TRUE); + } + + $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, FILE_WRITE_MODE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using ImageMagick + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_imagemagick($action = 'resize') + { + // Do we have a vaild library path? + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + if ( ! preg_match("/convert$/i", $this->library_path)) + { + $this->library_path = rtrim($this->library_path, '/').'/'; + + $this->library_path .= 'convert'; + } + + // Execute the command + $cmd = $this->library_path." -quality ".$this->quality; + + if ($action == 'crop') + { + $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 'hor' : $angle = '-flop'; + break; + case 'vrt' : $angle = '-flip'; + break; + default : $angle = '-rotate '.$this->rotation_angle; + break; + } + + $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + else // Resize + { + $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // Set the file to 777 + @chmod($this->full_dst_path, FILE_WRITE_MODE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using NetPBM + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_netpbm($action = 'resize') + { + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + // Build the resizing command + switch ($this->image_type) + { + case 1 : + $cmd_in = 'giftopnm'; + $cmd_out = 'ppmtogif'; + break; + case 2 : + $cmd_in = 'jpegtopnm'; + $cmd_out = 'ppmtojpeg'; + break; + case 3 : + $cmd_in = 'pngtopnm'; + $cmd_out = 'ppmtopng'; + break; + } + + if ($action == 'crop') + { + $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 90 : $angle = 'r270'; + break; + case 180 : $angle = 'r180'; + break; + case 270 : $angle = 'r90'; + break; + case 'vrt' : $angle = 'tb'; + break; + case 'hor' : $angle = 'lr'; + break; + } + + $cmd_inner = 'pnmflip -'.$angle.' '; + } + else // Resize + { + $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; + } + + $cmd = $this->library_path.$cmd_in.' '.$this->full_src_path.' | '.$cmd_inner.' | '.$cmd_out.' > '.$this->dest_folder.'netpbm.tmp'; + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // With NetPBM we have to create a temporary image. + // If you try manipulating the original it fails so + // we have to rename the temp file. + copy ($this->dest_folder.'netpbm.tmp', $this->full_dst_path); + unlink ($this->dest_folder.'netpbm.tmp'); + @chmod($this->full_dst_path, FILE_WRITE_MODE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Rotate Using GD + * + * @access public + * @return bool + */ + function image_rotate_gd() + { + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Set the background color + // This won't work with transparent PNG files so we are + // going to have to figure out how to determine the color + // of the alpha channel in a future release. + + $white = imagecolorallocate($src_img, 255, 255, 255); + + // Rotate it! + $dst_img = imagerotate($src_img, $this->rotation_angle, $white); + + // Save the Image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + + @chmod($this->full_dst_path, FILE_WRITE_MODE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Create Mirror Image using GD + * + * This function will flip horizontal or vertical + * + * @access public + * @return bool + */ + function image_mirror_gd() + { + if ( ! $src_img = $this->image_create_gd()) + { + return FALSE; + } + + $width = $this->orig_width; + $height = $this->orig_height; + + if ($this->rotation_angle == 'hor') + { + for ($i = 0; $i < $height; $i++) + { + $left = 0; + $right = $width-1; + + while ($left < $right) + { + $cl = imagecolorat($src_img, $left, $i); + $cr = imagecolorat($src_img, $right, $i); + + imagesetpixel($src_img, $left, $i, $cr); + imagesetpixel($src_img, $right, $i, $cl); + + $left++; + $right--; + } + } + } + else + { + for ($i = 0; $i < $width; $i++) + { + $top = 0; + $bot = $height-1; + + while ($top < $bot) + { + $ct = imagecolorat($src_img, $i, $top); + $cb = imagecolorat($src_img, $i, $bot); + + imagesetpixel($src_img, $i, $top, $cb); + imagesetpixel($src_img, $i, $bot, $ct); + + $top++; + $bot--; + } + } + } + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, FILE_WRITE_MODE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Watermark + * + * This is a wrapper function that chooses the type + * of watermarking based on the specified preference. + * + * @access public + * @param string + * @return bool + */ + function watermark() + { + if ($this->wm_type == 'overlay') + { + return $this->overlay_watermark(); + } + else + { + return $this->text_watermark(); + } + } + + // -------------------------------------------------------------------- + + /** + * Watermark - Graphic Version + * + * @access public + * @return bool + */ + function overlay_watermark() + { + if ( ! function_exists('imagecolortransparent')) + { + $this->set_error('imglib_gd_required'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Fetch watermark image properties + $props = $this->get_image_properties($this->wm_overlay_path, TRUE); + $wm_img_type = $props['image_type']; + $wm_width = $props['width']; + $wm_height = $props['height']; + + // Create two image resources + $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); + $src_img = $this->image_create_gd($this->full_src_path); + + // Reverse the offset if necessary + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Same with the horizontal + // offset when the image is at the right + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set the base x and y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set the vertical position + switch ($this->wm_vrt_alignment) + { + case 'T': + break; + case 'M': $y_axis += ($this->orig_height / 2) - ($wm_height / 2); + break; + case 'B': $y_axis += $this->orig_height - $wm_height; + break; + } + + // Set the horizontal position + switch ($this->wm_hor_alignment) + { + case 'L': + break; + case 'C': $x_axis += ($this->orig_width / 2) - ($wm_width / 2); + break; + case 'R': $x_axis += $this->orig_width - $wm_width; + break; + } + + // Build the finalized image + if ($wm_img_type == 3 AND function_exists('imagealphablending')) + { + @imagealphablending($src_img, TRUE); + } + + // Set RGB values for text and shadow + $rgba = imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp); + $alpha = ($rgba & 0x7F000000) >> 24; + + // make a best guess as to whether we're dealing with an image with alpha transparency or no/binary transparency + if ($alpha > 0) + { + // copy the image directly, the image's alpha transparency being the sole determinant of blending + imagecopy($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height); + } + else + { + // set our RGB value from above to be transparent and merge the images with the specified opacity + imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); + imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); + } + + // Output the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + imagedestroy($src_img); + imagedestroy($wm_img); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Watermark - Text Version + * + * @access public + * @return bool + */ + function text_watermark() + { + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + if ($this->wm_use_truetype == TRUE AND ! file_exists($this->wm_font_path)) + { + $this->set_error('imglib_missing_font'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Set RGB values for text and shadow + $this->wm_font_color = str_replace('#', '', $this->wm_font_color); + $this->wm_shadow_color = str_replace('#', '', $this->wm_shadow_color); + + $R1 = hexdec(substr($this->wm_font_color, 0, 2)); + $G1 = hexdec(substr($this->wm_font_color, 2, 2)); + $B1 = hexdec(substr($this->wm_font_color, 4, 2)); + + $R2 = hexdec(substr($this->wm_shadow_color, 0, 2)); + $G2 = hexdec(substr($this->wm_shadow_color, 2, 2)); + $B2 = hexdec(substr($this->wm_shadow_color, 4, 2)); + + $txt_color = imagecolorclosest($src_img, $R1, $G1, $B1); + $drp_color = imagecolorclosest($src_img, $R2, $G2, $B2); + + // Reverse the vertical offset + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Note: The horizontal + // offset flips itself automatically + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set font width and height + // These are calculated differently depending on + // whether we are using the true type font or not + if ($this->wm_use_truetype == TRUE) + { + if ($this->wm_font_size == '') + $this->wm_font_size = '17'; + + $fontwidth = $this->wm_font_size-($this->wm_font_size/4); + $fontheight = $this->wm_font_size; + $this->wm_vrt_offset += $this->wm_font_size; + } + else + { + $fontwidth = imagefontwidth($this->wm_font_size); + $fontheight = imagefontheight($this->wm_font_size); + } + + // Set base X and Y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set verticle alignment + if ($this->wm_use_drop_shadow == FALSE) + $this->wm_shadow_distance = 0; + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + switch ($this->wm_vrt_alignment) + { + case "T" : + break; + case "M": $y_axis += ($this->orig_height/2)+($fontheight/2); + break; + case "B": $y_axis += ($this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight/2)); + break; + } + + $x_shad = $x_axis + $this->wm_shadow_distance; + $y_shad = $y_axis + $this->wm_shadow_distance; + + // Set horizontal alignment + switch ($this->wm_hor_alignment) + { + case "L": + break; + case "R": + if ($this->wm_use_drop_shadow) + $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + break; + case "C": + if ($this->wm_use_drop_shadow) + $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); + $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); + break; + } + + // Add the text to the source image + if ($this->wm_use_truetype) + { + if ($this->wm_use_drop_shadow) + imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); + imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); + } + else + { + if ($this->wm_use_drop_shadow) + imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); + imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); + } + + // Output the final image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + $this->image_save_gd($src_img); + } + + imagedestroy($src_img); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Create Image - GD + * + * This simply creates an image resource handle + * based on the type of image being processed + * + * @access public + * @param string + * @return resource + */ + function image_create_gd($path = '', $image_type = '') + { + if ($path == '') + $path = $this->full_src_path; + + if ($image_type == '') + $image_type = $this->image_type; + + + switch ($image_type) + { + case 1 : + if ( ! function_exists('imagecreatefromgif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + return imagecreatefromgif($path); + break; + case 2 : + if ( ! function_exists('imagecreatefromjpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + return imagecreatefromjpeg($path); + break; + case 3 : + if ( ! function_exists('imagecreatefrompng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + return imagecreatefrompng($path); + break; + + } + + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Write image file to disk - GD + * + * Takes an image resource as input and writes the file + * to the specified destination + * + * @access public + * @param resource + * @return bool + */ + function image_save_gd($resource) + { + switch ($this->image_type) + { + case 1 : + if ( ! function_exists('imagegif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + if ( ! @imagegif($resource, $this->full_dst_path)) + { + $this->set_error('imglib_save_failed'); + return FALSE; + } + break; + case 2 : + if ( ! function_exists('imagejpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + if ( ! @imagejpeg($resource, $this->full_dst_path, $this->quality)) + { + $this->set_error('imglib_save_failed'); + return FALSE; + } + break; + case 3 : + if ( ! function_exists('imagepng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + if ( ! @imagepng($resource, $this->full_dst_path)) + { + $this->set_error('imglib_save_failed'); + return FALSE; + } + break; + default : + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + break; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Dynamically outputs an image + * + * @access public + * @param resource + * @return void + */ + function image_display_gd($resource) + { + header("Content-Disposition: filename={$this->source_image};"); + header("Content-Type: {$this->mime_type}"); + header('Content-Transfer-Encoding: binary'); + header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); + + switch ($this->image_type) + { + case 1 : imagegif($resource); + break; + case 2 : imagejpeg($resource, '', $this->quality); + break; + case 3 : imagepng($resource); + break; + default : echo 'Unable to display the image'; + break; + } + } + + // -------------------------------------------------------------------- + + /** + * Re-proportion Image Width/Height + * + * When creating thumbs, the desired width/height + * can end up warping the image due to an incorrect + * ratio between the full-sized image and the thumb. + * + * This function lets us re-proportion the width/height + * if users choose to maintain the aspect ratio when resizing. + * + * @access public + * @return void + */ + function image_reproportion() + { + if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) + return; + + if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) + return; + + $new_width = ceil($this->orig_width*$this->height/$this->orig_height); + $new_height = ceil($this->width*$this->orig_height/$this->orig_width); + + $ratio = (($this->orig_height/$this->orig_width) - ($this->height/$this->width)); + + if ($this->master_dim != 'width' AND $this->master_dim != 'height') + { + $this->master_dim = ($ratio < 0) ? 'width' : 'height'; + } + + if (($this->width != $new_width) AND ($this->height != $new_height)) + { + if ($this->master_dim == 'height') + { + $this->width = $new_width; + } + else + { + $this->height = $new_height; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Get image properties + * + * A helper function that gets info about the file + * + * @access public + * @param string + * @return mixed + */ + function get_image_properties($path = '', $return = FALSE) + { + // For now we require GD but we should + // find a way to determine this using IM or NetPBM + + if ($path == '') + $path = $this->full_src_path; + + if ( ! file_exists($path)) + { + $this->set_error('imglib_invalid_path'); + return FALSE; + } + + $vals = @getimagesize($path); + + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg'; + + if ($return == TRUE) + { + $v['width'] = $vals['0']; + $v['height'] = $vals['1']; + $v['image_type'] = $vals['2']; + $v['size_str'] = $vals['3']; + $v['mime_type'] = $mime; + + return $v; + } + + $this->orig_width = $vals['0']; + $this->orig_height = $vals['1']; + $this->image_type = $vals['2']; + $this->size_str = $vals['3']; + $this->mime_type = $mime; + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Size calculator + * + * This function takes a known width x height and + * recalculates it to a new size. Only one + * new variable needs to be known + * + * $props = array( + * 'width' => $width, + * 'height' => $height, + * 'new_width' => 40, + * 'new_height' => '' + * ); + * + * @access public + * @param array + * @return array + */ + function size_calculator($vals) + { + if ( ! is_array($vals)) + { + return; + } + + $allowed = array('new_width', 'new_height', 'width', 'height'); + + foreach ($allowed as $item) + { + if ( ! isset($vals[$item]) OR $vals[$item] == '') + $vals[$item] = 0; + } + + if ($vals['width'] == 0 OR $vals['height'] == 0) + { + return $vals; + } + + if ($vals['new_width'] == 0) + { + $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); + } + elseif ($vals['new_height'] == 0) + { + $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); + } + + return $vals; + } + + // -------------------------------------------------------------------- + + /** + * Explode source_image + * + * This is a helper function that extracts the extension + * from the source_image. This function lets us deal with + * source_images with multiple periods, like: my.cool.jpg + * It returns an associative array with two elements: + * $array['ext'] = '.jpg'; + * $array['name'] = 'my.cool'; + * + * @access public + * @param array + * @return array + */ + function explode_name($source_image) + { + $ext = strrchr($source_image, '.'); + $name = ($ext === FALSE) ? $source_image : substr($source_image, 0, -strlen($ext)); + + return array('ext' => $ext, 'name' => $name); + } + + // -------------------------------------------------------------------- + + /** + * Is GD Installed? + * + * @access public + * @return bool + */ + function gd_loaded() + { + if ( ! extension_loaded('gd')) + { + if ( ! dl('gd.so')) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Get GD version + * + * @access public + * @return mixed + */ + function gd_version() + { + if (function_exists('gd_info')) + { + $gd_version = @gd_info(); + $gd_version = preg_replace("/\D/", "", $gd_version['GD Version']); + + return $gd_version; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Set error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + $CI =& get_instance(); + $CI->lang->load('imglib'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + + $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + + // -------------------------------------------------------------------- + + /** + * Show error messages + * + * @access public + * @param string + * @return string + */ + function display_errors($open = '<p>', $close = '</p>') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + +} +// END Image_lib Class + +/* End of file Image_lib.php */ +/* Location: ./system/libraries/Image_lib.php */
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Upload.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Upload.php new file mode 100644 index 0000000..0e5d73b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Upload.php @@ -0,0 +1,1136 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * @package CodeIgniter + * @author ExpressionEngine Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +// ------------------------------------------------------------------------ + +/** + * File Uploading Class + * + * @package CodeIgniter + * @subpackage Libraries + * @category Uploads + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/libraries/file_uploading.html + */ +class CI_Upload { + + public $max_size = 0; + public $max_width = 0; + public $max_height = 0; + public $max_filename = 0; + public $allowed_types = ""; + public $file_temp = ""; + public $file_name = ""; + public $orig_name = ""; + public $file_type = ""; + public $file_size = ""; + public $file_ext = ""; + public $upload_path = ""; + public $overwrite = FALSE; + public $encrypt_name = FALSE; + public $is_image = FALSE; + public $image_width = ''; + public $image_height = ''; + public $image_type = ''; + public $image_size_str = ''; + public $error_msg = array(); + public $mimes = array(); + public $remove_spaces = TRUE; + public $xss_clean = FALSE; + public $temp_prefix = "temp_file_"; + public $client_name = ''; + + protected $_file_name_override = ''; + + /** + * Constructor + * + * @access public + */ + public function __construct($props = array()) + { + if (count($props) > 0) + { + $this->initialize($props); + } + + log_message('debug', "Upload Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize preferences + * + * @param array + * @return void + */ + public function initialize($config = array()) + { + $defaults = array( + 'max_size' => 0, + 'max_width' => 0, + 'max_height' => 0, + 'max_filename' => 0, + 'allowed_types' => "", + 'file_temp' => "", + 'file_name' => "", + 'orig_name' => "", + 'file_type' => "", + 'file_size' => "", + 'file_ext' => "", + 'upload_path' => "", + 'overwrite' => FALSE, + 'encrypt_name' => FALSE, + 'is_image' => FALSE, + 'image_width' => '', + 'image_height' => '', + 'image_type' => '', + 'image_size_str' => '', + 'error_msg' => array(), + 'mimes' => array(), + 'remove_spaces' => TRUE, + 'xss_clean' => FALSE, + 'temp_prefix' => "temp_file_", + 'client_name' => '' + ); + + + foreach ($defaults as $key => $val) + { + if (isset($config[$key])) + { + $method = 'set_'.$key; + if (method_exists($this, $method)) + { + $this->$method($config[$key]); + } + else + { + $this->$key = $config[$key]; + } + } + else + { + $this->$key = $val; + } + } + + // if a file_name was provided in the config, use it instead of the user input + // supplied file name for all uploads until initialized again + $this->_file_name_override = $this->file_name; + } + + // -------------------------------------------------------------------- + + /** + * Perform the file upload + * + * @return bool + */ + public function do_upload($field = 'userfile') + { + + // Is $_FILES[$field] set? If not, no reason to continue. + if ( ! isset($_FILES[$field])) + { + $this->set_error('upload_no_file_selected'); + return FALSE; + } + + // Is the upload path valid? + if ( ! $this->validate_upload_path()) + { + // errors will already be set by validate_upload_path() so just return FALSE + return FALSE; + } + + // Was the file able to be uploaded? If not, determine the reason why. + if ( ! is_uploaded_file($_FILES[$field]['tmp_name'])) + { + $error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error']; + + switch($error) + { + case 1: // UPLOAD_ERR_INI_SIZE + $this->set_error('upload_file_exceeds_limit'); + break; + case 2: // UPLOAD_ERR_FORM_SIZE + $this->set_error('upload_file_exceeds_form_limit'); + break; + case 3: // UPLOAD_ERR_PARTIAL + $this->set_error('upload_file_partial'); + break; + case 4: // UPLOAD_ERR_NO_FILE + $this->set_error('upload_no_file_selected'); + break; + case 6: // UPLOAD_ERR_NO_TMP_DIR + $this->set_error('upload_no_temp_directory'); + break; + case 7: // UPLOAD_ERR_CANT_WRITE + $this->set_error('upload_unable_to_write_file'); + break; + case 8: // UPLOAD_ERR_EXTENSION + $this->set_error('upload_stopped_by_extension'); + break; + default : $this->set_error('upload_no_file_selected'); + break; + } + + return FALSE; + } + + + // Set the uploaded data as class variables + $this->file_temp = $_FILES[$field]['tmp_name']; + $this->file_size = $_FILES[$field]['size']; + $this->_file_mime_type($_FILES[$field]); + $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $this->file_type); + $this->file_type = strtolower(trim(stripslashes($this->file_type), '"')); + $this->file_name = $this->_prep_filename($_FILES[$field]['name']); + $this->file_ext = $this->get_extension($this->file_name); + $this->client_name = $this->file_name; + + // Is the file type allowed to be uploaded? + if ( ! $this->is_allowed_filetype()) + { + $this->set_error('upload_invalid_filetype'); + return FALSE; + } + + // if we're overriding, let's now make sure the new name and type is allowed + if ($this->_file_name_override != '') + { + $this->file_name = $this->_prep_filename($this->_file_name_override); + + // If no extension was provided in the file_name config item, use the uploaded one + if (strpos($this->_file_name_override, '.') === FALSE) + { + $this->file_name .= $this->file_ext; + } + + // An extension was provided, lets have it! + else + { + $this->file_ext = $this->get_extension($this->_file_name_override); + } + + if ( ! $this->is_allowed_filetype(TRUE)) + { + $this->set_error('upload_invalid_filetype'); + return FALSE; + } + } + + // Convert the file size to kilobytes + if ($this->file_size > 0) + { + $this->file_size = round($this->file_size/1024, 2); + } + + // Is the file size within the allowed maximum? + if ( ! $this->is_allowed_filesize()) + { + $this->set_error('upload_invalid_filesize'); + return FALSE; + } + + // Are the image dimensions within the allowed size? + // Note: This can fail if the server has an open_basdir restriction. + if ( ! $this->is_allowed_dimensions()) + { + $this->set_error('upload_invalid_dimensions'); + return FALSE; + } + + // Sanitize the file name for security + $this->file_name = $this->clean_file_name($this->file_name); + + // Truncate the file name if it's too long + if ($this->max_filename > 0) + { + $this->file_name = $this->limit_filename_length($this->file_name, $this->max_filename); + } + + // Remove white spaces in the name + if ($this->remove_spaces == TRUE) + { + $this->file_name = preg_replace("/\s+/", "_", $this->file_name); + } + + /* + * Validate the file name + * This function appends an number onto the end of + * the file if one with the same name already exists. + * If it returns false there was a problem. + */ + $this->orig_name = $this->file_name; + + if ($this->overwrite == FALSE) + { + $this->file_name = $this->set_filename($this->upload_path, $this->file_name); + + if ($this->file_name === FALSE) + { + return FALSE; + } + } + + /* + * Run the file through the XSS hacking filter + * This helps prevent malicious code from being + * embedded within a file. Scripts can easily + * be disguised as images or other file types. + */ + if ($this->xss_clean) + { + if ($this->do_xss_clean() === FALSE) + { + $this->set_error('upload_unable_to_write_file'); + return FALSE; + } + } + + /* + * Move the file to the final destination + * To deal with different server configurations + * we'll attempt to use copy() first. If that fails + * we'll use move_uploaded_file(). One of the two should + * reliably work in most environments + */ + if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) + { + if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) + { + $this->set_error('upload_destination_error'); + return FALSE; + } + } + + /* + * Set the finalized image dimensions + * This sets the image width/height (assuming the + * file was an image). We use this information + * in the "data" function. + */ + $this->set_image_properties($this->upload_path.$this->file_name); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Finalized Data Array + * + * Returns an associative array containing all of the information + * related to the upload, allowing the developer easy access in one array. + * + * @return array + */ + public function data() + { + return array ( + 'file_name' => $this->file_name, + 'file_type' => $this->file_type, + 'file_path' => $this->upload_path, + 'full_path' => $this->upload_path.$this->file_name, + 'raw_name' => str_replace($this->file_ext, '', $this->file_name), + 'orig_name' => $this->orig_name, + 'client_name' => $this->client_name, + 'file_ext' => $this->file_ext, + 'file_size' => $this->file_size, + 'is_image' => $this->is_image(), + 'image_width' => $this->image_width, + 'image_height' => $this->image_height, + 'image_type' => $this->image_type, + 'image_size_str' => $this->image_size_str, + ); + } + + // -------------------------------------------------------------------- + + /** + * Set Upload Path + * + * @param string + * @return void + */ + public function set_upload_path($path) + { + // Make sure it has a trailing slash + $this->upload_path = rtrim($path, '/').'/'; + } + + // -------------------------------------------------------------------- + + /** + * Set the file name + * + * This function takes a filename/path as input and looks for the + * existence of a file with the same name. If found, it will append a + * number to the end of the filename to avoid overwriting a pre-existing file. + * + * @param string + * @param string + * @return string + */ + public function set_filename($path, $filename) + { + if ($this->encrypt_name == TRUE) + { + mt_srand(); + $filename = md5(uniqid(mt_rand())).$this->file_ext; + } + + if ( ! file_exists($path.$filename)) + { + return $filename; + } + + $filename = str_replace($this->file_ext, '', $filename); + + $new_filename = ''; + for ($i = 1; $i < 100; $i++) + { + if ( ! file_exists($path.$filename.$i.$this->file_ext)) + { + $new_filename = $filename.$i.$this->file_ext; + break; + } + } + + if ($new_filename == '') + { + $this->set_error('upload_bad_filename'); + return FALSE; + } + else + { + return $new_filename; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum File Size + * + * @param integer + * @return void + */ + public function set_max_filesize($n) + { + $this->max_size = ((int) $n < 0) ? 0: (int) $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum File Name Length + * + * @param integer + * @return void + */ + public function set_max_filename($n) + { + $this->max_filename = ((int) $n < 0) ? 0: (int) $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Width + * + * @param integer + * @return void + */ + public function set_max_width($n) + { + $this->max_width = ((int) $n < 0) ? 0: (int) $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Height + * + * @param integer + * @return void + */ + public function set_max_height($n) + { + $this->max_height = ((int) $n < 0) ? 0: (int) $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Allowed File Types + * + * @param string + * @return void + */ + public function set_allowed_types($types) + { + if ( ! is_array($types) && $types == '*') + { + $this->allowed_types = '*'; + return; + } + $this->allowed_types = explode('|', $types); + } + + // -------------------------------------------------------------------- + + /** + * Set Image Properties + * + * Uses GD to determine the width/height/type of image + * + * @param string + * @return void + */ + public function set_image_properties($path = '') + { + if ( ! $this->is_image()) + { + return; + } + + if (function_exists('getimagesize')) + { + if (FALSE !== ($D = @getimagesize($path))) + { + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $this->image_width = $D['0']; + $this->image_height = $D['1']; + $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']]; + $this->image_size_str = $D['3']; // string containing height and width + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set XSS Clean + * + * Enables the XSS flag so that the file that was uploaded + * will be run through the XSS filter. + * + * @param bool + * @return void + */ + public function set_xss_clean($flag = FALSE) + { + $this->xss_clean = ($flag == TRUE) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Validate the image + * + * @return bool + */ + public function is_image() + { + // IE will sometimes return odd mime-types during upload, so here we just standardize all + // jpegs or pngs to the same file type. + + $png_mimes = array('image/x-png'); + $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg'); + + if (in_array($this->file_type, $png_mimes)) + { + $this->file_type = 'image/png'; + } + + if (in_array($this->file_type, $jpeg_mimes)) + { + $this->file_type = 'image/jpeg'; + } + + $img_mimes = array( + 'image/gif', + 'image/jpeg', + 'image/png', + ); + + return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the filetype is allowed + * + * @return bool + */ + public function is_allowed_filetype($ignore_mime = FALSE) + { + if ($this->allowed_types == '*') + { + return TRUE; + } + + if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types)) + { + $this->set_error('upload_no_file_types'); + return FALSE; + } + + $ext = strtolower(ltrim($this->file_ext, '.')); + + if ( ! in_array($ext, $this->allowed_types)) + { + return FALSE; + } + + // Images get some additional checks + $image_types = array('gif', 'jpg', 'jpeg', 'png', 'jpe'); + + if (in_array($ext, $image_types)) + { + if (getimagesize($this->file_temp) === FALSE) + { + return FALSE; + } + } + + if ($ignore_mime === TRUE) + { + return TRUE; + } + + $mime = $this->mimes_types($ext); + + if (is_array($mime)) + { + if (in_array($this->file_type, $mime, TRUE)) + { + return TRUE; + } + } + elseif ($mime == $this->file_type) + { + return TRUE; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the file is within the allowed size + * + * @return bool + */ + public function is_allowed_filesize() + { + if ($this->max_size != 0 AND $this->file_size > $this->max_size) + { + return FALSE; + } + else + { + return TRUE; + } + } + + // -------------------------------------------------------------------- + + /** + * Verify that the image is within the allowed width/height + * + * @return bool + */ + public function is_allowed_dimensions() + { + if ( ! $this->is_image()) + { + return TRUE; + } + + if (function_exists('getimagesize')) + { + $D = @getimagesize($this->file_temp); + + if ($this->max_width > 0 AND $D['0'] > $this->max_width) + { + return FALSE; + } + + if ($this->max_height > 0 AND $D['1'] > $this->max_height) + { + return FALSE; + } + + return TRUE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Validate Upload Path + * + * Verifies that it is a valid upload path with proper permissions. + * + * + * @return bool + */ + public function validate_upload_path() + { + if ($this->upload_path == '') + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if (function_exists('realpath') AND @realpath($this->upload_path) !== FALSE) + { + $this->upload_path = str_replace("\\", "/", realpath($this->upload_path)); + } + + if ( ! @is_dir($this->upload_path)) + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if ( ! is_really_writable($this->upload_path)) + { + $this->set_error('upload_not_writable'); + return FALSE; + } + + $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Extract the file extension + * + * @param string + * @return string + */ + public function get_extension($filename) + { + $x = explode('.', $filename); + return '.'.end($x); + } + + // -------------------------------------------------------------------- + + /** + * Clean the file name for security + * + * @param string + * @return string + */ + public function clean_file_name($filename) + { + $bad = array( + "<!--", + "-->", + "'", + "<", + ">", + '"', + '&', + '$', + '=', + ';', + '?', + '/', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + $filename = str_replace($bad, '', $filename); + + return stripslashes($filename); + } + + // -------------------------------------------------------------------- + + /** + * Limit the File Name Length + * + * @param string + * @return string + */ + public function limit_filename_length($filename, $length) + { + if (strlen($filename) < $length) + { + return $filename; + } + + $ext = ''; + if (strpos($filename, '.') !== FALSE) + { + $parts = explode('.', $filename); + $ext = '.'.array_pop($parts); + $filename = implode('.', $parts); + } + + return substr($filename, 0, ($length - strlen($ext))).$ext; + } + + // -------------------------------------------------------------------- + + /** + * Runs the file through the XSS clean function + * + * This prevents people from embedding malicious code in their files. + * I'm not sure that it won't negatively affect certain files in unexpected ways, + * but so far I haven't found that it causes trouble. + * + * @return void + */ + public function do_xss_clean() + { + $file = $this->file_temp; + + if (filesize($file) == 0) + { + return FALSE; + } + + if (function_exists('memory_get_usage') && memory_get_usage() && ini_get('memory_limit') != '') + { + $current = ini_get('memory_limit') * 1024 * 1024; + + // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output + // into scientific notation. number_format() ensures this number is an integer + // http://bugs.php.net/bug.php?id=43053 + + $new_memory = number_format(ceil(filesize($file) + $current), 0, '.', ''); + + ini_set('memory_limit', $new_memory); // When an integer is used, the value is measured in bytes. - PHP.net + } + + // If the file being uploaded is an image, then we should have no problem with XSS attacks (in theory), but + // IE can be fooled into mime-type detecting a malformed image as an html file, thus executing an XSS attack on anyone + // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this + // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of + // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an + // attempted XSS attack. + + if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) + { + if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary + { + return FALSE; // Couldn't open the file, return FALSE + } + + $opening_bytes = fread($file, 256); + fclose($file); + + // These are known to throw IE into mime-type detection chaos + // <a, <body, <head, <html, <img, <plaintext, <pre, <script, <table, <title + // title is basically just in SVG, but we filter it anyhow + + if ( ! preg_match('/<(a|body|head|html|img|plaintext|pre|script|table|title)[\s>]/i', $opening_bytes)) + { + return TRUE; // its an image, no "triggers" detected in the first 256 bytes, we're good + } + else + { + return FALSE; + } + } + + if (($data = @file_get_contents($file)) === FALSE) + { + return FALSE; + } + + $CI =& get_instance(); + return $CI->security->xss_clean($data, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Set an error message + * + * @param string + * @return void + */ + public function set_error($msg) + { + $CI =& get_instance(); + $CI->lang->load('upload'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + + // -------------------------------------------------------------------- + + /** + * Display the error message + * + * @param string + * @param string + * @return string + */ + public function display_errors($open = '<p>', $close = '</p>') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * List of Mime Types + * + * This is a list of mime types. We use it to validate + * the "allowed types" set by the developer + * + * @param string + * @return string + */ + public function mimes_types($mime) + { + global $mimes; + + if (count($this->mimes) == 0) + { + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); + } + elseif (is_file(APPPATH.'config/mimes.php')) + { + include(APPPATH.'config//mimes.php'); + } + else + { + return FALSE; + } + + $this->mimes = $mimes; + unset($mimes); + } + + return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; + } + + // -------------------------------------------------------------------- + + /** + * Prep Filename + * + * Prevents possible script execution from Apache's handling of files multiple extensions + * http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext + * + * @param string + * @return string + */ + protected function _prep_filename($filename) + { + if (strpos($filename, '.') === FALSE OR $this->allowed_types == '*') + { + return $filename; + } + + $parts = explode('.', $filename); + $ext = array_pop($parts); + $filename = array_shift($parts); + + foreach ($parts as $part) + { + if ( ! in_array(strtolower($part), $this->allowed_types) OR $this->mimes_types(strtolower($part)) === FALSE) + { + $filename .= '.'.$part.'_'; + } + else + { + $filename .= '.'.$part; + } + } + + $filename .= '.'.$ext; + + return $filename; + } + + // -------------------------------------------------------------------- + + /** + * File MIME type + * + * Detects the (actual) MIME type of the uploaded file, if possible. + * The input array is expected to be $_FILES[$field] + * + * @param array + * @return void + */ + protected function _file_mime_type($file) + { + // We'll need this to validate the MIME info string (e.g. text/plain; charset=us-ascii) + $regexp = '/^([a-z\-]+\/[a-z0-9\-\.\+]+)(;\s.+)?$/'; + + /* Fileinfo extension - most reliable method + * + * Unfortunately, prior to PHP 5.3 - it's only available as a PECL extension and the + * more convenient FILEINFO_MIME_TYPE flag doesn't exist. + */ + if (function_exists('finfo_file')) + { + $finfo = finfo_open(FILEINFO_MIME); + if (is_resource($finfo)) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system + { + $mime = @finfo_file($finfo, $file['tmp_name']); + finfo_close($finfo); + + /* According to the comments section of the PHP manual page, + * it is possible that this function returns an empty string + * for some files (e.g. if they don't exist in the magic MIME database) + */ + if (is_string($mime) && preg_match($regexp, $mime, $matches)) + { + $this->file_type = $matches[1]; + return; + } + } + } + + /* This is an ugly hack, but UNIX-type systems provide a "native" way to detect the file type, + * which is still more secure than depending on the value of $_FILES[$field]['type'], and as it + * was reported in issue #750 (https://github.com/EllisLab/CodeIgniter/issues/750) - it's better + * than mime_content_type() as well, hence the attempts to try calling the command line with + * three different functions. + * + * Notes: + * - the DIRECTORY_SEPARATOR comparison ensures that we're not on a Windows system + * - many system admins would disable the exec(), shell_exec(), popen() and similar functions + * due to security concerns, hence the function_exists() checks + */ + if (DIRECTORY_SEPARATOR !== '\\') + { + $cmd = 'file --brief --mime ' . escapeshellarg($file['tmp_name']) . ' 2>&1'; + + if (function_exists('exec')) + { + /* This might look confusing, as $mime is being populated with all of the output when set in the second parameter. + * However, we only neeed the last line, which is the actual return value of exec(), and as such - it overwrites + * anything that could already be set for $mime previously. This effectively makes the second parameter a dummy + * value, which is only put to allow us to get the return status code. + */ + $mime = @exec($cmd, $mime, $return_status); + if ($return_status === 0 && is_string($mime) && preg_match($regexp, $mime, $matches)) + { + $this->file_type = $matches[1]; + return; + } + } + + if ( (bool) @ini_get('safe_mode') === FALSE && function_exists('shell_exec')) + { + $mime = @shell_exec($cmd); + if (strlen($mime) > 0) + { + $mime = explode("\n", trim($mime)); + if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) + { + $this->file_type = $matches[1]; + return; + } + } + } + + if (function_exists('popen')) + { + $proc = @popen($cmd, 'r'); + if (is_resource($proc)) + { + $mime = @fread($proc, 512); + @pclose($proc); + if ($mime !== FALSE) + { + $mime = explode("\n", trim($mime)); + if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) + { + $this->file_type = $matches[1]; + return; + } + } + } + } + } + + // Fall back to the deprecated mime_content_type(), if available (still better than $_FILES[$field]['type']) + if (function_exists('mime_content_type')) + { + $this->file_type = @mime_content_type($file['tmp_name']); + if (strlen($this->file_type) > 0) // It's possible that mime_content_type() returns FALSE or an empty string + { + return; + } + } + + $this->file_type = $file['type']; + } + + // -------------------------------------------------------------------- + +} +// END Upload Class + +/* End of file Upload.php */ +/* Location: ./system/libraries/Upload.php */ diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/index.html b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/index.html @@ -0,0 +1,10 @@ +<html> +<head> + <title>403 Forbidden</title> +</head> +<body> + +<p>Directory access is forbidden.</p> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/config.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/config.php new file mode 100644 index 0000000..2e6e81b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/config.php @@ -0,0 +1,149 @@ +<?php +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/config.php + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +/* + + ------------------------------------------------------------------ + + IMPORTANT NOTE! In case, when TinyMCE’s folder is not protected with HTTP Authorisation, + you should require is_allowed() function to return + `TRUE` if user is authorised, + `FALSE` - otherwise + is_allowed() can be found in jbimages/is_allowed.php + + This is intended to protect upload script, if someone guesses it's url. + + + So, here we go... + + +| ------------------------------------------------------------------- +| +| Path to upload target folder, relative to domain name. NO TRAILING SLASH! +| Example: if an image is acessed via http://www.example.com/images/somefolder/image.jpg, you should specify here: +| +| $config['img_path'] = '/images/somefolder'; +| +| -------------------------------------------------------------------*/ + + + $config['img_path'] = '/metanew/uploads'; // Relative to domain name + $config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . $config['img_path']; // Physical path. [Usually works fine like this] + + +/*------------------------------------------------------------------- +| +| Allowed image filetypes. Specifying something other, than image types will result in error. +| +| $config['allowed_types'] = 'gif|jpg|png'; +| +| -------------------------------------------------------------------*/ + + + $config['allowed_types'] = 'gif|jpg|png'; + + +/*------------------------------------------------------------------- +| +| Maximum image file size in kilobytes. This value can't exceed value set in php.ini. +| Set to `0` if you want to use php.ini default: +| +| $config['max_size'] = 0; +| +| -------------------------------------------------------------------*/ + + + $config['max_size'] = 0; + + +/*------------------------------------------------------------------- +| +| Maximum image width. Set to `0` for no limit: +| +| $config['max_width'] = 0; +| +| -------------------------------------------------------------------*/ + + + $config['max_width'] = 0; + + +/*------------------------------------------------------------------- +| +| Maximum image height. Set to `0` for no limit: +| +| $config['max_height'] = 0; +| +| -------------------------------------------------------------------*/ + + + $config['max_height'] = 0; + + +/*------------------------------------------------------------------- +| +| Allow script to resize image that exceeds maximum width or maximum height (or both) +| If set to `TRUE`, image will be resized to fit maximum values (proportions are saved) +| If set to `FALSE`, user will recieve an error message. +| +| $config['allow_resize'] = TRUE; +| +| -------------------------------------------------------------------*/ + + + $config['allow_resize'] = TRUE; + + +/*------------------------------------------------------------------- +| +| Image name encryption +| If set to `TRUE`, image file name will be encrypted in something like 7fdd57742f0f7b02288feb62570c7813.jpg +| If set to `FALSE`, original filenames will be preserved +| +| $config['encrypt_name'] = TRUE; +| +| -------------------------------------------------------------------*/ + + + $config['encrypt_name'] = FALSE; + + +/*------------------------------------------------------------------- +| +| How to behave if 2 or more files with the same name are uploaded: +| `TRUE` - the entire file will be overwritten +| `FALSE` - a number will be added to the newly uploaded file name +| +| -------------------------------------------------------------------*/ + + + $config['overwrite'] = FALSE; + + +/*------------------------------------------------------------------- +| +| Target upload folder relative to document root. Most likely, you will not need to change this setting. +| +| -------------------------------------------------------------------*/ + + + + + +/*------------------------------------------------------------------- +| +| THAT IS ALL. HAVE A NICE DAY! ))) +| +| -------------------------------------------------------------------*/ +?> diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog-v4.css b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog-v4.css new file mode 100644 index 0000000..c14eca8 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog-v4.css @@ -0,0 +1,38 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/css/dialog-v4.css + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -text-align:center; padding:0 10px 0 5px;} +h2 {color:#666; visibility:hidden;} + +.form-inline input { + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; +} + +#upload_target {border:0; margin:0; padding:0; width:0; height:0; display:none;} + +.upload_infobar {display:none; font-size:12pt; background:#fff; margin-top:10px; border-radius:5px;} +.upload_infobar img.spinner {margin-right:10px;} +.upload_infobar a {color:#0000cc;} +#upload_additional_info {font-size:10pt; padding-left:26px;} + +#the_plugin_name {margin:15px 0 0 0;} +#the_plugin_name, #the_plugin_name a {color:#777; font-size:9px;} +#the_plugin_name a {text-decoration:none;} +#the_plugin_name a:hover {color:#333;} + +/* this class makes the upload script output visible */ +.upload_target_visible {width:100%!important; height:200px!important; border:1px solid #000!important; display:block!important}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog.css b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog.css new file mode 100644 index 0000000..3a1c961 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/css/dialog.css @@ -0,0 +1,126 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/css/dialog.css + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; text-align:center;} +h2 {color:#666;} + +.form-inline input { + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; +} +.jbFileBox {border:0!important;} +.jbFileBox {width:120px!important; } + +#upload_target {border:0; margin:0; padding:0; width:0; height:0; display:none;} + +.upload_infobar {display:none; font-size:12pt; background:#fff; padding:5px; margin-top:10px; border-radius:5px;} +.upload_infobar img.spinner {margin-right:10px;} +.upload_infobar a {color:#0000cc;} +#upload_additional_info {font-size:10pt; padding-left:26px;} + +#the_plugin_name {margin:25px 0 0 0;} +#the_plugin_name, #the_plugin_name a {color:#777; font-size:9px;} +#the_plugin_name a {text-decoration:none;} +#the_plugin_name a:hover {color:#333;} + +#close_link {margin-top:10px; display:none;} /* for opera */ + +/* this class makes the upload script output visible */ +.upload_target_visible {width:100%!important; height:200px!important; border:1px solid #000!important; display:block!important} + +/* sweet upload button (from twitter bootstrap) */ +.btn { + display: inline-block; + *display: inline; + padding: 4px 12px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 14px; + line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #bbbbbb; + *border: 0; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn:hover, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; +} + +.btn:active, +.btn.active { + background-color: #cccccc \9; +} + +.btn:first-child { + *margin-left: 0; +} + +.btn:hover { + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn.active, +.btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn { + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); +}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog-v4.htm b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog-v4.htm new file mode 100644 index 0000000..2cac138 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog-v4.htm @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Upload an image</title> + <script type="text/javascript" src="js/dialog-v4.js"></script> + <link href="css/dialog-v4.css" rel="stylesheet" type="text/css"> +</head> +<body> + + <form class="form-inline" id="upl" name="upl" action="ci/index.php/upload/english" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="jbImagesDialog.inProgress();"> + + <div id="upload_in_progress" class="upload_infobar"><img src="img/spinner.gif" width="16" height="16" class="spinner">Upload in progress… <div id="upload_additional_info"></div></div> + <div id="upload_infobar" class="upload_infobar"></div> + + <p id="upload_form_container"> + <input id="uploader" name="userfile" type="file" class="jbFileBox" onChange="document.upl.submit(); jbImagesDialog.inProgress();"> + </p> + + <p id="the_plugin_name"><a href="http://justboil.me/" target="_blank" title="JustBoil.me — a TinyMCE Images Upload Plugin">JustBoil.me Images Plugin</a></p> + + </form> + + <iframe id="upload_target" name="upload_target" src="ci/index.php/blank"></iframe> + +</body> +</html>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog.htm b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog.htm new file mode 100644 index 0000000..8d85e52 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/dialog.htm @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>{#jbimages_dlg.title}</title> + <script type="text/javascript" src="../../tiny_mce_popup.js"></script> + <script type="text/javascript" src="js/dialog.js"></script> + + <link href="css/dialog.css" rel="stylesheet" type="text/css"> +</head> +<body> + + <form class="form-inline" id="upl" name="upl" action="ci/index.php/upload/{#jbimages_dlg.lang_id}" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="jbImagesDialog.inProgress();"> + + <h2>{#jbimages_dlg.select_an_image}</h2> + + <div id="upload_in_progress" class="upload_infobar"><img src="img/spinner.gif" width="16" height="16" class="spinner">{#jbimages_dlg.upload_in_progress}… <div id="upload_additional_info"></div></div> + <div id="upload_infobar" class="upload_infobar"></div> + + <p id="upload_form_container"> + <input id="uploader" name="userfile" type="file" class="jbFileBox" onChange="document.upl.submit(); jbImagesDialog.inProgress();" size="8"> + <button type="submit" class="btn">{#jbimages_dlg.upload}</button> + </p> + + <p id="the_plugin_name"><a href="http://justboil.me/" target="_blank" title="JustBoil.me Images - a TinyMCE Images Upload Plugin">JustBoil.me Images Plugin</a></p> + <div id="close_link"><a href="#" onclick="tinyMCEPopup.close(); return false;">Close [×]</a></div> + + </form> + + <iframe id="upload_target" name="upload_target" src="ci/index.php/blank"></iframe> + +</body> +</html> diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin.js new file mode 100644 index 0000000..7595e49 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack('jbimages');tinymce.create('tinymce.plugins.jbImagesPlugin',{init:function(ed,url){ed.addCommand('jbImages',function(){var unixtime_ms=new Date().getTime();ed.windowManager.open({file:url+'/dialog.htm?z'+unixtime_ms,width:330+parseInt(ed.getLang('jbimages.delta_width',0)),height:155+parseInt(ed.getLang('jbimages.delta_height',0)),inline:1},{plugin_url:url})});ed.addButton('jbimages',{title:'jbimages.desc',cmd:'jbImages',image:url+'/img/jbimages-bw.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('jbimages',n.nodeName=='IMG')})},createControl:function(n,cm){return null},getInfo:function(){return{longname:'JustBoil.me Images Plugin',author:'Viktor Kuzhelnyi',authorurl:'http://justboil.me/',infourl:'http://justboil.me/',version:"2.3"}}});tinymce.PluginManager.add('jbimages',tinymce.plugins.jbImagesPlugin)})();
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin_src.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin_src.js new file mode 100644 index 0000000..8ebe62a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/editor_plugin_src.js @@ -0,0 +1,87 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/plugin.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('jbimages'); + + tinymce.create('tinymce.plugins.jbImagesPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('jbImages', function() { + var unixtime_ms = new Date().getTime(); + ed.windowManager.open({ + file : url + '/dialog.htm?z' + unixtime_ms, + width : 330 + parseInt(ed.getLang('jbimages.delta_width', 0)), + height : 155 + parseInt(ed.getLang('jbimages.delta_height', 0)), + inline : 1 + }, { + plugin_url : url // Plugin absolute URL + }); + }); + + // Register example button + ed.addButton('jbimages', { + title : 'jbimages.desc', + cmd : 'jbImages', + image : url + '/img/jbimages-bw.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('jbimages', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'JustBoil.me Images Plugin', + author : 'Viktor Kuzhelnyi', + authorurl : 'http://justboil.me/', + infourl : 'http://justboil.me/', + version : "2.3" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('jbimages', tinymce.plugins.jbImagesPlugin); +})(); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/jbimages-bw.gif b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/jbimages-bw.gif Binary files differnew file mode 100644 index 0000000..f8887ea --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/jbimages-bw.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/spinner.gif b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/spinner.gif Binary files differnew file mode 100644 index 0000000..0d8f4f2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/img/spinner.gif diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/is_allowed.php b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/is_allowed.php new file mode 100644 index 0000000..792aaba --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/is_allowed.php @@ -0,0 +1,32 @@ +<?php +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/config.php + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + +/*------------------------------------------------------------------- +| +| IMPORTANT NOTE! In case, when TinyMCE’s folder is not protected with HTTP Authorisation, +| you should require is_allowed() function to return +| `TRUE` if user is authorised, +| `FALSE` - otherwise +| +| This is intended to protect upload script, if someone guesses it's url. +| +-------------------------------------------------------------------*/ + +function is_allowed() +{ + return TRUE; +} + +?>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog-v4.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog-v4.js new file mode 100644 index 0000000..b7179c3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog-v4.js @@ -0,0 +1,89 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/js/dialog-v4.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +var jbImagesDialog = { + + resized : false, + iframeOpened : false, + timeoutStore : false, + + inProgress : function() { + document.getElementById("upload_infobar").style.display = 'none'; + document.getElementById("upload_additional_info").innerHTML = ''; + document.getElementById("upload_form_container").style.display = 'none'; + document.getElementById("upload_in_progress").style.display = 'block'; + this.timeoutStore = window.setTimeout(function(){ + document.getElementById("upload_additional_info").innerHTML = 'This is taking longer than usual.' + '<br />' + 'An error may have occurred.' + '<br /><a href="#" onClick="jbImagesDialog.showIframe()">' + 'View script\'s output' + '</a>'; + // tinyMCEPopup.editor.windowManager.resizeBy(0, 30, tinyMCEPopup.id); + }, 20000); + }, + + showIframe : function() { + if (this.iframeOpened == false) + { + document.getElementById("upload_target").className = 'upload_target_visible'; + // tinyMCEPopup.editor.windowManager.resizeBy(0, 190, tinyMCEPopup.id); + this.iframeOpened = true; + } + }, + + uploadFinish : function(result) { + if (result.resultCode == 'failed') + { + window.clearTimeout(this.timeoutStore); + document.getElementById("upload_in_progress").style.display = 'none'; + document.getElementById("upload_infobar").style.display = 'block'; + document.getElementById("upload_infobar").innerHTML = result.result; + document.getElementById("upload_form_container").style.display = 'block'; + + if (this.resized == false) + { + // tinyMCEPopup.editor.windowManager.resizeBy(0, 30, tinyMCEPopup.id); + this.resized = true; + } + } + else + { + document.getElementById("upload_in_progress").style.display = 'none'; + document.getElementById("upload_infobar").style.display = 'block'; + document.getElementById("upload_infobar").innerHTML = 'Upload Complete'; + + var w = this.getWin(); + tinymce = w.tinymce; + + tinymce.EditorManager.activeEditor.insertContent('<img src="' + result.filename +'">'); + + this.close(); + } + }, + + getWin : function() { + return (!window.frameElement && window.dialogArguments) || opener || parent || top; + }, + + close : function() { + var t = this; + + // To avoid domain relaxing issue in Opera + function close() { + tinymce.EditorManager.activeEditor.windowManager.close(window); + tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup + }; + + if (tinymce.isOpera) + this.getWin().setTimeout(close, 0); + else + close(); + } + +};
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog.js new file mode 100644 index 0000000..f0c010a --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/js/dialog.js @@ -0,0 +1,77 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/js/dialog.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + tinyMCEPopup.requireLangPack(); + +var jbImagesDialog = { + + resized : false, + iframeOpened : false, + timeoutStore : false, + + init : function() { + document.getElementById("upload_target").src += '/' + tinyMCEPopup.getLang('jbimages_dlg.lang_id', 'english'); + if (navigator.userAgent.indexOf('Opera') > -1) + { + document.getElementById("close_link").style.display = 'block'; + } + }, + + inProgress : function() { + document.getElementById("upload_infobar").style.display = 'none'; + document.getElementById("upload_additional_info").innerHTML = ''; + document.getElementById("upload_form_container").style.display = 'none'; + document.getElementById("upload_in_progress").style.display = 'block'; + this.timeoutStore = window.setTimeout(function(){ + document.getElementById("upload_additional_info").innerHTML = tinyMCEPopup.getLang('jbimages_dlg.longer_than_usual', 0) + '<br />' + tinyMCEPopup.getLang('jbimages_dlg.maybe_an_error', 0) + '<br /><a href="#" onClick="jbImagesDialog.showIframe()">' + tinyMCEPopup.getLang('jbimages_dlg.view_output', 0) + '</a>'; + tinyMCEPopup.editor.windowManager.resizeBy(0, 30, tinyMCEPopup.id); + }, 20000); + }, + + showIframe : function() { + if (this.iframeOpened == false) + { + document.getElementById("upload_target").className = 'upload_target_visible'; + tinyMCEPopup.editor.windowManager.resizeBy(0, 190, tinyMCEPopup.id); + this.iframeOpened = true; + } + }, + + uploadFinish : function(result) { + if (result.resultCode == 'failed') + { + window.clearTimeout(this.timeoutStore); + document.getElementById("upload_in_progress").style.display = 'none'; + document.getElementById("upload_infobar").style.display = 'block'; + document.getElementById("upload_infobar").innerHTML = result.result; + document.getElementById("upload_form_container").style.display = 'block'; + + if (this.resized == false) + { + tinyMCEPopup.editor.windowManager.resizeBy(0, 30, tinyMCEPopup.id); + this.resized = true; + } + } + else + { + document.getElementById("upload_in_progress").style.display = 'none'; + document.getElementById("upload_infobar").style.display = 'block'; + document.getElementById("upload_infobar").innerHTML = tinyMCEPopup.getLang('jbimages_dlg.upload_complete', 0); + tinyMCEPopup.editor.execCommand('mceInsertContent', false, '<img src="' + result.filename +'" />'); + tinyMCEPopup.close(); + } + } + +}; + +tinyMCEPopup.onInit.add(jbImagesDialog.init, jbImagesDialog); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en.js new file mode 100644 index 0000000..d070f81 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en.js @@ -0,0 +1,16 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/en.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + tinyMCE.addI18n('en.jbimages',{ + desc : 'Upload an image' +}); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en_dlg.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en_dlg.js new file mode 100644 index 0000000..b958230 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/en_dlg.js @@ -0,0 +1,25 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/en_dlg.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + tinyMCE.addI18n('en.jbimages_dlg',{ + title : 'Upload an image from computer', + select_an_image : 'Select an image', + upload_in_progress : 'Upload in progress', + upload_complete : 'Upload Complete', + upload : 'Upload', + longer_than_usual : 'This is taking longer than usual.', + maybe_an_error : 'An error may have occurred.', + view_output : 'View script\'s output', + + lang_id : 'english' /* php-side language files are in: ci/application/language/{lang_id}; and in ci/system/language/{lang_id} */ +}); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr.js new file mode 100644 index 0000000..e8794e4 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr.js @@ -0,0 +1,16 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/fr.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +tinyMCE.addI18n('fr.jbimages',{ + desc : 'T\u00E9l\u00E9charger une image' +});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr_dlg.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr_dlg.js new file mode 100644 index 0000000..374d92b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/fr_dlg.js @@ -0,0 +1,25 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/fr_dlg.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + tinyMCE.addI18n('fr.jbimages_dlg',{ + title : 'T\u00E9l\u00E9charger une image depuis votre ordinateur', + select_an_image : 'S\u00E9lectionnez une image', + upload_in_progress : 'T\u00E9l\u00E9chargement en cours', + upload_complete : 'T\u00E9l\u00E9chargement termin\u00E9', + upload : 'T\u00E9l\u00E9charger', + longer_than_usual : 'C\'est plus long que pr\u00E9vu.', + maybe_an_error : 'Une erreur est probablement survenue.', + view_output : 'Voir la sortie du script', + + lang_id : 'french' /* php-side language files are in: ci/application/language/{lang_id}; and in ci/system/language/{lang_id} */ +});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru.js new file mode 100644 index 0000000..65786ab --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru.js @@ -0,0 +1,17 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/ru.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + + tinyMCE.addI18n('ru.jbimages',{ + desc : '\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435', + delta_width : 10 +}); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru_dlg.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru_dlg.js new file mode 100644 index 0000000..81016ce --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/langs/ru_dlg.js @@ -0,0 +1,25 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/langs/ru_dlg.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +tinyMCE.addI18n('ru.jbimages_dlg',{ + title : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430', + select_an_image : '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435', + upload_in_progress : '\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430', + upload_complete : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430', + upload : '\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c', + longer_than_usual : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e.', + maybe_an_error : '\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.', + view_output : '\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430', + + lang_id : 'russian' /* php-side language files are in: ci/application/language/{lang_id}; */ +}); diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.js new file mode 100644 index 0000000..b5f5a47 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.js @@ -0,0 +1,50 @@ +/** + * Justboil.me - a TinyMCE image upload plugin + * jbimages/plugin.js + * + * Released under Creative Commons Attribution 3.0 Unported License + * + * License: http://creativecommons.org/licenses/by/3.0/ + * Plugin info: http://justboil.me/ + * Author: Viktor Kuzhelnyi + * + * Version: 2.3 released 23/06/2013 + */ + +tinymce.PluginManager.add('jbimages', function(editor, url) { + + function jbBox() { + editor.windowManager.open({ + title: 'Upload an image', + file : url + '/dialog-v4.htm', + width : 350, + height: 135, + buttons: [{ + text: 'Upload', + classes:'widget btn primary first abs-layout-item', + disabled : true, + onclick: 'close' + }, + { + text: 'Close', + onclick: 'close' + }] + }); + } + + // Add a button that opens a window + editor.addButton('jbimages', { + tooltip: 'Upload an image', + icon : 'image', + text: 'Upload', + onclick: jbBox + }); + + // Adds a menu item to the tools menu + editor.addMenuItem('jbimages', { + text: 'Upload image', + icon : 'image', + context: 'insert', + onclick: jbBox + }); +});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.min.js new file mode 100644 index 0000000..48a2666 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add('jbimages',function(editor,url){function jbBox(){editor.windowManager.open({title:'Upload an image',file:url+'/dialog-v4.htm',width:350,height:135,buttons:[{text:'Upload',classes:'widget btn primary first abs-layout-item',disabled:true,onclick:'close'},{text:'Close',onclick:'close'}]})}editor.addButton('jbimages',{tooltip:'Upload an image',icon:'image',text:'Upload',onclick:jbBox});editor.addMenuItem('jbimages',{text:'Upload image',icon:'image',context:'insert',onclick:jbBox})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/jbimages/readme b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/readme new file mode 100644 index 0000000..e3cb1ba --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/jbimages/readme @@ -0,0 +1,11 @@ +|------------| +| | +| README | +| | +|------------| + + +Docs & stuff at: http://justboil.me + +-- +Cheers, and have a nice day! ))
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/layer/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/layer/plugin.min.js new file mode 100644 index 0000000..f100292 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/layer/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function o(t){var o=e.dom;tinymce.each(o.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?o.addClass(e,"mceItemVisualAid"):o.removeClass(e,"mceItemVisualAid"),o.addClass(e,"mceItemLayer"))})}function d(o){var d,n,a=[],i=t(e.selection.getNode()),s=-1,l=-1;for(n=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&n.push(e)},"childNodes"),d=0;d<n.length;d++)a[d]=n[d].style.zIndex?parseInt(n[d].style.zIndex,10):0,0>s&&n[d]==i&&(s=d);if(0>o){for(d=0;d<a.length;d++)if(a[d]<a[s]){l=d;break}l>-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):a[s]>0&&(n[s].style.zIndex=a[s]-1)}else{for(d=0;d<a.length;d++)if(a[d]>a[s]){l=d;break}l>-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):n[s].style.zIndex=a[s]+1}e.execCommand("mceRepaint")}function n(){var t=e.dom,o=t.getPos(t.getParent(e.selection.getNode(),"*")),d=e.getBody();e.dom.add(d,"div",{style:{position:"absolute",left:o.x,top:o.y>20?o.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(d,d.innerHTML)}function a(){var o=t(e.selection.getNode());o||(o=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),o&&("absolute"==o.style.position.toLowerCase()?(e.dom.setStyles(o,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(o,"mceItemVisualAid"),e.dom.removeClass(o,"mceItemLayer")):(o.style.left||(o.style.left="20px"),o.style.top||(o.style.top="20px"),o.style.width||(o.style.width=o.width?o.width+"px":"100px"),o.style.height||(o.style.height=o.height?o.height+"px":"100px"),o.style.position="absolute",e.dom.setAttrib(o,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",n),e.addCommand("mceMoveForward",function(){d(1)}),e.addCommand("mceMoveBackward",function(){d(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(o){var d=t(o.target);d&&e.dom.setAttrib(d,"data-mce-style","")}),e.on("mousedown",function(o){var d,n=o.target,a=e.getDoc();tinymce.Env.gecko&&(t(n)?"on"!==a.designMode&&(a.designMode="on",n=a.body,d=n.parentNode,d.removeChild(n),d.appendChild(n)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",o)});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js new file mode 100644 index 0000000..f77d8e8 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js @@ -0,0 +1 @@ +!function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var i="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",n=e.explode(t.settings.font_size_style_values),l=t.schema;t.formatter.register({alignleft:{selector:i,attributes:{align:"left"}},aligncenter:{selector:i,attributes:{align:"center"}},alignright:{selector:i,attributes:{align:"right"}},alignjustify:{selector:i,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(n,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){l.addValidElements(e+"[*]")}),l.getElementRule("font")||l.addValidElements("font[face|size|color|style]"),e.each(i.split(","),function(e){var t=l.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}(tinymce);
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/link/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/link/plugin.min.js new file mode 100644 index 0000000..703d616 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/link/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("link",function(t){function e(e){return function(){var n=t.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}}function n(t,e,n){function i(t,n){return n=n||[],tinymce.each(t,function(t){var l={text:t.text||t.title};t.menu?l.menu=i(t.menu):(l.value=t.value,e&&e(l)),n.push(l)}),n}return i(t,n||[])}function i(e){function i(t){var e=f.find("#text");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),f.find("#href").value(t.control.value())}function l(e){var n=[];return tinymce.each(t.dom.select("a:not([href])"),function(t){var i=t.name||t.id;i&&n.push({text:i,value:"#"+i,selected:-1!=e.indexOf("#"+i)})}),n.length?(n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:i}):void 0}function a(){!c&&0===y.text.length&&d&&this.parent().parent().find("#text")[0].value(this.value())}function o(e){var n=e.meta||{};x&&x.value(t.convertURL(this.value(),"href")),tinymce.each(e.meta,function(t,e){f.find("#"+e).value(t)}),n.text||a.call(this)}function r(t){var e=b.getContent();if(/</.test(e)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(e)||-1==e.indexOf("href=")))return!1;if(t){var n,i=t.childNodes;if(0===i.length)return!1;for(n=i.length-1;n>=0;n--)if(3!=i[n].nodeType)return!1}return!0}var s,u,c,f,d,g,x,v,h,m,p,k,y={},b=t.selection,_=t.dom;s=b.getNode(),u=_.getParent(s,"a[href]"),d=r(),y.text=c=u?u.innerText||u.textContent:b.getContent({format:"text"}),y.href=u?_.getAttrib(u,"href"):"",(k=_.getAttrib(u,"target"))?y.target=k:t.settings.default_link_target&&(y.target=t.settings.default_link_target),(k=_.getAttrib(u,"rel"))&&(y.rel=k),(k=_.getAttrib(u,"class"))&&(y["class"]=k),(k=_.getAttrib(u,"title"))&&(y.title=k),d&&(g={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){y.text=this.value()}}),e&&(x={type:"listbox",label:"Link list",values:n(e,function(e){e.value=t.convertURL(e.value||e.url,"href")},[{text:"None",value:""}]),onselect:i,value:t.convertURL(y.href,"href"),onPostRender:function(){x=this}}),t.settings.target_list!==!1&&(t.settings.target_list||(t.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),h={name:"target",type:"listbox",label:"Target",values:n(t.settings.target_list)}),t.settings.rel_list&&(v={name:"rel",type:"listbox",label:"Rel",values:n(t.settings.rel_list)}),t.settings.link_class_list&&(m={name:"class",type:"listbox",label:"Class",values:n(t.settings.link_class_list,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({inline:"a",classes:[e.value]})})})}),t.settings.link_title!==!1&&(p={name:"title",type:"textbox",label:"Title",value:y.title}),f=t.windowManager.open({title:"Insert link",data:y,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:a},g,p,l(y.href),x,v,h,m],onSubmit:function(e){function n(e,n){var i=t.selection.getRng();window.setTimeout(function(){t.windowManager.confirm(e,function(e){t.selection.setRng(i),n(e)})},0)}function i(){var e={href:l,target:y.target?y.target:null,rel:y.rel?y.rel:null,"class":y["class"]?y["class"]:null,title:y.title?y.title:null};u?(t.focus(),d&&y.text!=c&&("innerText"in u?u.innerText=y.text:u.textContent=y.text),_.setAttribs(u,e),b.select(u),t.undoManager.add()):d?t.insertContent(_.createHTML("a",e,_.encode(y.text))):t.execCommand("mceInsertLink",!1,e)}var l;return y=tinymce.extend(y,e.data),(l=y.href)?l.indexOf("@")>0&&-1==l.indexOf("//")&&-1==l.indexOf("mailto:")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(l="mailto:"+l),i()}):/^\s*www\./i.test(l)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(l="http://"+l),i()}):void i():void t.execCommand("unlink")}})}t.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:e(i),stateSelector:"a[href]"}),t.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),t.addShortcut("Ctrl+K","",e(i)),t.addCommand("mceLink",e(i)),this.showDialog=i,t.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:e(i),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/lists/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/lists/plugin.min.js new file mode 100644 index 0000000..cf0e600 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/lists/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("lists",function(e){function t(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)}function n(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function a(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}var o=this;e.on("init",function(){function i(e){function t(t){var r,a,o;a=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],1==a.nodeType&&(r=y.create("span",{"data-mce-type":"bookmark"}),a.hasChildNodes()?(o=Math.min(o,a.childNodes.length-1),t?a.insertBefore(r,a.childNodes[o]):y.insertAfter(r,a.childNodes[o])):a.appendChild(r),a=r,o=0),n[t?"startContainer":"endContainer"]=a,n[t?"startOffset":"endOffset"]=o}var n={};return t(!0),e.collapsed||t(),n}function d(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,a,o;r=o=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],r&&(1==r.nodeType&&(a=n(r),r=r.parentNode,y.remove(o)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=a)}t(!0),t();var n=y.createRng();n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),k.setRng(n)}function s(t,n){var r,a,o,i=y.createFragment(),d=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&(a=y.create(n),a.tagName===e.settings.forced_root_block&&y.setAttribs(a,e.settings.forced_root_block_attrs),i.appendChild(a)),t)for(;r=t.firstChild;){var s=r.nodeName;o||"SPAN"==s&&"bookmark"==r.getAttribute("data-mce-type")||(o=!0),d[s]?(i.appendChild(r),a=null):n?(a||(a=y.create(n),i.appendChild(a)),a.appendChild(r)):i.appendChild(r)}return e.settings.forced_root_block?o||tinymce.Env.ie&&!(tinymce.Env.ie>10)||a.appendChild(y.create("br",{"data-mce-bogus":"1"})):i.appendChild(y.create("br")),i}function f(){return tinymce.grep(k.getSelectedBlocks(),function(e){return/^(LI|DT|DD)$/.test(e.nodeName)})}function l(e,t,n){var r,a,o=y.select('span[data-mce-type="bookmark"]',e);n=n||s(t),r=y.createRng(),r.setStartAfter(t),r.setEndAfter(e),a=r.extractContents(),y.isEmpty(a)||y.insertAfter(a,e),y.insertAfter(n,e),y.isEmpty(t.parentNode)&&(tinymce.each(o,function(e){t.parentNode.parentNode.insertBefore(e,t.parentNode)}),y.remove(t.parentNode)),y.remove(t)}function c(e){var n,r;if(n=e.nextSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.appendChild(r);y.remove(n)}if(n=e.previousSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.insertBefore(r,e.firstChild);y.remove(n)}}function p(e){tinymce.each(tinymce.grep(y.select("ol,ul",e)),function(e){var n,r=e.parentNode;"LI"==r.nodeName&&r.firstChild==e&&(n=r.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),y.isEmpty(r)&&y.remove(r))),t(r)&&(n=r.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function a(e){y.isEmpty(e)&&y.remove(e)}var o,i=e.parentNode,d=i.parentNode;return"DD"==e.nodeName?(y.rename(e,"DT"),!0):n(e)&&r(e)?("LI"==d.nodeName?(y.insertAfter(e,d),a(d),y.remove(i)):t(d)?y.remove(i,!0):(d.insertBefore(s(e),i),y.remove(i)),!0):n(e)?("LI"==d.nodeName?(y.insertAfter(e,d),e.appendChild(i),a(d)):t(d)?d.insertBefore(e,i):(d.insertBefore(s(e),i),y.remove(e)),!0):r(e)?("LI"==d.nodeName?y.insertAfter(e,d):t(d)?y.insertAfter(e,i):(y.insertAfter(s(e),i),y.remove(e)),!0):("LI"==d.nodeName?(i=d,o=s(e,"LI")):o=t(d)?s(e,"LI"):s(e),l(i,e,o),p(i.parentNode),!0)}function u(e){function n(n,r){var a;if(t(n)){for(;a=e.lastChild.firstChild;)r.appendChild(a);y.remove(n)}}var r,a;return"DT"==e.nodeName?(y.rename(e,"DD"),!0):(r=e.previousSibling,r&&t(r)?(r.appendChild(e),!0):r&&"LI"==r.nodeName&&t(r.lastChild)?(r.lastChild.appendChild(e),n(e.lastChild,r.lastChild),!0):(r=e.nextSibling,r&&t(r)?(r.insertBefore(e,r.firstChild),!0):r&&"LI"==r.nodeName&&t(e.lastChild)?!1:(r=e.previousSibling,r&&"LI"==r.nodeName?(a=y.create(e.parentNode.nodeName),r.appendChild(a),a.appendChild(e),n(e.lastChild,a),!0):!1)))}function h(){var t=f();if(t.length){for(var n=i(k.getRng(!0)),r=0;r<t.length&&(u(t[r])||0!==r);r++);return d(n),e.nodeChanged(),!0}}function v(){var t=f();if(t.length){var n,r,a=i(k.getRng(!0)),o=e.getBody();for(n=t.length;n--;)for(var s=t[n].parentNode;s&&s!=o;){for(r=t.length;r--;)if(t[r]===s){t.splice(n,1);break}s=s.parentNode}for(n=0;n<t.length&&(m(t[n])||0!==n);n++);return d(a),e.nodeChanged(),!0}}function C(n){function r(){function t(e){var t,n;for(t=o[e?"startContainer":"endContainer"],n=o[e?"startOffset":"endOffset"],1==t.nodeType&&(t=t.childNodes[Math.min(n,t.childNodes.length-1)]||t);t.parentNode!=i;){if(a(t))return t;if(/^(TD|TH)$/.test(t.parentNode.nodeName))return t;t=t.parentNode}return t}for(var n,r=[],i=e.getBody(),d=t(!0),s=t(),f=[],l=d;l&&(f.push(l),l!=s);l=l.nextSibling);return tinymce.each(f,function(e){if(a(e))return r.push(e),void(n=null);if(y.isBlock(e)||"BR"==e.nodeName)return"BR"==e.nodeName&&y.remove(e),void(n=null);var t=e.nextSibling;return tinymce.dom.BookmarkManager.isBookmarkNode(e)&&(a(t)||!t&&e.parentNode==i)?void(n=null):(n||(n=y.create("p"),e.parentNode.insertBefore(n,e),r.push(n)),void n.appendChild(e))}),r}var o=k.getRng(!0),s=i(o),f="LI";n=n.toUpperCase(),"DL"==n&&(f="DT"),tinymce.each(r(),function(e){var r,a;a=e.previousSibling,a&&t(a)&&a.nodeName==n?(r=a,e=y.rename(e,f),a.appendChild(e)):(r=y.create(n),e.parentNode.insertBefore(r,e),r.appendChild(e),e=y.rename(e,f)),c(r)}),d(s)}function g(){var n=i(k.getRng(!0)),r=e.getBody();tinymce.each(f(),function(e){var n,a;if(y.isEmpty(e))return void m(e);for(n=e;n&&n!=r;n=n.parentNode)t(n)&&(a=n);l(a,e)}),d(n)}function N(e){var t=y.getParent(k.getStart(),"OL,UL,DL");if(t)if(t.nodeName==e)g(e);else{var n=i(k.getRng(!0));c(y.rename(t,e)),d(n)}else C(e)}function L(t){return function(){var n=y.getParent(e.selection.getStart(),"UL,OL,DL");return n&&n.nodeName==t}}var y=e.dom,k=e.selection;o.backspaceDelete=function(e){function n(e,t){var n=e.startContainer,r=e.startOffset;if(3==n.nodeType&&(t?r<n.data.length:r>0))return n;for(var a=new tinymce.dom.TreeWalker(e.startContainer);n=a[t?"next":"prev"]();)if(3==n.nodeType&&n.data.length>0)return n}function r(e,n){var r,a,o=e.parentNode;for(t(n.lastChild)&&(a=n.lastChild),r=n.lastChild,r&&"BR"==r.nodeName&&e.hasChildNodes()&&y.remove(r);r=e.firstChild;)n.appendChild(r);a&&n.appendChild(a),y.remove(e),y.isEmpty(o)&&y.remove(o)}if(k.isCollapsed()){var a=y.getParent(k.getStart(),"LI");if(a){var o=k.getRng(!0),s=y.getParent(n(o,e),"LI");if(s&&s!=a){var f=i(o);return e?r(s,a):r(a,s),d(f),!0}if(!s&&!e&&g(a.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return h()?void 0:!0}),e.addCommand("Outdent",function(){return v()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){N("UL")}),e.addCommand("InsertOrderedList",function(){N("OL")}),e.addCommand("InsertDefinitionList",function(){N("DL")}),e.addQueryStateHandler("InsertUnorderedList",L("UL")),e.addQueryStateHandler("InsertOrderedList",L("OL")),e.addQueryStateHandler("InsertDefinitionList",L("DL")),e.on("keydown",function(t){9==t.keyCode&&e.dom.getParent(e.selection.getStart(),"LI,DT,DD")&&(t.preventDefault(),t.shiftKey?v():h())})}),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var t=this;e.on("nodechange",function(){for(var r=e.selection.getSelectedBlocks(),a=!1,o=0,i=r.length;!a&&i>o;o++){var d=r[o].nodeName;a="LI"==d&&n(r[o])||"UL"==d||"OL"==d||"DD"==d}t.disabled(a)})}}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?o.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&o.backspaceDelete(!0)&&e.preventDefault()})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/media/moxieplayer.swf b/comiccontrol/tinymce/js/tinymce/plugins/media/moxieplayer.swf Binary files differnew file mode 100644 index 0000000..19c771b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/media/moxieplayer.swf diff --git a/comiccontrol/tinymce/js/tinymce/plugins/media/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/media/plugin.min.js new file mode 100644 index 0000000..1336b31 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/media/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r<i.length;r++)if(-1!==t.indexOf(i[r].filter))return i[r]}function o(){function t(e){var t,i,a,c;t=r.find("#width")[0],i=r.find("#height")[0],a=t.value(),c=i.value(),r.find("#constrain")[0].checked()&&o&&m&&a&&c&&(e.control==t?(c=Math.round(a/o*c),i.value(c)):(a=Math.round(c/m*a),t.value(a))),o=a,m=c}function i(){u=n(this.value()),this.parent().parent().fromJSON(u)}var r,o,m,u,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(e){tinymce.each(e.meta,function(e,t){r.find("#"+t).value(e)})}}];e.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),e.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),e.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),u=s(e.selection.getNode()),o=u.width,m=u.height;var h={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:a(),multiline:!0,label:"Source"};h[d]=i,r=e.windowManager.open({title:"Insert/edit video",data:u,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){u=n(this.next().find("#embed").value()),this.fromJSON(u)},items:l},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(c(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},h]}],onSubmit:function(){var t,i,r,o;for(t=e.dom.select("img[data-mce-object]"),e.insertContent(c(this.toJSON())),i=e.dom.select("img[data-mce-object]"),r=0;r<t.length;r++)for(o=i.length-1;o>=0;o--)t[r]==i[o]&&i.splice(o,1);e.selection.select(i[0]),e.nodeChanged()}})}function a(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function c(o){var a="";if(!o.source1&&(tinymce.extend(o,n(o.embed)),!o.source1))return"";if(o.source2||(o.source2=""),o.poster||(o.poster=""),o.source1=e.convertURL(o.source1,"source"),o.source2=e.convertURL(o.source2,"source"),o.source1mime=i(o.source1),o.source2mime=i(o.source2),o.poster=e.convertURL(o.poster,"poster"),o.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),tinymce.each(u,function(e){var t,i,r;if(t=e.regex.exec(o.source1)){for(r=e.url,i=0;t[i];i++)r=r.replace("$"+i,function(){return t[i]});o.source1=r,o.type=e.type,o.width=o.width||e.w,o.height=o.height||e.h}}),o.embed)a=m(o.embed,o,!0);else{var c=r(o.source1);c&&(o.type="script",o.width=c.width,o.height=c.height),o.width=o.width||300,o.height=o.height||150,tinymce.each(o,function(t,i){o[i]=e.dom.encode(t)}),"iframe"==o.type?a+='<iframe src="'+o.source1+'" width="'+o.width+'" height="'+o.height+'"></iframe>':"application/x-shockwave-flash"==o.source1mime?(a+='<object data="'+o.source1+'" width="'+o.width+'" height="'+o.height+'" type="application/x-shockwave-flash">',o.poster&&(a+='<img src="'+o.poster+'" width="'+o.width+'" height="'+o.height+'" />'),a+="</object>"):-1!=o.source1mime.indexOf("audio")?e.settings.audio_template_callback?a=e.settings.audio_template_callback(o):a+='<audio controls="controls" src="'+o.source1+'">'+(o.source2?'\n<source src="'+o.source2+'"'+(o.source2mime?' type="'+o.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==o.type?a+='<script src="'+o.source1+'"></script>':a=e.settings.video_template_callback?e.settings.video_template_callback(o):'<video width="'+o.width+'" height="'+o.height+'"'+(o.poster?' poster="'+o.poster+'"':"")+' controls="controls">\n<source src="'+o.source1+'"'+(o.source1mime?' type="'+o.source1mime+'"':"")+" />\n"+(o.source2?'<source src="'+o.source2+'"'+(o.source2mime?' type="'+o.source2mime+'"':"")+" />\n":"")+"</video>"}return a}function n(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var o=r(i.map.src);if(!o)return;t={type:"script",source1:i.map.src,width:o.width,height:o.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?n(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,o,a;for(i in t)if(o=""+t[i],e.map[i])for(r=e.length;r--;)a=e[r],a.name==i&&(o?(e.map[i]=o,a.value=o):(delete e.map[i],e.splice(r,1)));else o&&(e.push({name:i,value:o}),e.map[i]=o)}var o,a=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,n,s){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(n,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(n,{poster:t.poster,src:""}),t.source2&&r(n,{src:""});break;case"iframe":r(n,{src:t.source1});break;case"source":if(c++,2>=c&&(r(n,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;o=!0}a.start(e,n,s)},end:function(e){if("video"==e&&i)for(var n=1;2>=n;n++)if(t["source"+n]){var s=[];s.map={},n>c&&(r(s,{src:t["source"+n],type:t["source"+n+"mime"]}),a.start("source",s,!0))}if(t.poster&&"object"==e&&i&&!o){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),a.start("img",m,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var u=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}],d=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var o,a,c,n,s,m,u,d,l=t.length;l--;)if(a=t[l],a.parent&&("script"!=a.name||(d=r(a.attr("src"))))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,d&&(d.width&&a.attr("width",d.width.toString()),d.height&&a.attr("height",d.height.toString())),m=a.attributes,o=m.length;o--;)n=m[o].name,s=m[o].value,"width"!==n&&"height"!==n&&"style"!==n&&(("data"==n||"src"==n)&&(s=e.convertURL(s,n)),c.attr("data-mce-p-"+n,s));u=a.firstChild&&a.firstChild.value,u&&(c.attr("data-mce-html",escape(u)),c.firstChild=null),c.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==i?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),a.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,o,a,c,n,s,m=e.length;m--;)if(i=e[m],i.parent){for(s=i.attr(t),r=new tinymce.html.Node(s,1),"audio"!=s&&"script"!=s&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),a=i.attributes,o=a.length;o--;){var u=a[o].name;0===u.indexOf("data-mce-p-")&&r.attr(u.substr(11),a[o].value)}"script"==s&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(n=new tinymce.html.Node("#text",3),n.raw=!0,n.value=unescape(c),r.append(n)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:o,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:o,context:"insert",prependToContext:!0})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js new file mode 100644 index 0000000..3df66c3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("nonbreaking",function(n){var e=n.getParam("nonbreaking_force_tab");if(n.addCommand("mceNonBreaking",function(){n.insertContent(n.plugins.visualchars&&n.plugins.visualchars.state?'<span class="mce-nbsp"> </span>':" "),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),n.addButton("nonbreaking",{title:"Insert nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),e){var a=+e>1?+e:3;n.on("keydown",function(e){if(9==e.keyCode){if(e.shiftKey)return;e.preventDefault();for(var t=0;a>t;t++)n.execCommand("mceNonBreaking")}})}});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/noneditable/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/noneditable/plugin.min.js new file mode 100644 index 0000000..aa642de --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/noneditable/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("noneditable",function(e){function t(e){var t;if(1===e.nodeType){if(t=e.getAttribute(u),t&&"inherit"!==t)return t;if(t=e.contentEditable,"inherit"!==t)return t}return null}function n(e){for(var n;e;){if(n=t(e))return"false"===n?e:null;e=e.parentNode}}function r(){function r(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function a(e){var t;if(e)for(t=new f(e,e),e=t.current();e;e=t.next())if(3===e.nodeType)return e}function i(n,r){var a,i;return"false"===t(n)&&u.isBlock(n)?void s.select(n):(i=u.createRng(),"true"===t(n)&&(n.firstChild||n.appendChild(e.getDoc().createTextNode(" ")),n=n.firstChild,r=!0),a=u.create("span",{id:g,"data-mce-bogus":!0},m),r?n.parentNode.insertBefore(a,n):u.insertAfter(a,n),i.setStart(a.firstChild,1),i.collapse(!0),s.setRng(i),a)}function o(e){var t,n,i,o;if(e)t=s.getRng(!0),t.setStartBefore(e),t.setEndBefore(e),n=a(e),n&&n.nodeValue.charAt(0)==m&&(n=n.deleteData(0,1)),u.remove(e,!0),s.setRng(t);else for(i=r(s.getStart());(e=u.get(g))&&e!==o;)i!==e&&(n=a(e),n&&n.nodeValue.charAt(0)==m&&(n=n.deleteData(0,1)),u.remove(e,!0)),o=e}function l(){function e(e,n){var r,a,i,o,l;if(r=d.startContainer,a=d.startOffset,3==r.nodeType){if(l=r.nodeValue.length,a>0&&l>a||(n?a==l:0===a))return}else{if(!(a<r.childNodes.length))return n?null:e;var u=!n&&a>0?a-1:a;r=r.childNodes[u],r.hasChildNodes()&&(r=r.firstChild)}for(i=new f(r,e);o=i[n?"prev":"next"]();){if(3===o.nodeType&&o.nodeValue.length>0)return;if("true"===t(o))return o}return e}var r,a,l,d,u;o(),l=s.isCollapsed(),r=n(s.getStart()),a=n(s.getEnd()),(r||a)&&(d=s.getRng(!0),l?(r=r||a,(u=e(r,!0))?i(u,!0):(u=e(r,!1))?i(u,!1):s.select(r)):(d=s.getRng(!0),r&&d.setStartBefore(r),a&&d.setEndAfter(a),s.setRng(d)))}function d(a){function i(e,t){for(;e=e[t?"previousSibling":"nextSibling"];)if(3!==e.nodeType||e.nodeValue.length>0)return e}function d(e,t){s.select(e),s.collapse(t)}function g(a){function i(e){for(var t=d;t;){if(t===e)return;t=t.parentNode}u.remove(e),l()}function o(){var r,o,l=e.schema.getNonEmptyElements();for(o=new tinymce.dom.TreeWalker(d,e.getBody());(r=a?o.prev():o.next())&&!l[r.nodeName.toLowerCase()]&&!(3===r.nodeType&&tinymce.trim(r.nodeValue).length>0);)if("false"===t(r))return i(r),!0;return n(r)?!0:!1}var f,d,c,g;if(s.isCollapsed()){if(f=s.getRng(!0),d=f.startContainer,c=f.startOffset,d=r(d)||d,g=n(d))return i(g),!1;if(3==d.nodeType&&(a?c>0:c<d.nodeValue.length))return!0;if(1==d.nodeType&&(d=d.childNodes[c]||d),o())return!1}return!0}var m,p,v,E,h=a.keyCode;if(v=s.getStart(),E=s.getEnd(),m=n(v)||n(E),m&&(112>h||h>124)&&h!=c.DELETE&&h!=c.BACKSPACE){if((tinymce.isMac?a.metaKey:a.ctrlKey)&&(67==h||88==h||86==h))return;if(a.preventDefault(),h==c.LEFT||h==c.RIGHT){var y=h==c.LEFT;if(e.dom.isBlock(m)){var T=y?m.previousSibling:m.nextSibling,C=new f(T,T),b=y?C.prev():C.next();d(b,!y)}else d(m,y)}}else if(h==c.LEFT||h==c.RIGHT||h==c.BACKSPACE||h==c.DELETE){if(p=r(v)){if(h==c.LEFT||h==c.BACKSPACE)if(m=i(p,!0),m&&"false"===t(m)){if(a.preventDefault(),h!=c.LEFT)return void u.remove(m);d(m,!0)}else o(p);if(h==c.RIGHT||h==c.DELETE)if(m=i(p),m&&"false"===t(m)){if(a.preventDefault(),h!=c.RIGHT)return void u.remove(m);d(m,!1)}else o(p)}if((h==c.BACKSPACE||h==c.DELETE)&&!g(h==c.BACKSPACE))return a.preventDefault(),!1}}var u=e.dom,s=e.selection,g="mce_noneditablecaret",m="";e.on("mousedown",function(n){var r=e.selection.getNode();"false"===t(r)&&r==n.target&&l()}),e.on("mouseup keyup",l),e.on("keydown",d)}function a(t){var n=l.length,r=t.content,a=tinymce.trim(o);if("raw"!=t.format){for(;n--;)r=r.replace(l[n],function(t){var n=arguments,i=n[n.length-2];return i>0&&'"'==r.charAt(i-1)?t:'<span class="'+a+'" data-mce-content="'+e.dom.encode(n[0])+'">'+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"});t.content=r}}var i,o,l,f=tinymce.dom.TreeWalker,d="contenteditable",u="data-mce-"+d,c=tinymce.util.VK;i=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",o=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",l=e.getParam("noneditable_regexp"),l&&!l.length&&(l=[l]),e.on("PreInit",function(){r(),l&&e.on("BeforeSetContent",a),e.parser.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=e[r],t=" "+n.attr("class")+" ",-1!==t.indexOf(i)?n.attr(u,"true"):-1!==t.indexOf(o)&&n.attr(u,"false")}),e.serializer.addAttributeFilter(u,function(e){for(var t,n=e.length;n--;)t=e[n],l&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):(t.attr(d,null),t.attr(u,null))}),e.parser.addAttributeFilter(d,function(e){for(var t,n=e.length;n--;)t=e[n],t.attr(u,t.attr(d)),t.attr(d,null)})}),e.on("drop",function(e){n(e.target)&&e.preventDefault()})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js new file mode 100644 index 0000000..e232c05 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("pagebreak",function(e){var a="mce-pagebreak",t=e.getParam("pagebreak_separator","<!-- pagebreak -->"),n=new RegExp(t.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),r='<img src="'+tinymce.Env.transparentSrc+'" class="'+a+'" data-mce-resize="false" />';e.addCommand("mcePageBreak",function(){e.insertContent(e.settings.pagebreak_split_block?"<p>"+r+"</p>":r)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,a)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,a)&&e.selection.select(t)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(a){for(var n,r,c=a.length;c--;)if(n=a[c],r=n.attr("class"),r&&-1!==r.indexOf("mce-pagebreak")){var o=n.parent;if(e.schema.getBlockElements()[o.name]&&e.settings.pagebreak_split_block){o.type=3,o.value=t,o.raw=!0,n.remove();continue}n.type=3,n.value=t,n.raw=!0}})})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/paste/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/paste/plugin.min.js new file mode 100644 index 0000000..5016e35 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/paste/plugin.min.js @@ -0,0 +1 @@ +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Utils",c="tinymce/util/Tools",d="tinymce/html/DomParser",u="tinymce/html/Schema",f="tinymce/pasteplugin/Clipboard",p="tinymce/Env",m="tinymce/util/VK",h="tinymce/pasteplugin/WordFilter",g="tinymce/html/Serializer",v="tinymce/html/Node",y="tinymce/pasteplugin/Quirks",b="tinymce/pasteplugin/Plugin",C="tinymce/PluginManager";r(l,[c,d,u],function(e,t,n){function r(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function i(r){function i(e){var t=e.name,n=e;if("br"===t)return void(s+="\n");if(l[t]&&(s+=" "),c[t])return void(s+=" ");if(3==e.type&&(s+=e.value),!e.shortEnded&&(e=e.firstChild))do i(e);while(e=e.next);d[t]&&n.next&&(s+="\n","p"==t&&(s+="\n"))}var o=new n,a=new t({},o),s="",l=o.getShortEndedElements(),c=e.makeMap("script noscript style textarea video audio iframe object"," "),d=o.getBlockElements();return i(a.parse(r)),s}function o(e){return e=r(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\xa0"],/<br>$/i])}return{filter:r,innerText:i,trimHtml:o}}),r(f,[p,m,l],function(e,t,n){return function(r){function i(e){var t,n=r.dom;if(t=r.fire("BeforePastePreProcess",{content:e}),t=r.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(r.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var i=n.add(r.getBody(),"div",{style:"display:none"},e);t=r.fire("PastePostProcess",{node:i}),n.remove(i),e=t.node.innerHTML}t.isDefaultPrevented()||r.insertContent(e,{merge:r.settings.paste_merge_formats!==!1})}}function o(e){e=r.dom.encode(e).replace(/\r\n/g,"\n");var t=r.dom.getParent(r.selection.getStart(),r.dom.isBlock),o=r.settings.forced_root_block,a;o&&(a=r.dom.createHTML(o,r.settings.forced_root_block_attrs),a=a.substr(0,a.length-3)+">"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!o?e=n.filter(e,[[/\n/g,"<br>"]]):(e=n.filter(e,[[/\n\n/g,"</p>"+a],[/^(.*<\/p>)(<p>)$/,a+"$1"],[/\n/g,"<br />"]]),-1!=e.indexOf("<p>")&&(e=a+e)),i(e)}function a(){var t=r.dom,n=r.getBody(),i=r.dom.getViewPort(r.getWin()),o=i.y,a=20,s;if(b=r.selection.getRng(),r.inline&&(s=r.selection.getScrollContainer(),s&&s.scrollTop>0&&(o=s.scrollTop)),b.getClientRects){var l=b.getClientRects();if(l.length)a=o+(l[0].top-t.getPos(n).y);else{a=o;var c=b.startContainer;c&&(3==c.nodeType&&c.parentNode!=n&&(c=c.parentNode),1==c.nodeType&&(a=t.getPos(c,s||n).y))}}y=t.add(r.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+a+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},x),(e.ie||e.gecko)&&t.setStyle(y,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(y,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),y.focus(),r.selection.select(y,!0)}function s(){if(y){for(var e;e=r.dom.get("mcepastebin");)r.dom.remove(e),r.dom.unbind(e);b&&r.selection.setRng(b)}y=b=null}function l(){var e=x,t,n;for(t=r.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var i=t[n].innerHTML;e==x&&(e=""),i.length>e.length&&(e=i)}return e}function c(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var r=0;r<e.types.length;r++){var i=e.types[r];t[i]=e.getData(i)}}return t}function d(e){return c(e.clipboardData||r.getDoc().dataTransfer)}function u(e,t){function n(n){function o(){t&&(r.selection.setRng(t),t=null),i('<img src="'+l.result+'">')}var a,s,l;if(n)for(a=0;a<n.length;a++)if(s=n[a],/^image\/(jpeg|png|gif)$/.test(s.type))return l=new FileReader,l.onload=o,l.readAsDataURL(s.getAsFile?s.getAsFile():s),e.preventDefault(),!0}var o=e.clipboardData||e.dataTransfer;return r.settings.paste_data_images&&o?n(o.items)||n(o.files):void 0}function f(e){var t=e.clipboardData;return-1!=navigator.userAgent.indexOf("Android")&&t&&t.items&&0===t.items.length}function p(e){var t=r.getDoc(),n;if(t.caretPositionFromPoint){var i=t.caretPositionFromPoint(e.clientX,e.clientY);n=t.createRange(),n.setStart(i.offsetNode,i.offset),n.collapse(!0)}else t.caretRangeFromPoint&&(n=t.caretRangeFromPoint(e.clientX,e.clientY));return n}function m(e,t){return t in e&&e[t].length>0}function h(e){return t.metaKeyPressed(e)&&86==e.keyCode||e.shiftKey&&45==e.keyCode}function g(){r.on("keydown",function(t){function n(e){h(e)&&!e.isDefaultPrevented()&&s()}if(h(t)&&!t.isDefaultPrevented()){if(w=t.shiftKey&&86==t.keyCode,w&&e.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),C=(new Date).getTime(),e.ie&&w)return t.preventDefault(),void r.fire("paste",{ieFake:!0});s(),a(),r.once("keyup",n),r.once("paste",function(){r.off("keyup",n)})}}),r.on("paste",function(t){var c=d(t),p=(new Date).getTime()-C<1e3,h="text"==v.pasteFormat||w;return w=!1,t.isDefaultPrevented()||f(t)?void s():u(t)?void s():(p||t.preventDefault(),!e.ie||p&&!t.ieFake||(a(),r.dom.bind(y,"paste",function(e){e.stopPropagation()}),r.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),void setTimeout(function(){var e;return m(c,"text/html")?e=c["text/html"]:(e=l(),e==x&&(h=!0)),e=n.trimHtml(l()),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(h=!0),s(),h&&(e=m(c,"text/plain")&&-1==e.indexOf("</p>")?c["text/plain"]:n.innerText(e)),e==x?void(p||r.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(h?o(e):i(e))},0))}),r.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",r.selection.getContent())}catch(t){}}),r.on("drop",function(e){var t=p(e);if(!e.isDefaultPrevented()&&!u(e,t)&&t){var n=c(e.dataTransfer),a=n["mce-internal"]||n["text/html"]||n["text/plain"];a&&(e.preventDefault(),r.undoManager.transact(function(){n["mce-internal"]&&r.execCommand("Delete"),r.selection.setRng(t),n["text/html"]?i(a):o(a)}))}}),r.on("dragover dragend",function(e){var t,n=e.dataTransfer;if(r.settings.paste_data_images&&n)for(t=0;t<n.types.length;t++)if("Files"==n.types[t])return e.preventDefault(),!1})}var v=this,y,b,C=0,x="%MCEPASTEBIN%",w;v.pasteHtml=i,v.pasteText=o,r.on("preInit",function(){g(),r.parser.addNodeFilter("img",function(t){if(!r.settings.paste_data_images)for(var n=t.length;n--;){var i=t[n].attributes.map.src;i&&/^(data:image|webkit\-fake\-url)/.test(i)&&(t[n].attr("data-mce-object")||i===e.transparentSrc||t[n].remove())}})})}}),r(h,[c,d,u,g,v,l],function(e,t,n,r,i,o){function a(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}function s(s){var l=s.settings;s.on("BeforePastePreProcess",function(c){function d(e){function t(e,t,a,s){var l=e._listLevel||o;l!=o&&(o>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new i(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&r&&r.lastChild.append(n),o=l}for(var n,r,o=1,a=e.getAll("p"),s=0;s<a.length;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\.$/.test(l)){var d=/([0-9])\./.exec(l),u=1;d&&(u=parseInt(d[1],10)),t(e,c,"ol",u);continue}n=null}}function u(t,n){var r={},o=s.dom.parseStyle(n);if("p"===t.name){var a=/mso-list:\w+ \w+([0-9]+)/.exec(n);a&&(t._listLevel=parseInt(a[1],10))}return e.each(o,function(e,n){switch(n){case"horiz-align":n="text-align";break;case"vert-align":n="vertical-align";break;case"font-color":case"mso-foreground":n="color";break;case"mso-background":case"mso-highlight":n="background";break;case"font-weight":case"font-style":return void("normal"!=e&&(r[n]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void t.remove()}return 0===n.indexOf("mso-comment")?void t.remove():void(0!==n.indexOf("mso-")&&("all"==p||m&&m[n])&&(r[n]=e))}),/(bold)/i.test(r["font-weight"])&&(delete r["font-weight"],t.wrap(new i("b",1))),/(italic)/i.test(r["font-style"])&&(delete r["font-style"],t.wrap(new i("i",1))),r=s.dom.serializeStyle(r,t.name),r?r:null}var f=c.content,p,m;if(p=l.paste_retain_style_properties,p&&(m=e.makeMap(p.split(/[, ]/))),l.paste_enable_default_filters!==!1&&a(c.content)){c.wordContent=!0,f=o.filter(f,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var h=l.paste_word_valid_elements;h||(h="-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,del");var g=new n({valid_elements:h,valid_children:"-li[p]"});e.each(g.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var v=new t({},g);v.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"==n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),v.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(r)&&n.remove(),n.attr("class",null)}),v.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),v.addNodeFilter("a",function(e){for(var t=e.length,n,r,i;t--;)if(n=e[t],r=n.attr("href"),i=n.attr("name"),r&&-1!=r.indexOf("#_msocom_"))n.remove();else if(r&&0===r.indexOf("file://")&&(r=r.split("#")[1],r&&(r="#"+r)),r||i){if(i&&!/^_?(?:toc|edn|ftn)/i.test(i)){n.unwrap();continue}n.attr({href:r,name:i})}else n.unwrap()});var y=v.parse(f);d(y),c.content=new r({},g).serialize(y)}})}return s.isWordContent=a,s}),r(y,[p,c,h,l],function(e,t,n,r){return function(i){function o(e){i.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+o.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function s(e){if(n.isWordContent(e))return e;var t=i.settings.paste_webkit_styles;if(i.settings.paste_remove_styles_if_webkit===!1||"all"==t)return e;if(t&&(t=t.split(/[, ]/)),t){var r=i.dom,o=i.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,n,i,a){var s=r.parseStyle(i,"span"),l={};if("none"===t)return n+a;for(var c=0;c<t.length;c++){var d=s[t[c]],u=r.getStyle(o,t[c],!0);/color/.test(t[c])&&(d=r.toHex(d),u=r.toHex(u)),u!=d&&(l[t[c]]=d)}return l=r.serializeStyle(l,"span"),l?n+' style="'+l+'"'+a:""})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}e.webkit&&o(s),e.ie&&o(a)}}),r(b,[C,f,h,y],function(e,t,n,r){var i;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s,l=e.settings;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(a,a,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(a,a,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.pasteHtml(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,h])}(this);
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/preview/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/preview/plugin.min.js new file mode 100644 index 0000000..23e70ac --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/preview/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("preview",function(e){var t=e.settings,i=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(i?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var n,a="";a+='<base href="'+e.documentBaseURI.getURI()+'">',tinymce.each(e.contentCSS,function(t){a+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});var r=t.body_id||"tinymce";-1!=r.indexOf("=")&&(r=e.getParam("body_id","","hash"),r=r[e.id]||r);var d=t.body_class||"";-1!=d.indexOf("=")&&(d=e.getParam("body_class","","hash"),d=d[e.id]||"");var o=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(n="<!DOCTYPE html><html><head>"+a+'</head><body id="'+r+'" class="mce-content-body '+d+'"'+o+">"+e.getContent()+"</body></html>",i)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(n);else{var s=this.getEl("body").firstChild.contentWindow.document;s.open(),s.write(n),s.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/print/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/print/plugin.min.js new file mode 100644 index 0000000..abc37b5 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/print/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("print",function(t){t.addCommand("mcePrint",function(){t.getWin().print()}),t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addShortcut("Ctrl+P","","mcePrint"),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/save/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/save/plugin.min.js new file mode 100644 index 0000000..07fcb1b --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/save/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("save",function(e){function a(){var a;return a=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty()?(tinymce.triggerSave(),e.getParam("save_onsavecallback")?void(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged())):void(a?(e.isNotDirty=!0,(!a.onsubmit||a.onsubmit())&&("function"==typeof a.submit?a.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."))):void 0}function n(){var a=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(a),e.undoManager.clear(),void e.nodeChanged())}function t(){var a=this;e.on("nodeChange",function(){a.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",a),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:t}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:t}),e.addShortcut("ctrl+s","","mceSave")});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js new file mode 100644 index 0000000..367c6bd --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js @@ -0,0 +1 @@ +!function(){function e(e,t,n,a,r){function i(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var a=e[t];if(!a)throw"Invalid capture group";n+=e[0].indexOf(a),e[0]=a}return[n,n+e[0].length,[e[0]]]}function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!u[e.nodeName])return"";if(t="",(u[e.nodeName]||m[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=d(e);while(e=e.nextSibling);return t}function o(e,t,n){var a,r,i,d,o=[],l=0,c=e,s=t.shift(),f=0;e:for(;;){if((u[c.nodeName]||m[c.nodeName])&&l++,3===c.nodeType&&(!r&&c.length+l>=s[1]?(r=c,d=s[1]-l):a&&o.push(c),!a&&c.length+l>s[0]&&(a=c,i=s[0]-l),l+=c.length),a&&r){if(c=n({startNode:a,startNodeIndex:i,endNode:r,endNodeIndex:d,innerNodes:o,match:s[2],matchIndex:f}),l-=r.length-d,a=null,r=null,o=[],s=t.shift(),f++,!s)break}else{if((!h[c.nodeName]||u[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function l(e){var t;if("function"!=typeof e){var n=e.nodeType?e:f.createElement(e);t=function(e,t){var a=n.cloneNode(!1);return a.setAttribute("data-mce-index",t),e&&a.appendChild(f.createTextNode(e)),a}}else t=e;return function(e){var n,a,r,i=e.startNode,d=e.endNode,o=e.matchIndex;if(i===d){var l=i;r=l.parentNode,e.startNodeIndex>0&&(n=f.createTextNode(l.data.substring(0,e.startNodeIndex)),r.insertBefore(n,l));var c=t(e.match[0],o);return r.insertBefore(c,l),e.endNodeIndex<l.length&&(a=f.createTextNode(l.data.substring(e.endNodeIndex)),r.insertBefore(a,l)),l.parentNode.removeChild(l),c}n=f.createTextNode(i.data.substring(0,e.startNodeIndex)),a=f.createTextNode(d.data.substring(e.endNodeIndex));for(var s=t(i.data.substring(e.startNodeIndex),o),u=[],h=0,m=e.innerNodes.length;m>h;++h){var g=e.innerNodes[h],p=t(g.data,o);g.parentNode.replaceChild(p,g),u.push(p)}var x=t(d.data.substring(0,e.endNodeIndex),o);return r=i.parentNode,r.insertBefore(n,i),r.insertBefore(s,i),r.removeChild(i),r=d.parentNode,r.insertBefore(x,d),r.insertBefore(a,d),r.removeChild(d),x}}var c,s,f,u,h,m,g=[],p=0;if(f=t.ownerDocument,u=r.getBlockElements(),h=r.getWhiteSpaceElements(),m=r.getShortEndedElements(),s=d(t)){if(e.global)for(;c=e.exec(s);)g.push(i(c,a));else c=s.match(e),g.push(i(c,a));return g.length&&(p=g.length,o(t,g,l(n))),p}}function t(t){function n(){function e(){r.statusbar.find("#next").disabled(!d(s+1).length),r.statusbar.find("#prev").disabled(!d(s-1).length)}function n(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){r.find("#find")[0].focus()})}var a={},r=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){t.focus(),c.done()},onSubmit:function(t){var i,o,l,f;return t.preventDefault(),o=r.find("#case").checked(),f=r.find("#words").checked(),l=r.find("#find").value(),l.length?a.text==l&&a.caseState==o&&a.wholeWord==f?0===d(s+1).length?void n():(c.next(),void e()):(i=c.find(l,o,f),i||n(),r.statusbar.items().slice(1).disabled(0===i),e(),void(a={text:l,caseState:o,wholeWord:f})):(c.done(!1),void r.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",onclick:function(){r.submit()}},{text:"Replace",disabled:!0,onclick:function(){c.replace(r.find("#replace").value())||(r.statusbar.items().slice(1).disabled(!0),s=-1,a={})}},{text:"Replace all",disabled:!0,onclick:function(){c.replace(r.find("#replace").value(),!0,!0),r.statusbar.items().slice(1).disabled(!0),a={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){c.prev(),e()}},{text:"Next",name:"next",disabled:!0,onclick:function(){c.next(),e()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:t.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function a(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function r(n){var a,r;return r=t.dom.create("span",{"data-mce-bogus":1}),r.className="mce-match-marker",a=t.getBody(),c.done(!1),e(n,a,r,!1,t.schema)}function i(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function d(e){var n,r=[];if(n=tinymce.toArray(t.getBody().getElementsByTagName("span")),n.length)for(var i=0;i<n.length;i++){var d=a(n[i]);null!==d&&d.length&&d===e.toString()&&r.push(n[i])}return r}function o(e){var n=s,a=t.dom;e=e!==!1,e?n++:n--,a.removeClass(d(s),"mce-match-marker-selected");var r=d(n);return r.length?(a.addClass(d(n),"mce-match-marker-selected"),t.selection.scrollIntoView(r[0]),n):-1}function l(e){e.parentNode.removeChild(e)}var c=this,s=-1;c.init=function(e){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Ctrl+F",onclick:n,separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Ctrl+F",onclick:n}),e.addCommand("SearchReplace",n),e.shortcuts.add("Ctrl+F","",n)},c.find=function(e,t,n){e=e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e=n?"\\b"+e+"\\b":e;var a=r(new RegExp(e,t?"g":"gi"));return a&&(s=-1,s=o(!0)),a},c.next=function(){var e=o(!0);-1!==e&&(s=e)},c.prev=function(){var e=o(!1);-1!==e&&(s=e)},c.replace=function(e,n,r){var o,f,u,h,m,g,p=s;for(n=n!==!1,u=t.getBody(),f=tinymce.toArray(u.getElementsByTagName("span")),o=0;o<f.length;o++){var x=a(f[o]);if(null!==x&&x.length)if(h=m=parseInt(x,10),r||h===s){for(e.length?(f[o].firstChild.nodeValue=e,i(f[o])):l(f[o]);f[++o];)if(h=a(f[o]),null!==x&&x.length){if(h!==m){o--;break}l(f[o])}n&&p--}else m>s&&f[o].setAttribute("data-mce-index",m-1)}return t.undoManager.add(),s=p,n?(g=d(p+1).length>0,c.next()):(g=d(p-1).length>0,c.prev()),!r&&g},c.done=function(e){var n,r,d,o;for(r=tinymce.toArray(t.getBody().getElementsByTagName("span")),n=0;n<r.length;n++){var l=a(r[n]);null!==l&&l.length&&(l===s.toString()&&(d||(d=r[n].firstChild),o=r[n].firstChild),i(r[n]))}if(d&&o){var c=t.dom.createRng();return c.setStart(d,0),c.setEnd(o,o.data.length),e!==!1&&t.selection.setRng(c),c}}}tinymce.PluginManager.add("searchreplace",t)}();
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js new file mode 100644 index 0000000..364a741 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js @@ -0,0 +1 @@ +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",d="tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",p="tinymce/dom/DOMUtils",m="tinymce/util/XHR",h="tinymce/util/URI",g="tinymce/util/JSON";r(l,[],function(){return function(e,t){function n(e,t){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function r(e){var t;if(3===e.nodeType)return e.data;if(N[e.nodeName]&&!k[e.nodeName])return"";if(t="",(k[e.nodeName]||E[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=r(e);while(e=e.nextSibling);return t}function i(e,t,n){var r,i,o,a,s=[],l=0,c=e,d,u=0;t=t.slice(0),t.sort(function(e,t){return e.start-t.start}),d=t.shift();e:for(;;){if((k[c.nodeName]||E[c.nodeName])&&l++,3===c.nodeType&&(!i&&c.length+l>=d.end?(i=c,a=d.end-l):r&&s.push(c),!r&&c.length+l>d.start&&(r=c,o=d.start-l),l+=c.length),r&&i){if(c=n({startNode:r,startNodeIndex:o,endNode:i,endNodeIndex:a,innerNodes:s,match:d.text,matchIndex:u}),l-=i.length-a,r=null,i=null,s=[],d=t.shift(),u++,!d)break}else{if((!N[c.nodeName]||k[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function o(e){function t(t,n){var r=x[n];r.stencil||(r.stencil=e(r));var i=r.stencil.cloneNode(!1);return i.setAttribute("data-mce-index",n),t&&i.appendChild(_.doc.createTextNode(t)),i}return function(e){var n,r,i,o=e.startNode,a=e.endNode,s=e.matchIndex,l=_.doc;if(o===a){var c=o;i=c.parentNode,e.startNodeIndex>0&&(n=l.createTextNode(c.data.substring(0,e.startNodeIndex)),i.insertBefore(n,c));var d=t(e.match,s);return i.insertBefore(d,c),e.endNodeIndex<c.length&&(r=l.createTextNode(c.data.substring(e.endNodeIndex)),i.insertBefore(r,c)),c.parentNode.removeChild(c),d}n=l.createTextNode(o.data.substring(0,e.startNodeIndex)),r=l.createTextNode(a.data.substring(e.endNodeIndex));for(var u=t(o.data.substring(e.startNodeIndex),s),f=[],p=0,m=e.innerNodes.length;m>p;++p){var h=e.innerNodes[p],g=t(h.data,s);h.parentNode.replaceChild(g,h),f.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return i=o.parentNode,i.insertBefore(n,o),i.insertBefore(u,o),i.removeChild(o),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function s(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var i=0;i<n.length;i++){var o=n[i],a=o.getAttribute("data-mce-index");null!==a&&a.length&&(a===t||null===t)&&r.push(o)}return r}function l(e){for(var t=x.length;t--;)if(x[t]===e)return t;return-1}function c(e){var t=[];return d(function(n,r){e(n,r)&&t.push(n)}),x=t,this}function d(e){for(var t=0,n=x.length;n>t&&e(x[t],t)!==!1;t++);return this}function u(t){return x.length&&i(e,x,o(t)),this}function f(e,t){if(w&&e.global)for(;C=e.exec(w);)x.push(n(C,t));return this}function p(e){var t,n=s(e?l(e):null);for(t=n.length;t--;)a(n[t]);return this}function m(e){return x[e.getAttribute("data-mce-index")]}function h(e){return s(l(e))[0]}function g(e,t,n){return x.push({start:e,end:e+t,text:w.substr(e,t),data:n}),this}function v(e){var n=s(l(e)),r=t.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r}function y(e,n){var r=v(e);return r.deleteContents(),n.length>0&&r.insertNode(t.dom.doc.createTextNode(n)),r}function b(){return x.splice(0,x.length),p(),this}var C,x=[],w,_=t.dom,k,N,E;return k=t.schema.getBlockElements(),N=t.schema.getWhiteSpaceElements(),E=t.schema.getShortEndedElements(),w=r(e),{text:w,matches:x,each:d,filter:c,reset:b,matchFromElement:m,elementFromMatch:h,find:f,add:g,wrap:u,unwrap:p,replace:y,rangeFromMatch:v,indexOf:l}}}),r(c,[l,d,u,f,p,m,h,g],function(e,t,n,r,i,o,a,s){t.add("spellchecker",function(t,l){function c(){return N.textMatcher||(N.textMatcher=new e(t.getBody(),t)),N.textMatcher}function d(e,t){var r=[];return n.each(t,function(e){r.push({selectable:!0,text:e.name,data:e.value})}),r}function u(e){for(var t in e)return!1;return!0}function f(e,o){var a=[],s=E[e];n.each(s,function(e){a.push({text:e,onclick:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(o),v()}})}),a.push({text:"-"}),A&&a.push({text:"Add to Dictionary",onclick:function(){y(e,o)}}),a.push.apply(a,[{text:"Ignore",onclick:function(){b(e,o)}},{text:"Ignore all",onclick:function(){b(e,o,!0)}},{text:"Finish",onclick:C}]),T=new r({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){T.remove(),T=null}}),T.renderTo(document.body);var l=i.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(o[0]),d=t.dom.getRoot();"BODY"==d.nodeName?(c.x-=d.ownerDocument.documentElement.scrollLeft||d.scrollLeft,c.y-=d.ownerDocument.documentElement.scrollTop||d.scrollTop):(c.x-=d.scrollLeft,c.y-=d.scrollTop),l.x+=c.x,l.y+=c.y,T.moveTo(l.x,l.y+o[0].offsetHeight)}function p(){return t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g")}function m(e,t,r,i){var c={method:e},d="";"spellcheck"==e&&(c.text=t,c.lang=R.spellchecker_language),"addToDictionary"==e&&(c.word=t),n.each(c,function(e,t){d&&(d+="&"),d+=t+"="+encodeURIComponent(e)}),o.send({url:new a(l).toAbsolute(R.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:d,success:function(e){e=s.parse(e),e?e.error?i(e.error):r(e):i("Sever response wasn't proper JSON.")},error:function(e,t){i("Spellchecker request error: "+t.status)}})}function h(e,t,n,r){var i=R.spellchecker_callback||m;i.call(N,e,t,n,r)}function g(){function e(e){var n;return e.words?(A=!!e.dictionary,n=e.words):n=e,t.setProgressState(!1),u(n)?(t.windowManager.alert("No misspellings found"),void(S=!1)):(E=n,c().find(p()).filter(function(e){return!!n[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":e.text})}),void t.fire("SpellcheckStart"))}function n(e){t.windowManager.alert(e),t.setProgressState(!1),C()}return S?void C():(C(),S=!0,t.setProgressState(!0),h("spellcheck",c().text,e,n),void t.focus())}function v(){t.dom.select("span.mce-spellchecker-word").length||C()}function y(e,n){t.setProgressState(!0),h("addToDictionary",e,function(){t.setProgressState(!1),t.dom.remove(n,!0),v()},function(e){t.windowManager.alert(e),t.setProgressState(!1)})}function b(e,r,i){t.selection.collapse(),i?n.each(t.dom.select("span.mce-spellchecker-word"),function(n){n.getAttribute("data-mce-word")==e&&t.dom.remove(n,!0)}):t.dom.remove(r,!0),v()}function C(){c().reset(),N.textMatcher=null,S&&(S=!1,t.fire("SpellcheckEnd"))}function x(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function w(e){var r,i=[];if(r=n.toArray(t.getBody().getElementsByTagName("span")),r.length)for(var o=0;o<r.length;o++){var a=x(r[o]);null!==a&&a.length&&a===e.toString()&&i.push(r[o])}return i}function _(e){var t=R.spellchecker_language;e.control.items().each(function(e){e.active(e.settings.data===t)})}var k,N=this,E,S,T,R=t.settings,A,B=R.spellchecker_languages||"English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv";k=d("Language",n.map(B.split(","),function(e){var t=e.split("=");return{name:t[0],value:t[1]}})),t.on("click",function(e){var n=e.target;if("mce-spellchecker-word"==n.className){e.preventDefault();var r=w(x(n));if(r.length>0){var i=t.dom.createRng();i.setStartBefore(r[0]),i.setEndAfter(r[r.length-1]),t.selection.setRng(i),f(n.getAttribute("data-mce-word"),r)}}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:g,selectable:!0,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(S)})}});var D={tooltip:"Spellcheck",onclick:g,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(S)})}};k.length>1&&(D.type="splitbutton",D.menu=k,D.onshow=_,D.onselect=function(e){R.spellchecker_language=e.control.settings.data}),t.addButton("spellchecker",D),t.addCommand("mceSpellCheck",g),t.on("remove",function(){T&&(T.remove(),T=null)}),t.on("change",v),this.getTextMatcher=c,this.getWordCharPattern=p,this.getLanguage=function(){return R.spellchecker_language},R.spellchecker_language=R.spellchecker_language||R.language||"en"})}),a([l])}(this);
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js new file mode 100644 index 0000000..68fe35e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("tabfocus",function(e){function n(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function t(n){function t(n){function t(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&t(e.parentNode)}function r(e){return e.tabIndex||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function c(e){return!r(e)&&"-1"!=e.getAttribute("tabindex")&&t(e)}if(u=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(u,function(n,t){return n.id==e.id?(a=t,!1):void 0}),n>0){for(d=a+1;d<u.length;d++)if(c(u[d]))return u[d]}else for(d=a-1;d>=0;d--)if(c(u[d]))return u[d];return null}var a,u,c,d;if(!(9!==n.keyCode||n.ctrlKey||n.altKey||n.metaKey)&&(c=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==c.length&&(c[1]=c[0],c[0]=":prev"),u=n.shiftKey?":prev"==c[0]?t(-1):i.get(c[0]):":next"==c[1]?t(1):i.get(c[1]))){var y=tinymce.get(u.id||u.name);u.id&&y?y.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),u.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/table/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/table/plugin.min.js new file mode 100644 index 0000000..fbb79fe --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/table/plugin.min.js @@ -0,0 +1 @@ +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/tableplugin/TableGrid",c="tinymce/util/Tools",d="tinymce/Env",u="tinymce/tableplugin/Quirks",f="tinymce/util/VK",p="tinymce/tableplugin/CellSelection",m="tinymce/dom/TreeWalker",h="tinymce/tableplugin/Dialogs",g="tinymce/tableplugin/Plugin",v="tinymce/PluginManager";r(l,[c,d],function(e,n){function r(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=e.each;return function(o,a){function s(){var e=0;B=[],D=0,i(["thead","tbody","tfoot"],function(t){var n=O.select("> "+t+" tr",a);i(n,function(n,o){o+=e,i(O.select("> td, > th",n),function(e,n){var i,a,s,l;if(B[o])for(;B[o][n];)n++;for(s=r(e,"rowspan"),l=r(e,"colspan"),a=o;o+s>a;a++)for(B[a]||(B[a]=[]),i=n;n+l>i;i++)B[a][i]={part:t,real:a==o&&i==n,elm:e,rowspan:s,colspan:l};D=Math.max(D,n+1)})}),e+=n.length})}function l(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=B[t],n?n[e]:void 0}function d(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function u(e){return e&&(O.hasClass(e.elm,"mce-item-selected")||e==L)}function f(){var e=[];return i(a.rows,function(t){i(t.cells,function(n){return O.hasClass(n,"mce-item-selected")||L&&n==L.elm?(e.push(t),!1):void 0})}),e}function p(){var e=O.createRng();e.setStartAfter(a),e.setEndAfter(a),H.setRng(e),O.remove(a)}function m(t){var r,a={};return o.settings.table_clone_elements!==!1&&(a=e.makeMap((o.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(t,function(e){var o;return 3==e.nodeType?(i(O.getParents(e.parentNode,null,t).reverse(),function(e){a[e.nodeName]&&(e=l(e,!1),r?o&&o.appendChild(e):r=o=e,o=e)}),o&&(o.innerHTML=n.ie?" ":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),t=l(t,!1),d(t,"rowSpan",1),d(t,"colSpan",1),r?t.appendChild(r):(!n.ie||n.ie>10)&&(t.innerHTML='<br data-mce-bogus="1" />'),t}function h(){var e=O.createRng(),t;return i(O.select("tr",a),function(e){0===e.cells.length&&O.remove(e)}),0===O.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),H.setRng(e),void O.remove(a)):(i(O.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&O.remove(e)}),s(),void(P&&(t=B[Math.min(B.length-1,P.y)],t&&(H.select(t[Math.min(t.length-1,P.x)].elm,!0),H.collapse(!0)))))}function g(e,t,n,r){var i,o,a,s,l;for(i=B[t][e].elm.parentNode,a=1;n>=a;a++)if(i=O.getNext(i,"tr")){for(o=e;o>=0;o--)if(l=B[t+a][o].elm,l.parentNode==i){for(s=1;r>=s;s++)O.insertAfter(m(l),l);break}if(-1==o)for(s=1;r>=s;s++)i.insertBefore(m(i.cells[0]),i.cells[0])}}function v(){i(B,function(e,t){i(e,function(e,n){var i,o,a;if(u(e)&&(e=e.elm,i=r(e,"colspan"),o=r(e,"rowspan"),i>1||o>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;i-1>a;a++)O.insertAfter(m(e),e);g(n,t,o-1,i)}})})}function y(t,n,r){var o,a,l,f,p,m,g,y,b,C,x;if(t?(o=E(t),a=o.x,l=o.y,f=a+(n-1),p=l+(r-1)):(P=M=null,i(B,function(e,t){i(e,function(e,n){u(e)&&(P||(P={x:n,y:t}),M={x:n,y:t})})}),P&&(a=P.x,l=P.y,f=M.x,p=M.y)),y=c(a,l),b=c(f,p),y&&b&&y.part==b.part){for(v(),s(),y=c(a,l).elm,d(y,"colSpan",f-a+1),d(y,"rowSpan",p-l+1),g=l;p>=g;g++)for(m=a;f>=m;m++)B[g]&&B[g][m]&&(t=B[g][m].elm,t!=y&&(C=e.grep(t.childNodes),i(C,function(e){y.appendChild(e)}),C.length&&(C=e.grep(y.childNodes),x=0,i(C,function(e){"BR"==e.nodeName&&O.getAttrib(e,"data-mce-bogus")&&x++<C.length-1&&y.removeChild(e)})),O.remove(t)));h()}}function b(e){var n,o,a,s,c,f,p,h,g;if(i(B,function(t,r){return i(t,function(t){return u(t)&&(t=t.elm,c=t.parentNode,f=l(c,!1),n=r,e)?!1:void 0}),e?!n:void 0}),n!==t){for(s=0;s<B[0].length;s++)if(B[n][s]&&(o=B[n][s].elm,o!=a)){if(e){if(n>0&&B[n-1][s]&&(h=B[n-1][s].elm,g=r(h,"rowSpan"),g>1)){d(h,"rowSpan",g+1);continue}}else if(g=r(o,"rowspan"),g>1){d(o,"rowSpan",g+1);continue}p=m(o),d(p,"colSpan",o.colSpan),f.appendChild(p),a=o}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):O.insertAfter(f,c))}}function C(e){var t,n;i(B,function(n){return i(n,function(n,r){return u(n)&&(t=r,e)?!1:void 0}),e?!t:void 0}),i(B,function(i,o){var a,s,l;i[t]&&(a=i[t].elm,a!=n&&(l=r(a,"colspan"),s=r(a,"rowspan"),1==l?e?(a.parentNode.insertBefore(m(a),a),g(t,o,s-1,l)):(O.insertAfter(m(a),a),g(t,o,s-1,l)):d(a,"colSpan",a.colSpan+1),n=a))})}function x(){var t=[];i(B,function(n){i(n,function(n,o){u(n)&&-1===e.inArray(t,o)&&(i(B,function(e){var t=e[o].elm,n;n=r(t,"colSpan"),n>1?d(t,"colSpan",n-1):O.remove(t)}),t.push(o))})}),h()}function w(){function e(e){var t,n;i(e.cells,function(e){var n=r(e,"rowSpan");n>1&&(d(e,"rowSpan",n-1),t=E(e),g(t.x,t.y,1,1))}),t=E(e.cells[0]),i(B[t.y],function(e){var t;e=e.elm,e!=n&&(t=r(e,"rowSpan"),1>=t?O.remove(e):d(e,"rowSpan",t-1),n=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),h()}function _(){var e=f();return O.remove(e),h(),e}function k(){var e=f();return i(e,function(t,n){e[n]=l(t,!0)}),e}function N(e,t){var n=f(),r=n[t?0:n.length-1],o=r.cells.length;e&&(i(B,function(e){var t;return o=0,i(e,function(e){e.real&&(o+=e.colspan),e.elm.parentNode==r&&(t=1)}),t?!1:void 0}),t||e.reverse(),i(e,function(e){var n,i=e.cells.length,a;for(n=0;i>n;n++)a=e.cells[n],d(a,"colSpan",1),d(a,"rowSpan",1);for(n=i;o>n;n++)e.appendChild(m(e.cells[i-1]));for(n=o;i>n;n++)O.remove(e.cells[n]);t?r.parentNode.insertBefore(e,r):O.insertAfter(e,r)}),O.removeClass(O.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function E(e){var t;return i(B,function(n,r){return i(n,function(n,i){return n.elm==e?(t={x:i,y:r},!1):void 0}),!t}),t}function S(e){P=E(e)}function T(){var e,t;return e=t=0,i(B,function(n,r){i(n,function(n,i){var o,a;u(n)&&(n=B[r][i],i>e&&(e=i),r>t&&(t=r),n.real&&(o=n.colspan-1,a=n.rowspan-1,o&&i+o>e&&(e=i+o),a&&r+a>t&&(t=r+a)))})}),{x:e,y:t}}function R(e){var t,n,r,i,o,a,s,l,c,d;if(M=E(e),P&&M){for(t=Math.min(P.x,M.x),n=Math.min(P.y,M.y),r=Math.max(P.x,M.x),i=Math.max(P.y,M.y),o=r,a=i,d=n;a>=d;d++)e=B[d][t],e.real||t-(e.colspan-1)<t&&(t-=e.colspan-1);for(c=t;o>=c;c++)e=B[n][c],e.real||n-(e.rowspan-1)<n&&(n-=e.rowspan-1);for(d=n;i>=d;d++)for(c=t;r>=c;c++)e=B[d][c],e.real&&(s=e.colspan-1,l=e.rowspan-1,s&&c+s>o&&(o=c+s),l&&d+l>a&&(a=d+l));for(O.removeClass(O.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;a>=d;d++)for(c=t;o>=c;c++)B[d][c]&&O.addClass(B[d][c].elm,"mce-item-selected")}}function A(e,t){var n,r,i;n=E(e),r=n.y*D+n.x;do{if(r+=t,i=c(r%D,Math.floor(r/D)),!i)break;if(i.elm!=e)return H.select(i.elm,!0),O.isEmpty(i.elm)&&H.collapse(!0),!0}while(i.elm==e);return!1}var B,D,P,M,L,H=o.selection,O=H.dom;a=a||O.getParent(H.getStart(),"table"),s(),L=O.getParent(H.getStart(),"th,td"),L&&(P=E(L),M=T(),L=c(P.x,P.y)),e.extend(this,{deleteTable:p,split:v,merge:y,insertRow:b,insertCol:C,deleteCols:x,deleteRows:w,cutRows:_,copyRows:k,pasteRows:N,getPos:E,setStartCell:S,setEndCell:R,moveRelIdx:A,refresh:s})}}),r(u,[f,d,c],function(e,t,n){function r(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function o(){function t(t){function o(e,r){var i=e?"previousSibling":"nextSibling",o=n.dom.getParent(r,"tr"),s=o[i];if(s)return g(n,r,s,e),t.preventDefault(),!0;var d=n.dom.getParent(o,"table"),u=o.parentNode,f=u.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var p=a(e,d,u,"tbody");if(null!==p)return l(e,p,r)}return c(e,o,i,d)}function a(e,t,r,i){var o=n.dom.select(">"+i,t),a=o.indexOf(r);if(e&&0===a||!e&&a===o.length-1)return s(e,t);if(-1===a){var l="thead"===r.tagName.toLowerCase()?0:o.length-1;return o[l]}return o[a+(e?-1:1)]}function s(e,t){var r=e?"thead":"tfoot",i=n.dom.select(">"+r,t);return 0!==i.length?i[0]:null}function l(e,r,i){var o=d(r,e);return o&&g(n,i,o,e),t.preventDefault(),!0}function c(e,r,i,a){var s=a[i];if(s)return u(s),!0;var l=n.dom.getParent(a,"td,th");if(l)return o(e,l,t);var c=d(r,!e);return u(c),t.preventDefault(),!1}function d(e,t){var r=e&&e[t?"lastChild":"firstChild"];return r&&"BR"===r.nodeName?n.dom.getParent(r,"td,th"):r}function u(e){n.selection.setCursorLocation(e,0)}function f(){return b==e.UP||b==e.DOWN}function p(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function m(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=r(n,"colspan");return t}function h(e,t){var n=0,o=0;return i(e.children,function(e,i){return n+=r(e,"colspan"),o=i,n>t?!1:void 0}),o}function g(e,t,r,i){var o=m(n.dom.getParent(t,"td,th")),a=h(r,o),s=r.childNodes[a],l=d(s,i);u(l||s)}function v(e){var t=n.selection.getNode(),r=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return r&&r!==i&&y(r,i)}function y(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var b=t.keyCode;if(f()&&p(n)){var C=n.selection.getNode();setTimeout(function(){v(C)&&o(!t.shiftKey&&b===e.UP,C,t)},0)}}n.on("KeyDown",function(e){t(e)})}function a(){function e(e,t){var n=t.ownerDocument,r=n.createRange(),i;return r.setStartBefore(t),r.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(r.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var r,i,o=n.dom;(37==t.keyCode||38==t.keyCode)&&(r=n.selection.getRng(),i=o.getParent(r.startContainer,"table"),i&&n.getBody().firstChild==i&&e(r,i)&&(r=o.createRng(),r.setStartBefore(i),r.setEndBefore(i),n.selection.setRng(r),t.preventDefault()))})}function s(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&("BR"==e.tagName||!e.getAttribute("data-mce-bogus")))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,t.ie&&t.ie<11?" ":'<br data-mce-bogus="1" />'):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function l(){function e(e,t,n,r){var i=3,o=e.dom.getParent(t.startContainer,"TABLE"),a,s,l;return o&&(a=o.parentNode),s=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&r&&("TR"==n.nodeName||n==a),l=("TD"==n.nodeName||"TH"==n.nodeName)&&!r,s||l}function t(){var t=n.selection.getRng(),r=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,r,i)){i||(i=r);for(var o=i.lastChild;o.lastChild;)o=o.lastChild;3==o.nodeType&&(t.setEnd(o,o.data.length),n.selection.setRng(t))}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var r=n.dom.getParent(n.selection.getStart(),"table");if(r){for(var i=n.dom.select("td,th",r),o=i.length;o--;)if(!n.dom.hasClass(i[o],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(o(),l()),t.gecko&&(a(),s()),t.ie>10&&(a(),s())}}),r(p,[l,m,c],function(e,t,n){return function(r){function i(){r.getBody().style.webkitUserSelect="",d&&(r.dom.removeClass(r.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function o(t){var n,i,o=t.target;if(l&&(s||o!=l)&&("TD"==o.nodeName||"TH"==o.nodeName)){i=a.getParent(o,"table"),i==c&&(s||(s=new e(r,i),s.setStartCell(l),r.getBody().style.webkitUserSelect="none"),s.setEndCell(o),d=!0),n=r.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var a=r.dom,s,l,c,d=!0;return r.on("MouseDown",function(e){2!=e.button&&(i(),l=a.getParent(e.target,"td,th"),c=a.getParent(l,"table"))}),r.on("mouseover",o),r.on("remove",function(){a.unbind(r.getDoc(),"mouseover",o)}),r.on("MouseUp",function(){function e(e,r){var o=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(r?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(r?i.setStartBefore(e):i.setEndBefore(e))}while(e=r?o.next():o.prev())}var i,o=r.selection,d,u,f,p;if(l){if(s&&(r.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=a.createRng(),f=d[0],i.setStartBefore(f),i.setEndAfter(f),e(f,1),u=new t(f,a.getParent(d[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;p=f}while(f=u.next());e(p),o.setRng(i)}r.nodeChanged(),l=s=c=null}}),r.on("KeyUp Drop",function(){i(),l=s=c=null}),{clear:i}}}),r(h,[c,d],function(e,t){var n=e.each;return function(r){function i(){var e=this,t=r.settings.color_picker_callback;t&&t.call(r,function(t){e.value(t).fire("change")},e.value())}function o(e){return{title:"Advanced",type:"form",defaults:{onchange:function(){u(e,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:i},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:i}]}]}}function a(e){return e?e.replace(/px$/,""):""}function s(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){n("left center right".split(" "),function(t){r.formatter.remove("align"+t,{},e)})}function c(e){n("top middle bottom".split(" "),function(t){r.formatter.remove("valign"+t,{},e)})}function d(t,n,r){function i(t,r){return r=r||[],e.each(t,function(e){var t={text:e.text||e.title};e.menu?t.menu=i(e.menu):(t.value=e.value,n&&n(t)),r.push(t)}),r}return i(t,r||[])}function u(e,t,n){var r=t.toJSON(),i=e.parseStyle(r.style);n?(t.find("#borderColor").value(i["border-color"]||"")[0].fire("change"),t.find("#backgroundColor").value(i["background-color"]||"")[0].fire("change")):(i["border-color"]=r.borderColor,i["background-color"]=r.backgroundColor),t.find("#style").value(e.serializeStyle(e.parseStyle(e.serializeStyle(i))))}function f(e,t,n){var r=e.parseStyle(e.getAttrib(n,"style"));r["border-color"]&&(t.borderColor=r["border-color"]),r["background-color"]&&(t.backgroundColor=r["background-color"]),t.style=e.serializeStyle(r)}var p=this;p.tableProps=function(){p.table(!0)},p.table=function(i){function c(){var n;u(p,this),y=e.extend(y,this.toJSON()),e.each("backgroundColor borderColor".split(" "),function(e){delete y[e]}),y["class"]===!1&&delete y["class"],r.undoManager.transact(function(){m||(m=r.plugins.table.insertTable(y.cols||1,y.rows||1)),r.dom.setAttribs(m,{cellspacing:y.cellspacing,cellpadding:y.cellpadding,border:y.border,style:y.style,"class":y["class"]}),r.dom.setStyles(m,{width:s(y.width),height:s(y.height)}),n=p.select("caption",m)[0],n&&!y.caption&&p.remove(n),!n&&y.caption&&(n=p.create("caption"),n.innerHTML=t.ie?"\xa0":'<br data-mce-bogus="1"/>',m.insertBefore(n,m.firstChild)),l(m),y.align&&r.formatter.apply("align"+y.align,{},m),r.focus(),r.addVisual()})}var p=r.dom,m,h,g,v,y={},b;i===!0?(m=p.getParent(r.selection.getStart(),"table"),m&&(y={width:a(p.getStyle(m,"width")||p.getAttrib(m,"width")),height:a(p.getStyle(m,"height")||p.getAttrib(m,"height")),cellspacing:m?p.getAttrib(m,"cellspacing"):"",cellpadding:m?p.getAttrib(m,"cellpadding"):"",border:m?p.getAttrib(m,"border"):"",caption:!!p.select("caption",m)[0],"class":p.getAttrib(m,"class")},n("left center right".split(" "),function(e){r.formatter.matchNode(m,"align"+e)&&(y.align=e)}))):(h={label:"Cols",name:"cols"},g={label:"Rows",name:"rows"}),r.settings.table_class_list&&(y["class"]&&(y["class"]=y["class"].replace(/\s*mce\-item\-table\s*/g,"")),v={name:"class",type:"listbox",label:"Class",values:d(r.settings.table_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"table",classes:[e.value]})})})}),b={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[h,g,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},v]},r.settings.table_adv_tab!==!1?(f(p,y,m),r.windowManager.open({title:"Table properties",data:y,bodyType:"tabpanel",body:[{title:"General",type:"form",items:b},o(p)],onsubmit:c})):r.windowManager.open({title:"Table properties",data:y,body:b,onsubmit:c})},p.merge=function(e,t){r.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var n=this.toJSON();r.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})},p.cell=function(){function t(){u(i,this),m=e.extend(m,this.toJSON()),r.undoManager.transact(function(){n(g,function(e){r.dom.setAttribs(e,{scope:m.scope,style:m.style,"class":m["class"]}),r.dom.setStyles(e,{width:s(m.width),height:s(m.height)}),m.type&&e.nodeName.toLowerCase()!=m.type&&(e=i.rename(e,m.type)),l(e),m.align&&r.formatter.apply("align"+m.align,{},e),c(e),m.valign&&r.formatter.apply("valign"+m.valign,{},e)}),r.focus()})}var i=r.dom,p,m,h,g=[];if(g=r.dom.select("td.mce-item-selected,th.mce-item-selected"),p=r.dom.getParent(r.selection.getStart(),"td,th"),!g.length&&p&&g.push(p),p=p||g[0]){m={width:a(i.getStyle(p,"width")||i.getAttrib(p,"width")),height:a(i.getStyle(p,"height")||i.getAttrib(p,"height")),scope:i.getAttrib(p,"scope"),"class":i.getAttrib(p,"class")},m.type=p.nodeName.toLowerCase(),n("left center right".split(" "),function(e){r.formatter.matchNode(p,"align"+e)&&(m.align=e)}),n("top middle bottom".split(" "),function(e){r.formatter.matchNode(p,"valign"+e)&&(m.valign=e)}),r.settings.table_cell_class_list&&(h={name:"class",type:"listbox",label:"Class",values:d(r.settings.table_cell_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"td",classes:[e.value]})})})});var v={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},h]};r.settings.table_cell_adv_tab!==!1?(f(i,m,p),r.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:m,body:[{title:"General",type:"form",items:v},o(i)],onsubmit:t})):r.windowManager.open({title:"Cell properties",data:m,items:v,onsubmit:t})}},p.row=function(){function t(){var t,o,a;u(i,this),g=e.extend(g,this.toJSON()),r.undoManager.transact(function(){var e=g.type;n(v,function(n){r.dom.setAttribs(n,{scope:g.scope,style:g.style,"class":g["class"]}),r.dom.setStyles(n,{height:s(g.height)}),e!=n.parentNode.nodeName.toLowerCase()&&(t=i.getParent(n,"table"),o=n.parentNode,a=i.select(e,t)[0],a||(a=i.create(e),t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)),a.appendChild(n),o.hasChildNodes()||i.remove(o)),l(n),g.align&&r.formatter.apply("align"+g.align,{},n)}),r.focus()})}var i=r.dom,c,p,m,h,g,v=[],y;c=r.dom.getParent(r.selection.getStart(),"table"),p=r.dom.getParent(r.selection.getStart(),"td,th"),n(c.rows,function(e){n(e.cells,function(t){return i.hasClass(t,"mce-item-selected")||t==p?(v.push(e),!1):void 0})}),m=v[0],m&&(g={height:a(i.getStyle(m,"height")||i.getAttrib(m,"height")),scope:i.getAttrib(m,"scope"),"class":i.getAttrib(m,"class")},g.type=m.parentNode.nodeName.toLowerCase(),n("left center right".split(" "),function(e){r.formatter.matchNode(m,"align"+e)&&(g.align=e)}),r.settings.table_row_class_list&&(h={name:"class",type:"listbox",label:"Class",values:d(r.settings.table_row_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"tr",classes:[e.value]})})})}),y={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},h]},r.settings.table_row_adv_tab!==!1?(f(i,g,m),r.windowManager.open({title:"Row properties",data:g,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},o(i)],onsubmit:t})):r.windowManager.open({title:"Row properties",data:g,body:y,onsubmit:t}))}}}),r(g,[l,u,p,h,c,m,d,v],function(e,t,n,r,i,o,a,s){function l(i){function o(e){return function(){i.execCommand(e)}}function s(e,t){var n,r,o,s;for(o='<table id="__mce"><tbody>',n=0;t>n;n++){for(o+="<tr>",r=0;e>r;r++)o+="<td>"+(a.ie?" ":"<br>")+"</td>";o+="</tr>"}return o+="</tbody></table>",i.undoManager.transact(function(){i.insertContent(o),s=i.dom.get("__mce"),i.dom.setAttrib(s,"id",null),i.dom.setAttribs(s,i.settings.table_default_attributes||{}),i.dom.setStyles(s,i.settings.table_default_styles||{})}),s}function l(e,t){function n(){e.disabled(!i.dom.getParent(i.selection.getStart(),t)),i.selection.selectorChanged(t,function(t){e.disabled(!t)})}i.initialized?n():i.on("init",n)}function d(){l(this,"table")}function u(){l(this,"td,th")}function f(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;10>t;t++){e+="<tr>";for(var n=0;10>n;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}function p(e,t,n){var r=n.getEl().getElementsByTagName("table")[0],o,a,s,l,c,d=n.isRtl()||"tl-tr"==n.parent().rel;for(r.nextSibling.innerHTML=e+1+" x "+(t+1),d&&(e=9-e),a=0;10>a;a++)for(o=0;10>o;o++)l=r.rows[a].childNodes[o].firstChild,c=(d?o>=e:e>=o)&&t>=a,i.dom.toggleClass(l,"mce-active",c),c&&(s=l);return s.parentNode}var m,h=this,g=new r(i);i.settings.table_grid===!1?i.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:g.table}):i.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),g.table())},onshow:function(){p(0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");i.dom.removeClass(e,"mce-active"),i.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:f(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t=e.target,n,r;"A"==t.tagName.toUpperCase()&&(n=parseInt(t.getAttribute("data-mce-x"),10),r=parseInt(t.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(n=9-n),(n!==this.lastX||r!==this.lastY)&&(p(n,r,e.control),this.lastX=n,this.lastY=r))},onclick:function(e){var t=this;"A"==e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),i.undoManager.transact(function(){s(t.lastX+1,t.lastY+1)}),i.addVisual())}}]}),i.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:d,onclick:g.tableProps}),i.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:d,cmd:"mceTableDelete"}),i.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:o("mceTableCellProps"),onPostRender:u},{text:"Merge cells",onclick:o("mceTableMergeCells"),onPostRender:u},{text:"Split cell",onclick:o("mceTableSplitCells"),onPostRender:u}]}),i.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:o("mceTableInsertRowBefore"),onPostRender:u},{text:"Insert row after",onclick:o("mceTableInsertRowAfter"),onPostRender:u},{text:"Delete row",onclick:o("mceTableDeleteRow"),onPostRender:u},{text:"Row properties",onclick:o("mceTableRowProps"),onPostRender:u},{text:"-"},{text:"Cut row",onclick:o("mceTableCutRow"),onPostRender:u},{text:"Copy row",onclick:o("mceTableCopyRow"),onPostRender:u},{text:"Paste row before",onclick:o("mceTablePasteRowBefore"),onPostRender:u},{text:"Paste row after",onclick:o("mceTablePasteRowAfter"),onPostRender:u}]}),i.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:o("mceTableInsertColBefore"),onPostRender:u},{text:"Insert column after",onclick:o("mceTableInsertColAfter"),onPostRender:u},{text:"Delete column",onclick:o("mceTableDeleteCol"),onPostRender:u}]});var v=[];c("inserttable tableprops deletetable | cell row column".split(" "),function(e){v.push("|"==e?{text:"-"}:i.menuItems[e])}),i.addButton("table",{type:"menubutton",title:"Table",menu:v}),a.isIE||i.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(i.selection.select(e),i.nodeChanged())}),h.quirks=new t(i),i.on("Init",function(){h.cellSelection=new n(i)}),c({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t;t=i.dom.getParent(i.selection.getStart(),"th,td"),i.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():g.merge(e,t)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){m=e.cutRows()},mceTableCopyRow:function(e){m=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(m,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(m)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){i.addCommand(n,function(){var n=new e(i);n&&(t(n),i.execCommand("mceRepaint"),h.cellSelection.clear())})}),c({mceInsertTable:g.table,mceTableProps:function(){g.table(!0)},mceTableRowProps:g.row,mceTableCellProps:g.cell},function(e,t){i.addCommand(t,function(t,n){e(n)})}),i.settings.table_tab_navigation!==!1&&i.on("keydown",function(t){var n,r,o;9==t.keyCode&&(n=i.dom.getParent(i.selection.getStart(),"th,td"),n&&(t.preventDefault(),r=new e(i),o=t.shiftKey?-1:1,i.undoManager.transact(function(){!r.moveRelIdx(n,o)&&o>0&&(r.insertRow(),r.refresh(),r.moveRelIdx(n,o))})))}),h.insertTable=s}var c=i.each;s.add("table",l)}),a([])}(this);
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/template/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/template/plugin.min.js new file mode 100644 index 0000000..cee38af --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/template/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("template",function(e){function t(t){return function(){var a=e.settings.templates;"string"==typeof a?tinymce.util.XHR.send({url:a,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(a)}}function a(t){function a(t){function a(t){if(-1==t.indexOf("<html>")){var a="";tinymce.each(e.contentCSS,function(t){a+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'}),t="<!DOCTYPE html><html><head>"+a+"</head><body>"+t+"</body></html>"}t=r(t,"template_preview_replace_values");var l=n.find("iframe")[0].getEl().contentWindow.document;l.open(),l.write(t),l.close()}var c=t.control.value();c.url?tinymce.util.XHR.send({url:c.url,success:function(e){l=e,a(l)}}):(l=c.content,a(l)),n.find("#description")[0].text(t.control.value().description)}var n,l,i=[];return t&&0!==t.length?(tinymce.each(t,function(e){i.push({selected:!i.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),n=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:i,onselect:a}}]},{type:"label",name:"description",label:"Description",text:"Â "},{type:"iframe",flex:1,border:1}],onsubmit:function(){c(!1,l)},width:e.getParam("template_popup_width",600),height:e.getParam("template_popup_height",500)}),void n.find("listbox")[0].fire("select")):void e.windowManager.alert("No templates defined")}function n(t,a){function n(e,t){if(e=""+e,e.length<t)for(var a=0;a<t-e.length;a++)e="0"+e;return e}var l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" ");return a=a||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+a.getFullYear()),t=t.replace("%y",""+a.getYear()),t=t.replace("%m",n(a.getMonth()+1,2)),t=t.replace("%d",n(a.getDate(),2)),t=t.replace("%H",""+n(a.getHours(),2)),t=t.replace("%M",""+n(a.getMinutes(),2)),t=t.replace("%S",""+n(a.getSeconds(),2)),t=t.replace("%I",""+((a.getHours()+11)%12+1)),t=t.replace("%p",""+(a.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(i[a.getMonth()])),t=t.replace("%b",""+e.translate(c[a.getMonth()])),t=t.replace("%A",""+e.translate(r[a.getDay()])),t=t.replace("%a",""+e.translate(l[a.getDay()])),t=t.replace("%%","%")}function l(t){var a=e.dom,n=e.getParam("template_replace_values");i(a.select("*",t),function(e){i(n,function(t,l){a.hasClass(e,l)&&"function"==typeof n[l]&&n[l](e)})})}function r(t,a){return i(e.getParam(a),function(e,a){"function"!=typeof e&&(t=t.replace(new RegExp("\\{\\$"+a+"\\}","g"),e))}),t}function c(t,a){function c(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}var o,s,p=e.dom,m=e.selection.getContent();a=r(a,"template_replace_values"),o=p.create("div",null,a),s=p.select(".mceTmpl",o),s&&s.length>0&&(o=p.create("div",null),o.appendChild(s[0].cloneNode(!0))),i(p.select("*",o),function(t){c(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),c(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),c(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=m)}),l(o),e.execCommand("mceInsertContent",!1,o.innerHTML),e.addVisual()}var i=tinymce.each;e.addCommand("mceInsertTemplate",c),e.addButton("template",{title:"Insert template",onclick:t(a)}),e.addMenuItem("template",{text:"Insert template",onclick:t(a),context:"insert"}),e.on("PreProcess",function(t){var a=e.dom;i(a.select("div",t.node),function(t){a.hasClass(t,"mceTmpl")&&(i(a.select("*",t),function(t){a.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),l(t))})})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/textcolor/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/textcolor/plugin.min.js new file mode 100644 index 0000000..a58d882 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/textcolor/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("textcolor",function(t){function e(e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"==e?"color":"background-color"])&&(o=r)}),o}function o(){var e,o,r=[];for(o=t.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],e=0;e<o.length;e+=2)r.push({text:o[e+1],color:"#"+o[e]});return r}function r(){function e(t,e){var o="transparent"==t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+F+"-"+m++ +'" data-mce-color="'+(t?t:"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+e+'">'+(o?"×":"")+"</div></td>"}var r,l,a,n,c,d,u,g=this,F=g._id,m=0;for(r=o(),r.push({text:"No color",color:"transparent"}),a='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',n=r.length-1,d=0;s>d;d++){for(a+="<tr>",c=0;i>c;c++)u=d*i+c,u>n?a+="<td></td>":(l=r[u],a+=e(l.color,l.text));a+="</tr>"}if(t.settings.color_picker_callback){for(a+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+F+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+F+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">Custom...</button></div></td></tr>',a+="<tr>",c=0;i>c;c++)a+=e("","Custom color");a+="</tr>"}return a+="</tbody></table>"}function l(e,o){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()}function a(e){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}function n(o){function r(t){s.hidePanel(),s.color(t),l(s.settings.format,t)}function n(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)}var c,s=this.parent();if(tinymce.DOM.getParent(o.target,".mce-custom-color-btn")&&(s.hidePanel(),t.settings.color_picker_callback.call(t,function(t){var e,o,l,a=s.panel.getEl().getElementsByTagName("table")[0];for(e=tinymce.map(a.rows[a.rows.length-1].childNodes,function(t){return t.firstChild}),l=0;l<e.length&&(o=e[l],o.getAttribute("data-mce-color"));l++);if(l==i)for(l=0;i-1>l;l++)n(e[l],e[l+1].getAttribute("data-mce-color"));n(o,t),r(t)},e(s.settings.format))),c=o.target.getAttribute("data-mce-color")){if(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),o.target.setAttribute("aria-selected",!0),this.lastId=o.target.id,"transparent"==c)return a(s.settings.format),void s.hidePanel();r(c)}else null!==c&&s.hidePanel()}function c(){var t=this;t._color&&l(t.settings.format,t._color)}var i,s;s=t.settings.textcolor_rows||5,i=t.settings.textcolor_cols||8,t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/textpattern/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/textpattern/plugin.min.js new file mode 100644 index 0000000..dca2136 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/textpattern/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("textpattern",function(t){function e(){return l&&(i.sort(function(t,e){return t.start.length>e.start.length?-1:t.start.length<e.start.length?1:0}),l=!1),i}function n(t){for(var n=e(),a=0;a<n.length;a++)if(0===t.indexOf(n[a].start)&&(!n[a].end||t.lastIndexOf(n[a].end)==t.length-n[a].end.length))return n[a]}function a(t,n,a){var r,s,d;for(r=e(),d=0;d<r.length;d++)if(s=r[d],s.end&&t.substr(n-s.end.length-a,s.end.length)==s.end)return s}function r(e){function r(){i=i.splitText(f),i.splitText(l-f-h),i.deleteData(0,m.start.length),i.deleteData(i.data.length-m.end.length,m.end.length)}var s,d,o,i,l,f,g,c,m,h,u;return s=t.selection,d=t.dom,s.isCollapsed()&&(o=s.getRng(!0),i=o.startContainer,l=o.startOffset,g=i.data,h=e?1:0,3==i.nodeType&&(m=a(g,l,h),m&&(f=Math.max(0,l-h),f=g.lastIndexOf(m.start,f-m.end.length-1),-1!==f&&(c=d.createRng(),c.setStart(i,f),c.setEnd(i,l-h),m=n(c.toString()),m&&m.end&&!(i.data.length<=m.start.length+m.end.length)))))?(u=t.formatter.get(m.format),u&&u[0].inline?(r(),t.formatter.apply(m.format,{},i),i):void 0):void 0}function s(){var e,a,r,s,d,o,i,l,f,g,c;if(e=t.selection,a=t.dom,e.isCollapsed()&&(i=a.getParent(e.getStart(),"p"))){for(f=new tinymce.dom.TreeWalker(i,i);d=f.next();)if(3==d.nodeType){s=d;break}if(s){if(l=n(s.data),!l)return;if(g=e.getRng(!0),r=g.startContainer,c=g.startOffset,s==r&&(c=Math.max(0,c-l.start.length)),tinymce.trim(s.data).length==l.start.length)return;l.format&&(o=t.formatter.get(l.format),o&&o[0].block&&(s.deleteData(0,l.start.length),t.formatter.apply(l.format,{},s),g.setStart(r,c),g.collapse(!0),e.setRng(g))),l.cmd&&t.undoManager.transact(function(){s.deleteData(0,l.start.length),t.execCommand(l.cmd)})}}}function d(){var e,n;n=r(),n&&(e=t.dom.createRng(),e.setStart(n,n.data.length),e.setEnd(n,n.data.length),t.selection.setRng(e)),s()}function o(){var e,n,a,s,d;e=r(!0),e&&(d=t.dom,n=e.data.slice(-1),/[\u00a0 ]/.test(n)&&(e.deleteData(e.data.length-1,1),a=d.doc.createTextNode(n),e.nextSibling?d.insertAfter(a,e.nextSibling):e.parentNode.appendChild(a),s=d.createRng(),s.setStart(a,1),s.setEnd(a,1),t.selection.setRng(s)))}var i,l=!0;i=t.settings.textpattern_patterns||[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],t.on("keydown",function(t){13!=t.keyCode||tinymce.util.VK.modifierPressed(t)||d()},!0),t.on("keyup",function(t){32!=t.keyCode||tinymce.util.VK.modifierPressed(t)||o()}),this.getPatterns=e,this.setPatterns=function(t){i=t,l=!0}});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css b/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 0000000..0c998c2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,135 @@ +.mce-visualblocks p { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} + +.mce-visualblocks h1 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} + +.mce-visualblocks h2 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} + +.mce-visualblocks h3 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} + +.mce-visualblocks h4 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} + +.mce-visualblocks h5 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} + +.mce-visualblocks h6 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} + +.mce-visualblocks div { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} + +.mce-visualblocks section { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} + +.mce-visualblocks article { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} + +.mce-visualblocks blockquote { + padding-top: 10px; + border: 1px dashed #BBB; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} + +.mce-visualblocks address { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} + +.mce-visualblocks pre { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} + +.mce-visualblocks figure { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} + +.mce-visualblocks hgroup { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} + +.mce-visualblocks aside { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} + +.mce-visualblocks figcaption { + border: 1px dashed #BBB; +} + +.mce-visualblocks ul { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==) +} + +.mce-visualblocks ol { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} + +.mce-visualblocks dl { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); +} diff --git a/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js new file mode 100644 index 0000000..8c48ed0 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("visualblocks",function(e,s){function o(){var s=this;s.active(a),e.on("VisualBlocks",function(){s.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var l,t,a;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,c=e.dom;l||(l=c.uniqueId(),o=c.create("link",{id:l,rel:"stylesheet",href:s+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(s){a&&c.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==s.type)}),c.toggleClass(e.getBody(),"mce-visualblocks"),a=e.dom.hasClass(e.getBody(),"mce-visualblocks"),t&&t.active(c.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/visualchars/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/visualchars/plugin.min.js new file mode 100644 index 0000000..fc7e109 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/visualchars/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("visualchars",function(e){function a(a){var t,s,i,r,c,d,l=e.getBody(),m=e.selection;if(n=!n,o.state=n,e.fire("VisualChars",{state:n}),a&&(d=m.getBookmark()),n)for(s=[],tinymce.walk(l,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf("Â ")&&s.push(e)},"childNodes"),i=0;i<s.length;i++){for(r=s[i].nodeValue,r=r.replace(/(\u00a0)/g,'<span data-mce-bogus="1" class="mce-nbsp">$1</span>'),c=e.dom.create("div",null,r);t=c.lastChild;)e.dom.insertAfter(t,s[i]);e.dom.remove(s[i])}else for(s=e.dom.select("span.mce-nbsp",l),i=s.length-1;i>=0;i--)e.dom.remove(s[i],1);m.moveToBookmark(d)}function t(){var a=this;e.on("VisualChars",function(e){a.active(e.state)})}var n,o=this;e.addCommand("mceVisualChars",a),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){n&&"raw"!=e.format&&!e.draft&&(n=!0,a(!1))})});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/plugins/wordcount/plugin.min.js b/comiccontrol/tinymce/js/tinymce/plugins/wordcount/plugin.min.js new file mode 100644 index 0000000..1fd1518 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/plugins/wordcount/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}var n,o,a=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),o=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),a.getCount=function(){var t=e.getContent({format:"raw"}),a=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),t=t.replace(o,"");var r=t.match(n);r&&(a=r.length)}return a}});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.inline.min.css b/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.inline.min.css new file mode 100644 index 0000000..9f194f6 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.inline.min.css @@ -0,0 +1 @@ +.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.min.css b/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.min.css new file mode 100644 index 0000000..ea08c68 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/content.min.css @@ -0,0 +1 @@ +body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/.htaccess b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/.htaccess new file mode 100644 index 0000000..53cc1de --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/.htaccess @@ -0,0 +1,5 @@ +<FilesMatch "\.(ttf|otf|eot|woff)$"> + <IfModule mod_headers.c> + Header set Access-Control-Allow-Origin "*" + </IfModule> +</FilesMatch>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/readme.md b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/readme.md new file mode 100644 index 0000000..fa5d639 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/readme.md @@ -0,0 +1 @@ +Icons are generated and provided by the http://icomoon.io service. diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg new file mode 100644 index 0000000..578b869 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg @@ -0,0 +1,175 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata> +This is a custom SVG font generated by IcoMoon. +<iconset grid="16"></iconset> +</metadata> +<defs> +<font id="tinymce-small" horiz-adv-x="512" > +<font-face units-per-em="512" ascent="480" descent="-32" /> +<missing-glyph horiz-adv-x="512" /> +<glyph class="hidden" unicode="" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" /> +<glyph unicode="" d="M 352,64l0,18.502 c 75.674,30.814, 128,96.91, 128,173.498c0,106.039-100.288,192-224,192S 32,362.039, 32,256 + c0-76.588, 52.327-142.684, 128-173.498L 160,64 L 64,64 l-32,48l0-112 l 160,0 L 192,111.406 c-50.45,25.681-85.333,80.77-85.333,144.594 + c0,88.366, 66.859,160, 149.333,160c 82.474,0, 149.333-71.634, 149.333-160c0-63.824-34.883-118.913-85.333-144.594L 320,0 l 160,0 L 480,112 l-32-48 + L 352,64 z" /> +<glyph unicode="" d="M 128,448l0-448 l 128,128l 128-128L 384,448 L 128,448 z M 352,85.255l-96,96l-96-96L 160,416 l 192,0 L 352,85.255 z" /> +<glyph unicode="" d="M 463.637,364.892l-66.745,66.744C 386.34,442.188, 372.276,448, 357.293,448s-29.047-5.812-39.598-16.363l-82.746-82.745 + c-21.834-21.834-21.834-57.362,0-79.196l 1.373-1.373l 33.941,33.941l-1.373,1.373c-3.066,3.066-3.066,8.247,0,11.313l 82.746,82.746 + C 353.641,399.7, 356.040,400, 357.292,400s 3.651-0.299, 5.656-2.305l 66.745-66.744c 3.066-3.067, 3.066-8.249, 0.001-11.314l-82.747-82.747 + c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651,0.3-5.656,2.306l-1.373,1.373l-33.94-33.942l 1.371-1.371 + c 10.553-10.554, 24.615-16.364, 39.6-16.364s 29.047,5.812, 39.598,16.363l 82.747,82.746C 485.47,307.53, 485.47,343.057, 463.637,364.892 + zM 275.678,179.678l-33.941-33.941l 1.373-1.373c 2.004-2.004, 2.305-4.403, 2.305-5.655c0-1.253-0.299-3.651-2.303-5.657 + l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652,0.3-5.657,2.305L 82.305,117.050C 80.3,119.055, 80,121.455, 80,122.707 + s 0.299,3.65, 2.305,5.656l 82.745,82.744c 2.005,2.006, 4.405,2.306, 5.657,2.306s 3.652-0.3, 5.657-2.306l 1.373-1.371l 33.941,33.94 + l-1.373,1.373c-10.552,10.552-24.615,16.363-39.598,16.363s-29.046-5.812-39.598-16.363l-82.744-82.743 + C 37.812,151.754, 32,137.689, 32,122.707s 5.812-29.047, 16.363-39.599l 66.745-66.745C 125.661,5.812, 139.724,0, 154.707,0 + s 29.046,5.812, 39.598,16.363l 82.747,82.746c 10.552,10.552, 16.361,24.615, 16.361,39.598s-5.812,29.047-16.363,39.598 + L 275.678,179.678zM 400,61c-4.862,0-9.725,1.854-13.435,5.565l-64,63.999c-7.422,7.42-7.422,19.449,0,26.869 + c 7.42,7.422, 19.448,7.422, 26.868,0l 64-64c 7.422-7.42, 7.422-19.448,0-26.868C 409.725,62.854, 404.862,61, 400,61zM 304,0c-8.837,0-16,7.163-16,16l0,64 c0,8.837, 7.163,16, 16,16s 16-7.163, 16-16l0-64 C 320,7.163, 312.837,0, 304,0zM 464,160l-64,0 c-8.837,0-16,7.163-16,16s 7.163,16, 16,16l 64,0 c 8.837,0, 16-7.163, 16-16S 472.837,160, 464,160zM 112,387c 4.862,0, 9.725-1.854, 13.435-5.565l 64-64c 7.421-7.42, 7.421-19.449,0-26.869c-7.42-7.422-19.449-7.422-26.869,0 + l-64,64c-7.421,7.42-7.421,19.449,0,26.869C 102.275,385.146, 107.138,387, 112,387zM 208,448c 8.837,0, 16-7.163, 16-16l0-64 c0-8.837-7.163-16-16-16s-16,7.163-16,16L 192,432 C 192,440.837, 199.163,448, 208,448zM 48,288l 64,0 c 8.837,0, 16-7.163, 16-16s-7.163-16-16-16L 48,256 c-8.837,0-16,7.163-16,16S 39.163,288, 48,288z" /> +<glyph unicode="" d="M 463.637,364.892l-66.745,66.744C 386.34,442.188, 372.276,448, 357.293,448s-29.047-5.812-39.598-16.363l-82.746-82.745 + c-21.834-21.834-21.834-57.362,0-79.196l 1.373-1.373l 33.941,33.941l-1.373,1.373c-3.066,3.066-3.066,8.247,0,11.313l 82.746,82.746 + C 353.641,399.7, 356.040,400, 357.292,400s 3.651-0.299, 5.656-2.305l 66.745-66.744c 3.066-3.067, 3.066-8.249, 0.001-11.314l-82.747-82.747 + c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651,0.3-5.656,2.306l-1.373,1.373l-33.94-33.942l 1.371-1.371 + c 10.553-10.554, 24.615-16.364, 39.6-16.364s 29.047,5.812, 39.598,16.363l 82.747,82.746C 485.47,307.53, 485.47,343.057, 463.637,364.892 + zM 275.678,179.678l-33.941-33.941l 1.373-1.373c 2.004-2.004, 2.305-4.403, 2.305-5.655c0-1.253-0.299-3.651-2.303-5.657 + l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652,0.3-5.657,2.305L 82.305,117.050C 80.3,119.055, 80,121.455, 80,122.707 + s 0.299,3.65, 2.305,5.656l 82.745,82.744c 2.005,2.006, 4.405,2.306, 5.657,2.306s 3.652-0.3, 5.657-2.306l 1.373-1.371l 33.941,33.94 + l-1.373,1.373c-10.552,10.552-24.615,16.363-39.598,16.363s-29.046-5.812-39.598-16.363l-82.744-82.743 + C 37.812,151.754, 32,137.689, 32,122.707s 5.812-29.047, 16.363-39.599l 66.745-66.745C 125.661,5.812, 139.724,0, 154.707,0 + s 29.046,5.812, 39.598,16.363l 82.747,82.746c 10.552,10.552, 16.361,24.615, 16.361,39.598s-5.812,29.047-16.363,39.598 + L 275.678,179.678zM 176,125c-4.862,0-9.725,1.855-13.435,5.564c-7.42,7.42-7.42,19.449,0,26.869l 160,160c 7.42,7.42, 19.448,7.42, 26.868,0 + c 7.422-7.42, 7.422-19.45,0-26.87l-160-160C 185.725,126.855, 180.862,125, 176,125z" /> +<glyph unicode="" d="M 288,339.337L 288,448 l 168.001-168L 288,112L 288,223.048 C 92.547,227.633, 130.5,99.5, 160,0C 16,160, 53.954,345.437, 288,339.337z" /> +<glyph unicode="" d="M 352,0c 29.5,99.5, 67.453,227.633-128,223.048L 224,112 L 55.999,280L 224,448l0-108.663 C 458.046,345.437, 496,160, 352,0z" /> +<glyph unicode="" d="M 128.214,267.637c 52.9,0, 95.786-45.585, 95.786-101.819C 224,109.586, 181.114,64, 128.214,64 + c-52.901,0-95.786,45.585-95.786,101.818L 32,180.364C 32,292.829, 117.77,384, 223.572,384l0-58.182 c-36.55,0-70.913-15.13-96.758-42.602 + c-4.977-5.289-9.517-10.917-13.612-16.828C 118.094,267.208, 123.105,267.637, 128.214,267.637zM 384.214,267.637c 52.9,0, 95.786-45.585, 95.786-101.819C 480,109.586, 437.114,64, 384.214,64 + c-52.901,0-95.786,45.585-95.786,101.818L 288,180.364C 288,292.829, 373.77,384, 479.572,384l0-58.182 c-36.55,0-70.913-15.13-96.758-42.602 + c-4.978-5.289-9.518-10.917-13.612-16.828C 374.094,267.208, 379.105,267.637, 384.214,267.637z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 192,192L 480,192L 480,128L 192,128zM 192,288L 480,288L 480,224L 192,224zM 32,96L 480,96L 480,32L 32,32zM 32,288L 144,208L 32,128 z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 320,192L 320,128L 32,128zM 32,288L 320,288L 320,224L 32,224zM 32,96L 480,96L 480,32L 32,32zM 480,288L 368,208L 480,128 z" /> +<glyph unicode="" d="M 192,416L 480,416L 480,352L 192,352zM 192,256L 480,256L 480,192L 192,192zM 192,96L 480,96L 480,32L 192,32zM 160,215L 160,288L 128,288L 128,448L 64,448L 64,416L 96,416L 96,288L 64,288L 64,256L 128,256L 128,231L 64,201L 64,128L 128,128L 128,96L 64,96L 64,64L 128,64L 128,32L 64,32L 64,0L 160,0L 160,160L 96,160L 96,185 z" /> +<glyph unicode="" d="M 192,416L 480,416L 480,352L 192,352zM 192,256L 480,256L 480,192L 192,192zM 192,96L 480,96L 480,32L 192,32zM 64,384A32,32 2700 1 1 128,384A32,32 2700 1 1 64,384zM 64,224A32,32 2700 1 1 128,224A32,32 2700 1 1 64,224zM 64,64A32,32 2700 1 1 128,64A32,32 2700 1 1 64,64z" /> +<glyph unicode="" d="M 444,288l-28,0 L 416,416 l 32,0 L 448,448 L 288,448 l0-32 l 32,0 l0-128 L 192,288 L 192,416 l 32,0 L 224,448 L 64,448 l0-32 l 32,0 l0-128 L 68,288 c-19.8,0-36-16.2-36-36l0-216 c0-19.8, 16.2-36, 36-36l 120,0 + c 19.8,0, 36,16.2, 36,36L 224,192 l 64,0 l0-156 c0-19.8, 16.2-36, 36-36l 120,0 c 19.8,0, 36,16.2, 36,36L 480,252 C 480,271.8, 463.8,288, 444,288z M 174,32L 82,32 + c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 92,0 c 9.9,0, 18-7.2, 18-16S 183.9,32, 174,32z M 272,224l-32,0 c-8.8,0-16,7.2-16,16s 7.2,16, 16,16l 32,0 + c 8.8,0, 16-7.2, 16-16S 280.8,224, 272,224z M 430,32l-92,0 c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 92,0 c 9.9,0, 18-7.2, 18-16S 439.9,32, 430,32z" /> +<glyph unicode="" d="M 352,288l0,80 c0,8.8-7.2,16-16,16l-80,0 L 256,416 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,384 c-8.801,0-16-7.2-16-16l0-256 + c0-8.8, 7.199-16, 16-16l 112,0 l0-96 l 192,0 l 96,96L 448,288 L 352,288 z M 160,415.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0 + c 0.021-0.018, 0.041-0.038, 0.059-0.057L 224,384 l-64,0 L 160,415.943 L 160,415.943z M 96,320l0,32 l 192,0 l0-32 L 96,320 z M 352,45.255L 352,96 l 50.745,0 L 352,45.255z + M 416,128l-96,0 l0-96 L 192,32 L 192,256 l 224,0 L 416,128 z" /> +<glyph unicode="" d="M 416,320l-96,0 l0,32 l-96,96L 32,448 l0-352 l 192,0 l0-96 l 288,0 L 512,224 L 416,320z M 416,274.745L 466.745,224L 416,224 L 416,274.745 z M 224,402.745L 274.745,352 + L 224,352 L 224,402.745 z M 64,416l 128,0 l0-96 l 96,0 l0-192 L 64,128 L 64,416 z M 480,32L 256,32 l0,64 l 64,0 L 320,288 l 64,0 l0-96 l 96,0 L 480,32 z" /> +<glyph unicode="" d="M 432.204,144.934c-23.235,23.235-53.469,34.002-80.541,31.403L 320,208l 96,96c0,0, 64,64,0,128L 256,272L 96,432 + c-64-64,0-128,0-128l 96-96l-31.663-31.663c-27.072,2.599-57.305-8.169-80.54-31.403c-37.49-37.49-42.556-93.209-11.313-124.45 + c 31.241-31.241, 86.96-26.177, 124.45,11.313c 23.235,23.234, 34.001,53.469, 31.403,80.54L 256,144l 31.664-31.664 + c-2.598-27.072, 8.168-57.305, 31.403-80.539c 37.489-37.49, 93.209-42.556, 124.449-11.313 + C 474.76,51.725, 469.694,107.443, 432.204,144.934z M 176.562,100.711c-1.106-12.166-7.51-24.913-17.57-34.973 + C 147.886,54.631, 133.452,48, 120.383,48c-5.262,0-12.649,1.114-17.958,6.424c-10.703,10.702-8.688,36.566, 11.313,56.568 + c 11.106,11.107, 25.54,17.738, 38.609,17.738c 5.262,0, 12.649-1.114, 17.958-6.424C 176.861,115.751, 177.040,105.962, 176.562,100.711z + M 256,176c-17.673,0-32,14.327-32,32s 14.327,32, 32,32s 32-14.327, 32-32S 273.673,176, 256,176z M 409.576,54.424 + c-5.31-5.31-12.696-6.424-17.958-6.424c-13.069,0-27.503,6.631-38.609,17.738c-10.061,10.060-16.464,22.807-17.569,34.973 + c-0.479,5.251-0.3,15.040, 6.257,21.596c 5.309,5.311, 12.695,6.424, 17.958,6.424c 13.068,0, 27.503-6.631, 38.608-17.737 + C 418.265,90.99, 420.279,65.126, 409.576,54.424z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 32,288L 480,288L 480,224L 32,224zM 32,96L 480,96L 480,32L 32,32z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 128,288L 384,288L 384,224L 128,224zM 128,96L 384,96L 384,32L 128,32z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 192,288L 480,288L 480,224L 192,224zM 192,96L 480,96L 480,32L 192,32z" /> +<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 32,288L 320,288L 320,224L 32,224zM 32,96L 320,96L 320,32L 32,32z" /> +<glyph unicode="" d="M 480,224l-4.571,0 L 347.062,224 c-25.039,17.71-57.215,27.43-91.062,27.43c-44.603,0-82.286,25.121-82.286,54.856 + c0,29.735, 37.683,54.857, 82.286,54.857c 37.529,0, 70.154-17.788, 79.56-41.143l 56.508,0 c-3.965,25.322-18.79,48.984-42.029,66.413 + C 324.599,405.493, 291.201,416, 256,416c-35.202,0-68.598-10.507-94.037-29.587c-27.394-20.545-43.106-49.751-43.106-80.127 + s 15.712-59.582, 43.106-80.127c 0.978-0.733, 1.971-1.449, 2.973-2.158L 36.571,224.001 L 32,224.001 l0-32 l 256.266,0 c 29.104-8.553, 50.021-28.135, 50.021-50.286 + c0-29.734-37.684-54.855-82.286-54.855c-37.53,0-70.154,17.787-79.559,41.143l-56.508,0 c 3.965-25.32, 18.791-48.984, 42.030-66.413 + C 187.402,42.508, 220.798,32, 256,32c 35.201,0, 68.599,10.508, 94.037,29.587c 27.395,20.545, 43.104,49.751, 43.104,80.127 + c0,17.649-5.327,34.896-15.147,50.286L 480,192 L 480,224 z" /> +<glyph unicode="" d="M 96,64l 288,0 l0-32 L 96,32 L 96,64 zM 320,416l0-192 c0-15.656-7.35-30.812-20.695-42.676C 283.834,167.573, 262.771,160, 240,160c-22.772,0-43.834,7.573-59.304,21.324 + C 167.35,193.188, 160,208.344, 160,224L 160,416 L 96,416 l0-192 c0-70.691, 64.471-128, 144-128c 79.529,0, 144,57.309, 144,128L 384,416 L 320,416 z" /> +<glyph unicode="" d="M 416,416l0-32 l-72,0 L 216,64l 72,0 l0-32 L 64,32 l0,32 l 72,0 L 264,384l-72,0 L 192,416 L 416,416 z" /> +<glyph unicode="" d="M 312.721,232.909C 336.758,251.984, 352,280.337, 352,312c0,57.438-50.145,104-112,104L 128,416 l0-384 l 144,0 + c 61.856,0, 112,46.562, 112,104C 384,180.098, 354.441,217.781, 312.721,232.909z M 192,328c0,13.255, 10.745,24, 24,24l 33.602,0 + C 270.809,352, 288,330.51, 288,304s-17.191-48-38.398-48L 192,256 L 192,328 z M 273.6,96L 216,96 c-13.255,0-24,10.745-24,24l0,72 l 81.6,0 + c 21.209,0, 38.4-21.49, 38.4-48S 294.809,96, 273.6,96z" /> +<glyph unicode="" d="M 425.373,358.627l-66.746,66.745C 346.183,437.818, 321.6,448, 304,448L 96,448 c-17.6,0-32-14.4-32-32l0-384 c0-17.6, 14.4-32, 32-32l 320,0 + c 17.6,0, 32,14.4, 32,32L 448,304 C 448,321.6, 437.817,346.182, 425.373,358.627z M 402.745,336.001c 3.396-3.398, 6.896-9.581, 9.447-16.001L 320,320 + L 320,412.193 c 6.42-2.55, 12.602-6.050, 16-9.448L 402.745,336.001z M 415.942,32L 96.057,32 c-0.020,0.017-0.041,0.038-0.057,0.058L 96,415.943 + c 0.017,0.020, 0.038,0.041, 0.057,0.057L 288,416 l0-128 l 128,0 l0-255.942 C 415.983,32.038, 415.962,32.017, 415.942,32z" /> +<glyph unicode="" d="M 480,40L 480,335.969 L 368.031,448L 72,448 c-22.091,0-40-17.908-40-40l0-368 c0-22.092, 17.909-40, 40-40l 368,0 + C 462.092,0, 480,17.908, 480,40z M 288,384l 32,0 l0-96 l-32,0 L 288,384 z M 352,64L 160,64 L 160,191.941 c 0.017,0.021, 0.038,0.041, 0.058,0.059l 191.885,0 + c 0.020-0.018, 0.041-0.038, 0.058-0.059L 352,64L 352,64z M 416,64l-32,0 L 384,192 c0,17.6-14.4,32-32,32L 160,224 c-17.6,0-32-14.4-32-32l0-128 L 96,64 L 96,384 + l 32,0 l0-96 c0-17.6, 14.4-32, 32-32l 160,0 c 17.6,0, 32,14.4, 32,32l0,85.505 l 64-64.036L 416,64 z" /> +<glyph unicode="" d="M 32,384l0-352 l 448,0 L 480,384 L 32,384 z M 192,160l0,64 l 128,0 l0-64 L 192,160 z M 320,128l0-64 L 192,64 l0,64 L 320,128 z M 320,320l0-64 L 192,256 l0,64 L 320,320 z M 160,320l0-64 L 64,256 l0,64 L 160,320 + z M 64,224l 96,0 l0-64 L 64,160 L 64,224 z M 352,224l 96,0 l0-64 l-96,0 L 352,224 z M 352,256l0,64 l 96,0 l0-64 L 352,256 z M 64,128l 96,0 l0-64 L 64,64 L 64,128 z M 352,64l0,64 l 96,0 l0-64 L 352,64 z" /> +<glyph unicode="" d="M 256,410c 49.683,0, 96.391-19.347, 131.521-54.478S 442,273.683, 442,224s-19.348-96.391-54.479-131.521S 305.683,38, 256,38 + s-96.391,19.348-131.522,54.479S 70,174.317, 70,224s 19.347,96.391, 54.478,131.522S 206.317,410, 256,410 M 256,448 + C 132.288,448, 32,347.712, 32,224s 100.288-224, 224-224s 224,100.288, 224,224S 379.712,448, 256,448L 256,448zM 160,288A32,32 2700 1 1 224,288A32,32 2700 1 1 160,288zM 288,288A32,32 2700 1 1 352,288A32,32 2700 1 1 288,288zM 256,152c-50.92,0-96.28,18.437-125.583,47.164C 141.98,140.36, 193.806,96, 256,96c 62.194,0, 114.020,44.36, 125.584,103.164 + C 352.28,170.437, 306.92,152, 256,152z" /> +<glyph unicode="" d="M 240,288L 144,384L 208,448L 32,448L 32,272L 96,336L 192,240 zM 320,240L 416,336L 480,272L 480,448L 304,448L 368,384L 272,288 zM 272,160L 368,64L 304,0L 480,0L 480,176L 416,112L 320,208 zM 192,208L 96,112L 32,176L 32,0L 208,0L 144,64L 240,160 z" /> +<glyph unicode="" d="M 32,256L 480,256L 480,192L 32,192z" /> +<glyph unicode="" d="M 32,96l 256,0 l0-64 L 32,32 L 32,96 z M 384,384L 273.721,384 l-91.883-256l-66.144,0 l 91.881,256L 96,384 L 96,448 l 288,0 L 384,384 z M 464.887,32L 400,96.887 + L 335.113,32L 304,63.113L 368.887,128L 304,192.887L 335.113,224L 400,159.113L 464.887,224L 496,192.887L 431.113,128L 496,63.113 + L 464.887,32z" /> +<glyph unicode="" d="M 128,416l 256,0 l0-64 L 128,352 L 128,416 z M 448,320L 64,320 c-17.6,0-32-14.4-32-32l0-128 c0-17.6, 14.398-32, 32-32l 64,0 l0-96 l 256,0 l0,96 l 64,0 + c 17.6,0, 32,14.4, 32,32L 480,288 C 480,305.6, 465.6,320, 448,320z M 352,64L 160,64 L 160,192 l 192,0 L 352,64 z M 455.2,272c0-12.813-10.387-23.2-23.199-23.2 + S 408.8,259.187, 408.8,272s 10.389,23.2, 23.201,23.2C 444.814,295.2, 455.2,284.813, 455.2,272z" /> +<glyph unicode="" d="M 192,416c-61.856,0-112-50.144-112-112s 50.144-112, 112-112l0-160 l 64,0 L 256,352 l 32,0 l0-320 l 64,0 L 352,352 l 64,0 L 416,416 L 192,416 z" /> +<glyph unicode="" d="M 224,416c-61.856,0-112-50.144-112-112s 50.144-112, 112-112l0-160 l 64,0 L 288,352 l 32,0 l0-320 l 64,0 L 384,352 l 64,0 L 448,416 L 224,416 zM 32,32L 144,128L 32,224 z" /> +<glyph unicode="" d="M 160,416C 98.144,416, 48,365.856, 48,304s 50.144-112, 112-112l0-160 l 64,0 L 224,352 l 32,0 l0-320 l 64,0 L 320,352 l 64,0 L 384,416 L 160,416 zM 480,224L 368,128L 480,32 z" /> +<glyph unicode="" d="M 256,288L 320,288L 320,256L 256,256zM 256,96L 320,96L 320,64L 256,64zM 288,192L 352,192L 352,160L 288,160zM 384,192L 384,96L 352,96L 352,64L 416,64L 416,192 zM 192,192L 256,192L 256,160L 192,160zM 160,96L 224,96L 224,64L 160,64zM 160,288L 224,288L 224,256L 160,256zM 96,384L 96,256L 128,256L 128,352L 160,352L 160,384 zM 352,256L 416,256L 416,384L 384,384L 384,288L 352,288 zM 32,448l0-448 l 448,0 L 480,448 L 32,448 z M 448,32L 64,32 L 64,416 l 384,0 L 448,32 zM 96,192L 96,64L 128,64L 128,160L 160,160L 160,192 zM 288,384L 352,384L 352,352L 288,352zM 192,384L 256,384L 256,352L 192,352z" /> +<glyph unicode="" d="M 408,448l 8-192L 96,256 l 8,192l 16,0 l 8-160l 256,0 l 8,160L 408,448 z M 104,0l-8,160l 320,0 l-8-160l-16,0 l-8,128L 128,128 l-8-128L 104,0 zM 32,224L 96,224L 96,192L 32,192zM 128,224L 192,224L 192,192L 128,192zM 224,224L 288,224L 288,192L 224,192zM 320,224L 384,224L 384,192L 320,192zM 416,224L 480,224L 480,192L 416,192z" /> +<glyph unicode="" d="M 480,416L 480,448 l-96,0 c-17.601,0-32-14.4-32-32l0-160 c0-7.928, 2.929-15.201, 7.748-20.807L 208,105l-71,74l-41-35l 112-144l 208,224l 64,0 + l0,32 l-96,0 L 384,416 L 480,416 zM 128,224l 32,0 L 160,416 c0,17.6-14.4,32-32,32L 64,448 c-17.6,0-32-14.4-32-32l0-192 l 32,0 l0,96 l 64,0 L 128,224 z M 64,352L 64,416 l 64,0 l0-64 L 64,352 zM 320,256l0,48 c0,17.6-4.4,32-22,32c 17.6,0, 22,14.4, 22,32L 320,416 c0,17.6-14.4,32-32,32l-96,0 l0-224 l 96,0 C 305.6,224, 320,238.4, 320,256z + M 224,416l 64,0 l0-64 l-64,0 L 224,416 z M 224,320l 64,0 l0-64 l-64,0 L 224,320 z" /> +<glyph unicode="" d="M 224,224l-64,0 l0,64 l 64,0 l0,64 l 64,0 l0-64 l 64,0 l0-64 l-64,0 l0-64 l-64,0 L 224,224 z M 480,192l0-160 L 32,32 L 32,192 l 64,0 l0-96 l 320,0 l0,96 L 480,192 z" /> +<glyph unicode="" d="M 208,128L 112,224L 208,320L 176,352L 48,224L 176,96 zM 336,352L 304,320L 400,224L 304,128L 336,96L 464,224 z" /> +<glyph unicode="" d="M 224,128l 64,0 l0-64 l-64,0 L 224,128 z M 352,352c 17.673,0, 32-14.327, 32-32l0-83 l-114-77l-46,0 l0,32 l 96,64l0,32 L 160,288 l0,64 L 352,352 z M 256,448 + c-59.833,0-116.083-23.3-158.392-65.608C 55.301,340.083, 32,283.833, 32,224c0-59.832, 23.301-116.084, 65.608-158.392 + C 139.917,23.3, 196.167,0, 256,0c 59.832,0, 116.084,23.3, 158.392,65.608C 456.7,107.916, 480,164.168, 480,224 + c0,59.833-23.3,116.083-65.608,158.392C 372.084,424.7, 315.832,448, 256,448z" /> +<glyph unicode="" d="M 448,416L 64,416 c-17.6,0-32-14.4-32-32l0-320 c0-17.6, 14.4-32, 32-32l 384,0 c 17.6,0, 32,14.4, 32,32L 480,384 C 480,401.6, 465.6,416, 448,416z + M 448,64.058c-0.006-0.007-0.015-0.014-0.021-0.021L 352,224l-80-64L 160,304L 64.016,64.042c-0.005,0.005-0.011,0.011-0.016,0.016 + L 64,383.943 c 0.017,0.020, 0.038,0.041, 0.057,0.057l 383.885,0 c 0.020-0.017, 0.041-0.038, 0.058-0.058L 448,64.058 zM 320,304A48,48 2700 1 1 416,304A48,48 2700 1 1 320,304z" /> +<glyph unicode="" d="M 448,416L 64,416 c-17.6,0-32-14.4-32-32l0-320 c0-17.6, 14.4-32, 32-32l 384,0 c 17.6,0, 32,14.4, 32,32L 480,384 C 480,401.6, 465.6,416, 448,416z + M 128,64L 64,64 l0,64 l 64,0 L 128,64 z M 128,192L 64,192 l0,64 l 64,0 L 128,192 z M 128,320L 64,320 L 64,384 l 64,0 L 128,320 z M 352,64L 160,64 L 160,384 l 192,0 L 352,64 z M 448,64l-64,0 l0,64 l 64,0 L 448,64 z + M 448,192l-64,0 l0,64 l 64,0 L 448,192 z M 448,320l-64,0 L 384,384 l 64,0 L 448,320 zM 192,320L 192,128L 336,224 z" /> +<glyph unicode="" d="M 38.899,327.688l 40.707-25.441C 105.007,342.804, 144,373.974, 190.21,389.37l-15.183,45.547 + C 118.153,415.968, 70.163,377.604, 38.899,327.688zM 336.973,434.917L 321.79,389.37c 46.211-15.396, 85.202-46.566, 110.604-87.124l 40.706,25.441 + C 441.837,377.604, 393.847,415.968, 336.973,434.917zM 303.987,127.996c-2.404,0-4.846,0.545-7.143,1.693L 224,166.111L 224,272 c0,8.836, 7.164,16, 16,16s 16-7.164, 16-16l0-86.111 + l 55.155-27.578c 7.903-3.951, 11.107-13.562, 7.155-21.466C 315.508,131.238, 309.856,127.997, 303.987,127.996zM 256,384C 149.961,384, 64,298.039, 64,192c0-106.039, 85.961-192, 192-192c 106.039,0, 192,85.961, 192,192 + C 448,298.039, 362.039,384, 256,384z M 256,48c-79.529,0-144,64.471-144,144c0,79.529, 64.471,144, 144,144c 79.529,0, 144-64.471, 144-144 + C 400,112.471, 335.529,48, 256,48z" /> +<glyph unicode="" d="M 32,252.127c 22.659,24.96, 48.581,46.18, 76.636,62.562C 153.802,341.061, 204.759,355, 256,355 + c 51.24,0, 102.198-13.939, 147.363-40.312c 28.056-16.382, 53.978-37.602, 76.637-62.562l0,58.716 + c-16.505,14.059-34.062,26.57-52.434,37.297C 375.063,378.796, 315.737,395, 256,395s-119.064-16.204-171.567-46.86 + C 66.062,337.413, 48.505,324.901, 32,310.842L 32,252.127 zM 256,320c-91.598,0-172.919-50.278-224-128c 51.081-77.724, 132.402-128, 224-128c 91.598,0, 172.919,50.276, 224,128 + C 428.919,269.722, 347.598,320, 256,320z M 256,224c0-17.673-14.327-32-32-32s-32,14.327-32,32c0,17.674, 14.327,32, 32,32 + S 256,241.674, 256,224z M 364.033,131.669C 330.316,111.982, 293.969,102, 256,102s-74.316,9.982-108.033,29.669 + C 122.19,146.721, 98.659,167.324, 78.91,192c 19.749,24.675, 43.28,45.279, 69.058,60.33c 6.638,3.876, 13.379,7.37, 20.213,10.491 + C 162.925,250.95, 160,237.817, 160,224c0-53.020, 42.981-96, 96-96c 53.020,0, 96,42.98, 96,96c0,13.817-2.925,26.95-8.18,38.821 + c 6.834-3.122, 13.575-6.615, 20.213-10.491c 25.777-15.051, 49.308-35.655, 69.058-60.33 + C 413.342,167.324, 389.811,146.721, 364.033,131.669z" /> +<glyph unicode="" d="M 325.584,338.083C 313.278,379.064, 311.146,384, 272,384l-32,0 c-39.809,0-41.332-5.076-54.209-48c0-0.001,0-0.001-0.001-0.002 + L 113.791,96l 56.818,0 l 28.8,96l 113.183,0 l 28.8-96l 56.815,0 L 325.584,338.083z M 218.609,256l 19.2,68c 5.043,16.809, 18.19,15, 18.19,15 + s 13.147,1.809, 18.19-15l 0.002,0 l 19.2-68L 218.609,256 z" /> +<glyph unicode="" d="M 288,448 C 411.712,448 512,347.712 512,224 C 512,100.288 411.712,0 288,0 L 288,48 C 335.012,48 379.209,66.307 412.451,99.549 C 445.693,132.791 464,176.988 464,224 C 464,271.011 445.693,315.209 412.451,348.451 C 379.209,381.693 335.012,400 288,400 C 240.989,400 196.791,381.693 163.549,348.451 C 137.979,322.882 121.258,290.828 114.896,256 L 208,256 L 96,128 L -16,256 L 66.285,256 C 81.815,364.551 175.154,448 288,448 ZM 384,256 L 384,192 L 256,192 L 256,352 L 320,352 L 320,256 Z" /> +<glyph unicode="" d="M 512,183.771l0,80.458 l-79.572,7.957c-4.093,15.021-10.044,29.274-17.605,42.49l 52.298,63.919L 410.595,435.12l-63.918-52.298 + c-13.217,7.562-27.471,13.513-42.491,17.604L 296.229,480l-80.458,0 l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604 + L 101.405,435.12L 44.88,378.595l 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49L0,264.229l0-80.458 l 79.573-7.957 + c 4.093-15.021, 10.043-29.274, 17.605-42.491L 44.88,69.405l 56.524-56.524l 63.919,52.298c 13.216-7.562, 27.47-13.514, 42.49-17.605 + L 215.771-32l 80.458,0 l 7.957,79.572c 15.021,4.093, 29.274,10.044, 42.491,17.605l 63.918-52.298l 56.524,56.524l-52.298,63.918 + c 7.562,13.217, 13.514,27.471, 17.605,42.49L 512,183.771z M 352,192l-64-64l-64,0 l-64,64l0,64 l 64,64l 64,0 l 64-64L 352,192 z" /> +<glyph unicode="" d="M 384,377 L 384,352 L 448,352 L 448,320 L 352,320 L 352,393 L 416,423 L 416,448 L 352,448 L 352,480 L 448,480 L 448,407 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" /> +<glyph unicode="" d="M 384,25 L 384,0 L 448,0 L 448-32 L 352-32 L 352,41 L 416,71 L 416,96 L 352,96 L 352,128 L 448,128 L 448,55 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" /> +<glyph unicode="" d="M 352,288l0,80 c0,8.8-7.2,16-16,16l-80,0 L 256,416 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,384 c-8.801,0-16-7.2-16-16 + l0-256 c0-8.8, 7.199-16, 16-16l 112,0 l0-96 l 288,0 L 448,288 L 352,288 z M 160,415.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0 + c 0.021-0.018, 0.041-0.038, 0.059-0.057L 224,384 l-64,0 L 160,415.943 z M 96,320l0,32 l 192,0 l0-32 L 96,320 z M 416,32L 192,32 L 192,256 l 224,0 L 416,32 zM 224,224L 224,160L 240,160L 256,192L 288,192L 288,96L 264,96L 264,64L 344,64L 344,96L 320,96L 320,192L 352,192L 368,160L 384,160L 384,224 z" data-tags="pastetext" /> +<glyph unicode="" d="M 384,352L 416,352L 416,320L 384,320zM 320,288L 352,288L 352,256L 320,256zM 320,224L 352,224L 352,192L 320,192zM 320,160L 352,160L 352,128L 320,128zM 256,224L 288,224L 288,192L 256,192zM 256,160L 288,160L 288,128L 256,128zM 192,160L 224,160L 224,128L 192,128zM 384,288L 416,288L 416,256L 384,256zM 384,224L 416,224L 416,192L 384,192zM 384,160L 416,160L 416,128L 384,128zM 384,96L 416,96L 416,64L 384,64zM 320,96L 352,96L 352,64L 320,64zM 256,96L 288,96L 288,64L 256,64zM 192,96L 224,96L 224,64L 192,64zM 128,96L 160,96L 160,64L 128,64z" data-tags="resize, dots" /> +<glyph unicode="" d="M 464,416L 256,416L 240,448L 64,448L 32,384L 480,384 zM 420.17,128L 464,128 l 16,224L 32,352 l 32-320l 178.040,0 C 189.599,50.888, 152,101.133, 152,160c0,74.991, 61.009,136, 136,136 + c 74.99,0, 136-61.009, 136-136C 424,149.161, 422.689,138.425, 420.17,128zM 437.498,55.125l-67.248,55.346C 378.977,124.932, 384,141.878, 384,160c0,53.020-42.98,96-96,96s-96-42.98-96-96 + s 42.98-96, 96-96c 18.122,0, 35.069,5.023, 49.529,13.75l 55.346-67.248c 11.481-13.339, 31.059-14.070, 43.503-1.626l 2.746,2.746 + C 451.568,24.066, 450.837,43.644, 437.498,55.125z M 288,98c-34.242,0-62,27.758-62,62s 27.758,62, 62,62s 62-27.758, 62-62 + S 322.242,98, 288,98z" data-tags="browse" /> +<glyph unicode=" " horiz-adv-x="256" /> +</font></defs></svg>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot Binary files differnew file mode 100644 index 0000000..60e2d2e --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.svg b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.svg new file mode 100644 index 0000000..930c48d --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.svg @@ -0,0 +1,62 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata>Generated by IcoMoon</metadata> +<defs> +<font id="tinymce-small" horiz-adv-x="512"> +<font-face units-per-em="512" ascent="480" descent="-32" /> +<missing-glyph horiz-adv-x="512" /> +<glyph unicode=" " d="" horiz-adv-x="256" /> +<glyph unicode="" d="M480 40v295.969l-111.969 112.031h-296.031c-22.091 0-40-17.908-40-40v-368c0-22.092 17.909-40 40-40h368c22.092 0 40 17.908 40 40zM288 384h32v-96h-32v96zM352 64h-192v127.941c0.017 0.021 0.038 0.041 0.058 0.059h191.885c0.020-0.018 0.041-0.038 0.058-0.059l-0.001-127.941zM416 64h-32v128c0 17.6-14.4 32-32 32h-192c-17.6 0-32-14.4-32-32v-128h-32v320h32v-96c0-17.6 14.4-32 32-32h160c17.6 0 32 14.4 32 32v85.505l64-64.036v-245.469z" /> +<glyph unicode="" d="M425.373 358.627l-66.746 66.745c-12.444 12.446-37.027 22.628-54.627 22.628h-208c-17.6 0-32-14.4-32-32v-384c0-17.6 14.4-32 32-32h320c17.6 0 32 14.4 32 32v272c0 17.6-10.183 42.182-22.627 54.627zM402.745 336.001c3.396-3.398 6.896-9.581 9.447-16.001h-92.192v92.193c6.42-2.55 12.602-6.050 16-9.448l66.745-66.744zM415.942 32h-319.885c-0.020 0.017-0.041 0.038-0.057 0.058v383.885c0.017 0.020 0.038 0.041 0.057 0.057h191.943v-128h128v-255.942c-0.017-0.020-0.038-0.041-0.058-0.058z" /> +<glyph unicode="" d="M512 183.771v80.458l-79.572 7.957c-4.093 15.021-10.044 29.274-17.605 42.49l52.298 63.919-56.526 56.525-63.918-52.298c-13.217 7.562-27.471 13.513-42.491 17.604l-7.957 79.574h-80.458l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604l-63.919 52.297-56.525-56.525 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49l-79.573-7.958v-80.458l79.573-7.957c4.093-15.021 10.043-29.274 17.605-42.491l-52.298-63.918 56.524-56.524 63.919 52.298c13.216-7.562 27.47-13.514 42.49-17.605l7.958-79.574h80.458l7.957 79.572c15.021 4.093 29.274 10.044 42.491 17.605l63.918-52.298 56.524 56.524-52.298 63.918c7.562 13.217 13.514 27.471 17.605 42.49l79.574 7.96zM352 192l-64-64h-64l-64 64v64l64 64h64l64-64v-64z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM32 192h448v-64h-448zM32 288h288v-64h-288zM32 96h288v-64h-288z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM32 192h448v-64h-448zM128 288h256v-64h-256zM128 96h256v-64h-256z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM32 192h448v-64h-448zM192 288h288v-64h-288zM192 96h288v-64h-288z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM32 192h448v-64h-448zM32 288h448v-64h-448zM32 96h448v-64h-448z" /> +<glyph unicode="" d="M432.204 144.934c-23.235 23.235-53.469 34.002-80.541 31.403l-31.663 31.663 96 96c0 0 64 64 0 128l-160-160-160 160c-64-64 0-128 0-128l96-96-31.663-31.663c-27.072 2.599-57.305-8.169-80.54-31.403-37.49-37.49-42.556-93.209-11.313-124.45 31.241-31.241 86.96-26.177 124.45 11.313 23.235 23.234 34.001 53.469 31.403 80.54l31.663 31.663 31.664-31.664c-2.598-27.072 8.168-57.305 31.403-80.539 37.489-37.49 93.209-42.556 124.449-11.313 31.244 31.241 26.178 86.959-11.312 124.45zM176.562 100.711c-1.106-12.166-7.51-24.913-17.57-34.973-11.106-11.107-25.54-17.738-38.609-17.738-5.262 0-12.649 1.114-17.958 6.424-10.703 10.702-8.688 36.566 11.313 56.568 11.106 11.107 25.54 17.738 38.609 17.738 5.262 0 12.649-1.114 17.958-6.424 6.556-6.555 6.735-16.344 6.257-21.595zM256 176c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zM409.576 54.424c-5.31-5.31-12.696-6.424-17.958-6.424-13.069 0-27.503 6.631-38.609 17.738-10.061 10.060-16.464 22.807-17.569 34.973-0.479 5.251-0.3 15.040 6.257 21.596 5.309 5.311 12.695 6.424 17.958 6.424 13.068 0 27.503-6.631 38.608-17.737 20.002-20.004 22.016-45.868 11.313-56.57z" /> +<glyph unicode="" d="M352 288v80c0 8.8-7.2 16-16 16h-80v32c0 17.6-14.4 32-32 32h-64c-17.602 0-32-14.4-32-32v-32h-80c-8.801 0-16-7.2-16-16v-256c0-8.8 7.199-16 16-16h112v-96h192l96 96v192h-96zM160 415.943c0.017 0.019 0.036 0.039 0.057 0.057h63.884c0.021-0.018 0.041-0.038 0.059-0.057v-31.943h-64v31.943zM96 320v32h192v-32h-192zM352 45.255v50.745h50.745l-50.745-50.745zM416 128h-96v-96h-128v224h224v-128z" /> +<glyph unicode="" d="M444 288h-28v128h32v32h-160v-32h32v-128h-128v128h32v32h-160v-32h32v-128h-28c-19.8 0-36-16.2-36-36v-216c0-19.8 16.2-36 36-36h120c19.8 0 36 16.2 36 36v156h64v-156c0-19.8 16.2-36 36-36h120c19.8 0 36 16.2 36 36v216c0 19.8-16.2 36-36 36zM174 32h-92c-9.9 0-18 7.2-18 16s8.1 16 18 16h92c9.9 0 18-7.2 18-16s-8.1-16-18-16zM272 224h-32c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16zM430 32h-92c-9.9 0-18 7.2-18 16s8.1 16 18 16h92c9.9 0 18-7.2 18-16s-8.1-16-18-16z" /> +<glyph unicode="" d="M192 416h288v-64h-288zM192 256h288v-64h-288zM192 96h288v-64h-288zM64 384c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32zM64 224c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32zM64 64c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32z" /> +<glyph unicode="" d="M192 416h288v-64h-288zM192 256h288v-64h-288zM192 96h288v-64h-288zM160 215v73h-32v160h-64v-32h32v-128h-32v-32h64v-25l-64-30v-73h64v-32h-64v-32h64v-32h-64v-32h96v160h-64v25z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM192 192h288v-64h-288zM192 288h288v-64h-288zM32 96h448v-64h-448zM32 288l112-80-112-80z" /> +<glyph unicode="" d="M32 384h448v-64h-448zM32 192h288v-64h-288zM32 288h288v-64h-288zM32 96h448v-64h-448zM480 288l-112-80 112-80z" /> +<glyph unicode="" d="M128.214 267.637c52.9 0 95.786-45.585 95.786-101.819 0-56.232-42.886-101.818-95.786-101.818-52.901 0-95.786 45.585-95.786 101.818l-0.428 14.546c0 112.465 85.77 203.636 191.572 203.636v-58.182c-36.55 0-70.913-15.13-96.758-42.602-4.977-5.289-9.517-10.917-13.612-16.828 4.892 0.82 9.903 1.249 15.012 1.249zM384.214 267.637c52.9 0 95.786-45.585 95.786-101.819 0-56.232-42.886-101.818-95.786-101.818-52.901 0-95.786 45.585-95.786 101.818l-0.428 14.546c0 112.465 85.77 203.636 191.572 203.636v-58.182c-36.55 0-70.913-15.13-96.758-42.602-4.978-5.289-9.518-10.917-13.612-16.828 4.892 0.82 9.903 1.249 15.012 1.249z" /> +<glyph unicode="" d="M352 0c29.5 99.5 67.453 227.633-128 223.048v-111.048l-168.001 168 168.001 168v-108.663c234.046 6.1 272-179.337 128-339.337z" /> +<glyph unicode="" d="M288 339.337v108.663l168.001-168-168.001-168v111.048c-195.453 4.585-157.5-123.548-128-223.048-144 160-106.046 345.437 128 339.337z" /> +<glyph unicode="" d="M463.637 364.892l-66.745 66.744c-10.552 10.552-24.616 16.364-39.599 16.364s-29.047-5.812-39.598-16.363l-82.746-82.745c-21.834-21.834-21.834-57.362 0-79.196l1.373-1.373 33.941 33.941-1.373 1.373c-3.066 3.066-3.066 8.247 0 11.313l82.746 82.746c2.005 2.004 4.404 2.304 5.656 2.304s3.651-0.299 5.656-2.305l66.745-66.744c3.066-3.067 3.066-8.249 0.001-11.314l-82.747-82.747c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651 0.3-5.656 2.306l-1.373 1.373-33.94-33.942 1.371-1.371c10.553-10.554 24.615-16.364 39.6-16.364s29.047 5.812 39.598 16.363l82.747 82.746c21.831 21.833 21.831 57.36-0.002 79.195zM275.678 179.678l-33.941-33.941 1.373-1.373c2.004-2.004 2.305-4.403 2.305-5.655 0-1.253-0.299-3.651-2.303-5.657l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652 0.3-5.657 2.305l-66.746 66.743c-2.005 2.005-2.305 4.405-2.305 5.657s0.299 3.65 2.305 5.656l82.745 82.744c2.005 2.006 4.405 2.306 5.657 2.306s3.652-0.3 5.657-2.306l1.373-1.371 33.941 33.94-1.373 1.373c-10.552 10.552-24.615 16.363-39.598 16.363s-29.046-5.812-39.598-16.363l-82.744-82.743c-10.553-10.552-16.365-24.617-16.365-39.599s5.812-29.047 16.363-39.599l66.745-66.745c10.553-10.551 24.616-16.363 39.599-16.363s29.046 5.812 39.598 16.363l82.747 82.746c10.552 10.552 16.361 24.615 16.361 39.598s-5.812 29.047-16.363 39.598l-1.372 1.373zM176 125c-4.862 0-9.725 1.855-13.435 5.564-7.42 7.42-7.42 19.449 0 26.869l160 160c7.42 7.42 19.448 7.42 26.868 0 7.422-7.42 7.422-19.45 0-26.87l-160-160c-3.708-3.708-8.571-5.563-13.433-5.563z" /> +<glyph unicode="" d="M463.637 364.892l-66.745 66.744c-10.552 10.552-24.616 16.364-39.599 16.364s-29.047-5.812-39.598-16.363l-82.746-82.745c-21.834-21.834-21.834-57.362 0-79.196l1.373-1.373 33.941 33.941-1.373 1.373c-3.066 3.066-3.066 8.247 0 11.313l82.746 82.746c2.005 2.004 4.404 2.304 5.656 2.304s3.651-0.299 5.656-2.305l66.745-66.744c3.066-3.067 3.066-8.249 0.001-11.314l-82.747-82.747c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651 0.3-5.656 2.306l-1.373 1.373-33.94-33.942 1.371-1.371c10.553-10.554 24.615-16.364 39.6-16.364s29.047 5.812 39.598 16.363l82.747 82.746c21.831 21.833 21.831 57.36-0.002 79.195zM275.678 179.678l-33.941-33.941 1.373-1.373c2.004-2.004 2.305-4.403 2.305-5.655 0-1.253-0.299-3.651-2.303-5.657l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652 0.3-5.657 2.305l-66.746 66.743c-2.005 2.005-2.305 4.405-2.305 5.657s0.299 3.65 2.305 5.656l82.745 82.744c2.005 2.006 4.405 2.306 5.657 2.306s3.652-0.3 5.657-2.306l1.373-1.371 33.941 33.94-1.373 1.373c-10.552 10.552-24.615 16.363-39.598 16.363s-29.046-5.812-39.598-16.363l-82.744-82.743c-10.553-10.552-16.365-24.617-16.365-39.599s5.812-29.047 16.363-39.599l66.745-66.745c10.553-10.551 24.616-16.363 39.599-16.363s29.046 5.812 39.598 16.363l82.747 82.746c10.552 10.552 16.361 24.615 16.361 39.598s-5.812 29.047-16.363 39.598l-1.372 1.373zM400 61c-4.862 0-9.725 1.854-13.435 5.565l-64 63.999c-7.422 7.42-7.422 19.449 0 26.869 7.42 7.422 19.448 7.422 26.868 0l64-64c7.422-7.42 7.422-19.448 0-26.868-3.708-3.711-8.571-5.565-13.433-5.565zM304 0c-8.837 0-16 7.163-16 16v64c0 8.837 7.163 16 16 16s16-7.163 16-16v-64c0-8.837-7.163-16-16-16zM464 160h-64c-8.837 0-16 7.163-16 16s7.163 16 16 16h64c8.837 0 16-7.163 16-16s-7.163-16-16-16zM112 387c4.862 0 9.725-1.854 13.435-5.565l64-64c7.421-7.42 7.421-19.449 0-26.869-7.42-7.422-19.449-7.422-26.869 0l-64 64c-7.421 7.42-7.421 19.449 0 26.869 3.709 3.711 8.572 5.565 13.434 5.565zM208 448c8.837 0 16-7.163 16-16v-64c0-8.837-7.163-16-16-16s-16 7.163-16 16v64c0 8.837 7.163 16 16 16zM48 288h64c8.837 0 16-7.163 16-16s-7.163-16-16-16h-64c-8.837 0-16 7.163-16 16s7.163 16 16 16z" /> +<glyph unicode="" d="M128 448v-448l128 128 128-128v448h-256zM352 85.255l-96 96-96-96v330.745h192v-330.745z" /> +<glyph unicode="" d="M448 416h-384c-17.6 0-32-14.4-32-32v-320c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v320c0 17.6-14.4 32-32 32zM448 64.058c-0.006-0.007-0.015-0.014-0.021-0.021l-95.979 159.963-80-64-112 144-95.984-239.958c-0.005 0.005-0.011 0.011-0.016 0.016v319.885c0.017 0.020 0.038 0.041 0.057 0.057h383.885c0.020-0.017 0.041-0.038 0.058-0.058v-319.884zM320 304c0-26.51 21.49-48 48-48s48 21.49 48 48c0 26.51-21.49 48-48 48-26.51 0-48-21.49-48-48z" /> +<glyph unicode="" d="M448 416h-384c-17.6 0-32-14.4-32-32v-320c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v320c0 17.6-14.4 32-32 32zM128 64h-64v64h64v-64zM128 192h-64v64h64v-64zM128 320h-64v64h64v-64zM352 64h-192v320h192v-320zM448 64h-64v64h64v-64zM448 192h-64v64h64v-64zM448 320h-64v64h64v-64zM192 320v-192l144 96z" /> +<glyph unicode="" d="M224 128h64v-64h-64v64zM352 352c17.673 0 32-14.327 32-32v-83l-114-77h-46v32l96 64v32h-160v64h192zM256 448c-59.833 0-116.083-23.3-158.392-65.608-42.307-42.309-65.608-98.559-65.608-158.392 0-59.832 23.301-116.084 65.608-158.392 42.309-42.308 98.559-65.608 158.392-65.608 59.832 0 116.084 23.3 158.392 65.608 42.308 42.308 65.608 98.56 65.608 158.392 0 59.833-23.3 116.083-65.608 158.392-42.308 42.308-98.56 65.608-158.392 65.608z" /> +<glyph unicode="" d="M208 128l-96 96 96 96-32 32-128-128 128-128zM336 352l-32-32 96-96-96-96 32-32 128 128z" /> +<glyph unicode="" d="M38.899 327.688l40.707-25.441c25.401 40.557 64.394 71.727 110.604 87.123l-15.183 45.547c-56.874-18.949-104.864-57.313-136.128-107.229zM336.973 434.917l-15.183-45.547c46.211-15.396 85.202-46.566 110.604-87.124l40.706 25.441c-31.263 49.917-79.253 88.281-136.127 107.23zM303.987 127.996c-2.404 0-4.846 0.545-7.143 1.693l-72.844 36.422v105.889c0 8.836 7.164 16 16 16s16-7.164 16-16v-86.111l55.155-27.578c7.903-3.951 11.107-13.562 7.155-21.466-2.802-5.607-8.454-8.848-14.323-8.849zM256 384c-106.039 0-192-85.961-192-192s85.961-192 192-192c106.039 0 192 85.961 192 192 0 106.039-85.961 192-192 192zM256 48c-79.529 0-144 64.471-144 144s64.471 144 144 144c79.529 0 144-64.471 144-144 0-79.529-64.471-144-144-144z" /> +<glyph unicode="" d="M32 252.127c22.659 24.96 48.581 46.18 76.636 62.562 45.166 26.372 96.123 40.311 147.364 40.311 51.24 0 102.198-13.939 147.363-40.312 28.056-16.382 53.978-37.602 76.637-62.562v58.716c-16.505 14.059-34.062 26.57-52.434 37.297-52.503 30.657-111.829 46.861-171.566 46.861s-119.064-16.204-171.567-46.86c-18.371-10.727-35.928-23.239-52.433-37.298v-58.715zM256 320c-91.598 0-172.919-50.278-224-128 51.081-77.724 132.402-128 224-128 91.598 0 172.919 50.276 224 128-51.081 77.722-132.402 128-224 128zM256 224c0-17.673-14.327-32-32-32s-32 14.327-32 32c0 17.674 14.327 32 32 32s32-14.326 32-32zM364.033 131.669c-33.717-19.687-70.064-29.669-108.033-29.669s-74.316 9.982-108.033 29.669c-25.777 15.052-49.308 35.655-69.057 60.331 19.749 24.675 43.28 45.279 69.058 60.33 6.638 3.876 13.379 7.37 20.213 10.491-5.256-11.871-8.181-25.004-8.181-38.821 0-53.020 42.981-96 96-96 53.020 0 96 42.98 96 96 0 13.817-2.925 26.95-8.18 38.821 6.834-3.122 13.575-6.615 20.213-10.491 25.777-15.051 49.308-35.655 69.058-60.33-19.749-24.676-43.28-45.279-69.058-60.331z" /> +<glyph unicode="" d="M325.584 338.083c-12.306 40.981-14.438 45.917-53.584 45.917h-32c-39.809 0-41.332-5.076-54.209-48 0-0.001 0-0.001-0.001-0.002l-71.999-239.998h56.818l28.8 96h113.183l28.8-96h56.815l-72.623 242.083zM218.609 256l19.2 68c5.043 16.809 18.19 15 18.19 15s13.147 1.809 18.19-15h0.002l19.2-68h-74.782z" /> +<glyph unicode="" d="M32 384v-352h448v352h-448zM192 160v64h128v-64h-128zM320 128v-64h-128v64h128zM320 320v-64h-128v64h128zM160 320v-64h-96v64h96zM64 224h96v-64h-96v64zM352 224h96v-64h-96v64zM352 256v64h96v-64h-96zM64 128h96v-64h-96v64zM352 64v64h96v-64h-96z" /> +<glyph unicode="" d="M32 256h448v-64h-448z" /> +<glyph unicode="" d="M32 96h256v-64h-256v64zM384 384h-110.279l-91.883-256h-66.144l91.881 256h-111.575v64h288v-64zM464.887 32l-64.887 64.887-64.887-64.887-31.113 31.113 64.887 64.887-64.887 64.887 31.113 31.113 64.887-64.887 64.887 64.887 31.113-31.113-64.887-64.887 64.887-64.887-31.113-31.113z" /> +<glyph unicode="" d="M384 25v-25h64v-32h-96v73l64 30v25h-64v32h96v-73zM338 352h-68l-94-94-94 94h-68l128-128-128-128h68l94 94 94-94h68l-128 128z" /> +<glyph unicode="" d="M384 377v-25h64v-32h-96v73l64 30v25h-64v32h96v-73zM338 352h-68l-94-94-94 94h-68l128-128-128-128h68l94 94 94-94h68l-128 128z" /> +<glyph unicode="" d="M352 64v18.502c75.674 30.814 128 96.91 128 173.498 0 106.039-100.288 192-224 192s-224-85.961-224-192c0-76.588 52.327-142.684 128-173.498v-18.502h-96l-32 48v-112h160v111.406c-50.45 25.681-85.333 80.77-85.333 144.594 0 88.366 66.859 160 149.333 160 82.474 0 149.333-71.634 149.333-160 0-63.824-34.883-118.913-85.333-144.594v-111.406h160v112l-32-48h-96z" /> +<glyph unicode="" d="M256 410c49.683 0 96.391-19.347 131.521-54.478s54.479-81.839 54.479-131.522-19.348-96.391-54.479-131.521-81.838-54.479-131.521-54.479-96.391 19.348-131.522 54.479-54.478 81.838-54.478 131.521 19.347 96.391 54.478 131.522 81.839 54.478 131.522 54.478zM256 448c-123.712 0-224-100.288-224-224s100.288-224 224-224 224 100.288 224 224-100.288 224-224 224v0zM160 288c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32zM288 288c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32zM256 152c-50.92 0-96.28 18.437-125.583 47.164 11.563-58.804 63.389-103.164 125.583-103.164 62.194 0 114.020 44.36 125.584 103.164-29.304-28.727-74.664-47.164-125.584-47.164z" /> +<glyph unicode="" d="M128 416h256v-64h-256v64zM448 320h-384c-17.6 0-32-14.4-32-32v-128c0-17.6 14.398-32 32-32h64v-96h256v96h64c17.6 0 32 14.4 32 32v128c0 17.6-14.4 32-32 32zM352 64h-192v128h192v-128zM455.2 272c0-12.813-10.387-23.2-23.199-23.2s-23.201 10.387-23.201 23.2 10.389 23.2 23.201 23.2c12.813 0 23.199-10.387 23.199-23.2z" /> +<glyph unicode="" d="M240 288l-96 96 64 64h-176v-176l64 64 96-96zM320 240l96 96 64-64v176h-176l64-64-96-96zM272 160l96-96-64-64h176v176l-64-64-96 96zM192 208l-96-96-64 64v-176h176l-64 64 96 96z" /> +<glyph unicode="" d="M480 416v32h-96c-17.601 0-32-14.4-32-32v-160c0-7.928 2.929-15.201 7.748-20.807l-151.748-130.193-71 74-41-35 112-144 208 224h64v32h-96v160h96zM128 224h32v192c0 17.6-14.4 32-32 32h-64c-17.6 0-32-14.4-32-32v-192h32v96h64v-96zM64 352v64h64v-64h-64zM320 256v48c0 17.6-4.4 32-22 32 17.6 0 22 14.4 22 32v48c0 17.6-14.4 32-32 32h-96v-224h96c17.6 0 32 14.4 32 32zM224 416h64v-64h-64v64zM224 320h64v-64h-64v64z" /> +<glyph unicode="" d="M224 224h-64v64h64v64h64v-64h64v-64h-64v-64h-64v64zM480 192v-160h-448v160h64v-96h320v96h64z" /> +<glyph unicode="" d="M256 288h64v-32h-64zM256 96h64v-32h-64zM288 192h64v-32h-64zM384 192v-96h-32v-32h64v128zM192 192h64v-32h-64zM160 96h64v-32h-64zM160 288h64v-32h-64zM96 384v-128h32v96h32v32zM352 256h64v128h-32v-96h-32zM32 448v-448h448v448h-448zM448 32h-384v384h384v-384zM96 192v-128h32v96h32v32zM288 384h64v-32h-64zM192 384h64v-32h-64z" /> +<glyph unicode="" d="M408 448l8-192h-320l8 192h16l8-160h256l8 160h16zM104 0l-8 160h320l-8-160h-16l-8 128h-256l-8-128h-16zM32 224h64v-32h-64zM128 224h64v-32h-64zM224 224h64v-32h-64zM320 224h64v-32h-64zM416 224h64v-32h-64z" /> +<glyph unicode="" d="M288 448c123.712 0 224-100.288 224-224s-100.288-224-224-224v48c47.012 0 91.209 18.307 124.451 51.549 33.242 33.242 51.549 77.439 51.549 124.451 0 47.011-18.307 91.209-51.549 124.451-33.242 33.242-77.439 51.549-124.451 51.549-47.011 0-91.209-18.307-124.451-51.549-25.57-25.569-42.291-57.623-48.653-92.451h93.104l-112-128-112 128h82.285c15.53 108.551 108.869 192 221.715 192zM384 256v-64h-128v160h64v-96z" /> +<glyph unicode="" d="M312.721 232.909c24.037 19.075 39.279 47.428 39.279 79.091 0 57.438-50.145 104-112 104h-112v-384h144c61.856 0 112 46.562 112 104 0 44.098-29.559 81.781-71.279 96.909zM192 328c0 13.255 10.745 24 24 24h33.602c21.207 0 38.398-21.49 38.398-48s-17.191-48-38.398-48h-57.602v72zM273.6 96h-57.6c-13.255 0-24 10.745-24 24v72h81.6c21.209 0 38.4-21.49 38.4-48s-17.191-48-38.4-48z" /> +<glyph unicode="" d="M416 416v-32h-72l-128-320h72v-32h-224v32h72l128 320h-72v32h224z" /> +<glyph unicode="" d="M96 64h288v-32h-288v32zM320 416v-192c0-15.656-7.35-30.812-20.695-42.676-15.471-13.751-36.534-21.324-59.305-21.324-22.772 0-43.834 7.573-59.304 21.324-13.346 11.864-20.696 27.020-20.696 42.676v192h-64v-192c0-70.691 64.471-128 144-128s144 57.309 144 128v192h-64z" /> +<glyph unicode="" d="M480 224h-132.938c-25.039 17.71-57.215 27.43-91.062 27.43-44.603 0-82.286 25.121-82.286 54.856 0 29.735 37.683 54.857 82.286 54.857 37.529 0 70.154-17.788 79.56-41.143h56.508c-3.965 25.322-18.79 48.984-42.029 66.413-25.44 19.080-58.838 29.587-94.039 29.587-35.202 0-68.598-10.507-94.037-29.587-27.394-20.545-43.106-49.751-43.106-80.127s15.712-59.582 43.106-80.127c0.978-0.733 1.971-1.449 2.973-2.158h-132.936v-32h256.266c29.104-8.553 50.021-28.135 50.021-50.286 0-29.734-37.684-54.855-82.286-54.855-37.53 0-70.154 17.787-79.559 41.143h-56.508c3.965-25.32 18.791-48.984 42.030-66.413 25.438-19.082 58.834-29.59 94.036-29.59 35.201 0 68.599 10.508 94.037 29.587 27.395 20.545 43.104 49.751 43.104 80.127 0 17.649-5.327 34.896-15.147 50.286h102.006v32z" /> +<glyph unicode="" d="M192 416c-61.856 0-112-50.144-112-112s50.144-112 112-112v-160h64v320h32v-320h64v320h64v64h-224z" /> +<glyph unicode="" d="M224 416c-61.856 0-112-50.144-112-112s50.144-112 112-112v-160h64v320h32v-320h64v320h64v64h-224zM32 32l112 96-112 96z" /> +<glyph unicode="" d="M160 416c-61.856 0-112-50.144-112-112s50.144-112 112-112v-160h64v320h32v-320h64v320h64v64h-224zM480 224l-112-96 112-96z" /> +<glyph unicode="" d="M416 320h-96v32l-96 96h-192v-352h192v-96h288v224l-96 96zM416 274.745l50.745-50.745h-50.745v50.745zM224 402.745l50.745-50.745h-50.745v50.745zM64 416h128v-96h96v-192h-224v288zM480 32h-224v64h64v192h64v-96h96v-160z" /> +<glyph unicode="" d="M384 352h32v-32h-32zM320 288h32v-32h-32zM320 224h32v-32h-32zM320 160h32v-32h-32zM256 224h32v-32h-32zM256 160h32v-32h-32zM192 160h32v-32h-32zM384 288h32v-32h-32zM384 224h32v-32h-32zM384 160h32v-32h-32zM384 96h32v-32h-32zM320 96h32v-32h-32zM256 96h32v-32h-32zM192 96h32v-32h-32zM128 96h32v-32h-32z" /> +<glyph unicode="" d="M464 416h-208l-16 32h-176l-32-64h448zM420.17 128h43.83l16 224h-448l32-320h178.040c-52.441 18.888-90.040 69.133-90.040 128 0 74.991 61.009 136 136 136 74.99 0 136-61.009 136-136 0-10.839-1.311-21.575-3.83-32zM437.498 55.125l-67.248 55.346c8.727 14.461 13.75 31.407 13.75 49.529 0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96c18.122 0 35.069 5.023 49.529 13.75l55.346-67.248c11.481-13.339 31.059-14.070 43.503-1.626l2.746 2.746c12.444 12.444 11.713 32.022-1.626 43.503zM288 98c-34.242 0-62 27.758-62 62s27.758 62 62 62 62-27.758 62-62-27.758-62-62-62z" /> +<glyph unicode="" d="M352 288v80c0 8.8-7.2 16-16 16h-80v32c0 17.6-14.4 32-32 32h-64c-17.602 0-32-14.4-32-32v-32h-80c-8.801 0-16-7.2-16-16v-256c0-8.8 7.199-16 16-16h112v-96h288v288h-96zM160 415.943c0.017 0.019 0.036 0.039 0.057 0.057h63.884c0.021-0.018 0.041-0.038 0.059-0.057v-31.943h-64v31.943zM96 320v32h192v-32h-192zM416 32h-224v224h224v-224zM224 224v-64h16l16 32h32v-96h-24v-32h80v32h-24v96h32l16-32h16v64z" /> +</font></defs></svg>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf Binary files differnew file mode 100644 index 0000000..afc6ec4 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff Binary files differnew file mode 100644 index 0000000..fa72c74 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.dev.svg b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.dev.svg new file mode 100644 index 0000000..c87b8cd --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.dev.svg @@ -0,0 +1,153 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata> +This is a custom SVG font generated by IcoMoon. +<iconset grid="16"></iconset> +</metadata> +<defs> +<font id="tinymce" horiz-adv-x="512" > +<font-face units-per-em="512" ascent="480" descent="-32" /> +<missing-glyph horiz-adv-x="512" /> +<glyph class="hidden" unicode="" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" /> +<glyph unicode="" d="M 464,416L 256,416L 240,448L 64,448L 32,384L 480,384 zM 452.17,128l 37.43,0 L 512,352L0,352 l 32-320l 242.040,0 C 221.599,50.888, 184,101.133, 184,160c0,74.991, 61.009,136, 136,136 + c 74.99,0, 136-61.009, 136-136C 456,149.161, 454.689,138.425, 452.17,128zM 501.498,23.125l-99.248,87.346C 410.977,124.931, 416,141.878, 416,160c0,53.020-42.98,96-96,96s-96-42.98-96-96 + s 42.98-96, 96-96c 18.122,0, 35.069,5.023, 49.529,13.75l 87.346-99.248c 11.481-13.339, 31.059-14.070, 43.503-1.626l 2.746,2.746 + C 515.568-7.934, 514.837,11.644, 501.498,23.125z M 320,98c-34.242,0-62,27.758-62,62s 27.758,62, 62,62s 62-27.758, 62-62 + S 354.242,98, 320,98z" /> +<glyph unicode="" d="M 384,352L 416,352L 416,320L 384,320zM 320,288L 352,288L 352,256L 320,256zM 320,224L 352,224L 352,192L 320,192zM 320,160L 352,160L 352,128L 320,128zM 256,224L 288,224L 288,192L 256,192zM 256,160L 288,160L 288,128L 256,128zM 192,160L 224,160L 224,128L 192,128zM 384,288L 416,288L 416,256L 384,256zM 384,224L 416,224L 416,192L 384,192zM 384,160L 416,160L 416,128L 384,128zM 384,96L 416,96L 416,64L 384,64zM 320,96L 352,96L 352,64L 320,64zM 256,96L 288,96L 288,64L 256,64zM 192,96L 224,96L 224,64L 192,64zM 128,96L 160,96L 160,64L 128,64z" data-tags="resize, dots" /> +<glyph unicode="" d="M 416,352l-96,0 L 320,384 L 224,480L0,480 l0-384 l 192,0 l0-128 l 320,0 L 512,256 L 416,352z M 416,306.745L 466.745,256L 416,256 L 416,306.745 z M 224,434.745L 274.745,384L 224,384 + L 224,434.745 z M 32,448l 160,0 l0-96 l 96,0 l0-224 L 32,128 L 32,448 z M 480,0L 224,0 l0,96 l 96,0 L 320,320 l 64,0 l0-96 l 96,0 L 480,0 z" data-tags="copy" /> +<glyph unicode="" d="M 128,448 L 384,448 L 384,384 L 320,384 L 320,0 L 256,0 L 256,384 L 192,384 L 192,0 L 128,0 L 128,224 C 66.144,224 16,274.144 16,336 C 16,397.856 66.144,448 128,448 ZM 480,32L 352,144L 480,256 z" data-tags="rtl" /> +<glyph unicode="" d="M 224,448 L 480,448 L 480,384 L 416,384 L 416,0 L 352,0 L 352,384 L 288,384 L 288,0 L 224,0 L 224,224 C 162.144,224 112,274.144 112,336 C 112,397.856 162.144,448 224,448 ZM 32,256L 160,144L 32,32 z" data-tags="ltr" /> +<glyph unicode="" d="M 192,448 L 448,448 L 448,384 L 384,384 L 384,0 L 320,0 L 320,384 L 256,384 L 256,0 L 192,0 L 192,224 C 130.144,224 80,274.144 80,336 C 80,397.856 130.144,448 192,448 Z" data-tags="visualchars" /> +<glyph unicode="" d="M 365.71,221.482 C 397.67,197.513 416,163.439 416,128 C 416,92.561 397.67,58.487 365.71,34.518 C 336.031,12.259 297.068,0 256,0 C 214.931,0 175.969,12.259 146.29,34.518 C 114.33,58.487 96,92.561 96,128 L 160,128 C 160,93.309 203.963,64 256,64 C 308.037,64 352,93.309 352,128 C 352,162.691 308.037,192 256,192 C 214.931,192 175.969,204.259 146.29,226.518 C 114.33,250.488 96,284.561 96,320 C 96,355.439 114.33,389.512 146.29,413.482 C 175.969,435.741 214.931,448 256,448 C 297.068,448 336.031,435.741 365.71,413.482 C 397.67,389.512 416,355.439 416,320 L 352,320 C 352,354.691 308.037,384 256,384 C 203.963,384 160,354.691 160,320 C 160,285.309 203.963,256 256,256 C 297.068,256 336.031,243.741 365.71,221.482 ZM0,224L 512,224L 512,192L0,192z" data-tags="strikethrough" /> +<glyph unicode="" d="M 352,448 L 416,448 L 416,240 C 416,160.471 344.366,96 256,96 C 167.635,96 96,160.471 96,240 L 96,448 L 160,448 L 160,240 C 160,219.917 169.119,200.648 185.677,185.747 C 204.125,169.145 229.1,160 256,160 C 282.9,160 307.875,169.145 326.323,185.747 C 342.881,200.648 352,219.917 352,240 L 352,448 ZM 96,64L 416,64L 416,0L 96,0z" data-tags="underline" /> +<glyph unicode="" d="M 448,448 L 448,416 L 384,416 L 224,32 L 288,32 L 288,0 L 64,0 L 64,32 L 128,32 L 288,416 L 224,416 L 224,448 Z" data-tags="italic" /> +<glyph unicode="" d="M 353.94,237.674C 372.689,259.945, 384,288.678, 384,320c0,70.58-57.421,128-128,128l-64,0 l-64,0 L 96,448 l0-448 l 32,0 l 64,0 l 96,0 + c 70.579,0, 128,57.421, 128,128C 416,174.478, 391.101,215.248, 353.94,237.674z M 192,384l 50.75,0 c 27.984,0, 50.75-28.71, 50.75-64 + s-22.766-64-50.75-64L 192,256 L 192,384 z M 271.5,64L 192,64 L 192,192 l 79.5,0 c 29.225,0, 53-28.71, 53-64S 300.725,64, 271.5,64z" data-tags="bold0" /> +<glyph unicode="" d="M 192,64L 288,64L 288-32L 192-32zM 400,448 C 426.51,448 448,426.51 448,400 L 448,256 L 288,160 L 288,96 L 192,96 L 192,192 L 352,288 L 352,352 L 96,352 L 96,448 L 400,448 Z" /> +<glyph unicode="" d="M 288,448 C 411.712,448 512,347.712 512,224 C 512,100.288 411.712,0 288,0 L 288,48 C 335.012,48 379.209,66.307 412.451,99.549 C 445.693,132.791 464,176.988 464,224 C 464,271.011 445.693,315.209 412.451,348.451 C 379.209,381.693 335.012,400 288,400 C 240.989,400 196.791,381.693 163.549,348.451 C 137.979,322.882 121.258,290.828 114.896,256 L 208,256 L 96,128 L -16,256 L 66.285,256 C 81.815,364.551 175.154,448 288,448 ZM 384,256 L 384,192 L 256,192 L 256,352 L 320,352 L 320,256 Z" data-tags="restoredraft" /> +<glyph unicode="" d="M0,224L 64,224L 64,192L0,192zM 96,224L 192,224L 192,192L 96,192zM 224,224L 288,224L 288,192L 224,192zM 320,224L 416,224L 416,192L 320,192zM 448,224L 512,224L 512,192L 448,192zM 440,480 L 448,256 L 64,256 L 72,480 L 88,480 L 96,288 L 416,288 L 424,480 ZM 72-32 L 64,160 L 448,160 L 440-32 L 424-32 L 416,128 L 96,128 L 88-32 Z" data-tags="pagebreak" /> +<glyph unicode="" d="M 192,384L 256,384L 256,352L 192,352zM 288,384L 352,384L 352,352L 288,352zM 448,384 L 448,256 L 352,256 L 352,288 L 416,288 L 416,352 L 384,352 L 384,384 ZM 160,288L 224,288L 224,256L 160,256zM 256,288L 320,288L 320,256L 256,256zM 96,352 L 96,288 L 128,288 L 128,256 L 64,256 L 64,384 L 160,384 L 160,352 ZM 192,192L 256,192L 256,160L 192,160zM 288,192L 352,192L 352,160L 288,160zM 448,192 L 448,64 L 352,64 L 352,96 L 416,96 L 416,160 L 384,160 L 384,192 ZM 160,96L 224,96L 224,64L 160,64zM 256,96L 320,96L 320,64L 256,64zM 96,160 L 96,96 L 128,96 L 128,64 L 64,64 L 64,192 L 160,192 L 160,160 ZM 480,448 L 32,448 L 32,0 L 480,0 L 480,448 Z M 512,480 L 512,480 L 512-32 L 0-32 L 0,480 L 512,480 Z" data-tags="template" /> +<glyph unicode="" d="M 224,192 L 128,192 L 128,256 L 224,256 L 224,352 L 288,352 L 288,256 L 384,256 L 384,192 L 288,192 L 288,96 L 224,96 ZM 512,160 L 512-32 L 0-32 L 0,160 L 64,160 L 64,32 L 448,32 L 448,160 Z" data-tags="nonbreaking" /> +<glyph unicode="" d="M 64,352l 64,0 l0-96 l 32,0 L 160,448 c0,17.6-14.4,32-32,32L 64,480 C 46.4,480, 32,465.6, 32,448l0-192 l 32,0 L 64,352 z M 64,448l 64,0 l0-64 L 64,384 L 64,448 z M 480,448L 480,480 l-96,0 + c-17.601,0-32-14.4-32-32l0-160 c0-17.6, 14.399-32, 32-32l 96,0 l0,32 l-96,0 L 384,448 L 480,448 z M 320,400L 320,448 c0,17.6-14.4,32-32,32l-96,0 l0-224 l 96,0 + c 17.6,0, 32,14.4, 32,32l0,48 c0,17.6-4.4,32-22,32C 315.6,368, 320,382.4, 320,400z M 288,288l-64,0 l0,64 l 64,0 L 288,288 z M 288,384l-64,0 L 224,448 l 64,0 L 288,384 zM 416,192 L 208-32 L 96,112 L 137,147 L 208,73 L 384,224 Z" data-tags="spellchecker" /> +<glyph unicode="" d="M 512,480 L 512,288 L 442.87,357.13 L 336.87,251.13 L 283.13,304.87 L 389.13,410.87 L 320,480 ZM 122.87,410.87 L 228.87,304.87 L 175.13,251.13 L 69.13,357.13 L 0,288 L 0,480 L 192,480 ZM 442.87,90.87 L 512,160 L 512-32 L 320-32 L 389.13,37.13 L 283.13,143.13 L 336.87,196.87 ZM 228.87,143.13 L 122.87,37.13 L 192-32 L 0-32 L 0,160 L 69.13,90.87 L 175.13,196.87 Z" data-tags="fullscreen" /> +<glyph unicode="" d="M 128,448L 384,448L 384,384L 128,384zM 480,352L 32,352 C 14.4,352,0,337.6,0,320l0-160 c0-17.6, 14.398-32, 32-32l 96,0 l0-128 l 256,0 L 384,128 l 96,0 c 17.6,0, 32,14.4, 32,32L 512,320 + C 512,337.6, 497.6,352, 480,352z M 352,32L 160,32 L 160,192 l 192,0 L 352,32 z M 487.2,304c0-12.813-10.387-23.2-23.199-23.2 + c-12.813,0-23.201,10.387-23.201,23.2s 10.388,23.2, 23.201,23.2C 476.814,327.2, 487.2,316.813, 487.2,304z" data-tags="print" /> +<glyph unicode="" d="M 256,480C 114.615,480,0,365.386,0,224c0-141.385, 114.614-256, 256-256c 141.385,0, 256,114.615, 256,256 + C 512,365.386, 397.385,480, 256,480z M 256,8c-119.293,0-216,96.706-216,216c0,119.293, 96.707,216, 216,216c 119.295,0, 216-96.707, 216-216 + C 472,104.706, 375.295,8, 256,8z M 192,320c0-17.673-14.327-32-32-32s-32,14.327-32,32s 14.327,32, 32,32S 192,337.673, 192,320z + M 384,320c0-17.673-14.326-32-32-32s-32,14.327-32,32s 14.326,32, 32,32S 384,337.673, 384,320zM 256,154 C 326.537,154 387.344,182.766 415.231,215.596 C 404.795,129.986 337.087,64 256,64 C 174.941,64 107.251,130.013 96.778,215.584 C 124.671,182.761 185.471,154 256,154 Z" data-tags="emoticons" /> +<glyph unicode="" d="M 352,32 L 480,32 L 512,96 L 512-32 L 320-32 L 320,75.107 C 385.556,103.349 432,173.688 432,256 C 432,363.216 353.201,447.133 256,447.133 C 158.797,447.133 80,363.217 80,256 C 80,173.688 126.443,103.349 192,75.107 L 192-32 L 0-32 L 0,96 L 32,32 L 160,32 L 160,48.295 C 66.185,81.525 0,161.996 0,256 C 0,379.712 114.615,480 256,480 C 397.385,480 512,379.712 512,256 C 512,161.996 445.815,81.525 352,48.295 L 352,32 Z" data-tags="charmap" /> +<glyph unicode="" d="M 384,377 L 384,352 L 448,352 L 448,320 L 352,320 L 352,393 L 416,423 L 416,448 L 352,448 L 352,480 L 448,480 L 448,407 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" data-tags="sup" /> +<glyph unicode="" d="M 384,25 L 384,0 L 448,0 L 448-32 L 352-32 L 352,41 L 416,71 L 416,96 L 352,96 L 352,128 L 448,128 L 448,55 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" data-tags="sub" /> +<glyph unicode="" d="M0,32L 288,32L 288-32L0-32zM 96,480L 448,480L 448,416L 96,416zM 138.694,64 L 241.038,456.082 L 302.963,439.918 L 204.838,64 ZM 464.887-32 L 400,32.887 L 335.113-32 L 304-0.887 L 368.887,64 L 304,128.887 L 335.113,160 L 400,95.113 L 464.887,160 L 496,128.887 L 431.113,64 L 496-0.887 Z" data-tags="removeformat" /> +<glyph unicode="" d="M0,256L 512,256L 512,192L0,192z" data-tags="hr" /> +<glyph unicode="" d="M0,448l0-448 l 512,0 L 512,448 L0,448 z M 192,160l0,96 l 128,0 l0-96 L 192,160 z M 320,128l0-96 L 192,32 l0,96 L 320,128 z M 320,384l0-96 L 192,288 L 192,384 L 320,384 z M 160,384l0-96 L 32,288 L 32,384 L 160,384 z + M 32,256l 128,0 l0-96 L 32,160 L 32,256 z M 352,256l 128,0 l0-96 L 352,160 L 352,256 z M 352,288L 352,384 l 128,0 l0-96 L 352,288 z M 32,128l 128,0 l0-96 L 32,32 L 32,128 z M 352,32l0,96 l 128,0 l0-96 L 352,32 z" data-tags="table" /> +<glyph unicode="" d="M 161.009,64l 28.8,96l 132.382,0 l 28.8-96l 56.816,0 L 311.809,384L 200.191,384 l-96-320L 161.009,64 z M 237.809,320l 36.382,0 l 28.8-96l-93.982,0 + L 237.809,320z" data-tags="forecolor" /> +<glyph unicode="" d="M 256,320C 151.316,320, 58.378,269.722,0,192c 58.378-77.723, 151.316-128, 256-128c 104.684,0, 197.622,50.277, 256,128 + C 453.622,269.722, 360.684,320, 256,320z M 224,256c 17.673,0, 32-14.327, 32-32s-14.327-32-32-32s-32,14.327-32,32S 206.327,256, 224,256z + M 386.808,127.352c-19.824-10.129-40.826-17.931-62.423-23.188C 302.141,98.746, 279.134,96, 256,96 + c-23.133,0-46.141,2.746-68.384,8.162c-21.597,5.259-42.599,13.061-62.423,23.188c-31.51,16.101-60.111,38.205-83.82,64.649 + c 23.709,26.444, 52.31,48.55, 83.82,64.649c 16.168,8.261, 33.121,14.973, 50.541,20.020C 165.79,261.547, 160,243.451, 160,224 + c0-53.020, 42.981-96, 96-96c 53.019,0, 96,42.98, 96,96c0,19.451-5.791,37.547-15.733,52.67c 17.419-5.048, 34.372-11.76, 50.541-20.021 + c 31.511-16.099, 60.109-38.204, 83.819-64.649C 446.917,165.557, 418.318,143.45, 386.808,127.352z M 430.459,358.139 + C 376.099,385.916, 317.403,400, 256,400c-61.403,0-120.099-14.084-174.459-41.861C 52.155,343.123, 24.675,324.187,0,302.101l0-54.603 + c 27.669,29.283, 60.347,53.877, 96.097,72.145C 145.907,345.095, 199.706,358, 256,358s 110.093-12.905, 159.902-38.358 + c 35.751-18.268, 68.429-42.862, 96.098-72.145L 512,302.1 C 487.325,324.187, 459.846,343.123, 430.459,358.139z" data-tags="preview" /> +<glyph unicode="" d="M 256,384C 149.962,384, 64,298.039, 64,192s 85.961-192, 192-192c 106.037,0, 192,85.961, 192,192S 362.037,384, 256,384z + M 357.822,90.177C 330.626,62.979, 294.464,48, 256,48s-74.625,14.979-101.823,42.177C 126.979,117.374, 112,153.536, 112,192 + s 14.979,74.625, 42.177,101.823C 181.375,321.021, 217.536,336, 256,336s 74.626-14.979, 101.821-42.177 + C 385.022,266.625, 400,230.464, 400,192S 385.021,117.374, 357.822,90.177zM 162.965,378.069l-21.47,42.939C 92.058,396.24, 51.76,355.942, 26.992,306.504l 42.938-21.47 + C 90.054,325.202, 122.796,357.945, 162.965,378.069zM 442.067,285.035l 42.939,21.469C 460.24,355.942, 419.943,396.24, 370.504,421.008l-21.472-42.939 + C 389.201,357.945, 421.944,325.203, 442.067,285.035zM 256,288l-32,0 l0-96 c0-5.055, 2.35-9.555, 6.011-12.486l-0.006-0.008l 80-64l 19.988,24.988L 256,199.689L 256,288 z" data-tags="inserttime" /> +<glyph unicode="" d="M 160,352L 32,224L 160,96L 224,96L 96,224L 224,352 zM 352,352L 288,352L 416,224L 288,96L 352,96L 480,224 z" data-tags="code" /> +<glyph unicode="" d="M 224,128L 288,128L 288,64L 224,64zM 352,352 C 369.673,352 384,337.673 384,320 L 384,224 L 288,160 L 224,160 L 224,192 L 320,256 L 320,288 L 160,288 L 160,352 L 352,352 ZM 256,432 C 200.441,432 148.208,410.364 108.922,371.078 C 69.636,331.792 48,279.559 48,224 C 48,168.441 69.636,116.208 108.922,76.922 C 148.208,37.636 200.441,16 256,16 C 311.559,16 363.792,37.636 403.078,76.922 C 442.364,116.208 464,168.441 464,224 C 464,279.559 442.364,331.792 403.078,371.078 C 363.792,410.364 311.559,432 256,432 Z M 256,480 L 256,480 C 397.385,480 512,365.385 512,224 C 512,82.615 397.385-32 256-32 C 114.615-32 0,82.615 0,224 C 0,365.385 114.615,480 256,480 Z" data-tags="help" /> +<glyph unicode="" d="M0,416l0-384 l 512,0 L 512,416 L0,416 z M 96,64L 32,64 l0,64 l 64,0 L 96,64 z M 96,192L 32,192 l0,64 l 64,0 L 96,192 z M 96,320L 32,320 L 32,384 l 64,0 L 96,320 z M 384,64L 128,64 L 128,384 l 256,0 L 384,64 z + M 480,64l-64,0 l0,64 l 64,0 L 480,64 z M 480,192l-64,0 l0,64 l 64,0 L 480,192 z M 480,320l-64,0 L 416,384 l 64,0 L 480,320 zM 192,320L 192,128L 320,224 z" data-tags="media" /> +<glyph unicode="" d="M0,416l0-416 l 512,0 L 512,416 L0,416 z M 480,32L 32,32 L 32,384 l 448,0 L 480,32 zM 352,304A48,48 3060 1 0 448,304A48,48 3060 1 0 352,304zM 448,64 L 64,64 L 160,320 L 288,160 L 352,208 Z" data-tags="image" /> +<glyph unicode="" d="M 96,480l0-512 l 160,160l 160-160L 416,480 L 96,480 z M 384,45.255l-128,128l-128-128L 128,448 l 256,0 L 384,45.255 z" data-tags="anchor" /> +<glyph unicode="" d="M 238.444,142.443c 2.28-4.524, 3.495-9.579, 3.495-14.848c0-8.808-3.372-17.029-9.496-23.154l-81.69-81.69 + c-6.124-6.124-14.348-9.496-23.154-9.496s-17.030,3.372-23.154,9.496l-49.69,49.69c-6.124,6.125-9.496,14.348-9.496,23.154 + s 3.372,17.030, 9.496,23.154l 81.69,81.691c 6.124,6.123, 14.348,9.496, 23.154,9.496c 5.269,0, 10.322-1.215, 14.848-3.494l 32.669,32.668 + c-13.935,10.705-30.72,16.080-47.517,16.080c-19.993,0-39.986-7.583-55.154-22.751l-81.69-81.691 + c-30.335-30.335-30.335-79.975,0-110.309l 49.69-49.691c 15.167-15.166, 35.16-22.75, 55.153-22.75 + c 19.994,0, 39.987,7.584, 55.154,22.751l 81.69,81.69c 27.91,27.91, 30.119,72.149, 6.672,102.673L 238.444,142.443zM 489.248,407.558l-49.69,49.691C 424.391,472.417, 404.398,480, 384.404,480c-19.993,0-39.985-7.583-55.153-22.751l-81.691-81.691 + c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0,8.808, 3.372,17.030, 9.496,23.154 + l 81.691,81.691c 6.123,6.124, 14.347,9.497, 23.153,9.497c 8.808,0, 17.030-3.373, 23.154-9.497l 49.69-49.691 + c 6.124-6.124, 9.496-14.347, 9.496-23.154c0-8.807-3.372-17.030-9.496-23.154l-81.69-81.691c-6.124-6.124-14.347-9.496-23.154-9.496 + c-5.268,0-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.080, 47.517-16.080c 19.994,0, 39.987,7.584, 55.154,22.752 + l 81.69,81.69C 519.584,327.584, 519.584,377.223, 489.248,407.558zM 116.684,340.688L 20.687,436.685L 43.315,459.313L 139.312,363.316zM 192,480L 224,480L 224,384L 192,384zM0,288L 96,288L 96,256L0,256zM 395.316,107.312L 491.314,11.314L 468.686-11.314L 372.688,84.684zM 288,64L 320,64L 320-32L 288-32zM 416,192L 512,192L 512,160L 416,160z" data-tags="unlink" /> +<glyph unicode="" d="M 160,128c 8.8-8.8, 23.637-8.363, 32.971,0.971L 351.030,287.029C 360.364,296.363, 360.8,311.2, 352,320 + s-23.637,8.363-32.971-0.971L 160.971,160.971C 151.637,151.637, 151.2,136.8, 160,128zM 238.444,142.444c 2.28-4.525, 3.495-9.58, 3.495-14.848c0-8.808-3.372-17.030-9.496-23.154l-81.691-81.691 + c-6.124-6.124-14.347-9.496-23.154-9.496s-17.030,3.372-23.154,9.496l-49.691,49.691c-6.124,6.124-9.496,14.347-9.496,23.154 + s 3.372,17.030, 9.496,23.154l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497c 5.268,0, 10.322-1.215, 14.848-3.495l 32.669,32.669 + c-13.935,10.705-30.72,16.080-47.517,16.080c-19.993,0-39.986-7.583-55.154-22.751l-81.691-81.691 + c-30.335-30.335-30.335-79.974,0-110.309l 49.691-49.691C 87.611-24.416, 107.604-32, 127.597-32 + c 19.994,0, 39.987,7.584, 55.154,22.751l 81.691,81.691c 27.91,27.91, 30.119,72.149, 6.672,102.672L 238.444,142.444zM 489.249,407.558l-49.691,49.691C 424.391,472.417, 404.398,480, 384.404,480c-19.993,0-39.986-7.583-55.154-22.751l-81.691-81.691 + c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0,8.808, 3.372,17.030, 9.496,23.154 + l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497s 17.030-3.373, 23.154-9.497l 49.691-49.691 + c 6.124-6.124, 9.496-14.347, 9.496-23.154s-3.372-17.030-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496 + c-5.268,0-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.080, 47.517-16.080c 19.994,0, 39.987,7.584, 55.154,22.751 + l 81.691,81.691C 519.584,327.584, 519.584,377.223, 489.249,407.558z" data-tags="link" /> +<glyph unicode="" d="M 288,355.814L 288,480 l 192-192L 288,96L 288,222.912 C 64.625,228.153, 74.206,71.016, 131.070-32 + C-9.286,119.707, 20.52,362.785, 288,355.814z" data-tags="redo" /> +<glyph unicode="" d="M 380.931-32C 437.794,71.016, 447.375,228.153, 224,222.912L 224,96 L 32,288L 224,480l0-124.186 + C 491.481,362.785, 521.285,119.707, 380.931-32z" data-tags="undo" /> +<glyph unicode="" d="M 112.5,256 C 174.356,256 224.5,205.855 224.5,144 C 224.5,82.144 174.356,32 112.5,32 C 50.644,32 0.5,82.144 0.5,144 L 0,160 C 0,283.712 100.288,384 224,384 L 224,320 C 181.263,320 141.083,303.357 110.863,273.137 C 105.046,267.319 99.737,261.129 94.948,254.627 C 100.667,255.527 106.528,256 112.5,256 ZM 400.5,256 C 462.355,256 512.5,205.855 512.5,144 C 512.5,82.144 462.355,32 400.5,32 C 338.645,32 288.5,82.144 288.5,144 L 288,160 C 288,283.712 388.288,384 512,384 L 512,320 C 469.263,320 429.083,303.357 398.863,273.137 C 393.045,267.319 387.736,261.129 382.947,254.627 C 388.667,255.527 394.527,256 400.5,256 Z" data-tags="blockquote" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,256L 512,256L 512,192L 192,192zM 192,160L 512,160L 512,96L 192,96zM0,64L 512,64L 512,0L0,0zM 128,320 L 128,128 L 0,224 Z" data-tags="outdent" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,256L 512,256L 512,192L 192,192zM 192,160L 512,160L 512,96L 192,96zM0,64L 512,64L 512,0L0,0zM 0,128 L 0,320 L 128,224 Z" data-tags="indent" /> +<glyph unicode="" d="M 192,64L 512,64L 512,0L 192,0zM 192,256L 512,256L 512,192L 192,192zM 192,448L 512,448L 512,384L 192,384zM 96,480 L 96,352 L 64,352 L 64,448 L 32,448 L 32,480 ZM 64,217 L 64,192 L 128,192 L 128,160 L 32,160 L 32,233 L 96,263 L 96,288 L 32,288 L 32,320 L 128,320 L 128,247 ZM 128,128 L 128-32 L 32-32 L 32,0 L 96,0 L 96,32 L 32,32 L 32,64 L 96,64 L 96,96 L 32,96 L 32,128 Z" data-tags="numlist" /> +<glyph unicode="" d="M 192,448l 320,0 l0-64 L 192,384 L 192,448 z M 192,256l 320,0 l0-64 L 192,192 L 192,256 z M 192,64l 320,0 l0-64 L 192,0 L 192,64 zM0,416A64,64 3060 1 0 128,416A64,64 3060 1 0 0,416zM0,224A64,64 3060 1 0 128,224A64,64 3060 1 0 0,224zM0,32A64,64 3060 1 0 128,32A64,64 3060 1 0 0,32z" data-tags="bullist" /> +<glyph unicode="" d="M 32,480L 224,480L 224,448L 32,448zM 288,480L 480,480L 480,448L 288,448zM 476,320l-28,0 L 448,448 L 320,448 l0-128 L 192,320 L 192,448 L 64,448 l0-128 L 36,320 c-19.8,0-36-16.2-36-36l0-280 c0-19.8, 16.2-36, 36-36l 152,0 c 19.8,0, 36,16.2, 36,36L 224,192 l 64,0 + l0-188 c0-19.8, 16.2-36, 36-36l 152,0 c 19.8,0, 36,16.2, 36,36L 512,284 C 512,303.8, 495.8,320, 476,320z M 174,0L 50,0 c-9.9,0-18,7.2-18,16 + s 8.1,16, 18,16l 124,0 c 9.9,0, 18-7.2, 18-16S 183.9,0, 174,0z M 272,224l-32,0 c-8.8,0-16,7.2-16,16s 7.2,16, 16,16l 32,0 c 8.8,0, 16-7.2, 16-16 + S 280.8,224, 272,224z M 462,0L 338,0 c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 124,0 c 9.9,0, 18-7.2, 18-16S 471.9,0, 462,0z" data-tags="searchreplace" /> +<glyph unicode="" d="M 416,320L 416,400 c0,8.8-7.2,16-16,16L 288,416 L 288,448 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,416 c-8.801,0-16-7.2-16-16l0-320 + c0-8.8, 7.199-16, 16-16l 144,0 l0-96 l 224,0 l 96,96L 512,320 L 416,320 z M 192,447.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0 + c 0.021-0.018, 0.041-0.038, 0.059-0.057L 256,416 l-64,0 L 192,447.943 z M 96,352L 96,384 l 256,0 l0-32 L 96,352 z M 416,13.255L 416,64 l 50.745,0 L 416,13.255z M 480,96l-96,0 l0-96 + L 224,0 L 224,288 l 256,0 L 480,96 z" data-tags="paste" /> +<glyph unicode="" d="M 445.387,125.423c-22.827,22.778-51.864,34.536-78.973,34.536l-14.556,0 l-31.952,32.004l 127.81,128.019 + c 31.952,32.005, 31.952,96.014,0,128.019L 256.001,255.973L 64.285,448c-31.952-32.004-31.952-96.014,0-128.019l 127.811-128.017 + l-31.953-32.004l-14.557,0 c-27.11,0-56.146-11.759-78.974-34.538c-40.811-40.721-46.325-101.242-12.315-135.175 + C 69.282-24.704, 89.441-32, 110.795-32c 27.108,0, 56.145,11.757, 78.973,34.536c 26.792,26.732, 38.371,62, 33.542,92.674l 32.692,32.744 + l 32.688-32.744c-4.828-30.674, 6.753-65.941, 33.542-92.674C 345.063-20.243, 374.098-32, 401.206-32 + c 21.354,0, 41.512,7.296, 56.497,22.248C 491.713,24.181, 486.197,84.702, 445.387,125.423z M 176.512,57.231 + c-3.849-8.941-9.505-17.173-16.813-24.463c-7.318-7.302-15.586-12.959-24.574-16.812c-8.066-3.458-16.48-5.284-24.331-5.284 + c-7.573,0-18.306,1.701-26.431,9.806c-8.068,8.052-9.76,18.659-9.76,26.144c0,7.771, 1.821,16.105, 5.263,24.106 + c 3.85,8.942, 9.507,17.173, 16.813,24.463c 7.317,7.303, 15.586,12.957, 24.575,16.812c 8.067,3.457, 16.48,5.284, 24.332,5.284 + c 7.573,0, 18.306-1.7, 26.429-9.807c 8.067-8.049, 9.761-18.658, 9.761-26.142C 181.777,73.567, 179.957,65.23, 176.512,57.231z + M 256.002,146.702c-24.957,0-45.188,20.266-45.188,45.263c0,24.996, 20.231,45.26, 45.188,45.26s 45.186-20.264, 45.186-45.26 + C 301.188,166.966, 280.958,146.702, 256.002,146.702z M 427.636,20.479c-8.124-8.104-18.856-9.806-26.43-9.806 + c-7.852,0-16.265,1.826-24.333,5.284c-8.986,3.853-17.254,9.51-24.571,16.812c-7.307,7.29-12.963,15.521-16.813,24.463 + c-3.443,7.999-5.263,16.336-5.263,24.106c0,7.483, 1.692,18.094, 9.76,26.143c 8.123,8.104, 18.856,9.807, 26.43,9.807 + c 7.85,0, 16.265-1.827, 24.33-5.284c 8.989-3.854, 17.258-9.509, 24.575-16.812c 7.305-7.29, 12.962-15.521, 16.813-24.463 + c 3.442-7.999, 5.263-16.335, 5.263-24.106C 437.396,39.138, 435.702,28.53, 427.636,20.479z" data-tags="cut" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM0,352L 512,352L 512,288L0,288zM0,256L 512,256L 512,192L0,192zM0,160L 512,160L 512,96L0,96zM0,64L 512,64L 512,0L0,0z" data-tags="alignjustify" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,160L 512,160L 512,96L 192,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" data-tags="alignright" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 96,352L 416,352L 416,288L 96,288zM 96,160L 416,160L 416,96L 96,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" data-tags="aligncenter" /> +<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM0,352L 320,352L 320,288L0,288zM0,160L 320,160L 320,96L0,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" data-tags="alignleft" /> +<glyph unicode="" d="M 512,183.771l0,80.458 l-79.572,7.957c-4.093,15.021-10.044,29.274-17.605,42.49l 52.298,63.919L 410.595,435.12l-63.918-52.298 + c-13.217,7.562-27.471,13.513-42.491,17.604L 296.229,480l-80.458,0 l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604 + L 101.405,435.12L 44.88,378.595l 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49L0,264.229l0-80.458 l 79.573-7.957 + c 4.093-15.021, 10.043-29.274, 17.605-42.491L 44.88,69.405l 56.524-56.524l 63.919,52.298c 13.216-7.562, 27.47-13.514, 42.49-17.605 + L 215.771-32l 80.458,0 l 7.957,79.572c 15.021,4.093, 29.274,10.044, 42.491,17.605l 63.918-52.298l 56.524,56.524l-52.298,63.918 + c 7.562,13.217, 13.514,27.471, 17.605,42.49L 512,183.771z M 352,192l-64-64l-64,0 l-64,64l0,64 l 64,64l 64,0 l 64-64L 352,192 z" data-tags="fullpage" /> +<glyph unicode="" d="M 451.716,380.285l-71.432,71.431C 364.728,467.272, 334,480, 312,480L 72,480 C 50,480, 32,462, 32,440l0-432 c0-22, 18-40, 40-40l 368,0 c 22,0, 40,18, 40,40 + L 480,312 C 480,334, 467.272,364.729, 451.716,380.285z M 429.089,357.657c 1.565-1.565, 3.125-3.487, 4.64-5.657L 352,352 L 352,433.728 + c 2.17-1.515, 4.092-3.075, 5.657-4.64L 429.089,357.657z M 448,8c0-4.336-3.664-8-8-8L 72,0 c-4.336,0-8,3.664-8,8L 64,440 c0,4.336, 3.664,8, 8,8 + l 240,0 c 2.416,0, 5.127-0.305, 8-0.852L 320,320 l 127.148,0 c 0.547-2.873, 0.852-5.583, 0.852-8L 448,8 z" data-tags="newdocument" /> +<glyph unicode="" d="M 448,480L0,480 l0-512 l 512,0 L 512,416 L 448,480z M 256,416l 64,0 l0-128 l-64,0 L 256,416 z M 448,32L 64,32 L 64,416 l 32,0 l0-160 l 288,0 L 384,416 l 37.489,0 L 448,389.491L 448,32 z" data-tags="save" /> +<glyph unicode="" d="M 64,208L 208,64L 448,304L 384,368L 208,192L 128,272 z" /> +<glyph unicode="" d="M 256,224L 256,160L 272,160L 288,192L 320,192L 320,64L 296,64L 296,32L 408,32L 408,64L 384,64L 384,192L 416,192L 432,160L 448,160L 448,224 zM 416,320L 416,400 c0,8.8-7.2,16-16,16L 288,416 L 288,448 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,416 c-8.801,0-16-7.2-16-16l0-320 + c0-8.8, 7.199-16, 16-16l 144,0 l0-96 l 320,0 L 512,320 L 416,320 z M 192,447.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0 + c 0.021-0.018, 0.041-0.038, 0.059-0.057L 256,416 l-64,0 L 192,447.943 z M 96,352L 96,384 l 256,0 l0-32 L 96,352 z M 480,0L 224,0 L 224,288 l 256,0 L 480,0 z" data-tags="pastetext" /> +<glyph unicode=" " horiz-adv-x="256" /> +</font></defs></svg>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot Binary files differnew file mode 100644 index 0000000..c1085bf --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.svg b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.svg new file mode 100644 index 0000000..feb9ba3 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.svg @@ -0,0 +1,63 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata>Generated by IcoMoon</metadata> +<defs> +<font id="tinymce" horiz-adv-x="512"> +<font-face units-per-em="512" ascent="480" descent="-32" /> +<missing-glyph horiz-adv-x="512" /> +<glyph unicode=" " d="" horiz-adv-x="256" /> +<glyph unicode="" d="M448 480h-448v-512h512v448l-64 64zM256 416h64v-128h-64v128zM448 32h-384v384h32v-160h288v160h37.489l26.511-26.509v-357.491z" /> +<glyph unicode="" d="M451.716 380.285l-71.432 71.431c-15.556 15.556-46.284 28.284-68.284 28.284h-240c-22 0-40-18-40-40v-432c0-22 18-40 40-40h368c22 0 40 18 40 40v304c0 22-12.728 52.729-28.284 68.285zM429.089 357.657c1.565-1.565 3.125-3.487 4.64-5.657h-81.729v81.728c2.17-1.515 4.092-3.075 5.657-4.64l71.432-71.431zM448 8c0-4.336-3.664-8-8-8h-368c-4.336 0-8 3.664-8 8v432c0 4.336 3.664 8 8 8h240c2.416 0 5.127-0.305 8-0.852v-127.148h127.148c0.547-2.873 0.852-5.583 0.852-8v-304z" /> +<glyph unicode="" d="M512 183.771v80.458l-79.572 7.957c-4.093 15.021-10.044 29.274-17.605 42.49l52.298 63.919-56.526 56.525-63.918-52.298c-13.217 7.562-27.471 13.513-42.491 17.604l-7.957 79.574h-80.458l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604l-63.919 52.297-56.525-56.525 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49l-79.573-7.958v-80.458l79.573-7.957c4.093-15.021 10.043-29.274 17.605-42.491l-52.298-63.918 56.524-56.524 63.919 52.298c13.216-7.562 27.47-13.514 42.49-17.605l7.958-79.574h80.458l7.957 79.572c15.021 4.093 29.274 10.044 42.491 17.605l63.918-52.298 56.524 56.524-52.298 63.918c7.562 13.217 13.514 27.471 17.605 42.49l79.574 7.96zM352 192l-64-64h-64l-64 64v64l64 64h64l64-64v-64z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM0 352h320v-64h-320zM0 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM96 352h320v-64h-320zM96 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM192 352h320v-64h-320zM192 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM0 352h512v-64h-512zM0 256h512v-64h-512zM0 160h512v-64h-512zM0 64h512v-64h-512z" /> +<glyph unicode="" d="M445.387 125.423c-22.827 22.778-51.864 34.536-78.973 34.536h-14.556l-31.952 32.004 127.81 128.019c31.952 32.005 31.952 96.014 0 128.019l-191.715-192.028-191.716 192.027c-31.952-32.004-31.952-96.014 0-128.019l127.811-128.017-31.953-32.004h-14.557c-27.11 0-56.146-11.759-78.974-34.538-40.811-40.721-46.325-101.242-12.315-135.175 14.985-14.951 35.144-22.247 56.498-22.247 27.108 0 56.145 11.757 78.973 34.536 26.792 26.732 38.371 62 33.542 92.674l32.692 32.744 32.688-32.744c-4.828-30.674 6.753-65.941 33.542-92.674 22.831-22.779 51.866-34.536 78.974-34.536 21.354 0 41.512 7.296 56.497 22.248 34.010 33.933 28.494 94.454-12.316 135.175zM176.512 57.231c-3.849-8.941-9.505-17.173-16.813-24.463-7.318-7.302-15.586-12.959-24.574-16.812-8.066-3.458-16.48-5.284-24.331-5.284-7.573 0-18.306 1.701-26.431 9.806-8.068 8.052-9.76 18.659-9.76 26.144 0 7.771 1.821 16.105 5.263 24.106 3.85 8.942 9.507 17.173 16.813 24.463 7.317 7.303 15.586 12.957 24.575 16.812 8.067 3.457 16.48 5.284 24.332 5.284 7.573 0 18.306-1.7 26.429-9.807 8.067-8.049 9.761-18.658 9.761-26.142 0.001-7.771-1.819-16.108-5.264-24.107zM256.002 146.702c-24.957 0-45.188 20.266-45.188 45.263 0 24.996 20.231 45.26 45.188 45.26s45.186-20.264 45.186-45.26c0-24.999-20.23-45.263-45.186-45.263zM427.636 20.479c-8.124-8.104-18.856-9.806-26.43-9.806-7.852 0-16.265 1.826-24.333 5.284-8.986 3.853-17.254 9.51-24.571 16.812-7.307 7.29-12.963 15.521-16.813 24.463-3.443 7.999-5.263 16.336-5.263 24.106 0 7.483 1.692 18.094 9.76 26.143 8.123 8.104 18.856 9.807 26.43 9.807 7.85 0 16.265-1.827 24.33-5.284 8.989-3.854 17.258-9.509 24.575-16.812 7.305-7.29 12.962-15.521 16.813-24.463 3.442-7.999 5.263-16.335 5.263-24.106-0.001-7.485-1.695-18.093-9.761-26.144z" /> +<glyph unicode="" d="M416 320v80c0 8.8-7.2 16-16 16h-112v32c0 17.6-14.4 32-32 32h-64c-17.602 0-32-14.4-32-32v-32h-112c-8.801 0-16-7.2-16-16v-320c0-8.8 7.199-16 16-16h144v-96h224l96 96v256h-96zM192 447.943c0.017 0.019 0.036 0.039 0.057 0.057h63.884c0.021-0.018 0.041-0.038 0.059-0.057v-31.943h-64v31.943zM96 352v32h256v-32h-256zM416 13.255v50.745h50.745l-50.745-50.745zM480 96h-96v-96h-160v288h256v-192z" /> +<glyph unicode="" d="M32 480h192v-32h-192zM288 480h192v-32h-192zM476 320h-28v128h-128v-128h-128v128h-128v-128h-28c-19.8 0-36-16.2-36-36v-280c0-19.8 16.2-36 36-36h152c19.8 0 36 16.2 36 36v188h64v-188c0-19.8 16.2-36 36-36h152c19.8 0 36 16.2 36 36v280c0 19.8-16.2 36-36 36zM174 0h-124c-9.9 0-18 7.2-18 16s8.1 16 18 16h124c9.9 0 18-7.2 18-16s-8.1-16-18-16zM272 224h-32c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16zM462 0h-124c-9.9 0-18 7.2-18 16s8.1 16 18 16h124c9.9 0 18-7.2 18-16s-8.1-16-18-16z" /> +<glyph unicode="" d="M192 448h320v-64h-320v64zM192 256h320v-64h-320v64zM192 64h320v-64h-320v64zM0 416c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM0 224c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM0 32c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64z" /> +<glyph unicode="" d="M192 64h320v-64h-320zM192 256h320v-64h-320zM192 448h320v-64h-320zM96 480v-128h-32v96h-32v32zM64 217v-25h64v-32h-96v73l64 30v25h-64v32h96v-73zM128 128v-160h-96v32h64v32h-64v32h64v32h-64v32z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM192 352h320v-64h-320zM192 256h320v-64h-320zM192 160h320v-64h-320zM0 64h512v-64h-512zM0 128v192l128-96z" /> +<glyph unicode="" d="M0 448h512v-64h-512zM192 352h320v-64h-320zM192 256h320v-64h-320zM192 160h320v-64h-320zM0 64h512v-64h-512zM128 320v-192l-128 96z" /> +<glyph unicode="" d="M112.5 256c61.856 0 112-50.145 112-112 0-61.856-50.144-112-112-112-61.856 0-112 50.144-112 112l-0.5 16c0 123.712 100.288 224 224 224v-64c-42.737 0-82.917-16.643-113.137-46.863-5.817-5.818-11.126-12.008-15.915-18.51 5.719 0.9 11.58 1.373 17.552 1.373zM400.5 256c61.855 0 112-50.145 112-112 0-61.856-50.145-112-112-112-61.855 0-112 50.144-112 112l-0.5 16c0 123.712 100.288 224 224 224v-64c-42.737 0-82.917-16.643-113.137-46.863-5.818-5.818-11.127-12.008-15.916-18.51 5.72 0.9 11.58 1.373 17.553 1.373z" /> +<glyph unicode="" d="M380.931-32c56.863 103.016 66.444 260.153-156.931 254.912v-126.912l-192 192 192 192v-124.186c267.481 6.971 297.285-236.107 156.931-387.814z" /> +<glyph unicode="" d="M288 355.814v124.186l192-192-192-192v126.912c-223.375 5.241-213.794-151.896-156.93-254.912-140.356 151.707-110.55 394.785 156.93 387.814z" /> +<glyph unicode="" d="M160 128c8.8-8.8 23.637-8.363 32.971 0.971l158.059 158.058c9.334 9.334 9.77 24.171 0.97 32.971s-23.637 8.363-32.971-0.971l-158.058-158.058c-9.334-9.334-9.771-24.171-0.971-32.971zM238.444 142.444c2.28-4.525 3.495-9.58 3.495-14.848 0-8.808-3.372-17.030-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496s-17.030 3.372-23.154 9.496l-49.691 49.691c-6.124 6.124-9.496 14.347-9.496 23.154s3.372 17.030 9.496 23.154l81.691 81.691c6.124 6.124 14.347 9.497 23.154 9.497 5.268 0 10.322-1.215 14.848-3.495l32.669 32.669c-13.935 10.705-30.72 16.080-47.517 16.080-19.993 0-39.986-7.583-55.154-22.751l-81.691-81.691c-30.335-30.335-30.335-79.974 0-110.309l49.691-49.691c15.167-15.166 35.16-22.75 55.153-22.75 19.994 0 39.987 7.584 55.154 22.751l81.691 81.691c27.91 27.91 30.119 72.149 6.672 102.672l-32.67-32.67zM489.249 407.558l-49.691 49.691c-15.167 15.168-35.16 22.751-55.154 22.751-19.993 0-39.986-7.583-55.154-22.751l-81.691-81.691c-27.91-27.91-30.119-72.149-6.671-102.671l32.669 32.67c-2.279 4.525-3.494 9.58-3.494 14.847 0 8.808 3.372 17.030 9.496 23.154l81.691 81.691c6.124 6.124 14.347 9.497 23.154 9.497s17.030-3.373 23.154-9.497l49.691-49.691c6.124-6.124 9.496-14.347 9.496-23.154s-3.372-17.030-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496-5.268 0-10.322 1.215-14.848 3.495l-32.669-32.669c13.936-10.705 30.72-16.080 47.517-16.080 19.994 0 39.987 7.584 55.154 22.751l81.691 81.691c30.335 30.333 30.335 79.972 0 110.307z" /> +<glyph unicode="" d="M238.444 142.443c2.28-4.524 3.495-9.579 3.495-14.848 0-8.808-3.372-17.029-9.496-23.154l-81.69-81.69c-6.124-6.124-14.348-9.496-23.154-9.496s-17.030 3.372-23.154 9.496l-49.69 49.69c-6.124 6.125-9.496 14.348-9.496 23.154s3.372 17.030 9.496 23.154l81.69 81.691c6.124 6.123 14.348 9.496 23.154 9.496 5.269 0 10.322-1.215 14.848-3.494l32.669 32.668c-13.935 10.705-30.72 16.080-47.517 16.080-19.993 0-39.986-7.583-55.154-22.751l-81.69-81.691c-30.335-30.335-30.335-79.975 0-110.309l49.69-49.691c15.167-15.166 35.16-22.75 55.153-22.75 19.994 0 39.987 7.584 55.154 22.751l81.69 81.69c27.91 27.91 30.119 72.149 6.672 102.673l-32.67-32.669zM489.248 407.558l-49.69 49.691c-15.167 15.168-35.16 22.751-55.154 22.751-19.993 0-39.985-7.583-55.153-22.751l-81.691-81.691c-27.91-27.91-30.119-72.149-6.671-102.671l32.669 32.67c-2.279 4.525-3.494 9.58-3.494 14.847 0 8.808 3.372 17.030 9.496 23.154l81.691 81.691c6.123 6.124 14.347 9.497 23.153 9.497 8.808 0 17.030-3.373 23.154-9.497l49.69-49.691c6.124-6.124 9.496-14.347 9.496-23.154s-3.372-17.030-9.496-23.154l-81.69-81.691c-6.124-6.124-14.347-9.496-23.154-9.496-5.268 0-10.322 1.215-14.848 3.495l-32.669-32.669c13.936-10.705 30.72-16.080 47.517-16.080 19.994 0 39.987 7.584 55.154 22.752l81.69 81.69c30.336 30.333 30.336 79.972 0 110.307zM116.684 340.688l-95.997 95.997 22.628 22.628 95.997-95.997zM192 480h32v-96h-32zM0 288h96v-32h-96zM395.316 107.312l95.998-95.998-22.628-22.628-95.998 95.998zM288 64h32v-96h-32zM416 192h96v-32h-96z" /> +<glyph unicode="" d="M96 480v-512l160 160 160-160v512h-320zM384 45.255l-128 128-128-128v402.745h256v-402.745z" /> +<glyph unicode="" d="M0 416v-416h512v416h-512zM480 32h-448v352h448v-352zM352 304c0 26.51 21.49 48 48 48s48-21.49 48-48c0-26.51-21.49-48-48-48-26.51 0-48 21.49-48 48zM448 64h-384l96 256 128-160 64 48z" /> +<glyph unicode="" d="M0 416v-384h512v384h-512zM96 64h-64v64h64v-64zM96 192h-64v64h64v-64zM96 320h-64v64h64v-64zM384 64h-256v320h256v-320zM480 64h-64v64h64v-64zM480 192h-64v64h64v-64zM480 320h-64v64h64v-64zM192 320v-192l128 96z" /> +<glyph unicode="" d="M224 128h64v-64h-64zM352 352c17.673 0 32-14.327 32-32v-96l-96-64h-64v32l96 64v32h-160v64h192zM256 432c-55.559 0-107.792-21.636-147.078-60.922s-60.922-91.519-60.922-147.078c0-55.559 21.636-107.792 60.922-147.078 39.286-39.286 91.519-60.922 147.078-60.922 55.559 0 107.792 21.636 147.078 60.922 39.286 39.286 60.922 91.519 60.922 147.078 0 55.559-21.636 107.792-60.922 147.078-39.286 39.286-91.519 60.922-147.078 60.922zM256 480v0c141.385 0 256-114.615 256-256s-114.615-256-256-256c-141.385 0-256 114.615-256 256 0 141.385 114.615 256 256 256z" /> +<glyph unicode="" d="M160 352l-128-128 128-128h64l-128 128 128 128zM352 352h-64l128-128-128-128h64l128 128z" /> +<glyph unicode="" d="M256 384c-106.038 0-192-85.961-192-192s85.961-192 192-192c106.037 0 192 85.961 192 192s-85.963 192-192 192zM357.822 90.177c-27.196-27.198-63.358-42.177-101.822-42.177s-74.625 14.979-101.823 42.177c-27.198 27.197-42.177 63.359-42.177 101.823s14.979 74.625 42.177 101.823c27.198 27.198 63.359 42.177 101.823 42.177s74.626-14.979 101.821-42.177c27.201-27.198 42.179-63.359 42.179-101.823s-14.979-74.626-42.178-101.823zM162.965 378.069l-21.47 42.939c-49.437-24.768-89.735-65.066-114.503-114.504l42.938-21.47c20.124 40.168 52.866 72.911 93.035 93.035zM442.067 285.035l42.939 21.469c-24.766 49.438-65.063 89.736-114.502 114.504l-21.472-42.939c40.169-20.124 72.912-52.866 93.035-93.034zM256 288h-32v-96c0-5.055 2.35-9.555 6.011-12.486l-0.006-0.008 80-64 19.988 24.988-73.993 59.195v88.311z" /> +<glyph unicode="" d="M256 320c-104.684 0-197.622-50.278-256-128 58.378-77.723 151.316-128 256-128 104.684 0 197.622 50.277 256 128-58.378 77.722-151.316 128-256 128zM224 256c17.673 0 32-14.327 32-32s-14.327-32-32-32-32 14.327-32 32 14.327 32 32 32zM386.808 127.352c-19.824-10.129-40.826-17.931-62.423-23.188-22.244-5.418-45.251-8.164-68.385-8.164-23.133 0-46.141 2.746-68.384 8.162-21.597 5.259-42.599 13.061-62.423 23.188-31.51 16.101-60.111 38.205-83.82 64.649 23.709 26.444 52.31 48.55 83.82 64.649 16.168 8.261 33.121 14.973 50.541 20.020-9.944-15.121-15.734-33.217-15.734-52.668 0-53.020 42.981-96 96-96 53.019 0 96 42.98 96 96 0 19.451-5.791 37.547-15.733 52.67 17.419-5.048 34.372-11.76 50.541-20.021 31.511-16.099 60.109-38.204 83.819-64.649-23.71-26.443-52.309-48.55-83.819-64.648zM430.459 358.139c-54.36 27.777-113.056 41.861-174.459 41.861-61.403 0-120.099-14.084-174.459-41.861-29.386-15.016-56.866-33.952-81.541-56.038v-54.603c27.669 29.283 60.347 53.877 96.097 72.145 49.81 25.452 103.609 38.357 159.903 38.357s110.093-12.905 159.902-38.358c35.751-18.268 68.429-42.862 96.098-72.145v54.603c-24.675 22.087-52.154 41.023-81.541 56.039z" /> +<glyph unicode="" d="M161.009 64l28.8 96h132.382l28.8-96h56.816l-95.998 320h-111.618l-96-320h56.818zM237.809 320h36.382l28.8-96h-93.982l28.8 96z" /> +<glyph unicode="" d="M0 448v-448h512v448h-512zM192 160v96h128v-96h-128zM320 128v-96h-128v96h128zM320 384v-96h-128v96h128zM160 384v-96h-128v96h128zM32 256h128v-96h-128v96zM352 256h128v-96h-128v96zM352 288v96h128v-96h-128zM32 128h128v-96h-128v96zM352 32v96h128v-96h-128z" /> +<glyph unicode="" d="M0 256h512v-64h-512z" /> +<glyph unicode="" d="M0 32h288v-64h-288zM96 480h352v-64h-352zM138.694 64l102.344 392.082 61.925-16.164-98.125-375.918zM464.887-32l-64.887 64.887-64.887-64.887-31.113 31.113 64.887 64.887-64.887 64.887 31.113 31.113 64.887-64.887 64.887 64.887 31.113-31.113-64.887-64.887 64.887-64.887z" /> +<glyph unicode="" d="M384 25v-25h64v-32h-96v73l64 30v25h-64v32h96v-73zM338 352h-68l-94-94-94 94h-68l128-128-128-128h68l94 94 94-94h68l-128 128z" /> +<glyph unicode="" d="M384 377v-25h64v-32h-96v73l64 30v25h-64v32h96v-73zM338 352h-68l-94-94-94 94h-68l128-128-128-128h68l94 94 94-94h68l-128 128z" /> +<glyph unicode="" d="M352 32h128l32 64v-128h-192v107.107c65.556 28.242 112 98.581 112 180.893 0 107.216-78.799 191.133-176 191.133-97.203 0-176-83.916-176-191.133 0-82.312 46.443-152.651 112-180.893v-107.107h-192v128l32-64h128v16.295c-93.815 33.23-160 113.701-160 207.705 0 123.712 114.615 224 256 224 141.385 0 256-100.288 256-224 0-94.004-66.185-174.475-160-207.705v-16.295z" /> +<glyph unicode="" d="M256 480c-141.385 0-256-114.614-256-256 0-141.385 114.614-256 256-256 141.385 0 256 114.615 256 256 0 141.386-114.615 256-256 256zM256 8c-119.293 0-216 96.706-216 216 0 119.293 96.707 216 216 216 119.295 0 216-96.707 216-216 0-119.294-96.705-216-216-216zM192 320c0-17.673-14.327-32-32-32s-32 14.327-32 32 14.327 32 32 32 32-14.327 32-32zM384 320c0-17.673-14.326-32-32-32s-32 14.327-32 32 14.326 32 32 32 32-14.327 32-32zM256 154c70.537 0 131.344 28.766 159.231 61.596-10.436-85.61-78.144-151.596-159.231-151.596-81.059 0-148.749 66.013-159.222 151.584 27.893-32.823 88.693-61.584 159.222-61.584z" /> +<glyph unicode="" d="M128 448h256v-64h-256zM480 352h-448c-17.6 0-32-14.4-32-32v-160c0-17.6 14.398-32 32-32h96v-128h256v128h96c17.6 0 32 14.4 32 32v160c0 17.6-14.4 32-32 32zM352 32h-192v160h192v-160zM487.2 304c0-12.813-10.387-23.2-23.199-23.2-12.813 0-23.201 10.387-23.201 23.2s10.388 23.2 23.201 23.2c12.813 0 23.199-10.387 23.199-23.2z" /> +<glyph unicode="" d="M512 480v-192l-69.13 69.13-106-106-53.74 53.74 106 106-69.13 69.13zM122.87 410.87l106-106-53.74-53.74-106 106-69.13-69.13v192h192zM442.87 90.87l69.13 69.13v-192h-192l69.13 69.13-106 106 53.74 53.74zM228.87 143.13l-106-106 69.13-69.13h-192v192l69.13-69.13 106 106z" /> +<glyph unicode="" d="M64 352h64v-96h32v192c0 17.6-14.4 32-32 32h-64c-17.6 0-32-14.4-32-32v-192h32v96zM64 448h64v-64h-64v64zM480 448v32h-96c-17.601 0-32-14.4-32-32v-160c0-17.6 14.399-32 32-32h96v32h-96v160h96zM320 400v48c0 17.6-14.4 32-32 32h-96v-224h96c17.6 0 32 14.4 32 32v48c0 17.6-4.4 32-22 32 17.6 0 22 14.4 22 32zM288 288h-64v64h64v-64zM288 384h-64v64h64v-64zM416 192l-208-224-112 144 41 35 71-74 176 151z" /> +<glyph unicode="" d="M224 192h-96v64h96v96h64v-96h96v-64h-96v-96h-64zM512 160v-192h-512v192h64v-128h384v128z" /> +<glyph unicode="" d="M192 384h64v-32h-64zM288 384h64v-32h-64zM448 384v-128h-96v32h64v64h-32v32zM160 288h64v-32h-64zM256 288h64v-32h-64zM96 352v-64h32v-32h-64v128h96v-32zM192 192h64v-32h-64zM288 192h64v-32h-64zM448 192v-128h-96v32h64v64h-32v32zM160 96h64v-32h-64zM256 96h64v-32h-64zM96 160v-64h32v-32h-64v128h96v-32zM480 448h-448v-448h448v448zM512 480v0-512h-512v512h512z" /> +<glyph unicode="" d="M0 224h64v-32h-64zM96 224h96v-32h-96zM224 224h64v-32h-64zM320 224h96v-32h-96zM448 224h64v-32h-64zM440 480l8-224h-384l8 224h16l8-192h320l8 192zM72-32l-8 192h384l-8-192h-16l-8 160h-320l-8-160z" /> +<glyph unicode="" d="M288 448c123.712 0 224-100.288 224-224s-100.288-224-224-224v48c47.012 0 91.209 18.307 124.451 51.549 33.242 33.242 51.549 77.439 51.549 124.451 0 47.011-18.307 91.209-51.549 124.451-33.242 33.242-77.439 51.549-124.451 51.549-47.011 0-91.209-18.307-124.451-51.549-25.57-25.569-42.291-57.623-48.653-92.451h93.104l-112-128-112 128h82.285c15.53 108.551 108.869 192 221.715 192zM384 256v-64h-128v160h64v-96z" /> +<glyph unicode="" d="M353.94 237.674c18.749 22.271 30.060 51.004 30.060 82.326 0 70.58-57.421 128-128 128h-160v-448h192c70.579 0 128 57.421 128 128 0 46.478-24.899 87.248-62.060 109.674zM192 384h50.75c27.984 0 50.75-28.71 50.75-64s-22.766-64-50.75-64h-50.75v128zM271.5 64h-79.5v128h79.5c29.225 0 53-28.71 53-64s-23.775-64-53-64z" /> +<glyph unicode="" d="M448 448v-32h-64l-160-384h64v-32h-224v32h64l160 384h-64v32z" /> +<glyph unicode="" d="M352 448h64v-208c0-79.529-71.634-144-160-144-88.365 0-160 64.471-160 144v208h64v-208c0-20.083 9.119-39.352 25.677-54.253 18.448-16.602 43.423-25.747 70.323-25.747 26.9 0 51.875 9.145 70.323 25.747 16.558 14.901 25.677 34.17 25.677 54.253v208zM96 64h320v-64h-320z" /> +<glyph unicode="" d="M365.71 221.482c31.96-23.969 50.29-58.043 50.29-93.482s-18.33-69.513-50.29-93.482c-29.679-22.259-68.642-34.518-109.71-34.518-41.069 0-80.031 12.259-109.71 34.518-31.96 23.969-50.29 58.043-50.29 93.482h64c0-34.691 43.963-64 96-64s96 29.309 96 64c0 34.691-43.963 64-96 64-41.069 0-80.031 12.259-109.71 34.518-31.96 23.97-50.29 58.043-50.29 93.482 0 35.439 18.33 69.512 50.29 93.482 29.679 22.259 68.641 34.518 109.71 34.518 41.068 0 80.031-12.259 109.71-34.518 31.96-23.97 50.29-58.043 50.29-93.482h-64c0 34.691-43.963 64-96 64-52.037 0-96-29.309-96-64 0-34.691 43.963-64 96-64 41.068 0 80.031-12.259 109.71-34.518zM0 224h512v-32h-512z" /> +<glyph unicode="" d="M192 448h256v-64h-64v-384h-64v384h-64v-384h-64v224c-61.856 0-112 50.144-112 112s50.144 112 112 112z" /> +<glyph unicode="" d="M224 448h256v-64h-64v-384h-64v384h-64v-384h-64v224c-61.856 0-112 50.144-112 112s50.144 112 112 112zM32 256l128-112-128-112z" /> +<glyph unicode="" d="M128 448h256v-64h-64v-384h-64v384h-64v-384h-64v224c-61.856 0-112 50.144-112 112s50.144 112 112 112zM480 32l-128 112 128 112z" /> +<glyph unicode="" d="M416 352h-96v32l-96 96h-224v-384h192v-128h320v288l-96 96zM416 306.745l50.745-50.745h-50.745v50.745zM224 434.745l50.745-50.745h-50.745v50.745zM32 448h160v-96h96v-224h-256v320zM480 0h-256v96h96v224h64v-96h96v-224z" /> +<glyph unicode="" d="M384 352h32v-32h-32zM320 288h32v-32h-32zM320 224h32v-32h-32zM320 160h32v-32h-32zM256 224h32v-32h-32zM256 160h32v-32h-32zM192 160h32v-32h-32zM384 288h32v-32h-32zM384 224h32v-32h-32zM384 160h32v-32h-32zM384 96h32v-32h-32zM320 96h32v-32h-32zM256 96h32v-32h-32zM192 96h32v-32h-32zM128 96h32v-32h-32z" /> +<glyph unicode="" d="M64 208l144-144 240 240-64 64-176-176-80 80z" /> +<glyph unicode="" d="M464 416h-208l-16 32h-176l-32-64h448zM452.17 128h37.43l22.4 224h-512l32-320h242.040c-52.441 18.888-90.040 69.133-90.040 128 0 74.991 61.009 136 136 136 74.99 0 136-61.009 136-136 0-10.839-1.311-21.575-3.83-32zM501.498 23.125l-99.248 87.346c8.727 14.46 13.75 31.407 13.75 49.529 0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96c18.122 0 35.069 5.023 49.529 13.75l87.346-99.248c11.481-13.339 31.059-14.070 43.503-1.626l2.746 2.746c12.444 12.444 11.713 32.022-1.626 43.503zM320 98c-34.242 0-62 27.758-62 62s27.758 62 62 62 62-27.758 62-62-27.758-62-62-62z" /> +<glyph unicode="" d="M256 224v-64h16l16 32h32v-128h-24v-32h112v32h-24v128h32l16-32h16v64zM416 320v80c0 8.8-7.2 16-16 16h-112v32c0 17.6-14.4 32-32 32h-64c-17.602 0-32-14.4-32-32v-32h-112c-8.801 0-16-7.2-16-16v-320c0-8.8 7.199-16 16-16h144v-96h320v352h-96zM192 447.943c0.017 0.019 0.036 0.039 0.057 0.057h63.884c0.021-0.018 0.041-0.038 0.059-0.057v-31.943h-64v31.943zM96 352v32h256v-32h-256zM480 0h-256v288h256v-288z" /> +</font></defs></svg>
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf Binary files differnew file mode 100644 index 0000000..58103c2 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff Binary files differnew file mode 100644 index 0000000..ad1ae39 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/anchor.gif b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/anchor.gif Binary files differnew file mode 100644 index 0000000..606348c --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/anchor.gif diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/loader.gif b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/loader.gif Binary files differnew file mode 100644 index 0000000..c69e937 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/loader.gif diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/object.gif b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/object.gif Binary files differnew file mode 100644 index 0000000..cccd7f0 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/object.gif diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/trans.gif b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/trans.gif Binary files differnew file mode 100644 index 0000000..3884865 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/img/trans.gif diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.ie7.min.css b/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.ie7.min.css new file mode 100644 index 0000000..27cb832 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.ie7.min.css @@ -0,0 +1 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0);box-shadow:0 3px 7px rgba(0, 0, 0, 0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-btn:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-insertdatetime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.min.css b/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.min.css new file mode 100644 index 0000000..1fd34ff --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/skins/lightgray/skin.min.css @@ -0,0 +1 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0);box-shadow:0 3px 7px rgba(0, 0, 0, 0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-btn:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0), 0 1px 2px rgba(0, 0, 0, 0);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0);box-shadow:0 5px 10px rgba(0, 0, 0, 0);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0), 0 1px 2px rgba(0, 0, 0, 0)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0), 0 0 8px #52a8ec}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/themes/modern/theme.min.js b/comiccontrol/tinymce/js/tinymce/themes/modern/theme.min.js new file mode 100644 index 0000000..e25849d --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/themes/modern/theme.min.js @@ -0,0 +1 @@ +tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var n,o=[];if(t)return d(t.split(/[ ,]/),function(t){function i(){var i=e.selection;"bullist"==r&&i.selectorChanged("ul > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"UL"==n)}),"numlist"==r&&i.selectorChanged("ol > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"OL"==n)}),t.settings.stateSelector&&i.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&i.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?n=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),n=null):(n||(n={type:"buttongroup",items:[]},o.push(n)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),n.items.push(t),e.initialized?i():e.on("init",i)))}),i.push({type:"toolbar",layout:"flow",items:o}),!0}var i=[];if(tinymce.isArray(u.toolbar)){if(0===u.toolbar.length)return;tinymce.each(u.toolbar,function(e,t){u["toolbar"+(t+1)]=e}),delete u.toolbar}for(var n=1;10>n&&t(u["toolbar"+n]);n++);return i.length||u.toolbar===!1||t(u.toolbar||f),i.length?{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:i}:void 0}function i(){function t(t){var i;return"|"==t?{text:"|"}:i=e.menuItems[t]}function i(i){var n,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[i],a=!0):o=h[i],o){n={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var i=t(e);i&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==i&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l<r.length;l++)"|"==r[l].text&&(0===l||l==r.length-1)&&r.splice(l,1);if(n.menu=r,!n.menu.length)return null}return n}var n,o=[],r=[];if(u.menu)for(n in u.menu)r.push(n);else for(n in h)r.push(n);for(var a="string"==typeof u.menubar?u.menubar.split(/[ ,]/):r,s=0;s<a.length;s++){var l=a[s];l=i(l),l&&o.push(l)}return o}function n(t){function i(e){var i=t.find(e)[0];i&&i.focus(!0)}e.shortcuts.add("Alt+F9","",function(){i("menubar")}),e.shortcuts.add("Alt+F10","",function(){i("toolbar")}),e.shortcuts.add("Alt+F11","",function(){i("elementpath")}),t.on("cancel",function(){e.focus()})}function o(t,i){function n(e){return{width:e.clientWidth,height:e.clientHeight}}var o,r,a,s;o=e.getContainer(),r=e.getContentAreaContainer().firstChild,a=n(o),s=n(r),null!==t&&(t=Math.max(u.min_width||100,t),t=Math.min(u.max_width||65535,t),m.css(o,"width",t+(a.width-s.width)),m.css(r,"width",t)),i=Math.max(u.min_height||100,i),i=Math.min(u.max_height||65535,i),m.css(r,"height",i),e.fire("ResizeEditor")}function r(t,i){var n=e.getContentAreaContainer();l.resizeTo(n.clientWidth+t,n.clientHeight+i)}function a(o){function r(){if(h&&h.moveRel&&h.visible()&&!h._fixed){var t=e.selection.getScrollContainer(),i=e.getBody(),n=0,o=0;if(t){var r=m.getPos(i),a=m.getPos(t);n=Math.max(0,a.x-r.x),o=Math.max(0,a.y-r.y)}h.fixed(!1).moveRel(i,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl"]).moveBy(n,o)}}function a(){h&&(h.show(),r(),m.addClass(e.getBody(),"mce-edit-focus"))}function s(){h&&(h.hide(),m.removeClass(e.getBody(),"mce-edit-focus"))}function d(){return h?void(h.visible()||a()):(h=l.panel=c.create({type:f?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!f,border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:i()},t()]}),e.fire("BeforeRenderUI"),h.renderTo(f||document.body).reflow(),n(h),a(),e.on("nodeChange",r),e.on("activate",a),e.on("deactivate",s),void e.nodeChanged())}var h,f;return u.fixed_toolbar_container&&(f=m.select(u.fixed_toolbar_container)[0]),u.content_editable=!0,e.on("focus",function(){o.skinUiCss?tinymce.DOM.styleSheetLoader.load(o.skinUiCss,d,d):d()}),e.on("blur hide",s),e.on("remove",function(){h&&(h.remove(),h=null)}),o.skinUiCss&&tinymce.DOM.styleSheetLoader.load(o.skinUiCss),{}}function s(r){var a,s,d;return r.skinUiCss&&tinymce.DOM.loadCSS(r.skinUiCss),a=l.panel=c.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:i()},t(),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),u.resize!==!1&&(s={type:"resizehandle",direction:u.resize,onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;d={width:t.clientWidth,height:t.clientHeight}},onResize:function(e){"both"==u.resize?o(d.width+e.deltaX,d.height+e.deltaY):o(null,d.height+e.deltaY)}}),u.statusbar!==!1&&a.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath"},s]}),u.readonly&&a.find("*").disabled(!0),e.fire("BeforeRenderUI"),a.renderBefore(r.targetNode).reflow(),u.width&&tinymce.DOM.setStyle(a.getEl(),"width",u.width),e.on("remove",function(){a.remove(),a=null}),n(a),{iframeContainer:a.find("#iframe")[0].getEl(),editorContainer:a.getEl()}}var l=this,u=e.settings,c=tinymce.ui.Factory,d=tinymce.each,m=tinymce.DOM,h={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},f="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";l.renderUI=function(t){var i=u.skin!==!1?u.skin||"lightgray":!1;if(i){var n=u.skin_url;n=n?e.documentBaseURI.toAbsolute(n):tinymce.baseURL+"/skins/"+i,t.skinUiCss=tinymce.Env.documentMode<=7?n+"/skin.ie7.min.css":n+"/skin.min.css",e.contentCSS.push(n+"/content"+(e.inline?".inline":"")+".min.css")}return e.on("ProgressState",function(e){l.throbber=l.throbber||new tinymce.ui.Throbber(l.panel.getEl("body")),e.state?l.throbber.show(e.time):l.throbber.hide()}),u.inline?a(t):s(t)},l.resizeTo=o,l.resizeBy=r});
\ No newline at end of file diff --git a/comiccontrol/tinymce/js/tinymce/tinymce.min.js b/comiccontrol/tinymce/js/tinymce/tinymce.min.js new file mode 100644 index 0000000..cb77cd7 --- /dev/null +++ b/comiccontrol/tinymce/js/tinymce/tinymce.min.js @@ -0,0 +1,11 @@ +// 4.1.0 (2014-06-18) +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/dom/EventUtils",c="tinymce/dom/Sizzle",u="tinymce/util/Tools",d="tinymce/Env",f="tinymce/dom/DomQuery",p="tinymce/html/Styles",h="tinymce/dom/TreeWalker",m="tinymce/dom/Range",g="tinymce/html/Entities",v="tinymce/dom/StyleSheetLoader",y="tinymce/dom/DOMUtils",b="tinymce/dom/ScriptLoader",C="tinymce/AddOnManager",x="tinymce/html/Node",w="tinymce/html/Schema",_="tinymce/html/SaxParser",N="tinymce/html/DomParser",E="tinymce/html/Writer",k="tinymce/html/Serializer",S="tinymce/dom/Serializer",T="tinymce/dom/TridentSelection",R="tinymce/util/VK",A="tinymce/dom/ControlSelection",B="tinymce/dom/RangeUtils",D="tinymce/dom/BookmarkManager",L="tinymce/dom/Selection",M="tinymce/dom/ElementUtils",H="tinymce/fmt/Preview",P="tinymce/Formatter",O="tinymce/UndoManager",I="tinymce/EnterKey",F="tinymce/ForceBlocks",z="tinymce/EditorCommands",W="tinymce/util/URI",V="tinymce/util/Class",U="tinymce/util/EventDispatcher",q="tinymce/ui/Selector",$="tinymce/ui/Collection",j="tinymce/ui/DomUtils",K="tinymce/ui/Control",G="tinymce/ui/Factory",Y="tinymce/ui/KeyboardNavigation",X="tinymce/ui/Container",J="tinymce/ui/DragHelper",Q="tinymce/ui/Scrollable",Z="tinymce/ui/Panel",et="tinymce/ui/Movable",tt="tinymce/ui/Resizable",nt="tinymce/ui/FloatPanel",rt="tinymce/ui/Window",it="tinymce/ui/MessageBox",ot="tinymce/WindowManager",at="tinymce/util/Quirks",st="tinymce/util/Observable",lt="tinymce/EditorObservable",ct="tinymce/Shortcuts",ut="tinymce/Editor",dt="tinymce/util/I18n",ft="tinymce/FocusManager",pt="tinymce/EditorManager",ht="tinymce/LegacyInput",mt="tinymce/util/XHR",gt="tinymce/util/JSON",vt="tinymce/util/JSONRequest",yt="tinymce/util/JSONP",bt="tinymce/util/LocalStorage",Ct="tinymce/Compat",xt="tinymce/ui/Layout",wt="tinymce/ui/AbsoluteLayout",_t="tinymce/ui/Tooltip",Nt="tinymce/ui/Widget",Et="tinymce/ui/Button",kt="tinymce/ui/ButtonGroup",St="tinymce/ui/Checkbox",Tt="tinymce/ui/ComboBox",Rt="tinymce/ui/ColorBox",At="tinymce/ui/PanelButton",Bt="tinymce/ui/ColorButton",Dt="tinymce/util/Color",Lt="tinymce/ui/ColorPicker",Mt="tinymce/ui/Path",Ht="tinymce/ui/ElementPath",Pt="tinymce/ui/FormItem",Ot="tinymce/ui/Form",It="tinymce/ui/FieldSet",Ft="tinymce/ui/FilePicker",zt="tinymce/ui/FitLayout",Wt="tinymce/ui/FlexLayout",Vt="tinymce/ui/FlowLayout",Ut="tinymce/ui/FormatControls",qt="tinymce/ui/GridLayout",$t="tinymce/ui/Iframe",jt="tinymce/ui/Label",Kt="tinymce/ui/Toolbar",Gt="tinymce/ui/MenuBar",Yt="tinymce/ui/MenuButton",Xt="tinymce/ui/ListBox",Jt="tinymce/ui/MenuItem",Qt="tinymce/ui/Menu",Zt="tinymce/ui/Radio",en="tinymce/ui/ResizeHandle",tn="tinymce/ui/Spacer",nn="tinymce/ui/SplitButton",rn="tinymce/ui/StackLayout",on="tinymce/ui/TabPanel",an="tinymce/ui/TextBox",sn="tinymce/ui/Throbber";r(l,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function n(e,t){function n(){return!1}function r(){return!0}var i,o=t||{},l;for(i in e)s[i]||(o[i]=e[i]);if(o.target||(o.target=o.srcElement||document),e&&a.test(e.type)&&e.pageX===l&&e.clientX!==l){var c=o.target.ownerDocument||document,u=c.documentElement,d=c.body;o.pageX=e.clientX+(u&&u.scrollLeft||d&&d.scrollLeft||0)-(u&&u.clientLeft||d&&d.clientLeft||0),o.pageY=e.clientY+(u&&u.scrollTop||d&&d.scrollTop||0)-(u&&u.clientTop||d&&d.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=r,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=r,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=r,o.stopPropagation()},o.isDefaultPrevented||(o.isDefaultPrevented=n,o.isPropagationStopped=n,o.isImmediatePropagationStopped=n),o}function r(n,r,i){function o(){i.domLoaded||(i.domLoaded=!0,r(c))}function a(){("complete"===l.readyState||"interactive"===l.readyState&&l.body)&&(t(l,"readystatechange",a),o())}function s(){try{l.documentElement.doScroll("left")}catch(e){return void setTimeout(s,0)}o()}var l=n.document,c={type:"ready"};return i.domLoaded?void r(c):(l.addEventListener?"complete"===l.readyState?o():e(n,"DOMContentLoaded",o):(e(l,"readystatechange",a),l.documentElement.doScroll&&n.self===n.top&&s()),void e(n,"load",o))}function i(){function i(e,t){var n,r,i,o,a=s[t];if(n=a&&a[e.type])for(r=0,i=n.length;i>r;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler,h=o.fakeName,m=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,o.fakeName=h,o.capture=m,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return mt.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,h,m;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(L&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!M.test(e)){if(f=!0,p=I,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);h=ht.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return Z.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function m(e,t,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],m=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:h(g,f,e,s,l),b=n?o||(r?e:m||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=h(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=h(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==S)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return m(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,m=[],g=0,v="0",y=r&&[],b=null!=u,C=S,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(S=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,m,s,l);if(r){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=J.call(c));m=h(m)}Z.apply(c,m),b&&!r&&m.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,S=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&L&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),ht.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return k(e,c)(r,t,!L,n,ht.test(e)),n}function C(){}var x,w,_,N,E,k,S,T,R,A,B,D,L,M,H,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},G=typeof t,Y=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/[\x20\t\r\n\f]*[+~]/,mt=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==B&&9===r.nodeType&&r.documentElement?(B=r,D=r.documentElement,L=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),D.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return D.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==G&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==G&&L){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==G&&L){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==G&&r.getAttributeNode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==G&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==G?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==G?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==G&&L?t.getElementsByClassName(e):void 0},H=[],M=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||M.push("\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||M.push(":checked")}),i(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&M.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(z.matchesSelector=e(P=D.matchesSelector||D.mozMatchesSelector||D.webkitMatchesSelector||D.oMatchesSelector||D.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),H.push("!=",st)}),M=new RegExp(M.join("|")),H=H.length&&new RegExp(H.join("|")),O=e(D.contains)||D.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=D.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,"='$1']"),z.matchesSelector&&L&&(!H||!H.test(t))&&!M.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),L&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!L||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||o.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==G&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===D},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}};for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})_.pseudos[x]=l(x);return k=o.compile=function(e,t){var n,r=[],i=[],o=$[e+" "];if(!o){for(t||(t=u(e)),n=t.length;n--;)o=g(t[n]),o[I]?r.push(o):i.push(o);o=$(e,v(i,r))}return o},_.pseudos.nth=_.pseudos.eq,C.prototype=_.filters=_.pseudos,_.setFilters=new C,z.sortStable=I.split("").sort(K).join("")===I,A(),[0,0].sort(K),z.detectDuplicates=j,o}),r(u,[],function(){function e(e){return null===e||e===t?"":(""+e).replace(m,"")}function n(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function r(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function i(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function o(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function a(e,t){var n=[];return o(e,function(e){n.push(t(e))}),n}function s(e,t){var n=[];return o(e,function(e){(!t||t(e))&&n.push(e)}),n}function l(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function c(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function u(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),o(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void d(e,t,n,r)}))}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function p(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function h(t,r){return!t||n(t,"array")?t:a(t.split(r||","),e)}var m=/^\s*|\s*$/g,g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:e,isArray:g,is:n,toArray:r,makeMap:i,each:o,map:a,grep:s,inArray:c,extend:u,create:l,walk:d,createNS:f,resolve:p,explode:h}}),r(d,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(f,[l,c,u,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e,t){var n,r,i;for(t=t||b,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function l(e,t,n,r){var i;if(a(t))t=s(t);else if(t.length&&!t.nodeType){if(r)for(i=t.length-1;i>=0;i--)l(e,t[i],n,r);else for(i=0;i<t.length;i++)l(e,t[i],n,r);return e}for(i=e.length;i--;)n.call(e[i],t.parentNode?t:t);return e}function c(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function u(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function d(e,t){m(t,function(t,n){m(t.split(" "),function(){e[this]=n})})}function f(e,t){return new f.fn.init(e,t)}function p(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function h(e){return null===e||e===N?"":(""+e).replace(A,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!f(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function v(e,t,n,r){for(var i=[];e;e=e[t])if(!n||e.nodeType===n){if(r&&(r.nodeType&&e===r||f(e).is(r)))break;i.push(e)}return i}function y(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}var b=document,C=Array.prototype.push,x=Array.prototype.slice,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,_=e.Event,N,E=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),k=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),S={"for":"htmlFor","class":"className",readonly:"readOnly"},T={},R={};i.ie&&i.ie<=7&&(d(T,{maxlength:function(e,t){return t=e.maxLength,2147483647===t?N:t},size:function(e,t){return t=e.size,20===t?N:t},"class":function(e){return e.className},style:function(e){return 0===e.style.cssText.length?N:e.style.cssText}}),d(R,{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}}));var A=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:w.exec(e),!r)return f(t).find(e);if(r[1])for(i=s(e,t).firstChild;i;)C.call(n,i),i=i.nextSibling;else{if(i=b.getElementById(r[2]),i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(e.nodeType)return n.add([e]);if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else C.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(k[e])return n.prop(e)?e:N;if(t=n[0].getAttribute(e,2),r=T[e])return r(n[0],t,e);null===t&&(t=N)}return t}this.each(function(){var n;1===this.nodeType&&(n=R[e],n&&n(this,t,e),null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2))})}return n},removeAttr:function(e){return this.attr(e,null) +},prop:function(e,t){var n=this;if(e=S[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){var n=this;if("object"==typeof e)m(e,function(e,t){n.css(e,t)});else if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),o(t))"number"!=typeof t||E[e]||(t+="px"),n.each(function(){var n=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(n.filter=""===t?"":"alpha(opacity="+100*t+")");try{n[e]=t}catch(r){}});else if(n.context.defaultView){e=e.replace(/[A-Z]/g,function(e){return"-"+e});try{return n.context.defaultView.getComputedStyle(n[0],null).getPropertyValue(e)}catch(r){return N}}else if(n[0].currentStyle)return n[0].currentStyle[e];return n},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],_.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return l(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return l(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?l(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?l(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return u(this,e)},wrapAll:function(e){return u(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.each(function(){var e=f(this.parentNode);e.before(e.contents()),e.remove()})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=c(r,e),o!==t&&(i=r.className,o?r.className=h((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return c(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){_.bind(this,e,t)})},off:function(e,t){return this.each(function(){_.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?_.fire(this,e.type,e):_.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(x.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f(f.filter(e,this.toArray()))},closest:function(e){var t=[];return this.each(function(n,r){for(;r;){if(e.nodeType&&r==e||f(r).is(e)){t.push(r);break}r=r.parentNode}}),f(t)},push:C,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:r.toArray,inArray:p,isArray:r.isArray,each:m,trim:h,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return g(e,"parentNode")},parentsUntil:function(e,t){return g(e,"parentNode",t)},next:function(e){return y(e,"nextSibling",1)},prev:function(e){return y(e,"previousSibling",1)},nextUntil:function(e,t){return v(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return v(e,"previousSibling",1,t).slice(1)},children:function(e){return v(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),i=f.unique(i),(0===e.indexOf("parents")||"prevUntil"===e)&&(i=i.reverse()),i=f(i),n&&-1==e.indexOf("Until")?i.filter(n):i}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),new t.fn.init(r||n.element,i||n.context)}var n;return f.extend(t,this),t},f}),r(p,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,p="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+p).split(" "),l=0;l<u.length;l++)c[u[l]]=p+l,c[p+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function h(t,n,r,i,o,a){if(o=o||a)return o=p(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=p(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,h),m[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],n&&n[e]?!1:!0)}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(!f||r(o,t))&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(h,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(m,[u],function(e){function t(n){function r(){return H.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[U]=M[V],M[q]=M[W]):(M[V]=M[U],M[W]=M[q]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=M[V],r=M[W],i=M[U],o=M[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function h(){N(I)}function m(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return $(new t(n),{startContainer:M[V],startOffset:M[W],endContainer:M[U],endOffset:M[q],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[V]==M[U]&&M[W]==M[q]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(M[V]=t,M[W]=r):(M[U]=t,M[q]=r),i=M[U];i.parentNode;)i=i.parentNode;for(o=M[V];o.parentNode;)o=o.parentNode;o==i?w(M[V],M[W],M[U],M[q])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[V],M[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[V]==M[U])return E(e);for(t=M[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++n}for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[U])return S(t,e);++r}for(o=r-n,a=M[V];o>0;)a=a.parentNode,o--;for(s=M[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[W]==M[q])return t;if(3==M[V].nodeType){if(n=M[V].nodeValue,i=n.substring(M[W],M[q]),e!=O&&(o=M[V],c=M[W],u=M[q]-M[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(H.createTextNode(i)),t}for(o=C(M[V],M[W]),a=M[q]-M[W];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[W],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[U],M[q]-1),r,i,o,a,s,l=n!=M[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[V],M[W]),r=n!=M[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[W],a=o.substring(l),s=o.substring(0,l)):(l=M[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,H=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(M,{startContainer:H,startOffset:0,endContainer:H,endOffset:0,collapsed:F,commonAncestorContainer:H,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:h,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(g,[u],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(v,[],function(){return function(e,t){function n(t){e.getElementsByTagName("head")[0].appendChild(t)}function r(t,r,s){function l(){for(var e=v.passed,t=e.length;t--;)e[t]();v.status=2,v.passed=[],v.failed=[]}function c(){for(var e=v.failed,t=e.length;t--;)e[t]();v.status=3,v.passed=[],v.failed=[]}function u(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function d(e,t){e()||((new Date).getTime()-g<a?window.setTimeout(t,0):c())}function f(){d(function(){for(var t=e.styleSheets,n,r=t.length,i;r--;)if(n=t[r],i=n.ownerNode?n.ownerNode:n.owningElement,i&&i.id===h.id)return l(),!0},f)}function p(){d(function(){try{var e=m.sheet.cssRules;return l(),!!e}catch(t){}},p)}var h,m,g,v;if(o[t]?v=o[t]:(v={passed:[],failed:[]},o[t]=v),r&&v.passed.push(r),s&&v.failed.push(s),1!=v.status){if(2==v.status)return void l();if(3==v.status)return void c();if(v.status=1,h=e.createElement("link"),h.rel="stylesheet",h.type="text/css",h.id="u"+i++,h.async=!1,h.defer=!1,g=(new Date).getTime(),"onload"in h&&!u())h.onload=f,h.onerror=c;else{if(navigator.userAgent.indexOf("Firefox")>0)return m=e.createElement("style"),m.textContent='@import "'+t+'"',p(),void n(m);f()}n(h),h.href=t}}var i=0,o={},a;t=t||{},a=t.maxLoadTime||5e3,this.load=r}}),r(y,[c,f,p,l,h,m,g,d,u,v],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!y||e.documentMode>=8,o.boxModel=!y||"CSS1Compat"==e.compatMode||o.stdMode,o.hasOuterHTML="outerHTML"in e.createElement("a"),o.styleSheetLoader=new u(e),this.boundEvents=[],o.settings=t=g({keep_values:!1,hex_colors:1},t),o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var f=c.each,p=c.is,h=c.grep,m=c.trim,g=c.extend,v=l.webkit,y=l.ie,b=/^([a-z0-9],?)+$/i,C=/^[ \t\r\n]*$/,x=c.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return d.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(y&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!y||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),f(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),p(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(b.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=p(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!y||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n&&!/^[\-0-9\.]+$/.test(n)||x[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=y?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!p(n,"string"))return void f(n,function(t,n){r.setStyle(e,n,t)});i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&(i.url_converter&&(n=i.url_converter.call(i.url_converter_scope||r,n,t,e)),r.setAttrib(e,"data-mce-"+t,n,2));break;case"shape":e.setAttribute("data-mce-style",n)}p(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){f(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(p(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(y&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),v&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),y)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientLeft,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientTop,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==d.DOM&&n===document){var o=d.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,d.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==d.DOM&&n===document?void d.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void f(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),y&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=m(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(y){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="<br />"+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="<br />"+t,f(h(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,y)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return p(t,"array")&&(e=e.cloneNode(!0)),n&&f(h(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),f(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],f(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(y){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++; +continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!C.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:function(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=m(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},d.DOM=new d(document),d}),r(b,[y,u],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var h;u.push({func:r,scope:l||this}),(h=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,d++,e(t,function(){s[t]=a,d--,p(t),h()})))}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[b,u],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(x,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(w,[u],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var a,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;l<u.length;l++)"string"==typeof u[l]&&(u[l]=t(u[l])),r.push.apply(r,u[l]);for(e=t(e),a=e.length;a--;)c=[].concat(s,t(n)),o[e[a]]={attributes:i(c),attributesOrder:c,children:i(r)}}function r(e,n){var r,i,a,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=o[e[r]],a=0,s=n.length;s>a;a++)i.attributes[n[a]]={},i.attributesOrder.push(n[a])}var o={},s,l,c,u,d,f;return i[e]?i[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),c=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),l.push.apply(l,t("article aside details dialog figure header footer hgroup section nav")),c.push.apply(c,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),f=t("acronym applet basefont big font strike tt"),c.push.apply(c,f),a(f,function(e){n(e,"",c)}),d=t("center dir isindex noframes"),l.push.apply(l,d),u=[].concat(l,c),a(d,function(e){n(e,"",u)})),u=u||[].concat(l,c),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",u),n("address dt dd div caption","",u),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",c),n("blockquote","cite",u),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",u),n("dl","","dt dd"),n("a","href target rel media hreflang type",c),n("q","cite",c),n("ins del","cite datetime",u),n("img","src alt usemap ismap width height"),n("iframe","src name width height",u),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",u,"param"),n("param","name value"),n("map","name",u,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",u),n("th","colspan rowspan headers scope abbr",u),n("form","accept-charset action autocomplete enctype method name novalidate target",u),n("fieldset","disabled form name",u,"legend"),n("label","form for",c),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?u:c),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",u,"li"),n("noscript","",u),"html4"!=e&&(n("wbr"),n("ruby","",c,"rt rp"),n("figcaption","",u),n("mark rt rp summary bdi","",c),n("canvas","width height",u),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",u,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",u,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",c,"option"),n("article section nav aside header footer","",u),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",u,"figcaption"),n("time","datetime",c),n("dialog","open",u),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",c),n("progress","value max",c),n("meter","value min max low high optimum",c),n("details","open",u,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),a(t("a form meter progress dfn"),function(e){o[e]&&delete o[e].children[e]}),delete o.caption.children.table,i[e]=o,o)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),a(e,function(e,r){n[r]="map"==t?o(e,/[, ]/):l(e,/[, ]/)})),n}var i={},o=e.makeMap,a=e.each,s=e.extend,l=e.explode,c=e.inArray;return function(e){function u(t,n,r){var a=e[t];return a?a=o(a,/[, ]/,o(a.toUpperCase(),/[, ]/)):(a=i[t],a||(a=o(n," ",o(n.toUpperCase()," ")),a=s(a,r),i[t]=a)),a}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,a,s,l,u,f,p,h,m,g,v,b,x,w,_,N,E,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,_=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(b=s[1],p=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];v.push.apply(v,_)}if(f)for(f=t(f,"|"),i=0,a=f.length;a>i;i++)if(s=S.exec(f[i])){if(u={},m=s[1],h=s[2].replace(/::/g,":"),b=s[3],E=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(h),u.required=!0),"-"===m){delete g[h],v.splice(c(v,h),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:h,value:E}),u.defaultValue=E),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:h,value:E}),u.forcedValue=E),"<"===b&&(u.validValues=o(E,"?"))),T.test(h)?(l.attributePatterns=l.attributePatterns||[],u.pattern=d(h),l.attributePatterns.push(u)):(g[h]||v.push(h),g[h]=u)}w||"@"!=p||(w=g,_=v),x&&(l.outputName=p,y[x]=l),T.test(p)?(l.pattern=d(p),C.push(l)):y[p]=l}}function p(e){y={},C=[],f(e),a(_,function(e,t){b[t]=e.children})}function h(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,a(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],L[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var l=y[i];l=s({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,y[o]=l}a(b,function(e,t){e[i]&&(b[t]=e=s({},b[t]),e[o]=e[i])})}))}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&a(t(e,","),function(e){var r=n.exec(e),i,o;r&&(o=r[1],i=o?b[r[2]]:b[r[2]]={"#comment":{}},i=b[r[2]],a(t(r[3],"|"),function(e){"-"===o?(b[r[2]]=i=s({},b[r[2]]),delete i[e]):i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,_,N,E,k,S,T,R,A,B,D,L={},M={};e=e||{},_=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),N=u("whitespace_elements","pre script noscript style textarea video audio iframe object"),E=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),k=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),S=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=u("non_empty_elements","td th iframe video audio object script",k),B=u("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=u("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",B),D=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),a((e.special||"script noscript style textarea").split(" "),function(e){M[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?p(e.valid_elements):(a(_,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&a(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),y.img.attributesDefault=[{name:"alt",value:""}],a(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),a(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),a(t("span"),function(e){y[e].removeEmptyAttrs=!0})),h(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&a(l(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return S},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return B},v.getTextInlineElements=function(){return D},v.getShortEndedElements=function(){return k},v.getSelfClosingElements=function(){return E},v.getNonEmptyElements=function(){return A},v.getWhiteSpaceElements=function(){return N},v.getSpecialElements=function(){return M},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return L},v.addValidElements=f,v.setValidElements=p,v.addCustomElements=h,v.addValidChildren=m,v.elements=y}}),r(_,[w,g,u],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=p.length;t--&&p[t].name!==e;);if(t>=0){for(n=p.length-1;n>=t;n--)e=p[n],e.valid&&l.end(e.name);p.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),_&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(V[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(U.test(c))return;if(!i.allow_html_data_urls&&q.test(c)&&!/^data:image\//i.test(c))return}h.map[t]=n,h.push({name:t,value:n})}var l=this,c,u=0,d,f,p=[],h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,D,L,M,H,P,O,I,F=0,z=t.decode,W,V=n.makeMap("src,href,data,background,formaction,poster"),U=/((java|vb)script|mhtml):/i,q=/^data:/i;for(H=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),P=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),_=i.validate,b=i.remove_internals,W=i.fix_self_closing,O=a.getSpecialElements();c=H.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,W&&M[d]&&p.length>0&&p[p.length-1].name===d&&o(d),!_||(N=a.getElementRule(d))){if(E=!0,_&&(T=N.attributes,R=N.attributePatterns),(S=c[8])?(y=-1!==S.indexOf("data-mce-type"),y&&b&&(E=!1),h=[],h.map={},S.replace(P,s)):(h=[],h.map={}),_&&!y){if(A=N.attributesRequired,B=N.attributesDefault,D=N.attributesForced,L=N.removeEmptyAttrs,L&&!h.length&&(E=!1),D)for(m=D.length;m--;)k=D[m],v=k.name,I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I});if(B)for(m=B.length;m--;)k=B[m],v=k.name,v in h.map||(I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in h.map););-1===m&&(E=!1)}if(k=h.map["data-mce-bogus"]){if("all"===k){u=r(a,e,H.lastIndex),H.lastIndex=u;continue}E=!1}}E&&l.start(d,h,w)}else E=!1;if(f=O[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(E&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),E&&(g.length>0&&l.text(g,!0),l.end(d)),H.lastIndex=u;continue}w||(S&&S.indexOf("/")==S.length-1?E&&l.end(d):p.push({name:d,valid:E}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=p.length-1;m>=0;m--)d=p[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(N,[x,w,_,u],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,h,m,g,v,y;for(m=i("tr,td,th,tbody,thead,tfoot,table"),h=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(v=r.next;v&&g[v.name];)v.name="li",v.fixed=!0,r.parent.insert(v,r.parent),v=v.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p<a.length-1;p++){for(l.isValidChild(c.name,a[p].name)?(d=u.filterNode(a[p].clone()),c.append(d)):d=c,f=a[p].firstChild;f&&f!=a[p+1];)y=f.next,d.append(f),f=y;c=d}s.isEmpty(h)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(h)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(v=r.prev,v&&("ul"===v.name||"ul"===v.name)){v.append(r);continue}if(v=r.next,v&&("ul"===v.name||"ul"===v.name)){v.insert(r,v.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):"style"===r.name||"script"===r.name?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],p={},h={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=p[n],r?r.push(e):p[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=h[n],r?r.push(e):h[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=p[t],i?i.push(r):p[t]=[r]),r}function m(e){var t,n,r;for(t=e.prev;t&&3===t.type;)n=t.value.replace(D,""),n.length>0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,E,k,S,T,R,A=[],B,D,L,M,H,P,O,I;if(o=o||{},p={},h={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,H=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=h[a],E?E.push(r):h[a]=[r]);T[e]&&m(r),n||(b=r),!B&&H[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&H[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(E=d[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,k,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in h){for(C=h[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(h=new e("#text",3),h.value="\xa0",i.replace(h))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],u||!c||c[o]||(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(E,[g,u],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",t,"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(k,[E,w],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,h,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},m=r.getElementRule(e.name),p=0,h=m.attributesOrder.length;h>p;p++)u=m.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,h=c.length;h>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(S,[y,N,g,k,x,w,d,u],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null) +}),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,h,m;return a.ie&&s.select("script,style,select,map").length>0?(m=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,m)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),h=new r(e,d),n.content=h.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(T,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,h;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(h=t.childNodes,h.length?(n>=h.length?i.insertAfter(a,h[h.length-1]):t.insertBefore(a,h[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,h,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=p.createControlRange(),a.addElement(m),a.select(),h=e.getRng(),h.item&&m===h.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(R,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(A,[R,u,d],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:i.dom.is(e,t))}function a(t){var n,r,o,a,s;n=t.screenX-T,r=t.screenY-R,P=n*k[2]+D,O=r*k[3]+L,P=5>P?5:P,O=5>O?5:O,o="IMG"==w.nodeName&&i.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==w.nodeName&&k[2]*k[3]!==0,o&&(W(n)>W(r)?(O=V(P*M),P=V(O/M)):(P=V(O/M),O=V(P*M))),C.setStyles(_,{width:P,height:O}),a=k.startPos.x+n,s=k.startPos.y+r,a=a>0?a:0,s=s>0?s:0,C.setStyles(N,{left:a,top:s,display:"block"}),N.innerHTML=P+" × "+O,k[2]<0&&_.clientWidth<=P&&C.setStyle(_,"left",A+(D-P)),k[3]<0&&_.clientHeight<=O&&C.setStyle(_,"top",B+(L-O)),n=U.scrollWidth-q,r=U.scrollHeight-$,n+r!==0&&C.setStyles(N,{left:a-n,top:s-r}),H||(i.fire("ObjectResizeStart",{target:w,width:D,height:L}),H=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?C.setStyle(w,e,t):C.setAttrib(w,e,t))}H=!1,e("width",P),e("height",O),C.unbind(I,"mousemove",a),C.unbind(I,"mouseup",s),F!=I&&(C.unbind(F,"mousemove",a),C.unbind(F,"mouseup",s)),C.remove(_),C.remove(N),z&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:P,height:O}),i.nodeChanged()}function l(e,t,r){var l,u,d,f,p;g(),l=C.getPos(e,U),A=l.x,B=l.y,p=e.getBoundingClientRect(),u=p.width||p.right-p.left,d=p.height||p.bottom-p.top,w!=e&&(m(),w=e,P=O=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?x(E,function(e,i){function o(t){T=t.screenX,R=t.screenY,D=w.clientWidth,L=w.clientHeight,M=L/D,k=e,e.startPos=C.getPos(e.elm,U),q=U.scrollWidth,$=U.scrollHeight,_=w.cloneNode(!0),C.addClass(_,"mce-clonedresizable"),C.setAttrib(_,"data-mce-bogus","all"),_.contentEditable=!1,_.unSelectabe=!0,C.setStyles(_,{left:A,top:B,margin:0}),_.removeAttribute("data-mce-selected"),U.appendChild(_),C.bind(I,"mousemove",a),C.bind(I,"mouseup",s),F!=I&&(C.bind(F,"mousemove",a),C.bind(F,"mouseup",s)),N=C.add(U,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},D+" × "+L)}var l,c;return t?void(i==t&&o(r)):(l=C.get("mceResizeHandle"+i),l?C.show(l):(c=U,l=C.add(c,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),n.ie&&(l.contentEditable=!1)),e.elm||(C.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),o(e)}),e.elm=l),void C.setStyles(l,{left:u*e[0]+A-l.offsetWidth/2,top:d*e[1]+B-l.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in E)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n;return x(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=C.getParent(n,z?"table":"table,img,hr"),t(n,U)&&(v(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!z||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?void l(n):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=S.clientX-n.left,u=S.clientY-n.top;for(r in E)if(o=E[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],W(a-c)<8&&W(s-u)<8){k=o;break}H=!0,i.getDoc().selection.empty(),l(t,r,S)}function h(e){var t=e.srcElement;if(t!=w){if(m(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",p))}}function m(){f(w,"resizestart",p)}function g(){for(var e in E){var t=E[e];t.elm&&(C.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(z){t=I.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,z&&(m(),f(U,"controlselect",h))}var C=i.dom,x=t.each,w,_,N,E,k,S,T,R,A,B,D,L,M,H,P,O,I=i.getDoc(),F=document,z=n.ie&&n.ie<11,W=Math.abs,V=Math.round,U=i.getBody(),q,$;E={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var j=".mce-content-body";return i.contentStyles.push(j+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+j+" .mce-resizehandle:hover {background: #000}"+j+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+j+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+j+" .mce-resize-helper {background-color: #555;background-color: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),i.on("init",function(){z?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(U,"controlselect",h),i.on("mousedown",function(e){S=e})):(v(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(U,"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange mousedown mouseup ResizeEditor",u),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)}),i.on("hide",c)}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,controlSelect:y,destroy:b}}}),r(B,[u,h],function(e,t){function n(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function r(e){this.walk=function(t,r){function o(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function a(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function s(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function l(e,t,n){var i=n?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=a(g==e?g:g[i],i),y.length&&(n||y.reverse(),r(o(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,p,h,m,g,v,y,b;if(b=e.select("td.mce-item-selected,th.mce-item-selected"),b.length>0)return void i(b,function(e){r([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=n(d,f)),c==d)return r(o([c]));for(p=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return l(c,p,!0);if(g===p)break}for(g=d;g;g=g.parentNode){if(g===c)return l(d,p);if(g===p)break}h=s(c,p)||c,m=s(d,p)||d,l(c,h,!0),y=a(h==c?h:h.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&r(o(y)),l(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||f);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(n,r){var a,s,l;if(r=r||c,l=e.getParent(r.parentNode,e.isBlock)||f,n&&"BR"==r.nodeName&&g&&e.isEmpty(l))return c=r.parentNode,u=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);p=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(p))return;if(3===p.nodeType&&p.nodeValue.length>0)return c=p,u=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||h[p.nodeName.toLowerCase()])return;s=p}o&&s&&(c=s,i=!0,u=0)}var c,u,d,f=e.getRoot(),p,h,m,g;if(c=n[(r?"start":"end")+"Container"],u=n[(r?"start":"end")+"Offset"],g=1==c.nodeType&&u===c.childNodes.length,h=e.schema.getNonEmptyElements(),m=r,1==c.nodeType&&u>c.childNodes.length-1&&(m=!1),9===c.nodeType&&(c=e.getRoot(),u=0),c===f){if(m&&(p=c.childNodes[u>0?u-1:0],p&&(h[p.nodeName]||"TABLE"==p.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!m&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){p=c,d=new t(c,f);do{if(3===p.nodeType&&p.nodeValue.length>0){u=m?0:p.nodeValue.length,c=p,i=!0;break}if(h[p.nodeName.toLowerCase()]){u=e.nodeIndex(p),c=p.parentNode,"IMG"!=p.nodeName||m||u++,i=!0;break}}while(p=m?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(p=c.childNodes[u],p||(p=c.childNodes[u-1]),!p||"BR"!==p.nodeName||s(p,"A")||a(p)||a(p,!0)||l(!0,p))),m&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&n["set"+(r?"Start":"End")](c,u)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var i=e.each;return r.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},r}),r(D,[d,u],function(e,t){function n(n){var r=n.dom;this.getBookmark=function(e,i){function o(e,n){var i=0;return t.each(r.select(e),function(e,t){e==n&&(i=t)}),i}function a(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function s(){function e(e,t){var n=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==n.nodeType){if(i)for(l=n.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=n.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(r.nodeIndex(c[a],i)+u);for(;n&&n!=o;n=n.parentNode)s.push(r.nodeIndex(n,i));return s}var t=n.getRng(!0),o=r.getRoot(),a={};return a.start=e(t,!0),n.isCollapsed()||(a.end=e(t)),a}var l,c,u,d,f,p,h="",m;if(2==e)return p=n.getNode(),f=p?p.nodeName:null,"IMG"==f?{name:f,index:o(f,p)}:n.tridentSel?n.tridentSel.getBookmark(e):s();if(e)return{rng:n.getRng()};if(l=n.getRng(),u=r.uniqueId(),d=n.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:o(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_start" style="'+m+'">'+h+"</span>"),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_end" style="'+m+'">'+h+"</span>"))}catch(g){return null}}else{if(p=n.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:o(f,p)};c=a(l.cloneRange()),d||(c.collapse(!1),c.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},h))),l=a(l),l.collapse(!0),l.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return n.moveToBookmark({id:u,keep:1}),{id:u}},this.moveToBookmark=function(i){function o(e){var t=i[e?"start":"end"],n,r,o,a;if(t){for(o=t[0],r=c,n=t.length-1;n>=1;n--){if(a=r.childNodes,t[n]>a.length-1)return;r=a[t[n]]}3===r.nodeType&&(o=Math.min(t[0],r.nodeValue.length)),1===r.nodeType&&(o=Math.min(t[0],r.childNodes.length)),e?l.setStart(r,o):l.setEnd(r,o)}return!0}function a(n){var o=r.get(i.id+"_"+n),a,s,l,c,h=i.keep;if(o&&(a=o.parentNode,"start"==n?(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),u=d=a,f=p=s):(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),d=a,p=s),!h)){for(c=o.previousSibling,l=o.nextSibling,t.each(t.grep(o.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});o=r.get(i.id+"_"+n);)r.remove(o,1);c&&l&&c.nodeType==l.nodeType&&3==c.nodeType&&!e.opera&&(s=c.nodeValue.length,c.appendData(l.nodeValue),r.remove(l),"start"==n?(u=d=c,f=p=s):(d=c,p=s))}}function s(t){return!r.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}var l,c,u,d,f,p;if(i)if(i.start){if(l=r.createRng(),c=r.getRoot(),n.tridentSel)return n.tridentSel.moveToBookmark(i);o(!0)&&o()&&n.setRng(l)}else i.id?(a("start"),a("end"),u&&(l=r.createRng(),l.setStart(s(u),f),l.setEnd(s(d),p),n.setRng(l))):i.name?n.select(r.select(i.name)[i.index]):i.rng&&n.setRng(i.rng)}}return n.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},n}),r(L,[h,T,A,B,D,d,u],function(e,n,r,i,o,a,s){function l(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var c=s.each,u=s.trim,d=a.ie;return l.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return!d&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};c(n.selectorChangedData,function(e,t){c(o,function(n){return i.is(n,t)?(r[t]||(c(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),c(r,function(e,n){a[n]||(delete r[n],c(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(n<r.y||n+25>s+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),s=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==u(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(s[n.nodeName])return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(a.ie&&a.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},destroy:function(){this.win=null,this.controlSelection.destroy()}},l}),r(M,[D,u],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&"data-mce-style"!==i&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(H,[u],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(P,[h,B,D,M,u,H],function(e,t,n,r,i,o){return function(a){function s(e){return e.nodeType&&(e=e.nodeName),!!a.schema.getTextBlockElements()[e.toLowerCase()]}function l(e,t){return W.getParents(e,t,W.getRoot())}function c(e){return 1===e.nodeType&&"_mce_caret"===e.id}function u(){p({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:!1,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0 +},onformat:function(e,t,n){it(n,function(t,n){W.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),it("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){p(e,{block:e,remove:"all"})}),p(a.settings.formats)}function d(){a.addShortcut("ctrl+b","bold_desc","Bold"),a.addShortcut("ctrl+i","italic_desc","Italic"),a.addShortcut("ctrl+u","underline_desc","Underline");for(var e=1;6>=e;e++)a.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);a.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),a.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),a.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function f(e){return e?z[e]:z}function p(e,t){e&&("string"!=typeof e?it(e,function(e,t){p(t,e)}):(t=t.length?t:[t],it(t,function(e){e.deep===Z&&(e.deep=!e.selector),e.split===Z&&(e.split=!e.selector||e.inline),e.remove===Z&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),z[e]=t))}function h(e){var t;return a.dom.getParent(e,function(e){return t=a.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function m(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=h(e.parentNode),a.dom.getStyle(e,"color")&&t?a.dom.setStyle(e,"text-decoration",t):a.dom.getStyle(e,"textdecoration")===t&&a.dom.setStyle(e,"text-decoration",null))}function g(t,n,r){function i(e,t){if(t=t||p,e){if(t.onformat&&t.onformat(e,t,n,r),it(t.styles,function(t,r){W.setStyle(e,r,R(t,n))}),t.styles){var i=W.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}it(t.attributes,function(t,r){W.setAttrib(e,r,R(t,n))}),it(t.classes,function(t){t=R(t,n),W.hasClass(e,t)||W.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.current();r;r=i.prev())if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}var n=a.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var s=t(i,o),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function l(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,u;return it(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),it(e.childNodes,function(e,n){rt(e)&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(it(ot(e.childNodes),i),0):(u=W.clone(n,X),it(ot(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(u,s):l>a&&e.insertBefore(u,s.nextSibling),r.push(u),it(o,function(e){u.appendChild(e)}),u)}function u(e,r,o){var a=[],u,f,h=!0;u=p.inline||p.block,f=W.create(u),i(f),U.walk(e,function(e){function m(e){var v,C,x,w,_;return _=h,v=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&et(e)&&(_=h,h="true"===et(e),w=!0),k(v,"br")?(g=0,void(p.block&&W.remove(e))):p.wrapper&&b(e,t,n)?void(g=0):h&&!w&&p.block&&!p.wrapper&&s(v)&&q(C,u)?(e=W.rename(e,u),i(e),a.push(e),void(g=0)):p.selector&&(it(d,function(t){"collapsed"in t&&t.collapsed!==y||W.is(e,t.selector)&&!c(e)&&(i(e,t),x=!0)}),!p.inline||x)?void(g=0):void(!h||w||!q(u,v)||!q(C,u)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||c(e)||p.inline&&$(e)?"li"==v&&r?g=l(e,r,f,a,m):(g=0,it(ot(e.childNodes),m),w&&(h=_),g=0):(g||(g=W.clone(f,X),e.parentNode.insertBefore(g,e),a.push(g)),g.appendChild(e)))}var g;it(e,m)}),p.wrap_links===!1&&it(a,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=W.clone(f,X),a.push(r),i=ot(e.childNodes),n=0;n<i.length;n++)r.appendChild(i[n]);e.appendChild(r)}it(ot(e.childNodes),t)}t(e)}),it(a,function(e){function r(e){var t=0;return it(e.childNodes,function(e){A(e)||rt(e)||t++}),t}function o(e){var t,n;return it(e.childNodes,function(e){return 1!=e.nodeType||rt(e)||c(e)?void 0:(t=e,X)}),t&&!rt(t)&&E(t,p)&&(n=W.clone(t,X),i(n),W.replace(n,e,J),W.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!$(e))&&0===s)return void W.remove(e,1);if(p.inline||p.wrapper){if(p.exact||1!==s||(e=o(e)),it(d,function(t){it(W.select(t.inline,e),function(e){var r;if(!rt(e)){if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}L(t,n,e,t.exact?e:null)}})}),b(e.parentNode,t,n))return W.remove(e,1),e=0,J;p.merge_with_parents&&W.getParent(e.parentNode,function(r){return b(r,t,n)?(W.remove(e,1),e=0,J):void 0}),e&&p.merge_siblings!==!1&&(e=P(H(e),e),e=P(e,H(e,J)))}})}var d=f(t),p=d[0],h,v,y=!r&&V.isCollapsed();if(p)if(r)r.nodeType?(v=W.createRng(),v.setStartBefore(r),v.setEndAfter(r),u(D(v,d),null,!0)):u(r,null,!0);else if(y&&p.inline&&!W.select("td.mce-item-selected,th.mce-item-selected").length)I("apply",t,n);else{var C=a.selection.getNode();j||!d[0].defaultBlock||W.getParent(C,W.isBlock)||g(d[0].defaultBlock),a.selection.setRng(o()),h=V.getBookmark(),u(D(V.getRng(J),d),h),p.styles&&(p.styles.color||p.styles.textDecoration)&&(at(C,m,"childNodes"),m(C)),V.moveToBookmark(h),F(V.getRng(J)),a.nodeChanged()}}function v(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&et(e)&&(a=y,y="true"===et(e),s=!0),n=ot(e.childNodes),y&&!s)for(r=0,o=p.length;o>r&&!L(p[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return it(l(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=b(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=W.clone(o,X),c=0;c<p.length;c++)if(L(p[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||m.mixed&&$(e)||(n=W.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function c(e){return s(o(e),e,e,!0)}function u(e){var t=W.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return rt(n)&&(n=n[e?"firstChild":"lastChild"]),W.remove(t,!0),n}function d(e){var t,n,r=e.commonAncestorContainer;e=D(e,p,J),m.split&&(t=O(e,J),n=O(e),t!=n?(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),t=B(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=B(n,"span",{id:"_end","data-mce-type":"bookmark"}),c(t),c(n),t=u(J),n=u()):t=n=c(t),e.startContainer=t.parentNode,e.startOffset=K(t),e.endContainer=n.parentNode,e.endOffset=K(n)+1),U.walk(e,function(e){it(e,function(e){i(e),1===e.nodeType&&"underline"===a.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===h(e.parentNode)&&L({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var p=f(e),m=p[0],g,v,y=!0;return n?void(n.nodeType?(v=W.createRng(),v.setStartBefore(n),v.setEndAfter(n),d(v)):d(n)):void(V.isCollapsed()&&m.inline&&!W.select("td.mce-item-selected,th.mce-item-selected").length?I("remove",e,t,r):(g=V.getBookmark(),d(V.getRng(J)),V.moveToBookmark(g),m.inline&&C(e,t,V.getStart())&&F(V.getRng(!0)),a.nodeChanged()))}function y(e,t,n){var r=f(e);!C(e,t,n)||"toggle"in r[0]&&!r[0].toggle?g(e,t,n):v(e,t,n)}function b(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===Z){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?W.getAttrib(e,o):S(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!k(a,T(R(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?W.getAttrib(e,s[l]):S(e,s[l]))return t;return t}var o=f(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],E(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!W.hasClass(e,l[s]))return;return a}}function C(e,t,n){function r(n){var r=W.getRoot();return n===r?!1:(n=W.getParent(n,function(n){return n.parentNode===r||!!b(n,e,t,!0)}),b(n,e,t))}var i;return n?r(n):(n=V.getNode(),r(n)?J:(i=V.getStart(),i!=n&&r(i)?J:X))}function x(e,t){var n,r=[],i={};return n=V.getStart(),W.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&b(n,a,t)&&(i[a]=!0,r.push(a))},W.getRoot()),r}function w(e){var t=f(e),n,r,i,o,a;if(t)for(n=V.getStart(),r=l(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return J;for(i=r.length-1;i>=0;i--)if(W.is(r[i],a))return J}return X}function _(e,t,n){var r;return Q||(Q={},r={},a.on("NodeChange",function(e){var t=l(e.element),n={};it(Q,function(e,i){it(t,function(o){return b(o,i,{},e.similar)?(r[i]||(it(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):void 0})}),it(r,function(i,o){n[o]||(delete r[o],it(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),it(e.split(","),function(e){Q[e]||(Q[e]=[],Q[e].similar=n),Q[e].push(t)}),this}function N(e){return o.getCssText(a,e)}function E(e,t){return k(e,t.inline)?J:k(e,t.block)?J:t.selector?1==e.nodeType&&W.is(e,t.selector):void 0}function k(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function S(e,t){return T(W.getStyle(e,t),t)}function T(e,t){return("color"==t||"backgroundColor"==t)&&(e=W.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function R(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function A(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function B(e,t,n){var r=W.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function D(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=W.getRoot(),3==r.nodeType&&!A(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&$(i))return i;for(o=i[a];o;o=o[a])if(!rt(o)&&!A(o)&&!t(o))return i;if(i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===Z&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function c(e){for(var t=e;t;){if(1===t.nodeType&&et(t))return"false"===et(t)?t:e;t=t.parentNode}return e}function u(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,W.getParent(t,$)||a.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if($(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=l(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&W.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=W.getRoot();if(n[0].wrapper||(r=W.getParent(e,n[0].block,i)),r||(r=W.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&s(e)})),r&&n[0].wrapper&&(r=l(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!$(r[t])&&(r=r[t],!k(r,"br")););return r||e}var p,h,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(p=g.childNodes.length-1,g=g.childNodes[v>p?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(rt(g.parentNode)||rt(g))&&(g=rt(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(rt(y.parentNode)||rt(y))&&(y=rt(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=o(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=o(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==X&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&($(g)||(g=i(!0)),$(y)||(y=i()))),1==g.nodeType&&(v=K(g),g=g.parentNode),1==y.nodeType&&(b=K(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function L(e,t,n,r){var i,o,a;if(!E(n,e))return X;if("all"!=e.remove)for(it(e.styles,function(i,o){i=T(R(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||k(S(r,o),i))&&W.setStyle(n,o,""),a=1}),a&&""===W.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),it(e.attributes,function(e,i){var o;if(e=R(e,t),"number"==typeof i&&(i=e,r=0),!r||k(W.getAttrib(r,i),e)){if("class"==i&&(e=W.getAttrib(n,i),e&&(o="",it(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void W.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),Y.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),it(e.classes,function(e){e=R(e,t),(!r||W.hasClass(r,e))&&W.removeClass(n,e)}),o=W.getAttribs(n),i=0;i<o.length;i++)if(0!==o[i].nodeName.indexOf("_"))return X;return"none"!=e.remove?(M(n,e),J):void 0}function M(e,t){function n(e,t,n){return e=H(e,t,n),!e||"BR"==e.nodeName||$(e)}var r=e.parentNode,i;t.block&&(j?r==W.getRoot()&&(t.list_block&&k(e,t.list_block)||it(ot(e.childNodes),function(e){q(j,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=B(e,j),W.setAttribs(i,a.settings.forced_root_block_attrs)):i=0})):$(e)&&!$(r)&&(n(e,X)||n(e.firstChild,J,1)||e.insertBefore(W.create("br"),e.firstChild),n(e,J)||n(e.lastChild,X,1)||e.appendChild(W.create("br")))),t.selector&&t.inline&&!k(t.inline,e)||W.remove(e,1)}function H(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!A(e))return e}function P(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!rt(i))return i}return e}var i,o,a=new r(W);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return W.remove(t),it(ot(t.childNodes),function(t){e.appendChild(t)}),e}return t}function O(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,a.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,a.getBody()).prev()||r),r}function I(t,n,r,i){function o(e){var t=W.create("span",{id:y,"data-mce-bogus":!0,style:C?"color:red":""});return e&&t.appendChild(a.getDoc().createTextNode(G)),t}function l(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==G||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=V.getRng(!0),l(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),W.remove(e)):(n=u(e),n.nodeValue.charAt(0)===G&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset--,r.endContainer==n&&r.endOffset--),W.remove(e,1)),V.setRng(r);else if(e=c(V.getStart()),!e)for(;e=W.get(y);)d(e,!1)}function p(){var e,t,i,a,s,l,d;e=V.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(V.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=V.getBookmark(),e.collapse(!0),e=D(e,f(n)),e=U.split(e),g(n,r,e),V.moveToBookmark(s)):(t&&i.nodeValue===G?g(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,g(n,r,t)),V.setCursorLocation(i,a))}function h(){var e=V.getRng(!0),t,a,l,c,u,d,p=[],h,m;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(b(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),p.push(u),u=u.parentNode}if(d)if(c)l=V.getBookmark(),e.collapse(!0),e=D(e,f(n),!0),e=U.split(e),v(n,r,e),V.moveToBookmark(l);else{for(m=o(),u=m,h=p.length-1;h>=0;h--)u.appendChild(W.clone(p[h],!1)),u=u.firstChild;u.appendChild(W.doc.createTextNode(G)),u=u.firstChild;var g=W.getParent(d,s);g&&W.isEmpty(g)?d.parentNode.replaceChild(m,d):W.insertAfter(m,d),V.setCursorLocation(u,1),W.isEmpty(d)&&W.remove(d)}}function m(){var e;e=c(V.getStart()),e&&!W.isEmpty(e)&&at(e,function(e){1!=e.nodeType||e.id===y||W.isEmpty(e)||W.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",C=a.settings.caret_debug;a._hasCaretEvents||(nt=function(){var e=[],t;if(l(c(V.getStart()),e))for(t=e.length;t--;)W.setAttrib(e[t],"data-mce-bogus","1")},tt=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(c(V.getStart())),m()},a.on("SetContent",function(e){e.selection&&m()}),a._hasCaretEvents=!0),"apply"==t?p():h()}function F(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=K(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,W.getParent(n,W.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!A(a))return l=W.create("a",null,G),a.parentNode.insertBefore(l,a),t.setStart(a,0),V.setRng(t),void W.remove(l)}var z={},W=a.dom,V=a.selection,U=new t(W),q=a.schema.isValidChild,$=W.isBlock,j=a.settings.forced_root_block,K=W.nodeIndex,G="\ufeff",Y=/^(src|href|style)$/,X=!1,J=!0,Q,Z,et=W.getContentEditable,tt,nt,rt=n.isBookmarkNode,it=i.each,ot=i.grep,at=i.walk,st=i.extend;st(this,{get:f,register:p,apply:g,remove:v,toggle:y,match:C,matchAll:x,matchNode:b,canApply:w,formatChanged:_,getCssText:N}),u(),d(),a.on("BeforeGetContent",function(){nt&&nt()}),a.on("mouseup keydown",function(e){tt&&tt(e)})}}),r(O,[d,u,_],function(e,t,n){var r=t.trim,i;return i=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function o(){var e=r(t.getContent({format:"raw",no_events:1})),o=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,a,s,l,c,u,d=t.schema;for(e=e.replace(i,""),u=d.getShortEndedElements();c=o.exec(e);)s=o.lastIndex,l=c[0].length,a=u[c[1]]?s:n.findEndTag(d,e,s),e=e.substring(0,s-l)+e.substring(a),o.lastIndex=s-l;return e}function a(e){s.typing=!1,s.add({},e)}var s=this,l=0,c=[],u,d,f=0;return t.on("init",function(){s.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a(e)}),t.on("ObjectResizeStart",function(){s.beforeChange()}),t.on("SaveContent ObjectResized blur",a),t.on("DragEnd",a),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(a(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),d&&s.typing&&(t.isDirty()||(t.isNotDirty=!c[0]||o()==c[0].content,t.isNotDirty||t.fire("change",{level:c[0],lastLevel:null})),t.fire("TypingUndo"),d=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?void(s.typing&&a(e)):void((16>t||t>20)&&224!=t&&91!=t&&!s.typing&&(s.beforeChange(),s.typing=!0,s.add({},e),d=!0))}),t.on("MouseDown",function(e){s.typing&&a(e)}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||t.nodeChanged()}),e.ie?t.on("MouseUp",function(e){e.isDefaultPrevented()||(t.once("SelectionChange",function(){t.dom.isChildOf(t.selection.getStart(),t.getBody())&&t.nodeChanged()}),t.nodeChanged())}):(t.on("MouseUp",function(){t.nodeChanged()}),t.on("Click",function(e){e.isDefaultPrevented()||setTimeout(function(){t.nodeChanged()},0)})),s={data:c,typing:!1,beforeChange:function(){f||(u=t.selection.getBookmark(2,!0))},add:function(e,n){var r,i=t.settings,a;if(e=e||{},e.content=o(),f||t.removed)return null;if(a=c[l],t.fire("BeforeAddUndo",{level:e,lastLevel:a,originalEvent:n}).isDefaultPrevented())return null;if(a&&a.content==e.content)return null;if(c[l]&&(c[l].beforeBookmark=u),i.custom_undo_redo_levels&&c.length>i.custom_undo_redo_levels){for(r=0;r<c.length-1;r++)c[r]=c[r+1];c.length--,l=c.length}e.bookmark=t.selection.getBookmark(2,!0),l<c.length-1&&(c.length=l+1),c.push(e),l=c.length-1;var s={level:e,lastLevel:a,originalEvent:n};return t.fire("AddUndo",s),l>0&&(t.isNotDirty=!1,t.fire("change",s)),e},undo:function(){var e;return s.typing&&(s.add(),s.typing=!1),l>0&&(e=c[--l],0===l&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return l<c.length-1&&(e=c[++l],t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.bookmark),t.fire("redo",{level:e})),e},clear:function(){c=[],l=0,s.typing=!1,t.fire("ClearUndos")},hasUndo:function(){return l>0||s.typing&&c[0]&&o()!=c[0].content},hasRedo:function(){return l<c.length-1&&!this.typing},transact:function(e){s.beforeChange();try{f++,e()}finally{f--}s.add()}}}}),r(I,[h,B,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function f(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function h(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function m(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&A&&A.firstChild&&A.firstChild==A.lastChild&&"BR"==A.firstChild.tagName&&a.remove(A.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var f=r(t.firstChild);f&&/^(UL|OL|DL)$/.test(f.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(d[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!B||9>B)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function g(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function v(e){var t=T,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==P?(n=a.create(e||I),g(n)):n=A.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function y(t){var n,r,i;if(3==T.nodeType&&(t?R>0:R<T.nodeValue.length))return!1;if(T.parentNode==A&&F&&!t)return!0;if(t&&1==T.nodeType&&T==A.firstChild)return!0;if("TABLE"===T.nodeName||T.previousSibling&&"TABLE"==T.previousSibling.nodeName)return F&&!t||!F&&t;for(n=new e(T,A),3==T.nodeType&&(t&&0===R?n.prev():t||R!=T.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function b(e,t){var n,r,o,s,l,c,d=I||"P";if(r=a.getParent(e,a.isBlock),c=i.getBody().nodeName.toLowerCase(),!r||!f(r)){if(r=r||S,!r.hasChildNodes())return n=a.create(d),g(n),r.appendChild(n),E.setStart(n,0),E.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),g(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;E.setStart(e,t),E.setEnd(e,t)}}return e}function C(){function e(e){for(var t=H[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===A}function t(){var e=H.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:H}var n=H.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(I="LI"),L=I?v(I):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(L,t()):a.replace(L,H):e(!0)?"LI"==n?(a.insertAfter(L,t()),L.appendChild(a.doc.createTextNode(" ")),L.appendChild(H)):H.parentNode.insertBefore(L,H):e()?(a.insertAfter(L,t()),p(L)):(H=t(),k=E.cloneRange(),k.setStartAfter(A),k.setEndAfter(H),M=k.extractContents(),"LI"==I&&"LI"==M.firstChild.nodeName?(L=M.firstChild,a.insertAfter(M,H)):(a.insertAfter(M,H),a.insertAfter(L,H))),a.remove(A),m(L),c.add()}function x(){i.execCommand("InsertLineBreak",!1,o)}function w(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function _(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function N(e){var t;r||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(a.getStyle(t,"float",!0)))&&a.add(e,"br"))}var E,k,S,T,R,A,B,D,L,M,H,P,O,I,F;if(E=s.getRng(!0),!o.isDefaultPrevented()){if(!E.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(E),T=E.startContainer,R=E.startOffset,I=(l.force_p_newlines?"p":"")||l.forced_root_block,I=I?I.toUpperCase():"",B=a.doc.documentMode,D=o.shiftKey,1==T.nodeType&&T.hasChildNodes()&&(F=R>T.childNodes.length-1,T=T.childNodes[Math.min(R,T.childNodes.length-1)]||T,R=F&&3==T.nodeType?T.nodeValue.length:0),S=_(T)){if(c.beforeChange(),!a.isBlock(S)&&S!=a.getRoot())return void((!I||D)&&x());if((I&&!D||!I&&D)&&(T=b(T,R)),A=a.getParent(T,a.isBlock),H=A?a.getParent(A.parentNode,a.isBlock):null,P=A?A.nodeName.toUpperCase():"",O=H?H.nodeName.toUpperCase():"","LI"!=O||o.ctrlKey||(A=H,P=O),/^(LI|DT|DD)$/.test(P)){if(!I&&D)return void x();if(a.isEmpty(A))return void C()}if("PRE"==P&&l.br_in_pre!==!1){if(!D)return void x()}else if(!I&&!D&&"LI"!=P||I&&D)return void x();I&&A===i.getBody()||(I=I||"P",y()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(P)&&"HGROUP"!=O?v(I):v(),l.end_container_on_empty_block&&f(H)&&a.isEmpty(A)?L=a.split(H,A):a.insertAfter(L,A),m(L)):y(!0)?(L=A.parentNode.insertBefore(v(),A),p(L),m(A)):(k=E.cloneRange(),k.setEndAfter(A),M=k.extractContents(),w(M),L=M.firstChild,a.insertAfter(M,A),h(L),N(A),m(L)),a.setAttrib(L,"id",""),i.fire("NewBlock",{newBlock:L}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(F,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(z,[k,d,u,M,B,h],function(e,n,r,i,o,a){var s=r.each,l=r.extend,c=r.map,u=r.inArray,d=r.explode,f=n.gecko,p=n.ie,h=n.ie&&n.ie<11,m=!0,g=!1;return function(r){function v(e,t,n){var r;return e=e.toLowerCase(),(r=T.exec[e])?(r(e,t,n),m):g}function y(e){var t;return e=e.toLowerCase(),(t=T.state[e])?t(e):-1}function b(e){var t;return e=e.toLowerCase(),(t=T.value[e])?t(e):g}function C(e,t){t=t||"exec",s(e,function(e,n){s(n.toLowerCase().split(","),function(n){T[t][n]=e})})}function x(e,n,i){return n===t&&(n=g),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function w(e){return A.match(e)}function _(e,n){A.toggle(e,n?{value:n}:t),r.nodeChanged()}function N(e){B=S.getBookmark(e)}function E(){S.moveToBookmark(B)}var k=r.dom,S=r.selection,T={state:{},exec:{},value:{}},R=r.settings,A=r.formatter,B;l(this,{execCommand:v,queryCommandState:y,queryCommandValue:b,addCommands:C}),C({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{x(e)}catch(o){i=m}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(S.isCollapsed()){var e=S.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),s("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),_("align"+t),v("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;x(e),t=k.getParent(S.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(N(),k.split(n,t),E()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=d(R.font_size_style_values),r=d(R.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=S.getBookmark();r.setContent(r.getContent({cleanup:m}),{cleanup:m}),S.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||S.getNode();i!=r.getBody()&&(N(),r.dom.remove(i,m),E())},mceSelectNodeDepth:function(e,t,n){var i=0;k.getParent(S.getNode(),function(e){return 1==e.nodeType&&i++==n?(S.select(e),g):void 0},r.getBody())},mceSelectNode:function(e,t,n){S.select(n)},mceInsertContent:function(t,n,o){function a(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=S.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function l(e){if(w)for(b=e.firstChild;b;b=b.walk(!0))_[b.name]&&b.attr("data-mce-new","true")}function c(){if(w){var e=r.getBody(),t=new i(k);s(k.select("*[data-mce-new]"),function(n){n.removeAttribute("data-mce-new");for(var r=n.parentNode;r&&r!=e;r=r.parentNode)t.compare(r,n)&&k.remove(n,!0) +})}}var u,d,f,h,m,g,v,y,b,C,x,w,_=r.schema.getTextInlineElements();"string"!=typeof o&&(w=o.merge,o=o.content),/^ | $/.test(o)&&(o=a(o)),u=r.parser,d=new e({},r.schema),x='<span id="mce_marker" data-mce-type="bookmark">ÈB;</span>',g={content:o,format:"html",selection:!0},r.fire("BeforeSetContent",g),o=g.content,-1==o.indexOf("{$caret}")&&(o+="{$caret}"),o=o.replace(/\{\$caret\}/,x),y=S.getRng();var N=y.startContainer||(y.parentElement?y.parentElement():null),E=r.getBody();N===E&&S.isCollapsed()&&k.isBlock(E.firstChild)&&k.isEmpty(E.firstChild)&&(y=k.createRng(),y.setStart(E.firstChild,0),y.setEnd(E.firstChild,0),S.setRng(y)),S.isCollapsed()||r.getDoc().execCommand("Delete",!1,null),f=S.getNode();var T={context:f.nodeName.toLowerCase()};if(m=u.parse(o,T),l(m),b=m.lastChild,"mce_marker"==b.attr("id"))for(v=b,b=b.prev;b;b=b.walk(!0))if(3==b.type||!k.isBlock(b.name)){b.parent.insert(v,b,"br"===b.name);break}if(T.invalid){for(S.setContent(x),f=S.getNode(),h=r.getBody(),9==f.nodeType?f=b=h:b=f;b!==h;)f=b,b=b.parentNode;o=f==h?h.innerHTML:k.getOuterHTML(f),o=d.serialize(u.parse(o.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return d.serialize(m)}))),f==h?k.setHTML(h,o):k.setOuterHTML(f,o)}else o=d.serialize(m),b=f.firstChild,C=f.lastChild,!b||b===C&&"BR"===b.nodeName?k.setHTML(f,o):S.setContent(o);c(),v=k.get("mce_marker"),S.scrollIntoView(v),y=k.createRng(),b=v.previousSibling,b&&3==b.nodeType?(y.setStart(b,b.nodeValue.length),p||(C=v.nextSibling,C&&3==C.nodeType&&(b.appendData(C.data),C.parentNode.removeChild(C)))):(y.setStartBefore(v),y.setEndBefore(v)),k.remove(v),S.setRng(y),r.fire("SetContent",g),r.addVisual()},mceInsertRawHTML:function(e,t,n){S.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,i;t=R.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),y("InsertUnorderedList")||y("InsertOrderedList")?x(e):(R.forced_root_block||k.getParent(S.getNode(),k.isBlock)||A.apply("div"),s(S.getSelectedBlocks(),function(o){if("LI"!=o.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==k.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),k.setStyle(o,a,i?i+n:"")):(i=parseInt(o.style[a]||0,10)+t+n,k.setStyle(o,a,i))}}))},mceRepaint:function(){if(f)try{N(m),S.getSel()&&S.getSel().selectAllChildren(r.getBody()),S.collapse(m),E()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,S.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=k.getParent(S.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=k.getRoot(),t;S.getRng().setStart?(t=k.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),S.setRng(t)):(t=S.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){x("Delete");var e=r.getBody();k.isEmpty(e)&&(r.setContent(""),e.firstChild&&k.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")},InsertLineBreak:function(e,t,n){function i(){for(var e=new a(p,v),t,n=r.schema.getNonEmptyElements();t=e.next();)if(n[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=n,l,c,u,d=S.getRng(!0);new o(k).normalize(d);var f=d.startOffset,p=d.startContainer;if(1==p.nodeType&&p.hasChildNodes()){var g=f>p.childNodes.length-1;p=p.childNodes[Math.min(f,p.childNodes.length-1)]||p,f=g&&3==p.nodeType?p.nodeValue.length:0}var v=k.getParent(p,k.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?k.getParent(v.parentNode,k.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),p&&3==p.nodeType&&f>=p.nodeValue.length&&(h||i()||(l=k.create("br"),d.insertNode(l),d.setStartAfter(l),d.setEndAfter(l),c=!0)),l=k.create("br"),d.insertNode(l);var w=k.doc.documentMode;return h&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(k.doc.createTextNode("\r"),l),u=k.create("span",{}," "),l.parentNode.insertBefore(u,l),S.scrollIntoView(u),k.remove(u),c?(d.setStartBefore(l),d.setEndBefore(l)):(d.setStartAfter(l),d.setEndAfter(l)),S.setRng(d),r.undoManager.add(),m}}),C({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=S.isCollapsed()?[k.getParent(S.getNode(),k.isBlock)]:S.getSelectedBlocks(),r=c(n,function(e){return!!A.matchNode(e,t)});return-1!==u(r,m)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return w(e)},mceBlockQuote:function(){return w("blockquote")},Outdent:function(){var e;if(R.inline_styles){if((e=k.getParent(S.getStart(),k.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m;if((e=k.getParent(S.getEnd(),k.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m}return y("InsertUnorderedList")||y("InsertOrderedList")||!R.inline_styles&&!!k.getParent(S.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=k.getParent(S.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),C({"FontSize,FontName":function(e){var t=0,n;return(n=k.getParent(S.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),C({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(W,[u],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(V,[u],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(U,[u],function(e){function t(e){function t(){return!1}function n(){return!0}function r(r,i){var a,s,l,d;if(r=r.toLowerCase(),i=i||{},i.type=r,i.target||(i.target=c),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),e.beforeFire&&e.beforeFire(i),a=u[r])for(s=0,l=a.length;l>s;s++){if(a[s]=d=a[s],d.once&&o(r,d),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(d.call(c,i)===!1)return i.preventDefault(),i}return i}function i(e,n,r){var i,o,a;if(n===!1&&(n=t),n)for(o=e.toLowerCase().split(" "),a=o.length;a--;)e=o[a],i=u[e],i||(i=u[e]=[],d(e,!0)),r?i.unshift(n):i.push(n);return l}function o(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=u[e],!e){for(i in u)d(i,!1),delete u[i];return l}if(r){if(t)for(a=r.length;a--;)r[a]===t&&(r=r.slice(0,a).concat(r.slice(a+1)),u[e]=r);else r.length=0;r.length||(d(e,!1),delete u[e])}}else{for(e in u)d(e,!1);u={}}return l}function a(e,t,n){return t.once=!0,i(e,t,n)}function s(e){return e=e.toLowerCase(),!(!u[e]||0===u[e].length)}var l=this,c,u={},d;e=e||{},c=e.scope||l,d=e.toggleEvent||t,l.fire=r,l.on=i,l.off=o,l.once=a,l.has=s}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(q,[V],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r($,[u,q,V],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(j,[u,y],function(e,t){var n=0;return{id:function(){return"mceu_"+n++},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(K,[V,u,U,$,j],function(e,t,n,r,i){function o(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e._rendered&&e.bindPendingEvents())}})),e._eventDispatcher}var a={},s="onmousewheel"in document,l=!1,c="mce-",u=e.extend({Statics:{elementIdCache:a,classPrefix:c},isRtl:function(){return u.rtl},classPrefix:c,init:function(e){var n=this,r,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=e.id||i.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},r=e.classes)for(r=r.split(" "),r.map={},o=r.length;o--;)r.map[r[o]]=!0;n._classes=r||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,r,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=i.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(l=u.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s,l;l=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=l(r.x)+"px",s.x=r.x),r.y!==s.y&&(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this;return o(r).on(e,n(t)),r},off:function(e,t){return o(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=o(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return o(this).has(e)},parents:function(e){var t=this,n,i=new r;for(n=t.parent();n;n=n.parent())i.add(n);return e&&(i=i.filter(e)),i},parentsAndSelf:function(e){return new r(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return i.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,r=e?this._id+"-"+e:this._id;return n=a[r]=(t===!0?null:a[r])||i.get(r)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return u.translate?u.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,o;if(e.items){var s=e.items().toArray();for(o=s.length;o--;)s[o].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&i.off(t);var l=e.getRoot().controlIdLookup;if(l&&delete l[e._id],delete a[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(o=c.length;o--;)delete a[c[o].id];t.parentNode.removeChild(t)}return e._rendered=!1,e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(i.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(i.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,r,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||i.css(e.getEl(),"display","none"),e.settings.border&&(r=e.borderBox(),i.css(e.getEl(),{"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r<s.length&&a[r]===s[r];r++);for(i=s.length-1;i>=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;i<a.length;i++)t=a[i],t.fire("mouseenter",{target:t.getEl()})}}function r(e){e.preventDefault(),"mousewheel"==e.type?(e.deltaY=-1/40*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-1/40*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=o.fire("wheel",e)}var o=this,a,c,u,d,f,p;if(o._rendered=!0,f=o._nativeEvents){for(u=o.parents().toArray(),u.unshift(o),a=0,c=u.length;!d&&c>a;a++)d=u[a]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=a,a=0;c>a;a++)u[a]._eventsRoot=d;var h=d._delegates;h||(h=d._delegates={});for(p in f){if(!f)return!1;"wheel"!==p||l?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(i.on(d.getEl(),"mouseleave",t),i.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):h[p]||(i.on(d.getEl(),p,e),h[p]=!0),f[p]=!1):s?i.on(o.getEl(),"mousewheel",r):i.on(o.getEl(),"DOMMouseScroll",r)}}},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){return this.repaint(),this}});return u}),r(G,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Y,[],function(){return function(e){function t(e){return e=e||b,e&&e.getAttribute("role")}function n(e){for(var n,r=e||b;r=r.parentNode;)if(n=t(r))return n}function r(e){var t=b;return t?t.getAttribute("aria-"+e):void 0}function i(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t}function o(e){return i(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(e))?!0:!1}function a(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){o(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||y.getEl()),n}function s(e){var t,n;e=e||C,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function l(e){var t=s(e),n=a(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?c(t.lastAriaIndex,n):c(0,n)}function c(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function u(e,t){var n=-1,r=s();t=t||a(r.getEl());for(var i=0;i<t.length;i++)t[i]===b&&(n=i);n+=e,r.lastAriaIndex=c(n,t)}function d(){var e=n();"tablist"==e?u(-1,a(b.parentNode)):C.parent().submenu?g():u(-1)}function f(){var e=t(),i=n();"tablist"==i?u(1,a(b.parentNode)):"menuitem"==e&&"menu"==i&&r("haspopup")?v():u(1)}function p(){u(-1)}function h(){var e=t(),i=n();"menuitem"==e&&"menubar"==i?v():"button"==e&&r("haspopup")?v({key:"down"}):u(1)}function m(e){var t=n();if("tablist"==t){var r=a(C.getEl("body"))[0];r&&r.focus()}else u(e.shiftKey?-1:1)}function g(){C.fire("cancel")}function v(e){e=e||{},C.fire("click",{target:b,aria:e})}var y=e.root,b,C;return b=document.activeElement,C=y.getParentCtrl(b),y.on("keydown",function(e){function t(e,t){i(b)||t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,d);break;case 39:t(e,f);break;case 38:t(e,p);break;case 40:t(e,h);break;case 27:g();break;case 14:case 13:case 32:t(e,v);break;case 9:m(e)!==!1&&e.preventDefault()}}),y.on("focusin",function(e){b=e.target,C=e.control}),{focusFirst:l}}}),r(X,[K,$,q,G,Y,u,j],function(e,t,n,r,i,o,a){var s={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=s[e]=s[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=a.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},preRender:function(){},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>" +},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&a.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),a.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(J,[j],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(Q,[j,J],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(Z,[X,Q],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes()+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(et,[j],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this._fixed){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(tt,[j],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(nt,[Z,et,tt,j],function(e,t,n,r){function i(){function e(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}c||(c=function(t){if(2!=t.button)for(var n=f.length;n--;){var r=f[n],i=r.getParentCtrl(t.target);if(r.settings.autohide){if(i&&(e(i,r)||r.parent()===i))continue;t=r.fire("autohide",{target:t.target}),t.isDefaultPrevented()||r.hide()}}},r.on(document,"click",c))}function o(){u||(u=function(){var e;for(e=f.length;e--;)s(f[e])},r.on(window,"scroll",u))}function a(){d||(d=function(){m.hideAll()},r.on(window,"resize",d))}function s(e){function t(t,n){for(var r,i=0;i<f.length;i++)if(f[i]!=e)for(r=f[i].parent();r&&(r=r.parent());)r==e&&f[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e._fixed?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function l(e){var t;for(t=f.length;t--;)f[t]===e&&f.splice(t,1);for(t=p.length;t--;)p[t]===e&&p.splice(t,1)}var c,u,d,f=[],p=[],h,m=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=m.zIndex||65535,i;if(p.length)for(e=0;e<p.length;e++)p[e].modal&&(t++,i=p[e]),p[e].getEl().style.zIndex=t,p[e].zIndex=t,t++;var o=document.getElementById(n.classPrefix+"modal-block");i?r.css(o,"z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),h=!1),m.currentZIndex=t}var n=this;n._super(e),n._eventsRoot=n,n.addClass("floatpanel"),e.autohide&&(i(),a(),f.push(n)),e.autofix&&(o(),n.on("move",function(){s(this)})),n.on("postrender show",function(e){if(e.control==n){var i,o=n.classPrefix;n.modal&&!h&&(i=r.createFragment('<div id="'+o+'modal-block" class="'+o+"reset "+o+'fade"></div>'),i=i.firstChild,n.getContainerElm().appendChild(i),setTimeout(function(){r.addClass(i,o+"in"),r.addClass(n.getEl(),o+"in")},0),h=!0),p.push(n),t()}}),n.on("close hide",function(e){if(e.control==n){for(var r=p.length;r--;)p[r]===n&&p.splice(r,1);t()}}),n.on("show",function(){n.parents().each(function(e){return e._fixed?(n.fixed(!0),!1):void 0})}),e.popover&&(n._preBodyHtml='<div class="'+n.classPrefix+'arrow"></div>',n.addClass("popover").addClass("bottom").addClass(n.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=f.length;t--&&f[t]!==e;);return-1===t&&f.push(e),n},hide:function(){return l(this),this._super()},hideAll:function(){m.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){l(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return m.hideAll=function(){for(var e=f.length;e--;){var t=f[e];t&&t.settings.autohide&&(t.hide(),f.splice(e,1))}},m}),r(rt,[nt,Z,j,J],function(e,t,n,r){var i=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.on("cancel",function(){n.close()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><button type="button" class="'+r+'close" aria-hidden="true">\xd7</button><div id="'+n+'-dragh" class="'+r+'dragh"></div></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes()+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.classes("body")+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.addClass("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new r(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return i}),r(it,[rt],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(ot,[rt,it],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo().reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)},i.getWindows=function(){return o}}}),r(at,[R,B,x,g,d,u],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){var t=new i(function(){});o.each(a.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&a.dom.setAttrib(e,"style",e.getAttribute("style"))}),t.observe(a.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null);var n=a.selection.getRng(),r=n.startContainer.parentNode;o.each(t.takeRecords(),function(e){if(q.isChildOf(e.target,a.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}o.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),q.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),a.selection.setRng(n))}})}}),t.disconnect(),o.each(a.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var n=a.getDoc(),r="data:text/mce-internal,",i=window.MutationObserver,s,l;i||(s=!0,i=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),a.on("keydown",function(n){var r=n.keyCode==U,i=e.metaKeyPressed(n);if(!c(n)&&(r||n.keyCode==V)){var o=a.selection.getRng(),s=o.startContainer,l=o.startOffset;if(!i&&o.collapsed&&3==s.nodeType&&(r?l<s.data.length:l>0))return;n.preventDefault(),i&&a.selection.getSel().modify("extend",r?"forward":"backward","word"),t(r)}}),a.on("keypress",function(n){c(n)||$.isCollapsed()||!n.charCode||e.metaKeyPressed(n)||(n.preventDefault(),t(!0),a.selection.setContent(String.fromCharCode(n.charCode)))}),a.addCommand("Delete",function(){t()}),a.addCommand("ForwardDelete",function(){t(!0)}),s||(a.on("dragstart",function(e){var t;a.selection.isCollapsed()&&"IMG"==e.target.tagName&&$.select(e.target),l=$.getRng(),t=a.selection.getContent(),t.length>0&&e.dataTransfer.setData("URL","data:text/mce-internal,"+escape(t))}),a.on("drop",function(e){if(!c(e)){var i=e.dataTransfer.getData("URL");if(!i||-1==i.indexOf(r)||!n.caretRangeFromPoint)return;i=unescape(i.substr(r.length)),n.caretRangeFromPoint&&(e.preventDefault(),window.setTimeout(function(){var r=n.caretRangeFromPoint(e.x,e.y);l&&($.setRng(l),l=null),t(),$.setRng(r),a.insertContent(i)},0))}}),a.on("cut",function(e){!c(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",a.selection.getContent()),e.clipboardData.setData("text/plain",a.selection.getContent({format:"text"})),t(!0))}))}function d(){function e(e){var t=q.create("body"),n=e.cloneContents();return t.appendChild(n),$.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(a.getBody()),t.compareRanges(n,r)}var i=e(n),o=q.createRng();o.selectNode(a.getBody());var s=e(o);return i===s}a.on("keydown",function(e){var t=e.keyCode,r,i;if(!c(e)&&(t==U||t==V)){if(r=a.selection.isCollapsed(),i=a.getBody(),r&&!q.isEmpty(i))return;if(!r&&!n(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),i.firstChild&&q.isBlock(i.firstChild)?a.selection.setCursorLocation(i.firstChild,0):a.selection.setCursorLocation(i,0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(q.bind(a.getDoc(),"focusin",function(){$.setRng($.getRng())}),q.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getBody().focus(),$.setRng($.getRng()))}))}function h(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===V){if(!a.getBody().getElementsByTagName("hr").length)return;if($.isCollapsed()&&0===$.getRng(!0).startOffset){var t=$.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return q.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(q.remove(n),e.preventDefault())}}})}function m(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&$.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&q.hasClass(e,"mce-item-anchor")&&$.select(e),a.nodeChanged()})}function v(){function e(){var e=q.getAttribs($.getStart().cloneNode(!1));return function(){var t=$.getStart();t!==a.getBody()&&(q.setAttrib(t,"style",null),W(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!$.isCollapsed()&&q.getParent($.getStart(),q.isBlock)!=q.getParent($.getEnd(),q.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),q.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){if(!a.removed){var n=$.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)}},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===V&&$.isCollapsed()&&0===$.getRng(!0).startOffset){var t=$.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),q.addClass(a.getBody(),"mceHideBrInPre"),K.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),G.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){q.bind(a.getBody(),"mouseup",function(){var e,t=$.getNode();"IMG"==t.nodeName&&((e=q.getStyle(t,"width"))&&(q.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),q.setStyle(t,"width","")),(e=q.getStyle(t,"height"))&&(q.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),q.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=$.getRng(),r=n.startContainer,i=n.startOffset,o=q.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=q.createRng(),n.setStart(r,0),n.setEnd(r,0),$.setRng(n))}})}function N(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),j.object_resizing||s("enableObjectResizing",!1)}j.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){W(q.select("a"),function(e){var t=e.parentNode,n=q.getRoot();if(t.lastChild===e){for(;t&&!q.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}q.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function k(){j.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",j.forced_root_block)})}function S(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function T(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=V||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),q.remove(t.item(0)),a.undoManager.add()))})}function R(){var e;l()>=10&&(e="",W("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function A(){l()<9&&(K.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),G.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function B(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),q.unbind(r,"mouseup",n),q.unbind(r,"mousemove",t),a=o=0}var r=q.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,q.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(q.bind(r,"mouseup",n),q.bind(r,"mousemove",t),q.getRoot().focus(),a.select())}})}function D(){a.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||$.normalize()},!0)}function L(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function H(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.getBody().focus(),a.selection.normalize(),a.nodeChanged())}))}function P(){i.mac&&a.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),a.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function O(){s("AutoUrlDetect",!1)}function I(){a.inline||a.on("focus blur beforegetcontent",function(){var e=a.dom.create("br");a.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function F(){a.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function z(){a.on("init",function(){a.dom.bind(a.getBody(),"submit",function(e){e.preventDefault()})})}var W=o.each,V=e.BACKSPACE,U=e.DELETE,q=a.dom,$=a.selection,j=a.settings,K=a.parser,G=a.serializer,Y=i.gecko,X=i.ie,J=i.webkit;_(),d(),D(),J&&(u(),p(),g(),k(),z(),C(),i.iOS?(y(),M(),H(),F()):f()),X&&i.ie<11&&(h(),b(),x(),w(),T(),R(),A(),B()),i.ie>=11&&(H(),I(),C()),i.ie&&(f(),O()),Y&&(h(),m(),v(),N(),E(),S(),L(),P(),C())}}),r(st,[U],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(lt,[st,y,u],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc():e.getBody()}function i(e,t){var n=e.settings.event_root,i=e.editorManager,a=i.eventRootElm||r(e,t);if(n){if(i.rootEvents||(i.rootEvents={},i.on("RemoveEditor",function(){i.activeEditor||(o.unbind(a),delete i.rootEvents)})),i.rootEvents[t])return;a==e.getBody()&&(a=o.select(n)[0],i.eventRootElm=a),i.rootEvents[t]=!0,o.bind(a,t,function(e){for(var n=e.target,r=i.editors,a=r.length;a--;){var s=r[a].getBody();(s===n||o.isChildOf(n,s))&&(r[a].hidden||r[a].fire(t,e))}})}else e.dom.bind(a,t,function(n){e.hidden||e.fire(t,n)})}var o=t.DOM,a={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;n.settings.readonly||"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&n.dom.unbind(r(n,e),e))}};return a=n.extend({},e,a)}),r(ct,[u,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(ut,[y,f,C,x,S,k,L,P,O,I,F,z,W,b,l,ot,w,N,at,d,u,lt,ct],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_){function N(e,t,i){var o=this,a,s;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,o.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},t),r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.isNotDirty=!0,o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new _(o),o.execCommands={},o.queryStateCommands={},o.queryValueCommands={},o.loadedCSS={},o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var E=e.DOM,k=r.ThemeManager,S=r.PluginManager,T=x.extend,R=x.each,A=x.explode,B=x.inArray,D=x.trim,L=x.resolve,M=m.Event,H=C.gecko,P=C.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=h.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}x.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t +}),R(r.plugins.split(/[ ,]/),function(e){if(e=D(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&C.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new g(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=D(n),r&&-1===B(m,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h,m=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=k.get(n.theme),t.theme=new c(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,p=/^[0-9\.]+(|px)$/i,p.test(""+i)&&(i=Math.max(parseInt(i,10),100)),p.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!C.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',h=0;h<t.contentCSS.length;h++){var g=t.contentCSS[h];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+g+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" onload="window.parent.tinymce.get(\''+t.id+"').fire('load');\"><br></body></html>";var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(u=v),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(y){s.src=u=v}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,a=E.get(n.id),p=n.getDoc(),h,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"contentEditable",null)}),E.addClass(a,"mce-content-body"),n.contentDocument=p=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=a,r.content_document=r.content_window=null,r.root_name=a.nodeName.toLowerCase()),h=n.getBody(),h.disabled=!0,r.readonly||(n.inline&&"static"==E.getStyle(h,"position",!0)&&(h.style.position="relative"),h.contentEditable=n.getParam("content_editable_state",!0)),h.disabled=!1,n.schema=new v(r),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:r.content_editable?n.id:null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new y(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"no/type"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,o=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(o)&&(r.empty().append(new i("br",1)).shortEnded=!0)}),n.serializer=new o(r,n),n.selection=new s(n.dom,n.getWin(),n.serializer,n),n.formatter=new l(n),n.undoManager=new c(n),n.forceBlocks=new d(n),n.enterKey=new u(n),n.editorCommands=new f(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(h,"spellcheck","false")),n.fire("PostRender"),n.quirks=b(n),r.directionality&&(h.dir=r.directionality),r.nowrap&&(h.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){R(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m="",R(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&setTimeout(function(){var e=n.editorManager.get(r.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),a=p=h=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(C.opera||n.getBody().focus(),n.getWin().focus()),H||i){if(l=n.getBody(),l.setActive)try{l.setActive()}catch(c){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?L(r):0,n=L(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[D(e[0])]=D(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(e){var t=this,n=t.selection,r,i,o;!t.initialized||t.settings.disable_nodechange||t.settings.readonly||(o=t.getBody(),r=n.getStart()||o,r=P&&r.ownerDocument!=t.getDoc()?t.getBody():r,"IMG"==r.nodeName&&n.isCollapsed()&&(r=r.parentNode),i=[],t.dom.getParent(r,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=r,e.parents=i,t.fire("NodeChange",e))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented())return!1;if((a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0)return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o)return o;if(i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n))return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(i.editorCommands.execCommand(e,t,n))return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{o=i.getDoc().execCommand(e,t,n)}catch(s){}return o?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):!1},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r===!0||r===!1))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(E.show(e.getContainer()),E.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(P&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'<br data-mce-bogus="1">',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):P||(e='<br data-mce-bogus="1">'),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new a({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=D(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?D(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=T({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.save(),e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling),e.inline||(P&&10>P&&e.getDoc().execCommand("SelectAll",!1,null),E.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null,M.unbind(e.getWin()),M.unbind(e.getDoc()));var t=e.getContainer();M.unbind(e.getBody()),M.unbind(t),e.fire("remove"),e.editorManager.remove(e),E.remove(t),e.destroy()}},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&H&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return H?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,w),N}),r(dt,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(ft,[y,d],function(e,t){function n(e){function s(){try{return document.activeElement}catch(e){return document.body}}function l(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function c(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function u(e){return!!a.getParent(e,n.isEditorUIElement)}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&(d.on("nodechange keyup",function(){var e=document.activeElement;e&&e.id==d.id+"_ifr"&&(e=d.getBody()),d.dom.isChildOf(e,d.getBody())&&(d.lastRng=d.selection.getRng())}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},a.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(c(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.activeEditor=d,e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;u(s())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&(n.selection.lastFocusBookmark=l(n.dom,n.lastRng)),u(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},a.bind(document,"focusin",i)),d.inline&&!o&&(o=function(t){var n=e.activeEditor;if(n.inline&&!n.dom.isChildOf(t.target,n.getBody())){var r=n.selection.getRng();r.collapsed||(n.lastRng=r)}},a.bind(document,"mouseup",o))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(a.unbind(document,"selectionchange",r),a.unbind(document,"focusin",i),a.unbind(document,"mouseup",o),r=i=o=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o,a=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(pt,[ut,f,y,W,d,u,st,dt,ft],function(e,t,n,r,i,o,a,s,l){function c(e){var t=v.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return v.activeEditor==e&&(v.activeEditor=t[0]),v.focusedEditor==e&&(v.focusedEditor=null),n}function u(e){return e&&!(e.getContainer()||e.getBody()).parentNode&&(c(e),e.destroy(!0),e=null),e}var d=n.DOM,f=o.explode,p=o.each,h=o.extend,m=0,g,v;return v={$:t,majorVersion:"4",minorVersion:"1.0",releaseDate:"2014-06-18",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=document.location.href,/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),c=0;c<s.length;c++)if(a=s[c].src,/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new l(e)},init:function(t){function n(e){var t=e.id;return t||(t=e.name,t=t&&!d.get(t)?e.name:d.uniqueId(),e.setAttribute("id",t)),t}function r(t,n){if(!u(s.get(t))){var r=new e(t,n,s);l.push(r),r.render()}}function i(e,t,n){var r=e[t];if(r)return r.apply(n||this,Array.prototype.slice.call(arguments,2))}function o(e,t){return t.constructor===RegExp?t.test(e.className):d.hasClass(e,t)}function a(){var u,g;if(d.unbind(window,"ready",a),i(t,"onpageload"),t.types)return void p(t.types,function(e){p(d.select(e.selector),function(i){r(n(i),h({},t,e))})});if(t.selector)return void p(d.select(t.selector),function(e){r(n(e),t)});switch(t.mode){case"exact":u=t.elements||"",u.length>0&&p(f(u),function(n){d.get(n)?(c=new e(n,t,s),l.push(c),c.render()):p(document.forms,function(e){p(e.elements,function(e){e.name===n&&(n="mce_editor_"+m++,d.setAttrib(e,"id",n),r(n,t))})})});break;case"textareas":case"specific_textareas":p(d.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t)})}t.oninit&&(u=g=0,p(l,function(e){g++,e.initialized?u++:e.on("init",function(){u++,u==g&&i(t,"oninit")}),u==g&&i(t,"oninit")}))}var s=this,l=[],c;s.settings=t,d.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),g||(g=function(){t.fire("BeforeUnload")},d.bind(window,"beforeunload",g)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void p(d.select(e),function(e){t.remove(r[e.id])})):(i=e,r[i.id]?(c(i)&&t.fire("RemoveEditor",{editor:i}),r.length||d.unbind(window,"beforeunload",g),i.remove(),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){p(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}},h(v,a),v.setup(),window.tinymce=window.tinyMCE=v,v}),r(ht,[pt,u],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(mt,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(n.withCredentials=!0),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(gt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(vt,[gt,mt,u],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(yt,[y],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(bt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(Ct,[y,l,b,C,u,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(xt,[V,u],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(wt,[xt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(_t,[K,et],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes()+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e._text)+"</div></div>"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Nt,[K,_t],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Et,[Nt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},text:function(e){var t=this;if(t._rendered){var n=t.getEl().lastChild.lastChild;n&&(n.data=t.translate(e))}return t._super(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i;return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+(e._text?(r?"\xa0":"")+e.encode(e._text):"")+"</button></div>" +}})}),r(kt,[X],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[Nt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes()+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e._text)+"</span></div>"}})}),r(Tt,[Nt,G,j],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("combobox"),t.subinput=!0,t.ariaTarget="inp",e=t.settings,e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){for(var r=n.target,i=t.getEl();r&&r!=i;)r.id&&-1!=r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){return e.preventDefault(),t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),e.placeholder&&(t.addClass("placeholder"),t.on("focusin",function(){t._hasOnChange||(n.on(t.getEl("inp"),"change",function(){t.fire("change")}),t._hasOnChange=!0),t.hasClass("placeholder")&&(t.getEl("inp").value="",t.removeClass("placeholder"))}),t.on("focusout",function(){0===t.value().length&&(t.getEl("inp").value=e.placeholder,t.addClass("placeholder"))}))},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-n.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),n.css(t.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){n.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e._text,(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.addClass("has-open")),'<div id="'+t+'" class="'+e.classes()+'"><input id="'+t+'-inp" class="'+r+"textbox "+r+'placeholder" value="'+i+'" hidefocus="1"'+l+" />"+s+"</div>"}})}),r(Rt,[Tt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.icon="none",t._super(e),t.addClass("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){this.getEl().getElementsByTagName("i")[0].style.background=e},value:function(e){var t=this;return"undefined"!=typeof e&&t._rendered&&t.repaintColor(e),t._super(e)}})}),r(At,[Et,nt],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()}})}),r(Bt,[At,y],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'<div id="'+t+'" class="'+e.classes()+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+(e._text?(r?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Dt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=p=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,p=0;break;case 1:d=l,f=s,p=0;break;case 2:d=0,f=s,p=l;break;case 3:d=0,f=l,p=s;break;case 4:d=l,f=0,p=s;break;case 5:d=s,f=0,p=l;break;default:d=f=p=0}d=r(255*(d+c)),f=r(255*(f+c)),p=r(255*(p+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(p)}function s(){return{r:d,g:f,b:p}}function l(){return i(d,f,p)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,p=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),p=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),p=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),p=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,p=0>p?0:p>255?255:p,u}var u=this,d=0,f=0,p=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(Lt,[Nt,J,j,Dt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(p,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,p;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),p=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes()+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Mt,[Nt],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes()+'">'+e._getPathHtml()+"</div>"},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'<div class="'+o+'divider" aria-hidden="true"> '+e.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(n==r-1?" "+o+"last":"")+'" data-index="'+n+'" tabindex="-1" id="'+e._id+"-"+n+'" aria-level="'+n+'">'+t[n].name+"</div>";return i||(i='<div class="'+o+'path-item">\xa0</div>'),i}})}),r(Ht,[Mt,pt],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(Pt,[X],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(Ot,[X,Pt,u],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},recalcLabels:function(){var e=this,t=0,n=[],r,i,o;if(e.settings.labelGapCalc!==!1)for(o="children"==e.settings.labelGapCalc?e.find("formitem"):e.items(),o.filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(It,[Ot],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes()+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Ft,[Tt,u],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),(!s||s[e.filetype])&&(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(zt,[wt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Wt,[wt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,D,L,M,H,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",M="w",D="x",L="innerW",H="minW",O="right",I="deltaW",F="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",M="h",D="y",L="innerH",H="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[E],y=o[P]+h[H]+o[O],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[A]:i[R]-d+i[A],x[H]=_+i[I],x[B]=i[R]-d,x[F]=_,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[E]+h.flex*C,y>b?(d-=h[S]-h[E],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[P],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[E],"center"===s?x[D]=Math.round(i[L]/2-h[M]/2):"stretch"===s?(x[M]=z(h[H]||0,i[L]-o[P]-o[O]),x[D]=o[P]):"end"===s&&(x[D]=i[L]-h[M]-o.top),h.flex>0&&(y+=h.flex*C),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(Vt,[xt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Ut,[K,Nt,nt,u,pt,d],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){r.disabled(!n())})}}function a(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(qt,[wt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,N[d]=k>N[d]?k:N[d],E[f]=S>E[f]?S:E[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),T-=(d>0?y:0)+N[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),R-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var H=T/L;for(d=0;r>d;d++)N[d]+=M?M[d]*H:H;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r($t,[Nt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes()+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(jt,[Nt,j],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'<label id="'+e._id+'" class="'+e.classes()+'"'+(t?' for="'+t+'"':"")+">"+e.encode(e._text)+"</label>"}})}),r(Kt,[X],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e._super()}})}),r(Gt,[Kt],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Yt,[Et,G,Gt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"></i>':"")+"<span>"+(e._text?(i?"\xa0":"")+e.encode(e._text):"")+'</span> <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n<r.length;n++)r[n].innerHTML=(t.settings.icon&&e?"\xa0":"")+t.encode(e);return this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(Xt,[Yt],function(e){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value){o=o||r[a].text,n._value=r[a].value;break}r[a].menu&&t(r[a].menu)}}var n=this,r,i,o,a;n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n._value=r[0].value),e.menu=r),e.text=e.text||o||r[0].text,n._super(e),n.addClass("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){i=e.value()===n,i&&(o=o||e.text()),e.active(i),e.menu&&t(e.menu,n)})}function n(t){for(var r=0;r<t.length;r++)i=t[r].value==e,i&&(o=o||t[r].text),t[r].active=i,t[r].menu&&n(t[r].menu)}var r=this,i,o,a;return"undefined"!=typeof e&&(r.menu?t(r.menu,e):(a=r.settings.menu,n(a)),r.text(o||this.settings.text)),r._super(e)}})}),r(Jt,[Nt,G,d],function(e,t,n){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this;t.hasPopup=!0,t._super(e),e=t.settings,t.addClass("menu-item"),e.menu&&t.addClass("menu-item-expand"),e.preview&&t.addClass("menu-item-preview"),("-"===t._text||"|"===t._text)&&(t.addClass("menu-item-sep"),t.aria("role","separator"),t._text="-"),e.selectable&&(t.aria("role","menuitemcheckbox"),t.addClass("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.addClass("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault() +}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.removeClass("selected")}),r.submenu=!0),r._parentMenu=i,r.addClass("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.removeClass(r._lastRel),r.addClass(o),r._lastRel=o,e.addClass("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e=this,t=e._id,r=e.settings,i=e.classPrefix,o=e.encode(e._text),a=e.settings.icon,s="",l=r.shortcut;return a&&e.parent().addClass("menu-has-icons"),r.image&&(a="none",s=" style=\"background-image: url('"+r.image+"')\""),l&&n.mac&&(l=l.replace(/ctrl\+alt\+/i,"⌥⌘"),l=l.replace(/ctrl\+/i,"⌘"),l=l.replace(/alt\+/i,"⌥"),l=l.replace(/shift\+/i,"⇧")),a=i+"ico "+i+"i-"+(e.settings.icon||"none"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+("-"!==o?'<i class="'+a+'"'+s+"></i>\xa0":"")+("-"!==o?'<span id="'+t+'-text" class="'+i+'text">'+o+"</span>":"")+(l?'<div id="'+t+'-shortcut" class="'+i+'menu-shortcut">'+l+"</div>":"")+(r.menu?'<div class="'+i+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Qt,[nt,Jt,u],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r(Zt,[St],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(en,[Nt,J],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(tn,[Nt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"></div>'}})}),r(nn,[Yt,j],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'<div id="'+t+'" class="'+e.classes()+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(r?'<i class="'+r+'"></i>':"")+(e._text?(r?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(r?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(rn,[Vt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(on,[Z,j],function(e,t){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes()+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(an,[Nt,j],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'<textarea id="'+t+'" class="'+e.classes()+'" '+(n.rows?' rows="'+n.rows+'"':"")+' hidefocus="1"'+i+">"+r+"</textarea>":'<input id="'+t+'" class="'+e.classes()+'" value="'+r+'" hidefocus="1"'+i+" />"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(sn,[j,K],function(e,t){return function(n,r){var i=this,o,a=t.classPrefix;i.show=function(t){return i.hide(),o=!0,window.setTimeout(function(){o&&n.appendChild(e.createFragment('<div class="'+a+"throbber"+(r?" "+a+"throbber-inline":"")+'"></div>'))},t||0),i},i.hide=function(){var e=n.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,i}}}),a([l,c,u,d,f,p,h,m,g,y,b,C,x,w,_,N,E,k,S,T,R,A,D,L,M,P,O,I,F,z,W,V,U,q,$,j,K,G,Y,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Dt,Lt,Mt,Ht,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Gt,Yt,Xt,Jt,Qt,Zt,en,tn,nn,rn,on,an,sn])}(this);
\ No newline at end of file diff --git a/comiccontrol/upload.php b/comiccontrol/upload.php new file mode 100644 index 0000000..c6eaae0 --- /dev/null +++ b/comiccontrol/upload.php @@ -0,0 +1,95 @@ +<? +if(authCheck()){ +ini_set("memory_limit","512M"); +set_time_limit(60); + // make a note of the current working directory, relative to root. +$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); + +// make a note of the directory that will recieve the uploaded file +$uploadsDirectory = '../uploads/'; + +// Now let's deal with the upload + +// check that the file we are working on really was the subject of an HTTP upload +is_uploaded_file($_FILES[$fieldname]['tmp_name']) + or die("Not an uploaded file"); + +// validation... since this is an image upload script we should run a check +// to make sure the uploaded file is in fact an image. Here is a simple check: +// getimagesize() returns false if the file tested is not an image. +getimagesize($_FILES[$fieldname]['tmp_name']) + or die("Not an image"); + +// make a unique filename for the uploaded file and check it is not already +// taken... if it is already taken keep trying until we find a vacant one +// sample filename: 1140732936-filename.jpg +$now = time(); +while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])) +{ + $now++; +} + +$w = 1000; +$h = 10000; + +$source = @imagecreatefromstring( +@file_get_contents($_FILES[$fieldname]['tmp_name'])) +or die('Not a valid image format.'); +$x = imagesx($source); +$y = imagesy($source); +if($x > $w) { + if($y > $h){ + if(($x/$y)<=($w/h)){ + $w = round(($h / $y) * $x); + }else{ + $h = round(($w/$x)*$y); + $w = $x; + } + }else{ + $h = round(($w/$x)*$y); + } +}else{ + if($y > $h){ + $w = round(($h / $y) * $x); + }else{ + $w = $x; + $h = $y; + } +} +$slate = @imagecreatetruecolor($w, $h) +or die("Image too large"); +imagecopyresampled($slate, $source, 0, 0, 0, 0, $w, $h, $x, $y); +@imagejpeg($slate, $uploadFilename, 85) +or error('receiving directory insufficient permission', $uploadForm); +imagedestroy($slate); +imagedestroy($source); + +//do it again for thumb +$now2 = time(); +while(file_exists($uploadFilename = $uploadsDirectory.$now2.'-thumb-'.$_FILES[$fieldname]['name'])) +{ + $now2++; +} +$w = 120; +$h = 120; + +// now let's move the file to its final location and allocate the new filename to it + +$source = @imagecreatefromstring( +@file_get_contents($_FILES[$fieldname]['tmp_name'])) +or die('Not a valid image format.'); +$x = imagesx($source); +$y = imagesy($source); +if($w && ($x < $y)) $w = round(($h / $y) * $x); +else $h = round(($w / $x) * $y); +$slate = @imagecreatetruecolor($w, $h) +or error('Image too large.', $uploadForm); +imagecopyresampled($slate, $source, 0, 0, 0, 0, $w, $h, $x, $y); +@imagejpeg($slate, $uploadFilename, 85) +or error('receiving directory insufficient permission', $uploadForm); +imagedestroy($slate); +imagedestroy($source); +} + + +?>
\ No newline at end of file diff --git a/comiccontrol/viewadstats.php b/comiccontrol/viewadstats.php new file mode 100644 index 0000000..6ce7069 --- /dev/null +++ b/comiccontrol/viewadstats.php @@ -0,0 +1,136 @@ +<? +//viewadstats.php +//view ad stats + +//invoke header +include('includes/header.php'); +?> +<script src="includes/chart.js"></script> +<? +echo '<h2>' . $lang['adstats'] . '</h2>'; +$query = "SELECT * FROM (SELECT * FROM cc_" . $tableprefix . "adstats ORDER BY date DESC LIMIT 30) sub ORDER BY date ASC"; +$labels = ""; +$impdata = ""; +$revdata = ""; +$table = '<table><tr style="font-weight:bold"><td width="270px">' . $lang['date'] . '</td><td width="270px">' . $lang['impressions'] . '</td><td width="270px">' . $lang['estrevenue'] . '</td></tr>'; +$result = $z->query($query); +$commaed = false; +$highestimp = 0; +$highestrev = 0; +while($row=$result->fetch_assoc()){ + $table.="<tr>"; + if($commaed){ + $labels .= ','; + $impdata .= ','; + $revdata .= ','; + } + $labels .= '"' . date("M d",strtotime($row['date'])) . '"'; + $table .= '<td>' . date("M d, Y",strtotime($row['date'])) . '</td>'; + $impdata .= $row['impressions']; + $table .= '<td>' . number_format($row['impressions'],0,".",",") . '</td>'; + if($row['impressions'] > $highestimp) $highestimp = $row['impressions']; + $revdata .= $row['revenue']; + $table .= '<td>$' . number_format($row['revenue'],2,".",",") . '</td>'; + if($row['revenue'] > $highestrev) $highestrev = $row['revenue']; + $commaed = true; + $table.="</tr>"; +} +$impfirst = $highestimp[0] + 1; +$zeroes = strlen($highestimp) - 1; +$y1top = $impfirst; +while(strlen($y1top) < $zeroes){ + $y1top .= "0"; +} +$y1scale = $y1top; +$revfirst = $highestrev[0] + 1; +$zeroes = strlen(floor($highestrev)) - 1; +$y2top = $revfirst; +while(strlen($y2top) < $zeroes){ + $y2top .= "0"; +} +$y2scale = $y2top/10; +$table .= '</table>'; +?> +<canvas id="myChart" width="800" height="600"></canvas> +<script> +function setColor(area,data,config,i,j,animPct,value) +{ + if(value > 35)return("rgba(220,0,0,"+animPct); + else return("rgba(0,220,0,"+animPct); + +} + +var charJSPersonnalDefaultOptions = { decimalSeparator : "," , thousandSeparator : ".", roundNumber : "none", graphTitleFontSize: 2 }; +var startWithDataset =1; +var startWithData =1; +// Get the context of the canvas element we want to select +var data = { + labels: [<?=$labels?>], + datasets: [ + { + title: "<?=$lang['adimpressions']?>", + fillColor : "rgba(150,150,150,0.2)", + strokeColor : "rgba(150,150,150,1)", + pointColor : "rgba(150,150,150,1)", + pointStrokeColor : "#fff", + axis:1, + data: [<?=$impdata?>] + }, + { + title: "<?=$lang['estimatedrevenue']?>", + fillColor : "rgba(151,187,205,0.2)", + strokeColor : "rgba(151,187,205,1)", + pointColor : "rgba(151,187,205,1)", + pointStrokeColor : "#fff", + axis:2, + data: [<?=$revdata?>] + } + ] +}; + +var opt = { + animationStartWithDataset : startWithDataset, + animationStartWithData : startWithData, + graphTitle : "<?=$lang['estadstats']?>", + legend : true, + animationSteps : 50, + canvasBorders : true, + canvasBordersWidth : 3, + canvasBordersColor : "black", + bezierCurve:false, + annotateDisplay : true, + graphTitleFontSize: 24, + scaleFontFamily:"'Verdana','Arial'", + inGraphDataFontFamily:"'Verdana','Arial'", + graphTitleFontFamily: "'Verdana','Arial'", + legendFontFamily: "'Verdana','Arial'", + annotateFontFamily: "'Verdana','Arial'", + crossTextFontFamily: ["'Verdana','Arial'"], + yAxisFontFamily: "'Verdana','Arial'", + xAxisFontFamily: "'Verdana','Arial'", + yAxisUnitFontFamily: "'Verdana','Arial'", + yAxisUnitFontSize:10, + annotateFontSize:10, + yAxisRight : true, + scaleOverride: true, + scaleSteps: 10, + scaleStartValue:0, + scaleStepWidth:<?=$y1scale?>, + scaleOverride2: true, + scaleSteps2: 10, + scaleStartValue2:0, + scaleStepWidth2:<?=$y2scale?>, + yAxisLabel:"<?=$lang['adimpressions']?>", + yAxisUnit:"<?=$lang['impressions']?>", + yAxisUnit2:"<?=$lang['dollars']?>", + yAxisLabel2: "<?=$lang['estrevenue']?>", + canvasBorders:false +} +window.onload = function() { +var myLineChart = new Chart(document.getElementById("myChart").getContext("2d")).Line(data,opt); +} +</script> + +<? +echo $table; +include('includes/footer.php'); ?> diff --git a/comics/.htaccess b/comics/.htaccess new file mode 100644 index 0000000..5a928f6 --- /dev/null +++ b/comics/.htaccess @@ -0,0 +1 @@ +Options -Indexes diff --git a/comicshighres/.htaccess b/comicshighres/.htaccess new file mode 100644 index 0000000..5a928f6 --- /dev/null +++ b/comicshighres/.htaccess @@ -0,0 +1 @@ +Options -Indexes diff --git a/comicsthumbs/.htaccess b/comicsthumbs/.htaccess new file mode 100644 index 0000000..5a928f6 --- /dev/null +++ b/comicsthumbs/.htaccess @@ -0,0 +1 @@ +Options -Indexes diff --git a/custom.php b/custom.php new file mode 100644 index 0000000..9eb92f9 --- /dev/null +++ b/custom.php @@ -0,0 +1,3 @@ +<? + +?>
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..495748b --- /dev/null +++ b/index.php @@ -0,0 +1,34 @@ +<? +//header('X-Frame-Options: sameorigin'); +include('comiccontrol/dbconfig.php'); +include('comiccontrol/initialize.php'); +include('comiccontrol/functions.php'); +include('custom.php'); + + +//include template +if($moduleinfo['customtemplate'] != ""){ + include("templates/" . $moduleinfo['customtemplate']); +}else{ + + switch($moduleinfo['type']){ + case "comic": + include("templates/comicpage.php"); + break; + case "blog": + include("templates/blogpage.php"); + break; + case "gallery": + include("templates/gallerypage.php"); + break; + case "page": + include("templates/page.php"); + break; + case "archive": + include("templates/archive.php"); + break; + } + +} + +?>
\ No newline at end of file @@ -0,0 +1,63 @@ +<? header("Content-Type: application/xml; charset=UTF-8"); + include('comiccontrol/dbconfig.php'); + include('comiccontrol/initialize.php'); + $query = "SELECT * FROM cc_" . $tableprefix . "modules WHERE id='1'"; + $module = fetch($query); + function selfURL() { + $s = empty($_SERVER["HTTPS"]) ? '' + : ($_SERVER["HTTPS"] == "on") ? "s" + : ""; + $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; + $port = ($_SERVER["SERVER_PORT"] == "80") ? "" + : (":".$_SERVER["SERVER_PORT"]); + return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; +} +function strleft($s1, $s2) { + return substr($s1, 0, strpos($s1, $s2)); +} + $str = '<?xml version="1.0" encoding="UTF-8" ?> + <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>' . $module['title'] . '</title> + <atom:link href="' . selfURL() . '" rel="self" type="application/rss+xml" /> + <link>' . $siteroot . '</link> + <description>Latest ' . $module['title'] . ' comics and news</description> + <language>en-us</language>'; + $items = array(); + $query = "SELECT * FROM cc_" . $tableprefix . "comics WHERE comic='" . $module['id'] . "' AND publishtime <= " . time() . " ORDER BY publishtime DESC LIMIT 20"; + $result = $z->query($query); + while($row = $result->fetch_assoc()){ + $str .= '<item><title><![CDATA[' . $module['title'] . ' - ' . html_entity_decode($row['comicname'],ENT_QUOTES) . ']]></title>'; + $desc_data = '<a href="' . $siteroot . $module['slug'] . '/' . $row['slug'] . '">New comic!</a><br />Today\'s News:<br />' . $row['newscontent']; + $desc_data = preg_replace("#(<\s*a\s+[^>]*href\s*=\s*[\"'])(?!http)([^\"'>]+)([\"'>]+)#", $siteroot . '$2$3', $desc_data); + $desc_data = preg_replace("<html>", '', $desc_data); + $desc_data = preg_replace("<body>", '', $desc_data); + $desc_data = preg_replace("</html>", '', $desc_data); + $desc_data = preg_replace("</body>", '', $desc_data); + $dom = new DOMDocument(); + @$dom->loadHTML($desc_data); + + for ($i=0; $i<$dom->getElementsByTagName('img')->length; $i++) { + $encoded = implode("/", array_map("rawurlencode", + explode("/", $dom->getElementsByTagName('img') + ->item($i)->getAttribute('src')))); + + $dom->getElementsByTagName('img') + ->item($i) + ->setAttribute('src',$encoded); + } + $desc_data = $dom->saveHTML(); + $desc_data = str_replace("<html>", '', $desc_data); + $desc_data = str_replace("<body>", '', $desc_data); + $desc_data = str_replace("</html>", '', $desc_data); + $desc_data = str_replace("</body>", '', $desc_data); + $str .= '<description><![CDATA[' . $desc_data . ']]></description>'; + $str .= '<link>' . $siteroot . $module['slug'] . '/' . $row['slug'] . '</link>'; + $str .= '<author>tech@thehiveworks.com</author>'; + $str .= '<pubDate>' . date("D, d M Y H:i:s O", $row['publishtime']) . '</pubDate>'; + $str .= '<guid>' . $siteroot . $module['slug'] . '/' . $row['slug'] . '</guid>'; + $str .= '</item>'; + } + $str .= '</channel></rss>'; + echo $str; +?> diff --git a/uploads/.htaccess b/uploads/.htaccess new file mode 100644 index 0000000..5a928f6 --- /dev/null +++ b/uploads/.htaccess @@ -0,0 +1 @@ +Options -Indexes |