").text(text).html();
},
'activeKeyboard' : function($list){
var that = this;
$list.on('focus', function(){
$(this).addClass('ms-focus');
})
.on('blur', function(){
$(this).removeClass('ms-focus');
})
.on('keydown', function(e){
switch (e.which) {
case 40:
case 38:
e.preventDefault();
e.stopPropagation();
that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
return;
case 37:
case 39:
e.preventDefault();
e.stopPropagation();
that.switchList($list);
return;
case 9:
if(that.$element.is('[tabindex]')){
e.preventDefault();
var tabindex = parseInt(that.$element.attr('tabindex'), 10);
tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
$('[tabindex="'+(tabindex)+'"]').focus();
return;
}else{
if(e.shiftKey){
that.$element.trigger('focus');
}
}
}
if($.inArray(e.which, that.options.keySelect) > -1){
e.preventDefault();
e.stopPropagation();
that.selectHighlighted($list);
return;
}
});
},
'moveHighlight': function($list, direction){
var $elems = $list.find(this.elemsSelector),
$currElem = $elems.filter('.ms-hover'),
$nextElem = null,
elemHeight = $elems.first().outerHeight(),
containerHeight = $list.height(),
containerSelector = '#'+this.$container.prop('id');
$elems.removeClass('ms-hover');
if (direction === 1){ // DOWN
$nextElem = $currElem.nextAll(this.elemsSelector).first();
if ($nextElem.length === 0){
var $optgroupUl = $currElem.parent();
if ($optgroupUl.hasClass('ms-optgroup')){
var $optgroupLi = $optgroupUl.parent(),
$nextOptgroupLi = $optgroupLi.next(':visible');
if ($nextOptgroupLi.length > 0){
$nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
} else {
$nextElem = $elems.first();
}
} else {
$nextElem = $elems.first();
}
}
} else if (direction === -1){ // UP
$nextElem = $currElem.prevAll(this.elemsSelector).first();
if ($nextElem.length === 0){
var $optgroupUl = $currElem.parent();
if ($optgroupUl.hasClass('ms-optgroup')){
var $optgroupLi = $optgroupUl.parent(),
$prevOptgroupLi = $optgroupLi.prev(':visible');
if ($prevOptgroupLi.length > 0){
$nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
} else {
$nextElem = $elems.last();
}
} else {
$nextElem = $elems.last();
}
}
}
if ($nextElem.length > 0){
$nextElem.addClass('ms-hover');
var scrollTo = $list.scrollTop() + $nextElem.position().top -
containerHeight / 2 + elemHeight / 2;
$list.scrollTop(scrollTo);
}
},
'selectHighlighted' : function($list){
var $elems = $list.find(this.elemsSelector),
$highlightedElem = $elems.filter('.ms-hover').first();
if ($highlightedElem.length > 0){
if ($list.parent().hasClass('ms-selectable')){
this.select($highlightedElem.data('ms-value'));
} else {
this.deselect($highlightedElem.data('ms-value'));
}
$elems.removeClass('ms-hover');
}
},
'switchList' : function($list){
$list.blur();
this.$container.find(this.elemsSelector).removeClass('ms-hover');
if ($list.parent().hasClass('ms-selectable')){
this.$selectionUl.focus();
} else {
this.$selectableUl.focus();
}
},
'activeMouse' : function($list){
var that = this;
$('body').on('mouseenter', that.elemsSelector, function(){
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
$(this).addClass('ms-hover');
});
},
'refresh' : function() {
this.destroy();
this.$element.multiSelect(this.options);
},
'destroy' : function(){
$("#ms-"+this.$element.attr("id")).remove();
this.$element.css('position', '').css('left', '')
this.$element.removeData('multiselect');
},
'select' : function(value, method){
if (typeof value === 'string'){ value = [value]; }
var that = this,
ms = this.$element,
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
if (method === 'init'){
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
}
if (selectables.length > 0){
selectables.addClass('ms-selected').hide();
selections.addClass('ms-selected').show();
options.prop('selected', true);
that.$container.find(that.elemsSelector).removeClass('ms-hover');
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
if (selectableOptgroups.length > 0){
selectableOptgroups.each(function(){
var selectablesLi = $(this).find('.ms-elem-selectable');
if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
$(this).find('.ms-optgroup-label').hide();
}
});
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
selectionOptgroups.each(function(){
var selectionsLi = $(this).find('.ms-elem-selection');
if (selectionsLi.filter('.ms-selected').length > 0){
$(this).find('.ms-optgroup-label').show();
}
});
} else {
if (that.options.keepOrder && method !== 'init'){
var selectionLiLast = that.$selectionUl.find('.ms-selected');
if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
selections.insertAfter(selectionLiLast.last());
}
}
}
if (method !== 'init'){
ms.trigger('change');
if (typeof that.options.afterSelect === 'function') {
that.options.afterSelect.call(this, value);
}
}
}
},
'deselect' : function(value){
if (typeof value === 'string'){ value = [value]; }
var that = this,
ms = this.$element,
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
if (selections.length > 0){
selectables.removeClass('ms-selected').show();
selections.removeClass('ms-selected').hide();
options.prop('selected', false);
that.$container.find(that.elemsSelector).removeClass('ms-hover');
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
if (selectableOptgroups.length > 0){
selectableOptgroups.each(function(){
var selectablesLi = $(this).find('.ms-elem-selectable');
if (selectablesLi.filter(':not(.ms-selected)').length > 0){
$(this).find('.ms-optgroup-label').show();
}
});
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
selectionOptgroups.each(function(){
var selectionsLi = $(this).find('.ms-elem-selection');
if (selectionsLi.filter('.ms-selected').length === 0){
$(this).find('.ms-optgroup-label').hide();
}
});
}
ms.trigger('change');
if (typeof that.options.afterDeselect === 'function') {
that.options.afterDeselect.call(this, value);
}
}
},
'select_all' : function(){
var ms = this.$element,
values = ms.val();
ms.find('option:not(":disabled")').prop('selected', true);
this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
this.$selectionUl.find('.ms-optgroup-label').show();
this.$selectableUl.find('.ms-optgroup-label').hide();
this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
this.$selectionUl.focus();
ms.trigger('change');
if (typeof this.options.afterSelect === 'function') {
var selectedValues = $.grep(ms.val(), function(item){
return $.inArray(item, values) < 0;
});
this.options.afterSelect.call(this, selectedValues);
}
},
'deselect_all' : function(){
var ms = this.$element,
values = ms.val();
ms.find('option').prop('selected', false);
this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
this.$selectionUl.find('.ms-optgroup-label').hide();
this.$selectableUl.find('.ms-optgroup-label').show();
this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
this.$selectableUl.focus();
ms.trigger('change');
if (typeof this.options.afterDeselect === 'function') {
this.options.afterDeselect.call(this, values);
}
},
sanitize: function(value){
var hash = 0, i, character;
if (value.length == 0) return hash;
var ls = 0;
for (i = 0, ls = value.length; i < ls; i++) {
character = value.charCodeAt(i);
hash = ((hash<<5)-hash)+character;
hash |= 0; // Convert to 32bit integer
}
return hash;
}
};
/* MULTISELECT PLUGIN DEFINITION
* ======================= */
$.fn.multiSelect = function () {
var option = arguments[0],
args = arguments;
return this.each(function () {
var $this = $(this),
data = $this.data('multiselect'),
options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
if (typeof option === 'string'){
data[option](args[1]);
} else {
data.init();
}
});
};
$.fn.multiSelect.defaults = {
keySelect: [32],
selectableOptgroup: false,
disabledClass : 'disabled',
dblClick : false,
keepOrder: false,
cssClass: ''
};
$.fn.multiSelect.Constructor = MultiSelect;
$.fn.insertAt = function(index, $parent) {
return this.each(function() {
if (index === 0) {
$parent.prepend(this);
} else {
$parent.children().eq(index - 1).after(this);
}
});
}
}(window.jQuery);
================================================
FILE: static/assets/plugins/notifications/notification.css
================================================
.notifyjs-metro-base {
position: relative;
min-height: 52px;
min-width: 250px;
color:#444;
border-radius: 3px;
-webkit-border-radius: 3px;
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.2);
-webkit-animation: dropdownOpen 0.3s ease-out;
-o-animation: dropdownOpen 0.3s ease-out;
animation: dropdownOpen 0.3s ease-out;
}
.notifyjs-metro-base .image {
display: table;
position: absolute;
height: auto;
width: auto;
left: 25px;
top: 50%;
font-size: 24px;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.notifyjs-metro-base .text-wrapper {
display: inline-block;
vertical-align: top;
text-align: left;
margin: 10px 10px 10px 52px;
clear: both;
}
.notifyjs-metro-base .title {
font-size: 15px;
line-height: 20px;
margin-bottom: 5px;
font-weight: bold;
}
.notifyjs-metro-base .text {
font-size: 12px;
font-weight: normal;
max-width: 360px;
vertical-align: middle;
}
.notifyjs-metro-cool {
color: #fafafa !important;
background-color: #4A525F;
border: 1px solid #4A525F;
}
================================================
FILE: static/assets/plugins/notifications/notify-metro.js
================================================
$.notify.addStyle("metro", {
html:
"
",
classes: {
default: {
"color": "#fafafa !important",
"background-color": "#ABB7B7",
"border": "1px solid #ABB7B7"
},
error: {
"color": "#fafafa !important",
"background-color": "#f05050",
"border": "1px solid #ef5350"
},
custom: {
"color": "#fafafa !important",
"background-color": "#5fbeaa",
"border": "1px solid #5fbeaa"
},
success: {
"color": "#fafafa !important",
"background-color": "#81c868",
"border": "1px solid #33b86c"
},
info: {
"color": "#fafafa !important",
"background-color": "#34d3eb",
"border": "1px solid #29b6f6"
},
warning: {
"color": "#fafafa !important",
"background-color": "#ffbd4a",
"border": "1px solid #ffd740"
},
black: {
"color": "#fafafa !important",
"background-color": "#4c5667",
"border": "1px solid #212121"
},
white: {
"background-color": "#e6eaed",
"border": "1px solid #ddd"
}
}
});
================================================
FILE: static/assets/plugins/notifyjs/dist/notify-combined.js
================================================
/** Notify.js - v0.3.1 - 2014/06/29
* http://notifyjs.com/
* Copyright (c) 2014 Jaime Pillora - MIT
*/
(function(window,document,$,undefined) {
'use strict';
var Notification, addStyle, blankFieldName, coreStyle, createElem, defaults, encode, find, findFields, getAnchorElement, getStyle, globalAnchors, hAligns, incr, inherit, insertCSS, mainPositions, opposites, parsePosition, pluginClassName, pluginName, pluginOptions, positions, realign, stylePrefixes, styles, vAligns,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
pluginName = 'notify';
pluginClassName = pluginName + 'js';
blankFieldName = pluginName + "!blank";
positions = {
t: 'top',
m: 'middle',
b: 'bottom',
l: 'left',
c: 'center',
r: 'right'
};
hAligns = ['l', 'c', 'r'];
vAligns = ['t', 'm', 'b'];
mainPositions = ['t', 'b', 'l', 'r'];
opposites = {
t: 'b',
m: null,
b: 't',
l: 'r',
c: null,
r: 'l'
};
parsePosition = function(str) {
var pos;
pos = [];
$.each(str.split(/\W+/), function(i, word) {
var w;
w = word.toLowerCase().charAt(0);
if (positions[w]) {
return pos.push(w);
}
});
return pos;
};
styles = {};
coreStyle = {
name: 'core',
html: "
",
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
};
stylePrefixes = {
"border-radius": ["-webkit-", "-moz-"]
};
getStyle = function(name) {
return styles[name];
};
addStyle = function(name, def) {
var cssText, elem, fields, _ref;
if (!name) {
throw "Missing Style name";
}
if (!def) {
throw "Missing Style definition";
}
if (!def.html) {
throw "Missing Style HTML";
}
if ((_ref = styles[name]) != null ? _ref.cssElem : void 0) {
if (window.console) {
console.warn("" + pluginName + ": overwriting style '" + name + "'");
}
styles[name].cssElem.remove();
}
def.name = name;
styles[name] = def;
cssText = "";
if (def.classes) {
$.each(def.classes, function(className, props) {
cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n";
$.each(props, function(name, val) {
if (stylePrefixes[name]) {
$.each(stylePrefixes[name], function(i, prefix) {
return cssText += " " + prefix + name + ": " + val + ";\n";
});
}
return cssText += " " + name + ": " + val + ";\n";
});
return cssText += "}\n";
});
}
if (def.css) {
cssText += "/* styles for " + def.name + " */\n" + def.css;
}
if (cssText) {
def.cssElem = insertCSS(cssText);
def.cssElem.attr('id', "notify-" + def.name);
}
fields = {};
elem = $(def.html);
findFields('html', elem, fields);
findFields('text', elem, fields);
return def.fields = fields;
};
insertCSS = function(cssText) {
var elem;
elem = createElem("style");
elem.attr('type', 'text/css');
$("head").append(elem);
try {
elem.html(cssText);
} catch (e) {
elem[0].styleSheet.cssText = cssText;
}
return elem;
};
findFields = function(type, elem, fields) {
var attr;
if (type !== 'html') {
type = 'text';
}
attr = "data-notify-" + type;
return find(elem, "[" + attr + "]").each(function() {
var name;
name = $(this).attr(attr);
if (!name) {
name = blankFieldName;
}
return fields[name] = type;
});
};
find = function(elem, selector) {
if (elem.is(selector)) {
return elem;
} else {
return elem.find(selector);
}
};
pluginOptions = {
clickToHide: true,
autoHide: true,
autoHideDelay: 5000,
arrowShow: true,
arrowSize: 5,
breakNewLines: true,
elementPosition: 'bottom',
globalPosition: 'top right',
style: 'bootstrap',
className: 'error',
showAnimation: 'slideDown',
showDuration: 400,
hideAnimation: 'slideUp',
hideDuration: 200,
gap: 5
};
inherit = function(a, b) {
var F;
F = function() {};
F.prototype = a;
return $.extend(true, new F(), b);
};
defaults = function(opts) {
return $.extend(pluginOptions, opts);
};
createElem = function(tag) {
return $("<" + tag + ">" + tag + ">");
};
globalAnchors = {};
getAnchorElement = function(element) {
var radios;
if (element.is('[type=radio]')) {
radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) {
return $(e).attr('name') === element.attr('name');
});
element = radios.first();
}
return element;
};
incr = function(obj, pos, val) {
var opp, temp;
if (typeof val === 'string') {
val = parseInt(val, 10);
} else if (typeof val !== 'number') {
return;
}
if (isNaN(val)) {
return;
}
opp = positions[opposites[pos.charAt(0)]];
temp = pos;
if (obj[opp] !== undefined) {
pos = positions[opp.charAt(0)];
val = -val;
}
if (obj[pos] === undefined) {
obj[pos] = val;
} else {
obj[pos] += val;
}
return null;
};
realign = function(alignment, inner, outer) {
if (alignment === 'l' || alignment === 't') {
return 0;
} else if (alignment === 'c' || alignment === 'm') {
return outer / 2 - inner / 2;
} else if (alignment === 'r' || alignment === 'b') {
return outer - inner;
}
throw "Invalid alignment";
};
encode = function(text) {
encode.e = encode.e || createElem("div");
return encode.e.text(text).html();
};
Notification = (function() {
function Notification(elem, data, options) {
if (typeof options === 'string') {
options = {
className: options
};
}
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
this.loadHTML();
this.wrapper = $(coreStyle.html);
if (this.options.clickToHide) {
this.wrapper.addClass("" + pluginClassName + "-hidable");
}
this.wrapper.data(pluginClassName, this);
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
this.container = this.wrapper.find("." + pluginClassName + "-container");
this.container.append(this.userContainer);
if (elem && elem.length) {
this.elementType = elem.attr('type');
this.originalElement = elem;
this.elem = getAnchorElement(elem);
this.elem.data(pluginClassName, this);
this.elem.before(this.wrapper);
}
this.container.hide();
this.run(data);
}
Notification.prototype.loadHTML = function() {
var style;
style = this.getStyle();
this.userContainer = $(style.html);
return this.userFields = style.fields;
};
Notification.prototype.show = function(show, userCallback) {
var args, callback, elems, fn, hidden,
_this = this;
callback = function() {
if (!show && !_this.elem) {
_this.destroy();
}
if (userCallback) {
return userCallback();
}
};
hidden = this.container.parent().parents(':hidden').length > 0;
elems = this.container.add(this.arrow);
args = [];
if (hidden && show) {
fn = 'show';
} else if (hidden && !show) {
fn = 'hide';
} else if (!hidden && show) {
fn = this.options.showAnimation;
args.push(this.options.showDuration);
} else if (!hidden && !show) {
fn = this.options.hideAnimation;
args.push(this.options.hideDuration);
} else {
return callback();
}
args.push(callback);
return elems[fn].apply(elems, args);
};
Notification.prototype.setGlobalPosition = function() {
var align, anchor, css, key, main, pAlign, pMain, _ref;
_ref = this.getPosition(), pMain = _ref[0], pAlign = _ref[1];
main = positions[pMain];
align = positions[pAlign];
key = pMain + "|" + pAlign;
anchor = globalAnchors[key];
if (!anchor) {
anchor = globalAnchors[key] = createElem("div");
css = {};
css[main] = 0;
if (align === 'middle') {
css.top = '45%';
} else if (align === 'center') {
css.left = '45%';
} else {
css[align] = 0;
}
anchor.css(css).addClass("" + pluginClassName + "-corner");
$("body").append(anchor);
}
return anchor.prepend(this.wrapper);
};
Notification.prototype.setElementPosition = function() {
var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, wrapPos, _i, _j, _len, _len1, _ref;
position = this.getPosition();
pMain = position[0], pAlign = position[1], pArrow = position[2];
elemPos = this.elem.position();
elemH = this.elem.outerHeight();
elemW = this.elem.outerWidth();
elemIH = this.elem.innerHeight();
elemIW = this.elem.innerWidth();
wrapPos = this.wrapper.position();
contH = this.container.height();
contW = this.container.width();
mainFull = positions[pMain];
opp = opposites[pMain];
oppFull = positions[opp];
css = {};
css[oppFull] = pMain === 'b' ? elemH : pMain === 'r' ? elemW : 0;
incr(css, 'top', elemPos.top - wrapPos.top);
incr(css, 'left', elemPos.left - wrapPos.left);
_ref = ['top', 'left'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pos = _ref[_i];
margin = parseInt(this.elem.css("margin-" + pos), 10);
if (margin) {
incr(css, pos, margin);
}
}
gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0));
incr(css, oppFull, gap);
if (!this.options.arrowShow) {
this.arrow.hide();
} else {
arrowSize = this.options.arrowSize;
arrowCss = $.extend({}, css);
arrowColor = this.userContainer.css("border-color") || this.userContainer.css("background-color") || 'white';
for (_j = 0, _len1 = mainPositions.length; _j < _len1; _j++) {
pos = mainPositions[_j];
posFull = positions[pos];
if (pos === opp) {
continue;
}
color = posFull === mainFull ? arrowColor : 'transparent';
arrowCss["border-" + posFull] = "" + arrowSize + "px solid " + color;
}
incr(css, positions[opp], arrowSize);
if (__indexOf.call(mainPositions, pAlign) >= 0) {
incr(arrowCss, positions[pAlign], arrowSize * 2);
}
}
if (__indexOf.call(vAligns, pMain) >= 0) {
incr(css, 'left', realign(pAlign, contW, elemW));
if (arrowCss) {
incr(arrowCss, 'left', realign(pAlign, arrowSize, elemIW));
}
} else if (__indexOf.call(hAligns, pMain) >= 0) {
incr(css, 'top', realign(pAlign, contH, elemH));
if (arrowCss) {
incr(arrowCss, 'top', realign(pAlign, arrowSize, elemIH));
}
}
if (this.container.is(":visible")) {
css.display = 'block';
}
this.container.removeAttr('style').css(css);
if (arrowCss) {
return this.arrow.removeAttr('style').css(arrowCss);
}
};
Notification.prototype.getPosition = function() {
var pos, text, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition);
pos = parsePosition(text);
if (pos.length === 0) {
pos[0] = 'b';
}
if (_ref = pos[0], __indexOf.call(mainPositions, _ref) < 0) {
throw "Must be one of [" + mainPositions + "]";
}
if (pos.length === 1 || ((_ref1 = pos[0], __indexOf.call(vAligns, _ref1) >= 0) && (_ref2 = pos[1], __indexOf.call(hAligns, _ref2) < 0)) || ((_ref3 = pos[0], __indexOf.call(hAligns, _ref3) >= 0) && (_ref4 = pos[1], __indexOf.call(vAligns, _ref4) < 0))) {
pos[1] = (_ref5 = pos[0], __indexOf.call(hAligns, _ref5) >= 0) ? 'm' : 'l';
}
if (pos.length === 2) {
pos[2] = pos[1];
}
return pos;
};
Notification.prototype.getStyle = function(name) {
var style;
if (!name) {
name = this.options.style;
}
if (!name) {
name = 'default';
}
style = styles[name];
if (!style) {
throw "Missing style: " + name;
}
return style;
};
Notification.prototype.updateClasses = function() {
var classes, style;
classes = ['base'];
if ($.isArray(this.options.className)) {
classes = classes.concat(this.options.className);
} else if (this.options.className) {
classes.push(this.options.className);
}
style = this.getStyle();
classes = $.map(classes, function(n) {
return "" + pluginClassName + "-" + style.name + "-" + n;
}).join(' ');
return this.userContainer.attr('class', classes);
};
Notification.prototype.run = function(data, options) {
var d, datas, name, type, value,
_this = this;
if ($.isPlainObject(options)) {
$.extend(this.options, options);
} else if ($.type(options) === 'string') {
this.options.className = options;
}
if (this.container && !data) {
this.show(false);
return;
} else if (!this.container && !data) {
return;
}
datas = {};
if ($.isPlainObject(data)) {
datas = data;
} else {
datas[blankFieldName] = data;
}
for (name in datas) {
d = datas[name];
type = this.userFields[name];
if (!type) {
continue;
}
if (type === 'text') {
d = encode(d);
if (this.options.breakNewLines) {
d = d.replace(/\n/g, '
');
}
}
value = name === blankFieldName ? '' : '=' + name;
find(this.userContainer, "[data-notify-" + type + value + "]").html(d);
}
this.updateClasses();
if (this.elem) {
this.setElementPosition();
} else {
this.setGlobalPosition();
}
this.show(true);
if (this.options.autoHide) {
clearTimeout(this.autohideTimer);
return this.autohideTimer = setTimeout(function() {
return _this.show(false);
}, this.options.autoHideDelay);
}
};
Notification.prototype.destroy = function() {
return this.wrapper.remove();
};
return Notification;
})();
$[pluginName] = function(elem, data, options) {
if ((elem && elem.nodeName) || elem.jquery) {
$(elem)[pluginName](data, options);
} else {
options = data;
data = elem;
new Notification(null, data, options);
}
return elem;
};
$.fn[pluginName] = function(data, options) {
$(this).each(function() {
var inst;
inst = getAnchorElement($(this)).data(pluginClassName);
if (inst) {
return inst.run(data, options);
} else {
return new Notification($(this), data, options);
}
});
return this;
};
$.extend($[pluginName], {
defaults: defaults,
addStyle: addStyle,
pluginOptions: pluginOptions,
getStyle: getStyle,
insertCSS: insertCSS
});
$(function() {
insertCSS(coreStyle.css).attr('id', 'core-notify');
$(document).on('click', "." + pluginClassName + "-hidable", function(e) {
return $(this).trigger('notify-hide');
});
return $(document).on('notify-hide', "." + pluginClassName + "-wrapper", function(e) {
var _ref;
return (_ref = $(this).data(pluginClassName)) != null ? _ref.show(false) : void 0;
});
});
}(window,document,jQuery));
$.notify.addStyle("bootstrap", {
html: "
",
classes: {
base: {
"font-weight": "bold",
"padding": "8px 15px 8px 14px",
"text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
"background-color": "#fcf8e3",
"border": "1px solid #fbeed5",
"border-radius": "4px",
"white-space": "nowrap",
"padding-left": "25px",
"background-repeat": "no-repeat",
"background-position": "3px 7px"
},
error: {
"color": "#B94A48",
"background-color": "#F2DEDE",
"border-color": "#EED3D7",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
},
success: {
"color": "#468847",
"background-color": "#DFF0D8",
"border-color": "#D6E9C6",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
},
info: {
"color": "#3A87AD",
"background-color": "#D9EDF7",
"border-color": "#BCE8F1",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
},
warn: {
"color": "#C09853",
"background-color": "#FCF8E3",
"border-color": "#FBEED5",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
}
}
});
================================================
FILE: static/assets/plugins/notifyjs/dist/notify.js
================================================
/** Notify.js - v0.3.1 - 2014/06/29
* http://notifyjs.com/
* Copyright (c) 2014 Jaime Pillora - MIT
*/
(function(window,document,$,undefined) {
'use strict';
var Notification, addStyle, blankFieldName, coreStyle, createElem, defaults, encode, find, findFields, getAnchorElement, getStyle, globalAnchors, hAligns, incr, inherit, insertCSS, mainPositions, opposites, parsePosition, pluginClassName, pluginName, pluginOptions, positions, realign, stylePrefixes, styles, vAligns,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
pluginName = 'notify';
pluginClassName = pluginName + 'js';
blankFieldName = pluginName + "!blank";
positions = {
t: 'top',
m: 'middle',
b: 'bottom',
l: 'left',
c: 'center',
r: 'right'
};
hAligns = ['l', 'c', 'r'];
vAligns = ['t', 'm', 'b'];
mainPositions = ['t', 'b', 'l', 'r'];
opposites = {
t: 'b',
m: null,
b: 't',
l: 'r',
c: null,
r: 'l'
};
parsePosition = function(str) {
var pos;
pos = [];
$.each(str.split(/\W+/), function(i, word) {
var w;
w = word.toLowerCase().charAt(0);
if (positions[w]) {
return pos.push(w);
}
});
return pos;
};
styles = {};
coreStyle = {
name: 'core',
html: "
",
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
};
stylePrefixes = {
"border-radius": ["-webkit-", "-moz-"]
};
getStyle = function(name) {
return styles[name];
};
addStyle = function(name, def) {
var cssText, elem, fields, _ref;
if (!name) {
throw "Missing Style name";
}
if (!def) {
throw "Missing Style definition";
}
if (!def.html) {
throw "Missing Style HTML";
}
if ((_ref = styles[name]) != null ? _ref.cssElem : void 0) {
if (window.console) {
console.warn("" + pluginName + ": overwriting style '" + name + "'");
}
styles[name].cssElem.remove();
}
def.name = name;
styles[name] = def;
cssText = "";
if (def.classes) {
$.each(def.classes, function(className, props) {
cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n";
$.each(props, function(name, val) {
if (stylePrefixes[name]) {
$.each(stylePrefixes[name], function(i, prefix) {
return cssText += " " + prefix + name + ": " + val + ";\n";
});
}
return cssText += " " + name + ": " + val + ";\n";
});
return cssText += "}\n";
});
}
if (def.css) {
cssText += "/* styles for " + def.name + " */\n" + def.css;
}
if (cssText) {
def.cssElem = insertCSS(cssText);
def.cssElem.attr('id', "notify-" + def.name);
}
fields = {};
elem = $(def.html);
findFields('html', elem, fields);
findFields('text', elem, fields);
return def.fields = fields;
};
insertCSS = function(cssText) {
var elem;
elem = createElem("style");
elem.attr('type', 'text/css');
$("head").append(elem);
try {
elem.html(cssText);
} catch (e) {
elem[0].styleSheet.cssText = cssText;
}
return elem;
};
findFields = function(type, elem, fields) {
var attr;
if (type !== 'html') {
type = 'text';
}
attr = "data-notify-" + type;
return find(elem, "[" + attr + "]").each(function() {
var name;
name = $(this).attr(attr);
if (!name) {
name = blankFieldName;
}
return fields[name] = type;
});
};
find = function(elem, selector) {
if (elem.is(selector)) {
return elem;
} else {
return elem.find(selector);
}
};
pluginOptions = {
clickToHide: true,
autoHide: true,
autoHideDelay: 5000,
arrowShow: true,
arrowSize: 5,
breakNewLines: true,
elementPosition: 'bottom',
globalPosition: 'top right',
style: 'bootstrap',
className: 'error',
showAnimation: 'slideDown',
showDuration: 400,
hideAnimation: 'slideUp',
hideDuration: 200,
gap: 5
};
inherit = function(a, b) {
var F;
F = function() {};
F.prototype = a;
return $.extend(true, new F(), b);
};
defaults = function(opts) {
return $.extend(pluginOptions, opts);
};
createElem = function(tag) {
return $("<" + tag + ">" + tag + ">");
};
globalAnchors = {};
getAnchorElement = function(element) {
var radios;
if (element.is('[type=radio]')) {
radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) {
return $(e).attr('name') === element.attr('name');
});
element = radios.first();
}
return element;
};
incr = function(obj, pos, val) {
var opp, temp;
if (typeof val === 'string') {
val = parseInt(val, 10);
} else if (typeof val !== 'number') {
return;
}
if (isNaN(val)) {
return;
}
opp = positions[opposites[pos.charAt(0)]];
temp = pos;
if (obj[opp] !== undefined) {
pos = positions[opp.charAt(0)];
val = -val;
}
if (obj[pos] === undefined) {
obj[pos] = val;
} else {
obj[pos] += val;
}
return null;
};
realign = function(alignment, inner, outer) {
if (alignment === 'l' || alignment === 't') {
return 0;
} else if (alignment === 'c' || alignment === 'm') {
return outer / 2 - inner / 2;
} else if (alignment === 'r' || alignment === 'b') {
return outer - inner;
}
throw "Invalid alignment";
};
encode = function(text) {
encode.e = encode.e || createElem("div");
return encode.e.text(text).html();
};
Notification = (function() {
function Notification(elem, data, options) {
if (typeof options === 'string') {
options = {
className: options
};
}
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
this.loadHTML();
this.wrapper = $(coreStyle.html);
if (this.options.clickToHide) {
this.wrapper.addClass("" + pluginClassName + "-hidable");
}
this.wrapper.data(pluginClassName, this);
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
this.container = this.wrapper.find("." + pluginClassName + "-container");
this.container.append(this.userContainer);
if (elem && elem.length) {
this.elementType = elem.attr('type');
this.originalElement = elem;
this.elem = getAnchorElement(elem);
this.elem.data(pluginClassName, this);
this.elem.before(this.wrapper);
}
this.container.hide();
this.run(data);
}
Notification.prototype.loadHTML = function() {
var style;
style = this.getStyle();
this.userContainer = $(style.html);
return this.userFields = style.fields;
};
Notification.prototype.show = function(show, userCallback) {
var args, callback, elems, fn, hidden,
_this = this;
callback = function() {
if (!show && !_this.elem) {
_this.destroy();
}
if (userCallback) {
return userCallback();
}
};
hidden = this.container.parent().parents(':hidden').length > 0;
elems = this.container.add(this.arrow);
args = [];
if (hidden && show) {
fn = 'show';
} else if (hidden && !show) {
fn = 'hide';
} else if (!hidden && show) {
fn = this.options.showAnimation;
args.push(this.options.showDuration);
} else if (!hidden && !show) {
fn = this.options.hideAnimation;
args.push(this.options.hideDuration);
} else {
return callback();
}
args.push(callback);
return elems[fn].apply(elems, args);
};
Notification.prototype.setGlobalPosition = function() {
var align, anchor, css, key, main, pAlign, pMain, _ref;
_ref = this.getPosition(), pMain = _ref[0], pAlign = _ref[1];
main = positions[pMain];
align = positions[pAlign];
key = pMain + "|" + pAlign;
anchor = globalAnchors[key];
if (!anchor) {
anchor = globalAnchors[key] = createElem("div");
css = {};
css[main] = 0;
if (align === 'middle') {
css.top = '45%';
} else if (align === 'center') {
css.left = '45%';
} else {
css[align] = 0;
}
anchor.css(css).addClass("" + pluginClassName + "-corner");
$("body").append(anchor);
}
return anchor.prepend(this.wrapper);
};
Notification.prototype.setElementPosition = function() {
var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, wrapPos, _i, _j, _len, _len1, _ref;
position = this.getPosition();
pMain = position[0], pAlign = position[1], pArrow = position[2];
elemPos = this.elem.position();
elemH = this.elem.outerHeight();
elemW = this.elem.outerWidth();
elemIH = this.elem.innerHeight();
elemIW = this.elem.innerWidth();
wrapPos = this.wrapper.position();
contH = this.container.height();
contW = this.container.width();
mainFull = positions[pMain];
opp = opposites[pMain];
oppFull = positions[opp];
css = {};
css[oppFull] = pMain === 'b' ? elemH : pMain === 'r' ? elemW : 0;
incr(css, 'top', elemPos.top - wrapPos.top);
incr(css, 'left', elemPos.left - wrapPos.left);
_ref = ['top', 'left'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pos = _ref[_i];
margin = parseInt(this.elem.css("margin-" + pos), 10);
if (margin) {
incr(css, pos, margin);
}
}
gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0));
incr(css, oppFull, gap);
if (!this.options.arrowShow) {
this.arrow.hide();
} else {
arrowSize = this.options.arrowSize;
arrowCss = $.extend({}, css);
arrowColor = this.userContainer.css("border-color") || this.userContainer.css("background-color") || 'white';
for (_j = 0, _len1 = mainPositions.length; _j < _len1; _j++) {
pos = mainPositions[_j];
posFull = positions[pos];
if (pos === opp) {
continue;
}
color = posFull === mainFull ? arrowColor : 'transparent';
arrowCss["border-" + posFull] = "" + arrowSize + "px solid " + color;
}
incr(css, positions[opp], arrowSize);
if (__indexOf.call(mainPositions, pAlign) >= 0) {
incr(arrowCss, positions[pAlign], arrowSize * 2);
}
}
if (__indexOf.call(vAligns, pMain) >= 0) {
incr(css, 'left', realign(pAlign, contW, elemW));
if (arrowCss) {
incr(arrowCss, 'left', realign(pAlign, arrowSize, elemIW));
}
} else if (__indexOf.call(hAligns, pMain) >= 0) {
incr(css, 'top', realign(pAlign, contH, elemH));
if (arrowCss) {
incr(arrowCss, 'top', realign(pAlign, arrowSize, elemIH));
}
}
if (this.container.is(":visible")) {
css.display = 'block';
}
this.container.removeAttr('style').css(css);
if (arrowCss) {
return this.arrow.removeAttr('style').css(arrowCss);
}
};
Notification.prototype.getPosition = function() {
var pos, text, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition);
pos = parsePosition(text);
if (pos.length === 0) {
pos[0] = 'b';
}
if (_ref = pos[0], __indexOf.call(mainPositions, _ref) < 0) {
throw "Must be one of [" + mainPositions + "]";
}
if (pos.length === 1 || ((_ref1 = pos[0], __indexOf.call(vAligns, _ref1) >= 0) && (_ref2 = pos[1], __indexOf.call(hAligns, _ref2) < 0)) || ((_ref3 = pos[0], __indexOf.call(hAligns, _ref3) >= 0) && (_ref4 = pos[1], __indexOf.call(vAligns, _ref4) < 0))) {
pos[1] = (_ref5 = pos[0], __indexOf.call(hAligns, _ref5) >= 0) ? 'm' : 'l';
}
if (pos.length === 2) {
pos[2] = pos[1];
}
return pos;
};
Notification.prototype.getStyle = function(name) {
var style;
if (!name) {
name = this.options.style;
}
if (!name) {
name = 'default';
}
style = styles[name];
if (!style) {
throw "Missing style: " + name;
}
return style;
};
Notification.prototype.updateClasses = function() {
var classes, style;
classes = ['base'];
if ($.isArray(this.options.className)) {
classes = classes.concat(this.options.className);
} else if (this.options.className) {
classes.push(this.options.className);
}
style = this.getStyle();
classes = $.map(classes, function(n) {
return "" + pluginClassName + "-" + style.name + "-" + n;
}).join(' ');
return this.userContainer.attr('class', classes);
};
Notification.prototype.run = function(data, options) {
var d, datas, name, type, value,
_this = this;
if ($.isPlainObject(options)) {
$.extend(this.options, options);
} else if ($.type(options) === 'string') {
this.options.className = options;
}
if (this.container && !data) {
this.show(false);
return;
} else if (!this.container && !data) {
return;
}
datas = {};
if ($.isPlainObject(data)) {
datas = data;
} else {
datas[blankFieldName] = data;
}
for (name in datas) {
d = datas[name];
type = this.userFields[name];
if (!type) {
continue;
}
if (type === 'text') {
d = encode(d);
if (this.options.breakNewLines) {
d = d.replace(/\n/g, '
');
}
}
value = name === blankFieldName ? '' : '=' + name;
find(this.userContainer, "[data-notify-" + type + value + "]").html(d);
}
this.updateClasses();
if (this.elem) {
this.setElementPosition();
} else {
this.setGlobalPosition();
}
this.show(true);
if (this.options.autoHide) {
clearTimeout(this.autohideTimer);
return this.autohideTimer = setTimeout(function() {
return _this.show(false);
}, this.options.autoHideDelay);
}
};
Notification.prototype.destroy = function() {
return this.wrapper.remove();
};
return Notification;
})();
$[pluginName] = function(elem, data, options) {
if ((elem && elem.nodeName) || elem.jquery) {
$(elem)[pluginName](data, options);
} else {
options = data;
data = elem;
new Notification(null, data, options);
}
return elem;
};
$.fn[pluginName] = function(data, options) {
$(this).each(function() {
var inst;
inst = getAnchorElement($(this)).data(pluginClassName);
if (inst) {
return inst.run(data, options);
} else {
return new Notification($(this), data, options);
}
});
return this;
};
$.extend($[pluginName], {
defaults: defaults,
addStyle: addStyle,
pluginOptions: pluginOptions,
getStyle: getStyle,
insertCSS: insertCSS
});
$(function() {
insertCSS(coreStyle.css).attr('id', 'core-notify');
$(document).on('click', "." + pluginClassName + "-hidable", function(e) {
return $(this).trigger('notify-hide');
});
return $(document).on('notify-hide', "." + pluginClassName + "-wrapper", function(e) {
var _ref;
return (_ref = $(this).data(pluginClassName)) != null ? _ref.show(false) : void 0;
});
});
}(window,document,jQuery));
================================================
FILE: static/assets/plugins/notifyjs/dist/styles/bootstrap/notify-bootstrap.js
================================================
$.notify.addStyle("bootstrap", {
html: "
",
classes: {
base: {
"font-weight": "bold",
"padding": "8px 15px 8px 14px",
"text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
"background-color": "#fcf8e3",
"border": "1px solid #fbeed5",
"border-radius": "4px",
"white-space": "nowrap",
"padding-left": "25px",
"background-repeat": "no-repeat",
"background-position": "3px 7px"
},
error: {
"color": "#B94A48",
"background-color": "#F2DEDE",
"border-color": "#EED3D7",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
},
success: {
"color": "#468847",
"background-color": "#DFF0D8",
"border-color": "#D6E9C6",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
},
info: {
"color": "#3A87AD",
"background-color": "#D9EDF7",
"border-color": "#BCE8F1",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
},
warn: {
"color": "#C09853",
"background-color": "#FCF8E3",
"border-color": "#FBEED5",
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
}
}
});
================================================
FILE: static/assets/plugins/notifyjs/dist/styles/metro/notify-metro.css
================================================
.notifyjs-metro-base {
position: relative;
min-height: 52px;
color:#444;
}
.notifyjs-metro-base .image {
display: table;
position: absolute;
height: auto;
width: auto;
left: 25px;
top: 50%;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.notifyjs-metro-base .text-wrapper {
display: inline-block;
vertical-align: top;
text-align: left;
margin: 10px 10px 10px 52px;
clear: both;
font-family: 'Segoe UI';
}
.notifyjs-metro-base .title {
font-size: 15px;
font-weight: bold;
}
.notifyjs-metro-base .text {
font-size: 12px;
font-weight: normal;
vertical-align: middle;
}
================================================
FILE: static/assets/plugins/notifyjs/dist/styles/metro/notify-metro.js
================================================
$.notify.addStyle("metro", {
html:
"
",
classes: {
error: {
"color": "#fafafa !important",
"background-color": "#F71919",
"border": "1px solid #FF0026"
},
success: {
"background-color": "#32CD32",
"border": "1px solid #4DB149"
},
info: {
"color": "#fafafa !important",
"background-color": "#1E90FF",
"border": "1px solid #1E90FF"
},
warning: {
"background-color": "#FAFA47",
"border": "1px solid #EEEE45"
},
black: {
"color": "#fafafa !important",
"background-color": "#333",
"border": "1px solid #000"
},
white: {
"background-color": "#f1f1f1",
"border": "1px solid #ddd"
}
}
});
================================================
FILE: static/assets/plugins/notifyjs/src/notify.coffee
================================================
'use strict'
#plugin constants
pluginName = 'notify'
pluginClassName = pluginName+'js'
blankFieldName = pluginName+"!blank"
# ================================
# POSITIONING
# ================================
positions =
t: 'top'
m: 'middle'
b: 'bottom'
l: 'left'
c: 'center'
r: 'right'
hAligns = ['l','c','r']
vAligns = ['t','m','b']
mainPositions = ['t','b','l','r']
#positions mapped to opposites
opposites =
t: 'b'
m: null
b: 't'
l: 'r'
c: null
r: 'l'
parsePosition = (str) ->
pos = []
$.each str.split(/\W+/), (i,word) ->
w = word.toLowerCase().charAt(0)
pos.push w if positions[w]
pos
# ================================
# STYLES
# ================================
styles = {}
coreStyle =
name: 'core'
html: """
# .#{pluginClassName}-debug {
# position: absolute;
# border: 3px solid red;
# height: 0;
# width: 0;
# }
css: """
.#{pluginClassName}-corner {
position: fixed;
margin: 5px;
z-index: 1050;
}
.#{pluginClassName}-corner .#{pluginClassName}-wrapper,
.#{pluginClassName}-corner .#{pluginClassName}-container {
position: relative;
display: block;
height: inherit;
width: inherit;
margin: 3px;
}
.#{pluginClassName}-wrapper {
z-index: 1;
position: absolute;
display: inline-block;
height: 0;
width: 0;
}
.#{pluginClassName}-container {
display: none;
z-index: 1;
position: absolute;
}
.#{pluginClassName}-hidable {
cursor: pointer;
}
[data-notify-text],[data-notify-html] {
position: relative;
}
.#{pluginClassName}-arrow {
position: absolute;
z-index: 2;
width: 0;
height: 0;
}
"""
stylePrefixes =
"border-radius": ["-webkit-", "-moz-"]
getStyle = (name) ->
styles[name]
addStyle = (name, def) ->
unless name
throw "Missing Style name"
unless def
throw "Missing Style definition"
unless def.html
throw "Missing Style HTML"
if styles[name]?.cssElem
if window.console
console.warn "#{pluginName}: overwriting style '#{name}'"
styles[name].cssElem.remove()
def.name = name
styles[name] = def
cssText = ""
if def.classes
$.each def.classes, (className, props) ->
cssText += ".#{pluginClassName}-#{def.name}-#{className} {\n"
$.each props, (name, val) ->
#vendor prefixes
if stylePrefixes[name]
$.each stylePrefixes[name], (i, prefix) ->
cssText += " #{prefix}#{name}: #{val};\n"
#add prop
cssText += " #{name}: #{val};\n"
cssText += "}\n"
if def.css
cssText += """
/* styles for #{def.name} */
#{def.css}
"""
if cssText
def.cssElem = insertCSS cssText
def.cssElem.attr('id', "notify-#{def.name}")
#precompute usable text fields
fields = {}
elem = $(def.html)
findFields 'html', elem, fields
findFields 'text', elem, fields
def.fields = fields
insertCSS = (cssText) ->
elem = createElem("style")
elem.attr 'type', 'text/css'
$("head").append elem
try
elem.html cssText
catch e #ie fix
elem[0].styleSheet.cssText = cssText
elem
# style.html helper
findFields = (type, elem, fields) ->
type = 'text' if type isnt 'html'
attr = "data-notify-#{type}"
find(elem,"[#{attr}]").each ->
name = $(@).attr attr
name = blankFieldName unless name
fields[name] = type
find = (elem, selector) ->
if elem.is(selector) then elem else elem.find selector
# ================================
# OPTIONS
# ================================
#overridable options
pluginOptions =
clickToHide: true
autoHide: true
autoHideDelay: 5000
arrowShow: true
arrowSize: 5
breakNewLines: true
# autoReposition: true
elementPosition: 'bottom'
globalPosition: 'top right'
style: 'bootstrap'
className: 'error'
showAnimation: 'slideDown'
showDuration: 400
hideAnimation: 'slideUp'
hideDuration: 200
gap: 5
inherit = (a, b) ->
F = () ->
F.prototype = a
$.extend true, new F(), b
defaults = (opts) ->
$.extend pluginOptions, opts
# ================================
# DOM MANIPULATION
# ================================
# plugin helpers
createElem = (tag) ->
$ "<#{tag}>#{tag}>"
# references to global anchor positions
globalAnchors = {}
#gets first on n radios, and gets the fancy stylised input for hidden inputs
getAnchorElement = (element) ->
#choose the first of n radios
if element.is('[type=radio]')
radios = element.parents('form:first').find('[type=radio]').filter (i, e) ->
$(e).attr('name') is element.attr('name')
element = radios.first()
#custom-styled inputs - find thier real element
element
incr = (obj, pos, val) ->
# console.log "incr ---- #{pos} #{val} (#{typeof val})"
if typeof val is 'string'
val = parseInt val, 10
else if typeof val isnt 'number'
return
return if isNaN val
opp = positions[opposites[pos.charAt(0)]]
temp = pos
#use the opposite if exists
if obj[opp] isnt `undefined`
pos = positions[opp.charAt(0)]
val = -val
if obj[pos] is `undefined`
obj[pos] = val
else
obj[pos] += val
null
realign = (alignment, inner, outer) ->
return if alignment in ['l','t']
0
else if alignment in ['c','m']
outer/2 - inner/2
else if alignment in ['r','b']
outer - inner
throw "Invalid alignment"
encode = (text) ->
encode.e = encode.e or createElem "div"
encode.e.text(text).html()
# ================================
# NOTIFY CLASS
# ================================
#define plugin
class Notification
#setup instance variables
constructor: (elem, data, options) ->
options = {className: options} if typeof options is 'string'
@options = inherit pluginOptions, if $.isPlainObject(options) then options else {}
#load style html into @userContainer
@loadHTML()
@wrapper = $(coreStyle.html)
@wrapper.addClass "#{pluginClassName}-hidable" if @options.clickToHide
@wrapper.data pluginClassName, @
@arrow = @wrapper.find ".#{pluginClassName}-arrow"
@container = @wrapper.find ".#{pluginClassName}-container"
@container.append @userContainer
if elem and elem.length
@elementType = elem.attr('type')
@originalElement = elem
@elem = getAnchorElement(elem)
@elem.data pluginClassName, @
# add into dom above elem
@elem.before @wrapper
@container.hide()
@run(data)
loadHTML: ->
style = @getStyle()
@userContainer = $(style.html)
@userFields = style.fields
show: (show, userCallback) ->
callback = =>
@destroy() if not show and not @elem
userCallback() if userCallback
hidden = @container.parent().parents(':hidden').length > 0
elems = @container.add @arrow
args = []
if hidden and show
fn = 'show'
else if hidden and not show
fn = 'hide'
else if not hidden and show
fn = @options.showAnimation
args.push @options.showDuration
else if not hidden and not show
fn = @options.hideAnimation
args.push @options.hideDuration
else
return callback()
args.push callback
elems[fn].apply elems, args
setGlobalPosition: () ->
[pMain, pAlign] = @getPosition()
main = positions[pMain]
align = positions[pAlign]
key = pMain+"|"+pAlign
anchor = globalAnchors[key]
unless anchor
anchor = globalAnchors[key] = createElem("div")
css = {}
css[main] = 0
if align is 'middle'
css.top = '45%'
else if align is 'center'
css.left = '45%'
else
css[align] = 0
anchor.css(css).addClass("#{pluginClassName}-corner")
$("body").append anchor
anchor.prepend @wrapper
setElementPosition: () ->
position = @getPosition()
[pMain, pAlign, pArrow] = position
#grab some dimensions
elemPos = @elem.position()
elemH = @elem.outerHeight()
elemW = @elem.outerWidth()
elemIH = @elem.innerHeight()
elemIW = @elem.innerWidth()
wrapPos = @wrapper.position()
contH = @container.height()
contW = @container.width()
#start calculations
mainFull = positions[pMain]
opp = opposites[pMain]
oppFull = positions[opp]
#initial positioning
css = {}
css[oppFull] = if pMain is 'b'
elemH
else if pMain is 'r'
elemW
else
0
#correct for elem-wrapper offset
# unless navigator.userAgent.match /MSIE/
incr css, 'top', elemPos.top - wrapPos.top
incr css, 'left', elemPos.left - wrapPos.left
#correct for margins
for pos in ['top', 'left']
margin = parseInt @elem.css("margin-#{pos}"), 10
incr css, pos, margin if margin
#correct for paddings (only for inline)
# if /^inline/.test @elem.css('display')
# padding = parseInt @elem.css("padding-#{pos}"), 10
# incr css, pos, -padding if padding
#add gap
gap = Math.max 0, @options.gap - if @options.arrowShow then arrowSize else 0
incr css, oppFull, gap
#calculate arrow
if not @options.arrowShow
@arrow.hide()
else
arrowSize = @options.arrowSize
arrowCss = $.extend {}, css
arrowColor = @userContainer.css("border-color") or
@userContainer.css("background-color") or
'white'
#build arrow
for pos in mainPositions
posFull = positions[pos]
continue if pos is opp
color = if posFull is mainFull then arrowColor else 'transparent'
arrowCss["border-#{posFull}"] = "#{arrowSize}px solid #{color}"
#add some room for the arrow
incr css, positions[opp], arrowSize
incr arrowCss, positions[pAlign], arrowSize*2 if pAlign in mainPositions
#calculate container alignment
if pMain in vAligns
incr css, 'left', realign(pAlign, contW, elemW)
incr arrowCss, 'left', realign(pAlign, arrowSize, elemIW) if arrowCss
else if pMain in hAligns
incr css, 'top', realign(pAlign, contH, elemH)
incr arrowCss, 'top', realign(pAlign, arrowSize, elemIH) if arrowCss
css.display = 'block' if @container.is(":visible")
#apply css
@container.removeAttr('style').css css
@arrow.removeAttr('style').css(arrowCss) if arrowCss
getPosition: ->
text = @options.position or if @elem then @options.elementPosition else @options.globalPosition
pos = parsePosition text
#validate position
pos[0] = 'b' if pos.length is 0
if pos[0] not in mainPositions
throw "Must be one of [#{mainPositions}]"
#validate alignment
if pos.length is 1 or
(pos[0] in vAligns and pos[1] not in hAligns) or
(pos[0] in hAligns and pos[1] not in vAligns)
pos[1] = if pos[0] in hAligns then 'm' else 'l'
if pos.length is 2
pos[2] = pos[1]
return pos
getStyle: (name) ->
name = @options.style unless name
name = 'default' unless name
style = styles[name]
throw "Missing style: #{name}"unless style
style
updateClasses: ->
classes = ['base']
if $.isArray @options.className
classes = classes.concat @options.className
else if @options.className
classes.push @options.className
style = @getStyle()
classes = $.map(classes, (n) -> "#{pluginClassName}-#{style.name}-#{n}").join ' '
@userContainer.attr 'class', classes
#run plugin
run: (data, options) ->
#update options
if $.isPlainObject(options)
$.extend @options, options
#shortcut special case
else if $.type(options) is 'string'
@options.className = options
if @container and not data
@show false
return
else if not @container and not data
return
datas = {}
if $.isPlainObject data
datas = data
else
datas[blankFieldName] = data
for name, d of datas
type = @userFields[name]
continue unless type
if type is 'text'
#escape
d = encode(d)
d = d.replace(/\n/g,'
') if @options.breakNewLines
#update content
value = if name is blankFieldName then '' else '='+name
find(@userContainer,"[data-notify-#{type}#{value}]").html(d)
#set styles
@updateClasses()
#positioning
if @elem
@setElementPosition()
else
@setGlobalPosition()
@show true
#autohide
if @options.autoHide
clearTimeout @autohideTimer
@autohideTimer = setTimeout =>
@show false
, @options.autoHideDelay
destroy: ->
@wrapper.remove()
# ================================
# API
# ================================
# $.pluginName( { ... } ) changes options for all instances
$[pluginName] = (elem, data, options) ->
if (elem and elem.nodeName) or elem.jquery
$(elem)[pluginName](data, options)
else
options = data
data = elem
new Notification null, data, options
elem
# $( ... ).pluginName( { .. } ) creates a cached instance on each
$.fn[pluginName] = (data, options) ->
$(@).each ->
inst = getAnchorElement($(@)).data(pluginClassName)
if inst
inst.run data, options
else
new Notification $(@), data, options
@
#extra methods
$.extend $[pluginName], { defaults, addStyle, pluginOptions, getStyle, insertCSS }
#when ready
$ ->
#insert default style
insertCSS(coreStyle.css).attr('id', 'core-notify')
#watch all notifications clicks
$(document).on 'click', ".#{pluginClassName}-hidable", (e) ->
$(@).trigger 'notify-hide'
$(document).on 'notify-hide', ".#{pluginClassName}-wrapper", (e) ->
$(@).data(pluginClassName)?.show false
================================================
FILE: static/assets/plugins/notifyjs/src/styles/STYLES-README.md
================================================
* Styles in CoffeeScript go here, which will be compiled into `dist/styles`
* Styles in JavaScript can go straight in `dist/styles/`
================================================
FILE: static/assets/plugins/notifyjs/src/styles/bootstrap/notify-bootstrap.coffee
================================================
$.notify.addStyle "bootstrap",
html: """
"""
classes:
base:
"font-weight": "bold"
"padding": "8px 15px 8px 14px"
"text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)"
"background-color": "#fcf8e3"
"border": "1px solid #fbeed5"
"border-radius": "4px"
"white-space": "nowrap"
#for background-image
"padding-left": "25px"
"background-repeat": "no-repeat"
"background-position": "3px 7px"
error:
"color": "#B94A48"
"background-color": "#F2DEDE"
"border-color": "#EED3D7"
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
success:
"color": "#468847"
"background-color": "#DFF0D8"
"border-color": "#D6E9C6"
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
info:
"color": "#3A87AD"
"background-color": "#D9EDF7"
"border-color": "#BCE8F1"
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
warn:
"color": "#C09853"
"background-color": "#FCF8E3"
"border-color": "#FBEED5"
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
================================================
FILE: static/assets/plugins/peity/jquery.peity.js
================================================
// Peity jQuery plugin version 3.2.0
// (c) 2015 Ben Pickles
//
// http://benpickles.github.io/peity
//
// Released under MIT license.
(function($, document, Math, undefined) {
var peity = $.fn.peity = function(type, options) {
if (svgSupported) {
this.each(function() {
var $this = $(this)
var chart = $this.data('_peity')
if (chart) {
if (type) chart.type = type
$.extend(chart.opts, options)
} else {
chart = new Peity(
$this,
type,
$.extend({},
peity.defaults[type],
$this.data('peity'),
options)
)
$this
.change(function() { chart.draw() })
.data('_peity', chart)
}
chart.draw()
});
}
return this;
};
var Peity = function($el, type, opts) {
this.$el = $el
this.type = type
this.opts = opts
}
var PeityPrototype = Peity.prototype
var svgElement = PeityPrototype.svgElement = function(tag, attrs) {
return $(
document.createElementNS('http://www.w3.org/2000/svg', tag)
).attr(attrs)
}
// https://gist.github.com/madrobby/3201472
var svgSupported = 'createElementNS' in document && svgElement('svg', {})[0].createSVGRect
PeityPrototype.draw = function() {
var opts = this.opts
peity.graphers[this.type].call(this, opts)
if (opts.after) opts.after.call(this, opts)
}
PeityPrototype.fill = function() {
var fill = this.opts.fill
return $.isFunction(fill)
? fill
: function(_, i) { return fill[i % fill.length] }
}
PeityPrototype.prepare = function(width, height) {
if (!this.$svg) {
this.$el.hide().after(
this.$svg = svgElement('svg', {
"class": "peity"
})
)
}
return this.$svg
.empty()
.data('peity', this)
.attr({
height: height,
width: width
})
}
PeityPrototype.values = function() {
return $.map(this.$el.text().split(this.opts.delimiter), function(value) {
return parseFloat(value)
})
}
peity.defaults = {}
peity.graphers = {}
peity.register = function(type, defaults, grapher) {
this.defaults[type] = defaults
this.graphers[type] = grapher
}
peity.register(
'pie',
{
fill: ['#ff9900', '#fff4dd', '#ffc66e'],
radius: 8
},
function(opts) {
if (!opts.delimiter) {
var delimiter = this.$el.text().match(/[^0-9\.]/)
opts.delimiter = delimiter ? delimiter[0] : ","
}
var values = $.map(this.values(), function(n) {
return n > 0 ? n : 0
})
if (opts.delimiter == "/") {
var v1 = values[0]
var v2 = values[1]
values = [v1, Math.max(0, v2 - v1)]
}
var i = 0
var length = values.length
var sum = 0
for (; i < length; i++) {
sum += values[i]
}
if (!sum) {
length = 2
sum = 1
values = [0, 1]
}
var diameter = opts.radius * 2
var $svg = this.prepare(
opts.width || diameter,
opts.height || diameter
)
var width = $svg.width()
, height = $svg.height()
, cx = width / 2
, cy = height / 2
var radius = Math.min(cx, cy)
, innerRadius = opts.innerRadius
if (this.type == 'donut' && !innerRadius) {
innerRadius = radius * 0.5
}
var pi = Math.PI
var fill = this.fill()
var scale = this.scale = function(value, radius) {
var radians = value / sum * pi * 2 - pi / 2
return [
radius * Math.cos(radians) + cx,
radius * Math.sin(radians) + cy
]
}
var cumulative = 0
for (i = 0; i < length; i++) {
var value = values[i]
, portion = value / sum
, $node
if (portion == 0) continue
if (portion == 1) {
if (innerRadius) {
var x2 = cx - 0.01
, y1 = cy - radius
, y2 = cy - innerRadius
$node = svgElement('path', {
d: [
'M', cx, y1,
'A', radius, radius, 0, 1, 1, x2, y1,
'L', x2, y2,
'A', innerRadius, innerRadius, 0, 1, 0, cx, y2
].join(' ')
})
} else {
$node = svgElement('circle', {
cx: cx,
cy: cy,
r: radius
})
}
} else {
var cumulativePlusValue = cumulative + value
var d = ['M'].concat(
scale(cumulative, radius),
'A', radius, radius, 0, portion > 0.5 ? 1 : 0, 1,
scale(cumulativePlusValue, radius),
'L'
)
if (innerRadius) {
d = d.concat(
scale(cumulativePlusValue, innerRadius),
'A', innerRadius, innerRadius, 0, portion > 0.5 ? 1 : 0, 0,
scale(cumulative, innerRadius)
)
} else {
d.push(cx, cy)
}
cumulative += value
$node = svgElement('path', {
d: d.join(" ")
})
}
$node.attr('fill', fill.call(this, value, i, values))
$svg.append($node)
}
}
)
peity.register(
'donut',
$.extend(true, {}, peity.defaults.pie),
function(opts) {
peity.graphers.pie.call(this, opts)
}
)
peity.register(
"line",
{
delimiter: ",",
fill: "#c6d9fd",
height: 16,
min: 0,
stroke: "#4d89f9",
strokeWidth: 1,
width: 32
},
function(opts) {
var values = this.values()
if (values.length == 1) values.push(values[0])
var max = Math.max.apply(Math, opts.max == undefined ? values : values.concat(opts.max))
, min = Math.min.apply(Math, opts.min == undefined ? values : values.concat(opts.min))
var $svg = this.prepare(opts.width, opts.height)
, strokeWidth = opts.strokeWidth
, width = $svg.width()
, height = $svg.height() - strokeWidth
, diff = max - min
var xScale = this.x = function(input) {
return input * (width / (values.length - 1))
}
var yScale = this.y = function(input) {
var y = height
if (diff) {
y -= ((input - min) / diff) * height
}
return y + strokeWidth / 2
}
var zero = yScale(Math.max(min, 0))
, coords = [0, zero]
for (var i = 0; i < values.length; i++) {
coords.push(
xScale(i),
yScale(values[i])
)
}
coords.push(width, zero)
if (opts.fill) {
$svg.append(
svgElement('polygon', {
fill: opts.fill,
points: coords.join(' ')
})
)
}
if (strokeWidth) {
$svg.append(
svgElement('polyline', {
fill: 'none',
points: coords.slice(2, coords.length - 2).join(' '),
stroke: opts.stroke,
'stroke-width': strokeWidth,
'stroke-linecap': 'square'
})
)
}
}
);
peity.register(
'bar',
{
delimiter: ",",
fill: ["#4D89F9"],
height: 16,
min: 0,
padding: 0.1,
width: 32
},
function(opts) {
var values = this.values()
, max = Math.max.apply(Math, opts.max == undefined ? values : values.concat(opts.max))
, min = Math.min.apply(Math, opts.min == undefined ? values : values.concat(opts.min))
var $svg = this.prepare(opts.width, opts.height)
, width = $svg.width()
, height = $svg.height()
, diff = max - min
, padding = opts.padding
, fill = this.fill()
var xScale = this.x = function(input) {
return input * width / values.length
}
var yScale = this.y = function(input) {
return height - (
diff
? ((input - min) / diff) * height
: 1
)
}
for (var i = 0; i < values.length; i++) {
var x = xScale(i + padding)
, w = xScale(i + 1 - padding) - x
, value = values[i]
, valueY = yScale(value)
, y1 = valueY
, y2 = valueY
, h
if (!diff) {
h = 1
} else if (value < 0) {
y1 = yScale(Math.min(max, 0))
} else {
y2 = yScale(Math.max(min, 0))
}
h = y2 - y1
if (h == 0) {
h = 1
if (max > 0 && diff) y1--
}
$svg.append(
svgElement('rect', {
fill: fill.call(this, value, i, values),
x: x,
y: y1,
width: w,
height: h
})
)
}
}
);
})(jQuery, document, Math);
================================================
FILE: static/assets/plugins/raphael/raphael-min.js
================================================
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\
!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return void(k._events=j={n:{}});var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;m
i;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(window||this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve||"function"==typeof require&&require("eve"))}(this,function(a,b){function c(a){if(c.is(a,"function"))return u?a():b.on("raphael.DOMload",a);if(c.is(a,V))return c._engine.create[D](c,a.splice(0,3+c.is(a[0],T))).add(a);var d=Array.prototype.slice.call(arguments,0);if(c.is(d[d.length-1],"function")){var e=d.pop();return u?e.call(c._engine.create[D](c,d)):b.on("raphael.DOMload",function(){e.call(c._engine.create[D](c,d))})}return c._engine.create[D](c,arguments)}function d(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=d(a[c]));return b}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function f(a,b,c){function d(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];return h[z](g)?(e(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[D](b,f),c?c(h[g]):h[g])}return d}function g(){return this.hex}function h(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function i(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function j(a,b,c,d,e,f,g,h,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=i(q,a,c,e,g),s=i(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return k*o}function k(a,b,c,d,e,f,g,h,i){if(!(0>i||j(a,b,c,d,e,f,g,h)o;)m/=2,n+=(i>k?1:-1)*m,k=j(a,b,c,d,e,f,g,h,n);return n}}function l(a,b,c,d,e,f,g,h){if(!(O(a,c) O(e,g)||O(b,d)
O(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+O(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+O(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+O(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+O(f,h).toFixed(2)))return{x:l,y:m}}}}function m(a,b,d){var e=c.bezierBBox(a),f=c.bezierBBox(b);if(!c.isBBoxIntersect(e,f))return d?0:[];for(var g=j.apply(0,a),h=j.apply(0,b),i=O(~~(g/5),1),k=O(~~(h/5),1),m=[],n=[],o={},p=d?0:[],q=0;i+1>q;q++){var r=c.findDotsAtSegment.apply(c,a.concat(q/i));m.push({x:r.x,y:r.y,t:q/i})}for(q=0;k+1>q;q++)r=c.findDotsAtSegment.apply(c,b.concat(q/k)),n.push({x:r.x,y:r.y,t:q/k});for(q=0;i>q;q++)for(var s=0;k>s;s++){var t=m[q],u=m[q+1],v=n[s],w=n[s+1],x=Q(u.x-t.x)<.001?"y":"x",y=Q(w.x-v.x)<.001?"y":"x",z=l(t.x,t.y,u.x,u.y,v.x,v.y,w.x,w.y);if(z){if(o[z.x.toFixed(4)]==z.y.toFixed(4))continue;o[z.x.toFixed(4)]=z.y.toFixed(4);var A=t.t+Q((z[x]-t[x])/(u[x]-t[x]))*(u.t-t.t),B=v.t+Q((z[y]-v[y])/(w[y]-v[y]))*(w.t-v.t);A>=0&&1.001>=A&&B>=0&&1.001>=B&&(d?p++:p.push({x:z.x,y:z.y,t1:P(A,1),t2:P(B,1)}))}}return p}function n(a,b,d){a=c._path2curve(a),b=c._path2curve(b);for(var e,f,g,h,i,j,k,l,n,o,p=d?0:[],q=0,r=a.length;r>q;q++){var s=a[q];if("M"==s[0])e=i=s[1],f=j=s[2];else{"C"==s[0]?(n=[e,f].concat(s.slice(1)),e=n[6],f=n[7]):(n=[e,f,e,f,i,j,i,j],e=i,f=j);for(var t=0,u=b.length;u>t;t++){var v=b[t];if("M"==v[0])g=k=v[1],h=l=v[2];else{"C"==v[0]?(o=[g,h].concat(v.slice(1)),g=o[6],h=o[7]):(o=[g,h,g,h,k,l,k,l],g=k,h=l);var w=m(n,o,d);if(d)p+=w;else{for(var x=0,y=w.length;y>x;x++)w[x].segment1=q,w[x].segment2=t,w[x].bez1=n,w[x].bez2=o;p=p.concat(w)}}}}}return p}function o(a,b,c,d,e,f){null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+H+this.y+H+this.width+" × "+this.height}function q(a,b,c,d,e,f){function g(a){return((l*a+k)*a+j)*a}function h(a,b){var c=i(a,b);return((o*c+n)*c+m)*c}function i(a,b){var c,d,e,f,h,i;for(e=a,i=0;8>i;i++){if(f=g(e)-a,Q(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),Q(f-a)f?c=e:d=e,e=(d-c)/2+c}return e}var j=3*b,k=3*(d-b)-j,l=1-j-k,m=3*c,n=3*(e-c)-m,o=1-m-n;return h(a,1/(200*f))}function r(a,b){var c=[],d={};if(this.ms=b,this.times=1,a){for(var e in a)a[z](e)&&(d[_(e)]=a[e],c.push(_(e)));c.sort(lb)}this.anim=d,this.top=c[c.length-1],this.percents=c}function s(a,d,e,f,g,h){e=_(e);var i,j,k,l,m,n,p=a.ms,r={},s={},t={};if(f)for(v=0,x=ic.length;x>v;v++){var u=ic[v];if(u.el.id==d.id&&u.anim==a){u.percent!=e?(ic.splice(v,1),k=1):j=u,d.attr(u.totalOrigin);break}}else f=+s;for(var v=0,x=a.percents.length;x>v;v++){if(a.percents[v]==e||a.percents[v]>f*a.top){e=a.percents[v],m=a.percents[v-1]||0,p=p/a.top*(e-m),l=a.percents[v+1],i=a.anim[e];break}f&&d.attr(a.anim[a.percents[v]])}if(i){if(j)j.initstatus=f,j.start=new Date-j.ms*f;else{for(var y in i)if(i[z](y)&&(db[z](y)||d.paper.customAttributes[z](y)))switch(r[y]=d.attr(y),null==r[y]&&(r[y]=cb[y]),s[y]=i[y],db[y]){case T:t[y]=(s[y]-r[y])/p;break;case"colour":r[y]=c.getRGB(r[y]);var A=c.getRGB(s[y]);t[y]={r:(A.r-r[y].r)/p,g:(A.g-r[y].g)/p,b:(A.b-r[y].b)/p};break;case"path":var B=Kb(r[y],s[y]),C=B[1];for(r[y]=B[0],t[y]=[],v=0,x=r[y].length;x>v;v++){t[y][v]=[0];for(var D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(C[v][D]-r[y][v][D])/p}break;case"transform":var G=d._,H=Pb(G[y],s[y]);if(H)for(r[y]=H.from,s[y]=H.to,t[y]=[],t[y].real=!0,v=0,x=r[y].length;x>v;v++)for(t[y][v]=[r[y][v][0]],D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(s[y][v][D]-r[y][v][D])/p;else{var K=d.matrix||new o,L={_:{transform:G.transform},getBBox:function(){return d.getBBox(1)}};r[y]=[K.a,K.b,K.c,K.d,K.e,K.f],Nb(L,s[y]),s[y]=L._.transform,t[y]=[(L.matrix.a-K.a)/p,(L.matrix.b-K.b)/p,(L.matrix.c-K.c)/p,(L.matrix.d-K.d)/p,(L.matrix.e-K.e)/p,(L.matrix.f-K.f)/p]}break;case"csv":var M=I(i[y])[J](w),N=I(r[y])[J](w);if("clip-rect"==y)for(r[y]=N,t[y]=[],v=N.length;v--;)t[y][v]=(M[v]-r[y][v])/p;s[y]=M;break;default:for(M=[][E](i[y]),N=[][E](r[y]),t[y]=[],v=d.paper.customAttributes[y].length;v--;)t[y][v]=((M[v]||0)-(N[v]||0))/p}var O=i.easing,P=c.easing_formulas[O];if(!P)if(P=I(O).match(Z),P&&5==P.length){var Q=P;P=function(a){return q(a,+Q[1],+Q[2],+Q[3],+Q[4],p)}}else P=nb;if(n=i.start||a.start||+new Date,u={anim:a,percent:e,timestamp:n,start:n+(a.del||0),status:0,initstatus:f||0,stop:!1,ms:p,easing:P,from:r,diff:t,to:s,el:d,callback:i.callback,prev:m,next:l,repeat:h||a.times,origin:d.attr(),totalOrigin:g},ic.push(u),f&&!j&&!k&&(u.stop=!0,u.start=new Date-p*f,1==ic.length))return kc();k&&(u.start=new Date-u.ms*f),1==ic.length&&jc(kc)}b("raphael.anim.start."+d.id,d,a)}}function t(a){for(var b=0;be;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a};if(c._g=A,c.type=A.win.SVGAngle||A.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==c.type){var sb,tb=A.doc.createElement("div");if(tb.innerHTML=' ',sb=tb.firstChild,sb.style.behavior="url(#default#VML)",!sb||"object"!=typeof sb.adj)return c.type=G;tb=null}c.svg=!(c.vml="VML"==c.type),c._Paper=C,c.fn=v=C.prototype=c.prototype,c._id=0,c._oid=0,c.is=function(a,b){return b=M.call(b),"finite"==b?!Y[z](+a):"array"==b?a instanceof Array:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||"array"==b&&Array.isArray&&Array.isArray(a)||W.call(a).slice(8,-1).toLowerCase()==b},c.angle=function(a,b,d,e,f,g){if(null==f){var h=a-d,i=b-e;return h||i?(180+180*N.atan2(-i,-h)/S+360)%360:0}return c.angle(a,b,f,g)-c.angle(d,e,f,g)},c.rad=function(a){return a%360*S/180},c.deg=function(a){return Math.round(180*a/S%360*1e3)/1e3},c.snapTo=function(a,b,d){if(d=c.is(d,"finite")?d:10,c.is(a,V)){for(var e=a.length;e--;)if(Q(a[e]-b)<=d)return a[e]}else{a=+a;var f=b%a;if(d>f)return b-f;if(f>a-d)return b-f+a}return b};c.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=16*N.random()|0,c="x"==a?b:3&b|8;return c.toString(16)});c.setWindow=function(a){b("raphael.setWindow",c,A.win,a),A.win=a,A.doc=A.win.document,c._engine.initWin&&c._engine.initWin(A.win)};var ub=function(a){if(c.vml){var b,d=/^\s+|\s+$/g;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),b=e.body}catch(g){b=createPopup().document.body}var h=b.createTextRange();ub=f(function(a){try{b.style.color=I(a).replace(d,G);var c=h.queryCommandValue("ForeColor");return c=(255&c)<<16|65280&c|(16711680&c)>>>16,"#"+("000000"+c.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=A.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",A.doc.body.appendChild(i),ub=f(function(a){return i.style.color=a,A.doc.defaultView.getComputedStyle(i,G).getPropertyValue("color")})}return ub(a)},vb=function(){return"hsb("+[this.h,this.s,this.b]+")"},wb=function(){return"hsl("+[this.h,this.s,this.l]+")"},xb=function(){return this.hex},yb=function(a,b,d){if(null==b&&c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&c.is(a,U)){var e=c.getRGB(a);a=e.r,b=e.g,d=e.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},zb=function(a,b,d,e){a*=255,b*=255,d*=255;var f={r:a,g:b,b:d,hex:c.rgb(a,b,d),toString:xb};return c.is(e,"finite")&&(f.opacity=e),f};c.color=function(a){var b;return c.is(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):c.is(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):(c.is(a,"string")&&(a=c.getRGB(a)),c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1)),a.toString=xb,a},c.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Q(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var e,f,g,h,i;return a=a%360/60,i=2*b*(.5>c?c:1-c),h=i*(1-Q(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.rgb2hsb=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=O(a,b,c),g=f-P(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:vb}},c.rgb2hsl=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=O(a,b,c),h=P(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:wb}},c._path2string=function(){return this.join(",").replace(gb,"$1")};c._preload=function(a,b){var c=A.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,A.doc.body.removeChild(this)},c.onerror=function(){A.doc.body.removeChild(this)},A.doc.body.appendChild(c),c.src=a};c.getRGB=f(function(a){if(!a||(a=I(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:g};if("none"==a)return{r:-1,g:-1,b:-1,hex:"none",toString:g};!(fb[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=ub(a));var b,d,e,f,h,i,j=a.match(X);return j?(j[2]&&(e=ab(j[2].substring(5),16),d=ab(j[2].substring(3,5),16),b=ab(j[2].substring(1,3),16)),j[3]&&(e=ab((h=j[3].charAt(3))+h,16),d=ab((h=j[3].charAt(2))+h,16),b=ab((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100)),j[5]?(i=j[5][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsb2rgb(b,d,e,f)):j[6]?(i=j[6][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsl2rgb(b,d,e,f)):(j={r:b,g:d,b:e,toString:g},j.hex="#"+(16777216|e|d<<8|b<<16).toString(16).slice(1),c.is(f,"finite")&&(j.opacity=f),j)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:g}},c),c.hsb=f(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=f(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=f(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),c.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},c.getColor.reset=function(){delete this.start},c.parsePathString=function(a){if(!a)return null;var b=Ab(a);if(b.arr)return Cb(b.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];return c.is(a,V)&&c.is(a[0],V)&&(e=Cb(a)),e.length||I(a).replace(hb,function(a,b,c){var f=[],g=b.toLowerCase();if(c.replace(jb,function(a,b){b&&f.push(+b)}),"m"==g&&f.length>2&&(e.push([b][E](f.splice(0,2))),g="l",b="m"==b?"l":"L"),"r"==g)e.push([b][E](f));else for(;f.length>=d[g]&&(e.push([b][E](f.splice(0,d[g]))),d[g]););}),e.toString=c._path2string,b.arr=Cb(e),e},c.parseTransformString=f(function(a){if(!a)return null;var b=[];return c.is(a,V)&&c.is(a[0],V)&&(b=Cb(a)),b.length||I(a).replace(ib,function(a,c,d){{var e=[];M.call(c)}d.replace(jb,function(a,b){b&&e.push(+b)}),b.push([c][E](e))}),b.toString=c._path2string,b});var Ab=function(a){var b=Ab.ps=Ab.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[z](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]};c.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=R(j,3),l=R(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*N.atan2(q-s,r-t)/S;return(q>s||t>r)&&(y+=180),{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}},c.bezierBBox=function(a,b,d,e,f,g,h,i){c.is(a,"array")||(a=[a,b,d,e,f,g,h,i]);var j=Jb.apply(null,a);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},c.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},c.isBBoxIntersect=function(a,b){var d=c.isPointInsideBBox;return d(b,a.x,a.y)||d(b,a.x2,a.y)||d(b,a.x,a.y2)||d(b,a.x2,a.y2)||d(a,b.x,b.y)||d(a,b.x2,b.y)||d(a,b.x,b.y2)||d(a,b.x2,b.y2)||(a.xb.x||b.xa.x)&&(a.yb.y||b.ya.y)},c.pathIntersection=function(a,b){return n(a,b)},c.pathIntersectionNumber=function(a,b){return n(a,b,1)},c.isPointInsidePath=function(a,b,d){var e=c.pathBBox(a);return c.isPointInsideBBox(e,b,d)&&n(a,[["M",b,d],["H",e.x2+10]],1)%2==1},c._removedFactory=function(a){return function(){b("raphael.log",null,"Raphaël: you are calling to method “"+a+"” of removed object",a)}};var Bb=c.pathBBox=function(a){var b=Ab(a);if(b.bbox)return d(b.bbox);if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=Kb(a);for(var c,e=0,f=0,g=[],h=[],i=0,j=a.length;j>i;i++)if(c=a[i],"M"==c[0])e=c[1],f=c[2],g.push(e),h.push(f);else{var k=Jb(e,f,c[1],c[2],c[3],c[4],c[5],c[6]);g=g[E](k.min.x,k.max.x),h=h[E](k.min.y,k.max.y),e=c[5],f=c[6]}var l=P[D](0,g),m=P[D](0,h),n=O[D](0,g),o=O[D](0,h),p=n-l,q=o-m,r={x:l,y:m,x2:n,y2:o,width:p,height:q,cx:l+p/2,cy:m+q/2};return b.bbox=d(r),r},Cb=function(a){var b=d(a);return b.toString=c._path2string,b},Db=c._pathToRelative=function(a){var b=Ab(a);if(b.rel)return Cb(b.rel);c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a));var d=[],e=0,f=0,g=0,h=0,i=0;"M"==a[0][0]&&(e=a[0][1],f=a[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=a.length;k>j;j++){var l=d[j]=[],m=a[j];if(m[0]!=M.call(m[0]))switch(l[0]=M.call(m[0]),l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;o>n;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}else{l=d[j]=[],"m"==m[0]&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;q>p;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}return d.toString=c._path2string,b.rel=Cb(d),d},Eb=c._pathToAbsolute=function(a){var b=Ab(a);if(b.abs)return Cb(b.abs);if(c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a)),!a||!a.length)return[["M",0,0]];var d=[],e=0,f=0,g=0,i=0,j=0;"M"==a[0][0]&&(e=+a[0][1],f=+a[0][2],g=e,i=f,j++,d[0]=["M",e,f]);for(var k,l,m=3==a.length&&"M"==a[0][0]&&"R"==a[1][0].toUpperCase()&&"Z"==a[2][0].toUpperCase(),n=j,o=a.length;o>n;n++){if(d.push(k=[]),l=a[n],l[0]!=bb.call(l[0]))switch(k[0]=bb.call(l[0]),k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case"V":k[1]=+l[1]+f;break;case"H":k[1]=+l[1]+e;break;case"R":for(var p=[e,f][E](l.slice(1)),q=2,r=p.length;r>q;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[E](h(p,m));break;case"M":g=+l[1]+e,i=+l[2]+f;default:for(q=1,r=l.length;r>q;q++)k[q]=+l[q]+(q%2?e:f)}else if("R"==l[0])p=[e,f][E](l.slice(1)),d.pop(),d=d[E](h(p,m)),k=["R"][E](l.slice(-2));else for(var s=0,t=l.length;t>s;s++)k[s]=l[s];switch(k[0]){case"Z":e=g,f=i;break;case"H":e=k[1];break;case"V":f=k[1];break;case"M":g=k[k.length-2],i=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}return d.toString=c._path2string,b.abs=Cb(d),d},Fb=function(a,b,c,d){return[a,b,c,d,c,d]},Gb=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},Hb=function(a,b,c,d,e,g,h,i,j,k){var l,m=120*S/180,n=S/180*(+e||0),o=[],p=f(function(a,b,c){var d=a*N.cos(c)-b*N.sin(c),e=a*N.sin(c)+b*N.cos(c);return{x:d,y:e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(a,b,-n),a=l.x,b=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(N.cos(S/180*e),N.sin(S/180*e),(a-i)/2),r=(b-j)/2,s=q*q/(c*c)+r*r/(d*d);s>1&&(s=N.sqrt(s),c=s*c,d=s*d);var t=c*c,u=d*d,v=(g==h?-1:1)*N.sqrt(Q((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*c*r/d+(a+i)/2,x=v*-d*q/c+(b+j)/2,y=N.asin(((b-x)/d).toFixed(9)),z=N.asin(((j-x)/d).toFixed(9));y=w>a?S-y:y,z=w>i?S-z:z,0>y&&(y=2*S+y),0>z&&(z=2*S+z),h&&y>z&&(y-=2*S),!h&&z>y&&(z-=2*S)}var A=z-y;if(Q(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+c*N.cos(z),j=x+d*N.sin(z),o=Hb(i,j,c,d,e,0,h,C,D,[z,B,w,x])}A=z-y;var F=N.cos(y),G=N.sin(y),H=N.cos(z),I=N.sin(z),K=N.tan(A/4),L=4/3*c*K,M=4/3*d*K,O=[a,b],P=[a+L*G,b-M*F],R=[i+L*I,j-M*H],T=[i,j];if(P[0]=2*O[0]-P[0],P[1]=2*O[1]-P[1],k)return[P,R,T][E](o);o=[P,R,T][E](o).join()[J](",");for(var U=[],V=0,W=o.length;W>V;V++)U[V]=V%2?p(o[V-1],o[V],n).y:p(o[V],o[V+1],n).x;return U},Ib=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:R(j,3)*a+3*R(j,2)*i*c+3*j*i*i*e+R(i,3)*g,y:R(j,3)*b+3*R(j,2)*i*d+3*j*i*i*f+R(i,3)*h}},Jb=f(function(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{min:{x:P[D](0,p),y:P[D](0,o)},max:{x:O[D](0,p),y:O[D](0,o)}}}),Kb=c._path2curve=f(function(a,b){var c=!b&&Ab(a);if(!b&&c.curve)return Cb(c.curve);for(var d=Eb(a),e=b&&Eb(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=(function(a,b,c){var d,e,f={T:1,Q:1};if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in f)&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][E](Hb[D](0,[b.x,b.y][E](a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e][E](a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"][E](Gb(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][E](Gb(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][E](Fb(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][E](Fb(b.x,b.y,a[1],b.y));break;case"V":a=["C"][E](Fb(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][E](Fb(b.x,b.y,b.X,b.Y))}return a}),i=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)k[b]="A",e&&(l[b]="A"),a.splice(b++,0,["C"][E](c.splice(0,6)));a.splice(b,1),p=O(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],p=O(d.length,e&&e.length||0))},k=[],l=[],m="",n="",o=0,p=O(d.length,e&&e.length||0);p>o;o++){d[o]&&(m=d[o][0]),"C"!=m&&(k[o]=m,o&&(n=k[o-1])),d[o]=h(d[o],f,n),"A"!=k[o]&&"C"==m&&(k[o]="C"),i(d,o),e&&(e[o]&&(m=e[o][0]),"C"!=m&&(l[o]=m,o&&(n=l[o-1])),e[o]=h(e[o],g,n),"A"!=l[o]&&"C"==m&&(l[o]="C"),i(e,o)),j(d,e,f,g,o),j(e,d,g,f,o);var q=d[o],r=e&&e[o],s=q.length,t=e&&r.length;f.x=q[s-2],f.y=q[s-1],f.bx=_(q[s-4])||f.x,f.by=_(q[s-3])||f.y,g.bx=e&&(_(r[t-4])||g.x),g.by=e&&(_(r[t-3])||g.y),g.x=e&&r[t-2],g.y=e&&r[t-1]}return e||(c.curve=Cb(d)),e?[d,e]:d},null,Cb),Lb=(c._parseDots=f(function(a){for(var b=[],d=0,e=a.length;e>d;d++){var f={},g=a[d].match(/^([^:]*):?([\d\.]*)/);if(f.color=c.getRGB(g[1]),f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),b.push(f)}for(d=1,e=b.length-1;e>d;d++)if(!b[d].offset){for(var h=_(b[d-1].offset||0),i=0,j=d+1;e>j;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=e),i=_(i);for(var k=(i-h)/(j-d+1);j>d;d++)h+=k,b[d].offset=h+"%"}return b}),c._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)}),Mb=(c._tofront=function(a,b){b.top!==a&&(Lb(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},c._toback=function(a,b){b.bottom!==a&&(Lb(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},c._insertafter=function(a,b,c){Lb(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c){Lb(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=Bb(a),d={_:{transform:G},getBBox:function(){return c}};return Nb(d,b),d.matrix}),Nb=(c.transformPath=function(a,b){return rb(a,Mb(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=I(b).replace(/\.{3}|\u2026/g,a._.transform||G);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new o;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var n,p,q,r,s,t=d[l],u=t.length,v=I(t[0]).toLowerCase(),w=t[0]!=v,x=w?k.invert():0;"t"==v&&3==u?w?(n=x.x(0,0),p=x.y(0,0),q=x.x(t[1],t[2]),r=x.y(t[1],t[2]),k.translate(q-n,r-p)):k.translate(t[1],t[2]):"r"==v?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(w?(q=x.x(t[2],t[3]),r=x.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):"s"==v?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(w?(q=x.x(t[3],t[4]),r=x.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):"m"==v&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),Ob=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},Pb=c._equaliseTransform=function(a,b){b=I(b).replace(/\.{3}|\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[];
for(var d,e,f,g,h=O(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||Ob(b[k]),g=b[k]||Ob(f),f[0]!=g[0]||"r"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||"s"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=O(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,"object")?a:A.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=Db,c._engine={},c.path2curve=Kb,c.matrix=function(a,b,c,d,e,f){return new o(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=N.sqrt(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof o&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new o(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+N.cos(a).toFixed(9),f=+N.sin(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[I.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=N.sqrt(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=N.sqrt(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(N.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(N.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[J]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:G)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:G)+(b.rotate?"r"+[b.rotate,0,0]:G)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var Qb=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);v.safari="Apple Computer, Inc."==navigator.vendor&&(Qb&&Qb[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Qb&&Qb[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){a.remove()})}:mb;for(var Rb=function(){this.returnValue=!1},Sb=function(){return this.originalEvent.preventDefault()},Tb=function(){this.cancelBubble=!0},Ub=function(){return this.originalEvent.stopPropagation()},Vb=function(a){var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,c=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;return{x:a.clientX+c,y:a.clientY+b}},Wb=function(){return A.doc.addEventListener?function(a,b,c,d){var e=function(a){var b=Vb(a);return c.call(d,a,b.x,b.y)};if(a.addEventListener(b,e,!1),F&&L[b]){var f=function(b){for(var e=Vb(b),f=b,g=0,h=b.targetTouches&&b.targetTouches.length;h>g;g++)if(b.targetTouches[g].target==a){b=b.targetTouches[g],b.originalEvent=f,b.preventDefault=Sb,b.stopPropagation=Ub;break}return c.call(d,b,e.x,e.y)};a.addEventListener(L[b],f,!1)}return function(){return a.removeEventListener(b,e,!1),F&&L[b]&&a.removeEventListener(L[b],f,!1),!0}}:A.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||A.win.event;var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,e=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||Rb,a.stopPropagation=a.stopPropagation||Tb,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),Xb=[],Yb=function(a){for(var c,d=a.clientX,e=a.clientY,f=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,g=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,h=Xb.length;h--;){if(c=Xb[h],F&&a.touches){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;A.win.opera&&n.removeChild(l),l.style.display="none",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,A.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b("raphael.drag.over."+c.el.id,c.el,k),d+=g,e+=f,b("raphael.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},Zb=function(a){c.unmousemove(Yb).unmouseup(Zb);for(var d,e=Xb.length;e--;)d=Xb[e],d.el._drag={},b("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);Xb=[]},$b=c.el={},_b=K.length;_b--;)!function(a){c[a]=$b[a]=function(b,d){return c.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:Wb(this.shape||this.node||A.doc,a,b,d||this)})),this},c["un"+a]=$b["un"+a]=function(b){for(var d=this.events||[],e=d.length;e--;)d[e].name!=a||!c.is(b,"undefined")&&d[e].f!=b||(d[e].unbind(),d.splice(e,1),!d.length&&delete this.events);return this}}(K[_b]);$b.data=function(a,d){var e=kb[this.id]=kb[this.id]||{};if(0==arguments.length)return e;if(1==arguments.length){if(c.is(a,"object")){for(var f in a)a[z](f)&&this.data(f,a[f]);return this}return b("raphael.data.get."+this.id,this,e[a],a),e[a]}return e[a]=d,b("raphael.data.set."+this.id,this,d,a),this},$b.removeData=function(a){return null==a?kb[this.id]={}:kb[this.id]&&delete kb[this.id][a],this},$b.getData=function(){return d(kb[this.id]||{})},$b.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},$b.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var ac=[];$b.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=i.clientX,k=i.clientY,l=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,m=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;if(this._drag.id=i.identifier,F&&i.touches)for(var n,o=i.touches.length;o--;)if(n=i.touches[o],this._drag.id=n.identifier,n.identifier==this._drag.id){j=n.clientX,k=n.clientY;break}this._drag.x=j+m,this._drag.y=k+l,!Xb.length&&c.mousemove(Yb).mouseup(Zb),Xb.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("raphael.drag.start."+this.id,d),a&&b.on("raphael.drag.move."+this.id,a),e&&b.on("raphael.drag.end."+this.id,e),b("raphael.drag.start."+this.id,g||f||this,i.clientX+m,i.clientY+l,i)}return this._drag={},ac.push({el:this,start:i}),this.mousedown(i),this},$b.onDragOver=function(a){a?b.on("raphael.drag.over."+this.id,a):b.unbind("raphael.drag.over."+this.id)},$b.undrag=function(){for(var a=ac.length;a--;)ac[a].el==this&&(this.unmousedown(ac[a].start),ac.splice(a,1),b.unbind("raphael.drag.*."+this.id));!ac.length&&c.unmousemove(Yb).unmouseup(Zb),Xb=[]},v.circle=function(a,b,d){var e=c._engine.circle(this,a||0,b||0,d||0);return this.__set__&&this.__set__.push(e),e},v.rect=function(a,b,d,e,f){var g=c._engine.rect(this,a||0,b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.ellipse=function(a,b,d,e){var f=c._engine.ellipse(this,a||0,b||0,d||0,e||0);return this.__set__&&this.__set__.push(f),f},v.path=function(a){a&&!c.is(a,U)&&!c.is(a[0],V)&&(a+=G);var b=c._engine.path(c.format[D](c,arguments),this);return this.__set__&&this.__set__.push(b),b},v.image=function(a,b,d,e,f){var g=c._engine.image(this,a||"about:blank",b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.text=function(a,b,d){var e=c._engine.text(this,a||0,b||0,I(d));return this.__set__&&this.__set__.push(e),e},v.set=function(a){!c.is(a,"array")&&(a=Array.prototype.splice.call(arguments,0,arguments.length));var b=new mc(a);return this.__set__&&this.__set__.push(b),b.paper=this,b.type="set",b},v.setStart=function(a){this.__set__=a||this.set()},v.setFinish=function(){var a=this.__set__;return delete this.__set__,a},v.getSize=function(){var a=this.canvas.parentNode;return{width:a.offsetWidth,height:a.offsetHeight}},v.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},v.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},v.top=v.bottom=null,v.raphael=c;var bc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(A.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(A.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:h,x:i}};v.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=A.doc.elementFromPoint(a,b);if(A.win.opera&&"svg"==e.tagName){var f=bc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},v.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},v.getById=function(a){for(var b=this.bottom;b;){if(b.id==a)return b;b=b.next}return null},v.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},v.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},$b.isPointInside=function(a,b){var d=this.realPath=qb[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(d=c.transformPath(d,this.attr("transform"))),c.isPointInsidePath(d,a,b)},$b.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=qb[this.type](this),b.bboxwt=Bb(this.realPath),b.bboxwt.toString=p,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=qb[this.type](this)),b.bbox=Bb(rb(this.realPath,this.matrix)),b.bbox.toString=p,b.dirty=b.dirtyT=0),b.bbox)},$b.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(a),a},$b.glow=function(a){if("text"==this.type)return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||qb[this.type](this);f=this.matrix?rb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cc=function(a,b,d,e,f,g,h,i,l){return null==l?j(a,b,d,e,f,g,h,i):c.findDotsAtSegment(a,b,d,e,f,g,h,i,k(a,b,d,e,f,g,h,i,l))},dc=function(a,b){return function(d,e,f){d=Kb(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],"M"==i[0])g=+i[1],h=+i[2];else{if(j=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},ec=dc(1),fc=dc(),gc=dc(0,1);c.getTotalLength=ec,c.getPointAtLength=fc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return gc(a,b).end;var d=gc(a,c,1);return b?gc(d,b).end:d},$b.getTotalLength=function(){var a=this.getPath();if(a)return this.node.getTotalLength?this.node.getTotalLength():ec(a)},$b.getPointAtLength=function(a){var b=this.getPath();if(b)return fc(b,a)},$b.getPath=function(){var a,b=c._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return b&&(a=b(this)),a},$b.getSubpath=function(a,b){var d=this.getPath();if(d)return c.getSubpath(d,a,b)};var hc=c.easing_formulas={linear:function(a){return a},"<":function(a){return R(a,1.7)},">":function(a){return R(a,.48)},"<>":function(a){var b=.48-a/1.04,c=N.sqrt(.1734+b*b),d=c-b,e=R(Q(d),1/3)*(0>d?-1:1),f=-c-b,g=R(Q(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:R(2,-10*a)*N.sin(2*(a-.075)*S/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};hc.easeIn=hc["ease-in"]=hc["<"],hc.easeOut=hc["ease-out"]=hc[">"],hc.easeInOut=hc["ease-in-out"]=hc["<>"],hc["back-in"]=hc.backIn,hc["back-out"]=hc.backOut;var ic=[],jc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},kc=function(){for(var a=+new Date,d=0;dh))if(i>h){var q=j(h/i);for(var r in k)if(k[z](r)){switch(db[r]){case T:f=+k[r]+q*i*l[r];break;case"colour":f="rgb("+[lc($(k[r].r+q*i*l[r].r)),lc($(k[r].g+q*i*l[r].g)),lc($(k[r].b+q*i*l[r].b))].join(",")+")";break;case"path":f=[];for(var t=0,u=k[r].length;u>t;t++){f[t]=[k[r][t][0]];for(var v=1,w=k[r][t].length;w>v;v++)f[t][v]=+k[r][t][v]+q*i*l[r][t][v];f[t]=f[t].join(H)}f=f.join(H);break;case"transform":if(l[r].real)for(f=[],t=0,u=k[r].length;u>t;t++)for(f[t]=[k[r][t][0]],v=1,w=k[r][t].length;w>v;v++)f[t][v]=k[r][t][v]+q*i*l[r][t][v];else{var x=function(a){return+k[r][a]+q*i*l[r][a]};f=[["m",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case"csv":if("clip-rect"==r)for(f=[],t=4;t--;)f[t]=+k[r][t]+q*i*l[r][t];break;default:var y=[][E](k[r]);for(f=[],t=n.paper.customAttributes[r].length;t--;)f[t]=+y[t]+q*i*l[r][t]}o[r]=f}n.attr(o),function(a,c,d){setTimeout(function(){b("raphael.anim.frame."+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b("raphael.anim.frame."+d.id,d,e),b("raphael.anim.finish."+d.id,d,e),c.is(a,"function")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),ic.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[z](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),s(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&s(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),ic.length&&jc(kc)},lc=function(a){return a>255?255:0>a?0:a};$b.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof r?d:c.animation(d,e,f,g);s(i,h,i.percents[0],null,h.attr());for(var j=0,k=ic.length;k>j;j++)if(ic[j].anim==b&&ic[j].el==a){ic[k-1].start=ic[j].start;break}return h},$b.onAnimation=function(a){return a?b.on("raphael.anim.frame."+this.id,a):b.unbind("raphael.anim.frame."+this.id),this},r.prototype.delay=function(a){var b=new r(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},r.prototype.repeat=function(a){var b=new r(this.anim,this.ms);return b.del=this.del,b.times=N.floor(O(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof r)return a;(c.is(d,"function")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[z](g)&&_(g)!=g&&_(g)+"%"!=g&&(f=!0,h[g]=a[g]);if(f)return d&&(h.easing=d),e&&(h.callback=e),new r({100:h},b);if(e){var i=0;for(var j in a){var k=ab(j);a[z](j)&&k>i&&(i=k)}i+="%",!a[i].callback&&(a[i].callback=e)}return new r(a,b)},$b.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof r?a:c.animation(a,b,d,e);return s(g,f,g.percents[0],null,f.attr()),f},$b.setTime=function(a,b){return a&&null!=b&&this.status(a,P(b,a.ms)/a.ms),this},$b.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return s(a,this,-1,P(b,1)),this;for(c=ic.length;c>f;f++)if(d=ic[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({anim:d.anim,status:d.status})}return a?0:e},$b.pause=function(a){for(var c=0;cb;b++)!a[b]||a[b].constructor!=$b.constructor&&a[b].constructor!=mc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},nc=mc.prototype;nc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=$b.constructor&&a.constructor!=mc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},nc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},nc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var oc in $b)$b[z](oc)&&(nc[oc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][D](c,b)})}}(oc));return nc.attr=function(a,b){if(a&&c.is(a,V)&&c.is(a[0],"object"))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},nc.clear=function(){for(;this.length;)this.pop()},nc.splice=function(a,b){a=0>a?O(this.length+a,0):a,b=O(0,P(this.length-a,b));var c,d=[],e=[],f=[];for(c=2;cc;c++)e.push(this[a+c]);for(;cc?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new mc(e)},nc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},nc.animate=function(a,b,d,e){(c.is(d,"function")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,U)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k),this.items[i]&&!this.items[i].removed||h--;return this},nc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},nc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=P[D](0,a),b=P[D](0,b),c=O[D](0,c),d=O[D](0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},nc.clone=function(a){a=this.paper.set();for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},nc.toString=function(){return"Raphaël‘s set"},nc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},nc.isPointInside=function(a,b){var c=!1;return this.forEach(function(d){return d.isPointInside(a,b)?(c=!0,!1):void 0}),c},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[z](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face["units-per-em"]=ab(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[z](e)){var f=a.glyphs[e];if(b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"},f.k)for(var g in f.k)f[z](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},v.getFont=function(a,b,d,e){if(e=e||"normal",d=d||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,G)+"(\\s|$)","i");for(var h in c.fonts)if(c.fonts[z](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face["font-weight"]!=b||i.face["font-style"]!=d&&i.face["font-style"]||i.face["font-stretch"]!=e);j++);return i}},v.print=function(a,b,d,e,f,g,h,i){g=g||"middle",h=O(P(h||0,1),-1),i=O(P(i||1,3),1);var j,k=I(d)[J](G),l=0,m=0,n=G;if(c.is(e,"string")&&(e=this.getFont(e)),e){j=(f||16)/e.face["units-per-em"];for(var o=e.face.bbox[J](w),p=+o[0],q=o[3]-o[1],r=0,s=+o[1]+("baseline"==g?q+ +e.face.descent:q/2),t=0,u=k.length;u>t;t++){if("\n"==k[t])l=0,x=0,m=0,r+=q*i;else{var v=m&&e.glyphs[k[t-1]]||{},x=e.glyphs[k[t]];l+=m?(v.w||e.w)+(v.k&&v.k[k[t]]||0)+e.w*h:0,m=1}x&&x.d&&(n+=c.transformPath(x.d,["t",l*j,r*j,"s",j,j,p,s,"t",(a-p)/j,(b-s)/j]))}}return this.path(n).attr({fill:"#000",stroke:"none"})},v.add=function(a){if(c.is(a,"array"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},x[z](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,V)?[0][E](b):arguments;return a&&c.is(a,U)&&d.length-1&&(a=a.replace(y,function(a,b){return null==d[++b]?G:d[b]})),a||G},c.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return B.was?A.win.Raphael=B.is:delete Raphael,c},c.st=nc,b.on("raphael.DOMload",function(){u=!0}),function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve("raphael.DOMload")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState="complete"},!1),a.readyState="loading"),e()}(document,"DOMContentLoaded"),function(){if(c.svg){var a="hasOwnProperty",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=c.eve,l="",m=" ",n="http://www.w3.org/1999/xlink",o={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},p={};c.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var q=function(d,e){if(e){"string"==typeof d&&(d=q(d));for(var f in e)e[a](f)&&("xlink:"==f.substring(0,6)?d.setAttributeNS(n,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS("http://www.w3.org/2000/svg",d),d.style&&(d.style.webkitTapHighlightColor="rgba(0,0,0,0)");return d},r=function(a,e){var j="linear",k=a.id+e,m=.5,n=.5,o=a.node,p=a.paper,r=o.style,s=c._g.doc.getElementById(k);if(!s){if(e=b(e).replace(c._radial_gradient,function(a,b,c){if(j="radial",b&&c){m=d(b),n=d(c);var e=2*(n>.5)-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&.5!=n&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/),"linear"==j){var t=e.shift();if(t=-d(t),isNaN(t))return null;var u=[0,0,f.cos(c.rad(t)),f.sin(c.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=c._parseDots(e);if(!w)return null;if(k=k.replace(/[\(\)\s,\xb0#]/g,"_"),a.gradient&&k!=a.gradient.id&&(p.defs.removeChild(a.gradient),delete a.gradient),!a.gradient){s=q(j+"Gradient",{id:k}),a.gradient=s,q(s,"radial"==j?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:a.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;y>x;x++)s.appendChild(q("stop",{offset:w[x].offset?w[x].offset:x?"100%":"0%","stop-color":w[x].color||"#fff"}))}}return q(o,{fill:"url('"+document.location+"#"+k+"')",opacity:1,"fill-opacity":1}),r.fill=l,r.opacity=1,r.fillOpacity=1,1},s=function(a){var b=a.getBBox(1);q(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},t=function(d,e,f){if("path"==d.type){for(var g,h,i,j,k,m=b(e).toLowerCase().split("-"),n=d.paper,r=f?"end":"start",s=d.node,t=d.attrs,u=t["stroke-width"],v=m.length,w="classic",x=3,y=3,z=5;v--;)switch(m[v]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=m[v];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}if("open"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={fill:"none",stroke:t.stroke}):(j=i=x/2,k={fill:t.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={},"none"!=w){var A="raphael-marker-"+w,B="raphael-marker-"+r+w+x+y+"-obj"+d.id;c._g.doc.getElementById(A)?p[A]++:(n.defs.appendChild(q(q("path"),{"stroke-linecap":"round",d:o[w],id:A})),p[A]=1);var C,D=c._g.doc.getElementById(B);D?(p[B]++,C=D.getElementsByTagName("use")[0]):(D=q(q("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:j,refY:y/2}),C=q(q("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":l)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),n.defs.appendChild(D),p[B]=1),q(C,k);var E=i*("diamond"!=w&&"oval"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-E*u):(g=E*u,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),k={},k["marker-"+r]="url(#"+B+")",(h||g)&&(k.d=c.getSubpath(t.path,g,h)),q(s,k),d._.arrows[r+"Path"]=A,d._.arrows[r+"Marker"]=B,d._.arrows[r+"dx"]=E,d._.arrows[r+"Type"]=w,d._.arrows[r+"String"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-g):(g=0,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),d._.arrows[r+"Path"]&&q(s,{d:c.getSubpath(t.path,g,h)}),delete d._.arrows[r+"Path"],delete d._.arrows[r+"Marker"],delete d._.arrows[r+"dx"],delete d._.arrows[r+"Type"],delete d._.arrows[r+"String"];for(k in p)if(p[a](k)&&!p[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},u={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},v=function(a,c,d){if(c=u[b(c).toLowerCase()]){for(var e=a.attrs["stroke-width"]||"1",f={round:e,square:e,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],h=c.length;h--;)g[h]=c[h]*e+(h%2?1:-1)*f;q(a.node,{"stroke-dasharray":g.join(",")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility="hidden";for(var o in f)if(f[a](o)){if(!c._availableAttrs[a](o))continue;var p=f[o];switch(k[o]=p,o){case"blur":d.blur(p);break;case"title":var u=i.getElementsByTagName("title");if(u.length&&(u=u[0]))u.firstChild.nodeValue=p;else{u=q("title");var w=c._g.doc.createTextNode(p);u.appendChild(w),i.appendChild(u)}break;case"href":case"target":var x=i.parentNode;if("a"!=x.tagName.toLowerCase()){var z=q("a");x.insertBefore(z,i),z.appendChild(i),x=z}"target"==o?x.setAttributeNS(n,"show","blank"==p?"new":p):x.setAttributeNS(n,o,p);break;case"cursor":i.style.cursor=p;break;case"transform":d.transform(p);break;case"arrow-start":t(d,p);break;case"arrow-end":t(d,p,1);break;case"clip-rect":var A=b(p).split(j);if(4==A.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var B=q("clipPath"),C=q("rect");B.id=c.createUUID(),q(C,{x:A[0],y:A[1],width:A[2],height:A[3]}),B.appendChild(C),d.paper.defs.appendChild(B),q(i,{"clip-path":"url(#"+B.id+")"}),d.clip=C}if(!p){var D=i.getAttribute("clip-path");if(D){var E=c._g.doc.getElementById(D.replace(/(^url\(#|\)$)/g,l));E&&E.parentNode.removeChild(E),q(i,{"clip-path":l}),delete d.clip}}break;case"path":"path"==d.type&&(q(i,{d:p?k.path=c._pathToAbsolute(p):"M0,0"}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case"width":if(i.setAttribute(o,p),d._.dirty=1,!k.fx)break;o="x",p=k.x;case"x":k.fx&&(p=-k.x-(k.width||0));case"rx":if("rx"==o&&"rect"==d.type)break;case"cx":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"height":if(i.setAttribute(o,p),d._.dirty=1,!k.fy)break;o="y",p=k.y;case"y":k.fy&&(p=-k.y-(k.height||0));case"ry":if("ry"==o&&"rect"==d.type)break;case"cy":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"r":"rect"==d.type?q(i,{rx:p,ry:p}):i.setAttribute(o,p),d._.dirty=1;break;case"src":"image"==d.type&&i.setAttributeNS(n,"href",p);break;case"stroke-width":(1!=d._.sx||1!=d._.sy)&&(p/=g(h(d._.sx),h(d._.sy))||1),i.setAttribute(o,p),k["stroke-dasharray"]&&v(d,k["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"stroke-dasharray":v(d,p,f);break;case"fill":var F=b(p).match(c._ISURL);if(F){B=q("pattern");var G=q("image");B.id=c.createUUID(),q(B,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),q(G,{x:0,y:0,"xlink:href":F[1]}),B.appendChild(G),function(a){c._preload(F[1],function(){var b=this.offsetWidth,c=this.offsetHeight;q(a,{width:b,height:c}),q(G,{width:b,height:c}),d.paper.safari()})}(B),d.paper.defs.appendChild(B),q(i,{fill:"url(#"+B.id+")"}),d.pattern=B,d.pattern&&s(d);break}var H=c.getRGB(p);if(H.error){if(("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p)){if("opacity"in k||"fill-opacity"in k){var I=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l));if(I){var J=I.getElementsByTagName("stop");q(J[J.length-1],{"stop-opacity":("opacity"in k?k.opacity:1)*("fill-opacity"in k?k["fill-opacity"]:1)})}}k.gradient=p,k.fill="none";break}}else delete f.gradient,delete k.gradient,!c.is(k.opacity,"undefined")&&c.is(f.opacity,"undefined")&&q(i,{opacity:k.opacity}),!c.is(k["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&q(i,{"fill-opacity":k["fill-opacity"]});H[a]("opacity")&&q(i,{"fill-opacity":H.opacity>1?H.opacity/100:H.opacity});case"stroke":H=c.getRGB(p),i.setAttribute(o,H.hex),"stroke"==o&&H[a]("opacity")&&q(i,{"stroke-opacity":H.opacity>1?H.opacity/100:H.opacity}),"stroke"==o&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p);break;
case"opacity":k.gradient&&!k[a]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){I=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),I&&(J=I.getElementsByTagName("stop"),q(J[J.length-1],{"stop-opacity":p}));break}default:"font-size"==o&&(p=e(p,10)+"px");var K=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[K]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if("text"==d.type&&(f[a]("text")||f[a]("font")||f[a]("font-size")||f[a]("x")||f[a]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(c._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[a]("text")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=b(f.text).split("\n"),m=[],n=0,o=k.length;o>n;n++)j=q("tspan"),n&&q(j,{dy:i*x,x:g.x}),j.appendChild(c._g.doc.createTextNode(k[n])),h.appendChild(j),m[n]=j}else for(m=h.getElementsByTagName("tspan"),n=0,o=m.length;o>n;n++)n?q(m[n],{dy:i*x,x:g.x}):q(m[0],{dy:0});q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&c.is(r,"finite")&&q(m[0],{dy:r})}},z=function(a){return a.parentNode&&"a"===a.parentNode.tagName.toLowerCase()?a.parentNode:a},A=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.matrix=c.matrix(),this.realPath=null,this.paper=b,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},B=c.el;A.prototype=B,B.constructor=A,c._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new A(c,b);return d.type="path",w(d,{fill:"none",stroke:"#000",path:a}),d},B.rotate=function(a,c,e){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this.transform(this._.transform.concat([["r",a,c,e]])),this},B.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this},B.translate=function(a,c){return this.removed?this:(a=b(a).split(j),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this.transform(this._.transform.concat([["t",a,c]])),this)},B.transform=function(b){var d=this._;if(null==b)return d.transform;if(c._extractTransform(this,b),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix}),1!=d.sx||1!=d.sy){var e=this.attrs[a]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},B.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},B.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},B.remove=function(){var a=z(this.node);if(!this.removed&&a.parentNode){var b=this.paper;b.__set__&&b.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&b.defs.removeChild(this.gradient),c._tear(this,b),a.parentNode.removeChild(a),this.removeData();for(var d in this)this[d]="function"==typeof this[d]?c._removedFactory(d):null;this.removed=!0}},B._getBBox=function(){if("none"==this.node.style.display){this.show();var a=!0}var b,c=!1;this.paper.canvas.parentElement?b=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(b=this.paper.canvas.parentNode.style),b&&"none"==b.display&&(c=!0,b.display="");var d={};try{d=this.node.getBBox()}catch(e){d={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{d=d||{},c&&(b.display="none")}return a&&this.hide(),d},B.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;for(var g=b.split(j),h={},i=0,l=g.length;l>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return l-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,l=b.length;l>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var m={};m[b]=d}else null!=b&&c.is(b,"object")&&(m=b);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[a](n)&&m[a](n)&&c.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[a](p)&&(m[p]=o[p])}return w(this,m),this},B.toFront=function(){if(this.removed)return this;var a=z(this.node);a.parentNode.appendChild(a);var b=this.paper;return b.top!=this&&c._tofront(this,b),this},B.toBack=function(){if(this.removed)return this;var a=z(this.node),b=a.parentNode;b.insertBefore(a,b.firstChild),c._toback(this,this.paper);this.paper;return this},B.insertAfter=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[a.length-1].node);return d.nextSibling?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.appendChild(b),c._insertafter(this,a,this.paper),this},B.insertBefore=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[0].node);return d.parentNode.insertBefore(b,d),c._insertbefore(this,a,this.paper),this},B.blur=function(a){var b=this;if(0!==+a){var d=q("filter"),e=q("feGaussianBlur");b.attrs.blur=a,d.id=c.createUUID(),q(e,{stdDeviation:+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,q(b.node,{filter:"url(#"+d.id+")"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter");return b},c._engine.circle=function(a,b,c,d){var e=q("circle");a.canvas&&a.canvas.appendChild(e);var f=new A(e,a);return f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",q(e,f.attrs),f},c._engine.rect=function(a,b,c,d,e,f){var g=q("rect");a.canvas&&a.canvas.appendChild(g);var h=new A(g,a);return h.attrs={x:b,y:c,width:d,height:e,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",q(g,h.attrs),h},c._engine.ellipse=function(a,b,c,d,e){var f=q("ellipse");a.canvas&&a.canvas.appendChild(f);var g=new A(f,a);return g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",q(f,g.attrs),g},c._engine.image=function(a,b,c,d,e,f){var g=q("image");q(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(n,"href",b),a.canvas&&a.canvas.appendChild(g);var h=new A(g,a);return h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image",h},c._engine.text=function(a,b,d,e){var f=q("text");a.canvas&&a.canvas.appendChild(f);var g=new A(f,a);return g.attrs={x:b,y:d,"text-anchor":"middle",text:e,"font-family":c._availableAttrs["font-family"],"font-size":c._availableAttrs["font-size"],stroke:"none",fill:"#000"},g.type="text",w(g,g.attrs),g},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error("SVG container not found.");var h,i=q("svg"),j="overflow:hidden;";return d=d||0,e=e||0,f=f||512,g=g||342,q(i,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==b?(i.style.cssText=j+"position:absolute;left:"+d+"px;top:"+e+"px",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+"position:relative",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){k("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=this.getSize(),j=g(c/i.width,d/i.height),l=this.top,n=e?"xMidYMid meet":"xMinYMin";for(null==a?(this._vbSize&&(j=1),delete this._vbSize,f="0 0 "+this.width+m+this.height):(this._vbSize=j,f=a+m+b+m+c+m+d),q(this.canvas,{viewBox:f,preserveAspectRatio:n});j&&l;)h="stroke-width"in l.attrs?l.attrs["stroke-width"]:1,l.attr({"stroke-width":h}),l._.dirty=1,l._.dirtyT=1,l=l.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+"px"),f&&(this._top=(this._top+f)%1,c.top=this._top+"px"))},c.prototype.clear=function(){c.eve("raphael.clear",this);for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=q("desc")).appendChild(c._g.doc.createTextNode("Created with Raphaël "+c.version)),a.appendChild(this.desc),a.appendChild(this.defs=q("defs"))},c.prototype.remove=function(){k("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null};var C=c.st;for(var D in B)B[a](D)&&!C[a](D)&&(C[D]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(D))}}(),function(){if(c.vml){var a="hasOwnProperty",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j="fill",k=/[, ]+/,l=c.eve,m=" progid:DXImageTransform.Microsoft",n=" ",o="",p={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\S+Blur\([^\)]+\)/g,s=/-?[^,\s-]+/g,t="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",u=21600,v={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(q,function(a,b,c){var d=[],e="m"==b.toLowerCase(),g=p[b];return c.replace(s,function(a){e&&2==d.length&&(g+=d+p["m"==b?"l":"L"],d=[]),d.push(f(a*u))}),g+d});return g}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),"z"==i&&(i="x");for(var m=1,r=h.length;r>m;m++)i+=f(h[m]*u)+(m!=r-1?",":o);g.push(i)}return g.join(n)},y=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{dx:e.x(b,d),dy:e.y(b,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p="",q=u/b,r=u/c;if(m.visibility="hidden",b&&c){if(l.coordsize=i(q)+n+i(r),m.rotation=f*(0>b*c?-1:1),f){var s=y(f,d,e);d=s.dx,e=s.dy}if(0>b&&(p+="x"),0>c&&(p+=" y")&&(o=-1),m.flip=p,l.coordorigin=d*-q+n+e*-r,k||g.fillsize){var t=l.getElementsByTagName(j);t=t&&t[0],l.removeChild(t),k&&(s=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),t.position=s.dx*o+n+s.dy*o),g.fillsize&&(t.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(t)}m.visibility="visible"}};c.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var A=function(a,c,d){for(var e=b(c).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";g--;)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),r=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),s=e;for(var t in i)i[a](t)&&(m[t]=i[t]);if(q&&(m.path=c._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),"blur"in i&&e.blur(i.blur),(i.path&&"path"==e.type||q)&&(l.path=x(~b(m.path).toLowerCase().indexOf("r")?c._pathToAbsolute(m.path):m.path),e._.dirty=1,"image"==e.type&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0))),"transform"in i&&e.transform(i.transform),r){var y=+m.cx,B=+m.cy,D=+m.rx||+m.r||0,E=+m.ry||+m.r||0;l.path=c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((y-D)*u),f((B-E)*u),f((y+D)*u),f((B+E)*u),f(y*u)),e._.dirty=1}if("clip-rect"in i){var G=b(i["clip-rect"]).split(k);if(4==G.length){G[2]=+G[2]+ +G[0],G[3]=+G[3]+ +G[1];var H=l.clipRect||c._g.doc.createElement("div"),I=H.style;I.clip=c.format("rect({1}px {2}px {3}px {0}px)",G),l.clipRect||(I.position="absolute",I.top=0,I.left=0,I.width=e.paper.width+"px",I.height=e.paper.height+"px",l.parentNode.insertBefore(H,l),H.appendChild(l),l.clipRect=H)}i["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(e.textpath){var J=e.textpath.style;i.font&&(J.font=i.font),i["font-family"]&&(J.fontFamily='"'+i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,o)+'"'),i["font-size"]&&(J.fontSize=i["font-size"]),i["font-weight"]&&(J.fontWeight=i["font-weight"]),i["font-style"]&&(J.fontStyle=i["font-style"])}if("arrow-start"in i&&A(s,i["arrow-start"]),"arrow-end"in i&&A(s,i["arrow-end"],1),null!=i.opacity||null!=i["stroke-width"]||null!=i.fill||null!=i.src||null!=i.stroke||null!=i["stroke-width"]||null!=i["stroke-opacity"]||null!=i["fill-opacity"]||null!=i["stroke-dasharray"]||null!=i["stroke-miterlimit"]||null!=i["stroke-linejoin"]||null!=i["stroke-linecap"]){var K=l.getElementsByTagName(j),L=!1;if(K=K&&K[0],!K&&(L=K=F(j)),"image"==e.type&&i.src&&(K.src=i.src),i.fill&&(K.on=!0),(null==K.on||"none"==i.fill||null===i.fill)&&(K.on=!1),K.on&&i.fill){var M=b(i.fill).match(c._ISURL);if(M){K.parentNode==l&&l.removeChild(K),K.rotate=!0,K.src=M[1],K.type="tile";var N=e.getBBox(1);K.position=N.x+n+N.y,e._.fillpos=[N.x,N.y],c._preload(M[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else K.color=c.getRGB(i.fill).hex,K.src=o,K.type="solid",c.getRGB(i.fill).error&&(s.type in{circle:1,ellipse:1}||"r"!=b(i.fill).charAt())&&C(s,i.fill,K)&&(m.fill="none",m.gradient=i.fill,K.rotate=!1)}if("fill-opacity"in i||"opacity"in i){var O=((+m["fill-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+c.getRGB(i.fill).o+1||2)-1);O=h(g(O,0),1),K.opacity=O,K.src&&(K.color="none")}l.appendChild(K);var P=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],Q=!1;!P&&(Q=P=F("stroke")),(i.stroke&&"none"!=i.stroke||i["stroke-width"]||null!=i["stroke-opacity"]||i["stroke-dasharray"]||i["stroke-miterlimit"]||i["stroke-linejoin"]||i["stroke-linecap"])&&(P.on=!0),("none"==i.stroke||null===i.stroke||null==P.on||0==i.stroke||0==i["stroke-width"])&&(P.on=!1);var R=c.getRGB(i.stroke);P.on&&i.stroke&&(P.color=R.hex),O=((+m["stroke-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+R.o+1||2)-1);var S=.75*(d(i["stroke-width"])||1);if(O=h(g(O,0),1),null==i["stroke-width"]&&(S=m["stroke-width"]),i["stroke-width"]&&(P.weight=S),S&&1>S&&(O*=S)&&(P.weight=1),P.opacity=O,i["stroke-linejoin"]&&(P.joinstyle=i["stroke-linejoin"]||"miter"),P.miterlimit=i["stroke-miterlimit"]||8,i["stroke-linecap"]&&(P.endcap="butt"==i["stroke-linecap"]?"flat":"square"==i["stroke-linecap"]?"square":"round"),"stroke-dasharray"in i){var T={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};P.dashstyle=T[a](i["stroke-dasharray"])?T[i["stroke-dasharray"]]:o}Q&&l.appendChild(P)}if("text"==s.type){s.paper.canvas.style.display=o;var U=s.paper.span,V=100,W=m.font&&m.font.match(/\d+(?:\.\d*)?(?=px)/);p=U.style,m.font&&(p.font=m.font),m["font-family"]&&(p.fontFamily=m["font-family"]),m["font-weight"]&&(p.fontWeight=m["font-weight"]),m["font-style"]&&(p.fontStyle=m["font-style"]),W=d(m["font-size"]||W&&W[0])||10,p.fontSize=W*V+"px",s.textpath.string&&(U.innerHTML=b(s.textpath.string).replace(/"));var X=U.getBoundingClientRect();s.W=m.w=(X.right-X.left)/V,s.H=m.h=(X.bottom-X.top)/V,s.X=m.x,s.Y=m.y+s.H/2,("x"in i||"y"in i)&&(s.path.v=c.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));for(var Y=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,$=Y.length;$>Z;Z++)if(Y[Z]in i){s._.dirty=1;break}switch(m["text-anchor"]){case"start":s.textpath.style["v-text-align"]="left",s.bbx=s.W/2;break;case"end":s.textpath.style["v-text-align"]="right",s.bbx=-s.W/2;break;default:s.textpath.style["v-text-align"]="center",s.bbx=0}s.textpath.style["v-text-kern"]=!0}},C=function(a,f,g){a.attrs=a.attrs||{};var h=(a.attrs,Math.pow),i="linear",j=".5 .5";if(a.attrs.gradient=f,f=b(f).replace(c._radial_gradient,function(a,b,c){return i="radial",b&&c&&(b=d(b),c=d(c),h(b-.5,2)+h(c-.5,2)>.25&&(c=e.sqrt(.25-h(b-.5,2))*(2*(c>.5)-1)+.5),j=b+n+c),o}),f=f.split(/\s*\-\s*/),"linear"==i){var k=f.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(f);if(!l)return null;if(a=a.shape||a.node,l.length){a.removeChild(g),g.on=!0,g.method="none",g.color=l[0].color,g.color2=l[l.length-1].color;for(var m=[],p=0,q=l.length;q>p;p++)l[p].offset&&m.push(l[p].offset+n+l[p].color);g.colors=m.length?m.join():"0% "+g.color,"radial"==i?(g.type="gradientTitle",g.focus="100%",g.focussize="0 0",g.focusposition=j,g.angle=0):(g.type="gradient",g.angle=(270-k)%360),a.appendChild(g)}return 1},D=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=b,this.matrix=c.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},E=c.el;D.prototype=E,E.constructor=D,E.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?"s"+[e.scale,e.scale]+"-1-1t"+[e.dx,e.dy]:o;e&&(d=a=b(a).replace(/\.{3}|\u2026/g,this._.transform||o)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf("-"),l=!b(this.attrs.fill).indexOf("url(");if(h.translate(1,1),l||k||"image"==this.type)if(i.matrix="1 0 0 1",i.offset="0 0",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;j.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else j.style.filter=o,z(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=o,i.matrix=b(h),i.offset=h.offset();return null!==d&&(this._.transform=d,c._extractTransform(this,d)),this},E.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,c,e]])),this}},E.translate=function(a,c){return this.removed?this:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([["t",a,c]])),this)},E.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this._.dirtyT=1,this},E.hide=function(){return!this.removed&&(this.node.style.display="none"),this},E.show=function(){return!this.removed&&(this.node.style.display=o),this},E.auxGetBBox=c.el.getBBox,E.getBBox=function(){var a=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var b={},c=1/this.paper._viewBoxShift.scale;return b.x=a.x-this.paper._viewBoxShift.dx,b.x*=c,b.y=a.y-this.paper._viewBoxShift.dy,b.y*=c,b.width=a.width*c,b.height=a.height*c,b.x2=b.x+b.width,b.y2=b.y+b.height,b}return a},E._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},E.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),c.eve.unbind("raphael.*.*."+this.id),c._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;this.removed=!0}},E.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if(b==j&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var g=b.split(k),h={},i=0,m=g.length;m>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return m-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,"array")){for(h={},i=0,m=b.length;m>i;i++)h[b[i]]=this.attr(b[i]);return h}var n;null!=d&&(n={},n[b]=d),null==d&&c.is(b,"object")&&(n=b);for(var o in n)l("raphael.attr."+o+"."+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[a](o)&&n[a](o)&&c.is(this.paper.customAttributes[o],"function")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[a](q)&&(n[q]=p[q])}n.text&&"text"==this.type&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&c._tofront(this,this.paper),this},E.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper)),this)},E.insertAfter=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[a.length-1]),a.node.nextSibling?a.node.parentNode.insertBefore(this.node,a.node.nextSibling):a.node.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this)},E.insertBefore=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[0]),a.node.parentNode.insertBefore(this.node,a.node),c._insertbefore(this,a,this.paper),this)},E.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(r,o),0!==+a?(this.attrs.blur=a,b.filter=d+n+m+".Blur(pixelradius="+(+a||1.5)+")",b.margin=c.format("-{0}px 0 0 -{0}px",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},c._engine.path=function(a,b){var c=F("shape");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={fill:"none",stroke:"#000"};a&&(e.path=a),d.type="path",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F("skew");return f.on=!0,c.appendChild(f),d.skew=f,d.transform(o),d},c._engine.rect=function(a,b,d,e,f,g){var h=c._rectPath(b,d,e,f,g),i=a.path(h),j=i.attrs;return i.X=j.x=b,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type="rect",i},c._engine.ellipse=function(a,b,c,d,e){{var f=a.path();f.attrs}return f.X=b-d,f.Y=c-e,f.W=2*d,f.H=2*e,f.type="ellipse",B(f,{cx:b,cy:c,rx:d,ry:e}),f},c._engine.circle=function(a,b,c,d){{var e=a.path();e.attrs}return e.X=b-d,e.Y=c-d,e.W=e.H=2*d,e.type="circle",B(e,{cx:b,cy:c,r:d}),e},c._engine.image=function(a,b,d,e,f,g){var h=c._rectPath(d,e,f,g),i=a.path(h).attr({stroke:"none"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];return k.src=b,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type="image",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=b,m.type="tile",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0),i},c._engine.text=function(a,d,e,g){var h=F("shape"),i=F("path"),j=F("textpath");d=d||0,e=e||0,g=g||"",i.v=c.format("m{0},{1}l{2},{1}",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=b(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin="0 0";var k=new D(h,a),l={fill:"#000",stroke:"none",font:c._availableAttrs.font,text:g};k.shape=h,k.path=i,k.textpath=j,k.type="text",k.attrs.text=b(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),a.canvas.appendChild(h);var m=F("skew");return m.on=!0,h.appendChild(m),k.skew=m,k.transform(o),k},c._engine.setSize=function(a,b){var d=this.canvas.style;return this.width=a,this.height=b,a==+a&&(a+="px"),b==+b&&(b+="px"),d.width=a,d.height=b,d.clip="rect(0 "+a+" "+b+" 0)",this._viewBox&&c._engine.setViewBox.apply(this,this._viewBox),this},c._engine.setViewBox=function(a,b,d,e,f){c.eve("raphael.setViewBox",this,this._viewBox,[a,b,d,e,f]);var g,h,i=this.getSize(),j=i.width,k=i.height;return f&&(g=k/e,h=j/d,j>d*g&&(a-=(j-d*g)/2/g),k>e*h&&(b-=(k-e*h)/2/h)),this._viewBox=[a,b,d,e,!!f],this._viewBoxShift={dx:-a,dy:-b,scale:i},this.forEach(function(a){a.transform("...")}),this};var F;c._engine.initWin=function(a){var b=a.document;b.styleSheets.length<31?b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):b.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),F=function(a){return b.createElement("')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},c._engine.initWin(c._g.win),c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a.container,d=a.height,e=a.width,f=a.x,g=a.y;if(!b)throw new Error("VML container not found.");var h=new c._Paper,i=h.canvas=c._g.doc.createElement("div"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+="px"),d==+d&&(d+="px"),h.coordsize=1e3*u+n+1e3*u,h.coordorigin="0 0",h.span=c._g.doc.createElement("span"),h.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",i.appendChild(h.span),j.cssText=c.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,d),1==b?(c._g.doc.body.appendChild(i),j.left=f+"px",j.top=g+"px",j.position="absolute"):b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i),h.renderfix=function(){},h},c.prototype.clear=function(){c.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=c._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},c.prototype.remove=function(){c.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;return!0};var G=c.st;for(var H in E)E[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),B.was?A.win.Raphael=c:Raphael=c,"object"==typeof exports&&(module.exports=c),c});
================================================
FILE: static/assets/plugins/select2/.bower.json
================================================
{
"name": "select2",
"version": "3.5.2",
"main": [
"select2.js",
"select2.css",
"select2.png",
"select2x2.png",
"select2-spinner.gif"
],
"dependencies": {
"jquery": ">= 1.7.1"
},
"homepage": "https://github.com/ivaynberg/select2",
"_release": "3.5.2",
"_resolution": {
"type": "version",
"tag": "3.5.2",
"commit": "0a7ed096f05155bf2a901cf289602cb3aef2f651"
},
"_source": "git://github.com/ivaynberg/select2.git",
"_target": "3.5.2",
"_originalSource": "select2"
}
================================================
FILE: static/assets/plugins/select2/.gitignore
================================================
.idea
================================================
FILE: static/assets/plugins/select2/CONTRIBUTING.md
================================================
Contributing to Select2
=======================
Looking to contribute something to Select2? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
Using the issue tracker
-----------------------
When [reporting bugs][reporting-bugs] or
[requesting features][requesting-features], the
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
The issue tracker **is not** a place for support requests. The
[mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
get help.
Reporting bugs with Select2
---------------------------
We really appreciate clear bug reports that _consistently_ show an issue
_within Select2_.
The ideal bug report follows these guidelines:
1. **Use the [GitHub issue search][issue-search]** — Check if the issue
has already been reported.
2. **Check if the issue has been fixed** — Try to reproduce the problem
using the code in the `master` branch.
3. **Isolate the problem** — Try to create an
[isolated test case][isolated-case] that consistently reproduces the problem.
Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
to are:
- What steps can be used to reproduce the issue?
- What is the bug and what is the expected outcome?
- What browser(s) and Operating System have you tested with?
- Does the bug happen consistently across all tested browsers?
- What version of jQuery are you using? And what version of Select2?
- Are you using Select2 with other plugins?
All of these questions will help people fix and identify any potential bugs.
Requesting features in Select2
------------------------------
Select2 is a large library that carries with it a lot of functionality. Because
of this, many feature requests will not be implemented in the core library.
Before starting work on a major feature for Select2, **contact the
[community][community] first** or you may risk spending a considerable amount of
time on something which the project developers are not interested in bringing
into the project.
### Select2 4.0
Many feature requests will be closed off until 4.0, where Select2 plans to adopt
a more flexible API. If you are interested in helping with the development of
the next major Select2 release, please send a message to the
[mailing list][mailing-list] or [irc channel][irc-channel] for more information.
Triaging issues and pull requests
---------------------------------
Anyone can help the project maintainers triage issues and review pull requests.
### Handling new issues
Select2 regularly receives new issues which need to be tested and organized.
When a new issue that comes in that is similar to another existing issue, it
should be checked to make sure it is not a duplicate. Duplicates issues should
be marked by replying to the issue with "Duplicate of #[issue number]" where
`[issue number]` is the url or issue number for the existing issue. This will
allow the project maintainers to quickly close off additional issues and keep
the discussion focused within a single issue.
If you can test issues that are reported to Select2 that contain test cases and
confirm under what conditions bugs happen, that will allow others to identify
what causes a bug quicker.
### Reviewing pull requests
It is very common for pull requests to be opened for issues that contain a clear
solution to the problem. These pull requests should be rigorously reviewed by
the community before being accepted. If you are not sure about a piece of
submitted code, or know of a better way to do something, do not hesitate to make
a comment on the pull request.
It should also be made clear that **all code contributed to Select** must be
licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
be released under either of these licenses **cannot be accepted** into the
project.
[community]: https://github.com/ivaynberg/select2#community
[reporting-bugs]: #reporting-bugs-with-select2
[requesting-features]: #requesting-features-in-select2
[issue-tracker]: https://github.com/ivaynberg/select2/issues
[mailing-list]: https://github.com/ivaynberg/select2#mailing-list
[irc-channel]: https://github.com/ivaynberg/select2#irc-channel
[issue-search]: https://github.com/ivaynberg/select2/search?q=&type=Issues
[isolated-case]: http://css-tricks.com/6263-reduced-test-cases/
[licensing]: https://github.com/ivaynberg/select2#copyright-and-license
================================================
FILE: static/assets/plugins/select2/LICENSE
================================================
Copyright 2014 Igor Vaynberg
Version: @@ver@@ Timestamp: @@timestamp@@
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
================================================
FILE: static/assets/plugins/select2/README.md
================================================
Select2
=======
Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
To get started, checkout examples and documentation at http://ivaynberg.github.com/select2
Use cases
---------
* Enhancing native selects with search.
* Enhancing native selects with a better multi-select interface.
* Loading data from JavaScript: easily load items via ajax and have them searchable.
* Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction.
* Tagging: ability to add new items on the fly.
* Working with large, remote datasets: ability to partially load a dataset based on the search term.
* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end.
* Templating: support for custom rendering of results and selections.
Browser compatibility
---------------------
* IE 8+
* Chrome 8+
* Firefox 10+
* Safari 3+
* Opera 10.6+
Usage
-----
You can source Select2 directly from a CDN like [JSDliver](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below.
Integrations
------------
* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/))
* [Django](https://github.com/applegrew/django-select2)
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
* [Symfony2](https://github.com/avocode/FormExtensions)
* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
* [Meteor](https://jquery-select2.meteor.com)
* [Yii 2.x](http://demos.krajee.com/widgets#select2)
* [Yii 1.x](https://github.com/tonybolzan/yii-select2)
* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
### Example Integrations
* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
Internationalization (i18n)
---------------------------
Select2 supports multiple languages by simply including the right language JS
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
Missing a language? Just copy `select2_locale_en.js.template`, translate
it, and make a pull request back to Select2 here on GitHub.
Documentation
-------------
The documentation for Select2 is available [through GitHub Pages](https://ivaynberg.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages).
Community
---------
### Bug tracker
Have a bug? Please create an issue here on GitHub!
https://github.com/ivaynberg/select2/issues
### Mailing list
Have a question? Ask on our mailing list!
select2@googlegroups.com
https://groups.google.com/d/forum/select2
### IRC channel
Need help implementing Select2 in your project? Ask in our IRC channel!
**Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`)
**Channel:** `#select2`
**Web access:** https://webchat.freenode.net/?channels=select2
Copyright and license
---------------------
Copyright 2012 Igor Vaynberg
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
================================================
FILE: static/assets/plugins/select2/bower.json
================================================
{
"name": "select2",
"version": "3.5.2",
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
"dependencies": {
"jquery": ">= 1.7.1"
}
}
================================================
FILE: static/assets/plugins/select2/component.json
================================================
{
"name": "select2",
"repo": "ivaynberg/select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"version": "3.5.2",
"demo": "http://ivaynberg.github.io/select2/",
"keywords": [
"jquery"
],
"main": "select2.js",
"styles": [
"select2.css",
"select2-bootstrap.css"
],
"scripts": [
"select2.js",
"select2_locale_ar.js",
"select2_locale_bg.js",
"select2_locale_ca.js",
"select2_locale_cs.js",
"select2_locale_da.js",
"select2_locale_de.js",
"select2_locale_el.js",
"select2_locale_es.js",
"select2_locale_et.js",
"select2_locale_eu.js",
"select2_locale_fa.js",
"select2_locale_fi.js",
"select2_locale_fr.js",
"select2_locale_gl.js",
"select2_locale_he.js",
"select2_locale_hr.js",
"select2_locale_hu.js",
"select2_locale_id.js",
"select2_locale_is.js",
"select2_locale_it.js",
"select2_locale_ja.js",
"select2_locale_ka.js",
"select2_locale_ko.js",
"select2_locale_lt.js",
"select2_locale_lv.js",
"select2_locale_mk.js",
"select2_locale_ms.js",
"select2_locale_nl.js",
"select2_locale_no.js",
"select2_locale_pl.js",
"select2_locale_pt-BR.js",
"select2_locale_pt-PT.js",
"select2_locale_ro.js",
"select2_locale_ru.js",
"select2_locale_sk.js",
"select2_locale_sv.js",
"select2_locale_th.js",
"select2_locale_tr.js",
"select2_locale_uk.js",
"select2_locale_vi.js",
"select2_locale_zh-CN.js",
"select2_locale_zh-TW.js"
],
"images": [
"select2-spinner.gif",
"select2.png",
"select2x2.png"
],
"license": "MIT"
}
================================================
FILE: static/assets/plugins/select2/composer.json
================================================
{
"name":
"ivaynberg/select2",
"description": "Select2 is a jQuery based replacement for select boxes.",
"version": "3.5.2",
"type": "component",
"homepage": "http://ivaynberg.github.io/select2/",
"license": "Apache-2.0",
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.7.1"
},
"extra": {
"component": {
"scripts": [
"select2.js"
],
"files": [
"select2.js",
"select2_locale_*.js",
"select2.css",
"select2-bootstrap.css",
"select2-spinner.gif",
"select2.png",
"select2x2.png"
]
}
}
}
================================================
FILE: static/assets/plugins/select2/package.json
================================================
{
"name" : "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"homepage": "http://ivaynberg.github.io/select2",
"author": "Igor Vaynberg",
"repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"},
"main": "select2.js",
"version": "3.5.2",
"jspm": {
"main": "select2",
"files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],
"shim": {
"select2": {
"imports": ["jquery", "./select2.css!"],
"exports": "$"
}
},
"buildConfig": { "uglify": true }
}
}
================================================
FILE: static/assets/plugins/select2/release.sh
================================================
#!/bin/bash
set -e
echo -n "Enter the version for this release: "
read ver
if [ ! $ver ]; then
echo "Invalid version."
exit
fi
name="select2"
js="$name.js"
mini="$name.min.js"
css="$name.css"
release="$name-$ver"
tag="$ver"
branch="build-$ver"
curbranch=`git branch | grep "*" | sed "s/* //"`
timestamp=$(date)
tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g"
remote="origin"
echo "Pulling from origin"
git pull
echo "Updating Version Identifiers"
sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json
git add bower.json
git add select2.jquery.json
git add component.json
git add composer.json
git add package.json
git commit -m "modified version identifiers in descriptors for release $ver"
git push
git branch "$branch"
git checkout "$branch"
echo "Tokenizing..."
find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {}
find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {}
sed -e "s/latest/$ver/g" -i -- bower.json
git add "$js"
git add "$css"
echo "Minifying..."
echo "/*" > "$mini"
cat LICENSE | sed "$tokens" >> "$mini"
echo "*/" >> "$mini"
curl -s \
--data-urlencode "js_code@$js" \
http://marijnhaverbeke.nl/uglifyjs \
>> "$mini"
git add "$mini"
git commit -m "release $ver"
echo "Tagging..."
git tag -a "$tag" -m "tagged version $ver"
git push "$remote" --tags
echo "Cleaning Up..."
git checkout "$curbranch"
git branch -D "$branch"
echo "Done"
================================================
FILE: static/assets/plugins/select2/select2-bootstrap.css
================================================
.form-control .select2-choice {
border: 0;
border-radius: 2px;
}
.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
}
.form-control.select2-container {
height: auto !important;
padding: 0;
}
.form-control.select2-container.select2-dropdown-open {
border-color: #5897FB;
border-radius: 3px 3px 0 0;
}
.form-control .select2-container.select2-dropdown-open .select2-choices {
border-radius: 3px 3px 0 0;
}
.form-control.select2-container .select2-choices {
border: 0 !important;
border-radius: 3px;
}
.control-group.warning .select2-container .select2-choice,
.control-group.warning .select2-container .select2-choices,
.control-group.warning .select2-container-active .select2-choice,
.control-group.warning .select2-container-active .select2-choices,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.warning .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #C09853 !important;
}
.control-group.warning .select2-container .select2-choice div {
border-left: 1px solid #C09853 !important;
background: #FCF8E3 !important;
}
.control-group.error .select2-container .select2-choice,
.control-group.error .select2-container .select2-choices,
.control-group.error .select2-container-active .select2-choice,
.control-group.error .select2-container-active .select2-choices,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.error .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #B94A48 !important;
}
.control-group.error .select2-container .select2-choice div {
border-left: 1px solid #B94A48 !important;
background: #F2DEDE !important;
}
.control-group.info .select2-container .select2-choice,
.control-group.info .select2-container .select2-choices,
.control-group.info .select2-container-active .select2-choice,
.control-group.info .select2-container-active .select2-choices,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.info .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #3A87AD !important;
}
.control-group.info .select2-container .select2-choice div {
border-left: 1px solid #3A87AD !important;
background: #D9EDF7 !important;
}
.control-group.success .select2-container .select2-choice,
.control-group.success .select2-container .select2-choices,
.control-group.success .select2-container-active .select2-choice,
.control-group.success .select2-container-active .select2-choices,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.success .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #468847 !important;
}
.control-group.success .select2-container .select2-choice div {
border-left: 1px solid #468847 !important;
background: #DFF0D8 !important;
}
================================================
FILE: static/assets/plugins/select2/select2.css
================================================
/*
Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
*/
.select2-container {
margin: 0;
position: relative;
display: inline-block;
/* inline-block for ie7 */
zoom: 1;
*display: inline;
vertical-align: middle;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input {
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-webkit-box-sizing: border-box; /* webkit */
-moz-box-sizing: border-box; /* firefox */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
border-radius: 4px;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
}
html[dir="rtl"] .select2-container .select2-choice {
padding: 0 8px 0 0;
}
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
border-radius: 0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
}
.select2-container.select2-allowclear .select2-choice .select2-chosen {
margin-right: 42px;
}
.select2-container .select2-choice > .select2-chosen {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: none;
width: auto;
}
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
margin-left: 26px;
margin-right: 0;
}
.select2-container .select2-choice abbr {
display: none;
width: 12px;
height: 12px;
position: absolute;
right: 24px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
.select2-container.select2-allowclear .select2-choice abbr {
display: inline-block;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop-mask {
border: 0;
margin: 0;
padding: 0;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 9998;
/* styles required for IE to work */
background-color: #fff;
filter: alpha(opacity=0);
}
.select2-drop {
width: 100%;
margin-top: -1px;
position: absolute;
z-index: 9999;
top: 100%;
background: #fff;
color: #000;
border: 1px solid #aaa;
border-top: 0;
border-radius: 0 0 4px 4px;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
}
.select2-drop.select2-drop-above {
margin-top: 1px;
border-top: 1px solid #aaa;
border-bottom: 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-drop-active {
border: 1px solid #5897fb;
border-top: none;
}
.select2-drop.select2-drop-above.select2-drop-active {
border-top: 1px solid #5897fb;
}
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-drop-auto-width .select2-search {
padding-top: 4px;
}
.select2-container .select2-choice .select2-arrow {
display: inline-block;
width: 18px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: 1px solid #aaa;
border-radius: 0 4px 4px 0;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
left: 0;
right: auto;
border-left: none;
border-right: 1px solid #aaa;
border-radius: 4px 0 0 4px;
}
.select2-container .select2-choice .select2-arrow b {
display: block;
width: 100%;
height: 100%;
background: url('select2.png') no-repeat 0 1px;
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
background-position: 2px 1px;
}
.select2-search {
display: inline-block;
width: 100%;
min-height: 26px;
margin: 0;
padding-left: 4px;
padding-right: 4px;
position: relative;
z-index: 10000;
white-space: nowrap;
}
.select2-search input {
width: 100%;
height: auto !important;
min-height: 26px;
padding: 4px 20px 4px 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: #fff url('select2.png') no-repeat 100% -22px;
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
html[dir="rtl"] .select2-search input {
padding: 4px 5px 4px 20px;
background: #fff url('select2.png') no-repeat -37px -22px;
background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-drop.select2-drop-above .select2-search input {
margin-top: 4px;
}
.select2-search input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100%;
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
box-shadow: 0 1px 0 #fff inset;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to top, #fff 0%, #eee 50%);
}
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices {
border: 1px solid #5897fb;
border-top-color: transparent;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
}
.select2-dropdown-open .select2-choice .select2-arrow {
background: transparent;
border-left: none;
filter: none;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
border-right: none;
}
.select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -18px 1px;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -16px 1px;
}
.select2-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/* results */
.select2-results {
max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html[dir="rtl"] .select2-results {
padding: 0 4px 0 0;
margin: 4px 0 4px 4px;
}
.select2-results ul.select2-result-sub {
margin: 0;
padding-left: 0;
}
.select2-results li {
list-style: none;
display: list-item;
background-image: none;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
min-height: 1em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select2-results-dept-1 .select2-result-label { padding-left: 20px }
.select2-results-dept-2 .select2-result-label { padding-left: 40px }
.select2-results-dept-3 .select2-result-label { padding-left: 60px }
.select2-results-dept-4 .select2-result-label { padding-left: 80px }
.select2-results-dept-5 .select2-result-label { padding-left: 100px }
.select2-results-dept-6 .select2-result-label { padding-left: 110px }
.select2-results-dept-7 .select2-result-label { padding-left: 120px }
.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-highlighted ul {
background: #fff;
color: #000;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-ajax-error,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
padding-left: 5px;
}
/*
disabled look for disabled choices in the results dropdown
*/
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-selected {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
}
.select2-results .select2-ajax-error {
background: rgba(255, 50, 50, .2);
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice .select2-arrow {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
.select2-container.select2-container-disabled .select2-choice abbr {
display: none;
}
/* multiselect */
.select2-container-multi .select2-choices {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
border: 1px solid #aaa;
cursor: text;
overflow: hidden;
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
}
html[dir="rtl"] .select2-container-multi .select2-choices {
padding: 0 0 0 5px;
}
.select2-locked {
padding: 3px 5px 3px 5px !important;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
html[dir="rtl"] .select2-container-multi .select2-choices li
{
float: right;
}
.select2-container-multi .select2-choices .select2-search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 5px;
margin: 1px 0;
font-family: sans-serif;
font-size: 100%;
color: #666;
outline: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: transparent !important;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
{
margin: 3px 5px 3px 0;
padding: 3px 18px 3px 5px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 4px;
font-size: 1px;
outline: none;
background: url('select2.png') right top no-repeat;
}
html[dir="rtl"] .select2-search-choice-close {
right: auto;
left: 3px;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
left: auto;
right: 2px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
padding: 3px 5px 3px 5px;
border: 1px solid #ddd;
background-image: none;
background-color: #f4f4f4;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
background: none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-match {
text-decoration: underline;
}
.select2-offscreen, .select2-offscreen:focus {
clip: rect(0 0 0 0) !important;
width: 1px !important;
height: 1px !important;
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
position: absolute !important;
outline: 0 !important;
left: 0px !important;
top: 0px !important;
}
.select2-display-none {
display: none;
}
.select2-measure-scrollbar {
position: absolute;
top: -10000px;
left: -10000px;
width: 100px;
height: 100px;
overflow: scroll;
}
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
.select2-search input,
.select2-search-choice-close,
.select2-container .select2-choice abbr,
.select2-container .select2-choice .select2-arrow b {
background-image: url('select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}
================================================
FILE: static/assets/plugins/select2/select2.jquery.json
================================================
{
"name": "select2",
"title": "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"keywords": [
"select",
"autocomplete",
"typeahead",
"dropdown",
"multiselect",
"tag",
"tagging"
],
"version": "3.5.2",
"author": {
"name": "Igor Vaynberg",
"url": "https://github.com/ivaynberg"
},
"licenses": [
{
"type": "Apache",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
},
{
"type": "GPL v2",
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
}
],
"bugs": "https://github.com/ivaynberg/select2/issues",
"homepage": "http://ivaynberg.github.com/select2",
"docs": "http://ivaynberg.github.com/select2/",
"download": "https://github.com/ivaynberg/select2/tags",
"dependencies": {
"jquery": ">=1.7.1"
}
}
================================================
FILE: static/assets/plugins/select2/select2.js
================================================
/*
Copyright 2012 Igor Vaynberg
Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the
Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
the specific language governing permissions and limitations under the Apache License and the GPL License.
*/
(function ($) {
if(typeof $.fn.each2 == "undefined") {
$.extend($.fn, {
/*
* 4-10 times faster .each replacement
* use it carefully, as it overrides jQuery context of element on each iteration
*/
each2 : function (c) {
var j = $([0]), i = -1, l = this.length;
while (
++i < l
&& (j.context = j[0] = this[i])
&& c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object
);
return this;
}
});
}
})(jQuery);
(function ($, undefined) {
"use strict";
/*global document, window, jQuery, console */
if (window.Select2 !== undefined) {
return;
}
var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
lastMousePosition={x:0,y:0}, $document, scrollBarDimensions,
KEY = {
TAB: 9,
ENTER: 13,
ESC: 27,
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAGE_UP: 33,
PAGE_DOWN: 34,
HOME: 36,
END: 35,
BACKSPACE: 8,
DELETE: 46,
isArrow: function (k) {
k = k.which ? k.which : k;
switch (k) {
case KEY.LEFT:
case KEY.RIGHT:
case KEY.UP:
case KEY.DOWN:
return true;
}
return false;
},
isControl: function (e) {
var k = e.which;
switch (k) {
case KEY.SHIFT:
case KEY.CTRL:
case KEY.ALT:
return true;
}
if (e.metaKey) return true;
return false;
},
isFunctionKey: function (k) {
k = k.which ? k.which : k;
return k >= 112 && k <= 123;
}
},
MEASURE_SCROLLBAR_TEMPLATE = "
",
DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"};
$document = $(document);
nextUid=(function() { var counter=1; return function() { return counter++; }; }());
function reinsertElement(element) {
var placeholder = $(document.createTextNode(''));
element.before(placeholder);
placeholder.before(element);
placeholder.remove();
}
function stripDiacritics(str) {
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
function match(a) {
return DIACRITICS[a] || a;
}
return str.replace(/[^\u0000-\u007E]/g, match);
}
function indexOf(value, array) {
var i = 0, l = array.length;
for (; i < l; i = i + 1) {
if (equal(value, array[i])) return i;
}
return -1;
}
function measureScrollbar () {
var $template = $( MEASURE_SCROLLBAR_TEMPLATE );
$template.appendTo(document.body);
var dim = {
width: $template.width() - $template[0].clientWidth,
height: $template.height() - $template[0].clientHeight
};
$template.remove();
return dim;
}
/**
* Compares equality of a and b
* @param a
* @param b
*/
function equal(a, b) {
if (a === b) return true;
if (a === undefined || b === undefined) return false;
if (a === null || b === null) return false;
// Check whether 'a' or 'b' is a string (primitive or object).
// The concatenation of an empty string (+'') converts its argument to a string's primitive.
if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object
if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object
return false;
}
/**
* Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty
* strings
* @param string
* @param separator
*/
function splitVal(string, separator, transform) {
var val, i, l;
if (string === null || string.length < 1) return [];
val = string.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]);
return val;
}
function getSideBorderPadding(element) {
return element.outerWidth(false) - element.width();
}
function installKeyUpChangeEvent(element) {
var key="keyup-change-value";
element.on("keydown", function () {
if ($.data(element, key) === undefined) {
$.data(element, key, element.val());
}
});
element.on("keyup", function () {
var val= $.data(element, key);
if (val !== undefined && element.val() !== val) {
$.removeData(element, key);
element.trigger("keyup-change");
}
});
}
/**
* filters mouse events so an event is fired only if the mouse moved.
*
* filters out mouse events that occur when mouse is stationary but
* the elements under the pointer are scrolled.
*/
function installFilteredMouseMove(element) {
element.on("mousemove", function (e) {
var lastpos = lastMousePosition;
if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
$(e.target).trigger("mousemove-filtered", e);
}
});
}
/**
* Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
* within the last quietMillis milliseconds.
*
* @param quietMillis number of milliseconds to wait before invoking fn
* @param fn function to be debounced
* @param ctx object to be used as this reference within fn
* @return debounced version of fn
*/
function debounce(quietMillis, fn, ctx) {
ctx = ctx || undefined;
var timeout;
return function () {
var args = arguments;
window.clearTimeout(timeout);
timeout = window.setTimeout(function() {
fn.apply(ctx, args);
}, quietMillis);
};
}
function installDebouncedScroll(threshold, element) {
var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
element.on("scroll", function (e) {
if (indexOf(e.target, element.get()) >= 0) notify(e);
});
}
function focus($el) {
if ($el[0] === document.activeElement) return;
/* set the focus in a 0 timeout - that way the focus is set after the processing
of the current event has finished - which seems like the only reliable way
to set focus */
window.setTimeout(function() {
var el=$el[0], pos=$el.val().length, range;
$el.focus();
/* make sure el received focus so we do not error out when trying to manipulate the caret.
sometimes modals or others listeners may steal it after its set */
var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
if (isVisible && el === document.activeElement) {
/* after the focus is set move the caret to the end, necessary when we val()
just before setting focus */
if(el.setSelectionRange)
{
el.setSelectionRange(pos, pos);
}
else if (el.createTextRange) {
range = el.createTextRange();
range.collapse(false);
range.select();
}
}
}, 0);
}
function getCursorInfo(el) {
el = $(el)[0];
var offset = 0;
var length = 0;
if ('selectionStart' in el) {
offset = el.selectionStart;
length = el.selectionEnd - offset;
} else if ('selection' in document) {
el.focus();
var sel = document.selection.createRange();
length = document.selection.createRange().text.length;
sel.moveStart('character', -el.value.length);
offset = sel.text.length - length;
}
return { offset: offset, length: length };
}
function killEvent(event) {
event.preventDefault();
event.stopPropagation();
}
function killEventImmediately(event) {
event.preventDefault();
event.stopImmediatePropagation();
}
function measureTextWidth(e) {
if (!sizer){
var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
sizer = $(document.createElement("div")).css({
position: "absolute",
left: "-10000px",
top: "-10000px",
display: "none",
fontSize: style.fontSize,
fontFamily: style.fontFamily,
fontStyle: style.fontStyle,
fontWeight: style.fontWeight,
letterSpacing: style.letterSpacing,
textTransform: style.textTransform,
whiteSpace: "nowrap"
});
sizer.attr("class","select2-sizer");
$(document.body).append(sizer);
}
sizer.text(e.val());
return sizer.width();
}
function syncCssClasses(dest, src, adapter) {
var classes, replacements = [], adapted;
classes = $.trim(dest.attr("class"));
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(/\s+/)).each2(function() {
if (this.indexOf("select2-") === 0) {
replacements.push(this);
}
});
}
classes = $.trim(src.attr("class"));
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(/\s+/)).each2(function() {
if (this.indexOf("select2-") !== 0) {
adapted = adapter(this);
if (adapted) {
replacements.push(adapted);
}
}
});
}
dest.attr("class", replacements.join(" "));
}
function markMatch(text, term, markup, escapeMarkup) {
var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),
tl=term.length;
if (match<0) {
markup.push(escapeMarkup(text));
return;
}
markup.push(escapeMarkup(text.substring(0, match)));
markup.push("");
markup.push(escapeMarkup(text.substring(match, match + tl)));
markup.push(" ");
markup.push(escapeMarkup(text.substring(match + tl, text.length)));
}
function defaultEscapeMarkup(markup) {
var replace_map = {
'\\': '\',
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
"/": '/'
};
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
return replace_map[match];
});
}
/**
* Produces an ajax-based query function
*
* @param options object containing configuration parameters
* @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax
* @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax
* @param options.url url for the data
* @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
* @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified
* @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
* @param options.results a function(remoteData, pageNumber, query) that converts data returned form the remote request to the format expected by Select2.
* The expected format is an object containing the following keys:
* results array of objects that will be used as choices
* more (optional) boolean indicating whether there are more results available
* Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
*/
function ajax(options) {
var timeout, // current scheduled but not yet executed request
handler = null,
quietMillis = options.quietMillis || 100,
ajaxUrl = options.url,
self = this;
return function (query) {
window.clearTimeout(timeout);
timeout = window.setTimeout(function () {
var data = options.data, // ajax data function
url = ajaxUrl, // ajax url string or function
transport = options.transport || $.fn.select2.ajaxDefaults.transport,
// deprecated - to be removed in 4.0 - use params instead
deprecated = {
type: options.type || 'GET', // set type of request (GET or POST)
cache: options.cache || false,
jsonpCallback: options.jsonpCallback||undefined,
dataType: options.dataType||"json"
},
params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated);
data = data ? data.call(self, query.term, query.page, query.context) : null;
url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
if (handler && typeof handler.abort === "function") { handler.abort(); }
if (options.params) {
if ($.isFunction(options.params)) {
$.extend(params, options.params.call(self));
} else {
$.extend(params, options.params);
}
}
$.extend(params, {
url: url,
dataType: options.dataType,
data: data,
success: function (data) {
// TODO - replace query.page with query so users have access to term, page, etc.
// added query as third paramter to keep backwards compatibility
var results = options.results(data, query.page, query);
query.callback(results);
},
error: function(jqXHR, textStatus, errorThrown){
var results = {
hasError: true,
jqXHR: jqXHR,
textStatus: textStatus,
errorThrown: errorThrown
};
query.callback(results);
}
});
handler = transport.call(self, params);
}, quietMillis);
};
}
/**
* Produces a query function that works with a local array
*
* @param options object containing configuration parameters. The options parameter can either be an array or an
* object.
*
* If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
*
* If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
* an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
* key can either be a String in which case it is expected that each element in the 'data' array has a key with the
* value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract
* the text.
*/
function local(options) {
var data = options, // data elements
dataText,
tmp,
text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
if ($.isArray(data)) {
tmp = data;
data = { results: tmp };
}
if ($.isFunction(data) === false) {
tmp = data;
data = function() { return tmp; };
}
var dataItem = data();
if (dataItem.text) {
text = dataItem.text;
// if text is not a function we assume it to be a key name
if (!$.isFunction(text)) {
dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
text = function (item) { return item[dataText]; };
}
}
return function (query) {
var t = query.term, filtered = { results: [] }, process;
if (t === "") {
query.callback(data());
return;
}
process = function(datum, collection) {
var group, attr;
datum = datum[0];
if (datum.children) {
group = {};
for (attr in datum) {
if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
}
group.children=[];
$(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
if (group.children.length || query.matcher(t, text(group), datum)) {
collection.push(group);
}
} else {
if (query.matcher(t, text(datum), datum)) {
collection.push(datum);
}
}
};
$(data().results).each2(function(i, datum) { process(datum, filtered.results); });
query.callback(filtered);
};
}
// TODO javadoc
function tags(data) {
var isFunc = $.isFunction(data);
return function (query) {
var t = query.term, filtered = {results: []};
var result = isFunc ? data(query) : data;
if ($.isArray(result)) {
$(result).each(function () {
var isObject = this.text !== undefined,
text = isObject ? this.text : this;
if (t === "" || query.matcher(t, text)) {
filtered.results.push(isObject ? this : {id: this, text: this});
}
});
query.callback(filtered);
}
};
}
/**
* Checks if the formatter function should be used.
*
* Throws an error if it is not a function. Returns true if it should be used,
* false if no formatting should be performed.
*
* @param formatter
*/
function checkFormatter(formatter, formatterName) {
if ($.isFunction(formatter)) return true;
if (!formatter) return false;
if (typeof(formatter) === 'string') return true;
throw new Error(formatterName +" must be a string, function, or falsy value");
}
/**
* Returns a given value
* If given a function, returns its output
*
* @param val string|function
* @param context value of "this" to be passed to function
* @returns {*}
*/
function evaluate(val, context) {
if ($.isFunction(val)) {
var args = Array.prototype.slice.call(arguments, 2);
return val.apply(context, args);
}
return val;
}
function countResults(results) {
var count = 0;
$.each(results, function(i, item) {
if (item.children) {
count += countResults(item.children);
} else {
count++;
}
});
return count;
}
/**
* Default tokenizer. This function uses breaks the input on substring match of any string from the
* opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
* two options have to be defined in order for the tokenizer to work.
*
* @param input text user has typed so far or pasted into the search field
* @param selection currently selected choices
* @param selectCallback function(choice) callback tho add the choice to selection
* @param opts select2's opts
* @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value
*/
function defaultTokenizer(input, selection, selectCallback, opts) {
var original = input, // store the original so we can compare and know if we need to tell the search to update its text
dupe = false, // check for whether a token we extracted represents a duplicate selected choice
token, // token
index, // position at which the separator was found
i, l, // looping variables
separator; // the matched separator
if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined;
while (true) {
index = -1;
for (i = 0, l = opts.tokenSeparators.length; i < l; i++) {
separator = opts.tokenSeparators[i];
index = input.indexOf(separator);
if (index >= 0) break;
}
if (index < 0) break; // did not find any token separator in the input string, bail
token = input.substring(0, index);
input = input.substring(index + separator.length);
if (token.length > 0) {
token = opts.createSearchChoice.call(this, token, selection);
if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
dupe = false;
for (i = 0, l = selection.length; i < l; i++) {
if (equal(opts.id(token), opts.id(selection[i]))) {
dupe = true; break;
}
}
if (!dupe) selectCallback(token);
}
}
}
if (original!==input) return input;
}
function cleanupJQueryElements() {
var self = this;
$.each(arguments, function (i, element) {
self[element].remove();
self[element] = null;
});
}
/**
* Creates a new class
*
* @param superClass
* @param methods
*/
function clazz(SuperClass, methods) {
var constructor = function () {};
constructor.prototype = new SuperClass;
constructor.prototype.constructor = constructor;
constructor.prototype.parent = SuperClass.prototype;
constructor.prototype = $.extend(constructor.prototype, methods);
return constructor;
}
AbstractSelect2 = clazz(Object, {
// abstract
bind: function (func) {
var self = this;
return function () {
func.apply(self, arguments);
};
},
// abstract
init: function (opts) {
var results, search, resultsSelector = ".select2-results";
// prepare options
this.opts = opts = this.prepareOpts(opts);
this.id=opts.id;
// destroy if called on an existing component
if (opts.element.data("select2") !== undefined &&
opts.element.data("select2") !== null) {
opts.element.data("select2").destroy();
}
this.container = this.createContainer();
this.liveRegion = $('.select2-hidden-accessible');
if (this.liveRegion.length == 0) {
this.liveRegion = $("", {
role: "status",
"aria-live": "polite"
})
.addClass("select2-hidden-accessible")
.appendTo(document.body);
}
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
this.containerEventName= this.containerId
.replace(/([.])/g, '_')
.replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
this.container.attr("id", this.containerId);
this.container.attr("title", opts.element.attr("title"));
this.body = $(document.body);
syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
this.container.attr("style", opts.element.attr("style"));
this.container.css(evaluate(opts.containerCss, this.opts.element));
this.container.addClass(evaluate(opts.containerCssClass, this.opts.element));
this.elementTabIndex = this.opts.element.attr("tabindex");
// swap container for the element
this.opts.element
.data("select2", this)
.attr("tabindex", "-1")
.before(this.container)
.on("click.select2", killEvent); // do not leak click events
this.container.data("select2", this);
this.dropdown = this.container.find(".select2-drop");
syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element));
this.dropdown.data("select2", this);
this.dropdown.on("click", killEvent);
this.results = results = this.container.find(resultsSelector);
this.search = search = this.container.find("input.select2-input");
this.queryCount = 0;
this.resultsPage = 0;
this.context = null;
// initialize the container
this.initContainer();
this.container.on("click", killEvent);
installFilteredMouseMove(this.results);
this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent));
this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) {
this._touchEvent = true;
this.highlightUnderEvent(event);
}));
this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved));
this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved));
// Waiting for a click event on touch devices to select option and hide dropdown
// otherwise click will be triggered on an underlying element
this.dropdown.on('click', this.bind(function (event) {
if (this._touchEvent) {
this._touchEvent = false;
this.selectHighlighted();
}
}));
installDebouncedScroll(80, this.results);
this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded));
// do not propagate change event from the search field out of the component
$(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();});
$(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();});
// if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
if ($.fn.mousewheel) {
results.mousewheel(function (e, delta, deltaX, deltaY) {
var top = results.scrollTop();
if (deltaY > 0 && top - deltaY <= 0) {
results.scrollTop(0);
killEvent(e);
} else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
results.scrollTop(results.get(0).scrollHeight - results.height());
killEvent(e);
}
});
}
installKeyUpChangeEvent(search);
search.on("keyup-change input paste", this.bind(this.updateResults));
search.on("focus", function () { search.addClass("select2-focused"); });
search.on("blur", function () { search.removeClass("select2-focused");});
this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) {
if ($(e.target).closest(".select2-result-selectable").length > 0) {
this.highlightUnderEvent(e);
this.selectHighlighted(e);
}
}));
// trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
// for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
// dom it will trigger the popup close, which is not what we want
// focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); });
this.nextSearchTerm = undefined;
if ($.isFunction(this.opts.initSelection)) {
// initialize selection based on the current value of the source element
this.initSelection();
// if the user has provided a function that can set selection based on the value of the source element
// we monitor the change event on the element and trigger it, allowing for two way synchronization
this.monitorSource();
}
if (opts.maximumInputLength !== null) {
this.search.attr("maxlength", opts.maximumInputLength);
}
var disabled = opts.element.prop("disabled");
if (disabled === undefined) disabled = false;
this.enable(!disabled);
var readonly = opts.element.prop("readonly");
if (readonly === undefined) readonly = false;
this.readonly(readonly);
// Calculate size of scrollbar
scrollBarDimensions = scrollBarDimensions || measureScrollbar();
this.autofocus = opts.element.prop("autofocus");
opts.element.prop("autofocus", false);
if (this.autofocus) this.focus();
this.search.attr("placeholder", opts.searchInputPlaceholder);
},
// abstract
destroy: function () {
var element=this.opts.element, select2 = element.data("select2"), self = this;
this.close();
if (element.length && element[0].detachEvent && self._sync) {
element.each(function () {
if (self._sync) {
this.detachEvent("onpropertychange", self._sync);
}
});
}
if (this.propertyObserver) {
this.propertyObserver.disconnect();
this.propertyObserver = null;
}
this._sync = null;
if (select2 !== undefined) {
select2.container.remove();
select2.liveRegion.remove();
select2.dropdown.remove();
element
.show()
.removeData("select2")
.off(".select2")
.prop("autofocus", this.autofocus || false);
if (this.elementTabIndex) {
element.attr({tabindex: this.elementTabIndex});
} else {
element.removeAttr("tabindex");
}
element.show();
}
cleanupJQueryElements.call(this,
"container",
"liveRegion",
"dropdown",
"results",
"search"
);
},
// abstract
optionToData: function(element) {
if (element.is("option")) {
return {
id:element.prop("value"),
text:element.text(),
element: element.get(),
css: element.attr("class"),
disabled: element.prop("disabled"),
locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true)
};
} else if (element.is("optgroup")) {
return {
text:element.attr("label"),
children:[],
element: element.get(),
css: element.attr("class")
};
}
},
// abstract
prepareOpts: function (opts) {
var element, select, idKey, ajaxUrl, self = this;
element = opts.element;
if (element.get(0).tagName.toLowerCase() === "select") {
this.select = select = opts.element;
}
if (select) {
// these options are not allowed when attached to a select because they are picked up off the element itself
$.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
if (this in opts) {
throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a element.");
}
});
}
opts = $.extend({}, {
populateResults: function(container, results, query) {
var populate, id=this.opts.id, liveRegion=this.liveRegion;
populate=function(results, container, depth) {
var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted;
results = opts.sortResults(results, container, query);
// collect the created nodes for bulk append
var nodes = [];
for (i = 0, l = results.length; i < l; i = i + 1) {
result=results[i];
disabled = (result.disabled === true);
selectable = (!disabled) && (id(result) !== undefined);
compound=result.children && result.children.length > 0;
node=$(" ");
node.addClass("select2-results-dept-"+depth);
node.addClass("select2-result");
node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
if (disabled) { node.addClass("select2-disabled"); }
if (compound) { node.addClass("select2-result-with-children"); }
node.addClass(self.opts.formatResultCssClass(result));
node.attr("role", "presentation");
label=$(document.createElement("div"));
label.addClass("select2-result-label");
label.attr("id", "select2-result-label-" + nextUid());
label.attr("role", "option");
formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup);
if (formatted!==undefined) {
label.html(formatted);
node.append(label);
}
if (compound) {
innerContainer=$("");
innerContainer.addClass("select2-result-sub");
populate(result.children, innerContainer, depth+1);
node.append(innerContainer);
}
node.data("select2-data", result);
nodes.push(node[0]);
}
// bulk append the created nodes
container.append(nodes);
liveRegion.text(opts.formatMatches(results.length));
};
populate(results, container, 0);
}
}, $.fn.select2.defaults, opts);
if (typeof(opts.id) !== "function") {
idKey = opts.id;
opts.id = function (e) { return e[idKey]; };
}
if ($.isArray(opts.element.data("select2Tags"))) {
if ("tags" in opts) {
throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
}
opts.tags=opts.element.data("select2Tags");
}
if (select) {
opts.query = this.bind(function (query) {
var data = { results: [], more: false },
term = query.term,
children, placeholderOption, process;
process=function(element, collection) {
var group;
if (element.is("option")) {
if (query.matcher(term, element.text(), element)) {
collection.push(self.optionToData(element));
}
} else if (element.is("optgroup")) {
group=self.optionToData(element);
element.children().each2(function(i, elm) { process(elm, group.children); });
if (group.children.length>0) {
collection.push(group);
}
}
};
children=element.children();
// ignore the placeholder option if there is one
if (this.getPlaceholder() !== undefined && children.length > 0) {
placeholderOption = this.getPlaceholderOption();
if (placeholderOption) {
children=children.not(placeholderOption);
}
}
children.each2(function(i, elm) { process(elm, data.results); });
query.callback(data);
});
// this is needed because inside val() we construct choices from options and their id is hardcoded
opts.id=function(e) { return e.id; };
} else {
if (!("query" in opts)) {
if ("ajax" in opts) {
ajaxUrl = opts.element.data("ajax-url");
if (ajaxUrl && ajaxUrl.length > 0) {
opts.ajax.url = ajaxUrl;
}
opts.query = ajax.call(opts.element, opts.ajax);
} else if ("data" in opts) {
opts.query = local(opts.data);
} else if ("tags" in opts) {
opts.query = tags(opts.tags);
if (opts.createSearchChoice === undefined) {
opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
}
if (opts.initSelection === undefined) {
opts.initSelection = function (element, callback) {
var data = [];
$(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () {
var obj = { id: this, text: this },
tags = opts.tags;
if ($.isFunction(tags)) tags=tags();
$(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
data.push(obj);
});
callback(data);
};
}
}
}
}
if (typeof(opts.query) !== "function") {
throw "query function not defined for Select2 " + opts.element.attr("id");
}
if (opts.createSearchChoicePosition === 'top') {
opts.createSearchChoicePosition = function(list, item) { list.unshift(item); };
}
else if (opts.createSearchChoicePosition === 'bottom') {
opts.createSearchChoicePosition = function(list, item) { list.push(item); };
}
else if (typeof(opts.createSearchChoicePosition) !== "function") {
throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";
}
return opts;
},
/**
* Monitor the original element for changes and update select2 accordingly
*/
// abstract
monitorSource: function () {
var el = this.opts.element, observer, self = this;
el.on("change.select2", this.bind(function (e) {
if (this.opts.element.data("select2-change-triggered") !== true) {
this.initSelection();
}
}));
this._sync = this.bind(function () {
// sync enabled state
var disabled = el.prop("disabled");
if (disabled === undefined) disabled = false;
this.enable(!disabled);
var readonly = el.prop("readonly");
if (readonly === undefined) readonly = false;
this.readonly(readonly);
if (this.container) {
syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
}
if (this.dropdown) {
syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
}
});
// IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
if (el.length && el[0].attachEvent) {
el.each(function() {
this.attachEvent("onpropertychange", self._sync);
});
}
// safari, chrome, firefox, IE11
observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver;
if (observer !== undefined) {
if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
this.propertyObserver = new observer(function (mutations) {
$.each(mutations, self._sync);
});
this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
}
},
// abstract
triggerSelect: function(data) {
var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data });
this.opts.element.trigger(evt);
return !evt.isDefaultPrevented();
},
/**
* Triggers the change event on the source element
*/
// abstract
triggerChange: function (details) {
details = details || {};
details= $.extend({}, details, { type: "change", val: this.val() });
// prevents recursive triggering
this.opts.element.data("select2-change-triggered", true);
this.opts.element.trigger(details);
this.opts.element.data("select2-change-triggered", false);
// some validation frameworks ignore the change event and listen instead to keyup, click for selects
// so here we trigger the click event manually
this.opts.element.click();
// ValidationEngine ignores the change event and listens instead to blur
// so here we trigger the blur event manually if so desired
if (this.opts.blurOnChange)
this.opts.element.blur();
},
//abstract
isInterfaceEnabled: function()
{
return this.enabledInterface === true;
},
// abstract
enableInterface: function() {
var enabled = this._enabled && !this._readonly,
disabled = !enabled;
if (enabled === this.enabledInterface) return false;
this.container.toggleClass("select2-container-disabled", disabled);
this.close();
this.enabledInterface = enabled;
return true;
},
// abstract
enable: function(enabled) {
if (enabled === undefined) enabled = true;
if (this._enabled === enabled) return;
this._enabled = enabled;
this.opts.element.prop("disabled", !enabled);
this.enableInterface();
},
// abstract
disable: function() {
this.enable(false);
},
// abstract
readonly: function(enabled) {
if (enabled === undefined) enabled = false;
if (this._readonly === enabled) return;
this._readonly = enabled;
this.opts.element.prop("readonly", enabled);
this.enableInterface();
},
// abstract
opened: function () {
return (this.container) ? this.container.hasClass("select2-dropdown-open") : false;
},
// abstract
positionDropdown: function() {
var $dropdown = this.dropdown,
container = this.container,
offset = container.offset(),
height = container.outerHeight(false),
width = container.outerWidth(false),
dropHeight = $dropdown.outerHeight(false),
$window = $(window),
windowWidth = $window.width(),
windowHeight = $window.height(),
viewPortRight = $window.scrollLeft() + windowWidth,
viewportBottom = $window.scrollTop() + windowHeight,
dropTop = offset.top + height,
dropLeft = offset.left,
enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(),
dropWidth = $dropdown.outerWidth(false),
enoughRoomOnRight = function() {
return dropLeft + dropWidth <= viewPortRight;
},
enoughRoomOnLeft = function() {
return offset.left + viewPortRight + container.outerWidth(false) > dropWidth;
},
aboveNow = $dropdown.hasClass("select2-drop-above"),
bodyOffset,
above,
changeDirection,
css,
resultsListNode;
// always prefer the current above/below alignment, unless there is not enough room
if (aboveNow) {
above = true;
if (!enoughRoomAbove && enoughRoomBelow) {
changeDirection = true;
above = false;
}
} else {
above = false;
if (!enoughRoomBelow && enoughRoomAbove) {
changeDirection = true;
above = true;
}
}
//if we are changing direction we need to get positions when dropdown is hidden;
if (changeDirection) {
$dropdown.hide();
offset = this.container.offset();
height = this.container.outerHeight(false);
width = this.container.outerWidth(false);
dropHeight = $dropdown.outerHeight(false);
viewPortRight = $window.scrollLeft() + windowWidth;
viewportBottom = $window.scrollTop() + windowHeight;
dropTop = offset.top + height;
dropLeft = offset.left;
dropWidth = $dropdown.outerWidth(false);
$dropdown.show();
// fix so the cursor does not move to the left within the search-textbox in IE
this.focusSearch();
}
if (this.opts.dropdownAutoWidth) {
resultsListNode = $('.select2-results', $dropdown)[0];
$dropdown.addClass('select2-drop-auto-width');
$dropdown.css('width', '');
// Add scrollbar width to dropdown if vertical scrollbar is present
dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
dropWidth > width ? width = dropWidth : dropWidth = width;
dropHeight = $dropdown.outerHeight(false);
}
else {
this.container.removeClass('select2-drop-auto-width');
}
//console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
//console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body.scrollTop(), "enough?", enoughRoomAbove);
// fix positioning when body has an offset and is not position: static
if (this.body.css('position') !== 'static') {
bodyOffset = this.body.offset();
dropTop -= bodyOffset.top;
dropLeft -= bodyOffset.left;
}
if (!enoughRoomOnRight() && enoughRoomOnLeft()) {
dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
}
css = {
left: dropLeft,
width: width
};
if (above) {
css.top = offset.top - dropHeight;
css.bottom = 'auto';
this.container.addClass("select2-drop-above");
$dropdown.addClass("select2-drop-above");
}
else {
css.top = dropTop;
css.bottom = 'auto';
this.container.removeClass("select2-drop-above");
$dropdown.removeClass("select2-drop-above");
}
css = $.extend(css, evaluate(this.opts.dropdownCss, this.opts.element));
$dropdown.css(css);
},
// abstract
shouldOpen: function() {
var event;
if (this.opened()) return false;
if (this._enabled === false || this._readonly === true) return false;
event = $.Event("select2-opening");
this.opts.element.trigger(event);
return !event.isDefaultPrevented();
},
// abstract
clearDropdownAlignmentPreference: function() {
// clear the classes used to figure out the preference of where the dropdown should be opened
this.container.removeClass("select2-drop-above");
this.dropdown.removeClass("select2-drop-above");
},
/**
* Opens the dropdown
*
* @return {Boolean} whether or not dropdown was opened. This method will return false if, for example,
* the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
*/
// abstract
open: function () {
if (!this.shouldOpen()) return false;
this.opening();
// Only bind the document mousemove when the dropdown is visible
$document.on("mousemove.select2Event", function (e) {
lastMousePosition.x = e.pageX;
lastMousePosition.y = e.pageY;
});
return true;
},
/**
* Performs the opening of the dropdown
*/
// abstract
opening: function() {
var cid = this.containerEventName,
scroll = "scroll." + cid,
resize = "resize."+cid,
orient = "orientationchange."+cid,
mask;
this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
this.clearDropdownAlignmentPreference();
if(this.dropdown[0] !== this.body.children().last()[0]) {
this.dropdown.detach().appendTo(this.body);
}
// create the dropdown mask if doesn't already exist
mask = $("#select2-drop-mask");
if (mask.length === 0) {
mask = $(document.createElement("div"));
mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
mask.hide();
mask.appendTo(this.body);
mask.on("mousedown touchstart click", function (e) {
// Prevent IE from generating a click event on the body
reinsertElement(mask);
var dropdown = $("#select2-drop"), self;
if (dropdown.length > 0) {
self=dropdown.data("select2");
if (self.opts.selectOnBlur) {
self.selectHighlighted({noFocus: true});
}
self.close();
e.preventDefault();
e.stopPropagation();
}
});
}
// ensure the mask is always right before the dropdown
if (this.dropdown.prev()[0] !== mask[0]) {
this.dropdown.before(mask);
}
// move the global id to the correct dropdown
$("#select2-drop").removeAttr("id");
this.dropdown.attr("id", "select2-drop");
// show the elements
mask.show();
this.positionDropdown();
this.dropdown.show();
this.positionDropdown();
this.dropdown.addClass("select2-drop-active");
// attach listeners to events that can change the position of the container and thus require
// the position of the dropdown to be updated as well so it does not come unglued from the container
var that = this;
this.container.parents().add(window).each(function () {
$(this).on(resize+" "+scroll+" "+orient, function (e) {
if (that.opened()) that.positionDropdown();
});
});
},
// abstract
close: function () {
if (!this.opened()) return;
var cid = this.containerEventName,
scroll = "scroll." + cid,
resize = "resize."+cid,
orient = "orientationchange."+cid;
// unbind event listeners
this.container.parents().add(window).each(function () { $(this).off(scroll).off(resize).off(orient); });
this.clearDropdownAlignmentPreference();
$("#select2-drop-mask").hide();
this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id
this.dropdown.hide();
this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
this.results.empty();
// Now that the dropdown is closed, unbind the global document mousemove event
$document.off("mousemove.select2Event");
this.clearSearch();
this.search.removeClass("select2-active");
this.opts.element.trigger($.Event("select2-close"));
},
/**
* Opens control, sets input value, and updates results.
*/
// abstract
externalSearch: function (term) {
this.open();
this.search.val(term);
this.updateResults(false);
},
// abstract
clearSearch: function () {
},
//abstract
getMaximumSelectionSize: function() {
return evaluate(this.opts.maximumSelectionSize, this.opts.element);
},
// abstract
ensureHighlightVisible: function () {
var results = this.results, children, index, child, hb, rb, y, more, topOffset;
index = this.highlight();
if (index < 0) return;
if (index == 0) {
// if the first element is highlighted scroll all the way to the top,
// that way any unselectable headers above it will also be scrolled
// into view
results.scrollTop(0);
return;
}
children = this.findHighlightableChoices().find('.select2-result-label');
child = $(children[index]);
topOffset = (child.offset() || {}).top || 0;
hb = topOffset + child.outerHeight(true);
// if this is the last child lets also make sure select2-more-results is visible
if (index === children.length - 1) {
more = results.find("li.select2-more-results");
if (more.length > 0) {
hb = more.offset().top + more.outerHeight(true);
}
}
rb = results.offset().top + results.outerHeight(false);
if (hb > rb) {
results.scrollTop(results.scrollTop() + (hb - rb));
}
y = topOffset - results.offset().top;
// make sure the top of the element is visible
if (y < 0 && child.css('display') != 'none' ) {
results.scrollTop(results.scrollTop() + y); // y is negative
}
},
// abstract
findHighlightableChoices: function() {
return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
},
// abstract
moveHighlight: function (delta) {
var choices = this.findHighlightableChoices(),
index = this.highlight();
while (index > -1 && index < choices.length) {
index += delta;
var choice = $(choices[index]);
if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
this.highlight(index);
break;
}
}
},
// abstract
highlight: function (index) {
var choices = this.findHighlightableChoices(),
choice,
data;
if (arguments.length === 0) {
return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
}
if (index >= choices.length) index = choices.length - 1;
if (index < 0) index = 0;
this.removeHighlight();
choice = $(choices[index]);
choice.addClass("select2-highlighted");
// ensure assistive technology can determine the active choice
this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
this.ensureHighlightVisible();
this.liveRegion.text(choice.text());
data = choice.data("select2-data");
if (data) {
this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
}
},
removeHighlight: function() {
this.results.find(".select2-highlighted").removeClass("select2-highlighted");
},
touchMoved: function() {
this._touchMoved = true;
},
clearTouchMoved: function() {
this._touchMoved = false;
},
// abstract
countSelectableResults: function() {
return this.findHighlightableChoices().length;
},
// abstract
highlightUnderEvent: function (event) {
var el = $(event.target).closest(".select2-result-selectable");
if (el.length > 0 && !el.is(".select2-highlighted")) {
var choices = this.findHighlightableChoices();
this.highlight(choices.index(el));
} else if (el.length == 0) {
// if we are over an unselectable item remove all highlights
this.removeHighlight();
}
},
// abstract
loadMoreIfNeeded: function () {
var results = this.results,
more = results.find("li.select2-more-results"),
below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
page = this.resultsPage + 1,
self=this,
term=this.search.val(),
context=this.context;
if (more.length === 0) return;
below = more.offset().top - results.offset().top - results.height();
if (below <= this.opts.loadMorePadding) {
more.addClass("select2-active");
this.opts.query({
element: this.opts.element,
term: term,
page: page,
context: context,
matcher: this.opts.matcher,
callback: this.bind(function (data) {
// ignore a response if the select2 has been closed before it was received
if (!self.opened()) return;
self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
self.postprocessResults(data, false, false);
if (data.more===true) {
more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore, self.opts.element, page+1)));
window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
} else {
more.remove();
}
self.positionDropdown();
self.resultsPage = page;
self.context = data.context;
this.opts.element.trigger({ type: "select2-loaded", items: data });
})});
}
},
/**
* Default tokenizer function which does nothing
*/
tokenize: function() {
},
/**
* @param initial whether or not this is the call to this method right after the dropdown has been opened
*/
// abstract
updateResults: function (initial) {
var search = this.search,
results = this.results,
opts = this.opts,
data,
self = this,
input,
term = search.val(),
lastTerm = $.data(this.container, "select2-last-term"),
// sequence number used to drop out-of-order responses
queryNumber;
// prevent duplicate queries against the same term
if (initial !== true && lastTerm && equal(term, lastTerm)) return;
$.data(this.container, "select2-last-term", term);
// if the search is currently hidden we do not alter the results
if (initial !== true && (this.showSearchInput === false || !this.opened())) {
return;
}
function postRender() {
search.removeClass("select2-active");
self.positionDropdown();
if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
self.liveRegion.text(results.text());
}
else {
self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length));
}
}
function render(html) {
results.html(html);
postRender();
}
queryNumber = ++this.queryCount;
var maxSelSize = this.getMaximumSelectionSize();
if (maxSelSize >=1) {
data = this.data();
if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
render("" + evaluate(opts.formatSelectionTooBig, opts.element, maxSelSize) + " ");
return;
}
}
if (search.val().length < opts.minimumInputLength) {
if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
render("" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + " ");
} else {
render("");
}
if (initial && this.showSearch) this.showSearch(true);
return;
}
if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
render("" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + " ");
} else {
render("");
}
return;
}
if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
render("" + evaluate(opts.formatSearching, opts.element) + " ");
}
search.addClass("select2-active");
this.removeHighlight();
// give the tokenizer a chance to pre-process the input
input = this.tokenize();
if (input != undefined && input != null) {
search.val(input);
}
this.resultsPage = 1;
opts.query({
element: opts.element,
term: search.val(),
page: this.resultsPage,
context: null,
matcher: opts.matcher,
callback: this.bind(function (data) {
var def; // default choice
// ignore old responses
if (queryNumber != this.queryCount) {
return;
}
// ignore a response if the select2 has been closed before it was received
if (!this.opened()) {
this.search.removeClass("select2-active");
return;
}
// handle ajax error
if(data.hasError !== undefined && checkFormatter(opts.formatAjaxError, "formatAjaxError")) {
render("" + evaluate(opts.formatAjaxError, opts.element, data.jqXHR, data.textStatus, data.errorThrown) + " ");
return;
}
// save context, if any
this.context = (data.context===undefined) ? null : data.context;
// create a default choice and prepend it to the list
if (this.opts.createSearchChoice && search.val() !== "") {
def = this.opts.createSearchChoice.call(self, search.val(), data.results);
if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
if ($(data.results).filter(
function () {
return equal(self.id(this), self.id(def));
}).length === 0) {
this.opts.createSearchChoicePosition(data.results, def);
}
}
}
if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
render("" + evaluate(opts.formatNoMatches, opts.element, search.val()) + " ");
return;
}
results.empty();
self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
results.append("" + opts.escapeMarkup(evaluate(opts.formatLoadMore, opts.element, this.resultsPage)) + " ");
window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
}
this.postprocessResults(data, initial);
postRender();
this.opts.element.trigger({ type: "select2-loaded", items: data });
})});
},
// abstract
cancel: function () {
this.close();
},
// abstract
blur: function () {
// if selectOnBlur == true, select the currently highlighted option
if (this.opts.selectOnBlur)
this.selectHighlighted({noFocus: true});
this.close();
this.container.removeClass("select2-container-active");
// synonymous to .is(':focus'), which is available in jquery >= 1.6
if (this.search[0] === document.activeElement) { this.search.blur(); }
this.clearSearch();
this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
},
// abstract
focusSearch: function () {
focus(this.search);
},
// abstract
selectHighlighted: function (options) {
if (this._touchMoved) {
this.clearTouchMoved();
return;
}
var index=this.highlight(),
highlighted=this.results.find(".select2-highlighted"),
data = highlighted.closest('.select2-result').data("select2-data");
if (data) {
this.highlight(index);
this.onSelect(data, options);
} else if (options && options.noFocus) {
this.close();
}
},
// abstract
getPlaceholder: function () {
var placeholderOption;
return this.opts.element.attr("placeholder") ||
this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
this.opts.element.data("placeholder") ||
this.opts.placeholder ||
((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined);
},
// abstract
getPlaceholderOption: function() {
if (this.select) {
var firstOption = this.select.children('option').first();
if (this.opts.placeholderOption !== undefined ) {
//Determine the placeholder option based on the specified placeholderOption setting
return (this.opts.placeholderOption === "first" && firstOption) ||
(typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select));
} else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") {
//No explicit placeholder option specified, use the first if it's blank
return firstOption;
}
}
},
/**
* Get the desired width for the container element. This is
* derived first from option `width` passed to select2, then
* the inline 'style' on the original element, and finally
* falls back to the jQuery calculated element width.
*/
// abstract
initContainerWidth: function () {
function resolveContainerWidth() {
var style, attrs, matches, i, l, attr;
if (this.opts.width === "off") {
return null;
} else if (this.opts.width === "element"){
return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
} else if (this.opts.width === "copy" || this.opts.width === "resolve") {
// check if there is inline style on the element that contains width
style = this.opts.element.attr('style');
if (style !== undefined) {
attrs = style.split(';');
for (i = 0, l = attrs.length; i < l; i = i + 1) {
attr = attrs[i].replace(/\s/g, '');
matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);
if (matches !== null && matches.length >= 1)
return matches[1];
}
}
if (this.opts.width === "resolve") {
// next check if css('width') can resolve a width that is percent based, this is sometimes possible
// when attached to input type=hidden or elements hidden via css
style = this.opts.element.css('width');
if (style.indexOf("%") > 0) return style;
// finally, fallback on the calculated width of the element
return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
}
return null;
} else if ($.isFunction(this.opts.width)) {
return this.opts.width();
} else {
return this.opts.width;
}
};
var width = resolveContainerWidth.call(this);
if (width !== null) {
this.container.css("width", width);
}
}
});
SingleSelect2 = clazz(AbstractSelect2, {
// single
createContainer: function () {
var container = $(document.createElement("div")).attr({
"class": "select2-container"
}).html([
"",
" ",
" ",
" ",
" ",
" ",
"",
"
",
" ",
" ",
"
",
"
",
"
"].join(""));
return container;
},
// single
enableInterface: function() {
if (this.parent.enableInterface.apply(this, arguments)) {
this.focusser.prop("disabled", !this.isInterfaceEnabled());
}
},
// single
opening: function () {
var el, range, len;
if (this.opts.minimumResultsForSearch >= 0) {
this.showSearch(true);
}
this.parent.opening.apply(this, arguments);
if (this.showSearchInput !== false) {
// IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range
// all other browsers handle this just fine
this.search.val(this.focusser.val());
}
if (this.opts.shouldFocusInput(this)) {
this.search.focus();
// move the cursor to the end after focussing, otherwise it will be at the beginning and
// new text will appear *before* focusser.val()
el = this.search.get(0);
if (el.createTextRange) {
range = el.createTextRange();
range.collapse(false);
range.select();
} else if (el.setSelectionRange) {
len = this.search.val().length;
el.setSelectionRange(len, len);
}
}
// initializes search's value with nextSearchTerm (if defined by user)
// ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
if(this.search.val() === "") {
if(this.nextSearchTerm != undefined){
this.search.val(this.nextSearchTerm);
this.search.select();
}
}
this.focusser.prop("disabled", true).val("");
this.updateResults(true);
this.opts.element.trigger($.Event("select2-open"));
},
// single
close: function () {
if (!this.opened()) return;
this.parent.close.apply(this, arguments);
this.focusser.prop("disabled", false);
if (this.opts.shouldFocusInput(this)) {
this.focusser.focus();
}
},
// single
focus: function () {
if (this.opened()) {
this.close();
} else {
this.focusser.prop("disabled", false);
if (this.opts.shouldFocusInput(this)) {
this.focusser.focus();
}
}
},
// single
isFocused: function () {
return this.container.hasClass("select2-container-active");
},
// single
cancel: function () {
this.parent.cancel.apply(this, arguments);
this.focusser.prop("disabled", false);
if (this.opts.shouldFocusInput(this)) {
this.focusser.focus();
}
},
// single
destroy: function() {
$("label[for='" + this.focusser.attr('id') + "']")
.attr('for', this.opts.element.attr("id"));
this.parent.destroy.apply(this, arguments);
cleanupJQueryElements.call(this,
"selection",
"focusser"
);
},
// single
initContainer: function () {
var selection,
container = this.container,
dropdown = this.dropdown,
idSuffix = nextUid(),
elementLabel;
if (this.opts.minimumResultsForSearch < 0) {
this.showSearch(false);
} else {
this.showSearch(true);
}
this.selection = selection = container.find(".select2-choice");
this.focusser = container.find(".select2-focusser");
// add aria associations
selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix);
this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix);
this.results.attr("id", "select2-results-"+idSuffix);
this.search.attr("aria-owns", "select2-results-"+idSuffix);
// rewrite labels from original element to focusser
this.focusser.attr("id", "s2id_autogen"+idSuffix);
elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
this.opts.element.focus(this.bind(function () { this.focus(); }));
this.focusser.prev()
.text(elementLabel.text())
.attr('for', this.focusser.attr('id'));
// Ensure the original element retains an accessible name
var originalTitle = this.opts.element.attr("title");
this.opts.element.attr("title", (originalTitle || elementLabel.text()));
this.focusser.attr("tabindex", this.elementTabIndex);
// write label for search field using the label from the focusser element
this.search.attr("id", this.focusser.attr('id') + '_search');
this.search.prev()
.text($("label[for='" + this.focusser.attr('id') + "']").text())
.attr('for', this.search.attr('id'));
this.search.on("keydown", this.bind(function (e) {
if (!this.isInterfaceEnabled()) return;
// filter 229 keyCodes (input method editor is processing key input)
if (229 == e.keyCode) return;
if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
// prevent the page from scrolling
killEvent(e);
return;
}
switch (e.which) {
case KEY.UP:
case KEY.DOWN:
this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
killEvent(e);
return;
case KEY.ENTER:
this.selectHighlighted();
killEvent(e);
return;
case KEY.TAB:
this.selectHighlighted({noFocus: true});
return;
case KEY.ESC:
this.cancel(e);
killEvent(e);
return;
}
}));
this.search.on("blur", this.bind(function(e) {
// a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
// without this the search field loses focus which is annoying
if (document.activeElement === this.body.get(0)) {
window.setTimeout(this.bind(function() {
if (this.opened()) {
this.search.focus();
}
}), 0);
}
}));
this.focusser.on("keydown", this.bind(function (e) {
if (!this.isInterfaceEnabled()) return;
if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
return;
}
if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
killEvent(e);
return;
}
if (e.which == KEY.DOWN || e.which == KEY.UP
|| (e.which == KEY.ENTER && this.opts.openOnEnter)) {
if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return;
this.open();
killEvent(e);
return;
}
if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
if (this.opts.allowClear) {
this.clear();
}
killEvent(e);
return;
}
}));
installKeyUpChangeEvent(this.focusser);
this.focusser.on("keyup-change input", this.bind(function(e) {
if (this.opts.minimumResultsForSearch >= 0) {
e.stopPropagation();
if (this.opened()) return;
this.open();
}
}));
selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
if (!this.isInterfaceEnabled()) {
return;
}
this.clear();
killEventImmediately(e);
this.close();
if (this.selection) {
this.selection.focus();
}
}));
selection.on("mousedown touchstart", this.bind(function (e) {
// Prevent IE from generating a click event on the body
reinsertElement(selection);
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
if (this.opened()) {
this.close();
} else if (this.isInterfaceEnabled()) {
this.open();
}
killEvent(e);
}));
dropdown.on("mousedown touchstart", this.bind(function() {
if (this.opts.shouldFocusInput(this)) {
this.search.focus();
}
}));
selection.on("focus", this.bind(function(e) {
killEvent(e);
}));
this.focusser.on("focus", this.bind(function(){
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
this.container.addClass("select2-container-active");
})).on("blur", this.bind(function() {
if (!this.opened()) {
this.container.removeClass("select2-container-active");
this.opts.element.trigger($.Event("select2-blur"));
}
}));
this.search.on("focus", this.bind(function(){
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
this.container.addClass("select2-container-active");
}));
this.initContainerWidth();
this.opts.element.hide();
this.setPlaceholder();
},
// single
clear: function(triggerChange) {
var data=this.selection.data("select2-data");
if (data) { // guard against queued quick consecutive clicks
var evt = $.Event("select2-clearing");
this.opts.element.trigger(evt);
if (evt.isDefaultPrevented()) {
return;
}
var placeholderOption = this.getPlaceholderOption();
this.opts.element.val(placeholderOption ? placeholderOption.val() : "");
this.selection.find(".select2-chosen").empty();
this.selection.removeData("select2-data");
this.setPlaceholder();
if (triggerChange !== false){
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
this.triggerChange({removed:data});
}
}
},
/**
* Sets selection based on source element's value
*/
// single
initSelection: function () {
var selected;
if (this.isPlaceholderOptionSelected()) {
this.updateSelection(null);
this.close();
this.setPlaceholder();
} else {
var self = this;
this.opts.initSelection.call(null, this.opts.element, function(selected){
if (selected !== undefined && selected !== null) {
self.updateSelection(selected);
self.close();
self.setPlaceholder();
self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
}
});
}
},
isPlaceholderOptionSelected: function() {
var placeholderOption;
if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered
return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected"))
|| (this.opts.element.val() === "")
|| (this.opts.element.val() === undefined)
|| (this.opts.element.val() === null);
},
// single
prepareOpts: function () {
var opts = this.parent.prepareOpts.apply(this, arguments),
self=this;
if (opts.element.get(0).tagName.toLowerCase() === "select") {
// install the selection initializer
opts.initSelection = function (element, callback) {
var selected = element.find("option").filter(function() { return this.selected && !this.disabled });
// a single select box always has a value, no need to null check 'selected'
callback(self.optionToData(selected));
};
} else if ("data" in opts) {
// install default initSelection when applied to hidden input and data is local
opts.initSelection = opts.initSelection || function (element, callback) {
var id = element.val();
//search in data by id, storing the actual matching item
var match = null;
opts.query({
matcher: function(term, text, el){
var is_match = equal(id, opts.id(el));
if (is_match) {
match = el;
}
return is_match;
},
callback: !$.isFunction(callback) ? $.noop : function() {
callback(match);
}
});
};
}
return opts;
},
// single
getPlaceholder: function() {
// if a placeholder is specified on a single select without a valid placeholder option ignore it
if (this.select) {
if (this.getPlaceholderOption() === undefined) {
return undefined;
}
}
return this.parent.getPlaceholder.apply(this, arguments);
},
// single
setPlaceholder: function () {
var placeholder = this.getPlaceholder();
if (this.isPlaceholderOptionSelected() && placeholder !== undefined) {
// check for a placeholder option if attached to a select
if (this.select && this.getPlaceholderOption() === undefined) return;
this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));
this.selection.addClass("select2-default");
this.container.removeClass("select2-allowclear");
}
},
// single
postprocessResults: function (data, initial, noHighlightUpdate) {
var selected = 0, self = this, showSearchInput = true;
// find the selected element in the result list
this.findHighlightableChoices().each2(function (i, elm) {
if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
selected = i;
return false;
}
});
// and highlight it
if (noHighlightUpdate !== false) {
if (initial === true && selected >= 0) {
this.highlight(selected);
} else {
this.highlight(0);
}
}
// hide the search box if this is the first we got the results and there are enough of them for search
if (initial === true) {
var min = this.opts.minimumResultsForSearch;
if (min >= 0) {
this.showSearch(countResults(data.results) >= min);
}
}
},
// single
showSearch: function(showSearchInput) {
if (this.showSearchInput === showSearchInput) return;
this.showSearchInput = showSearchInput;
this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput);
this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput);
//add "select2-with-searchbox" to the container if search box is shown
$(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput);
},
// single
onSelect: function (data, options) {
if (!this.triggerSelect(data)) { return; }
var old = this.opts.element.val(),
oldData = this.data();
this.opts.element.val(this.id(data));
this.updateSelection(data);
this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
this.close();
if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
this.focusser.focus();
}
if (!equal(old, this.id(data))) {
this.triggerChange({ added: data, removed: oldData });
}
},
// single
updateSelection: function (data) {
var container=this.selection.find(".select2-chosen"), formatted, cssClass;
this.selection.data("select2-data", data);
container.empty();
if (data !== null) {
formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
}
if (formatted !== undefined) {
container.append(formatted);
}
cssClass=this.opts.formatSelectionCssClass(data, container);
if (cssClass !== undefined) {
container.addClass(cssClass);
}
this.selection.removeClass("select2-default");
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
this.container.addClass("select2-allowclear");
}
},
// single
val: function () {
var val,
triggerChange = false,
data = null,
self = this,
oldData = this.data();
if (arguments.length === 0) {
return this.opts.element.val();
}
val = arguments[0];
if (arguments.length > 1) {
triggerChange = arguments[1];
}
if (this.select) {
this.select
.val(val)
.find("option").filter(function() { return this.selected }).each2(function (i, elm) {
data = self.optionToData(elm);
return false;
});
this.updateSelection(data);
this.setPlaceholder();
if (triggerChange) {
this.triggerChange({added: data, removed:oldData});
}
} else {
// val is an id. !val is true for [undefined,null,'',0] - 0 is legal
if (!val && val !== 0) {
this.clear(triggerChange);
return;
}
if (this.opts.initSelection === undefined) {
throw new Error("cannot call val() if initSelection() is not defined");
}
this.opts.element.val(val);
this.opts.initSelection(this.opts.element, function(data){
self.opts.element.val(!data ? "" : self.id(data));
self.updateSelection(data);
self.setPlaceholder();
if (triggerChange) {
self.triggerChange({added: data, removed:oldData});
}
});
}
},
// single
clearSearch: function () {
this.search.val("");
this.focusser.val("");
},
// single
data: function(value) {
var data,
triggerChange = false;
if (arguments.length === 0) {
data = this.selection.data("select2-data");
if (data == undefined) data = null;
return data;
} else {
if (arguments.length > 1) {
triggerChange = arguments[1];
}
if (!value) {
this.clear(triggerChange);
} else {
data = this.data();
this.opts.element.val(!value ? "" : this.id(value));
this.updateSelection(value);
if (triggerChange) {
this.triggerChange({added: value, removed:data});
}
}
}
}
});
MultiSelect2 = clazz(AbstractSelect2, {
// multi
createContainer: function () {
var container = $(document.createElement("div")).attr({
"class": "select2-container select2-container-multi"
}).html([
"",
""].join(""));
return container;
},
// multi
prepareOpts: function () {
var opts = this.parent.prepareOpts.apply(this, arguments),
self=this;
// TODO validate placeholder is a string if specified
if (opts.element.get(0).tagName.toLowerCase() === "select") {
// install the selection initializer
opts.initSelection = function (element, callback) {
var data = [];
element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) {
data.push(self.optionToData(elm));
});
callback(data);
};
} else if ("data" in opts) {
// install default initSelection when applied to hidden input and data is local
opts.initSelection = opts.initSelection || function (element, callback) {
var ids = splitVal(element.val(), opts.separator, opts.transformVal);
//search in data by array of ids, storing matching items in a list
var matches = [];
opts.query({
matcher: function(term, text, el){
var is_match = $.grep(ids, function(id) {
return equal(id, opts.id(el));
}).length;
if (is_match) {
matches.push(el);
}
return is_match;
},
callback: !$.isFunction(callback) ? $.noop : function() {
// reorder matches based on the order they appear in the ids array because right now
// they are in the order in which they appear in data array
var ordered = [];
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
for (var j = 0; j < matches.length; j++) {
var match = matches[j];
if (equal(id, opts.id(match))) {
ordered.push(match);
matches.splice(j, 1);
break;
}
}
}
callback(ordered);
}
});
};
}
return opts;
},
// multi
selectChoice: function (choice) {
var selected = this.container.find(".select2-search-choice-focus");
if (selected.length && choice && choice[0] == selected[0]) {
} else {
if (selected.length) {
this.opts.element.trigger("choice-deselected", selected);
}
selected.removeClass("select2-search-choice-focus");
if (choice && choice.length) {
this.close();
choice.addClass("select2-search-choice-focus");
this.opts.element.trigger("choice-selected", choice);
}
}
},
// multi
destroy: function() {
$("label[for='" + this.search.attr('id') + "']")
.attr('for', this.opts.element.attr("id"));
this.parent.destroy.apply(this, arguments);
cleanupJQueryElements.call(this,
"searchContainer",
"selection"
);
},
// multi
initContainer: function () {
var selector = ".select2-choices", selection;
this.searchContainer = this.container.find(".select2-search-field");
this.selection = selection = this.container.find(selector);
var _this = this;
this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) {
_this.search[0].focus();
_this.selectChoice($(this));
});
// rewrite labels from original element to focusser
this.search.attr("id", "s2id_autogen"+nextUid());
this.search.prev()
.text($("label[for='" + this.opts.element.attr("id") + "']").text())
.attr('for', this.search.attr('id'));
this.opts.element.focus(this.bind(function () { this.focus(); }));
this.search.on("input paste", this.bind(function() {
if (this.search.attr('placeholder') && this.search.val().length == 0) return;
if (!this.isInterfaceEnabled()) return;
if (!this.opened()) {
this.open();
}
}));
this.search.attr("tabindex", this.elementTabIndex);
this.keydowns = 0;
this.search.on("keydown", this.bind(function (e) {
if (!this.isInterfaceEnabled()) return;
++this.keydowns;
var selected = selection.find(".select2-search-choice-focus");
var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
var next = selected.next(".select2-search-choice:not(.select2-locked)");
var pos = getCursorInfo(this.search);
if (selected.length &&
(e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
var selectedChoice = selected;
if (e.which == KEY.LEFT && prev.length) {
selectedChoice = prev;
}
else if (e.which == KEY.RIGHT) {
selectedChoice = next.length ? next : null;
}
else if (e.which === KEY.BACKSPACE) {
if (this.unselect(selected.first())) {
this.search.width(10);
selectedChoice = prev.length ? prev : next;
}
} else if (e.which == KEY.DELETE) {
if (this.unselect(selected.first())) {
this.search.width(10);
selectedChoice = next.length ? next : null;
}
} else if (e.which == KEY.ENTER) {
selectedChoice = null;
}
this.selectChoice(selectedChoice);
killEvent(e);
if (!selectedChoice || !selectedChoice.length) {
this.open();
}
return;
} else if (((e.which === KEY.BACKSPACE && this.keydowns == 1)
|| e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) {
this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
killEvent(e);
return;
} else {
this.selectChoice(null);
}
if (this.opened()) {
switch (e.which) {
case KEY.UP:
case KEY.DOWN:
this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
killEvent(e);
return;
case KEY.ENTER:
this.selectHighlighted();
killEvent(e);
return;
case KEY.TAB:
this.selectHighlighted({noFocus:true});
this.close();
return;
case KEY.ESC:
this.cancel(e);
killEvent(e);
return;
}
}
if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e)
|| e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
return;
}
if (e.which === KEY.ENTER) {
if (this.opts.openOnEnter === false) {
return;
} else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
return;
}
}
this.open();
if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
// prevent the page from scrolling
killEvent(e);
}
if (e.which === KEY.ENTER) {
// prevent form from being submitted
killEvent(e);
}
}));
this.search.on("keyup", this.bind(function (e) {
this.keydowns = 0;
this.resizeSearch();
})
);
this.search.on("blur", this.bind(function(e) {
this.container.removeClass("select2-container-active");
this.search.removeClass("select2-focused");
this.selectChoice(null);
if (!this.opened()) this.clearSearch();
e.stopImmediatePropagation();
this.opts.element.trigger($.Event("select2-blur"));
}));
this.container.on("click", selector, this.bind(function (e) {
if (!this.isInterfaceEnabled()) return;
if ($(e.target).closest(".select2-search-choice").length > 0) {
// clicked inside a select2 search choice, do not open
return;
}
this.selectChoice(null);
this.clearPlaceholder();
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
this.open();
this.focusSearch();
e.preventDefault();
}));
this.container.on("focus", selector, this.bind(function () {
if (!this.isInterfaceEnabled()) return;
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
this.container.addClass("select2-container-active");
this.dropdown.addClass("select2-drop-active");
this.clearPlaceholder();
}));
this.initContainerWidth();
this.opts.element.hide();
// set the placeholder if necessary
this.clearSearch();
},
// multi
enableInterface: function() {
if (this.parent.enableInterface.apply(this, arguments)) {
this.search.prop("disabled", !this.isInterfaceEnabled());
}
},
// multi
initSelection: function () {
var data;
if (this.opts.element.val() === "" && this.opts.element.text() === "") {
this.updateSelection([]);
this.close();
// set the placeholder if necessary
this.clearSearch();
}
if (this.select || this.opts.element.val() !== "") {
var self = this;
this.opts.initSelection.call(null, this.opts.element, function(data){
if (data !== undefined && data !== null) {
self.updateSelection(data);
self.close();
// set the placeholder if necessary
self.clearSearch();
}
});
}
},
// multi
clearSearch: function () {
var placeholder = this.getPlaceholder(),
maxWidth = this.getMaxSearchWidth();
if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
this.search.val(placeholder).addClass("select2-default");
// stretch the search box to full width of the container so as much of the placeholder is visible as possible
// we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
} else {
this.search.val("").width(10);
}
},
// multi
clearPlaceholder: function () {
if (this.search.hasClass("select2-default")) {
this.search.val("").removeClass("select2-default");
}
},
// multi
opening: function () {
this.clearPlaceholder(); // should be done before super so placeholder is not used to search
this.resizeSearch();
this.parent.opening.apply(this, arguments);
this.focusSearch();
// initializes search's value with nextSearchTerm (if defined by user)
// ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
if(this.search.val() === "") {
if(this.nextSearchTerm != undefined){
this.search.val(this.nextSearchTerm);
this.search.select();
}
}
this.updateResults(true);
if (this.opts.shouldFocusInput(this)) {
this.search.focus();
}
this.opts.element.trigger($.Event("select2-open"));
},
// multi
close: function () {
if (!this.opened()) return;
this.parent.close.apply(this, arguments);
},
// multi
focus: function () {
this.close();
this.search.focus();
},
// multi
isFocused: function () {
return this.search.hasClass("select2-focused");
},
// multi
updateSelection: function (data) {
var ids = [], filtered = [], self = this;
// filter out duplicates
$(data).each(function () {
if (indexOf(self.id(this), ids) < 0) {
ids.push(self.id(this));
filtered.push(this);
}
});
data = filtered;
this.selection.find(".select2-search-choice").remove();
$(data).each(function () {
self.addSelectedChoice(this);
});
self.postprocessResults();
},
// multi
tokenize: function() {
var input = this.search.val();
input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts);
if (input != null && input != undefined) {
this.search.val(input);
if (input.length > 0) {
this.open();
}
}
},
// multi
onSelect: function (data, options) {
if (!this.triggerSelect(data) || data.text === "") { return; }
this.addSelectedChoice(data);
this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
// keep track of the search's value before it gets cleared
this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
this.clearSearch();
this.updateResults();
if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true);
if (this.opts.closeOnSelect) {
this.close();
this.search.width(10);
} else {
if (this.countSelectableResults()>0) {
this.search.width(10);
this.resizeSearch();
if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
// if we reached max selection size repaint the results so choices
// are replaced with the max selection reached message
this.updateResults(true);
} else {
// initializes search's value with nextSearchTerm and update search result
if(this.nextSearchTerm != undefined){
this.search.val(this.nextSearchTerm);
this.updateResults();
this.search.select();
}
}
this.positionDropdown();
} else {
// if nothing left to select close
this.close();
this.search.width(10);
}
}
// since its not possible to select an element that has already been
// added we do not need to check if this is a new element before firing change
this.triggerChange({ added: data });
if (!options || !options.noFocus)
this.focusSearch();
},
// multi
cancel: function () {
this.close();
this.focusSearch();
},
addSelectedChoice: function (data) {
var enableChoice = !data.locked,
enabledItem = $(
"" +
"
" +
" " +
" "),
disabledItem = $(
"" +
"
" +
" ");
var choice = enableChoice ? enabledItem : disabledItem,
id = this.id(data),
val = this.getVal(),
formatted,
cssClass;
formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
if (formatted != undefined) {
choice.find("div").replaceWith($("
").html(formatted));
}
cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
if (cssClass != undefined) {
choice.addClass(cssClass);
}
if(enableChoice){
choice.find(".select2-search-choice-close")
.on("mousedown", killEvent)
.on("click dblclick", this.bind(function (e) {
if (!this.isInterfaceEnabled()) return;
this.unselect($(e.target));
this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
killEvent(e);
this.close();
this.focusSearch();
})).on("focus", this.bind(function () {
if (!this.isInterfaceEnabled()) return;
this.container.addClass("select2-container-active");
this.dropdown.addClass("select2-drop-active");
}));
}
choice.data("select2-data", data);
choice.insertBefore(this.searchContainer);
val.push(id);
this.setVal(val);
},
// multi
unselect: function (selected) {
var val = this.getVal(),
data,
index;
selected = selected.closest(".select2-search-choice");
if (selected.length === 0) {
throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
}
data = selected.data("select2-data");
if (!data) {
// prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued
// and invoked on an element already removed
return;
}
var evt = $.Event("select2-removing");
evt.val = this.id(data);
evt.choice = data;
this.opts.element.trigger(evt);
if (evt.isDefaultPrevented()) {
return false;
}
while((index = indexOf(this.id(data), val)) >= 0) {
val.splice(index, 1);
this.setVal(val);
if (this.select) this.postprocessResults();
}
selected.remove();
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
this.triggerChange({ removed: data });
return true;
},
// multi
postprocessResults: function (data, initial, noHighlightUpdate) {
var val = this.getVal(),
choices = this.results.find(".select2-result"),
compound = this.results.find(".select2-result-with-children"),
self = this;
choices.each2(function (i, choice) {
var id = self.id(choice.data("select2-data"));
if (indexOf(id, val) >= 0) {
choice.addClass("select2-selected");
// mark all children of the selected parent as selected
choice.find(".select2-result-selectable").addClass("select2-selected");
}
});
compound.each2(function(i, choice) {
// hide an optgroup if it doesn't have any selectable children
if (!choice.is('.select2-result-selectable')
&& choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
choice.addClass("select2-selected");
}
});
if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){
self.highlight(0);
}
//If all results are chosen render formatNoMatches
if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) {
this.results.append("" + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + " ");
}
}
}
},
// multi
getMaxSearchWidth: function() {
return this.selection.width() - getSideBorderPadding(this.search);
},
// multi
resizeSearch: function () {
var minimumWidth, left, maxWidth, containerLeft, searchWidth,
sideBorderPadding = getSideBorderPadding(this.search);
minimumWidth = measureTextWidth(this.search) + 10;
left = this.search.offset().left;
maxWidth = this.selection.width();
containerLeft = this.selection.offset().left;
searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
if (searchWidth < minimumWidth) {
searchWidth = maxWidth - sideBorderPadding;
}
if (searchWidth < 40) {
searchWidth = maxWidth - sideBorderPadding;
}
if (searchWidth <= 0) {
searchWidth = minimumWidth;
}
this.search.width(Math.floor(searchWidth));
},
// multi
getVal: function () {
var val;
if (this.select) {
val = this.select.val();
return val === null ? [] : val;
} else {
val = this.opts.element.val();
return splitVal(val, this.opts.separator, this.opts.transformVal);
}
},
// multi
setVal: function (val) {
var unique;
if (this.select) {
this.select.val(val);
} else {
unique = [];
// filter out duplicates
$(val).each(function () {
if (indexOf(this, unique) < 0) unique.push(this);
});
this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
}
},
// multi
buildChangeDetails: function (old, current) {
var current = current.slice(0),
old = old.slice(0);
// remove intersection from each array
for (var i = 0; i < current.length; i++) {
for (var j = 0; j < old.length; j++) {
if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
current.splice(i, 1);
if(i>0){
i--;
}
old.splice(j, 1);
j--;
}
}
}
return {added: current, removed: old};
},
// multi
val: function (val, triggerChange) {
var oldData, self=this;
if (arguments.length === 0) {
return this.getVal();
}
oldData=this.data();
if (!oldData.length) oldData=[];
// val is an id. !val is true for [undefined,null,'',0] - 0 is legal
if (!val && val !== 0) {
this.opts.element.val("");
this.updateSelection([]);
this.clearSearch();
if (triggerChange) {
this.triggerChange({added: this.data(), removed: oldData});
}
return;
}
// val is a list of ids
this.setVal(val);
if (this.select) {
this.opts.initSelection(this.select, this.bind(this.updateSelection));
if (triggerChange) {
this.triggerChange(this.buildChangeDetails(oldData, this.data()));
}
} else {
if (this.opts.initSelection === undefined) {
throw new Error("val() cannot be called if initSelection() is not defined");
}
this.opts.initSelection(this.opts.element, function(data){
var ids=$.map(data, self.id);
self.setVal(ids);
self.updateSelection(data);
self.clearSearch();
if (triggerChange) {
self.triggerChange(self.buildChangeDetails(oldData, self.data()));
}
});
}
this.clearSearch();
},
// multi
onSortStart: function() {
if (this.select) {
throw new Error("Sorting of elements is not supported when attached to . Attach to instead.");
}
// collapse search field into 0 width so its container can be collapsed as well
this.search.width(0);
// hide the container
this.searchContainer.hide();
},
// multi
onSortEnd:function() {
var val=[], self=this;
// show search and move it to the end of the list
this.searchContainer.show();
// make sure the search container is the last item in the list
this.searchContainer.appendTo(this.searchContainer.parent());
// since we collapsed the width in dragStarted, we resize it here
this.resizeSearch();
// update selection
this.selection.find(".select2-search-choice").each(function() {
val.push(self.opts.id($(this).data("select2-data")));
});
this.setVal(val);
this.triggerChange();
},
// multi
data: function(values, triggerChange) {
var self=this, ids, old;
if (arguments.length === 0) {
return this.selection
.children(".select2-search-choice")
.map(function() { return $(this).data("select2-data"); })
.get();
} else {
old = this.data();
if (!values) { values = []; }
ids = $.map(values, function(e) { return self.opts.id(e); });
this.setVal(ids);
this.updateSelection(values);
this.clearSearch();
if (triggerChange) {
this.triggerChange(this.buildChangeDetails(old, this.data()));
}
}
}
});
$.fn.select2 = function () {
var args = Array.prototype.slice.call(arguments, 0),
opts,
select2,
method, value, multiple,
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"],
valueMethods = ["opened", "isFocused", "container", "dropdown"],
propertyMethods = ["val", "data"],
methodsMap = { search: "externalSearch" };
this.each(function () {
if (args.length === 0 || typeof(args[0]) === "object") {
opts = args.length === 0 ? {} : $.extend({}, args[0]);
opts.element = $(this);
if (opts.element.get(0).tagName.toLowerCase() === "select") {
multiple = opts.element.prop("multiple");
} else {
multiple = opts.multiple || false;
if ("tags" in opts) {opts.multiple = multiple = true;}
}
select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single();
select2.init(opts);
} else if (typeof(args[0]) === "string") {
if (indexOf(args[0], allowedMethods) < 0) {
throw "Unknown method: " + args[0];
}
value = undefined;
select2 = $(this).data("select2");
if (select2 === undefined) return;
method=args[0];
if (method === "container") {
value = select2.container;
} else if (method === "dropdown") {
value = select2.dropdown;
} else {
if (methodsMap[method]) method = methodsMap[method];
value = select2[method].apply(select2, args.slice(1));
}
if (indexOf(args[0], valueMethods) >= 0
|| (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) {
return false; // abort the iteration, ready to return first matched value
}
} else {
throw "Invalid arguments to select2 plugin: " + args;
}
});
return (value === undefined) ? this : value;
};
// plugin defaults, accessible to users
$.fn.select2.defaults = {
width: "copy",
loadMorePadding: 0,
closeOnSelect: true,
openOnEnter: true,
containerCss: {},
dropdownCss: {},
containerCssClass: "",
dropdownCssClass: "",
formatResult: function(result, container, query, escapeMarkup) {
var markup=[];
markMatch(this.text(result), query.term, markup, escapeMarkup);
return markup.join("");
},
transformVal: function(val) {
return $.trim(val);
},
formatSelection: function (data, container, escapeMarkup) {
return data ? escapeMarkup(this.text(data)) : undefined;
},
sortResults: function (results, container, query) {
return results;
},
formatResultCssClass: function(data) {return data.css;},
formatSelectionCssClass: function(data, container) {return undefined;},
minimumResultsForSearch: 0,
minimumInputLength: 0,
maximumInputLength: null,
maximumSelectionSize: 0,
id: function (e) { return e == undefined ? null : e.id; },
text: function (e) {
if (e && this.data && this.data.text) {
if ($.isFunction(this.data.text)) {
return this.data.text(e);
} else {
return e[this.data.text];
}
} else {
return e.text;
}
},
matcher: function(term, text) {
return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
},
separator: ",",
tokenSeparators: [],
tokenizer: defaultTokenizer,
escapeMarkup: defaultEscapeMarkup,
blurOnChange: false,
selectOnBlur: false,
adaptContainerCssClass: function(c) { return c; },
adaptDropdownCssClass: function(c) { return null; },
nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
searchInputPlaceholder: '',
createSearchChoicePosition: 'top',
shouldFocusInput: function (instance) {
// Attempt to detect touch devices
var supportsTouchEvents = (('ontouchstart' in window) ||
(navigator.msMaxTouchPoints > 0));
// Only devices which support touch events should be special cased
if (!supportsTouchEvents) {
return true;
}
// Never focus the input if search is disabled
if (instance.opts.minimumResultsForSearch < 0) {
return false;
}
return true;
}
};
$.fn.select2.locales = [];
$.fn.select2.locales['en'] = {
formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
formatNoMatches: function () { return "No matches found"; },
formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Loading more results…"; },
formatSearching: function () { return "Searching…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
$.fn.select2.ajaxDefaults = {
transport: $.ajax,
params: {
type: "GET",
cache: false,
dataType: "json"
}
};
// exports
window.Select2 = {
query: {
ajax: ajax,
local: local,
tags: tags
}, util: {
debounce: debounce,
markMatch: markMatch,
escapeMarkup: defaultEscapeMarkup,
stripDiacritics: stripDiacritics
}, "class": {
"abstract": AbstractSelect2,
"single": SingleSelect2,
"multi": MultiSelect2
}
};
}(jQuery));
================================================
FILE: static/assets/plugins/select2/select2_locale_ar.js
================================================
/**
* Select2 Arabic translation.
*
* Author: Adel KEDJOUR
*/
(function ($) {
"use strict";
$.fn.select2.locales['ar'] = {
formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; },
formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
formatSearching: function () { return "البحث…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ar']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_az.js
================================================
/**
* Select2 Azerbaijani translation.
*
* Author: Farhad Safarov
*/
(function ($) {
"use strict";
$.fn.select2.locales['az'] = {
formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; },
formatNoMatches: function () { return "Nəticə tapılmadı"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; },
formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; },
formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; },
formatSearching: function () { return "Axtarılır…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['az']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_bg.js
================================================
/**
* Select2 Bulgarian translation.
*
* @author Lubomir Vikev
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['bg'] = {
formatNoMatches: function () { return "Няма намерени съвпадения"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); },
formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); },
formatLoadMore: function (pageNumber) { return "Зареждат се още…"; },
formatSearching: function () { return "Търсене…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['bg']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ca.js
================================================
/**
* Select2 Catalan translation.
*
* Author: David Planella
*/
(function ($) {
"use strict";
$.fn.select2.locales['ca'] = {
formatNoMatches: function () { return "No s'ha trobat cap coincidència"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; },
formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; },
formatSearching: function () { return "S'està cercant…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ca']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_cs.js
================================================
/**
* Select2 Czech translation.
*
* Author: Michal Marek
* Author - sklonovani: David Vallner
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dvě"); },
3: function() { return "tři"; },
4: function() { return "čtyři"; }
}
$.fn.select2.locales['cs'] = {
formatNoMatches: function () { return "Nenalezeny žádné položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím zadejte ještě jeden znak";
} else if (n <= 4) {
return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím zadejte ještě dalších "+n+" znaků";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím zadejte o jeden znak méně";
} else if (n <= 4) {
return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně";
} else {
return "Prosím zadejte o "+n+" znaků méně";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Můžete zvolit jen jednu položku";
} else if (limit <= 4) {
return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky";
} else {
return "Můžete zvolit maximálně "+limit+" položek";
}
},
formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; },
formatSearching: function () { return "Vyhledávání…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['cs']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_da.js
================================================
/**
* Select2 Danish translation.
*
* Author: Anders Jenbo
*/
(function ($) {
"use strict";
$.fn.select2.locales['da'] = {
formatNoMatches: function () { return "Ingen resultater fundet"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; },
formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); },
formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; },
formatSearching: function () { return "Søger…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['da']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_de.js
================================================
/**
* Select2 German translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['de'] = {
formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; },
formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; },
formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; },
formatSearching: function () { return "Suche…"; },
formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['de']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_el.js
================================================
/**
* Select2 Greek translation.
*
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['el'] = {
formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); },
formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; },
formatSearching: function () { return "Αναζήτηση…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['el']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_en.js.template
================================================
/**
* Select2 translation.
*
* Author: Your Name
*/
(function ($) {
"use strict";
$.fn.select2.locales['en'] = {
formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
formatNoMatches: function () { return "No matches found"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Loading more results…"; },
formatSearching: function () { return "Searching…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_es.js
================================================
/**
* Select2 Spanish translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['es'] = {
formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; },
formatNoMatches: function () { return "No se encontraron resultados"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); },
formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; },
formatSearching: function () { return "Buscando…"; },
formatAjaxError: function() { return "La carga falló"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['es']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_et.js
================================================
/**
* Select2 Estonian translation.
*
* Author: Kuldar Kalvik
*/
(function ($) {
"use strict";
$.fn.select2.locales['et'] = {
formatNoMatches: function () { return "Tulemused puuduvad"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; },
formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; },
formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; },
formatSearching: function () { return "Otsin.."; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['et']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_eu.js
================================================
/**
* Select2 Basque translation.
*
* Author: Julen Ruiz Aizpuru
*/
(function ($) {
"use strict";
$.fn.select2.locales['eu'] = {
formatNoMatches: function () {
return "Ez da bat datorrenik aurkitu";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Idatzi karaktere bat gehiago";
} else {
return "Idatzi " + n + " karaktere gehiago";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Idatzi karaktere bat gutxiago";
} else {
return "Idatzi " + n + " karaktere gutxiago";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Elementu bakarra hauta dezakezu";
} else {
return limit + " elementu hauta ditzakezu soilik";
}
},
formatLoadMore: function (pageNumber) {
return "Emaitza gehiago kargatzen…";
},
formatSearching: function () {
return "Bilatzen…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['eu']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_fa.js
================================================
/**
* Select2 Persian translation.
*
* Author: Ali Choopan
* Author: Ebrahim Byagowi
*/
(function ($) {
"use strict";
$.fn.select2.locales['fa'] = {
formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; },
formatNoMatches: function () { return "نتیجهای یافت نشد."; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; },
formatSelectionTooBig: function (limit) { return "شما فقط میتوانید " + limit + " مورد را انتخاب کنید"; },
formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; },
formatSearching: function () { return "در حال جستجو…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fa']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_fi.js
================================================
/**
* Select2 Finnish translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['fi'] = {
formatNoMatches: function () {
return "Ei tuloksia";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
return "Ole hyvä ja anna " + n + " merkkiä lisää";
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
return "Ole hyvä ja anna " + n + " merkkiä vähemmän";
},
formatSelectionTooBig: function (limit) {
return "Voit valita ainoastaan " + limit + " kpl";
},
formatLoadMore: function (pageNumber) {
return "Ladataan lisää tuloksia…";
},
formatSearching: function () {
return "Etsitään…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fi']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_fr.js
================================================
/**
* Select2 French translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['fr'] = {
formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; },
formatNoMatches: function () { return "Aucun résultat trouvé"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Supprimez " + n + " caractère" + (n == 1? "" : "s"); },
formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; },
formatSearching: function () { return "Recherche en cours…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fr']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_gl.js
================================================
/**
* Select2 Galician translation
*
* Author: Leandro Regueiro
*/
(function ($) {
"use strict";
$.fn.select2.locales['gl'] = {
formatNoMatches: function () {
return "Non se atoparon resultados";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Engada un carácter";
} else {
return "Engada " + n + " caracteres";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Elimine un carácter";
} else {
return "Elimine " + n + " caracteres";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Só pode seleccionar un elemento";
} else {
return "Só pode seleccionar " + limit + " elementos";
}
},
formatLoadMore: function (pageNumber) {
return "Cargando máis resultados…";
},
formatSearching: function () {
return "Buscando…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['gl']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_he.js
================================================
/**
* Select2 Hebrew translation.
*
* Author: Yakir Sitbon
*/
(function ($) {
"use strict";
$.fn.select2.locales['he'] = {
formatNoMatches: function () { return "לא נמצאו התאמות"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; },
formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; },
formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; },
formatSearching: function () { return "מחפש…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['he']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_hr.js
================================================
/**
* Select2 Croatian translation.
*
* @author Edi Modrić
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['hr'] = {
formatNoMatches: function () { return "Nema rezultata"; },
formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; },
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; },
formatSearching: function () { return "Pretraga…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['hr']);
function character (n) {
return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova");
}
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_hu.js
================================================
/**
* Select2 Hungarian translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['hu'] = {
formatNoMatches: function () { return "Nincs találat."; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; },
formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; },
formatLoadMore: function (pageNumber) { return "Töltés…"; },
formatSearching: function () { return "Keresés…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['hu']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_id.js
================================================
/**
* Select2 Indonesian translation.
*
* Author: Ibrahim Yusuf
*/
(function ($) {
"use strict";
$.fn.select2.locales['id'] = {
formatNoMatches: function () { return "Tidak ada data yang sesuai"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); },
formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Mengambil data…"; },
formatSearching: function () { return "Mencari…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['id']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_is.js
================================================
/**
* Select2 Icelandic translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['is'] = {
formatNoMatches: function () { return "Ekkert fannst"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); },
formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; },
formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; },
formatSearching: function () { return "Leita…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['is']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_it.js
================================================
/**
* Select2 Italian translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['it'] = {
formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; },
formatSearching: function () { return "Ricerca…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['it']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ja.js
================================================
/**
* Select2 Japanese translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['ja'] = {
formatNoMatches: function () { return "該当なし"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; },
formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; },
formatLoadMore: function (pageNumber) { return "読込中・・・"; },
formatSearching: function () { return "検索中・・・"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ja']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ka.js
================================================
/**
* Select2 Georgian (Kartuli) translation.
*
* Author: Dimitri Kurashvili dimakura@gmail.com
*/
(function ($) {
"use strict";
$.fn.select2.locales['ka'] = {
formatNoMatches: function () { return "ვერ მოიძებნა"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; },
formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; },
formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; },
formatSearching: function () { return "ძებნა…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ka']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ko.js
================================================
/**
* Select2 Korean translation.
*
* @author Swen Mun
*/
(function ($) {
"use strict";
$.fn.select2.locales['ko'] = {
formatNoMatches: function () { return "결과 없음"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; },
formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; },
formatLoadMore: function (pageNumber) { return "불러오는 중…"; },
formatSearching: function () { return "검색 중…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ko']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_lt.js
================================================
/**
* Select2 Lithuanian translation.
*
* @author CRONUS Karmalakas
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['lt'] = {
formatNoMatches: function () { return "Atitikmenų nerasta"; },
formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); },
formatSelectionTooBig: function (limit) {
return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą");
},
formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; },
formatSearching: function () { return "Ieškoma…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['lt']);
function character (n) {
return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į");
}
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_lv.js
================================================
/**
* Select2 Latvian translation.
*
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['lv'] = {
formatNoMatches: function () { return "Sakritību nav"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; },
formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); },
formatLoadMore: function (pageNumber) { return "Datu ielāde…"; },
formatSearching: function () { return "Meklēšana…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['lv']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_mk.js
================================================
/**
* Select2 Macedonian translation.
*
* Author: Marko Aleksic
*/
(function ($) {
"use strict";
$.fn.select2.locales['mk'] = {
formatNoMatches: function () { return "Нема пронајдено совпаѓања"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); },
formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); },
formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; },
formatSearching: function () { return "Пребарување…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['mk']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ms.js
================================================
/**
* Select2 Malay translation.
*
* Author: Kepoweran
*/
(function ($) {
"use strict";
$.fn.select2.locales['ms'] = {
formatNoMatches: function () { return "Tiada padanan yang ditemui"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; },
formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; },
formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; },
formatSearching: function () { return "Mencari…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ms']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_nb.js
================================================
/**
* Select2 Norwegian Bokmål translation.
*
* Author: Torgeir Veimo
* Author: Bjørn Johansen
*/
(function ($) {
"use strict";
$.fn.select2.locales['nb'] = {
formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; },
formatNoMatches: function () { return "Ingen treff"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; },
formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; },
formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; },
formatSearching: function () { return "Søker …"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['no']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_nl.js
================================================
/**
* Select2 Dutch translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['nl'] = {
formatNoMatches: function () { return "Geen resultaten gevonden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul nog " + n + " karakter" + (n == 1? "" : "s") + " in"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Haal " + n + " karakter" + (n == 1? "" : "s") + " weg"; },
formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; },
formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; },
formatSearching: function () { return "Zoeken…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['nl']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_pl.js
================================================
/**
* Select2 Polish translation.
*
* @author Jan Kondratowicz
* @author Uriy Efremochkin
* @author Michał Połtyn
* @author Damian Zajkowski
*/
(function($) {
"use strict";
$.fn.select2.locales['pl'] = {
formatNoMatches: function() {
return "Brak wyników";
},
formatInputTooShort: function(input, min) {
return "Wpisz co najmniej" + character(min - input.length, "znak", "i");
},
formatInputTooLong: function(input, max) {
return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i");
},
formatSelectionTooBig: function(limit) {
return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y");
},
formatLoadMore: function(pageNumber) {
return "Ładowanie wyników…";
},
formatSearching: function() {
return "Szukanie…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pl']);
function character(n, word, pluralSuffix) {
//Liczba pojedyncza - brak suffiksu
//jeden znak
//jeden element
var suffix = '';
if (n > 1 && n < 5) {
//Liczaba mnoga ilość od 2 do 4 - własny suffiks
//Dwa znaki, trzy znaki, cztery znaki.
//Dwa elementy, trzy elementy, cztery elementy
suffix = pluralSuffix;
} else if (n == 0 || n >= 5) {
//Ilość 0 suffiks ów
//Liczaba mnoga w ilości 5 i więcej - suffiks ów (nie poprawny dla wszystkich wyrazów, np. 100 wiadomości)
//Zero znaków, Pięć znaków, sześć znaków, siedem znaków, osiem znaków.
//Zero elementów Pięć elementów, sześć elementów, siedem elementów, osiem elementów.
suffix = 'ów';
}
return " " + n + " " + word + suffix;
}
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_pt-BR.js
================================================
/**
* Select2 Brazilian Portuguese translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['pt-BR'] = {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatAjaxError: function () { return "Erro na busca"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite " + (min == 1 ? "" : "mais") + " " + n + " caracter" + (n == 1? "" : "es"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; },
formatSearching: function () { return "Buscando…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pt-BR']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_pt-PT.js
================================================
/**
* Select2 Portuguese (Portugal) translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['pt-PT'] = {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; },
formatSearching: function () { return "A pesquisar…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pt-PT']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ro.js
================================================
/**
* Select2 Romanian translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['ro'] = {
formatNoMatches: function () { return "Nu a fost găsit nimic"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); },
formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); },
formatLoadMore: function (pageNumber) { return "Se încarcă…"; },
formatSearching: function () { return "Căutare…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ro']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_rs.js
================================================
/**
* Select2 Serbian translation.
*
* @author Limon Monte
*/
(function ($) {
"use strict";
$.fn.select2.locales['rs'] = {
formatNoMatches: function () { return "Ništa nije pronađeno"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); },
formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; },
formatSearching: function () { return "Pretraga…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['rs']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ru.js
================================================
/**
* Select2 Russian translation.
*
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['ru'] = {
formatNoMatches: function () { return "Совпадений не найдено"; },
formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; },
formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); },
formatLoadMore: function (pageNumber) { return "Загрузка данных…"; },
formatSearching: function () { return "Поиск…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ru']);
function character (n) {
return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов");
}
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_sk.js
================================================
/**
* Select2 Slovak translation.
*
* Author: David Vallner
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dve"); },
3: function() { return "tri"; },
4: function() { return "štyri"; }
};
$.fn.select2.locales['sk'] = {
formatNoMatches: function () { return "Nenašli sa žiadne položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím, zadajte ešte jeden znak";
} else if (n <= 4) {
return "Prosím, zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím, zadajte ešte ďalších "+n+" znakov";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím, zadajte o jeden znak menej";
} else if (n >= 2 && n <= 4) {
return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
} else {
return "Prosím, zadajte o "+n+" znakov menej";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Môžete zvoliť len jednu položku";
} else if (limit >= 2 && limit <= 4) {
return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
} else {
return "Môžete zvoliť najviac "+limit+" položiek";
}
},
formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; },
formatSearching: function () { return "Vyhľadávanie…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['sk']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_sv.js
================================================
/**
* Select2 Swedish translation.
*
* Author: Jens Rantil
*/
(function ($) {
"use strict";
$.fn.select2.locales['sv'] = {
formatNoMatches: function () { return "Inga träffar"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; },
formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; },
formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; },
formatSearching: function () { return "Söker…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['sv']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_th.js
================================================
/**
* Select2 Thai translation.
*
* Author: Atsawin Chaowanakritsanakul
*/
(function ($) {
"use strict";
$.fn.select2.locales['th'] = {
formatNoMatches: function () { return "ไม่พบข้อมูล"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; },
formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; },
formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; },
formatSearching: function () { return "กำลังค้นข้อมูล…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['th']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_tr.js
================================================
/**
* Select2 Turkish translation.
*
* Author: Salim KAYABAŞI
*/
(function ($) {
"use strict";
$.fn.select2.locales['tr'] = {
formatNoMatches: function () { return "Sonuç bulunamadı"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; },
formatLoadMore: function (pageNumber) { return "Daha fazla…"; },
formatSearching: function () { return "Aranıyor…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['tr']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_ug-CN.js
================================================
/**
* Select2 Uyghur translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['ug-CN'] = {
formatNoMatches: function () { return "ماس كېلىدىغان ئۇچۇر تېپىلمىدى"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "يەنە " + n + " ھەرپ كىرگۈزۈڭ";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "" + n + "ھەرپ ئۆچۈرۈڭ";},
formatSelectionTooBig: function (limit) { return "ئەڭ كۆپ بولغاندا" + limit + " تال ئۇچۇر تاللىيالايسىز"; },
formatLoadMore: function (pageNumber) { return "ئۇچۇرلار ئوقۇلىۋاتىدۇ…"; },
formatSearching: function () { return "ئىزدەۋاتىدۇ…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ug-CN']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_uk.js
================================================
/**
* Select2 Ukrainian translation.
*
* @author bigmihail
* @author Uriy Efremochkin
*/
(function ($) {
"use strict";
$.fn.select2.locales['uk'] = {
formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; },
formatNoMatches: function () { return "Нічого не знайдено"; },
formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); },
formatInputTooLong: function (input, max) { return "Введіть буль ласка на " + character(input.length - max, "символ") + " менше"; },
formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); },
formatLoadMore: function (pageNumber) { return "Завантаження даних…"; },
formatSearching: function () { return "Пошук…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['uk']);
function character (n, word) {
return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів");
}
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_vi.js
================================================
/**
* Select2 Vietnamese translation.
*
* Author: Long Nguyen
*/
(function ($) {
"use strict";
$.fn.select2.locales['vi'] = {
formatNoMatches: function () { return "Không tìm thấy kết quả"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); },
formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; },
formatSearching: function () { return "Đang tìm…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['vi']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_zh-CN.js
================================================
/**
* Select2 Chinese translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['zh-CN'] = {
formatNoMatches: function () { return "没有找到匹配项"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";},
formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; },
formatLoadMore: function (pageNumber) { return "加载结果中…"; },
formatSearching: function () { return "搜索中…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['zh-CN']);
})(jQuery);
================================================
FILE: static/assets/plugins/select2/select2_locale_zh-TW.js
================================================
/**
* Select2 Traditional Chinese translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['zh-TW'] = {
formatNoMatches: function () { return "沒有找到相符的項目"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";},
formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; },
formatLoadMore: function (pageNumber) { return "載入中…"; },
formatSearching: function () { return "搜尋中…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['zh-TW']);
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/dist/summernote-bs3.css
================================================
.note-editor {
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
}
.note-editor article,
.note-editor aside,
.note-editor details,
.note-editor figcaption,
.note-editor figure,
.note-editor footer,
.note-editor header,
.note-editor hgroup,
.note-editor main,
.note-editor nav,
.note-editor section,
.note-editor summary {
display: block;
}
.note-editor audio,
.note-editor canvas,
.note-editor video {
display: inline-block;
}
.note-editor audio:not([controls]) {
display: none;
height: 0;
}
.note-editor [hidden],
.note-editor template {
display: none;
}
.note-editor html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
.note-editor body {
margin: 0;
}
.note-editor a {
background: transparent;
}
.note-editor a:focus {
outline: thin dotted;
}
.note-editor a:active,
.note-editor a:hover {
outline: 0;
}
.note-editor h1 {
font-size: 2em;
margin: 0.67em 0;
}
.note-editor abbr[title] {
border-bottom: 1px dotted;
}
.note-editor b,
.note-editor strong {
font-weight: bold;
}
.note-editor dfn {
font-style: italic;
}
.note-editor hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.note-editor mark {
background: #ff0;
color: #000;
}
.note-editor code,
.note-editor kbd,
.note-editor pre,
.note-editor samp {
font-family: monospace, serif;
font-size: 1em;
}
.note-editor pre {
white-space: pre-wrap;
}
.note-editor q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
.note-editor small {
font-size: 80%;
}
.note-editor sub,
.note-editor sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
.note-editor sup {
top: -0.5em;
}
.note-editor sub {
bottom: -0.25em;
}
.note-editor img {
border: 0;
}
.note-editor svg:not(:root) {
overflow: hidden;
}
.note-editor figure {
margin: 0;
}
.note-editor fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
.note-editor legend {
border: 0;
padding: 0;
}
.note-editor button,
.note-editor input,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
.note-editor button,
.note-editor input {
line-height: normal;
}
.note-editor button,
.note-editor select {
text-transform: none;
}
.note-editor button,
.note-editor html input[type="button"],
.note-editor input[type="reset"],
.note-editor input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
.note-editor button[disabled],
.note-editor html input[disabled] {
cursor: default;
}
.note-editor input[type="checkbox"],
.note-editor input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
.note-editor input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.note-editor input[type="search"]::-webkit-search-cancel-button,
.note-editor input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
.note-editor button::-moz-focus-inner,
.note-editor input::-moz-focus-inner {
border: 0;
padding: 0;
}
.note-editor textarea {
overflow: auto;
vertical-align: top;
}
.note-editor table {
border-collapse: collapse;
border-spacing: 0;
}
@media print {
.note-editor * {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
.note-editor a,
.note-editor a:visited {
text-decoration: underline;
}
.note-editor a[href]:after {
content: " (" attr(href) ")";
}
.note-editor abbr[title]:after {
content: " (" attr(title) ")";
}
.note-editor .ir a:after,
.note-editor a[href^="javascript:"]:after,
.note-editor a[href^="#"]:after {
content: "";
}
.note-editor pre,
.note-editor blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
.note-editor thead {
display: table-header-group;
}
.note-editor tr,
.note-editor img {
page-break-inside: avoid;
}
.note-editor img {
max-width: 100% !important;
}
@page {
margin: 2cm .5cm;
}
.note-editor p,
.note-editor h2,
.note-editor h3 {
orphans: 3;
widows: 3;
}
.note-editor h2,
.note-editor h3 {
page-break-after: avoid;
}
.note-editor .navbar {
display: none;
}
.note-editor .table td,
.note-editor .table th {
background-color: #fff !important;
}
.note-editor .btn > .caret,
.note-editor .dropup > .btn > .caret {
border-top-color: #000 !important;
}
.note-editor .label {
border: 1px solid #000;
}
.note-editor .table {
border-collapse: collapse !important;
}
.note-editor .table-bordered th,
.note-editor .table-bordered td {
border: 1px solid #ddd !important;
}
}
.note-editor *,
.note-editor *:before,
.note-editor *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.note-editor body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
}
.note-editor input,
.note-editor button,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
.note-editor a {
color: #428bca;
text-decoration: none;
}
.note-editor a:hover,
.note-editor a:focus {
color: #2a6496;
text-decoration: underline;
}
.note-editor a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor img {
vertical-align: middle;
}
.note-editor .img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.note-editor .img-rounded {
border-radius: 6px;
}
.note-editor .img-thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.note-editor .img-circle {
border-radius: 50%;
}
.note-editor hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.note-editor .sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.note-editor p {
margin: 0 0 10px;
}
.note-editor .lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.note-editor .lead {
font-size: 21px;
}
}
.note-editor small,
.note-editor .small {
font-size: 85%;
}
.note-editor cite {
font-style: normal;
}
.note-editor .text-muted {
color: #999999;
}
.note-editor .text-primary {
color: #428bca;
}
.note-editor .text-primary:hover {
color: #3071a9;
}
.note-editor .text-warning {
color: #c09853;
}
.note-editor .text-warning:hover {
color: #a47e3c;
}
.note-editor .text-danger {
color: #b94a48;
}
.note-editor .text-danger:hover {
color: #953b39;
}
.note-editor .text-success {
color: #468847;
}
.note-editor .text-success:hover {
color: #356635;
}
.note-editor .text-info {
color: #3a87ad;
}
.note-editor .text-info:hover {
color: #2d6987;
}
.note-editor .text-left {
text-align: left;
}
.note-editor .text-right {
text-align: right;
}
.note-editor .text-center {
text-align: center;
}
.note-editor h1,
.note-editor h2,
.note-editor h3,
.note-editor h4,
.note-editor h5,
.note-editor h6,
.note-editor .h1,
.note-editor .h2,
.note-editor .h3,
.note-editor .h4,
.note-editor .h5,
.note-editor .h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor .h1 small,
.note-editor .h2 small,
.note-editor .h3 small,
.note-editor .h4 small,
.note-editor .h5 small,
.note-editor .h6 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small,
.note-editor .h1 .small,
.note-editor .h2 .small,
.note-editor .h3 .small,
.note-editor .h4 .small,
.note-editor .h5 .small,
.note-editor .h6 .small {
font-weight: normal;
line-height: 1;
color: #999999;
}
.note-editor h1,
.note-editor h2,
.note-editor h3 {
margin-top: 20px;
margin-bottom: 10px;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small {
font-size: 65%;
}
.note-editor h4,
.note-editor h5,
.note-editor h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small {
font-size: 75%;
}
.note-editor h1,
.note-editor .h1 {
font-size: 36px;
}
.note-editor h2,
.note-editor .h2 {
font-size: 30px;
}
.note-editor h3,
.note-editor .h3 {
font-size: 24px;
}
.note-editor h4,
.note-editor .h4 {
font-size: 18px;
}
.note-editor h5,
.note-editor .h5 {
font-size: 14px;
}
.note-editor h6,
.note-editor .h6 {
font-size: 12px;
}
.note-editor .page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
.note-editor ul,
.note-editor ol {
margin-top: 0;
margin-bottom: 10px;
}
.note-editor ul ul,
.note-editor ol ul,
.note-editor ul ol,
.note-editor ol ol {
margin-bottom: 0;
}
.note-editor .list-unstyled {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
.note-editor dl {
margin-bottom: 20px;
}
.note-editor dt,
.note-editor dd {
line-height: 1.428571429;
}
.note-editor dt {
font-weight: bold;
}
.note-editor dd {
margin-left: 0;
}
@media (min-width: 768px) {
.note-editor .dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.note-editor .dl-horizontal dd {
margin-left: 180px;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
}
.note-editor abbr[title],
.note-editor abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
.note-editor abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
.note-editor blockquote {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
.note-editor blockquote p {
font-size: 17.5px;
font-weight: 300;
line-height: 1.25;
}
.note-editor blockquote p:last-child {
margin-bottom: 0;
}
.note-editor blockquote small {
display: block;
line-height: 1.428571429;
color: #999999;
}
.note-editor blockquote small:before {
content: '\2014 \00A0';
}
.note-editor blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
.note-editor blockquote.pull-right p,
.note-editor blockquote.pull-right small,
.note-editor blockquote.pull-right .small {
text-align: right;
}
.note-editor blockquote.pull-right small:before,
.note-editor blockquote.pull-right .small:before {
content: '';
}
.note-editor blockquote.pull-right small:after,
.note-editor blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
.note-editor blockquote:before,
.note-editor blockquote:after {
content: "";
}
.note-editor address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
}
.note-editor code,
.note-editor kdb,
.note-editor pre,
.note-editor samp {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
.note-editor code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
white-space: nowrap;
border-radius: 4px;
}
.note-editor pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.note-editor .pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.note-editor .container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .row {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .col-xs-1,
.note-editor .col-sm-1,
.note-editor .col-md-1,
.note-editor .col-lg-1,
.note-editor .col-xs-2,
.note-editor .col-sm-2,
.note-editor .col-md-2,
.note-editor .col-lg-2,
.note-editor .col-xs-3,
.note-editor .col-sm-3,
.note-editor .col-md-3,
.note-editor .col-lg-3,
.note-editor .col-xs-4,
.note-editor .col-sm-4,
.note-editor .col-md-4,
.note-editor .col-lg-4,
.note-editor .col-xs-5,
.note-editor .col-sm-5,
.note-editor .col-md-5,
.note-editor .col-lg-5,
.note-editor .col-xs-6,
.note-editor .col-sm-6,
.note-editor .col-md-6,
.note-editor .col-lg-6,
.note-editor .col-xs-7,
.note-editor .col-sm-7,
.note-editor .col-md-7,
.note-editor .col-lg-7,
.note-editor .col-xs-8,
.note-editor .col-sm-8,
.note-editor .col-md-8,
.note-editor .col-lg-8,
.note-editor .col-xs-9,
.note-editor .col-sm-9,
.note-editor .col-md-9,
.note-editor .col-lg-9,
.note-editor .col-xs-10,
.note-editor .col-sm-10,
.note-editor .col-md-10,
.note-editor .col-lg-10,
.note-editor .col-xs-11,
.note-editor .col-sm-11,
.note-editor .col-md-11,
.note-editor .col-lg-11,
.note-editor .col-xs-12,
.note-editor .col-sm-12,
.note-editor .col-md-12,
.note-editor .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .col-xs-1,
.note-editor .col-xs-2,
.note-editor .col-xs-3,
.note-editor .col-xs-4,
.note-editor .col-xs-5,
.note-editor .col-xs-6,
.note-editor .col-xs-7,
.note-editor .col-xs-8,
.note-editor .col-xs-9,
.note-editor .col-xs-10,
.note-editor .col-xs-11 {
float: left;
}
.note-editor .col-xs-12 {
width: 100%;
}
.note-editor .col-xs-11 {
width: 91.66666666666666%;
}
.note-editor .col-xs-10 {
width: 83.33333333333334%;
}
.note-editor .col-xs-9 {
width: 75%;
}
.note-editor .col-xs-8 {
width: 66.66666666666666%;
}
.note-editor .col-xs-7 {
width: 58.333333333333336%;
}
.note-editor .col-xs-6 {
width: 50%;
}
.note-editor .col-xs-5 {
width: 41.66666666666667%;
}
.note-editor .col-xs-4 {
width: 33.33333333333333%;
}
.note-editor .col-xs-3 {
width: 25%;
}
.note-editor .col-xs-2 {
width: 16.666666666666664%;
}
.note-editor .col-xs-1 {
width: 8.333333333333332%;
}
.note-editor .col-xs-pull-12 {
right: 100%;
}
.note-editor .col-xs-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-xs-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-xs-pull-9 {
right: 75%;
}
.note-editor .col-xs-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-xs-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-xs-pull-6 {
right: 50%;
}
.note-editor .col-xs-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-xs-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-xs-pull-3 {
right: 25%;
}
.note-editor .col-xs-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-xs-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-xs-push-12 {
left: 100%;
}
.note-editor .col-xs-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-xs-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-xs-push-9 {
left: 75%;
}
.note-editor .col-xs-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-xs-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-xs-push-6 {
left: 50%;
}
.note-editor .col-xs-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-xs-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-xs-push-3 {
left: 25%;
}
.note-editor .col-xs-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-xs-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-xs-offset-12 {
margin-left: 100%;
}
.note-editor .col-xs-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-xs-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-xs-offset-9 {
margin-left: 75%;
}
.note-editor .col-xs-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-xs-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-xs-offset-6 {
margin-left: 50%;
}
.note-editor .col-xs-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-xs-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-xs-offset-3 {
margin-left: 25%;
}
.note-editor .col-xs-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-xs-offset-1 {
margin-left: 8.333333333333332%;
}
@media (min-width: 768px) {
.note-editor .container {
width: 750px;
}
.note-editor .col-sm-1,
.note-editor .col-sm-2,
.note-editor .col-sm-3,
.note-editor .col-sm-4,
.note-editor .col-sm-5,
.note-editor .col-sm-6,
.note-editor .col-sm-7,
.note-editor .col-sm-8,
.note-editor .col-sm-9,
.note-editor .col-sm-10,
.note-editor .col-sm-11 {
float: left;
}
.note-editor .col-sm-12 {
width: 100%;
}
.note-editor .col-sm-11 {
width: 91.66666666666666%;
}
.note-editor .col-sm-10 {
width: 83.33333333333334%;
}
.note-editor .col-sm-9 {
width: 75%;
}
.note-editor .col-sm-8 {
width: 66.66666666666666%;
}
.note-editor .col-sm-7 {
width: 58.333333333333336%;
}
.note-editor .col-sm-6 {
width: 50%;
}
.note-editor .col-sm-5 {
width: 41.66666666666667%;
}
.note-editor .col-sm-4 {
width: 33.33333333333333%;
}
.note-editor .col-sm-3 {
width: 25%;
}
.note-editor .col-sm-2 {
width: 16.666666666666664%;
}
.note-editor .col-sm-1 {
width: 8.333333333333332%;
}
.note-editor .col-sm-pull-12 {
right: 100%;
}
.note-editor .col-sm-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-sm-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-sm-pull-9 {
right: 75%;
}
.note-editor .col-sm-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-sm-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-sm-pull-6 {
right: 50%;
}
.note-editor .col-sm-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-sm-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-sm-pull-3 {
right: 25%;
}
.note-editor .col-sm-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-sm-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-sm-push-12 {
left: 100%;
}
.note-editor .col-sm-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-sm-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-sm-push-9 {
left: 75%;
}
.note-editor .col-sm-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-sm-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-sm-push-6 {
left: 50%;
}
.note-editor .col-sm-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-sm-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-sm-push-3 {
left: 25%;
}
.note-editor .col-sm-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-sm-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-sm-offset-12 {
margin-left: 100%;
}
.note-editor .col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-sm-offset-9 {
margin-left: 75%;
}
.note-editor .col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-sm-offset-6 {
margin-left: 50%;
}
.note-editor .col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-sm-offset-3 {
margin-left: 25%;
}
.note-editor .col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 992px) {
.note-editor .container {
width: 970px;
}
.note-editor .col-md-1,
.note-editor .col-md-2,
.note-editor .col-md-3,
.note-editor .col-md-4,
.note-editor .col-md-5,
.note-editor .col-md-6,
.note-editor .col-md-7,
.note-editor .col-md-8,
.note-editor .col-md-9,
.note-editor .col-md-10,
.note-editor .col-md-11 {
float: left;
}
.note-editor .col-md-12 {
width: 100%;
}
.note-editor .col-md-11 {
width: 91.66666666666666%;
}
.note-editor .col-md-10 {
width: 83.33333333333334%;
}
.note-editor .col-md-9 {
width: 75%;
}
.note-editor .col-md-8 {
width: 66.66666666666666%;
}
.note-editor .col-md-7 {
width: 58.333333333333336%;
}
.note-editor .col-md-6 {
width: 50%;
}
.note-editor .col-md-5 {
width: 41.66666666666667%;
}
.note-editor .col-md-4 {
width: 33.33333333333333%;
}
.note-editor .col-md-3 {
width: 25%;
}
.note-editor .col-md-2 {
width: 16.666666666666664%;
}
.note-editor .col-md-1 {
width: 8.333333333333332%;
}
.note-editor .col-md-pull-12 {
right: 100%;
}
.note-editor .col-md-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-md-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-md-pull-9 {
right: 75%;
}
.note-editor .col-md-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-md-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-md-pull-6 {
right: 50%;
}
.note-editor .col-md-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-md-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-md-pull-3 {
right: 25%;
}
.note-editor .col-md-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-md-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-md-push-12 {
left: 100%;
}
.note-editor .col-md-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-md-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-md-push-9 {
left: 75%;
}
.note-editor .col-md-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-md-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-md-push-6 {
left: 50%;
}
.note-editor .col-md-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-md-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-md-push-3 {
left: 25%;
}
.note-editor .col-md-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-md-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-md-offset-12 {
margin-left: 100%;
}
.note-editor .col-md-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-md-offset-9 {
margin-left: 75%;
}
.note-editor .col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-md-offset-6 {
margin-left: 50%;
}
.note-editor .col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-md-offset-3 {
margin-left: 25%;
}
.note-editor .col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-md-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 1200px) {
.note-editor .container {
width: 1170px;
}
.note-editor .col-lg-1,
.note-editor .col-lg-2,
.note-editor .col-lg-3,
.note-editor .col-lg-4,
.note-editor .col-lg-5,
.note-editor .col-lg-6,
.note-editor .col-lg-7,
.note-editor .col-lg-8,
.note-editor .col-lg-9,
.note-editor .col-lg-10,
.note-editor .col-lg-11 {
float: left;
}
.note-editor .col-lg-12 {
width: 100%;
}
.note-editor .col-lg-11 {
width: 91.66666666666666%;
}
.note-editor .col-lg-10 {
width: 83.33333333333334%;
}
.note-editor .col-lg-9 {
width: 75%;
}
.note-editor .col-lg-8 {
width: 66.66666666666666%;
}
.note-editor .col-lg-7 {
width: 58.333333333333336%;
}
.note-editor .col-lg-6 {
width: 50%;
}
.note-editor .col-lg-5 {
width: 41.66666666666667%;
}
.note-editor .col-lg-4 {
width: 33.33333333333333%;
}
.note-editor .col-lg-3 {
width: 25%;
}
.note-editor .col-lg-2 {
width: 16.666666666666664%;
}
.note-editor .col-lg-1 {
width: 8.333333333333332%;
}
.note-editor .col-lg-pull-12 {
right: 100%;
}
.note-editor .col-lg-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-lg-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-lg-pull-9 {
right: 75%;
}
.note-editor .col-lg-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-lg-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-lg-pull-6 {
right: 50%;
}
.note-editor .col-lg-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-lg-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-lg-pull-3 {
right: 25%;
}
.note-editor .col-lg-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-lg-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-lg-push-12 {
left: 100%;
}
.note-editor .col-lg-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-lg-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-lg-push-9 {
left: 75%;
}
.note-editor .col-lg-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-lg-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-lg-push-6 {
left: 50%;
}
.note-editor .col-lg-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-lg-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-lg-push-3 {
left: 25%;
}
.note-editor .col-lg-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-lg-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-lg-offset-12 {
margin-left: 100%;
}
.note-editor .col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-lg-offset-9 {
margin-left: 75%;
}
.note-editor .col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-lg-offset-6 {
margin-left: 50%;
}
.note-editor .col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-lg-offset-3 {
margin-left: 25%;
}
.note-editor .col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
}
.note-editor table {
max-width: 100%;
background-color: transparent;
}
.note-editor th {
text-align: left;
}
.note-editor .table {
width: 100%;
margin-bottom: 20px;
}
.note-editor .table > thead > tr > th,
.note-editor .table > tbody > tr > th,
.note-editor .table > tfoot > tr > th,
.note-editor .table > thead > tr > td,
.note-editor .table > tbody > tr > td,
.note-editor .table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.note-editor .table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.note-editor .table > caption + thead > tr:first-child > th,
.note-editor .table > colgroup + thead > tr:first-child > th,
.note-editor .table > thead:first-child > tr:first-child > th,
.note-editor .table > caption + thead > tr:first-child > td,
.note-editor .table > colgroup + thead > tr:first-child > td,
.note-editor .table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.note-editor .table > tbody + tbody {
border-top: 2px solid #dddddd;
}
.note-editor .table .table {
background-color: #ffffff;
}
.note-editor .table-condensed > thead > tr > th,
.note-editor .table-condensed > tbody > tr > th,
.note-editor .table-condensed > tfoot > tr > th,
.note-editor .table-condensed > thead > tr > td,
.note-editor .table-condensed > tbody > tr > td,
.note-editor .table-condensed > tfoot > tr > td {
padding: 5px;
}
.note-editor .table-bordered {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > tbody > tr > th,
.note-editor .table-bordered > tfoot > tr > th,
.note-editor .table-bordered > thead > tr > td,
.note-editor .table-bordered > tbody > tr > td,
.note-editor .table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.note-editor .table-striped > tbody > tr:nth-child(odd) > td,
.note-editor .table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.note-editor .table-hover > tbody > tr:hover > td,
.note-editor .table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
.note-editor table col[class*="col-"] {
float: none;
display: table-column;
}
.note-editor table td[class*="col-"],
.note-editor table th[class*="col-"] {
float: none;
display: table-cell;
}
.note-editor .table > thead > tr > td.active,
.note-editor .table > tbody > tr > td.active,
.note-editor .table > tfoot > tr > td.active,
.note-editor .table > thead > tr > th.active,
.note-editor .table > tbody > tr > th.active,
.note-editor .table > tfoot > tr > th.active,
.note-editor .table > thead > tr.active > td,
.note-editor .table > tbody > tr.active > td,
.note-editor .table > tfoot > tr.active > td,
.note-editor .table > thead > tr.active > th,
.note-editor .table > tbody > tr.active > th,
.note-editor .table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.note-editor .table > thead > tr > td.success,
.note-editor .table > tbody > tr > td.success,
.note-editor .table > tfoot > tr > td.success,
.note-editor .table > thead > tr > th.success,
.note-editor .table > tbody > tr > th.success,
.note-editor .table > tfoot > tr > th.success,
.note-editor .table > thead > tr.success > td,
.note-editor .table > tbody > tr.success > td,
.note-editor .table > tfoot > tr.success > td,
.note-editor .table > thead > tr.success > th,
.note-editor .table > tbody > tr.success > th,
.note-editor .table > tfoot > tr.success > th {
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .table-hover > tbody > tr > td.success:hover,
.note-editor .table-hover > tbody > tr > th.success:hover,
.note-editor .table-hover > tbody > tr.success:hover > td,
.note-editor .table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
border-color: #c9e2b3;
}
.note-editor .table > thead > tr > td.danger,
.note-editor .table > tbody > tr > td.danger,
.note-editor .table > tfoot > tr > td.danger,
.note-editor .table > thead > tr > th.danger,
.note-editor .table > tbody > tr > th.danger,
.note-editor .table > tfoot > tr > th.danger,
.note-editor .table > thead > tr.danger > td,
.note-editor .table > tbody > tr.danger > td,
.note-editor .table > tfoot > tr.danger > td,
.note-editor .table > thead > tr.danger > th,
.note-editor .table > tbody > tr.danger > th,
.note-editor .table > tfoot > tr.danger > th {
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .table-hover > tbody > tr > td.danger:hover,
.note-editor .table-hover > tbody > tr > th.danger:hover,
.note-editor .table-hover > tbody > tr.danger:hover > td,
.note-editor .table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
border-color: #e4b9c0;
}
.note-editor .table > thead > tr > td.warning,
.note-editor .table > tbody > tr > td.warning,
.note-editor .table > tfoot > tr > td.warning,
.note-editor .table > thead > tr > th.warning,
.note-editor .table > tbody > tr > th.warning,
.note-editor .table > tfoot > tr > th.warning,
.note-editor .table > thead > tr.warning > td,
.note-editor .table > tbody > tr.warning > td,
.note-editor .table > tfoot > tr.warning > td,
.note-editor .table > thead > tr.warning > th,
.note-editor .table > tbody > tr.warning > th,
.note-editor .table > tfoot > tr.warning > th {
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .table-hover > tbody > tr > td.warning:hover,
.note-editor .table-hover > tbody > tr > th.warning:hover,
.note-editor .table-hover > tbody > tr.warning:hover > td,
.note-editor .table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
border-color: #f7e1b5;
}
@media (max-width: 767px) {
.note-editor .table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
overflow-x: scroll;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #dddddd;
-webkit-overflow-scrolling: touch;
}
.note-editor .table-responsive > .table {
margin-bottom: 0;
}
.note-editor .table-responsive > .table > thead > tr > th,
.note-editor .table-responsive > .table > tbody > tr > th,
.note-editor .table-responsive > .table > tfoot > tr > th,
.note-editor .table-responsive > .table > thead > tr > td,
.note-editor .table-responsive > .table > tbody > tr > td,
.note-editor .table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.note-editor .table-responsive > .table-bordered {
border: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
.note-editor fieldset {
padding: 0;
margin: 0;
border: 0;
}
.note-editor legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
.note-editor label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
.note-editor input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor input[type="radio"],
.note-editor input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
.note-editor input[type="file"] {
display: block;
}
.note-editor select[multiple],
.note-editor select[size] {
height: auto;
}
.note-editor select optgroup {
font-size: inherit;
font-style: inherit;
font-family: inherit;
}
.note-editor input[type="file"]:focus,
.note-editor input[type="radio"]:focus,
.note-editor input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor input[type="number"]::-webkit-outer-spin-button,
.note-editor input[type="number"]::-webkit-inner-spin-button {
height: auto;
}
.note-editor output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
}
.note-editor .form-control:-moz-placeholder {
color: #999999;
}
.note-editor .form-control::-moz-placeholder {
color: #999999;
}
.note-editor .form-control:-ms-input-placeholder {
color: #999999;
}
.note-editor .form-control::-webkit-input-placeholder {
color: #999999;
}
.note-editor .form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.note-editor .form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.note-editor .form-control[disabled],
.note-editor .form-control[readonly],
fieldset[disabled] .note-editor .form-control {
cursor: not-allowed;
background-color: #eeeeee;
}
textarea.note-editor .form-control {
height: auto;
}
.note-editor .form-group {
margin-bottom: 15px;
}
.note-editor .radio,
.note-editor .checkbox {
display: block;
min-height: 20px;
margin-top: 10px;
margin-bottom: 10px;
padding-left: 20px;
vertical-align: middle;
}
.note-editor .radio label,
.note-editor .checkbox label {
display: inline;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio input[type="radio"],
.note-editor .radio-inline input[type="radio"],
.note-editor .checkbox input[type="checkbox"],
.note-editor .checkbox-inline input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.note-editor .radio + .radio,
.note-editor .checkbox + .checkbox {
margin-top: -5px;
}
.note-editor .radio-inline,
.note-editor .checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio-inline + .radio-inline,
.note-editor .checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
.note-editor input[type="radio"][disabled],
.note-editor input[type="checkbox"][disabled],
.note-editor .radio[disabled],
.note-editor .radio-inline[disabled],
.note-editor .checkbox[disabled],
.note-editor .checkbox-inline[disabled],
fieldset[disabled] .note-editor input[type="radio"],
fieldset[disabled] .note-editor input[type="checkbox"],
fieldset[disabled] .note-editor .radio,
fieldset[disabled] .note-editor .radio-inline,
fieldset[disabled] .note-editor .checkbox,
fieldset[disabled] .note-editor .checkbox-inline {
cursor: not-allowed;
}
.note-editor .input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-sm {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-sm {
height: auto;
}
.note-editor .input-lg {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-lg {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-lg {
height: auto;
}
.note-editor .has-warning .help-block,
.note-editor .has-warning .control-label {
color: #c09853;
}
.note-editor .has-warning .form-control {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-warning .form-control:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.note-editor .has-warning .input-group-addon {
color: #c09853;
border-color: #c09853;
background-color: #fcf8e3;
}
.note-editor .has-error .help-block,
.note-editor .has-error .control-label {
color: #b94a48;
}
.note-editor .has-error .form-control {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-error .form-control:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.note-editor .has-error .input-group-addon {
color: #b94a48;
border-color: #b94a48;
background-color: #f2dede;
}
.note-editor .has-success .help-block,
.note-editor .has-success .control-label {
color: #468847;
}
.note-editor .has-success .form-control {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-success .form-control:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.note-editor .has-success .input-group-addon {
color: #468847;
border-color: #468847;
background-color: #dff0d8;
}
.note-editor .form-control-static {
margin-bottom: 0;
}
.note-editor .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.note-editor .form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .form-inline .form-control {
display: inline-block;
}
.note-editor .form-inline .radio,
.note-editor .form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .form-inline .radio input[type="radio"],
.note-editor .form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
.note-editor .form-horizontal .control-label,
.note-editor .form-horizontal .radio,
.note-editor .form-horizontal .checkbox,
.note-editor .form-horizontal .radio-inline,
.note-editor .form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.note-editor .form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-control-static {
padding-top: 7px;
}
@media (min-width: 768px) {
.note-editor .form-horizontal .control-label {
text-align: right;
}
}
.note-editor .btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.note-editor .btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor .btn:hover,
.note-editor .btn:focus {
color: #333333;
text-decoration: none;
}
.note-editor .btn:active,
.note-editor .btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn.disabled,
.note-editor .btn[disabled],
fieldset[disabled] .note-editor .btn {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-default:hover,
.note-editor .btn-default:focus,
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
background-image: none;
}
.note-editor .btn-default.disabled,
.note-editor .btn-default[disabled],
fieldset[disabled] .note-editor .btn-default,
.note-editor .btn-default.disabled:hover,
.note-editor .btn-default[disabled]:hover,
fieldset[disabled] .note-editor .btn-default:hover,
.note-editor .btn-default.disabled:focus,
.note-editor .btn-default[disabled]:focus,
fieldset[disabled] .note-editor .btn-default:focus,
.note-editor .btn-default.disabled:active,
.note-editor .btn-default[disabled]:active,
fieldset[disabled] .note-editor .btn-default:active,
.note-editor .btn-default.disabled.active,
.note-editor .btn-default[disabled].active,
fieldset[disabled] .note-editor .btn-default.active {
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-primary {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-primary:hover,
.note-editor .btn-primary:focus,
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
background-image: none;
}
.note-editor .btn-primary.disabled,
.note-editor .btn-primary[disabled],
fieldset[disabled] .note-editor .btn-primary,
.note-editor .btn-primary.disabled:hover,
.note-editor .btn-primary[disabled]:hover,
fieldset[disabled] .note-editor .btn-primary:hover,
.note-editor .btn-primary.disabled:focus,
.note-editor .btn-primary[disabled]:focus,
fieldset[disabled] .note-editor .btn-primary:focus,
.note-editor .btn-primary.disabled:active,
.note-editor .btn-primary[disabled]:active,
fieldset[disabled] .note-editor .btn-primary:active,
.note-editor .btn-primary.disabled.active,
.note-editor .btn-primary[disabled].active,
fieldset[disabled] .note-editor .btn-primary.active {
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-warning:hover,
.note-editor .btn-warning:focus,
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
color: #ffffff;
background-color: #ed9c28;
border-color: #d58512;
}
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
background-image: none;
}
.note-editor .btn-warning.disabled,
.note-editor .btn-warning[disabled],
fieldset[disabled] .note-editor .btn-warning,
.note-editor .btn-warning.disabled:hover,
.note-editor .btn-warning[disabled]:hover,
fieldset[disabled] .note-editor .btn-warning:hover,
.note-editor .btn-warning.disabled:focus,
.note-editor .btn-warning[disabled]:focus,
fieldset[disabled] .note-editor .btn-warning:focus,
.note-editor .btn-warning.disabled:active,
.note-editor .btn-warning[disabled]:active,
fieldset[disabled] .note-editor .btn-warning:active,
.note-editor .btn-warning.disabled.active,
.note-editor .btn-warning[disabled].active,
fieldset[disabled] .note-editor .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-danger:hover,
.note-editor .btn-danger:focus,
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
color: #ffffff;
background-color: #d2322d;
border-color: #ac2925;
}
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
background-image: none;
}
.note-editor .btn-danger.disabled,
.note-editor .btn-danger[disabled],
fieldset[disabled] .note-editor .btn-danger,
.note-editor .btn-danger.disabled:hover,
.note-editor .btn-danger[disabled]:hover,
fieldset[disabled] .note-editor .btn-danger:hover,
.note-editor .btn-danger.disabled:focus,
.note-editor .btn-danger[disabled]:focus,
fieldset[disabled] .note-editor .btn-danger:focus,
.note-editor .btn-danger.disabled:active,
.note-editor .btn-danger[disabled]:active,
fieldset[disabled] .note-editor .btn-danger:active,
.note-editor .btn-danger.disabled.active,
.note-editor .btn-danger[disabled].active,
fieldset[disabled] .note-editor .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-success:hover,
.note-editor .btn-success:focus,
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
color: #ffffff;
background-color: #47a447;
border-color: #398439;
}
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
background-image: none;
}
.note-editor .btn-success.disabled,
.note-editor .btn-success[disabled],
fieldset[disabled] .note-editor .btn-success,
.note-editor .btn-success.disabled:hover,
.note-editor .btn-success[disabled]:hover,
fieldset[disabled] .note-editor .btn-success:hover,
.note-editor .btn-success.disabled:focus,
.note-editor .btn-success[disabled]:focus,
fieldset[disabled] .note-editor .btn-success:focus,
.note-editor .btn-success.disabled:active,
.note-editor .btn-success[disabled]:active,
fieldset[disabled] .note-editor .btn-success:active,
.note-editor .btn-success.disabled.active,
.note-editor .btn-success[disabled].active,
fieldset[disabled] .note-editor .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-info:hover,
.note-editor .btn-info:focus,
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
color: #ffffff;
background-color: #39b3d7;
border-color: #269abc;
}
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
background-image: none;
}
.note-editor .btn-info.disabled,
.note-editor .btn-info[disabled],
fieldset[disabled] .note-editor .btn-info,
.note-editor .btn-info.disabled:hover,
.note-editor .btn-info[disabled]:hover,
fieldset[disabled] .note-editor .btn-info:hover,
.note-editor .btn-info.disabled:focus,
.note-editor .btn-info[disabled]:focus,
fieldset[disabled] .note-editor .btn-info:focus,
.note-editor .btn-info.disabled:active,
.note-editor .btn-info[disabled]:active,
fieldset[disabled] .note-editor .btn-info:active,
.note-editor .btn-info.disabled.active,
.note-editor .btn-info[disabled].active,
fieldset[disabled] .note-editor .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-link {
color: #428bca;
font-weight: normal;
cursor: pointer;
border-radius: 0;
}
.note-editor .btn-link,
.note-editor .btn-link:active,
.note-editor .btn-link[disabled],
fieldset[disabled] .note-editor .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-link,
.note-editor .btn-link:hover,
.note-editor .btn-link:focus,
.note-editor .btn-link:active {
border-color: transparent;
}
.note-editor .btn-link:hover,
.note-editor .btn-link:focus {
color: #2a6496;
text-decoration: underline;
background-color: transparent;
}
.note-editor .btn-link[disabled]:hover,
fieldset[disabled] .note-editor .btn-link:hover,
.note-editor .btn-link[disabled]:focus,
fieldset[disabled] .note-editor .btn-link:focus {
color: #999999;
text-decoration: none;
}
.note-editor .btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-sm,
.note-editor .btn-xs {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-xs {
padding: 1px 5px;
}
.note-editor .btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
.note-editor .btn-block + .btn-block {
margin-top: 5px;
}
.note-editor input[type="submit"].btn-block,
.note-editor input[type="reset"].btn-block,
.note-editor input[type="button"].btn-block {
width: 100%;
}
.note-editor .fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.note-editor .fade.in {
opacity: 1;
}
.note-editor .collapse {
display: none;
}
.note-editor .collapse.in {
display: block;
}
.note-editor .collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
}
.note-editor .caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 0 dotted;
}
.note-editor .dropdown {
position: relative;
}
.note-editor .dropdown-toggle:focus {
outline: 0;
}
.note-editor .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.note-editor .dropdown-menu.pull-right {
right: 0;
left: auto;
}
.note-editor .dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap;
}
.note-editor .dropdown-menu > li > a:hover,
.note-editor .dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.note-editor .dropdown-menu > .active > a,
.note-editor .dropdown-menu > .active > a:hover,
.note-editor .dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #428bca;
}
.note-editor .dropdown-menu > .disabled > a,
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
color: #999999;
}
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.note-editor .open > .dropdown-menu {
display: block;
}
.note-editor .open > a {
outline: 0;
}
.note-editor .dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #999999;
}
.note-editor .dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.note-editor .pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.note-editor .dropup .caret,
.note-editor .navbar-fixed-bottom .dropdown .caret {
border-top: 0 dotted;
border-bottom: 4px solid #000000;
content: "";
}
.note-editor .dropup .dropdown-menu,
.note-editor .navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
.btn-default .note-editor .caret {
border-top-color: #333333;
}
.btn-primary .note-editor .caret,
.btn-success .note-editor .caret,
.btn-warning .note-editor .caret,
.btn-danger .note-editor .caret,
.btn-info .note-editor .caret {
border-top-color: #fff;
}
.note-editor .dropup .btn-default .caret {
border-bottom-color: #333333;
}
.note-editor .dropup .btn-primary .caret,
.note-editor .dropup .btn-success .caret,
.note-editor .dropup .btn-warning .caret,
.note-editor .dropup .btn-danger .caret,
.note-editor .dropup .btn-info .caret {
border-bottom-color: #fff;
}
.note-editor .btn-group,
.note-editor .btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.note-editor .btn-group > .btn,
.note-editor .btn-group-vertical > .btn {
position: relative;
float: left;
}
.note-editor .btn-group > .btn:hover,
.note-editor .btn-group-vertical > .btn:hover,
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus,
.note-editor .btn-group > .btn:active,
.note-editor .btn-group-vertical > .btn:active,
.note-editor .btn-group > .btn.active,
.note-editor .btn-group-vertical > .btn.active {
z-index: 2;
}
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus {
outline: none;
}
.note-editor .btn-group .btn + .btn,
.note-editor .btn-group .btn + .btn-group,
.note-editor .btn-group .btn-group + .btn,
.note-editor .btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar .btn-group {
float: left;
}
.note-editor .btn-toolbar > .btn + .btn,
.note-editor .btn-toolbar > .btn-group + .btn,
.note-editor .btn-toolbar > .btn + .btn-group,
.note-editor .btn-toolbar > .btn-group + .btn-group {
margin-left: 5px;
}
.note-editor .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.note-editor .btn-group > .btn:first-child {
margin-left: 0;
}
.note-editor .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn:last-child:not(:first-child),
.note-editor .btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group > .btn-group {
float: left;
}
.note-editor .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn-group:last-child > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group .dropdown-toggle:active,
.note-editor .btn-group.open .dropdown-toggle {
outline: 0;
}
.note-editor .btn-group-xs > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 5px;
}
.note-editor .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-group > .btn + .dropdown-toggle {
padding-left: 5px;
padding-right: 5px;
}
.note-editor .btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.note-editor .btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn .caret {
margin-left: 0;
}
.note-editor .btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.note-editor .dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.note-editor .btn-group-vertical > .btn,
.note-editor .btn-group-vertical > .btn-group {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group > .btn {
float: none;
}
.note-editor .btn-group-vertical > .btn + .btn,
.note-editor .btn-group-vertical > .btn + .btn-group,
.note-editor .btn-group-vertical > .btn-group + .btn,
.note-editor .btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.note-editor .btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn:last-child:not(:first-child) {
border-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:last-child > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.note-editor .btn-group-justified .btn {
float: none;
display: table-cell;
width: 1%;
}
.note-editor [data-toggle="buttons"] > .btn > input[type="radio"],
.note-editor [data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.note-editor .input-group {
position: relative;
display: table;
border-collapse: separate;
}
.note-editor .input-group.col {
float: none;
padding-left: 0;
padding-right: 0;
}
.note-editor .input-group .form-control {
width: 100%;
margin-bottom: 0;
}
.note-editor .input-group-lg > .form-control,
.note-editor .input-group-lg > .input-group-addon,
.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-group-lg > .form-control,
select.note-editor .input-group-lg > .input-group-addon,
select.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-group-lg > .form-control,
textarea.note-editor .input-group-lg > .input-group-addon,
textarea.note-editor .input-group-lg > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-sm > .form-control,
.note-editor .input-group-sm > .input-group-addon,
.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-group-sm > .form-control,
select.note-editor .input-group-sm > .input-group-addon,
select.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-group-sm > .form-control,
textarea.note-editor .input-group-sm > .input-group-addon,
textarea.note-editor .input-group-sm > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn,
.note-editor .input-group .form-control {
display: table-cell;
}
.note-editor .input-group-addon:not(:first-child):not(:last-child),
.note-editor .input-group-btn:not(:first-child):not(:last-child),
.note-editor .input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.note-editor .input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor .input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.note-editor .input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.note-editor .input-group-addon input[type="radio"],
.note-editor .input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.note-editor .input-group .form-control:first-child,
.note-editor .input-group-addon:first-child,
.note-editor .input-group-btn:first-child > .btn,
.note-editor .input-group-btn:first-child > .dropdown-toggle,
.note-editor .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .input-group-addon:first-child {
border-right: 0;
}
.note-editor .input-group .form-control:last-child,
.note-editor .input-group-addon:last-child,
.note-editor .input-group-btn:last-child > .btn,
.note-editor .input-group-btn:last-child > .dropdown-toggle,
.note-editor .input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .input-group-addon:last-child {
border-left: 0;
}
.note-editor .input-group-btn {
position: relative;
white-space: nowrap;
}
.note-editor .input-group-btn:first-child > .btn {
margin-right: -1px;
}
.note-editor .input-group-btn:last-child > .btn {
margin-left: -1px;
}
.note-editor .input-group-btn > .btn {
position: relative;
}
.note-editor .input-group-btn > .btn + .btn {
margin-left: -4px;
}
.note-editor .input-group-btn > .btn:hover,
.note-editor .input-group-btn > .btn:active {
z-index: 2;
}
.note-editor .nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav > li {
position: relative;
display: block;
}
.note-editor .nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.note-editor .nav > li > a:hover,
.note-editor .nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .nav > li.disabled > a {
color: #999999;
}
.note-editor .nav > li.disabled > a:hover,
.note-editor .nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.note-editor .nav .open > a,
.note-editor .nav .open > a:hover,
.note-editor .nav .open > a:focus {
background-color: #eeeeee;
border-color: #428bca;
}
.note-editor .nav .open > a .caret,
.note-editor .nav .open > a:hover .caret,
.note-editor .nav .open > a:focus .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .nav > li > a > img {
max-width: none;
}
.note-editor .nav-tabs {
border-bottom: 1px solid #dddddd;
}
.note-editor .nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.note-editor .nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.note-editor .nav-tabs > li.active > a,
.note-editor .nav-tabs > li.active > a:hover,
.note-editor .nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.note-editor .nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.note-editor .nav-tabs.nav-justified > li {
float: none;
}
.note-editor .nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .nav-pills > li {
float: left;
}
.note-editor .nav-pills > li > a {
border-radius: 4px;
}
.note-editor .nav-pills > li + li {
margin-left: 2px;
}
.note-editor .nav-pills > li.active > a,
.note-editor .nav-pills > li.active > a:hover,
.note-editor .nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #428bca;
}
.note-editor .nav-pills > li.active > a .caret,
.note-editor .nav-pills > li.active > a:hover .caret,
.note-editor .nav-pills > li.active > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .nav-stacked > li {
float: none;
}
.note-editor .nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.note-editor .nav-justified {
width: 100%;
}
.note-editor .nav-justified > li {
float: none;
}
.note-editor .nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs-justified {
border-bottom: 0;
}
.note-editor .nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .tab-content > .tab-pane {
display: none;
}
.note-editor .tab-content > .active {
display: block;
}
.note-editor .nav .caret {
border-top-color: #428bca;
border-bottom-color: #428bca;
}
.note-editor .nav a:hover .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar {
position: relative;
z-index: 1000;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar {
border-radius: 4px;
}
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar-header {
float: left;
}
}
.note-editor .navbar-collapse {
max-height: 340px;
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.note-editor .navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.note-editor .navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.note-editor .navbar-collapse.in {
overflow-y: visible;
}
.note-editor .navbar-collapse .navbar-nav.navbar-left:first-child {
margin-left: -15px;
}
.note-editor .navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
.note-editor .navbar-collapse .navbar-text:last-child {
margin-right: 0;
}
}
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.note-editor .navbar-static-top {
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-static-top {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top {
z-index: 1030;
top: 0;
}
.note-editor .navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.note-editor .navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.note-editor .navbar-brand:hover,
.note-editor .navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .note-editor .navbar-brand {
margin-left: -15px;
}
}
.note-editor .navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.note-editor .navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.note-editor .navbar-toggle {
display: none;
}
}
.note-editor .navbar-nav {
margin: 7.5px -15px;
}
.note-editor .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.note-editor .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a,
.note-editor .navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.note-editor .navbar-nav {
float: left;
margin: 0;
}
.note-editor .navbar-nav > li {
float: left;
}
.note-editor .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-left {
float: left !important;
}
.note-editor .navbar-right {
float: right !important;
}
}
.note-editor .navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@media (min-width: 768px) {
.note-editor .navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .navbar-form .form-control {
display: inline-block;
}
.note-editor .navbar-form .radio,
.note-editor .navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .navbar-form .radio input[type="radio"],
.note-editor .navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
@media (max-width: 767px) {
.note-editor .navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.note-editor .navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .navbar-nav.pull-right > li > .dropdown-menu,
.note-editor .navbar-nav > li > .dropdown-menu.pull-right {
left: auto;
right: 0;
}
.note-editor .navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.note-editor .navbar-text {
float: left;
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.note-editor .navbar-text {
margin-left: 15px;
margin-right: 15px;
}
}
.note-editor .navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-brand {
color: #777777;
}
.note-editor .navbar-default .navbar-brand:hover,
.note-editor .navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.note-editor .navbar-default .navbar-text {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a:hover,
.note-editor .navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav > .active > a,
.note-editor .navbar-default .navbar-nav > .active > a:hover,
.note-editor .navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .disabled > a,
.note-editor .navbar-default .navbar-nav > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.note-editor .navbar-default .navbar-toggle {
border-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle:hover,
.note-editor .navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle .icon-bar {
background-color: #cccccc;
}
.note-editor .navbar-default .navbar-collapse,
.note-editor .navbar-default .navbar-form {
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #333333;
border-bottom-color: #333333;
}
.note-editor .navbar-default .navbar-nav > .open > a,
.note-editor .navbar-default .navbar-nav > .open > a:hover,
.note-editor .navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555555;
}
.note-editor .navbar-default .navbar-nav > .open > a .caret,
.note-editor .navbar-default .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #777777;
border-bottom-color: #777777;
}
@media (max-width: 767px) {
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.note-editor .navbar-default .navbar-link {
color: #777777;
}
.note-editor .navbar-default .navbar-link:hover {
color: #333333;
}
.note-editor .navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-brand {
color: #999999;
}
.note-editor .navbar-inverse .navbar-brand:hover,
.note-editor .navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-text {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a:hover,
.note-editor .navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav > .active > a,
.note-editor .navbar-inverse .navbar-nav > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav > .disabled > a,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-toggle {
border-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle:hover,
.note-editor .navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-collapse,
.note-editor .navbar-inverse .navbar-form {
border-color: #101010;
}
.note-editor .navbar-inverse .navbar-nav > .open > a,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus {
background-color: #080808;
color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a .caret {
border-top-color: #999999;
border-bottom-color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > .open > a .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
@media (max-width: 767px) {
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
.note-editor .navbar-inverse .navbar-link {
color: #999999;
}
.note-editor .navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.note-editor .breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.note-editor .breadcrumb > li {
display: inline-block;
}
.note-editor .breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.note-editor .breadcrumb > .active {
color: #999999;
}
.note-editor .pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.note-editor .pagination > li {
display: inline;
}
.note-editor .pagination > li > a,
.note-editor .pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.428571429;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.note-editor .pagination > li:first-child > a,
.note-editor .pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .pagination > li:last-child > a,
.note-editor .pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.note-editor .pagination > li > a:hover,
.note-editor .pagination > li > span:hover,
.note-editor .pagination > li > a:focus,
.note-editor .pagination > li > span:focus {
background-color: #eeeeee;
}
.note-editor .pagination > .active > a,
.note-editor .pagination > .active > span,
.note-editor .pagination > .active > a:hover,
.note-editor .pagination > .active > span:hover,
.note-editor .pagination > .active > a:focus,
.note-editor .pagination > .active > span:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
cursor: default;
}
.note-editor .pagination > .disabled > span,
.note-editor .pagination > .disabled > span:hover,
.note-editor .pagination > .disabled > span:focus,
.note-editor .pagination > .disabled > a,
.note-editor .pagination > .disabled > a:hover,
.note-editor .pagination > .disabled > a:focus {
color: #999999;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.note-editor .pagination-lg > li > a,
.note-editor .pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
}
.note-editor .pagination-lg > li:first-child > a,
.note-editor .pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.note-editor .pagination-lg > li:last-child > a,
.note-editor .pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.note-editor .pagination-sm > li > a,
.note-editor .pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.note-editor .pagination-sm > li:first-child > a,
.note-editor .pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .pagination-sm > li:last-child > a,
.note-editor .pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.note-editor .pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager li {
display: inline;
}
.note-editor .pager li > a,
.note-editor .pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.note-editor .pager li > a:hover,
.note-editor .pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .pager .next > a,
.note-editor .pager .next > span {
float: right;
}
.note-editor .pager .previous > a,
.note-editor .pager .previous > span {
float: left;
}
.note-editor .pager .disabled > a,
.note-editor .pager .disabled > a:hover,
.note-editor .pager .disabled > a:focus,
.note-editor .pager .disabled > span {
color: #999999;
background-color: #ffffff;
cursor: not-allowed;
}
.note-editor .label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.note-editor .label[href]:hover,
.note-editor .label[href]:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .label:empty {
display: none;
}
.note-editor .label-default {
background-color: #999999;
}
.note-editor .label-default[href]:hover,
.note-editor .label-default[href]:focus {
background-color: #808080;
}
.note-editor .label-primary {
background-color: #428bca;
}
.note-editor .label-primary[href]:hover,
.note-editor .label-primary[href]:focus {
background-color: #3071a9;
}
.note-editor .label-success {
background-color: #5cb85c;
}
.note-editor .label-success[href]:hover,
.note-editor .label-success[href]:focus {
background-color: #449d44;
}
.note-editor .label-info {
background-color: #5bc0de;
}
.note-editor .label-info[href]:hover,
.note-editor .label-info[href]:focus {
background-color: #31b0d5;
}
.note-editor .label-warning {
background-color: #f0ad4e;
}
.note-editor .label-warning[href]:hover,
.note-editor .label-warning[href]:focus {
background-color: #ec971f;
}
.note-editor .label-danger {
background-color: #d9534f;
}
.note-editor .label-danger[href]:hover,
.note-editor .label-danger[href]:focus {
background-color: #c9302c;
}
.note-editor .badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: #999999;
border-radius: 10px;
}
.note-editor .badge:empty {
display: none;
}
.note-editor a.badge:hover,
.note-editor a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .btn .badge {
position: relative;
top: -1px;
}
.note-editor a.list-group-item.active > .badge,
.note-editor .nav-pills > .active > a > .badge {
color: #428bca;
background-color: #ffffff;
}
.note-editor .nav-pills > li > a > .badge {
margin-left: 3px;
}
.note-editor .jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 21px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
.note-editor .jumbotron h1 {
line-height: 1;
color: inherit;
}
.note-editor .jumbotron p {
line-height: 1.4;
}
.container .note-editor .jumbotron {
border-radius: 6px;
}
@media screen and (min-width: 768px) {
.note-editor .jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .note-editor .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.note-editor .jumbotron h1 {
font-size: 63px;
}
}
.note-editor .thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
display: block;
margin-bottom: 20px;
}
.note-editor .thumbnail > img {
display: block;
max-width: 100%;
height: auto;
}
.note-editor a.thumbnail:hover,
.note-editor a.thumbnail:focus,
.note-editor a.thumbnail.active {
border-color: #428bca;
}
.note-editor .thumbnail > img {
margin-left: auto;
margin-right: auto;
}
.note-editor .thumbnail .caption {
padding: 9px;
color: #333333;
}
.note-editor .alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .alert h4 {
margin-top: 0;
color: inherit;
}
.note-editor .alert .alert-link {
font-weight: bold;
}
.note-editor .alert > p,
.note-editor .alert > ul {
margin-bottom: 0;
}
.note-editor .alert > p + p {
margin-top: 5px;
}
.note-editor .alert-dismissable {
padding-right: 35px;
}
.note-editor .alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.note-editor .alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
.note-editor .alert-success hr {
border-top-color: #c9e2b3;
}
.note-editor .alert-success .alert-link {
color: #356635;
}
.note-editor .alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
.note-editor .alert-info hr {
border-top-color: #a6e1ec;
}
.note-editor .alert-info .alert-link {
color: #2d6987;
}
.note-editor .alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #c09853;
}
.note-editor .alert-warning hr {
border-top-color: #f7e1b5;
}
.note-editor .alert-warning .alert-link {
color: #a47e3c;
}
.note-editor .alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #b94a48;
}
.note-editor .alert-danger hr {
border-top-color: #e4b9c0;
}
.note-editor .alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.note-editor .progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.note-editor .progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #428bca;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.note-editor .progress-striped .progress-bar {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.note-editor .progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.note-editor .progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .note-editor .progress-bar-success {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .note-editor .progress-bar-info {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .note-editor .progress-bar-warning {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .note-editor .progress-bar-danger {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .media,
.note-editor .media-body {
overflow: hidden;
zoom: 1;
}
.note-editor .media,
.note-editor .media .media {
margin-top: 15px;
}
.note-editor .media:first-child {
margin-top: 0;
}
.note-editor .media-object {
display: block;
}
.note-editor .media-heading {
margin: 0 0 5px;
}
.note-editor .media > .pull-left {
margin-right: 10px;
}
.note-editor .media > .pull-right {
margin-left: 10px;
}
.note-editor .media-list {
padding-left: 0;
list-style: none;
}
.note-editor .list-group {
margin-bottom: 20px;
padding-left: 0;
}
.note-editor .list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.note-editor .list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.note-editor .list-group-item > .badge {
float: right;
}
.note-editor .list-group-item > .badge + .badge {
margin-right: 5px;
}
.note-editor a.list-group-item {
color: #555555;
}
.note-editor a.list-group-item .list-group-item-heading {
color: #333333;
}
.note-editor a.list-group-item:hover,
.note-editor a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
.note-editor a.list-group-item.active,
.note-editor a.list-group-item.active:hover,
.note-editor a.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor a.list-group-item.active .list-group-item-heading,
.note-editor a.list-group-item.active:hover .list-group-item-heading,
.note-editor a.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
.note-editor a.list-group-item.active .list-group-item-text,
.note-editor a.list-group-item.active:hover .list-group-item-text,
.note-editor a.list-group-item.active:focus .list-group-item-text {
color: #e1edf7;
}
.note-editor .list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.note-editor .list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.note-editor .panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .panel-body {
padding: 15px;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel > .list-group {
margin-bottom: 0;
}
.note-editor .panel > .list-group .list-group-item {
border-width: 1px 0;
}
.note-editor .panel > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.note-editor .panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.note-editor .panel > .table,
.note-editor .panel > .table-responsive {
margin-bottom: 0;
}
.note-editor .panel > .panel-body + .table,
.note-editor .panel > .panel-body + .table-responsive {
border-top: 1px solid #dddddd;
}
.note-editor .panel > .table-bordered,
.note-editor .panel > .table-responsive > .table-bordered {
border: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .panel > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
.note-editor .panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
}
.note-editor .panel-title > a {
color: inherit;
}
.note-editor .panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.note-editor .panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
overflow: hidden;
}
.note-editor .panel-group .panel + .panel {
margin-top: 5px;
}
.note-editor .panel-group .panel-heading {
border-bottom: 0;
}
.note-editor .panel-group .panel-heading + .panel-collapse .panel-body {
border-top: 1px solid #dddddd;
}
.note-editor .panel-group .panel-footer {
border-top: 0;
}
.note-editor .panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.note-editor .panel-default {
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #dddddd;
}
.note-editor .panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #dddddd;
}
.note-editor .panel-primary {
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading {
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #428bca;
}
.note-editor .panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #428bca;
}
.note-editor .panel-success {
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #d6e9c6;
}
.note-editor .panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #d6e9c6;
}
.note-editor .panel-warning {
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading {
color: #c09853;
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #faebcc;
}
.note-editor .panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #faebcc;
}
.note-editor .panel-danger {
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading {
color: #b94a48;
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #ebccd1;
}
.note-editor .panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #ebccd1;
}
.note-editor .panel-info {
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #bce8f1;
}
.note-editor .panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #bce8f1;
}
.note-editor .well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.note-editor .well-lg {
padding: 24px;
border-radius: 6px;
}
.note-editor .well-sm {
padding: 9px;
border-radius: 3px;
}
.note-editor .close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.note-editor .close:hover,
.note-editor .close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.note-editor .close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: auto;
overflow-y: scroll;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog {
margin-left: auto;
margin-right: auto;
width: auto;
padding: 10px;
z-index: 1050;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: none;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.428571429px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
margin-top: 15px;
padding: 19px 20px 20px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media screen and (min-width: 768px) {
.modal-dialog {
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
visibility: visible;
font-size: 12px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
right: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after {
border-width: 10px;
content: "";
}
.popover.top .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-control.left {
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicons-chevron-left,
.carousel-control .glyphicons-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
tr.visible-xs,
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs.visible-sm {
display: block !important;
}
tr.visible-xs.visible-sm {
display: table-row !important;
}
th.visible-xs.visible-sm,
td.visible-xs.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs.visible-md {
display: block !important;
}
tr.visible-xs.visible-md {
display: table-row !important;
}
th.visible-xs.visible-md,
td.visible-xs.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-xs.visible-lg {
display: block !important;
}
tr.visible-xs.visible-lg {
display: table-row !important;
}
th.visible-xs.visible-lg,
td.visible-xs.visible-lg {
display: table-cell !important;
}
}
.visible-sm,
tr.visible-sm,
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (max-width: 767px) {
.visible-sm.visible-xs {
display: block !important;
}
tr.visible-sm.visible-xs {
display: table-row !important;
}
th.visible-sm.visible-xs,
td.visible-sm.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-sm.visible-md {
display: block !important;
}
tr.visible-sm.visible-md {
display: table-row !important;
}
th.visible-sm.visible-md,
td.visible-sm.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-sm.visible-lg {
display: block !important;
}
tr.visible-sm.visible-lg {
display: table-row !important;
}
th.visible-sm.visible-lg,
td.visible-sm.visible-lg {
display: table-cell !important;
}
}
.visible-md,
tr.visible-md,
th.visible-md,
td.visible-md {
display: none !important;
}
@media (max-width: 767px) {
.visible-md.visible-xs {
display: block !important;
}
tr.visible-md.visible-xs {
display: table-row !important;
}
th.visible-md.visible-xs,
td.visible-md.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-md.visible-sm {
display: block !important;
}
tr.visible-md.visible-sm {
display: table-row !important;
}
th.visible-md.visible-sm,
td.visible-md.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-md.visible-lg {
display: block !important;
}
tr.visible-md.visible-lg {
display: table-row !important;
}
th.visible-md.visible-lg,
td.visible-md.visible-lg {
display: table-cell !important;
}
}
.visible-lg,
tr.visible-lg,
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (max-width: 767px) {
.visible-lg.visible-xs {
display: block !important;
}
tr.visible-lg.visible-xs {
display: table-row !important;
}
th.visible-lg.visible-xs,
td.visible-lg.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-lg.visible-sm {
display: block !important;
}
tr.visible-lg.visible-sm {
display: table-row !important;
}
th.visible-lg.visible-sm,
td.visible-lg.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-lg.visible-md {
display: block !important;
}
tr.visible-lg.visible-md {
display: table-row !important;
}
th.visible-lg.visible-md,
td.visible-lg.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
.hidden-xs {
display: block !important;
}
tr.hidden-xs {
display: table-row !important;
}
th.hidden-xs,
td.hidden-xs {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-xs,
tr.hidden-xs,
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-xs.hidden-sm,
tr.hidden-xs.hidden-sm,
th.hidden-xs.hidden-sm,
td.hidden-xs.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-xs.hidden-md,
tr.hidden-xs.hidden-md,
th.hidden-xs.hidden-md,
td.hidden-xs.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-xs.hidden-lg,
tr.hidden-xs.hidden-lg,
th.hidden-xs.hidden-lg,
td.hidden-xs.hidden-lg {
display: none !important;
}
}
.hidden-sm {
display: block !important;
}
tr.hidden-sm {
display: table-row !important;
}
th.hidden-sm,
td.hidden-sm {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-sm.hidden-xs,
tr.hidden-sm.hidden-xs,
th.hidden-sm.hidden-xs,
td.hidden-sm.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm,
tr.hidden-sm,
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-sm.hidden-md,
tr.hidden-sm.hidden-md,
th.hidden-sm.hidden-md,
td.hidden-sm.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-sm.hidden-lg,
tr.hidden-sm.hidden-lg,
th.hidden-sm.hidden-lg,
td.hidden-sm.hidden-lg {
display: none !important;
}
}
.hidden-md {
display: block !important;
}
tr.hidden-md {
display: table-row !important;
}
th.hidden-md,
td.hidden-md {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-md.hidden-xs,
tr.hidden-md.hidden-xs,
th.hidden-md.hidden-xs,
td.hidden-md.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-md.hidden-sm,
tr.hidden-md.hidden-sm,
th.hidden-md.hidden-sm,
td.hidden-md.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md,
tr.hidden-md,
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-md.hidden-lg,
tr.hidden-md.hidden-lg,
th.hidden-md.hidden-lg,
td.hidden-md.hidden-lg {
display: none !important;
}
}
.hidden-lg {
display: block !important;
}
tr.hidden-lg {
display: table-row !important;
}
th.hidden-lg,
td.hidden-lg {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-lg.hidden-xs,
tr.hidden-lg.hidden-xs,
th.hidden-lg.hidden-xs,
td.hidden-lg.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-lg.hidden-sm,
tr.hidden-lg.hidden-sm,
th.hidden-lg.hidden-sm,
td.hidden-lg.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-lg.hidden-md,
tr.hidden-lg.hidden-md,
th.hidden-lg.hidden-md,
td.hidden-lg.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg,
tr.hidden-lg,
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
.hidden-print,
tr.hidden-print,
th.hidden-print,
td.hidden-print {
display: none !important;
}
}
================================================
FILE: static/assets/plugins/summernote/dist/summernote.css
================================================
.note-editor{position:relative;overflow:hidden;border:1px solid #a9a9a9}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:white;opacity:.95;pointer-event:none}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor.codeview .note-editing-area .note-editable{display:none}.note-editor.codeview .note-editing-area .note-codable{display:block}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen .note-editable{background-color:white}.note-editor.fullscreen .note-resizebar{display:none}.note-editor .note-editing-area{position:relative;overflow:hidden}.note-editor .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;background-color:#fff;outline:0}.note-editor .note-editing-area .note-editable[contenteditable=true]:empty:not(:focus):before{content:attr(data-placeholder)}.note-editor .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;padding-top:1px;cursor:ns-resize}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-air-editor{outline:0}.note-popover .popover{max-width:none}.note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover .popover .arrow{left:20px}.note-popover .popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover .popover-content .note-style h1,.panel-heading.note-toolbar .note-style h1,.note-popover .popover .popover-content .note-style h2,.panel-heading.note-toolbar .note-style h2,.note-popover .popover .popover-content .note-style h3,.panel-heading.note-toolbar .note-style h3,.note-popover .popover .popover-content .note-style h4,.panel-heading.note-toolbar .note-style h4,.note-popover .popover .popover-content .note-style h5,.panel-heading.note-toolbar .note-style h5,.note-popover .popover .popover-content .note-style h6,.panel-heading.note-toolbar .note-style h6,.note-popover .popover .popover-content .note-style blockquote,.panel-heading.note-toolbar .note-style blockquote{margin:0}.note-popover .popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover .popover-content .note-color .dropdown-menu,.panel-heading.note-toolbar .note-color .dropdown-menu{min-width:340px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-row{height:20px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-popover .popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}.note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:transparent;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.note-dialog .note-help-dialog .modal-content{background:transparent;border:1px solid white;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.note-dialog .note-help-dialog a{font-size:12px;color:white}.note-dialog .note-help-dialog .title{padding-bottom:5px;margin-bottom:10px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-dialog .note-help-dialog .text-center{margin:10px 0 0}.note-dialog .note-help-dialog .note-shortcut{padding-top:8px;padding-bottom:8px}.note-dialog .note-help-dialog .note-shortcut-row{margin-right:-5px;margin-left:-5px}.note-dialog .note-help-dialog .note-shortcut-col{padding-right:5px;padding-left:5px}.note-dialog .note-help-dialog .note-shortcut-title{font-size:13px;font-weight:bold;color:#dd0}.note-dialog .note-help-dialog .note-shortcut-key{font-family:"Courier New";color:#dd0;text-align:right}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}
================================================
FILE: static/assets/plugins/summernote/dist/summernote.js
================================================
/**
* Super simple wysiwyg editor on Bootstrap v0.6.16
* http://summernote.org/
*
* summernote.js
* Copyright 2013-2015 Alan Hong. and other contributors
* summernote may be freely distributed under the MIT license./
*
* Date: 2015-08-03T16:41Z
*/
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals: jQuery
factory(window.jQuery);
}
}(function ($) {
if (!Array.prototype.reduce) {
/**
* Array.prototype.reduce polyfill
*
* @param {Function} callback
* @param {Value} [initialValue]
* @return {Value}
*
* @see http://goo.gl/WNriQD
*/
Array.prototype.reduce = function (callback) {
var t = Object(this), len = t.length >>> 0, k = 0, value;
if (arguments.length === 2) {
value = arguments[1];
} else {
while (k < len && !(k in t)) {
k++;
}
if (k >= len) {
throw new TypeError('Reduce of empty array with no initial value');
}
value = t[k++];
}
for (; k < len; k++) {
if (k in t) {
value = callback(value, t[k], k, t);
}
}
return value;
};
}
if ('function' !== typeof Array.prototype.filter) {
/**
* Array.prototype.filter polyfill
*
* @param {Function} func
* @return {Array}
*
* @see http://goo.gl/T1KFnq
*/
Array.prototype.filter = function (func) {
var t = Object(this), len = t.length >>> 0;
var res = [];
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i];
if (func.call(thisArg, val, i, t)) {
res.push(val);
}
}
}
return res;
};
}
if (!Array.prototype.map) {
/**
* Array.prototype.map polyfill
*
* @param {Function} callback
* @return {Array}
*
* @see https://goo.gl/SMWaMK
*/
Array.prototype.map = function (callback, thisArg) {
var T, A, k;
if (this === null) {
throw new TypeError(' this is null or not defined');
}
var O = Object(this);
var len = O.length >>> 0;
if (typeof callback !== 'function') {
throw new TypeError(callback + ' is not a function');
}
if (arguments.length > 1) {
T = thisArg;
}
A = new Array(len);
k = 0;
while (k < len) {
var kValue, mappedValue;
if (k in O) {
kValue = O[k];
mappedValue = callback.call(T, kValue, k, O);
A[k] = mappedValue;
}
k++;
}
return A;
};
}
var isSupportAmd = typeof define === 'function' && define.amd;
/**
* returns whether font is installed or not.
*
* @param {String} fontName
* @return {Boolean}
*/
var isFontInstalled = function (fontName) {
var testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';
var $tester = $('').css({
position: 'absolute',
left: '-9999px',
top: '-9999px',
fontSize: '200px'
}).text('mmmmmmmmmwwwwwww').appendTo(document.body);
var originalWidth = $tester.css('fontFamily', testFontName).width();
var width = $tester.css('fontFamily', fontName + ',' + testFontName).width();
$tester.remove();
return originalWidth !== width;
};
var userAgent = navigator.userAgent;
var isMSIE = /MSIE|Trident/i.test(userAgent);
var browserVersion;
if (isMSIE) {
var matches = /MSIE (\d+[.]\d+)/.exec(userAgent);
if (matches) {
browserVersion = parseFloat(matches[1]);
}
matches = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
if (matches) {
browserVersion = parseFloat(matches[1]);
}
}
/**
* @class core.agent
*
* Object which check platform and agent
*
* @singleton
* @alternateClassName agent
*/
var agent = {
/** @property {Boolean} [isMac=false] true if this agent is Mac */
isMac: navigator.appVersion.indexOf('Mac') > -1,
/** @property {Boolean} [isMSIE=false] true if this agent is a Internet Explorer */
isMSIE: isMSIE,
/** @property {Boolean} [isFF=false] true if this agent is a Firefox */
isFF: /firefox/i.test(userAgent),
isWebkit: /webkit/i.test(userAgent),
/** @property {Boolean} [isSafari=false] true if this agent is a Safari */
isSafari: /safari/i.test(userAgent),
/** @property {Float} browserVersion current browser version */
browserVersion: browserVersion,
/** @property {String} jqueryVersion current jQuery version string */
jqueryVersion: parseFloat($.fn.jquery),
isSupportAmd: isSupportAmd,
hasCodeMirror: isSupportAmd ? require.specified('CodeMirror') : !!window.CodeMirror,
isFontInstalled: isFontInstalled,
isW3CRangeSupport: !!document.createRange
};
/**
* @class core.func
*
* func utils (for high-order func's arg)
*
* @singleton
* @alternateClassName func
*/
var func = (function () {
var eq = function (itemA) {
return function (itemB) {
return itemA === itemB;
};
};
var eq2 = function (itemA, itemB) {
return itemA === itemB;
};
var peq2 = function (propName) {
return function (itemA, itemB) {
return itemA[propName] === itemB[propName];
};
};
var ok = function () {
return true;
};
var fail = function () {
return false;
};
var not = function (f) {
return function () {
return !f.apply(f, arguments);
};
};
var and = function (fA, fB) {
return function (item) {
return fA(item) && fB(item);
};
};
var self = function (a) {
return a;
};
var idCounter = 0;
/**
* generate a globally-unique id
*
* @param {String} [prefix]
*/
var uniqueId = function (prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
/**
* returns bnd (bounds) from rect
*
* - IE Compatability Issue: http://goo.gl/sRLOAo
* - Scroll Issue: http://goo.gl/sNjUc
*
* @param {Rect} rect
* @return {Object} bounds
* @return {Number} bounds.top
* @return {Number} bounds.left
* @return {Number} bounds.width
* @return {Number} bounds.height
*/
var rect2bnd = function (rect) {
var $document = $(document);
return {
top: rect.top + $document.scrollTop(),
left: rect.left + $document.scrollLeft(),
width: rect.right - rect.left,
height: rect.bottom - rect.top
};
};
/**
* returns a copy of the object where the keys have become the values and the values the keys.
* @param {Object} obj
* @return {Object}
*/
var invertObject = function (obj) {
var inverted = {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
inverted[obj[key]] = key;
}
}
return inverted;
};
/**
* @param {String} namespace
* @param {String} [prefix]
* @return {String}
*/
var namespaceToCamel = function (namespace, prefix) {
prefix = prefix || '';
return prefix + namespace.split('.').map(function (name) {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}).join('');
};
return {
eq: eq,
eq2: eq2,
peq2: peq2,
ok: ok,
fail: fail,
self: self,
not: not,
and: and,
uniqueId: uniqueId,
rect2bnd: rect2bnd,
invertObject: invertObject,
namespaceToCamel: namespaceToCamel
};
})();
/**
* @class core.list
*
* list utils
*
* @singleton
* @alternateClassName list
*/
var list = (function () {
/**
* returns the first item of an array.
*
* @param {Array} array
*/
var head = function (array) {
return array[0];
};
/**
* returns the last item of an array.
*
* @param {Array} array
*/
var last = function (array) {
return array[array.length - 1];
};
/**
* returns everything but the last entry of the array.
*
* @param {Array} array
*/
var initial = function (array) {
return array.slice(0, array.length - 1);
};
/**
* returns the rest of the items in an array.
*
* @param {Array} array
*/
var tail = function (array) {
return array.slice(1);
};
/**
* returns item of array
*/
var find = function (array, pred) {
for (var idx = 0, len = array.length; idx < len; idx ++) {
var item = array[idx];
if (pred(item)) {
return item;
}
}
};
/**
* returns true if all of the values in the array pass the predicate truth test.
*/
var all = function (array, pred) {
for (var idx = 0, len = array.length; idx < len; idx ++) {
if (!pred(array[idx])) {
return false;
}
}
return true;
};
/**
* returns index of item
*/
var indexOf = function (array, item) {
return $.inArray(item, array);
};
/**
* returns true if the value is present in the list.
*/
var contains = function (array, item) {
return indexOf(array, item) !== -1;
};
/**
* get sum from a list
*
* @param {Array} array - array
* @param {Function} fn - iterator
*/
var sum = function (array, fn) {
fn = fn || func.self;
return array.reduce(function (memo, v) {
return memo + fn(v);
}, 0);
};
/**
* returns a copy of the collection with array type.
* @param {Collection} collection - collection eg) node.childNodes, ...
*/
var from = function (collection) {
var result = [], idx = -1, length = collection.length;
while (++idx < length) {
result[idx] = collection[idx];
}
return result;
};
/**
* cluster elements by predicate function.
*
* @param {Array} array - array
* @param {Function} fn - predicate function for cluster rule
* @param {Array[]}
*/
var clusterBy = function (array, fn) {
if (!array.length) { return []; }
var aTail = tail(array);
return aTail.reduce(function (memo, v) {
var aLast = last(memo);
if (fn(last(aLast), v)) {
aLast[aLast.length] = v;
} else {
memo[memo.length] = [v];
}
return memo;
}, [[head(array)]]);
};
/**
* returns a copy of the array with all falsy values removed
*
* @param {Array} array - array
* @param {Function} fn - predicate function for cluster rule
*/
var compact = function (array) {
var aResult = [];
for (var idx = 0, len = array.length; idx < len; idx ++) {
if (array[idx]) { aResult.push(array[idx]); }
}
return aResult;
};
/**
* produces a duplicate-free version of the array
*
* @param {Array} array
*/
var unique = function (array) {
var results = [];
for (var idx = 0, len = array.length; idx < len; idx ++) {
if (!contains(results, array[idx])) {
results.push(array[idx]);
}
}
return results;
};
/**
* returns next item.
* @param {Array} array
*/
var next = function (array, item) {
var idx = indexOf(array, item);
if (idx === -1) { return null; }
return array[idx + 1];
};
/**
* returns prev item.
* @param {Array} array
*/
var prev = function (array, item) {
var idx = indexOf(array, item);
if (idx === -1) { return null; }
return array[idx - 1];
};
return { head: head, last: last, initial: initial, tail: tail,
prev: prev, next: next, find: find, contains: contains,
all: all, sum: sum, from: from,
clusterBy: clusterBy, compact: compact, unique: unique };
})();
var NBSP_CHAR = String.fromCharCode(160);
var ZERO_WIDTH_NBSP_CHAR = '\ufeff';
/**
* @class core.dom
*
* Dom functions
*
* @singleton
* @alternateClassName dom
*/
var dom = (function () {
/**
* @method isEditable
*
* returns whether node is `note-editable` or not.
*
* @param {Node} node
* @return {Boolean}
*/
var isEditable = function (node) {
return node && $(node).hasClass('note-editable');
};
/**
* @method isControlSizing
*
* returns whether node is `note-control-sizing` or not.
*
* @param {Node} node
* @return {Boolean}
*/
var isControlSizing = function (node) {
return node && $(node).hasClass('note-control-sizing');
};
/**
* @method buildLayoutInfo
*
* build layoutInfo from $editor(.note-editor)
*
* @param {jQuery} $editor
* @return {Object}
* @return {Function} return.editor
* @return {Node} return.dropzone
* @return {Node} return.toolbar
* @return {Node} return.editable
* @return {Node} return.codable
* @return {Node} return.popover
* @return {Node} return.handle
* @return {Node} return.dialog
*/
var buildLayoutInfo = function ($editor) {
var makeFinder;
// air mode
if ($editor.hasClass('note-air-editor')) {
var id = list.last($editor.attr('id').split('-'));
makeFinder = function (sIdPrefix) {
return function () { return $(sIdPrefix + id); };
};
return {
editor: function () { return $editor; },
holder : function () { return $editor.data('holder'); },
editable: function () { return $editor; },
popover: makeFinder('#note-popover-'),
handle: makeFinder('#note-handle-'),
dialog: makeFinder('#note-dialog-')
};
// frame mode
} else {
makeFinder = function (className, $base) {
$base = $base || $editor;
return function () { return $base.find(className); };
};
var options = $editor.data('options');
var $dialogHolder = (options && options.dialogsInBody) ? $(document.body) : null;
return {
editor: function () { return $editor; },
holder : function () { return $editor.data('holder'); },
dropzone: makeFinder('.note-dropzone'),
toolbar: makeFinder('.note-toolbar'),
editable: makeFinder('.note-editable'),
codable: makeFinder('.note-codable'),
statusbar: makeFinder('.note-statusbar'),
popover: makeFinder('.note-popover'),
handle: makeFinder('.note-handle'),
dialog: makeFinder('.note-dialog', $dialogHolder)
};
}
};
/**
* returns makeLayoutInfo from editor's descendant node.
*
* @private
* @param {Node} descendant
* @return {Object}
*/
var makeLayoutInfo = function (descendant) {
var $target = $(descendant).closest('.note-editor, .note-air-editor, .note-air-layout');
if (!$target.length) {
return null;
}
var $editor;
if ($target.is('.note-editor, .note-air-editor')) {
$editor = $target;
} else {
$editor = $('#note-editor-' + list.last($target.attr('id').split('-')));
}
return buildLayoutInfo($editor);
};
/**
* @method makePredByNodeName
*
* returns predicate which judge whether nodeName is same
*
* @param {String} nodeName
* @return {Function}
*/
var makePredByNodeName = function (nodeName) {
nodeName = nodeName.toUpperCase();
return function (node) {
return node && node.nodeName.toUpperCase() === nodeName;
};
};
/**
* @method isText
*
*
*
* @param {Node} node
* @return {Boolean} true if node's type is text(3)
*/
var isText = function (node) {
return node && node.nodeType === 3;
};
/**
* ex) br, col, embed, hr, img, input, ...
* @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
*/
var isVoid = function (node) {
return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON/.test(node.nodeName.toUpperCase());
};
var isPara = function (node) {
if (isEditable(node)) {
return false;
}
// Chrome(v31.0), FF(v25.0.1) use DIV for paragraph
return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());
};
var isLi = makePredByNodeName('LI');
var isPurePara = function (node) {
return isPara(node) && !isLi(node);
};
var isTable = makePredByNodeName('TABLE');
var isInline = function (node) {
return !isBodyContainer(node) &&
!isList(node) &&
!isHr(node) &&
!isPara(node) &&
!isTable(node) &&
!isBlockquote(node);
};
var isList = function (node) {
return node && /^UL|^OL/.test(node.nodeName.toUpperCase());
};
var isHr = makePredByNodeName('HR');
var isCell = function (node) {
return node && /^TD|^TH/.test(node.nodeName.toUpperCase());
};
var isBlockquote = makePredByNodeName('BLOCKQUOTE');
var isBodyContainer = function (node) {
return isCell(node) || isBlockquote(node) || isEditable(node);
};
var isAnchor = makePredByNodeName('A');
var isParaInline = function (node) {
return isInline(node) && !!ancestor(node, isPara);
};
var isBodyInline = function (node) {
return isInline(node) && !ancestor(node, isPara);
};
var isBody = makePredByNodeName('BODY');
/**
* returns whether nodeB is closest sibling of nodeA
*
* @param {Node} nodeA
* @param {Node} nodeB
* @return {Boolean}
*/
var isClosestSibling = function (nodeA, nodeB) {
return nodeA.nextSibling === nodeB ||
nodeA.previousSibling === nodeB;
};
/**
* returns array of closest siblings with node
*
* @param {Node} node
* @param {function} [pred] - predicate function
* @return {Node[]}
*/
var withClosestSiblings = function (node, pred) {
pred = pred || func.ok;
var siblings = [];
if (node.previousSibling && pred(node.previousSibling)) {
siblings.push(node.previousSibling);
}
siblings.push(node);
if (node.nextSibling && pred(node.nextSibling)) {
siblings.push(node.nextSibling);
}
return siblings;
};
/**
* blank HTML for cursor position
* - [workaround] old IE only works with
* - [workaround] IE11 and other browser works with bogus br
*/
var blankHTML = agent.isMSIE && agent.browserVersion < 11 ? ' ' : '
';
/**
* @method nodeLength
*
* returns #text's text size or element's childNodes size
*
* @param {Node} node
*/
var nodeLength = function (node) {
if (isText(node)) {
return node.nodeValue.length;
}
return node.childNodes.length;
};
/**
* returns whether node is empty or not.
*
* @param {Node} node
* @return {Boolean}
*/
var isEmpty = function (node) {
var len = nodeLength(node);
if (len === 0) {
return true;
} else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {
// ex)
,
return true;
} else if (list.all(node.childNodes, isText) && node.innerHTML === '') {
// ex)
,
return true;
}
return false;
};
/**
* padding blankHTML if node is empty (for cursor position)
*/
var paddingBlankHTML = function (node) {
if (!isVoid(node) && !nodeLength(node)) {
node.innerHTML = blankHTML;
}
};
/**
* find nearest ancestor predicate hit
*
* @param {Node} node
* @param {Function} pred - predicate function
*/
var ancestor = function (node, pred) {
while (node) {
if (pred(node)) { return node; }
if (isEditable(node)) { break; }
node = node.parentNode;
}
return null;
};
/**
* find nearest ancestor only single child blood line and predicate hit
*
* @param {Node} node
* @param {Function} pred - predicate function
*/
var singleChildAncestor = function (node, pred) {
node = node.parentNode;
while (node) {
if (nodeLength(node) !== 1) { break; }
if (pred(node)) { return node; }
if (isEditable(node)) { break; }
node = node.parentNode;
}
return null;
};
/**
* returns new array of ancestor nodes (until predicate hit).
*
* @param {Node} node
* @param {Function} [optional] pred - predicate function
*/
var listAncestor = function (node, pred) {
pred = pred || func.fail;
var ancestors = [];
ancestor(node, function (el) {
if (!isEditable(el)) {
ancestors.push(el);
}
return pred(el);
});
return ancestors;
};
/**
* find farthest ancestor predicate hit
*/
var lastAncestor = function (node, pred) {
var ancestors = listAncestor(node);
return list.last(ancestors.filter(pred));
};
/**
* returns common ancestor node between two nodes.
*
* @param {Node} nodeA
* @param {Node} nodeB
*/
var commonAncestor = function (nodeA, nodeB) {
var ancestors = listAncestor(nodeA);
for (var n = nodeB; n; n = n.parentNode) {
if ($.inArray(n, ancestors) > -1) { return n; }
}
return null; // difference document area
};
/**
* listing all previous siblings (until predicate hit).
*
* @param {Node} node
* @param {Function} [optional] pred - predicate function
*/
var listPrev = function (node, pred) {
pred = pred || func.fail;
var nodes = [];
while (node) {
if (pred(node)) { break; }
nodes.push(node);
node = node.previousSibling;
}
return nodes;
};
/**
* listing next siblings (until predicate hit).
*
* @param {Node} node
* @param {Function} [pred] - predicate function
*/
var listNext = function (node, pred) {
pred = pred || func.fail;
var nodes = [];
while (node) {
if (pred(node)) { break; }
nodes.push(node);
node = node.nextSibling;
}
return nodes;
};
/**
* listing descendant nodes
*
* @param {Node} node
* @param {Function} [pred] - predicate function
*/
var listDescendant = function (node, pred) {
var descendents = [];
pred = pred || func.ok;
// start DFS(depth first search) with node
(function fnWalk(current) {
if (node !== current && pred(current)) {
descendents.push(current);
}
for (var idx = 0, len = current.childNodes.length; idx < len; idx++) {
fnWalk(current.childNodes[idx]);
}
})(node);
return descendents;
};
/**
* wrap node with new tag.
*
* @param {Node} node
* @param {Node} tagName of wrapper
* @return {Node} - wrapper
*/
var wrap = function (node, wrapperName) {
var parent = node.parentNode;
var wrapper = $('<' + wrapperName + '>')[0];
parent.insertBefore(wrapper, node);
wrapper.appendChild(node);
return wrapper;
};
/**
* insert node after preceding
*
* @param {Node} node
* @param {Node} preceding - predicate function
*/
var insertAfter = function (node, preceding) {
var next = preceding.nextSibling, parent = preceding.parentNode;
if (next) {
parent.insertBefore(node, next);
} else {
parent.appendChild(node);
}
return node;
};
/**
* append elements.
*
* @param {Node} node
* @param {Collection} aChild
*/
var appendChildNodes = function (node, aChild) {
$.each(aChild, function (idx, child) {
node.appendChild(child);
});
return node;
};
/**
* returns whether boundaryPoint is left edge or not.
*
* @param {BoundaryPoint} point
* @return {Boolean}
*/
var isLeftEdgePoint = function (point) {
return point.offset === 0;
};
/**
* returns whether boundaryPoint is right edge or not.
*
* @param {BoundaryPoint} point
* @return {Boolean}
*/
var isRightEdgePoint = function (point) {
return point.offset === nodeLength(point.node);
};
/**
* returns whether boundaryPoint is edge or not.
*
* @param {BoundaryPoint} point
* @return {Boolean}
*/
var isEdgePoint = function (point) {
return isLeftEdgePoint(point) || isRightEdgePoint(point);
};
/**
* returns wheter node is left edge of ancestor or not.
*
* @param {Node} node
* @param {Node} ancestor
* @return {Boolean}
*/
var isLeftEdgeOf = function (node, ancestor) {
while (node && node !== ancestor) {
if (position(node) !== 0) {
return false;
}
node = node.parentNode;
}
return true;
};
/**
* returns whether node is right edge of ancestor or not.
*
* @param {Node} node
* @param {Node} ancestor
* @return {Boolean}
*/
var isRightEdgeOf = function (node, ancestor) {
while (node && node !== ancestor) {
if (position(node) !== nodeLength(node.parentNode) - 1) {
return false;
}
node = node.parentNode;
}
return true;
};
/**
* returns whether point is left edge of ancestor or not.
* @param {BoundaryPoint} point
* @param {Node} ancestor
* @return {Boolean}
*/
var isLeftEdgePointOf = function (point, ancestor) {
return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);
};
/**
* returns whether point is right edge of ancestor or not.
* @param {BoundaryPoint} point
* @param {Node} ancestor
* @return {Boolean}
*/
var isRightEdgePointOf = function (point, ancestor) {
return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);
};
/**
* returns offset from parent.
*
* @param {Node} node
*/
var position = function (node) {
var offset = 0;
while ((node = node.previousSibling)) {
offset += 1;
}
return offset;
};
var hasChildren = function (node) {
return !!(node && node.childNodes && node.childNodes.length);
};
/**
* returns previous boundaryPoint
*
* @param {BoundaryPoint} point
* @param {Boolean} isSkipInnerOffset
* @return {BoundaryPoint}
*/
var prevPoint = function (point, isSkipInnerOffset) {
var node, offset;
if (point.offset === 0) {
if (isEditable(point.node)) {
return null;
}
node = point.node.parentNode;
offset = position(point.node);
} else if (hasChildren(point.node)) {
node = point.node.childNodes[point.offset - 1];
offset = nodeLength(node);
} else {
node = point.node;
offset = isSkipInnerOffset ? 0 : point.offset - 1;
}
return {
node: node,
offset: offset
};
};
/**
* returns next boundaryPoint
*
* @param {BoundaryPoint} point
* @param {Boolean} isSkipInnerOffset
* @return {BoundaryPoint}
*/
var nextPoint = function (point, isSkipInnerOffset) {
var node, offset;
if (nodeLength(point.node) === point.offset) {
if (isEditable(point.node)) {
return null;
}
node = point.node.parentNode;
offset = position(point.node) + 1;
} else if (hasChildren(point.node)) {
node = point.node.childNodes[point.offset];
offset = 0;
} else {
node = point.node;
offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;
}
return {
node: node,
offset: offset
};
};
/**
* returns whether pointA and pointB is same or not.
*
* @param {BoundaryPoint} pointA
* @param {BoundaryPoint} pointB
* @return {Boolean}
*/
var isSamePoint = function (pointA, pointB) {
return pointA.node === pointB.node && pointA.offset === pointB.offset;
};
/**
* returns whether point is visible (can set cursor) or not.
*
* @param {BoundaryPoint} point
* @return {Boolean}
*/
var isVisiblePoint = function (point) {
if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {
return true;
}
var leftNode = point.node.childNodes[point.offset - 1];
var rightNode = point.node.childNodes[point.offset];
if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {
return true;
}
return false;
};
/**
* @method prevPointUtil
*
* @param {BoundaryPoint} point
* @param {Function} pred
* @return {BoundaryPoint}
*/
var prevPointUntil = function (point, pred) {
while (point) {
if (pred(point)) {
return point;
}
point = prevPoint(point);
}
return null;
};
/**
* @method nextPointUntil
*
* @param {BoundaryPoint} point
* @param {Function} pred
* @return {BoundaryPoint}
*/
var nextPointUntil = function (point, pred) {
while (point) {
if (pred(point)) {
return point;
}
point = nextPoint(point);
}
return null;
};
/**
* returns whether point has character or not.
*
* @param {Point} point
* @return {Boolean}
*/
var isCharPoint = function (point) {
if (!isText(point.node)) {
return false;
}
var ch = point.node.nodeValue.charAt(point.offset - 1);
return ch && (ch !== ' ' && ch !== NBSP_CHAR);
};
/**
* @method walkPoint
*
* @param {BoundaryPoint} startPoint
* @param {BoundaryPoint} endPoint
* @param {Function} handler
* @param {Boolean} isSkipInnerOffset
*/
var walkPoint = function (startPoint, endPoint, handler, isSkipInnerOffset) {
var point = startPoint;
while (point) {
handler(point);
if (isSamePoint(point, endPoint)) {
break;
}
var isSkipOffset = isSkipInnerOffset &&
startPoint.node !== point.node &&
endPoint.node !== point.node;
point = nextPoint(point, isSkipOffset);
}
};
/**
* @method makeOffsetPath
*
* return offsetPath(array of offset) from ancestor
*
* @param {Node} ancestor - ancestor node
* @param {Node} node
*/
var makeOffsetPath = function (ancestor, node) {
var ancestors = listAncestor(node, func.eq(ancestor));
return ancestors.map(position).reverse();
};
/**
* @method fromOffsetPath
*
* return element from offsetPath(array of offset)
*
* @param {Node} ancestor - ancestor node
* @param {array} offsets - offsetPath
*/
var fromOffsetPath = function (ancestor, offsets) {
var current = ancestor;
for (var i = 0, len = offsets.length; i < len; i++) {
if (current.childNodes.length <= offsets[i]) {
current = current.childNodes[current.childNodes.length - 1];
} else {
current = current.childNodes[offsets[i]];
}
}
return current;
};
/**
* @method splitNode
*
* split element or #text
*
* @param {BoundaryPoint} point
* @param {Object} [options]
* @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false
* @param {Boolean} [options.isNotSplitEdgePoint] - default: false
* @return {Node} right node of boundaryPoint
*/
var splitNode = function (point, options) {
var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;
var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;
// edge case
if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {
if (isLeftEdgePoint(point)) {
return point.node;
} else if (isRightEdgePoint(point)) {
return point.node.nextSibling;
}
}
// split #text
if (isText(point.node)) {
return point.node.splitText(point.offset);
} else {
var childNode = point.node.childNodes[point.offset];
var clone = insertAfter(point.node.cloneNode(false), point.node);
appendChildNodes(clone, listNext(childNode));
if (!isSkipPaddingBlankHTML) {
paddingBlankHTML(point.node);
paddingBlankHTML(clone);
}
return clone;
}
};
/**
* @method splitTree
*
* split tree by point
*
* @param {Node} root - split root
* @param {BoundaryPoint} point
* @param {Object} [options]
* @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false
* @param {Boolean} [options.isNotSplitEdgePoint] - default: false
* @return {Node} right node of boundaryPoint
*/
var splitTree = function (root, point, options) {
// ex) [#text,
, ]
var ancestors = listAncestor(point.node, func.eq(root));
if (!ancestors.length) {
return null;
} else if (ancestors.length === 1) {
return splitNode(point, options);
}
return ancestors.reduce(function (node, parent) {
if (node === point.node) {
node = splitNode(point, options);
}
return splitNode({
node: parent,
offset: node ? dom.position(node) : nodeLength(parent)
}, options);
});
};
/**
* split point
*
* @param {Point} point
* @param {Boolean} isInline
* @return {Object}
*/
var splitPoint = function (point, isInline) {
// find splitRoot, container
// - inline: splitRoot is a child of paragraph
// - block: splitRoot is a child of bodyContainer
var pred = isInline ? isPara : isBodyContainer;
var ancestors = listAncestor(point.node, pred);
var topAncestor = list.last(ancestors) || point.node;
var splitRoot, container;
if (pred(topAncestor)) {
splitRoot = ancestors[ancestors.length - 2];
container = topAncestor;
} else {
splitRoot = topAncestor;
container = splitRoot.parentNode;
}
// if splitRoot is exists, split with splitTree
var pivot = splitRoot && splitTree(splitRoot, point, {
isSkipPaddingBlankHTML: isInline,
isNotSplitEdgePoint: isInline
});
// if container is point.node, find pivot with point.offset
if (!pivot && container === point.node) {
pivot = point.node.childNodes[point.offset];
}
return {
rightNode: pivot,
container: container
};
};
var create = function (nodeName) {
return document.createElement(nodeName);
};
var createText = function (text) {
return document.createTextNode(text);
};
/**
* @method remove
*
* remove node, (isRemoveChild: remove child or not)
*
* @param {Node} node
* @param {Boolean} isRemoveChild
*/
var remove = function (node, isRemoveChild) {
if (!node || !node.parentNode) { return; }
if (node.removeNode) { return node.removeNode(isRemoveChild); }
var parent = node.parentNode;
if (!isRemoveChild) {
var nodes = [];
var i, len;
for (i = 0, len = node.childNodes.length; i < len; i++) {
nodes.push(node.childNodes[i]);
}
for (i = 0, len = nodes.length; i < len; i++) {
parent.insertBefore(nodes[i], node);
}
}
parent.removeChild(node);
};
/**
* @method removeWhile
*
* @param {Node} node
* @param {Function} pred
*/
var removeWhile = function (node, pred) {
while (node) {
if (isEditable(node) || !pred(node)) {
break;
}
var parent = node.parentNode;
remove(node);
node = parent;
}
};
/**
* @method replace
*
* replace node with provided nodeName
*
* @param {Node} node
* @param {String} nodeName
* @return {Node} - new node
*/
var replace = function (node, nodeName) {
if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {
return node;
}
var newNode = create(nodeName);
if (node.style.cssText) {
newNode.style.cssText = node.style.cssText;
}
appendChildNodes(newNode, list.from(node.childNodes));
insertAfter(newNode, node);
remove(node);
return newNode;
};
var isTextarea = makePredByNodeName('TEXTAREA');
/**
* @param {jQuery} $node
* @param {Boolean} [stripLinebreaks] - default: false
*/
var value = function ($node, stripLinebreaks) {
var val = isTextarea($node[0]) ? $node.val() : $node.html();
if (stripLinebreaks) {
return val.replace(/[\n\r]/g, '');
}
return val;
};
/**
* @method html
*
* get the HTML contents of node
*
* @param {jQuery} $node
* @param {Boolean} [isNewlineOnBlock]
*/
var html = function ($node, isNewlineOnBlock) {
var markup = value($node);
if (isNewlineOnBlock) {
var regexTag = /<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;
markup = markup.replace(regexTag, function (match, endSlash, name) {
name = name.toUpperCase();
var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&
!!endSlash;
var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);
return match + ((isEndOfInlineContainer || isBlockNode) ? '\n' : '');
});
markup = $.trim(markup);
}
return markup;
};
return {
/** @property {String} NBSP_CHAR */
NBSP_CHAR: NBSP_CHAR,
/** @property {String} ZERO_WIDTH_NBSP_CHAR */
ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR,
/** @property {String} blank */
blank: blankHTML,
/** @property {String} emptyPara */
emptyPara: '
' + blankHTML + '
',
makePredByNodeName: makePredByNodeName,
isEditable: isEditable,
isControlSizing: isControlSizing,
buildLayoutInfo: buildLayoutInfo,
makeLayoutInfo: makeLayoutInfo,
isText: isText,
isVoid: isVoid,
isPara: isPara,
isPurePara: isPurePara,
isInline: isInline,
isBlock: func.not(isInline),
isBodyInline: isBodyInline,
isBody: isBody,
isParaInline: isParaInline,
isList: isList,
isTable: isTable,
isCell: isCell,
isBlockquote: isBlockquote,
isBodyContainer: isBodyContainer,
isAnchor: isAnchor,
isDiv: makePredByNodeName('DIV'),
isLi: isLi,
isBR: makePredByNodeName('BR'),
isSpan: makePredByNodeName('SPAN'),
isB: makePredByNodeName('B'),
isU: makePredByNodeName('U'),
isS: makePredByNodeName('S'),
isI: makePredByNodeName('I'),
isImg: makePredByNodeName('IMG'),
isTextarea: isTextarea,
isEmpty: isEmpty,
isEmptyAnchor: func.and(isAnchor, isEmpty),
isClosestSibling: isClosestSibling,
withClosestSiblings: withClosestSiblings,
nodeLength: nodeLength,
isLeftEdgePoint: isLeftEdgePoint,
isRightEdgePoint: isRightEdgePoint,
isEdgePoint: isEdgePoint,
isLeftEdgeOf: isLeftEdgeOf,
isRightEdgeOf: isRightEdgeOf,
isLeftEdgePointOf: isLeftEdgePointOf,
isRightEdgePointOf: isRightEdgePointOf,
prevPoint: prevPoint,
nextPoint: nextPoint,
isSamePoint: isSamePoint,
isVisiblePoint: isVisiblePoint,
prevPointUntil: prevPointUntil,
nextPointUntil: nextPointUntil,
isCharPoint: isCharPoint,
walkPoint: walkPoint,
ancestor: ancestor,
singleChildAncestor: singleChildAncestor,
listAncestor: listAncestor,
lastAncestor: lastAncestor,
listNext: listNext,
listPrev: listPrev,
listDescendant: listDescendant,
commonAncestor: commonAncestor,
wrap: wrap,
insertAfter: insertAfter,
appendChildNodes: appendChildNodes,
position: position,
hasChildren: hasChildren,
makeOffsetPath: makeOffsetPath,
fromOffsetPath: fromOffsetPath,
splitTree: splitTree,
splitPoint: splitPoint,
create: create,
createText: createText,
remove: remove,
removeWhile: removeWhile,
replace: replace,
html: html,
value: value
};
})();
var range = (function () {
/**
* return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js
*
* @param {TextRange} textRange
* @param {Boolean} isStart
* @return {BoundaryPoint}
*
* @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx
*/
var textRangeToPoint = function (textRange, isStart) {
var container = textRange.parentElement(), offset;
var tester = document.body.createTextRange(), prevContainer;
var childNodes = list.from(container.childNodes);
for (offset = 0; offset < childNodes.length; offset++) {
if (dom.isText(childNodes[offset])) {
continue;
}
tester.moveToElementText(childNodes[offset]);
if (tester.compareEndPoints('StartToStart', textRange) >= 0) {
break;
}
prevContainer = childNodes[offset];
}
if (offset !== 0 && dom.isText(childNodes[offset - 1])) {
var textRangeStart = document.body.createTextRange(), curTextNode = null;
textRangeStart.moveToElementText(prevContainer || container);
textRangeStart.collapse(!prevContainer);
curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;
var pointTester = textRange.duplicate();
pointTester.setEndPoint('StartToStart', textRangeStart);
var textCount = pointTester.text.replace(/[\r\n]/g, '').length;
while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {
textCount -= curTextNode.nodeValue.length;
curTextNode = curTextNode.nextSibling;
}
/* jshint ignore:start */
var dummy = curTextNode.nodeValue; // enforce IE to re-reference curTextNode, hack
/* jshint ignore:end */
if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&
textCount === curTextNode.nodeValue.length) {
textCount -= curTextNode.nodeValue.length;
curTextNode = curTextNode.nextSibling;
}
container = curTextNode;
offset = textCount;
}
return {
cont: container,
offset: offset
};
};
/**
* return TextRange from boundary point (inspired by google closure-library)
* @param {BoundaryPoint} point
* @return {TextRange}
*/
var pointToTextRange = function (point) {
var textRangeInfo = function (container, offset) {
var node, isCollapseToStart;
if (dom.isText(container)) {
var prevTextNodes = dom.listPrev(container, func.not(dom.isText));
var prevContainer = list.last(prevTextNodes).previousSibling;
node = prevContainer || container.parentNode;
offset += list.sum(list.tail(prevTextNodes), dom.nodeLength);
isCollapseToStart = !prevContainer;
} else {
node = container.childNodes[offset] || container;
if (dom.isText(node)) {
return textRangeInfo(node, 0);
}
offset = 0;
isCollapseToStart = false;
}
return {
node: node,
collapseToStart: isCollapseToStart,
offset: offset
};
};
var textRange = document.body.createTextRange();
var info = textRangeInfo(point.node, point.offset);
textRange.moveToElementText(info.node);
textRange.collapse(info.collapseToStart);
textRange.moveStart('character', info.offset);
return textRange;
};
/**
* Wrapped Range
*
* @constructor
* @param {Node} sc - start container
* @param {Number} so - start offset
* @param {Node} ec - end container
* @param {Number} eo - end offset
*/
var WrappedRange = function (sc, so, ec, eo) {
this.sc = sc;
this.so = so;
this.ec = ec;
this.eo = eo;
// nativeRange: get nativeRange from sc, so, ec, eo
var nativeRange = function () {
if (agent.isW3CRangeSupport) {
var w3cRange = document.createRange();
w3cRange.setStart(sc, so);
w3cRange.setEnd(ec, eo);
return w3cRange;
} else {
var textRange = pointToTextRange({
node: sc,
offset: so
});
textRange.setEndPoint('EndToEnd', pointToTextRange({
node: ec,
offset: eo
}));
return textRange;
}
};
this.getPoints = function () {
return {
sc: sc,
so: so,
ec: ec,
eo: eo
};
};
this.getStartPoint = function () {
return {
node: sc,
offset: so
};
};
this.getEndPoint = function () {
return {
node: ec,
offset: eo
};
};
/**
* select update visible range
*/
this.select = function () {
var nativeRng = nativeRange();
if (agent.isW3CRangeSupport) {
var selection = document.getSelection();
if (selection.rangeCount > 0) {
selection.removeAllRanges();
}
selection.addRange(nativeRng);
} else {
nativeRng.select();
}
return this;
};
/**
* @return {WrappedRange}
*/
this.normalize = function () {
/**
* @param {BoundaryPoint} point
* @param {Boolean} isLeftToRight
* @return {BoundaryPoint}
*/
var getVisiblePoint = function (point, isLeftToRight) {
if ((dom.isVisiblePoint(point) && !dom.isEdgePoint(point)) ||
(dom.isVisiblePoint(point) && dom.isRightEdgePoint(point) && !isLeftToRight) ||
(dom.isVisiblePoint(point) && dom.isLeftEdgePoint(point) && isLeftToRight) ||
(dom.isVisiblePoint(point) && dom.isBlock(point.node) && dom.isEmpty(point.node))) {
return point;
}
// point on block's edge
var block = dom.ancestor(point.node, dom.isBlock);
if (((dom.isLeftEdgePointOf(point, block) || dom.isVoid(dom.prevPoint(point).node)) && !isLeftToRight) ||
((dom.isRightEdgePointOf(point, block) || dom.isVoid(dom.nextPoint(point).node)) && isLeftToRight)) {
// returns point already on visible point
if (dom.isVisiblePoint(point)) {
return point;
}
// reverse direction
isLeftToRight = !isLeftToRight;
}
var nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint) :
dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);
return nextPoint || point;
};
var endPoint = getVisiblePoint(this.getEndPoint(), false);
var startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);
return new WrappedRange(
startPoint.node,
startPoint.offset,
endPoint.node,
endPoint.offset
);
};
/**
* returns matched nodes on range
*
* @param {Function} [pred] - predicate function
* @param {Object} [options]
* @param {Boolean} [options.includeAncestor]
* @param {Boolean} [options.fullyContains]
* @return {Node[]}
*/
this.nodes = function (pred, options) {
pred = pred || func.ok;
var includeAncestor = options && options.includeAncestor;
var fullyContains = options && options.fullyContains;
// TODO compare points and sort
var startPoint = this.getStartPoint();
var endPoint = this.getEndPoint();
var nodes = [];
var leftEdgeNodes = [];
dom.walkPoint(startPoint, endPoint, function (point) {
if (dom.isEditable(point.node)) {
return;
}
var node;
if (fullyContains) {
if (dom.isLeftEdgePoint(point)) {
leftEdgeNodes.push(point.node);
}
if (dom.isRightEdgePoint(point) && list.contains(leftEdgeNodes, point.node)) {
node = point.node;
}
} else if (includeAncestor) {
node = dom.ancestor(point.node, pred);
} else {
node = point.node;
}
if (node && pred(node)) {
nodes.push(node);
}
}, true);
return list.unique(nodes);
};
/**
* returns commonAncestor of range
* @return {Element} - commonAncestor
*/
this.commonAncestor = function () {
return dom.commonAncestor(sc, ec);
};
/**
* returns expanded range by pred
*
* @param {Function} pred - predicate function
* @return {WrappedRange}
*/
this.expand = function (pred) {
var startAncestor = dom.ancestor(sc, pred);
var endAncestor = dom.ancestor(ec, pred);
if (!startAncestor && !endAncestor) {
return new WrappedRange(sc, so, ec, eo);
}
var boundaryPoints = this.getPoints();
if (startAncestor) {
boundaryPoints.sc = startAncestor;
boundaryPoints.so = 0;
}
if (endAncestor) {
boundaryPoints.ec = endAncestor;
boundaryPoints.eo = dom.nodeLength(endAncestor);
}
return new WrappedRange(
boundaryPoints.sc,
boundaryPoints.so,
boundaryPoints.ec,
boundaryPoints.eo
);
};
/**
* @param {Boolean} isCollapseToStart
* @return {WrappedRange}
*/
this.collapse = function (isCollapseToStart) {
if (isCollapseToStart) {
return new WrappedRange(sc, so, sc, so);
} else {
return new WrappedRange(ec, eo, ec, eo);
}
};
/**
* splitText on range
*/
this.splitText = function () {
var isSameContainer = sc === ec;
var boundaryPoints = this.getPoints();
if (dom.isText(ec) && !dom.isEdgePoint(this.getEndPoint())) {
ec.splitText(eo);
}
if (dom.isText(sc) && !dom.isEdgePoint(this.getStartPoint())) {
boundaryPoints.sc = sc.splitText(so);
boundaryPoints.so = 0;
if (isSameContainer) {
boundaryPoints.ec = boundaryPoints.sc;
boundaryPoints.eo = eo - so;
}
}
return new WrappedRange(
boundaryPoints.sc,
boundaryPoints.so,
boundaryPoints.ec,
boundaryPoints.eo
);
};
/**
* delete contents on range
* @return {WrappedRange}
*/
this.deleteContents = function () {
if (this.isCollapsed()) {
return this;
}
var rng = this.splitText();
var nodes = rng.nodes(null, {
fullyContains: true
});
// find new cursor point
var point = dom.prevPointUntil(rng.getStartPoint(), function (point) {
return !list.contains(nodes, point.node);
});
var emptyParents = [];
$.each(nodes, function (idx, node) {
// find empty parents
var parent = node.parentNode;
if (point.node !== parent && dom.nodeLength(parent) === 1) {
emptyParents.push(parent);
}
dom.remove(node, false);
});
// remove empty parents
$.each(emptyParents, function (idx, node) {
dom.remove(node, false);
});
return new WrappedRange(
point.node,
point.offset,
point.node,
point.offset
).normalize();
};
/**
* makeIsOn: return isOn(pred) function
*/
var makeIsOn = function (pred) {
return function () {
var ancestor = dom.ancestor(sc, pred);
return !!ancestor && (ancestor === dom.ancestor(ec, pred));
};
};
// isOnEditable: judge whether range is on editable or not
this.isOnEditable = makeIsOn(dom.isEditable);
// isOnList: judge whether range is on list node or not
this.isOnList = makeIsOn(dom.isList);
// isOnAnchor: judge whether range is on anchor node or not
this.isOnAnchor = makeIsOn(dom.isAnchor);
// isOnAnchor: judge whether range is on cell node or not
this.isOnCell = makeIsOn(dom.isCell);
/**
* @param {Function} pred
* @return {Boolean}
*/
this.isLeftEdgeOf = function (pred) {
if (!dom.isLeftEdgePoint(this.getStartPoint())) {
return false;
}
var node = dom.ancestor(this.sc, pred);
return node && dom.isLeftEdgeOf(this.sc, node);
};
/**
* returns whether range was collapsed or not
*/
this.isCollapsed = function () {
return sc === ec && so === eo;
};
/**
* wrap inline nodes which children of body with paragraph
*
* @return {WrappedRange}
*/
this.wrapBodyInlineWithPara = function () {
if (dom.isBodyContainer(sc) && dom.isEmpty(sc)) {
sc.innerHTML = dom.emptyPara;
return new WrappedRange(sc.firstChild, 0, sc.firstChild, 0);
}
/**
* [workaround] firefox often create range on not visible point. so normalize here.
* - firefox: |text
|
* - chrome: |text|
*/
var rng = this.normalize();
if (dom.isParaInline(sc) || dom.isPara(sc)) {
return rng;
}
// find inline top ancestor
var topAncestor;
if (dom.isInline(rng.sc)) {
var ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));
topAncestor = list.last(ancestors);
if (!dom.isInline(topAncestor)) {
topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];
}
} else {
topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];
}
// siblings not in paragraph
var inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();
inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));
// wrap with paragraph
if (inlineSiblings.length) {
var para = dom.wrap(list.head(inlineSiblings), 'p');
dom.appendChildNodes(para, list.tail(inlineSiblings));
}
return this.normalize();
};
/**
* insert node at current cursor
*
* @param {Node} node
* @return {Node}
*/
this.insertNode = function (node) {
var rng = this.wrapBodyInlineWithPara().deleteContents();
var info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));
if (info.rightNode) {
info.rightNode.parentNode.insertBefore(node, info.rightNode);
} else {
info.container.appendChild(node);
}
return node;
};
/**
* insert html at current cursor
*/
this.pasteHTML = function (markup) {
var contentsContainer = $('
').html(markup)[0];
var childNodes = list.from(contentsContainer.childNodes);
var rng = this.wrapBodyInlineWithPara().deleteContents();
return childNodes.reverse().map(function (childNode) {
return rng.insertNode(childNode);
}).reverse();
};
/**
* returns text in range
*
* @return {String}
*/
this.toString = function () {
var nativeRng = nativeRange();
return agent.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;
};
/**
* returns range for word before cursor
*
* @param {Boolean} [findAfter] - find after cursor, default: false
* @return {WrappedRange}
*/
this.getWordRange = function (findAfter) {
var endPoint = this.getEndPoint();
if (!dom.isCharPoint(endPoint)) {
return this;
}
var startPoint = dom.prevPointUntil(endPoint, function (point) {
return !dom.isCharPoint(point);
});
if (findAfter) {
endPoint = dom.nextPointUntil(endPoint, function (point) {
return !dom.isCharPoint(point);
});
}
return new WrappedRange(
startPoint.node,
startPoint.offset,
endPoint.node,
endPoint.offset
);
};
/**
* create offsetPath bookmark
*
* @param {Node} editable
*/
this.bookmark = function (editable) {
return {
s: {
path: dom.makeOffsetPath(editable, sc),
offset: so
},
e: {
path: dom.makeOffsetPath(editable, ec),
offset: eo
}
};
};
/**
* create offsetPath bookmark base on paragraph
*
* @param {Node[]} paras
*/
this.paraBookmark = function (paras) {
return {
s: {
path: list.tail(dom.makeOffsetPath(list.head(paras), sc)),
offset: so
},
e: {
path: list.tail(dom.makeOffsetPath(list.last(paras), ec)),
offset: eo
}
};
};
/**
* getClientRects
* @return {Rect[]}
*/
this.getClientRects = function () {
var nativeRng = nativeRange();
return nativeRng.getClientRects();
};
};
/**
* @class core.range
*
* Data structure
* * BoundaryPoint: a point of dom tree
* * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range
*
* See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position
*
* @singleton
* @alternateClassName range
*/
return {
/**
* @method
*
* create Range Object From arguments or Browser Selection
*
* @param {Node} sc - start container
* @param {Number} so - start offset
* @param {Node} ec - end container
* @param {Number} eo - end offset
* @return {WrappedRange}
*/
create : function (sc, so, ec, eo) {
if (!arguments.length) { // from Browser Selection
if (agent.isW3CRangeSupport) {
var selection = document.getSelection();
if (!selection || selection.rangeCount === 0) {
return null;
} else if (dom.isBody(selection.anchorNode)) {
// Firefox: returns entire body as range on initialization. We won't never need it.
return null;
}
var nativeRng = selection.getRangeAt(0);
sc = nativeRng.startContainer;
so = nativeRng.startOffset;
ec = nativeRng.endContainer;
eo = nativeRng.endOffset;
} else { // IE8: TextRange
var textRange = document.selection.createRange();
var textRangeEnd = textRange.duplicate();
textRangeEnd.collapse(false);
var textRangeStart = textRange;
textRangeStart.collapse(true);
var startPoint = textRangeToPoint(textRangeStart, true),
endPoint = textRangeToPoint(textRangeEnd, false);
// same visible point case: range was collapsed.
if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&
dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&
endPoint.node.nextSibling === startPoint.node) {
startPoint = endPoint;
}
sc = startPoint.cont;
so = startPoint.offset;
ec = endPoint.cont;
eo = endPoint.offset;
}
} else if (arguments.length === 2) { //collapsed
ec = sc;
eo = so;
}
return new WrappedRange(sc, so, ec, eo);
},
/**
* @method
*
* create WrappedRange from node
*
* @param {Node} node
* @return {WrappedRange}
*/
createFromNode: function (node) {
var sc = node;
var so = 0;
var ec = node;
var eo = dom.nodeLength(ec);
// browsers can't target a picture or void node
if (dom.isVoid(sc)) {
so = dom.listPrev(sc).length - 1;
sc = sc.parentNode;
}
if (dom.isBR(ec)) {
eo = dom.listPrev(ec).length - 1;
ec = ec.parentNode;
} else if (dom.isVoid(ec)) {
eo = dom.listPrev(ec).length;
ec = ec.parentNode;
}
return this.create(sc, so, ec, eo);
},
/**
* create WrappedRange from node after position
*
* @param {Node} node
* @return {WrappedRange}
*/
createFromNodeBefore: function (node) {
return this.createFromNode(node).collapse(true);
},
/**
* create WrappedRange from node after position
*
* @param {Node} node
* @return {WrappedRange}
*/
createFromNodeAfter: function (node) {
return this.createFromNode(node).collapse();
},
/**
* @method
*
* create WrappedRange from bookmark
*
* @param {Node} editable
* @param {Object} bookmark
* @return {WrappedRange}
*/
createFromBookmark : function (editable, bookmark) {
var sc = dom.fromOffsetPath(editable, bookmark.s.path);
var so = bookmark.s.offset;
var ec = dom.fromOffsetPath(editable, bookmark.e.path);
var eo = bookmark.e.offset;
return new WrappedRange(sc, so, ec, eo);
},
/**
* @method
*
* create WrappedRange from paraBookmark
*
* @param {Object} bookmark
* @param {Node[]} paras
* @return {WrappedRange}
*/
createFromParaBookmark: function (bookmark, paras) {
var so = bookmark.s.offset;
var eo = bookmark.e.offset;
var sc = dom.fromOffsetPath(list.head(paras), bookmark.s.path);
var ec = dom.fromOffsetPath(list.last(paras), bookmark.e.path);
return new WrappedRange(sc, so, ec, eo);
}
};
})();
/**
* @class defaults
*
* @singleton
*/
var defaults = {
/** @property */
version: '0.6.16',
/**
*
* for event options, reference to EventHandler.attach
*
* @property {Object} options
* @property {String/Number} [options.width=null] set editor width
* @property {String/Number} [options.height=null] set editor height, ex) 300
* @property {String/Number} options.minHeight set minimum height of editor
* @property {String/Number} options.maxHeight
* @property {String/Number} options.focus
* @property {Number} options.tabsize
* @property {Boolean} options.styleWithSpan
* @property {Object} options.codemirror
* @property {Object} [options.codemirror.mode='text/html']
* @property {Object} [options.codemirror.htmlMode=true]
* @property {Object} [options.codemirror.lineNumbers=true]
* @property {String} [options.lang=en-US] language 'en-US', 'ko-KR', ...
* @property {String} [options.direction=null] text direction, ex) 'rtl'
* @property {Array} [options.toolbar]
* @property {Boolean} [options.airMode=false]
* @property {Array} [options.airPopover]
* @property {Fucntion} [options.onInit] initialize
* @property {Fucntion} [options.onsubmit]
*/
options: {
width: null, // set editor width
height: null, // set editor height, ex) 300
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height of editor
focus: false, // set focus to editable area after initializing summernote
tabsize: 4, // size of tab ex) 2 or 4
styleWithSpan: true, // style with span (Chrome and FF only)
disableLinkTarget: false, // hide link Target Checkbox
disableDragAndDrop: false, // disable drag and drop event
disableResizeEditor: false, // disable resizing editor
disableResizeImage: false, // disable resizing image
shortcuts: true, // enable keyboard shortcuts
textareaAutoSync: true, // enable textarea auto sync
placeholder: false, // enable placeholder text
prettifyHtml: true, // enable prettifying html while toggling codeview
iconPrefix: 'fa fa-', // prefix for css icon classes
icons: {
font: {
bold: 'bold',
italic: 'italic',
underline: 'underline',
clear: 'eraser',
height: 'text-height',
strikethrough: 'strikethrough',
superscript: 'superscript',
subscript: 'subscript'
},
image: {
image: 'picture-o',
floatLeft: 'align-left',
floatRight: 'align-right',
floatNone: 'align-justify',
shapeRounded: 'square',
shapeCircle: 'circle-o',
shapeThumbnail: 'picture-o',
shapeNone: 'times',
remove: 'trash-o'
},
link: {
link: 'link',
unlink: 'unlink',
edit: 'edit'
},
table: {
table: 'table'
},
hr: {
insert: 'minus'
},
style: {
style: 'magic'
},
lists: {
unordered: 'list-ul',
ordered: 'list-ol'
},
options: {
help: 'question',
fullscreen: 'arrows-alt',
codeview: 'code'
},
paragraph: {
paragraph: 'align-left',
outdent: 'outdent',
indent: 'indent',
left: 'align-left',
center: 'align-center',
right: 'align-right',
justify: 'align-justify'
},
color: {
recent: 'font'
},
history: {
undo: 'undo',
redo: 'repeat'
},
misc: {
check: 'check'
}
},
dialogsInBody: false, // false will add dialogs into editor
codemirror: { // codemirror options
mode: 'text/html',
htmlMode: true,
lineNumbers: true
},
// language
lang: 'en-US', // language 'en-US', 'ko-KR', ...
direction: null, // text direction, ex) 'rtl'
// toolbar
toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']],
// ['font', ['bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'clear']],
['fontname', ['fontname']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['table', ['table']],
['insert', ['link', 'picture', 'hr']],
['view', ['fullscreen', 'codeview']],
['help', ['help']]
],
plugin : { },
// air mode: inline editor
airMode: false,
// airPopover: [
// ['style', ['style']],
// ['font', ['bold', 'italic', 'underline', 'clear']],
// ['fontname', ['fontname']],
// ['color', ['color']],
// ['para', ['ul', 'ol', 'paragraph']],
// ['height', ['height']],
// ['table', ['table']],
// ['insert', ['link', 'picture']],
// ['help', ['help']]
// ],
airPopover: [
['color', ['color']],
['font', ['bold', 'underline', 'clear']],
['para', ['ul', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture']]
],
// style tag
styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
// default fontName
defaultFontName: 'Helvetica Neue',
// fontName
fontNames: [
'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',
'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',
'Tahoma', 'Times New Roman', 'Verdana'
],
fontNamesIgnoreCheck: [],
fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],
// pallete colors(n x n)
colors: [
['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],
['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],
['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],
['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],
['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],
['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],
['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],
['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031']
],
// lineHeight
lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],
// insertTable max size
insertTableMaxSize: {
col: 10,
row: 10
},
// image
maximumImageFileSize: null, // size in bytes, null = no limit
// callbacks
oninit: null, // initialize
onfocus: null, // editable has focus
onblur: null, // editable out of focus
onenter: null, // enter key pressed
onkeyup: null, // keyup
onkeydown: null, // keydown
onImageUpload: null, // imageUpload
onImageUploadError: null, // imageUploadError
onMediaDelete: null, // media delete
onToolbarClick: null,
onsubmit: null,
/**
* manipulate link address when user create link
* @param {String} sLinkUrl
* @return {String}
*/
onCreateLink: function (sLinkUrl) {
if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) {
sLinkUrl = 'mailto:' + sLinkUrl;
}
return sLinkUrl;
},
keyMap: {
pc: {
'ENTER': 'insertParagraph',
'CTRL+Z': 'undo',
'CTRL+Y': 'redo',
'TAB': 'tab',
'SHIFT+TAB': 'untab',
'CTRL+B': 'bold',
'CTRL+I': 'italic',
'CTRL+U': 'underline',
'CTRL+SHIFT+S': 'strikethrough',
'CTRL+BACKSLASH': 'removeFormat',
'CTRL+SHIFT+L': 'justifyLeft',
'CTRL+SHIFT+E': 'justifyCenter',
'CTRL+SHIFT+R': 'justifyRight',
'CTRL+SHIFT+J': 'justifyFull',
'CTRL+SHIFT+NUM7': 'insertUnorderedList',
'CTRL+SHIFT+NUM8': 'insertOrderedList',
'CTRL+LEFTBRACKET': 'outdent',
'CTRL+RIGHTBRACKET': 'indent',
'CTRL+NUM0': 'formatPara',
'CTRL+NUM1': 'formatH1',
'CTRL+NUM2': 'formatH2',
'CTRL+NUM3': 'formatH3',
'CTRL+NUM4': 'formatH4',
'CTRL+NUM5': 'formatH5',
'CTRL+NUM6': 'formatH6',
'CTRL+ENTER': 'insertHorizontalRule',
'CTRL+K': 'showLinkDialog'
},
mac: {
'ENTER': 'insertParagraph',
'CMD+Z': 'undo',
'CMD+SHIFT+Z': 'redo',
'TAB': 'tab',
'SHIFT+TAB': 'untab',
'CMD+B': 'bold',
'CMD+I': 'italic',
'CMD+U': 'underline',
'CMD+SHIFT+S': 'strikethrough',
'CMD+BACKSLASH': 'removeFormat',
'CMD+SHIFT+L': 'justifyLeft',
'CMD+SHIFT+E': 'justifyCenter',
'CMD+SHIFT+R': 'justifyRight',
'CMD+SHIFT+J': 'justifyFull',
'CMD+SHIFT+NUM7': 'insertUnorderedList',
'CMD+SHIFT+NUM8': 'insertOrderedList',
'CMD+LEFTBRACKET': 'outdent',
'CMD+RIGHTBRACKET': 'indent',
'CMD+NUM0': 'formatPara',
'CMD+NUM1': 'formatH1',
'CMD+NUM2': 'formatH2',
'CMD+NUM3': 'formatH3',
'CMD+NUM4': 'formatH4',
'CMD+NUM5': 'formatH5',
'CMD+NUM6': 'formatH6',
'CMD+ENTER': 'insertHorizontalRule',
'CMD+K': 'showLinkDialog'
}
}
},
// default language: en-US
lang: {
'en-US': {
font: {
bold: 'Bold',
italic: 'Italic',
underline: 'Underline',
clear: 'Remove Font Style',
height: 'Line Height',
name: 'Font Family',
strikethrough: 'Strikethrough',
subscript: 'Subscript',
superscript: 'Superscript',
size: 'Font Size'
},
image: {
image: 'Picture',
insert: 'Insert Image',
resizeFull: 'Resize Full',
resizeHalf: 'Resize Half',
resizeQuarter: 'Resize Quarter',
floatLeft: 'Float Left',
floatRight: 'Float Right',
floatNone: 'Float None',
shapeRounded: 'Shape: Rounded',
shapeCircle: 'Shape: Circle',
shapeThumbnail: 'Shape: Thumbnail',
shapeNone: 'Shape: None',
dragImageHere: 'Drag image or text here',
dropImage: 'Drop image or Text',
selectFromFiles: 'Select from files',
maximumFileSize: 'Maximum file size',
maximumFileSizeError: 'Maximum file size exceeded.',
url: 'Image URL',
remove: 'Remove Image'
},
link: {
link: 'Link',
insert: 'Insert Link',
unlink: 'Unlink',
edit: 'Edit',
textToDisplay: 'Text to display',
url: 'To what URL should this link go?',
openInNewWindow: 'Open in new window'
},
table: {
table: 'Table'
},
hr: {
insert: 'Insert Horizontal Rule'
},
style: {
style: 'Style',
normal: 'Normal',
blockquote: 'Quote',
pre: 'Code',
h1: 'Header 1',
h2: 'Header 2',
h3: 'Header 3',
h4: 'Header 4',
h5: 'Header 5',
h6: 'Header 6'
},
lists: {
unordered: 'Unordered list',
ordered: 'Ordered list'
},
options: {
help: 'Help',
fullscreen: 'Full Screen',
codeview: 'Code View'
},
paragraph: {
paragraph: 'Paragraph',
outdent: 'Outdent',
indent: 'Indent',
left: 'Align left',
center: 'Align center',
right: 'Align right',
justify: 'Justify full'
},
color: {
recent: 'Recent Color',
more: 'More Color',
background: 'Background Color',
foreground: 'Foreground Color',
transparent: 'Transparent',
setTransparent: 'Set transparent',
reset: 'Reset',
resetToDefault: 'Reset to default'
},
shortcut: {
shortcuts: 'Keyboard shortcuts',
close: 'Close',
textFormatting: 'Text formatting',
action: 'Action',
paragraphFormatting: 'Paragraph formatting',
documentStyle: 'Document Style',
extraKeys: 'Extra keys'
},
history: {
undo: 'Undo',
redo: 'Redo'
}
}
}
};
/**
* @class core.async
*
* Async functions which returns `Promise`
*
* @singleton
* @alternateClassName async
*/
var async = (function () {
/**
* @method readFileAsDataURL
*
* read contents of file as representing URL
*
* @param {File} file
* @return {Promise} - then: sDataUrl
*/
var readFileAsDataURL = function (file) {
return $.Deferred(function (deferred) {
$.extend(new FileReader(), {
onload: function (e) {
var sDataURL = e.target.result;
deferred.resolve(sDataURL);
},
onerror: function () {
deferred.reject(this);
}
}).readAsDataURL(file);
}).promise();
};
/**
* @method createImage
*
* create `` from url string
*
* @param {String} sUrl
* @param {String} filename
* @return {Promise} - then: $image
*/
var createImage = function (sUrl, filename) {
return $.Deferred(function (deferred) {
var $img = $(' ');
$img.one('load', function () {
$img.off('error abort');
deferred.resolve($img);
}).one('error abort', function () {
$img.off('load').detach();
deferred.reject($img);
}).css({
display: 'none'
}).appendTo(document.body).attr({
'src': sUrl,
'data-filename': filename
});
}).promise();
};
return {
readFileAsDataURL: readFileAsDataURL,
createImage: createImage
};
})();
/**
* @class core.key
*
* Object for keycodes.
*
* @singleton
* @alternateClassName key
*/
var key = (function () {
var keyMap = {
'BACKSPACE': 8,
'TAB': 9,
'ENTER': 13,
'SPACE': 32,
// Number: 0-9
'NUM0': 48,
'NUM1': 49,
'NUM2': 50,
'NUM3': 51,
'NUM4': 52,
'NUM5': 53,
'NUM6': 54,
'NUM7': 55,
'NUM8': 56,
// Alphabet: a-z
'B': 66,
'E': 69,
'I': 73,
'J': 74,
'K': 75,
'L': 76,
'R': 82,
'S': 83,
'U': 85,
'V': 86,
'Y': 89,
'Z': 90,
'SLASH': 191,
'LEFTBRACKET': 219,
'BACKSLASH': 220,
'RIGHTBRACKET': 221
};
return {
/**
* @method isEdit
*
* @param {Number} keyCode
* @return {Boolean}
*/
isEdit: function (keyCode) {
return list.contains([8, 9, 13, 32], keyCode);
},
/**
* @method isMove
*
* @param {Number} keyCode
* @return {Boolean}
*/
isMove: function (keyCode) {
return list.contains([37, 38, 39, 40], keyCode);
},
/**
* @property {Object} nameFromCode
* @property {String} nameFromCode.8 "BACKSPACE"
*/
nameFromCode: func.invertObject(keyMap),
code: keyMap
};
})();
/**
* @class editing.History
*
* Editor History
*
*/
var History = function ($editable) {
var stack = [], stackOffset = -1;
var editable = $editable[0];
var makeSnapshot = function () {
var rng = range.create();
var emptyBookmark = {s: {path: [], offset: 0}, e: {path: [], offset: 0}};
return {
contents: $editable.html(),
bookmark: (rng ? rng.bookmark(editable) : emptyBookmark)
};
};
var applySnapshot = function (snapshot) {
if (snapshot.contents !== null) {
$editable.html(snapshot.contents);
}
if (snapshot.bookmark !== null) {
range.createFromBookmark(editable, snapshot.bookmark).select();
}
};
/**
* undo
*/
this.undo = function () {
// Create snap shot if not yet recorded
if ($editable.html() !== stack[stackOffset].contents) {
this.recordUndo();
}
if (0 < stackOffset) {
stackOffset--;
applySnapshot(stack[stackOffset]);
}
};
/**
* redo
*/
this.redo = function () {
if (stack.length - 1 > stackOffset) {
stackOffset++;
applySnapshot(stack[stackOffset]);
}
};
/**
* recorded undo
*/
this.recordUndo = function () {
stackOffset++;
// Wash out stack after stackOffset
if (stack.length > stackOffset) {
stack = stack.slice(0, stackOffset);
}
// Create new snapshot and push it to the end
stack.push(makeSnapshot());
};
// Create first undo stack
this.recordUndo();
};
/**
* @class editing.Style
*
* Style
*
*/
var Style = function () {
/**
* @method jQueryCSS
*
* [workaround] for old jQuery
* passing an array of style properties to .css()
* will result in an object of property-value pairs.
* (compability with version < 1.9)
*
* @private
* @param {jQuery} $obj
* @param {Array} propertyNames - An array of one or more CSS properties.
* @return {Object}
*/
var jQueryCSS = function ($obj, propertyNames) {
if (agent.jqueryVersion < 1.9) {
var result = {};
$.each(propertyNames, function (idx, propertyName) {
result[propertyName] = $obj.css(propertyName);
});
return result;
}
return $obj.css.call($obj, propertyNames);
};
/**
* returns style object from node
*
* @param {jQuery} $node
* @return {Object}
*/
this.fromNode = function ($node) {
var properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];
var styleInfo = jQueryCSS($node, properties) || {};
styleInfo['font-size'] = parseInt(styleInfo['font-size'], 10);
return styleInfo;
};
/**
* paragraph level style
*
* @param {WrappedRange} rng
* @param {Object} styleInfo
*/
this.stylePara = function (rng, styleInfo) {
$.each(rng.nodes(dom.isPara, {
includeAncestor: true
}), function (idx, para) {
$(para).css(styleInfo);
});
};
/**
* insert and returns styleNodes on range.
*
* @param {WrappedRange} rng
* @param {Object} [options] - options for styleNodes
* @param {String} [options.nodeName] - default: `SPAN`
* @param {Boolean} [options.expandClosestSibling] - default: `false`
* @param {Boolean} [options.onlyPartialContains] - default: `false`
* @return {Node[]}
*/
this.styleNodes = function (rng, options) {
rng = rng.splitText();
var nodeName = options && options.nodeName || 'SPAN';
var expandClosestSibling = !!(options && options.expandClosestSibling);
var onlyPartialContains = !!(options && options.onlyPartialContains);
if (rng.isCollapsed()) {
return [rng.insertNode(dom.create(nodeName))];
}
var pred = dom.makePredByNodeName(nodeName);
var nodes = rng.nodes(dom.isText, {
fullyContains: true
}).map(function (text) {
return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);
});
if (expandClosestSibling) {
if (onlyPartialContains) {
var nodesInRange = rng.nodes();
// compose with partial contains predication
pred = func.and(pred, function (node) {
return list.contains(nodesInRange, node);
});
}
return nodes.map(function (node) {
var siblings = dom.withClosestSiblings(node, pred);
var head = list.head(siblings);
var tails = list.tail(siblings);
$.each(tails, function (idx, elem) {
dom.appendChildNodes(head, elem.childNodes);
dom.remove(elem);
});
return list.head(siblings);
});
} else {
return nodes;
}
};
/**
* get current style on cursor
*
* @param {WrappedRange} rng
* @return {Object} - object contains style properties.
*/
this.current = function (rng) {
var $cont = $(dom.isText(rng.sc) ? rng.sc.parentNode : rng.sc);
var styleInfo = this.fromNode($cont);
// document.queryCommandState for toggle state
styleInfo['font-bold'] = document.queryCommandState('bold') ? 'bold' : 'normal';
styleInfo['font-italic'] = document.queryCommandState('italic') ? 'italic' : 'normal';
styleInfo['font-underline'] = document.queryCommandState('underline') ? 'underline' : 'normal';
styleInfo['font-strikethrough'] = document.queryCommandState('strikeThrough') ? 'strikethrough' : 'normal';
styleInfo['font-superscript'] = document.queryCommandState('superscript') ? 'superscript' : 'normal';
styleInfo['font-subscript'] = document.queryCommandState('subscript') ? 'subscript' : 'normal';
// list-style-type to list-style(unordered, ordered)
if (!rng.isOnList()) {
styleInfo['list-style'] = 'none';
} else {
var aOrderedType = ['circle', 'disc', 'disc-leading-zero', 'square'];
var isUnordered = $.inArray(styleInfo['list-style-type'], aOrderedType) > -1;
styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';
}
var para = dom.ancestor(rng.sc, dom.isPara);
if (para && para.style['line-height']) {
styleInfo['line-height'] = para.style.lineHeight;
} else {
var lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);
styleInfo['line-height'] = lineHeight.toFixed(1);
}
styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);
styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);
styleInfo.range = rng;
return styleInfo;
};
};
/**
* @class editing.Bullet
*
* @alternateClassName Bullet
*/
var Bullet = function () {
/**
* @method insertOrderedList
*
* toggle ordered list
*
* @type command
*/
this.insertOrderedList = function () {
this.toggleList('OL');
};
/**
* @method insertUnorderedList
*
* toggle unordered list
*
* @type command
*/
this.insertUnorderedList = function () {
this.toggleList('UL');
};
/**
* @method indent
*
* indent
*
* @type command
*/
this.indent = function () {
var self = this;
var rng = range.create().wrapBodyInlineWithPara();
var paras = rng.nodes(dom.isPara, { includeAncestor: true });
var clustereds = list.clusterBy(paras, func.peq2('parentNode'));
$.each(clustereds, function (idx, paras) {
var head = list.head(paras);
if (dom.isLi(head)) {
self.wrapList(paras, head.parentNode.nodeName);
} else {
$.each(paras, function (idx, para) {
$(para).css('marginLeft', function (idx, val) {
return (parseInt(val, 10) || 0) + 25;
});
});
}
});
rng.select();
};
/**
* @method outdent
*
* outdent
*
* @type command
*/
this.outdent = function () {
var self = this;
var rng = range.create().wrapBodyInlineWithPara();
var paras = rng.nodes(dom.isPara, { includeAncestor: true });
var clustereds = list.clusterBy(paras, func.peq2('parentNode'));
$.each(clustereds, function (idx, paras) {
var head = list.head(paras);
if (dom.isLi(head)) {
self.releaseList([paras]);
} else {
$.each(paras, function (idx, para) {
$(para).css('marginLeft', function (idx, val) {
val = (parseInt(val, 10) || 0);
return val > 25 ? val - 25 : '';
});
});
}
});
rng.select();
};
/**
* @method toggleList
*
* toggle list
*
* @param {String} listName - OL or UL
*/
this.toggleList = function (listName) {
var self = this;
var rng = range.create().wrapBodyInlineWithPara();
var paras = rng.nodes(dom.isPara, { includeAncestor: true });
var bookmark = rng.paraBookmark(paras);
var clustereds = list.clusterBy(paras, func.peq2('parentNode'));
// paragraph to list
if (list.find(paras, dom.isPurePara)) {
var wrappedParas = [];
$.each(clustereds, function (idx, paras) {
wrappedParas = wrappedParas.concat(self.wrapList(paras, listName));
});
paras = wrappedParas;
// list to paragraph or change list style
} else {
var diffLists = rng.nodes(dom.isList, {
includeAncestor: true
}).filter(function (listNode) {
return !$.nodeName(listNode, listName);
});
if (diffLists.length) {
$.each(diffLists, function (idx, listNode) {
dom.replace(listNode, listName);
});
} else {
paras = this.releaseList(clustereds, true);
}
}
range.createFromParaBookmark(bookmark, paras).select();
};
/**
* @method wrapList
*
* @param {Node[]} paras
* @param {String} listName
* @return {Node[]}
*/
this.wrapList = function (paras, listName) {
var head = list.head(paras);
var last = list.last(paras);
var prevList = dom.isList(head.previousSibling) && head.previousSibling;
var nextList = dom.isList(last.nextSibling) && last.nextSibling;
var listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);
// P to LI
paras = paras.map(function (para) {
return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;
});
// append to list(, )
dom.appendChildNodes(listNode, paras);
if (nextList) {
dom.appendChildNodes(listNode, list.from(nextList.childNodes));
dom.remove(nextList);
}
return paras;
};
/**
* @method releaseList
*
* @param {Array[]} clustereds
* @param {Boolean} isEscapseToBody
* @return {Node[]}
*/
this.releaseList = function (clustereds, isEscapseToBody) {
var releasedParas = [];
$.each(clustereds, function (idx, paras) {
var head = list.head(paras);
var last = list.last(paras);
var headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) :
head.parentNode;
var lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {
node: last.parentNode,
offset: dom.position(last) + 1
}, {
isSkipPaddingBlankHTML: true
}) : null;
var middleList = dom.splitTree(headList, {
node: head.parentNode,
offset: dom.position(head)
}, {
isSkipPaddingBlankHTML: true
});
paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi) :
list.from(middleList.childNodes).filter(dom.isLi);
// LI to P
if (isEscapseToBody || !dom.isList(headList.parentNode)) {
paras = paras.map(function (para) {
return dom.replace(para, 'P');
});
}
$.each(list.from(paras).reverse(), function (idx, para) {
dom.insertAfter(para, headList);
});
// remove empty lists
var rootLists = list.compact([headList, middleList, lastList]);
$.each(rootLists, function (idx, rootList) {
var listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));
$.each(listNodes.reverse(), function (idx, listNode) {
if (!dom.nodeLength(listNode)) {
dom.remove(listNode, true);
}
});
});
releasedParas = releasedParas.concat(paras);
});
return releasedParas;
};
};
/**
* @class editing.Typing
*
* Typing
*
*/
var Typing = function () {
// a Bullet instance to toggle lists off
var bullet = new Bullet();
/**
* insert tab
*
* @param {jQuery} $editable
* @param {WrappedRange} rng
* @param {Number} tabsize
*/
this.insertTab = function ($editable, rng, tabsize) {
var tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));
rng = rng.deleteContents();
rng.insertNode(tab, true);
rng = range.create(tab, tabsize);
rng.select();
};
/**
* insert paragraph
*/
this.insertParagraph = function () {
var rng = range.create();
// deleteContents on range.
rng = rng.deleteContents();
// Wrap range if it needs to be wrapped by paragraph
rng = rng.wrapBodyInlineWithPara();
// finding paragraph
var splitRoot = dom.ancestor(rng.sc, dom.isPara);
var nextPara;
// on paragraph: split paragraph
if (splitRoot) {
// if it is an empty line with li
if (dom.isEmpty(splitRoot) && dom.isLi(splitRoot)) {
// disable UL/OL and escape!
bullet.toggleList(splitRoot.parentNode.nodeName);
return;
// if new line has content (not a line break)
} else {
nextPara = dom.splitTree(splitRoot, rng.getStartPoint());
var emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);
emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));
$.each(emptyAnchors, function (idx, anchor) {
dom.remove(anchor);
});
}
// no paragraph: insert empty paragraph
} else {
var next = rng.sc.childNodes[rng.so];
nextPara = $(dom.emptyPara)[0];
if (next) {
rng.sc.insertBefore(nextPara, next);
} else {
rng.sc.appendChild(nextPara);
}
}
range.create(nextPara, 0).normalize().select();
};
};
/**
* @class editing.Table
*
* Table
*
*/
var Table = function () {
/**
* handle tab key
*
* @param {WrappedRange} rng
* @param {Boolean} isShift
*/
this.tab = function (rng, isShift) {
var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
var table = dom.ancestor(cell, dom.isTable);
var cells = dom.listDescendant(table, dom.isCell);
var nextCell = list[isShift ? 'prev' : 'next'](cells, cell);
if (nextCell) {
range.create(nextCell, 0).select();
}
};
/**
* create empty table element
*
* @param {Number} rowCount
* @param {Number} colCount
* @return {Node}
*/
this.createTable = function (colCount, rowCount) {
var tds = [], tdHTML;
for (var idxCol = 0; idxCol < colCount; idxCol++) {
tds.push('' + dom.blank + ' ');
}
tdHTML = tds.join('');
var trs = [], trHTML;
for (var idxRow = 0; idxRow < rowCount; idxRow++) {
trs.push('' + tdHTML + ' ');
}
trHTML = trs.join('');
return $('')[0];
};
};
var KEY_BOGUS = 'bogus';
/**
* @class editing.Editor
*
* Editor
*
*/
var Editor = function (handler) {
var self = this;
var style = new Style();
var table = new Table();
var typing = new Typing();
var bullet = new Bullet();
/**
* @method createRange
*
* create range
*
* @param {jQuery} $editable
* @return {WrappedRange}
*/
this.createRange = function ($editable) {
this.focus($editable);
return range.create();
};
/**
* @method saveRange
*
* save current range
*
* @param {jQuery} $editable
* @param {Boolean} [thenCollapse=false]
*/
this.saveRange = function ($editable, thenCollapse) {
this.focus($editable);
$editable.data('range', range.create());
if (thenCollapse) {
range.create().collapse().select();
}
};
/**
* @method saveRange
*
* save current node list to $editable.data('childNodes')
*
* @param {jQuery} $editable
*/
this.saveNode = function ($editable) {
// copy child node reference
var copy = [];
for (var key = 0, len = $editable[0].childNodes.length; key < len; key++) {
copy.push($editable[0].childNodes[key]);
}
$editable.data('childNodes', copy);
};
/**
* @method restoreRange
*
* restore lately range
*
* @param {jQuery} $editable
*/
this.restoreRange = function ($editable) {
var rng = $editable.data('range');
if (rng) {
rng.select();
this.focus($editable);
}
};
/**
* @method restoreNode
*
* restore lately node list
*
* @param {jQuery} $editable
*/
this.restoreNode = function ($editable) {
$editable.html('');
var child = $editable.data('childNodes');
for (var index = 0, len = child.length; index < len; index++) {
$editable[0].appendChild(child[index]);
}
};
/**
* @method currentStyle
*
* current style
*
* @param {Node} target
* @return {Object|Boolean} unfocus
*/
this.currentStyle = function (target) {
var rng = range.create();
var styleInfo = rng && rng.isOnEditable() ? style.current(rng.normalize()) : {};
if (dom.isImg(target)) {
styleInfo.image = target;
}
return styleInfo;
};
/**
* style from node
*
* @param {jQuery} $node
* @return {Object}
*/
this.styleFromNode = function ($node) {
return style.fromNode($node);
};
var triggerOnBeforeChange = function ($editable) {
var $holder = dom.makeLayoutInfo($editable).holder();
handler.bindCustomEvent(
$holder, $editable.data('callbacks'), 'before.command'
)($editable.html(), $editable);
};
var triggerOnChange = function ($editable) {
var $holder = dom.makeLayoutInfo($editable).holder();
handler.bindCustomEvent(
$holder, $editable.data('callbacks'), 'change'
)($editable.html(), $editable);
};
/**
* @method undo
* undo
* @param {jQuery} $editable
*/
this.undo = function ($editable) {
triggerOnBeforeChange($editable);
$editable.data('NoteHistory').undo();
triggerOnChange($editable);
};
/**
* @method redo
* redo
* @param {jQuery} $editable
*/
this.redo = function ($editable) {
triggerOnBeforeChange($editable);
$editable.data('NoteHistory').redo();
triggerOnChange($editable);
};
/**
* @method beforeCommand
* before command
* @param {jQuery} $editable
*/
var beforeCommand = this.beforeCommand = function ($editable) {
triggerOnBeforeChange($editable);
// keep focus on editable before command execution
self.focus($editable);
};
/**
* @method afterCommand
* after command
* @param {jQuery} $editable
* @param {Boolean} isPreventTrigger
*/
var afterCommand = this.afterCommand = function ($editable, isPreventTrigger) {
$editable.data('NoteHistory').recordUndo();
if (!isPreventTrigger) {
triggerOnChange($editable);
}
};
/**
* @method bold
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method italic
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method underline
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method strikethrough
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method formatBlock
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method superscript
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method subscript
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method justifyLeft
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method justifyCenter
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method justifyRight
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method justifyFull
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method formatBlock
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method removeFormat
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method backColor
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method foreColor
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method insertHorizontalRule
* @param {jQuery} $editable
* @param {Mixed} value
*/
/**
* @method fontName
*
* change font name
*
* @param {jQuery} $editable
* @param {Mixed} value
*/
/* jshint ignore:start */
// native commands(with execCommand), generate function for execCommand
var commands = ['bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',
'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',
'formatBlock', 'removeFormat',
'backColor', 'foreColor', 'fontName'];
for (var idx = 0, len = commands.length; idx < len; idx ++) {
this[commands[idx]] = (function (sCmd) {
return function ($editable, value) {
beforeCommand($editable);
document.execCommand(sCmd, false, value);
afterCommand($editable, true);
};
})(commands[idx]);
}
/* jshint ignore:end */
/**
* @method tab
*
* handle tab key
*
* @param {jQuery} $editable
* @param {Object} options
*/
this.tab = function ($editable, options) {
var rng = this.createRange($editable);
if (rng.isCollapsed() && rng.isOnCell()) {
table.tab(rng);
} else {
beforeCommand($editable);
typing.insertTab($editable, rng, options.tabsize);
afterCommand($editable);
}
};
/**
* @method untab
*
* handle shift+tab key
*
*/
this.untab = function ($editable) {
var rng = this.createRange($editable);
if (rng.isCollapsed() && rng.isOnCell()) {
table.tab(rng, true);
}
};
/**
* @method insertParagraph
*
* insert paragraph
*
* @param {Node} $editable
*/
this.insertParagraph = function ($editable) {
beforeCommand($editable);
typing.insertParagraph($editable);
afterCommand($editable);
};
/**
* @method insertOrderedList
*
* @param {jQuery} $editable
*/
this.insertOrderedList = function ($editable) {
beforeCommand($editable);
bullet.insertOrderedList($editable);
afterCommand($editable);
};
/**
* @param {jQuery} $editable
*/
this.insertUnorderedList = function ($editable) {
beforeCommand($editable);
bullet.insertUnorderedList($editable);
afterCommand($editable);
};
/**
* @param {jQuery} $editable
*/
this.indent = function ($editable) {
beforeCommand($editable);
bullet.indent($editable);
afterCommand($editable);
};
/**
* @param {jQuery} $editable
*/
this.outdent = function ($editable) {
beforeCommand($editable);
bullet.outdent($editable);
afterCommand($editable);
};
/**
* insert image
*
* @param {jQuery} $editable
* @param {String} sUrl
*/
this.insertImage = function ($editable, sUrl, filename) {
async.createImage(sUrl, filename).then(function ($image) {
beforeCommand($editable);
$image.css({
display: '',
width: Math.min($editable.width(), $image.width())
});
range.create().insertNode($image[0]);
range.createFromNodeAfter($image[0]).select();
afterCommand($editable);
}).fail(function () {
var $holder = dom.makeLayoutInfo($editable).holder();
handler.bindCustomEvent(
$holder, $editable.data('callbacks'), 'image.upload.error'
)();
});
};
/**
* @method insertNode
* insert node
* @param {Node} $editable
* @param {Node} node
*/
this.insertNode = function ($editable, node) {
beforeCommand($editable);
range.create().insertNode(node);
range.createFromNodeAfter(node).select();
afterCommand($editable);
};
/**
* insert text
* @param {Node} $editable
* @param {String} text
*/
this.insertText = function ($editable, text) {
beforeCommand($editable);
var textNode = range.create().insertNode(dom.createText(text));
range.create(textNode, dom.nodeLength(textNode)).select();
afterCommand($editable);
};
/**
* paste HTML
* @param {Node} $editable
* @param {String} markup
*/
this.pasteHTML = function ($editable, markup) {
beforeCommand($editable);
var contents = range.create().pasteHTML(markup);
range.createFromNodeAfter(list.last(contents)).select();
afterCommand($editable);
};
/**
* formatBlock
*
* @param {jQuery} $editable
* @param {String} tagName
*/
this.formatBlock = function ($editable, tagName) {
beforeCommand($editable);
// [workaround] for MSIE, IE need `<`
tagName = agent.isMSIE ? '<' + tagName + '>' : tagName;
document.execCommand('FormatBlock', false, tagName);
afterCommand($editable);
};
this.formatPara = function ($editable) {
beforeCommand($editable);
this.formatBlock($editable, 'P');
afterCommand($editable);
};
/* jshint ignore:start */
for (var idx = 1; idx <= 6; idx ++) {
this['formatH' + idx] = function (idx) {
return function ($editable) {
this.formatBlock($editable, 'H' + idx);
};
}(idx);
};
/* jshint ignore:end */
/**
* fontSize
*
* @param {jQuery} $editable
* @param {String} value - px
*/
this.fontSize = function ($editable, value) {
var rng = range.create();
if (rng.isCollapsed()) {
var spans = style.styleNodes(rng);
var firstSpan = list.head(spans);
$(spans).css({
'font-size': value + 'px'
});
// [workaround] added styled bogus span for style
// - also bogus character needed for cursor position
if (firstSpan && !dom.nodeLength(firstSpan)) {
firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;
range.createFromNodeAfter(firstSpan.firstChild).select();
$editable.data(KEY_BOGUS, firstSpan);
}
} else {
beforeCommand($editable);
$(style.styleNodes(rng)).css({
'font-size': value + 'px'
});
afterCommand($editable);
}
};
/**
* insert horizontal rule
* @param {jQuery} $editable
*/
this.insertHorizontalRule = function ($editable) {
beforeCommand($editable);
var rng = range.create();
var hrNode = rng.insertNode($(' ')[0]);
if (hrNode.nextSibling) {
range.create(hrNode.nextSibling, 0).normalize().select();
}
afterCommand($editable);
};
/**
* remove bogus node and character
*/
this.removeBogus = function ($editable) {
var bogusNode = $editable.data(KEY_BOGUS);
if (!bogusNode) {
return;
}
var textNode = list.find(list.from(bogusNode.childNodes), dom.isText);
var bogusCharIdx = textNode.nodeValue.indexOf(dom.ZERO_WIDTH_NBSP_CHAR);
if (bogusCharIdx !== -1) {
textNode.deleteData(bogusCharIdx, 1);
}
if (dom.isEmpty(bogusNode)) {
dom.remove(bogusNode);
}
$editable.removeData(KEY_BOGUS);
};
/**
* lineHeight
* @param {jQuery} $editable
* @param {String} value
*/
this.lineHeight = function ($editable, value) {
beforeCommand($editable);
style.stylePara(range.create(), {
lineHeight: value
});
afterCommand($editable);
};
/**
* unlink
*
* @type command
*
* @param {jQuery} $editable
*/
this.unlink = function ($editable) {
var rng = this.createRange($editable);
if (rng.isOnAnchor()) {
var anchor = dom.ancestor(rng.sc, dom.isAnchor);
rng = range.createFromNode(anchor);
rng.select();
beforeCommand($editable);
document.execCommand('unlink');
afterCommand($editable);
}
};
/**
* create link (command)
*
* @param {jQuery} $editable
* @param {Object} linkInfo
* @param {Object} options
*/
this.createLink = function ($editable, linkInfo, options) {
var linkUrl = linkInfo.url;
var linkText = linkInfo.text;
var isNewWindow = linkInfo.isNewWindow;
var rng = linkInfo.range || this.createRange($editable);
var isTextChanged = rng.toString() !== linkText;
options = options || dom.makeLayoutInfo($editable).editor().data('options');
beforeCommand($editable);
if (options.onCreateLink) {
linkUrl = options.onCreateLink(linkUrl);
}
var anchors = [];
if (isTextChanged) {
// Create a new link when text changed.
var anchor = rng.insertNode($('' + linkText + ' ')[0]);
anchors.push(anchor);
} else {
anchors = style.styleNodes(rng, {
nodeName: 'A',
expandClosestSibling: true,
onlyPartialContains: true
});
}
$.each(anchors, function (idx, anchor) {
$(anchor).attr('href', linkUrl);
if (isNewWindow) {
$(anchor).attr('target', '_blank');
} else {
$(anchor).removeAttr('target');
}
});
var startRange = range.createFromNodeBefore(list.head(anchors));
var startPoint = startRange.getStartPoint();
var endRange = range.createFromNodeAfter(list.last(anchors));
var endPoint = endRange.getEndPoint();
range.create(
startPoint.node,
startPoint.offset,
endPoint.node,
endPoint.offset
).select();
afterCommand($editable);
};
/**
* returns link info
*
* @return {Object}
* @return {WrappedRange} return.range
* @return {String} return.text
* @return {Boolean} [return.isNewWindow=true]
* @return {String} [return.url=""]
*/
this.getLinkInfo = function ($editable) {
this.focus($editable);
var rng = range.create().expand(dom.isAnchor);
// Get the first anchor on range(for edit).
var $anchor = $(list.head(rng.nodes(dom.isAnchor)));
return {
range: rng,
text: rng.toString(),
isNewWindow: $anchor.length ? $anchor.attr('target') === '_blank' : false,
url: $anchor.length ? $anchor.attr('href') : ''
};
};
/**
* setting color
*
* @param {Node} $editable
* @param {Object} sObjColor color code
* @param {String} sObjColor.foreColor foreground color
* @param {String} sObjColor.backColor background color
*/
this.color = function ($editable, sObjColor) {
var oColor = JSON.parse(sObjColor);
var foreColor = oColor.foreColor, backColor = oColor.backColor;
beforeCommand($editable);
if (foreColor) { document.execCommand('foreColor', false, foreColor); }
if (backColor) { document.execCommand('backColor', false, backColor); }
afterCommand($editable);
};
/**
* insert Table
*
* @param {Node} $editable
* @param {String} sDim dimension of table (ex : "5x5")
*/
this.insertTable = function ($editable, sDim) {
var dimension = sDim.split('x');
beforeCommand($editable);
var rng = range.create().deleteContents();
rng.insertNode(table.createTable(dimension[0], dimension[1]));
afterCommand($editable);
};
/**
* float me
*
* @param {jQuery} $editable
* @param {String} value
* @param {jQuery} $target
*/
this.floatMe = function ($editable, value, $target) {
beforeCommand($editable);
// bootstrap
$target.removeClass('pull-left pull-right');
if (value && value !== 'none') {
$target.addClass('pull-' + value);
}
// fallback for non-bootstrap
$target.css('float', value);
afterCommand($editable);
};
/**
* change image shape
*
* @param {jQuery} $editable
* @param {String} value css class
* @param {Node} $target
*/
this.imageShape = function ($editable, value, $target) {
beforeCommand($editable);
$target.removeClass('img-rounded img-circle img-thumbnail');
if (value) {
$target.addClass(value);
}
afterCommand($editable);
};
/**
* resize overlay element
* @param {jQuery} $editable
* @param {String} value
* @param {jQuery} $target - target element
*/
this.resize = function ($editable, value, $target) {
beforeCommand($editable);
$target.css({
width: value * 100 + '%',
height: ''
});
afterCommand($editable);
};
/**
* @param {Position} pos
* @param {jQuery} $target - target element
* @param {Boolean} [bKeepRatio] - keep ratio
*/
this.resizeTo = function (pos, $target, bKeepRatio) {
var imageSize;
if (bKeepRatio) {
var newRatio = pos.y / pos.x;
var ratio = $target.data('ratio');
imageSize = {
width: ratio > newRatio ? pos.x : pos.y / ratio,
height: ratio > newRatio ? pos.x * ratio : pos.y
};
} else {
imageSize = {
width: pos.x,
height: pos.y
};
}
$target.css(imageSize);
};
/**
* remove media object
*
* @param {jQuery} $editable
* @param {String} value - dummy argument (for keep interface)
* @param {jQuery} $target - target element
*/
this.removeMedia = function ($editable, value, $target) {
beforeCommand($editable);
$target.detach();
handler.bindCustomEvent(
$(), $editable.data('callbacks'), 'media.delete'
)($target, $editable);
afterCommand($editable);
};
/**
* set focus
*
* @param $editable
*/
this.focus = function ($editable) {
$editable.focus();
// [workaround] for firefox bug http://goo.gl/lVfAaI
if (agent.isFF && !range.create().isOnEditable()) {
range.createFromNode($editable[0])
.normalize()
.collapse()
.select();
}
};
/**
* returns whether contents is empty or not.
*
* @param {jQuery} $editable
* @return {Boolean}
*/
this.isEmpty = function ($editable) {
return dom.isEmpty($editable[0]) || dom.emptyPara === $editable.html();
};
};
/**
* @class module.Button
*
* Button
*/
var Button = function () {
/**
* update button status
*
* @param {jQuery} $container
* @param {Object} styleInfo
*/
this.update = function ($container, styleInfo) {
/**
* handle dropdown's check mark (for fontname, fontsize, lineHeight).
* @param {jQuery} $btn
* @param {Number} value
*/
var checkDropdownMenu = function ($btn, value) {
$btn.find('.dropdown-menu li a').each(function () {
// always compare string to avoid creating another func.
var isChecked = ($(this).data('value') + '') === (value + '');
this.className = isChecked ? 'checked' : '';
});
};
/**
* update button state(active or not).
*
* @private
* @param {String} selector
* @param {Function} pred
*/
var btnState = function (selector, pred) {
var $btn = $container.find(selector);
$btn.toggleClass('active', pred());
};
if (styleInfo.image) {
var $img = $(styleInfo.image);
btnState('button[data-event="imageShape"][data-value="img-rounded"]', function () {
return $img.hasClass('img-rounded');
});
btnState('button[data-event="imageShape"][data-value="img-circle"]', function () {
return $img.hasClass('img-circle');
});
btnState('button[data-event="imageShape"][data-value="img-thumbnail"]', function () {
return $img.hasClass('img-thumbnail');
});
btnState('button[data-event="imageShape"]:not([data-value])', function () {
return !$img.is('.img-rounded, .img-circle, .img-thumbnail');
});
var imgFloat = $img.css('float');
btnState('button[data-event="floatMe"][data-value="left"]', function () {
return imgFloat === 'left';
});
btnState('button[data-event="floatMe"][data-value="right"]', function () {
return imgFloat === 'right';
});
btnState('button[data-event="floatMe"][data-value="none"]', function () {
return imgFloat !== 'left' && imgFloat !== 'right';
});
var style = $img.attr('style');
btnState('button[data-event="resize"][data-value="1"]', function () {
return !!/(^|\s)(max-)?width\s*:\s*100%/.test(style);
});
btnState('button[data-event="resize"][data-value="0.5"]', function () {
return !!/(^|\s)(max-)?width\s*:\s*50%/.test(style);
});
btnState('button[data-event="resize"][data-value="0.25"]', function () {
return !!/(^|\s)(max-)?width\s*:\s*25%/.test(style);
});
return;
}
// fontname
var $fontname = $container.find('.note-fontname');
if ($fontname.length) {
var selectedFont = styleInfo['font-family'];
if (!!selectedFont) {
var list = selectedFont.split(',');
for (var i = 0, len = list.length; i < len; i++) {
selectedFont = list[i].replace(/[\'\"]/g, '').replace(/\s+$/, '').replace(/^\s+/, '');
if (agent.isFontInstalled(selectedFont)) {
break;
}
}
$fontname.find('.note-current-fontname').text(selectedFont);
checkDropdownMenu($fontname, selectedFont);
}
}
// fontsize
var $fontsize = $container.find('.note-fontsize');
$fontsize.find('.note-current-fontsize').text(styleInfo['font-size']);
checkDropdownMenu($fontsize, parseFloat(styleInfo['font-size']));
// lineheight
var $lineHeight = $container.find('.note-height');
checkDropdownMenu($lineHeight, parseFloat(styleInfo['line-height']));
btnState('button[data-event="bold"]', function () {
return styleInfo['font-bold'] === 'bold';
});
btnState('button[data-event="italic"]', function () {
return styleInfo['font-italic'] === 'italic';
});
btnState('button[data-event="underline"]', function () {
return styleInfo['font-underline'] === 'underline';
});
btnState('button[data-event="strikethrough"]', function () {
return styleInfo['font-strikethrough'] === 'strikethrough';
});
btnState('button[data-event="superscript"]', function () {
return styleInfo['font-superscript'] === 'superscript';
});
btnState('button[data-event="subscript"]', function () {
return styleInfo['font-subscript'] === 'subscript';
});
btnState('button[data-event="justifyLeft"]', function () {
return styleInfo['text-align'] === 'left' || styleInfo['text-align'] === 'start';
});
btnState('button[data-event="justifyCenter"]', function () {
return styleInfo['text-align'] === 'center';
});
btnState('button[data-event="justifyRight"]', function () {
return styleInfo['text-align'] === 'right';
});
btnState('button[data-event="justifyFull"]', function () {
return styleInfo['text-align'] === 'justify';
});
btnState('button[data-event="insertUnorderedList"]', function () {
return styleInfo['list-style'] === 'unordered';
});
btnState('button[data-event="insertOrderedList"]', function () {
return styleInfo['list-style'] === 'ordered';
});
};
/**
* update recent color
*
* @param {Node} button
* @param {String} eventName
* @param {Mixed} value
*/
this.updateRecentColor = function (button, eventName, value) {
var $color = $(button).closest('.note-color');
var $recentColor = $color.find('.note-recent-color');
var colorInfo = JSON.parse($recentColor.attr('data-value'));
colorInfo[eventName] = value;
$recentColor.attr('data-value', JSON.stringify(colorInfo));
var sKey = eventName === 'backColor' ? 'background-color' : 'color';
$recentColor.find('i').css(sKey, value);
};
};
/**
* @class module.Toolbar
*
* Toolbar
*/
var Toolbar = function () {
var button = new Button();
this.update = function ($toolbar, styleInfo) {
button.update($toolbar, styleInfo);
};
/**
* @param {Node} button
* @param {String} eventName
* @param {String} value
*/
this.updateRecentColor = function (buttonNode, eventName, value) {
button.updateRecentColor(buttonNode, eventName, value);
};
/**
* activate buttons exclude codeview
* @param {jQuery} $toolbar
*/
this.activate = function ($toolbar) {
$toolbar.find('button')
.not('button[data-event="codeview"]')
.removeClass('disabled');
};
/**
* deactivate buttons exclude codeview
* @param {jQuery} $toolbar
*/
this.deactivate = function ($toolbar) {
$toolbar.find('button')
.not('button[data-event="codeview"]')
.addClass('disabled');
};
/**
* @param {jQuery} $container
* @param {Boolean} [bFullscreen=false]
*/
this.updateFullscreen = function ($container, bFullscreen) {
var $btn = $container.find('button[data-event="fullscreen"]');
$btn.toggleClass('active', bFullscreen);
};
/**
* @param {jQuery} $container
* @param {Boolean} [isCodeview=false]
*/
this.updateCodeview = function ($container, isCodeview) {
var $btn = $container.find('button[data-event="codeview"]');
$btn.toggleClass('active', isCodeview);
if (isCodeview) {
this.deactivate($container);
} else {
this.activate($container);
}
};
/**
* get button in toolbar
*
* @param {jQuery} $editable
* @param {String} name
* @return {jQuery}
*/
this.get = function ($editable, name) {
var $toolbar = dom.makeLayoutInfo($editable).toolbar();
return $toolbar.find('[data-name=' + name + ']');
};
/**
* set button state
* @param {jQuery} $editable
* @param {String} name
* @param {Boolean} [isActive=true]
*/
this.setButtonState = function ($editable, name, isActive) {
isActive = (isActive === false) ? false : true;
var $button = this.get($editable, name);
$button.toggleClass('active', isActive);
};
};
var EDITABLE_PADDING = 24;
var Statusbar = function () {
var $document = $(document);
this.attach = function (layoutInfo, options) {
if (!options.disableResizeEditor) {
layoutInfo.statusbar().on('mousedown', hStatusbarMousedown);
}
};
/**
* `mousedown` event handler on statusbar
*
* @param {MouseEvent} event
*/
var hStatusbarMousedown = function (event) {
event.preventDefault();
event.stopPropagation();
var $editable = dom.makeLayoutInfo(event.target).editable();
var editableTop = $editable.offset().top - $document.scrollTop();
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
var options = layoutInfo.editor().data('options');
$document.on('mousemove', function (event) {
var nHeight = event.clientY - (editableTop + EDITABLE_PADDING);
nHeight = (options.minHeight > 0) ? Math.max(nHeight, options.minHeight) : nHeight;
nHeight = (options.maxHeight > 0) ? Math.min(nHeight, options.maxHeight) : nHeight;
$editable.height(nHeight);
}).one('mouseup', function () {
$document.off('mousemove');
});
};
};
/**
* @class module.Popover
*
* Popover (http://getbootstrap.com/javascript/#popovers)
*
*/
var Popover = function () {
var button = new Button();
/**
* returns position from placeholder
*
* @private
* @param {Node} placeholder
* @param {Object} options
* @param {Boolean} options.isAirMode
* @return {Position}
*/
var posFromPlaceholder = function (placeholder, options) {
var isAirMode = options && options.isAirMode;
var isLeftTop = options && options.isLeftTop;
var $placeholder = $(placeholder);
var pos = isAirMode ? $placeholder.offset() : $placeholder.position();
var height = isLeftTop ? 0 : $placeholder.outerHeight(true); // include margin
// popover below placeholder.
return {
left: pos.left,
top: pos.top + height
};
};
/**
* show popover
*
* @private
* @param {jQuery} popover
* @param {Position} pos
*/
var showPopover = function ($popover, pos) {
$popover.css({
display: 'block',
left: pos.left,
top: pos.top
});
};
var PX_POPOVER_ARROW_OFFSET_X = 20;
/**
* update current state
* @param {jQuery} $popover - popover container
* @param {Object} styleInfo - style object
* @param {Boolean} isAirMode
*/
this.update = function ($popover, styleInfo, isAirMode) {
button.update($popover, styleInfo);
var $linkPopover = $popover.find('.note-link-popover');
if (styleInfo.anchor) {
var $anchor = $linkPopover.find('a');
var href = $(styleInfo.anchor).attr('href');
var target = $(styleInfo.anchor).attr('target');
$anchor.attr('href', href).html(href);
if (!target) {
$anchor.removeAttr('target');
} else {
$anchor.attr('target', '_blank');
}
showPopover($linkPopover, posFromPlaceholder(styleInfo.anchor, {
isAirMode: isAirMode
}));
} else {
$linkPopover.hide();
}
var $imagePopover = $popover.find('.note-image-popover');
if (styleInfo.image) {
showPopover($imagePopover, posFromPlaceholder(styleInfo.image, {
isAirMode: isAirMode,
isLeftTop: true
}));
} else {
$imagePopover.hide();
}
var $airPopover = $popover.find('.note-air-popover');
if (isAirMode && styleInfo.range && !styleInfo.range.isCollapsed()) {
var rect = list.last(styleInfo.range.getClientRects());
if (rect) {
var bnd = func.rect2bnd(rect);
showPopover($airPopover, {
left: Math.max(bnd.left + bnd.width / 2 - PX_POPOVER_ARROW_OFFSET_X, 0),
top: bnd.top + bnd.height
});
}
} else {
$airPopover.hide();
}
};
/**
* @param {Node} button
* @param {String} eventName
* @param {String} value
*/
this.updateRecentColor = function (button, eventName, value) {
button.updateRecentColor(button, eventName, value);
};
/**
* hide all popovers
* @param {jQuery} $popover - popover container
*/
this.hide = function ($popover) {
$popover.children().hide();
};
};
/**
* @class module.Handle
*
* Handle
*/
var Handle = function (handler) {
var $document = $(document);
/**
* `mousedown` event handler on $handle
* - controlSizing: resize image
*
* @param {MouseEvent} event
*/
var hHandleMousedown = function (event) {
if (dom.isControlSizing(event.target)) {
event.preventDefault();
event.stopPropagation();
var layoutInfo = dom.makeLayoutInfo(event.target),
$handle = layoutInfo.handle(),
$popover = layoutInfo.popover(),
$editable = layoutInfo.editable(),
$editor = layoutInfo.editor();
var target = $handle.find('.note-control-selection').data('target'),
$target = $(target), posStart = $target.offset(),
scrollTop = $document.scrollTop();
var isAirMode = $editor.data('options').airMode;
$document.on('mousemove', function (event) {
handler.invoke('editor.resizeTo', {
x: event.clientX - posStart.left,
y: event.clientY - (posStart.top - scrollTop)
}, $target, !event.shiftKey);
handler.invoke('handle.update', $handle, {image: target}, isAirMode);
handler.invoke('popover.update', $popover, {image: target}, isAirMode);
}).one('mouseup', function () {
$document.off('mousemove');
handler.invoke('editor.afterCommand', $editable);
});
if (!$target.data('ratio')) { // original ratio.
$target.data('ratio', $target.height() / $target.width());
}
}
};
this.attach = function (layoutInfo) {
layoutInfo.handle().on('mousedown', hHandleMousedown);
};
/**
* update handle
* @param {jQuery} $handle
* @param {Object} styleInfo
* @param {Boolean} isAirMode
*/
this.update = function ($handle, styleInfo, isAirMode) {
var $selection = $handle.find('.note-control-selection');
if (styleInfo.image) {
var $image = $(styleInfo.image);
var pos = isAirMode ? $image.offset() : $image.position();
// include margin
var imageSize = {
w: $image.outerWidth(true),
h: $image.outerHeight(true)
};
$selection.css({
display: 'block',
left: pos.left,
top: pos.top,
width: imageSize.w,
height: imageSize.h
}).data('target', styleInfo.image); // save current image element.
var sizingText = imageSize.w + 'x' + imageSize.h;
$selection.find('.note-control-selection-info').text(sizingText);
} else {
$selection.hide();
}
};
/**
* hide
*
* @param {jQuery} $handle
*/
this.hide = function ($handle) {
$handle.children().hide();
};
};
var Fullscreen = function (handler) {
var $window = $(window);
var $scrollbar = $('html, body');
/**
* toggle fullscreen
*
* @param {Object} layoutInfo
*/
this.toggle = function (layoutInfo) {
var $editor = layoutInfo.editor(),
$toolbar = layoutInfo.toolbar(),
$editable = layoutInfo.editable(),
$codable = layoutInfo.codable();
var resize = function (size) {
$editable.css('height', size.h);
$codable.css('height', size.h);
if ($codable.data('cmeditor')) {
$codable.data('cmeditor').setsize(null, size.h);
}
};
$editor.toggleClass('fullscreen');
var isFullscreen = $editor.hasClass('fullscreen');
if (isFullscreen) {
$editable.data('orgheight', $editable.css('height'));
$window.on('resize', function () {
resize({
h: $window.height() - $toolbar.outerHeight()
});
}).trigger('resize');
$scrollbar.css('overflow', 'hidden');
} else {
$window.off('resize');
resize({
h: $editable.data('orgheight')
});
$scrollbar.css('overflow', 'visible');
}
handler.invoke('toolbar.updateFullscreen', $toolbar, isFullscreen);
};
};
var CodeMirror;
if (agent.hasCodeMirror) {
if (agent.isSupportAmd) {
require(['CodeMirror'], function (cm) {
CodeMirror = cm;
});
} else {
CodeMirror = window.CodeMirror;
}
}
/**
* @class Codeview
*/
var Codeview = function (handler) {
this.sync = function (layoutInfo) {
var isCodeview = handler.invoke('codeview.isActivated', layoutInfo);
if (isCodeview && agent.hasCodeMirror) {
layoutInfo.codable().data('cmEditor').save();
}
};
/**
* @param {Object} layoutInfo
* @return {Boolean}
*/
this.isActivated = function (layoutInfo) {
var $editor = layoutInfo.editor();
return $editor.hasClass('codeview');
};
/**
* toggle codeview
*
* @param {Object} layoutInfo
*/
this.toggle = function (layoutInfo) {
if (this.isActivated(layoutInfo)) {
this.deactivate(layoutInfo);
} else {
this.activate(layoutInfo);
}
};
/**
* activate code view
*
* @param {Object} layoutInfo
*/
this.activate = function (layoutInfo) {
var $editor = layoutInfo.editor(),
$toolbar = layoutInfo.toolbar(),
$editable = layoutInfo.editable(),
$codable = layoutInfo.codable(),
$popover = layoutInfo.popover(),
$handle = layoutInfo.handle();
var options = $editor.data('options');
$codable.val(dom.html($editable, options.prettifyHtml));
$codable.height($editable.height());
handler.invoke('toolbar.updateCodeview', $toolbar, true);
handler.invoke('popover.hide', $popover);
handler.invoke('handle.hide', $handle);
$editor.addClass('codeview');
$codable.focus();
// activate CodeMirror as codable
if (agent.hasCodeMirror) {
var cmEditor = CodeMirror.fromTextArea($codable[0], options.codemirror);
// CodeMirror TernServer
if (options.codemirror.tern) {
var server = new CodeMirror.TernServer(options.codemirror.tern);
cmEditor.ternServer = server;
cmEditor.on('cursorActivity', function (cm) {
server.updateArgHints(cm);
});
}
// CodeMirror hasn't Padding.
cmEditor.setSize(null, $editable.outerHeight());
$codable.data('cmEditor', cmEditor);
}
};
/**
* deactivate code view
*
* @param {Object} layoutInfo
*/
this.deactivate = function (layoutInfo) {
var $holder = layoutInfo.holder(),
$editor = layoutInfo.editor(),
$toolbar = layoutInfo.toolbar(),
$editable = layoutInfo.editable(),
$codable = layoutInfo.codable();
var options = $editor.data('options');
// deactivate CodeMirror as codable
if (agent.hasCodeMirror) {
var cmEditor = $codable.data('cmEditor');
$codable.val(cmEditor.getValue());
cmEditor.toTextArea();
}
var value = dom.value($codable, options.prettifyHtml) || dom.emptyPara;
var isChange = $editable.html() !== value;
$editable.html(value);
$editable.height(options.height ? $codable.height() : 'auto');
$editor.removeClass('codeview');
if (isChange) {
handler.bindCustomEvent(
$holder, $editable.data('callbacks'), 'change'
)($editable.html(), $editable);
}
$editable.focus();
handler.invoke('toolbar.updateCodeview', $toolbar, false);
};
};
var DragAndDrop = function (handler) {
var $document = $(document);
/**
* attach Drag and Drop Events
*
* @param {Object} layoutInfo - layout Informations
* @param {Object} options
*/
this.attach = function (layoutInfo, options) {
if (options.airMode || options.disableDragAndDrop) {
// prevent default drop event
$document.on('drop', function (e) {
e.preventDefault();
});
} else {
this.attachDragAndDropEvent(layoutInfo, options);
}
};
/**
* attach Drag and Drop Events
*
* @param {Object} layoutInfo - layout Informations
* @param {Object} options
*/
this.attachDragAndDropEvent = function (layoutInfo, options) {
var collection = $(),
$editor = layoutInfo.editor(),
$dropzone = layoutInfo.dropzone(),
$dropzoneMessage = $dropzone.find('.note-dropzone-message');
// show dropzone on dragenter when dragging a object to document
// -but only if the editor is visible, i.e. has a positive width and height
$document.on('dragenter', function (e) {
var isCodeview = handler.invoke('codeview.isActivated', layoutInfo);
var hasEditorSize = $editor.width() > 0 && $editor.height() > 0;
if (!isCodeview && !collection.length && hasEditorSize) {
$editor.addClass('dragover');
$dropzone.width($editor.width());
$dropzone.height($editor.height());
$dropzoneMessage.text(options.langInfo.image.dragImageHere);
}
collection = collection.add(e.target);
}).on('dragleave', function (e) {
collection = collection.not(e.target);
if (!collection.length) {
$editor.removeClass('dragover');
}
}).on('drop', function () {
collection = $();
$editor.removeClass('dragover');
});
// change dropzone's message on hover.
$dropzone.on('dragenter', function () {
$dropzone.addClass('hover');
$dropzoneMessage.text(options.langInfo.image.dropImage);
}).on('dragleave', function () {
$dropzone.removeClass('hover');
$dropzoneMessage.text(options.langInfo.image.dragImageHere);
});
// attach dropImage
$dropzone.on('drop', function (event) {
var dataTransfer = event.originalEvent.dataTransfer;
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
event.preventDefault();
layoutInfo.editable().focus();
handler.insertImages(layoutInfo, dataTransfer.files);
} else {
var insertNodefunc = function () {
layoutInfo.holder().summernote('insertNode', this);
};
for (var i = 0, len = dataTransfer.types.length; i < len; i++) {
var type = dataTransfer.types[i];
var content = dataTransfer.getData(type);
if (type.toLowerCase().indexOf('text') > -1) {
layoutInfo.holder().summernote('pasteHTML', content);
} else {
$(content).each(insertNodefunc);
}
}
}
}).on('dragover', false); // prevent default dragover event
};
};
var Clipboard = function (handler) {
var $paste;
this.attach = function (layoutInfo) {
// [workaround] getting image from clipboard
// - IE11 and Firefox: CTRL+v hook
// - Webkit: event.clipboardData
if ((agent.isMSIE && agent.browserVersion > 10) || agent.isFF) {
$paste = $('
').attr('contenteditable', true).css({
position : 'absolute',
left : -100000,
opacity : 0
});
layoutInfo.editable().on('keydown', function (e) {
if (e.ctrlKey && e.keyCode === key.code.V) {
handler.invoke('saveRange', layoutInfo.editable());
$paste.focus();
setTimeout(function () {
pasteByHook(layoutInfo);
}, 0);
}
});
layoutInfo.editable().before($paste);
} else {
layoutInfo.editable().on('paste', pasteByEvent);
}
};
var pasteByHook = function (layoutInfo) {
var $editable = layoutInfo.editable();
var node = $paste[0].firstChild;
if (dom.isImg(node)) {
var dataURI = node.src;
var decodedData = atob(dataURI.split(',')[1]);
var array = new Uint8Array(decodedData.length);
for (var i = 0; i < decodedData.length; i++) {
array[i] = decodedData.charCodeAt(i);
}
var blob = new Blob([array], { type : 'image/png' });
blob.name = 'clipboard.png';
handler.invoke('restoreRange', $editable);
handler.invoke('focus', $editable);
handler.insertImages(layoutInfo, [blob]);
} else {
var pasteContent = $('
').html($paste.html()).html();
handler.invoke('restoreRange', $editable);
handler.invoke('focus', $editable);
if (pasteContent) {
handler.invoke('pasteHTML', $editable, pasteContent);
}
}
$paste.empty();
};
/**
* paste by clipboard event
*
* @param {Event} event
*/
var pasteByEvent = function (event) {
var clipboardData = event.originalEvent.clipboardData;
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
var $editable = layoutInfo.editable();
if (clipboardData && clipboardData.items && clipboardData.items.length) {
var item = list.head(clipboardData.items);
if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {
handler.insertImages(layoutInfo, [item.getAsFile()]);
}
handler.invoke('editor.afterCommand', $editable);
}
};
};
var LinkDialog = function (handler) {
/**
* toggle button status
*
* @private
* @param {jQuery} $btn
* @param {Boolean} isEnable
*/
var toggleBtn = function ($btn, isEnable) {
$btn.toggleClass('disabled', !isEnable);
$btn.attr('disabled', !isEnable);
};
/**
* bind enter key
*
* @private
* @param {jQuery} $input
* @param {jQuery} $btn
*/
var bindEnterKey = function ($input, $btn) {
$input.on('keypress', function (event) {
if (event.keyCode === key.code.ENTER) {
$btn.trigger('click');
}
});
};
/**
* Show link dialog and set event handlers on dialog controls.
*
* @param {jQuery} $editable
* @param {jQuery} $dialog
* @param {Object} linkInfo
* @return {Promise}
*/
this.showLinkDialog = function ($editable, $dialog, linkInfo) {
return $.Deferred(function (deferred) {
var $linkDialog = $dialog.find('.note-link-dialog');
var $linkText = $linkDialog.find('.note-link-text'),
$linkUrl = $linkDialog.find('.note-link-url'),
$linkBtn = $linkDialog.find('.note-link-btn'),
$openInNewWindow = $linkDialog.find('input[type=checkbox]');
$linkDialog.one('shown.bs.modal', function () {
$linkText.val(linkInfo.text);
$linkText.on('input', function () {
toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());
// if linktext was modified by keyup,
// stop cloning text from linkUrl
linkInfo.text = $linkText.val();
});
// if no url was given, copy text to url
if (!linkInfo.url) {
linkInfo.url = linkInfo.text || 'http://';
toggleBtn($linkBtn, linkInfo.text);
}
$linkUrl.on('input', function () {
toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());
// display same link on `Text to display` input
// when create a new link
if (!linkInfo.text) {
$linkText.val($linkUrl.val());
}
}).val(linkInfo.url).trigger('focus').trigger('select');
bindEnterKey($linkUrl, $linkBtn);
bindEnterKey($linkText, $linkBtn);
$openInNewWindow.prop('checked', linkInfo.isNewWindow);
$linkBtn.one('click', function (event) {
event.preventDefault();
deferred.resolve({
range: linkInfo.range,
url: $linkUrl.val(),
text: $linkText.val(),
isNewWindow: $openInNewWindow.is(':checked')
});
$linkDialog.modal('hide');
});
}).one('hidden.bs.modal', function () {
// detach events
$linkText.off('input keypress');
$linkUrl.off('input keypress');
$linkBtn.off('click');
if (deferred.state() === 'pending') {
deferred.reject();
}
}).modal('show');
}).promise();
};
/**
* @param {Object} layoutInfo
*/
this.show = function (layoutInfo) {
var $editor = layoutInfo.editor(),
$dialog = layoutInfo.dialog(),
$editable = layoutInfo.editable(),
$popover = layoutInfo.popover(),
linkInfo = handler.invoke('editor.getLinkInfo', $editable);
var options = $editor.data('options');
handler.invoke('editor.saveRange', $editable);
this.showLinkDialog($editable, $dialog, linkInfo).then(function (linkInfo) {
handler.invoke('editor.restoreRange', $editable);
handler.invoke('editor.createLink', $editable, linkInfo, options);
// hide popover after creating link
handler.invoke('popover.hide', $popover);
}).fail(function () {
handler.invoke('editor.restoreRange', $editable);
});
};
};
var ImageDialog = function (handler) {
/**
* toggle button status
*
* @private
* @param {jQuery} $btn
* @param {Boolean} isEnable
*/
var toggleBtn = function ($btn, isEnable) {
$btn.toggleClass('disabled', !isEnable);
$btn.attr('disabled', !isEnable);
};
/**
* bind enter key
*
* @private
* @param {jQuery} $input
* @param {jQuery} $btn
*/
var bindEnterKey = function ($input, $btn) {
$input.on('keypress', function (event) {
if (event.keyCode === key.code.ENTER) {
$btn.trigger('click');
}
});
};
this.show = function (layoutInfo) {
var $dialog = layoutInfo.dialog(),
$editable = layoutInfo.editable();
handler.invoke('editor.saveRange', $editable);
this.showImageDialog($editable, $dialog).then(function (data) {
handler.invoke('editor.restoreRange', $editable);
if (typeof data === 'string') {
// image url
handler.invoke('editor.insertImage', $editable, data);
} else {
// array of files
handler.insertImages(layoutInfo, data);
}
}).fail(function () {
handler.invoke('editor.restoreRange', $editable);
});
};
/**
* show image dialog
*
* @param {jQuery} $editable
* @param {jQuery} $dialog
* @return {Promise}
*/
this.showImageDialog = function ($editable, $dialog) {
return $.Deferred(function (deferred) {
var $imageDialog = $dialog.find('.note-image-dialog');
var $imageInput = $dialog.find('.note-image-input'),
$imageUrl = $dialog.find('.note-image-url'),
$imageBtn = $dialog.find('.note-image-btn');
$imageDialog.one('shown.bs.modal', function () {
// Cloning imageInput to clear element.
$imageInput.replaceWith($imageInput.clone()
.on('change', function () {
deferred.resolve(this.files || this.value);
$imageDialog.modal('hide');
})
.val('')
);
$imageBtn.click(function (event) {
event.preventDefault();
deferred.resolve($imageUrl.val());
$imageDialog.modal('hide');
});
$imageUrl.on('keyup paste', function (event) {
var url;
if (event.type === 'paste') {
url = event.originalEvent.clipboardData.getData('text');
} else {
url = $imageUrl.val();
}
toggleBtn($imageBtn, url);
}).val('').trigger('focus');
bindEnterKey($imageUrl, $imageBtn);
}).one('hidden.bs.modal', function () {
$imageInput.off('change');
$imageUrl.off('keyup paste keypress');
$imageBtn.off('click');
if (deferred.state() === 'pending') {
deferred.reject();
}
}).modal('show');
});
};
};
var HelpDialog = function (handler) {
/**
* show help dialog
*
* @param {jQuery} $editable
* @param {jQuery} $dialog
* @return {Promise}
*/
this.showHelpDialog = function ($editable, $dialog) {
return $.Deferred(function (deferred) {
var $helpDialog = $dialog.find('.note-help-dialog');
$helpDialog.one('hidden.bs.modal', function () {
deferred.resolve();
}).modal('show');
}).promise();
};
/**
* @param {Object} layoutInfo
*/
this.show = function (layoutInfo) {
var $dialog = layoutInfo.dialog(),
$editable = layoutInfo.editable();
handler.invoke('editor.saveRange', $editable, true);
this.showHelpDialog($editable, $dialog).then(function () {
handler.invoke('editor.restoreRange', $editable);
});
};
};
/**
* @class EventHandler
*
* EventHandler
* - TODO: new instance per a editor
*/
var EventHandler = function () {
var self = this;
/**
* Modules
*/
var modules = this.modules = {
editor: new Editor(this),
toolbar: new Toolbar(this),
statusbar: new Statusbar(this),
popover: new Popover(this),
handle: new Handle(this),
fullscreen: new Fullscreen(this),
codeview: new Codeview(this),
dragAndDrop: new DragAndDrop(this),
clipboard: new Clipboard(this),
linkDialog: new LinkDialog(this),
imageDialog: new ImageDialog(this),
helpDialog: new HelpDialog(this)
};
/**
* invoke module's method
*
* @param {String} moduleAndMethod - ex) 'editor.redo'
* @param {...*} arguments - arguments of method
* @return {*}
*/
this.invoke = function () {
var moduleAndMethod = list.head(list.from(arguments));
var args = list.tail(list.from(arguments));
var splits = moduleAndMethod.split('.');
var hasSeparator = splits.length > 1;
var moduleName = hasSeparator && list.head(splits);
var methodName = hasSeparator ? list.last(splits) : list.head(splits);
var module = this.getModule(moduleName);
var method = module[methodName];
return method && method.apply(module, args);
};
/**
* returns module
*
* @param {String} moduleName - name of module
* @return {Module} - defaults is editor
*/
this.getModule = function (moduleName) {
return this.modules[moduleName] || this.modules.editor;
};
/**
* @param {jQuery} $holder
* @param {Object} callbacks
* @param {String} eventNamespace
* @returns {Function}
*/
var bindCustomEvent = this.bindCustomEvent = function ($holder, callbacks, eventNamespace) {
return function () {
var callback = callbacks[func.namespaceToCamel(eventNamespace, 'on')];
if (callback) {
callback.apply($holder[0], arguments);
}
return $holder.trigger('summernote.' + eventNamespace, arguments);
};
};
/**
* insert Images from file array.
*
* @private
* @param {Object} layoutInfo
* @param {File[]} files
*/
this.insertImages = function (layoutInfo, files) {
var $editor = layoutInfo.editor(),
$editable = layoutInfo.editable(),
$holder = layoutInfo.holder();
var callbacks = $editable.data('callbacks');
var options = $editor.data('options');
// If onImageUpload options setted
if (callbacks.onImageUpload) {
bindCustomEvent($holder, callbacks, 'image.upload')(files);
// else insert Image as dataURL
} else {
$.each(files, function (idx, file) {
var filename = file.name;
if (options.maximumImageFileSize && options.maximumImageFileSize < file.size) {
bindCustomEvent($holder, callbacks, 'image.upload.error')(options.langInfo.image.maximumFileSizeError);
} else {
async.readFileAsDataURL(file).then(function (sDataURL) {
modules.editor.insertImage($editable, sDataURL, filename);
}).fail(function () {
bindCustomEvent($holder, callbacks, 'image.upload.error')(options.langInfo.image.maximumFileSizeError);
});
}
});
}
};
var commands = {
/**
* @param {Object} layoutInfo
*/
showLinkDialog: function (layoutInfo) {
modules.linkDialog.show(layoutInfo);
},
/**
* @param {Object} layoutInfo
*/
showImageDialog: function (layoutInfo) {
modules.imageDialog.show(layoutInfo);
},
/**
* @param {Object} layoutInfo
*/
showHelpDialog: function (layoutInfo) {
modules.helpDialog.show(layoutInfo);
},
/**
* @param {Object} layoutInfo
*/
fullscreen: function (layoutInfo) {
modules.fullscreen.toggle(layoutInfo);
},
/**
* @param {Object} layoutInfo
*/
codeview: function (layoutInfo) {
modules.codeview.toggle(layoutInfo);
}
};
var hMousedown = function (event) {
//preventDefault Selection for FF, IE8+
if (dom.isImg(event.target)) {
event.preventDefault();
}
};
var hKeyupAndMouseup = function (event) {
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
modules.editor.removeBogus(layoutInfo.editable());
hToolbarAndPopoverUpdate(event);
};
/**
* update sytle info
* @param {Object} styleInfo
* @param {Object} layoutInfo
*/
this.updateStyleInfo = function (styleInfo, layoutInfo) {
if (!styleInfo) {
return;
}
var isAirMode = layoutInfo.editor().data('options').airMode;
if (!isAirMode) {
modules.toolbar.update(layoutInfo.toolbar(), styleInfo);
}
modules.popover.update(layoutInfo.popover(), styleInfo, isAirMode);
modules.handle.update(layoutInfo.handle(), styleInfo, isAirMode);
};
var hToolbarAndPopoverUpdate = function (event) {
var target = event.target;
// delay for range after mouseup
setTimeout(function () {
var layoutInfo = dom.makeLayoutInfo(target);
var styleInfo = modules.editor.currentStyle(target);
self.updateStyleInfo(styleInfo, layoutInfo);
}, 0);
};
var hScroll = function (event) {
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
//hide popover and handle when scrolled
modules.popover.hide(layoutInfo.popover());
modules.handle.hide(layoutInfo.handle());
};
var hToolbarAndPopoverMousedown = function (event) {
// prevent default event when insertTable (FF, Webkit)
var $btn = $(event.target).closest('[data-event]');
if ($btn.length) {
event.preventDefault();
}
};
var hToolbarAndPopoverClick = function (event) {
var $btn = $(event.target).closest('[data-event]');
if (!$btn.length) {
return;
}
var eventName = $btn.attr('data-event'),
value = $btn.attr('data-value'),
hide = $btn.attr('data-hide');
var layoutInfo = dom.makeLayoutInfo(event.target);
// before command: detect control selection element($target)
var $target;
if ($.inArray(eventName, ['resize', 'floatMe', 'removeMedia', 'imageShape']) !== -1) {
var $selection = layoutInfo.handle().find('.note-control-selection');
$target = $($selection.data('target'));
}
// If requested, hide the popover when the button is clicked.
// Useful for things like showHelpDialog.
if (hide) {
$btn.parents('.popover').hide();
}
if ($.isFunction($.summernote.pluginEvents[eventName])) {
$.summernote.pluginEvents[eventName](event, modules.editor, layoutInfo, value);
} else if (modules.editor[eventName]) { // on command
var $editable = layoutInfo.editable();
$editable.focus();
modules.editor[eventName]($editable, value, $target);
event.preventDefault();
} else if (commands[eventName]) {
commands[eventName].call(this, layoutInfo);
event.preventDefault();
}
// after command
if ($.inArray(eventName, ['backColor', 'foreColor']) !== -1) {
var options = layoutInfo.editor().data('options', options);
var module = options.airMode ? modules.popover : modules.toolbar;
module.updateRecentColor(list.head($btn), eventName, value);
}
hToolbarAndPopoverUpdate(event);
};
var PX_PER_EM = 18;
var hDimensionPickerMove = function (event, options) {
var $picker = $(event.target.parentNode); // target is mousecatcher
var $dimensionDisplay = $picker.next();
var $catcher = $picker.find('.note-dimension-picker-mousecatcher');
var $highlighted = $picker.find('.note-dimension-picker-highlighted');
var $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');
var posOffset;
// HTML5 with jQuery - e.offsetX is undefined in Firefox
if (event.offsetX === undefined) {
var posCatcher = $(event.target).offset();
posOffset = {
x: event.pageX - posCatcher.left,
y: event.pageY - posCatcher.top
};
} else {
posOffset = {
x: event.offsetX,
y: event.offsetY
};
}
var dim = {
c: Math.ceil(posOffset.x / PX_PER_EM) || 1,
r: Math.ceil(posOffset.y / PX_PER_EM) || 1
};
$highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });
$catcher.attr('data-value', dim.c + 'x' + dim.r);
if (3 < dim.c && dim.c < options.insertTableMaxSize.col) {
$unhighlighted.css({ width: dim.c + 1 + 'em'});
}
if (3 < dim.r && dim.r < options.insertTableMaxSize.row) {
$unhighlighted.css({ height: dim.r + 1 + 'em'});
}
$dimensionDisplay.html(dim.c + ' x ' + dim.r);
};
/**
* bind KeyMap on keydown
*
* @param {Object} layoutInfo
* @param {Object} keyMap
*/
this.bindKeyMap = function (layoutInfo, keyMap) {
var $editor = layoutInfo.editor();
var $editable = layoutInfo.editable();
$editable.on('keydown', function (event) {
var keys = [];
// modifier
if (event.metaKey) { keys.push('CMD'); }
if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }
if (event.shiftKey) { keys.push('SHIFT'); }
// keycode
var keyName = key.nameFromCode[event.keyCode];
if (keyName) {
keys.push(keyName);
}
var pluginEvent;
var keyString = keys.join('+');
var eventName = keyMap[keyString];
if (eventName) {
// FIXME Summernote doesn't support event pipeline yet.
// - Plugin -> Base Code
pluginEvent = $.summernote.pluginEvents[keyString];
if ($.isFunction(pluginEvent)) {
if (pluginEvent(event, modules.editor, layoutInfo)) {
return false;
}
}
pluginEvent = $.summernote.pluginEvents[eventName];
if ($.isFunction(pluginEvent)) {
pluginEvent(event, modules.editor, layoutInfo);
} else if (modules.editor[eventName]) {
modules.editor[eventName]($editable, $editor.data('options'));
event.preventDefault();
} else if (commands[eventName]) {
commands[eventName].call(this, layoutInfo);
event.preventDefault();
}
} else if (key.isEdit(event.keyCode)) {
modules.editor.afterCommand($editable);
}
});
};
/**
* attach eventhandler
*
* @param {Object} layoutInfo - layout Informations
* @param {Object} options - user options include custom event handlers
*/
this.attach = function (layoutInfo, options) {
// handlers for editable
if (options.shortcuts) {
this.bindKeyMap(layoutInfo, options.keyMap[agent.isMac ? 'mac' : 'pc']);
}
layoutInfo.editable().on('mousedown', hMousedown);
layoutInfo.editable().on('keyup mouseup', hKeyupAndMouseup);
layoutInfo.editable().on('scroll', hScroll);
// handler for clipboard
modules.clipboard.attach(layoutInfo, options);
// handler for handle and popover
modules.handle.attach(layoutInfo, options);
layoutInfo.popover().on('click', hToolbarAndPopoverClick);
layoutInfo.popover().on('mousedown', hToolbarAndPopoverMousedown);
// handler for drag and drop
modules.dragAndDrop.attach(layoutInfo, options);
// handlers for frame mode (toolbar, statusbar)
if (!options.airMode) {
// handler for toolbar
layoutInfo.toolbar().on('click', hToolbarAndPopoverClick);
layoutInfo.toolbar().on('mousedown', hToolbarAndPopoverMousedown);
// handler for statusbar
modules.statusbar.attach(layoutInfo, options);
}
// handler for table dimension
var $catcherContainer = options.airMode ? layoutInfo.popover() :
layoutInfo.toolbar();
var $catcher = $catcherContainer.find('.note-dimension-picker-mousecatcher');
$catcher.css({
width: options.insertTableMaxSize.col + 'em',
height: options.insertTableMaxSize.row + 'em'
}).on('mousemove', function (event) {
hDimensionPickerMove(event, options);
});
// save options on editor
layoutInfo.editor().data('options', options);
// ret styleWithCSS for backColor / foreColor clearing with 'inherit'.
if (!agent.isMSIE) {
// [workaround] for Firefox
// - protect FF Error: NS_ERROR_FAILURE: Failure
setTimeout(function () {
document.execCommand('styleWithCSS', 0, options.styleWithSpan);
}, 0);
}
// History
var history = new History(layoutInfo.editable());
layoutInfo.editable().data('NoteHistory', history);
// All editor status will be saved on editable with jquery's data
// for support multiple editor with singleton object.
layoutInfo.editable().data('callbacks', {
onInit: options.onInit,
onFocus: options.onFocus,
onBlur: options.onBlur,
onKeydown: options.onKeydown,
onKeyup: options.onKeyup,
onMousedown: options.onMousedown,
onEnter: options.onEnter,
onPaste: options.onPaste,
onBeforeCommand: options.onBeforeCommand,
onChange: options.onChange,
onImageUpload: options.onImageUpload,
onImageUploadError: options.onImageUploadError,
onMediaDelete: options.onMediaDelete,
onToolbarClick: options.onToolbarClick
});
var styleInfo = modules.editor.styleFromNode(layoutInfo.editable());
this.updateStyleInfo(styleInfo, layoutInfo);
};
/**
* attach jquery custom event
*
* @param {Object} layoutInfo - layout Informations
*/
this.attachCustomEvent = function (layoutInfo, options) {
var $holder = layoutInfo.holder();
var $editable = layoutInfo.editable();
var callbacks = $editable.data('callbacks');
$editable.focus(bindCustomEvent($holder, callbacks, 'focus'));
$editable.blur(bindCustomEvent($holder, callbacks, 'blur'));
$editable.keydown(function (event) {
if (event.keyCode === key.code.ENTER) {
bindCustomEvent($holder, callbacks, 'enter').call(this, event);
}
bindCustomEvent($holder, callbacks, 'keydown').call(this, event);
});
$editable.keyup(bindCustomEvent($holder, callbacks, 'keyup'));
$editable.on('mousedown', bindCustomEvent($holder, callbacks, 'mousedown'));
$editable.on('mouseup', bindCustomEvent($holder, callbacks, 'mouseup'));
$editable.on('scroll', bindCustomEvent($holder, callbacks, 'scroll'));
$editable.on('paste', bindCustomEvent($holder, callbacks, 'paste'));
// [workaround] IE doesn't have input events for contentEditable
// - see: https://goo.gl/4bfIvA
var changeEventName = agent.isMSIE ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';
$editable.on(changeEventName, function () {
bindCustomEvent($holder, callbacks, 'change')($editable.html(), $editable);
});
if (!options.airMode) {
layoutInfo.toolbar().click(bindCustomEvent($holder, callbacks, 'toolbar.click'));
layoutInfo.popover().click(bindCustomEvent($holder, callbacks, 'popover.click'));
}
// Textarea: auto filling the code before form submit.
if (dom.isTextarea(list.head($holder))) {
$holder.closest('form').submit(function (e) {
layoutInfo.holder().val(layoutInfo.holder().code());
bindCustomEvent($holder, callbacks, 'submit').call(this, e, $holder.code());
});
}
// textarea auto sync
if (dom.isTextarea(list.head($holder)) && options.textareaAutoSync) {
$holder.on('summernote.change', function () {
layoutInfo.holder().val(layoutInfo.holder().code());
});
}
// fire init event
bindCustomEvent($holder, callbacks, 'init')(layoutInfo);
// fire plugin init event
for (var i = 0, len = $.summernote.plugins.length; i < len; i++) {
if ($.isFunction($.summernote.plugins[i].init)) {
$.summernote.plugins[i].init(layoutInfo);
}
}
};
this.detach = function (layoutInfo, options) {
layoutInfo.holder().off();
layoutInfo.editable().off();
layoutInfo.popover().off();
layoutInfo.handle().off();
layoutInfo.dialog().off();
if (!options.airMode) {
layoutInfo.dropzone().off();
layoutInfo.toolbar().off();
layoutInfo.statusbar().off();
}
};
};
/**
* @class Renderer
*
* renderer
*
* rendering toolbar and editable
*/
var Renderer = function () {
/**
* bootstrap button template
* @private
* @param {String} label button name
* @param {Object} [options] button options
* @param {String} [options.event] data-event
* @param {String} [options.className] button's class name
* @param {String} [options.value] data-value
* @param {String} [options.title] button's title for popup
* @param {String} [options.dropdown] dropdown html
* @param {String} [options.hide] data-hide
*/
var tplButton = function (label, options) {
var event = options.event;
var value = options.value;
var title = options.title;
var className = options.className;
var dropdown = options.dropdown;
var hide = options.hide;
return (dropdown ? '' : '') +
'' +
label +
(dropdown ? ' ' : '') +
' ' +
(dropdown || '') +
(dropdown ? '
' : '');
};
/**
* bootstrap icon button template
* @private
* @param {String} iconClassName
* @param {Object} [options]
* @param {String} [options.event]
* @param {String} [options.value]
* @param {String} [options.title]
* @param {String} [options.dropdown]
*/
var tplIconButton = function (iconClassName, options) {
var label = ' ';
return tplButton(label, options);
};
/**
* bootstrap popover template
* @private
* @param {String} className
* @param {String} content
*/
var tplPopover = function (className, content) {
var $popover = $('');
$popover.find('.popover-content').append(content);
return $popover;
};
/**
* bootstrap dialog template
*
* @param {String} className
* @param {String} [title='']
* @param {String} body
* @param {String} [footer='']
*/
var tplDialog = function (className, title, body, footer) {
return '' +
'
' +
'
' +
(title ?
'' : ''
) +
'
' + body + '
' +
(footer ?
'' : ''
) +
'
' +
'
' +
'
';
};
/**
* bootstrap dropdown template
*
* @param {String|String[]} contents
* @param {String} [className='']
* @param {String} [nodeName='']
*/
var tplDropdown = function (contents, className, nodeName) {
var classes = 'dropdown-menu' + (className ? ' ' + className : '');
nodeName = nodeName || 'ul';
if (contents instanceof Array) {
contents = contents.join('');
}
return '<' + nodeName + ' class="' + classes + '">' + contents + '' + nodeName + '>';
};
var tplButtonInfo = {
picture: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.image.image, {
event: 'showImageDialog',
title: lang.image.image,
hide: true
});
},
link: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.link.link, {
event: 'showLinkDialog',
title: lang.link.link,
hide: true
});
},
table: function (lang, options) {
var dropdown = [
'',
' 1 x 1
'
];
return tplIconButton(options.iconPrefix + options.icons.table.table, {
title: lang.table.table,
dropdown: tplDropdown(dropdown, 'note-table')
});
},
style: function (lang, options) {
var items = options.styleTags.reduce(function (memo, v) {
var label = lang.style[v === 'p' ? 'normal' : v];
return memo + '' +
(
(v === 'p' || v === 'pre') ? label :
'<' + v + '>' + label + '' + v + '>'
) +
' ';
}, '');
return tplIconButton(options.iconPrefix + options.icons.style.style, {
title: lang.style.style,
dropdown: tplDropdown(items)
});
},
fontname: function (lang, options) {
var realFontList = [];
var items = options.fontNames.reduce(function (memo, v) {
if (!agent.isFontInstalled(v) && !list.contains(options.fontNamesIgnoreCheck, v)) {
return memo;
}
realFontList.push(v);
return memo + '' +
' ' + v +
' ';
}, '');
var hasDefaultFont = agent.isFontInstalled(options.defaultFontName);
var defaultFontName = (hasDefaultFont) ? options.defaultFontName : realFontList[0];
var label = '' +
defaultFontName +
' ';
return tplButton(label, {
title: lang.font.name,
className: 'note-fontname',
dropdown: tplDropdown(items, 'note-check')
});
},
fontsize: function (lang, options) {
var items = options.fontSizes.reduce(function (memo, v) {
return memo + '' +
' ' + v +
' ';
}, '');
var label = '11 ';
return tplButton(label, {
title: lang.font.size,
className: 'note-fontsize',
dropdown: tplDropdown(items, 'note-check')
});
},
color: function (lang, options) {
var colorButtonLabel = ' ';
var colorButton = tplButton(colorButtonLabel, {
className: 'note-recent-color',
title: lang.color.recent,
event: 'color',
value: '{"backColor":"yellow"}'
});
var items = [
'',
'
' + lang.color.background + '
',
'
' + lang.color.setTransparent + '
',
'
',
'
',
'
' + lang.color.foreground + '
',
'
',
lang.color.resetToDefault,
'
',
'
',
'
'
];
var moreButton = tplButton('', {
title: lang.color.more,
dropdown: tplDropdown(items)
});
return colorButton + moreButton;
},
bold: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.bold, {
event: 'bold',
title: lang.font.bold
});
},
italic: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.italic, {
event: 'italic',
title: lang.font.italic
});
},
underline: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.underline, {
event: 'underline',
title: lang.font.underline
});
},
strikethrough: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.strikethrough, {
event: 'strikethrough',
title: lang.font.strikethrough
});
},
superscript: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.superscript, {
event: 'superscript',
title: lang.font.superscript
});
},
subscript: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.subscript, {
event: 'subscript',
title: lang.font.subscript
});
},
clear: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.font.clear, {
event: 'removeFormat',
title: lang.font.clear
});
},
ul: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.lists.unordered, {
event: 'insertUnorderedList',
title: lang.lists.unordered
});
},
ol: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.lists.ordered, {
event: 'insertOrderedList',
title: lang.lists.ordered
});
},
paragraph: function (lang, options) {
var leftButton = tplIconButton(options.iconPrefix + options.icons.paragraph.left, {
title: lang.paragraph.left,
event: 'justifyLeft'
});
var centerButton = tplIconButton(options.iconPrefix + options.icons.paragraph.center, {
title: lang.paragraph.center,
event: 'justifyCenter'
});
var rightButton = tplIconButton(options.iconPrefix + options.icons.paragraph.right, {
title: lang.paragraph.right,
event: 'justifyRight'
});
var justifyButton = tplIconButton(options.iconPrefix + options.icons.paragraph.justify, {
title: lang.paragraph.justify,
event: 'justifyFull'
});
var outdentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.outdent, {
title: lang.paragraph.outdent,
event: 'outdent'
});
var indentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.indent, {
title: lang.paragraph.indent,
event: 'indent'
});
var dropdown = [
'',
leftButton + centerButton + rightButton + justifyButton,
'
',
indentButton + outdentButton,
'
'
];
return tplIconButton(options.iconPrefix + options.icons.paragraph.paragraph, {
title: lang.paragraph.paragraph,
dropdown: tplDropdown(dropdown, '', 'div')
});
},
height: function (lang, options) {
var items = options.lineHeights.reduce(function (memo, v) {
return memo + '' +
' ' + v +
' ';
}, '');
return tplIconButton(options.iconPrefix + options.icons.font.height, {
title: lang.font.height,
dropdown: tplDropdown(items, 'note-check')
});
},
help: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.options.help, {
event: 'showHelpDialog',
title: lang.options.help,
hide: true
});
},
fullscreen: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.options.fullscreen, {
event: 'fullscreen',
title: lang.options.fullscreen
});
},
codeview: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.options.codeview, {
event: 'codeview',
title: lang.options.codeview
});
},
undo: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.history.undo, {
event: 'undo',
title: lang.history.undo
});
},
redo: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.history.redo, {
event: 'redo',
title: lang.history.redo
});
},
hr: function (lang, options) {
return tplIconButton(options.iconPrefix + options.icons.hr.insert, {
event: 'insertHorizontalRule',
title: lang.hr.insert
});
}
};
var tplPopovers = function (lang, options) {
var tplLinkPopover = function () {
var linkButton = tplIconButton(options.iconPrefix + options.icons.link.edit, {
title: lang.link.edit,
event: 'showLinkDialog',
hide: true
});
var unlinkButton = tplIconButton(options.iconPrefix + options.icons.link.unlink, {
title: lang.link.unlink,
event: 'unlink'
});
var content = 'www.google.com ' +
'' +
linkButton + unlinkButton +
'
';
return tplPopover('note-link-popover', content);
};
var tplImagePopover = function () {
var fullButton = tplButton('100% ', {
title: lang.image.resizeFull,
event: 'resize',
value: '1'
});
var halfButton = tplButton('50% ', {
title: lang.image.resizeHalf,
event: 'resize',
value: '0.5'
});
var quarterButton = tplButton('25% ', {
title: lang.image.resizeQuarter,
event: 'resize',
value: '0.25'
});
var leftButton = tplIconButton(options.iconPrefix + options.icons.image.floatLeft, {
title: lang.image.floatLeft,
event: 'floatMe',
value: 'left'
});
var rightButton = tplIconButton(options.iconPrefix + options.icons.image.floatRight, {
title: lang.image.floatRight,
event: 'floatMe',
value: 'right'
});
var justifyButton = tplIconButton(options.iconPrefix + options.icons.image.floatNone, {
title: lang.image.floatNone,
event: 'floatMe',
value: 'none'
});
var roundedButton = tplIconButton(options.iconPrefix + options.icons.image.shapeRounded, {
title: lang.image.shapeRounded,
event: 'imageShape',
value: 'img-rounded'
});
var circleButton = tplIconButton(options.iconPrefix + options.icons.image.shapeCircle, {
title: lang.image.shapeCircle,
event: 'imageShape',
value: 'img-circle'
});
var thumbnailButton = tplIconButton(options.iconPrefix + options.icons.image.shapeThumbnail, {
title: lang.image.shapeThumbnail,
event: 'imageShape',
value: 'img-thumbnail'
});
var noneButton = tplIconButton(options.iconPrefix + options.icons.image.shapeNone, {
title: lang.image.shapeNone,
event: 'imageShape',
value: ''
});
var removeButton = tplIconButton(options.iconPrefix + options.icons.image.remove, {
title: lang.image.remove,
event: 'removeMedia',
value: 'none'
});
var content = (options.disableResizeImage ? '' : '' + fullButton + halfButton + quarterButton + '
') +
'' + leftButton + rightButton + justifyButton + '
' +
'' + roundedButton + circleButton + thumbnailButton + noneButton + '
' +
'' + removeButton + '
';
return tplPopover('note-image-popover', content);
};
var tplAirPopover = function () {
var $content = $('
');
for (var idx = 0, len = options.airPopover.length; idx < len; idx ++) {
var group = options.airPopover[idx];
var $group = $('');
for (var i = 0, lenGroup = group[1].length; i < lenGroup; i++) {
var $button = $(tplButtonInfo[group[1][i]](lang, options));
$button.attr('data-name', group[1][i]);
$group.append($button);
}
$content.append($group);
}
return tplPopover('note-air-popover', $content.children());
};
var $notePopover = $('
');
$notePopover.append(tplLinkPopover());
$notePopover.append(tplImagePopover());
if (options.airMode) {
$notePopover.append(tplAirPopover());
}
return $notePopover;
};
var tplHandles = function (options) {
return '
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
(options.disableResizeImage ? '' : '
') +
'
' +
'
';
};
/**
* shortcut table template
* @param {String} title
* @param {String} body
*/
var tplShortcut = function (title, keys) {
var keyClass = 'note-shortcut-col col-xs-6 note-shortcut-';
var body = [];
for (var i in keys) {
if (keys.hasOwnProperty(i)) {
body.push(
'
' + keys[i].kbd + '
' +
'
' + keys[i].text + '
'
);
}
}
return '
' +
'
' + body.join('
') + '
';
};
var tplShortcutText = function (lang) {
var keys = [
{ kbd: '⌘ + B', text: lang.font.bold },
{ kbd: '⌘ + I', text: lang.font.italic },
{ kbd: '⌘ + U', text: lang.font.underline },
{ kbd: '⌘ + \\', text: lang.font.clear }
];
return tplShortcut(lang.shortcut.textFormatting, keys);
};
var tplShortcutAction = function (lang) {
var keys = [
{ kbd: '⌘ + Z', text: lang.history.undo },
{ kbd: '⌘ + ⇧ + Z', text: lang.history.redo },
{ kbd: '⌘ + ]', text: lang.paragraph.indent },
{ kbd: '⌘ + [', text: lang.paragraph.outdent },
{ kbd: '⌘ + ENTER', text: lang.hr.insert }
];
return tplShortcut(lang.shortcut.action, keys);
};
var tplShortcutPara = function (lang) {
var keys = [
{ kbd: '⌘ + ⇧ + L', text: lang.paragraph.left },
{ kbd: '⌘ + ⇧ + E', text: lang.paragraph.center },
{ kbd: '⌘ + ⇧ + R', text: lang.paragraph.right },
{ kbd: '⌘ + ⇧ + J', text: lang.paragraph.justify },
{ kbd: '⌘ + ⇧ + NUM7', text: lang.lists.ordered },
{ kbd: '⌘ + ⇧ + NUM8', text: lang.lists.unordered }
];
return tplShortcut(lang.shortcut.paragraphFormatting, keys);
};
var tplShortcutStyle = function (lang) {
var keys = [
{ kbd: '⌘ + NUM0', text: lang.style.normal },
{ kbd: '⌘ + NUM1', text: lang.style.h1 },
{ kbd: '⌘ + NUM2', text: lang.style.h2 },
{ kbd: '⌘ + NUM3', text: lang.style.h3 },
{ kbd: '⌘ + NUM4', text: lang.style.h4 },
{ kbd: '⌘ + NUM5', text: lang.style.h5 },
{ kbd: '⌘ + NUM6', text: lang.style.h6 }
];
return tplShortcut(lang.shortcut.documentStyle, keys);
};
var tplExtraShortcuts = function (lang, options) {
var extraKeys = options.extraKeys;
var keys = [];
for (var key in extraKeys) {
if (extraKeys.hasOwnProperty(key)) {
keys.push({ kbd: key, text: extraKeys[key] });
}
}
return tplShortcut(lang.shortcut.extraKeys, keys);
};
var tplShortcutTable = function (lang, options) {
var colClass = 'class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"';
var template = [
'
' + tplShortcutAction(lang, options) + '
' +
'
' + tplShortcutText(lang, options) + '
',
'
' + tplShortcutStyle(lang, options) + '
' +
'
' + tplShortcutPara(lang, options) + '
'
];
if (options.extraKeys) {
template.push('
' + tplExtraShortcuts(lang, options) + '
');
}
return '
' +
template.join('
') +
'
';
};
var replaceMacKeys = function (sHtml) {
return sHtml.replace(/⌘/g, 'Ctrl').replace(/⇧/g, 'Shift');
};
var tplDialogInfo = {
image: function (lang, options) {
var imageLimitation = '';
if (options.maximumImageFileSize) {
var unit = Math.floor(Math.log(options.maximumImageFileSize) / Math.log(1024));
var readableSize = (options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +
' ' + ' KMGTP'[unit] + 'B';
imageLimitation = '
' + lang.image.maximumFileSize + ' : ' + readableSize + ' ';
}
var body = '
' +
'' + lang.image.selectFromFiles + ' ' +
' ' +
imageLimitation +
'
' +
'
' +
'' + lang.image.url + ' ' +
' ' +
'
';
var footer = '
' + lang.image.insert + ' ';
return tplDialog('note-image-dialog', lang.image.insert, body, footer);
},
link: function (lang, options) {
var body = '
' +
'' + lang.link.textToDisplay + ' ' +
' ' +
'
' +
'
' +
'' + lang.link.url + ' ' +
' ' +
'
' +
(!options.disableLinkTarget ?
'
' +
'' + ' ' +
lang.link.openInNewWindow +
' ' +
'
' : ''
);
var footer = '
' + lang.link.insert + ' ';
return tplDialog('note-link-dialog', lang.link.insert, body, footer);
},
help: function (lang, options) {
var body = '
' + lang.shortcut.close + ' ' +
'
' + lang.shortcut.shortcuts + '
' +
(agent.isMac ? tplShortcutTable(lang, options) : replaceMacKeys(tplShortcutTable(lang, options))) +
'
' +
'Summernote 0.6.16 · ' +
'Project · ' +
'Issues ' +
'
';
return tplDialog('note-help-dialog', '', body, '');
}
};
var tplDialogs = function (lang, options) {
var dialogs = '';
$.each(tplDialogInfo, function (idx, tplDialog) {
dialogs += tplDialog(lang, options);
});
return '
' + dialogs + '
';
};
var tplStatusbar = function () {
return '
';
};
var representShortcut = function (str) {
if (agent.isMac) {
str = str.replace('CMD', '⌘').replace('SHIFT', '⇧');
}
return str.replace('BACKSLASH', '\\')
.replace('SLASH', '/')
.replace('LEFTBRACKET', '[')
.replace('RIGHTBRACKET', ']');
};
/**
* createTooltip
*
* @param {jQuery} $container
* @param {Object} keyMap
* @param {String} [sPlacement]
*/
var createTooltip = function ($container, keyMap, sPlacement) {
var invertedKeyMap = func.invertObject(keyMap);
var $buttons = $container.find('button');
$buttons.each(function (i, elBtn) {
var $btn = $(elBtn);
var sShortcut = invertedKeyMap[$btn.data('event')];
if (sShortcut) {
$btn.attr('title', function (i, v) {
return v + ' (' + representShortcut(sShortcut) + ')';
});
}
// bootstrap tooltip on btn-group bug
// https://github.com/twbs/bootstrap/issues/5687
}).tooltip({
container: 'body',
trigger: 'hover',
placement: sPlacement || 'top'
}).on('click', function () {
$(this).tooltip('hide');
});
};
// createPalette
var createPalette = function ($container, options) {
var colorInfo = options.colors;
$container.find('.note-color-palette').each(function () {
var $palette = $(this), eventName = $palette.attr('data-target-event');
var paletteContents = [];
for (var row = 0, lenRow = colorInfo.length; row < lenRow; row++) {
var colors = colorInfo[row];
var buttons = [];
for (var col = 0, lenCol = colors.length; col < lenCol; col++) {
var color = colors[col];
buttons.push(['
'].join(''));
}
paletteContents.push('
' + buttons.join('') + '
');
}
$palette.html(paletteContents.join(''));
});
};
/**
* create summernote layout (air mode)
*
* @param {jQuery} $holder
* @param {Object} options
*/
this.createLayoutByAirMode = function ($holder, options) {
var langInfo = options.langInfo;
var keyMap = options.keyMap[agent.isMac ? 'mac' : 'pc'];
var id = func.uniqueId();
$holder.addClass('note-air-editor note-editable panel-body');
$holder.attr({
'id': 'note-editor-' + id,
'contentEditable': true
});
var body = document.body;
// create Popover
var $popover = $(tplPopovers(langInfo, options));
$popover.addClass('note-air-layout');
$popover.attr('id', 'note-popover-' + id);
$popover.appendTo(body);
createTooltip($popover, keyMap);
createPalette($popover, options);
// create Handle
var $handle = $(tplHandles(options));
$handle.addClass('note-air-layout');
$handle.attr('id', 'note-handle-' + id);
$handle.appendTo(body);
// create Dialog
var $dialog = $(tplDialogs(langInfo, options));
$dialog.addClass('note-air-layout');
$dialog.attr('id', 'note-dialog-' + id);
$dialog.find('button.close, a.modal-close').click(function () {
$(this).closest('.modal').modal('hide');
});
$dialog.appendTo(body);
};
/**
* create summernote layout (normal mode)
*
* @param {jQuery} $holder
* @param {Object} options
*/
this.createLayoutByFrame = function ($holder, options) {
var langInfo = options.langInfo;
//01. create Editor
var $editor = $('
');
if (options.width) {
$editor.width(options.width);
}
//02. statusbar (resizebar)
if (options.height > 0) {
$('
' + (options.disableResizeEditor ? '' : tplStatusbar()) + '
').prependTo($editor);
}
//03 editing area
var $editingArea = $('
');
//03. create editable
var isContentEditable = !$holder.is(':disabled');
var $editable = $('
').prependTo($editingArea);
if (options.height) {
$editable.height(options.height);
}
if (options.direction) {
$editable.attr('dir', options.direction);
}
var placeholder = $holder.attr('placeholder') || options.placeholder;
if (placeholder) {
$editable.attr('data-placeholder', placeholder);
}
$editable.html(dom.html($holder) || dom.emptyPara);
//031. create codable
$('
').prependTo($editingArea);
//04. create Popover
var $popover = $(tplPopovers(langInfo, options)).prependTo($editingArea);
createPalette($popover, options);
createTooltip($popover, keyMap);
//05. handle(control selection, ...)
$(tplHandles(options)).prependTo($editingArea);
$editingArea.prependTo($editor);
//06. create Toolbar
var $toolbar = $('
');
for (var idx = 0, len = options.toolbar.length; idx < len; idx ++) {
var groupName = options.toolbar[idx][0];
var groupButtons = options.toolbar[idx][1];
var $group = $('
');
for (var i = 0, btnLength = groupButtons.length; i < btnLength; i++) {
var buttonInfo = tplButtonInfo[groupButtons[i]];
// continue creating toolbar even if a button doesn't exist
if (!$.isFunction(buttonInfo)) { continue; }
var $button = $(buttonInfo(langInfo, options));
$button.attr('data-name', groupButtons[i]); // set button's alias, becuase to get button element from $toolbar
$group.append($button);
}
$toolbar.append($group);
}
var keyMap = options.keyMap[agent.isMac ? 'mac' : 'pc'];
createPalette($toolbar, options);
createTooltip($toolbar, keyMap, 'bottom');
$toolbar.prependTo($editor);
//07. create Dropzone
$('
').prependTo($editor);
//08. create Dialog
var $dialogContainer = options.dialogsInBody ? $(document.body) : $editor;
var $dialog = $(tplDialogs(langInfo, options)).prependTo($dialogContainer);
$dialog.find('button.close, a.modal-close').click(function () {
$(this).closest('.modal').modal('hide');
});
//09. Editor/Holder switch
$editor.insertAfter($holder);
$holder.hide();
};
this.hasNoteEditor = function ($holder) {
return this.noteEditorFromHolder($holder).length > 0;
};
this.noteEditorFromHolder = function ($holder) {
if ($holder.hasClass('note-air-editor')) {
return $holder;
} else if ($holder.next().hasClass('note-editor')) {
return $holder.next();
} else {
return $();
}
};
/**
* create summernote layout
*
* @param {jQuery} $holder
* @param {Object} options
*/
this.createLayout = function ($holder, options) {
if (options.airMode) {
this.createLayoutByAirMode($holder, options);
} else {
this.createLayoutByFrame($holder, options);
}
};
/**
* returns layoutInfo from holder
*
* @param {jQuery} $holder - placeholder
* @return {Object}
*/
this.layoutInfoFromHolder = function ($holder) {
var $editor = this.noteEditorFromHolder($holder);
if (!$editor.length) {
return;
}
// connect $holder to $editor
$editor.data('holder', $holder);
return dom.buildLayoutInfo($editor);
};
/**
* removeLayout
*
* @param {jQuery} $holder - placeholder
* @param {Object} layoutInfo
* @param {Object} options
*
*/
this.removeLayout = function ($holder, layoutInfo, options) {
if (options.airMode) {
$holder.removeClass('note-air-editor note-editable')
.removeAttr('id contentEditable');
layoutInfo.popover().remove();
layoutInfo.handle().remove();
layoutInfo.dialog().remove();
} else {
$holder.html(layoutInfo.editable().html());
if (options.dialogsInBody) {
layoutInfo.dialog().remove();
}
layoutInfo.editor().remove();
$holder.show();
}
};
/**
*
* @return {Object}
* @return {function(label, options=):string} return.button {@link #tplButton function to make text button}
* @return {function(iconClass, options=):string} return.iconButton {@link #tplIconButton function to make icon button}
* @return {function(className, title=, body=, footer=):string} return.dialog {@link #tplDialog function to make dialog}
*/
this.getTemplate = function () {
return {
button: tplButton,
iconButton: tplIconButton,
dialog: tplDialog
};
};
/**
* add button information
*
* @param {String} name button name
* @param {Function} buttonInfo function to make button, reference to {@link #tplButton},{@link #tplIconButton}
*/
this.addButtonInfo = function (name, buttonInfo) {
tplButtonInfo[name] = buttonInfo;
};
/**
*
* @param {String} name
* @param {Function} dialogInfo function to make dialog, reference to {@link #tplDialog}
*/
this.addDialogInfo = function (name, dialogInfo) {
tplDialogInfo[name] = dialogInfo;
};
};
// jQuery namespace for summernote
/**
* @class $.summernote
*
* summernote attribute
*
* @mixin defaults
* @singleton
*
*/
$.summernote = $.summernote || {};
// extends default settings
// - $.summernote.version
// - $.summernote.options
// - $.summernote.lang
$.extend($.summernote, defaults);
var renderer = new Renderer();
var eventHandler = new EventHandler();
$.extend($.summernote, {
/** @property {Renderer} */
renderer: renderer,
/** @property {EventHandler} */
eventHandler: eventHandler,
/**
* @property {Object} core
* @property {core.agent} core.agent
* @property {core.dom} core.dom
* @property {core.range} core.range
*/
core: {
agent: agent,
list : list,
dom: dom,
range: range
},
/**
* @property {Object}
* pluginEvents event list for plugins
* event has name and callback function.
*
* ```
* $.summernote.addPlugin({
* events : {
* 'hello' : function(layoutInfo, value, $target) {
* console.log('event name is hello, value is ' + value );
* }
* }
* })
* ```
*
* * event name is data-event property.
* * layoutInfo is a summernote layout information.
* * value is data-value property.
*/
pluginEvents: {},
plugins : []
});
/**
* @method addPlugin
*
* add Plugin in Summernote
*
* Summernote can make a own plugin.
*
* ### Define plugin
* ```
* // get template function
* var tmpl = $.summernote.renderer.getTemplate();
*
* // add a button
* $.summernote.addPlugin({
* buttons : {
* // "hello" is button's namespace.
* "hello" : function(lang, options) {
* // make icon button by template function
* return tmpl.iconButton(options.iconPrefix + 'header', {
* // callback function name when button clicked
* event : 'hello',
* // set data-value property
* value : 'hello',
* hide : true
* });
* }
*
* },
*
* events : {
* "hello" : function(layoutInfo, value) {
* // here is event code
* }
* }
* });
* ```
* ### Use a plugin in toolbar
*
* ```
* $("#editor").summernote({
* ...
* toolbar : [
* // display hello plugin in toolbar
* ['group', [ 'hello' ]]
* ]
* ...
* });
* ```
*
*
* @param {Object} plugin
* @param {Object} [plugin.buttons] define plugin button. for detail, see to Renderer.addButtonInfo
* @param {Object} [plugin.dialogs] define plugin dialog. for detail, see to Renderer.addDialogInfo
* @param {Object} [plugin.events] add event in $.summernote.pluginEvents
* @param {Object} [plugin.langs] update $.summernote.lang
* @param {Object} [plugin.options] update $.summernote.options
*/
$.summernote.addPlugin = function (plugin) {
// save plugin list
$.summernote.plugins.push(plugin);
if (plugin.buttons) {
$.each(plugin.buttons, function (name, button) {
renderer.addButtonInfo(name, button);
});
}
if (plugin.dialogs) {
$.each(plugin.dialogs, function (name, dialog) {
renderer.addDialogInfo(name, dialog);
});
}
if (plugin.events) {
$.each(plugin.events, function (name, event) {
$.summernote.pluginEvents[name] = event;
});
}
if (plugin.langs) {
$.each(plugin.langs, function (locale, lang) {
if ($.summernote.lang[locale]) {
$.extend($.summernote.lang[locale], lang);
}
});
}
if (plugin.options) {
$.extend($.summernote.options, plugin.options);
}
};
/*
* extend $.fn
*/
$.fn.extend({
/**
* @method
* Initialize summernote
* - create editor layout and attach Mouse and keyboard events.
*
* ```
* $("#summernote").summernote( { options ..} );
* ```
*
* @member $.fn
* @param {Object|String} options reference to $.summernote.options
* @return {this}
*/
summernote: function () {
// check first argument's type
// - {String}: External API call {{module}}.{{method}}
// - {Object}: init options
var type = $.type(list.head(arguments));
var isExternalAPICalled = type === 'string';
var hasInitOptions = type === 'object';
// extend default options with custom user options
var options = hasInitOptions ? list.head(arguments) : {};
options = $.extend({}, $.summernote.options, options);
options.icons = $.extend({}, $.summernote.options.icons, options.icons);
// Include langInfo in options for later use, e.g. for image drag-n-drop
// Setup language info with en-US as default
options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);
// override plugin options
if (!isExternalAPICalled && hasInitOptions) {
for (var i = 0, len = $.summernote.plugins.length; i < len; i++) {
var plugin = $.summernote.plugins[i];
if (options.plugin[plugin.name]) {
$.summernote.plugins[i] = $.extend(true, plugin, options.plugin[plugin.name]);
}
}
}
this.each(function (idx, holder) {
var $holder = $(holder);
// if layout isn't created yet, createLayout and attach events
if (!renderer.hasNoteEditor($holder)) {
renderer.createLayout($holder, options);
var layoutInfo = renderer.layoutInfoFromHolder($holder);
$holder.data('layoutInfo', layoutInfo);
eventHandler.attach(layoutInfo, options);
eventHandler.attachCustomEvent(layoutInfo, options);
}
});
var $first = this.first();
if ($first.length) {
var layoutInfo = renderer.layoutInfoFromHolder($first);
// external API
if (isExternalAPICalled) {
var moduleAndMethod = list.head(list.from(arguments));
var args = list.tail(list.from(arguments));
// TODO now external API only works for editor
var params = [moduleAndMethod, layoutInfo.editable()].concat(args);
return eventHandler.invoke.apply(eventHandler, params);
} else if (options.focus) {
// focus on first editable element for initialize editor
layoutInfo.editable().focus();
}
}
return this;
},
/**
* @method
*
* get the HTML contents of note or set the HTML contents of note.
*
* * get contents
* ```
* var content = $("#summernote").code();
* ```
* * set contents
*
* ```
* $("#summernote").code(html);
* ```
*
* @member $.fn
* @param {String} [html] - HTML contents(optional, set)
* @return {this|String} - context(set) or HTML contents of note(get).
*/
code: function (html) {
// get the HTML contents of note
if (html === undefined) {
var $holder = this.first();
if (!$holder.length) {
return;
}
var layoutInfo = renderer.layoutInfoFromHolder($holder);
var $editable = layoutInfo && layoutInfo.editable();
if ($editable && $editable.length) {
var isCodeview = eventHandler.invoke('codeview.isActivated', layoutInfo);
eventHandler.invoke('codeview.sync', layoutInfo);
return isCodeview ? layoutInfo.codable().val() :
layoutInfo.editable().html();
}
return dom.value($holder);
}
// set the HTML contents of note
this.each(function (i, holder) {
var layoutInfo = renderer.layoutInfoFromHolder($(holder));
var $editable = layoutInfo && layoutInfo.editable();
if ($editable) {
$editable.html(html);
}
});
return this;
},
/**
* @method
*
* destroy Editor Layout and detach Key and Mouse Event
*
* @member $.fn
* @return {this}
*/
destroy: function () {
this.each(function (idx, holder) {
var $holder = $(holder);
if (!renderer.hasNoteEditor($holder)) {
return;
}
var info = renderer.layoutInfoFromHolder($holder);
var options = info.editor().data('options');
eventHandler.detach(info, options);
renderer.removeLayout($holder, info, options);
});
return this;
}
});
}));
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ar-AR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ar-AR': {
font: {
bold: 'عريض',
italic: 'مائل',
underline: 'تحته خط',
clear: 'مسح التنسيق',
height: 'إرتفاع السطر',
name: 'الخط',
strikethrough: 'فى وسطه خط',
size: 'الحجم'
},
image: {
image: 'صورة',
insert: 'إضافة صورة',
resizeFull: 'الحجم بالكامل',
resizeHalf: 'تصغير للنصف',
resizeQuarter: 'تصغير للربع',
floatLeft: 'تطيير لليسار',
floatRight: 'تطيير لليمين',
floatNone: 'ثابته',
dragImageHere: 'إدرج الصورة هنا',
selectFromFiles: 'حدد ملف',
url: 'رابط الصورة',
remove: 'حذف الصورة'
},
link: {
link: 'رابط رابط',
insert: 'إدراج',
unlink: 'حذف الرابط',
edit: 'تعديل',
textToDisplay: 'النص',
url: 'مسار الرابط',
openInNewWindow: 'فتح في نافذة جديدة'
},
table: {
table: 'جدول'
},
hr: {
insert: 'إدراج خط أفقي'
},
style: {
style: 'تنسيق',
normal: 'عادي',
blockquote: 'إقتباس',
pre: 'شفيرة',
h1: 'عنوان رئيسي 1',
h2: 'عنوان رئيسي 2',
h3: 'عنوان رئيسي 3',
h4: 'عنوان رئيسي 4',
h5: 'عنوان رئيسي 5',
h6: 'عنوان رئيسي 6'
},
lists: {
unordered: 'قائمة مُنقطة',
ordered: 'قائمة مُرقمة'
},
options: {
help: 'مساعدة',
fullscreen: 'حجم الشاشة بالكامل',
codeview: 'شفيرة المصدر'
},
paragraph: {
paragraph: 'فقرة',
outdent: 'محاذاة للخارج',
indent: 'محاذاة للداخل',
left: 'محاذاة لليسار',
center: 'توسيط',
right: 'محاذاة لليمين',
justify: 'ملئ السطر'
},
color: {
recent: 'تم إستخدامه',
more: 'المزيد',
background: 'لون الخلفية',
foreground: 'لون النص',
transparent: 'شفاف',
setTransparent: 'بدون خلفية',
reset: 'إعادة الضبط',
resetToDefault: 'إعادة الضبط'
},
shortcut: {
shortcuts: 'إختصارات',
close: 'غلق',
textFormatting: 'تنسيق النص',
action: 'Action',
paragraphFormatting: 'تنسيق الفقرة',
documentStyle: 'تنسيق المستند'
},
history: {
undo: 'تراجع',
redo: 'إعادة'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-bg-BG.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'bg-BG': {
font: {
bold: 'Удебелен',
italic: 'Наклонен',
underline: 'Подчертан',
clear: 'Изчисти стиловете',
height: 'Височина',
name: 'Шрифт',
strikethrough: 'Задраскано',
subscript: 'Долен индекс',
superscript: 'Горен индекс',
size: 'Размер на шрифта'
},
image: {
image: 'Изображение',
insert: 'Постави картинка',
resizeFull: 'Цял размер',
resizeHalf: 'Размер на 50%',
resizeQuarter: 'Размер на 25%',
floatLeft: 'Подравни в ляво',
floatRight: 'Подравни в дясно',
floatNone: 'Без подравняване',
dragImageHere: 'Пуснете изображението тук',
selectFromFiles: 'Изберете файл',
url: 'URL адрес на изображение',
remove: 'Премахни изображение'
},
link: {
link: 'Връзка',
insert: 'Добави връзка',
unlink: 'Премахни връзка',
edit: 'Промени',
textToDisplay: 'Текст за показване',
url: 'URL адрес',
openInNewWindow: 'Отвори в нов прозорец'
},
table: {
table: 'Таблица'
},
hr: {
insert: 'Добави хоризонтална линия'
},
style: {
style: 'Стил',
normal: 'Нормален',
blockquote: 'Цитат',
pre: 'Код',
h1: 'Заглавие 1',
h2: 'Заглавие 2',
h3: 'Заглавие 3',
h4: 'Заглавие 4',
h5: 'Заглавие 5',
h6: 'Заглавие 6'
},
lists: {
unordered: 'Символен списък',
ordered: 'Цифров списък'
},
options: {
help: 'Помощ',
fullscreen: 'На цял екран',
codeview: 'Преглед на код'
},
paragraph: {
paragraph: 'Параграф',
outdent: 'Намаляване на отстъпа',
indent: 'Абзац',
left: 'Подравняване в ляво',
center: 'Център',
right: 'Подравняване в дясно',
justify: 'Разтягане по ширина'
},
color: {
recent: 'Последния избран цвят',
more: 'Още цветове',
background: 'Цвят на фона',
foreground: 'Цвят на шрифта',
transparent: 'Прозрачен',
setTransparent: 'Направете прозрачен',
reset: 'Възстанови',
resetToDefault: 'Възстанови оригиналните'
},
shortcut: {
shortcuts: 'Клавишни комбинации',
close: 'Затвори',
textFormatting: 'Форматиране на текста',
action: 'Действие',
paragraphFormatting: 'Форматиране на параграф',
documentStyle: 'Стил на документа'
},
history: {
undo: 'Назад',
redo: 'Напред'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ca-ES.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ca-ES': {
font: {
bold: 'Negreta',
italic: 'Cursiva',
underline: 'Subratllat',
clear: 'Treure estil de lletra',
height: 'Alçada de línia',
strikethrough: 'Ratllat',
size: 'Mida de lletra'
},
image: {
image: 'Imatge',
insert: 'Inserir imatge',
resizeFull: 'Redimensionar a mida completa',
resizeHalf: 'Redimensionar a la meitat',
resizeQuarter: 'Redimensionar a un quart',
floatLeft: 'Surar a l%27esquerra',
floatRight: 'Surar a la dreta',
floatNone: 'No surar',
dragImageHere: 'Arrossegueu una imatge aquí',
selectFromFiles: 'Seleccioneu des dels arxius',
url: 'URL de la imatge'
},
link: {
link: 'Enllaç',
insert: 'Inserir enllaç',
unlink: 'Treure enllaç',
edit: 'Editar',
textToDisplay: 'Text per mostrar',
url: 'Cap a quina URL porta l\'enllaç?',
openInNewWindow: 'Obrir en una finestra nova'
},
table: {
table: 'Taula'
},
hr: {
insert: 'Inserir línia horitzontal'
},
style: {
style: 'Estil',
normal: 'Normal',
blockquote: 'Cita',
pre: 'Codi',
h1: 'Títol 1',
h2: 'Títol 2',
h3: 'Títol 3',
h4: 'Títol 4',
h5: 'Títol 5',
h6: 'Títol 6'
},
lists: {
unordered: 'Llista desendreçada',
ordered: 'Llista endreçada'
},
options: {
help: 'Ajut',
fullscreen: 'Pantalla sencera',
codeview: 'Veure codi font'
},
paragraph: {
paragraph: 'Paràgraf',
outdent: 'Menys tabulació',
indent: 'Més tabulació',
left: 'Alinear a l\'esquerra',
center: 'Alinear al mig',
right: 'Alinear a la dreta',
justify: 'Justificar'
},
color: {
recent: 'Últim color',
more: 'Més colors',
background: 'Color de fons',
foreground: 'Color de lletra',
transparent: 'Transparent',
setTransparent: 'Establir transparent',
reset: 'Restablir',
resetToDefault: 'Restablir per defecte'
},
shortcut: {
shortcuts: 'Dreceres de teclat',
close: 'Tancar',
textFormatting: 'Format de text',
action: 'Acció',
paragraphFormatting: 'Format de paràgraf',
documentStyle: 'Estil del document'
},
history: {
undo: 'Desfer',
redo: 'Refer'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-cs-CZ.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'cs-CZ': {
font: {
bold: 'Tučné',
italic: 'Kurzíva',
underline: 'Podtržené',
clear: 'Odstranit styl písma',
height: 'Výška řádku',
strikethrough: 'Přeškrtnuté',
size: 'Velikost písma'
},
image: {
image: 'Obrázek',
insert: 'Vložit obrázek',
resizeFull: 'Původní velikost',
resizeHalf: 'Poloviční velikost',
resizeQuarter: 'Čtvrteční velikost',
floatLeft: 'Umístit doleva',
floatRight: 'Umístit doprava',
floatNone: 'Neobtékat textem',
dragImageHere: 'Přetáhnout sem obrázek',
selectFromFiles: 'Vybrat soubor',
url: 'URL obrázku'
},
link: {
link: 'Odkaz',
insert: 'Vytvořit odkaz',
unlink: 'Zrušit odkaz',
edit: 'Upravit',
textToDisplay: 'Zobrazovaný text',
url: 'Na jaké URL má tento odkaz vést?',
openInNewWindow: 'Otevřít v novém okně'
},
table: {
table: 'Tabulka'
},
hr: {
insert: 'Vložit vodorovnou čáru'
},
style: {
style: 'Styl',
normal: 'Normální',
blockquote: 'Citace',
pre: 'Kód',
h1: 'Nadpis 1',
h2: 'Nadpis 2',
h3: 'Nadpis 3',
h4: 'Nadpis 4',
h5: 'Nadpis 5',
h6: 'Nadpis 6'
},
lists: {
unordered: 'Odrážkový seznam',
ordered: 'Číselný seznam'
},
options: {
help: 'Nápověda',
fullscreen: 'Celá obrazovka',
codeview: 'HTML kód'
},
paragraph: {
paragraph: 'Odstavec',
outdent: 'Zvětšit odsazení',
indent: 'Zmenšit odsazení',
left: 'Zarovnat doleva',
center: 'Zarovnat na střed',
right: 'Zarovnat doprava',
justify: 'Zarovnat oboustranně'
},
color: {
recent: 'Aktuální barva',
more: 'Další barvy',
background: 'Barva pozadí',
foreground: 'Barva písma',
transparent: 'Průhlednost',
setTransparent: 'Nastavit průhlednost',
reset: 'Obnovit',
resetToDefault: 'Obnovit výchozí'
},
shortcut: {
shortcuts: 'Klávesové zkratky',
close: 'Zavřít',
textFormatting: 'Formátování textu',
action: 'Akce',
paragraphFormatting: 'Formátování odstavce',
documentStyle: 'Styl dokumentu'
},
history: {
undo: 'Krok vzad',
redo: 'Krok vpřed'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-da-DK.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'da-DK': {
font: {
bold: 'Fed',
italic: 'Kursiv',
underline: 'Understreget',
clear: 'Fjern formatering',
height: 'Højde',
name: 'Skrifttype',
strikethrough: 'Gennemstreget',
subscript: 'Sænket skrift',
superscript: 'Hævet skrift',
size: 'Skriftstørrelse'
},
image: {
image: 'Billede',
insert: 'Indsæt billede',
resizeFull: 'Original størrelse',
resizeHalf: 'Halv størrelse',
resizeQuarter: 'Kvart størrelse',
floatLeft: 'Venstrestillet',
floatRight: 'Højrestillet',
floatNone: 'Fjern formatering',
shapeRounded: 'Form: Runde kanter',
shapeCircle: 'Form: Cirkel',
shapeThumbnail: 'Form: Miniature',
shapeNone: 'Form: Ingen',
dragImageHere: 'Træk billede hertil',
dropImage: 'Slip billede',
selectFromFiles: 'Vælg billed-fil',
maximumFileSize: 'Maks fil størrelse',
maximumFileSizeError: 'Filen er større end maks tilladte fil størrelse!',
url: 'Billede URL',
remove: 'Fjern billede'
},
link: {
link: 'Link',
insert: 'Indsæt link',
unlink: 'Fjern link',
edit: 'Rediger',
textToDisplay: 'Visningstekst',
url: 'Hvor skal linket pege hen?',
openInNewWindow: 'Åbn i nyt vindue'
},
table: {
table: 'Tabel'
},
hr: {
insert: 'Indsæt horisontal linje'
},
style: {
style: 'Stil',
normal: 'Normal',
blockquote: 'Citat',
pre: 'Kode',
h1: 'Overskrift 1',
h2: 'Overskrift 2',
h3: 'Overskrift 3',
h4: 'Overskrift 4',
h5: 'Overskrift 5',
h6: 'Overskrift 6'
},
lists: {
unordered: 'Punktopstillet liste',
ordered: 'Nummereret liste'
},
options: {
help: 'Hjælp',
fullscreen: 'Fuld skærm',
codeview: 'HTML-Visning'
},
paragraph: {
paragraph: 'Afsnit',
outdent: 'Formindsk indryk',
indent: 'Forøg indryk',
left: 'Venstrestillet',
center: 'Centreret',
right: 'Højrestillet',
justify: 'Blokjuster'
},
color: {
recent: 'Nyligt valgt farve',
more: 'Flere farver',
background: 'Baggrund',
foreground: 'Forgrund',
transparent: 'Transparent',
setTransparent: 'Sæt transparent',
reset: 'Nulstil',
resetToDefault: 'Gendan standardindstillinger'
},
shortcut: {
shortcuts: 'Genveje',
close: 'Luk',
textFormatting: 'Tekstformatering',
action: 'Handling',
paragraphFormatting: 'Afsnitsformatering',
documentStyle: 'Dokumentstil'
},
history: {
undo: 'Fortryd',
redo: 'Annuller fortryd'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-de-DE.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'de-DE': {
font: {
bold: 'Fett',
italic: 'Kursiv',
underline: 'Unterstreichen',
clear: 'Zurücksetzen',
height: 'Zeilenhöhe',
strikethrough: 'Durchgestrichen',
size: 'Schriftgröße'
},
image: {
image: 'Grafik',
insert: 'Grafik einfügen',
resizeFull: 'Originalgröße',
resizeHalf: 'Größe 1/2',
resizeQuarter: 'Größe 1/4',
floatLeft: 'Linksbündig',
floatRight: 'Rechtsbündig',
floatNone: 'Kein Textfluss',
shapeRounded: 'Rahmen: Abgerundet',
shapeCircle: 'Rahmen: Kreisförmig',
shapeThumbnail: 'Rahmen: Thumbnail',
shapeNone: 'Kein Rahmen',
dragImageHere: 'Ziehen Sie ein Bild mit der Maus hierher',
selectFromFiles: 'Wählen Sie eine Datei aus',
maximumFileSize: 'Maximale Dateigröße',
maximumFileSizeError: 'Maximale Dateigröße überschritten',
url: 'Grafik URL',
remove: 'Grafik entfernen'
},
link: {
link: 'Link',
insert: 'Link einfügen',
unlink: 'Link entfernen',
edit: 'Editieren',
textToDisplay: 'Anzeigetext',
url: 'Ziel des Links?',
openInNewWindow: 'In einem neuen Fenster öffnen'
},
table: {
table: 'Tabelle'
},
hr: {
insert: 'Eine horizontale Linie einfügen'
},
style: {
style: 'Stil',
normal: 'Normal',
blockquote: 'Zitat',
pre: 'Quellcode',
h1: 'Überschrift 1',
h2: 'Überschrift 2',
h3: 'Überschrift 3',
h4: 'Überschrift 4',
h5: 'Überschrift 5',
h6: 'Überschrift 6'
},
lists: {
unordered: 'Aufzählung',
ordered: 'Nummerierung'
},
options: {
help: 'Hilfe',
fullscreen: 'Vollbild',
codeview: 'HTML-Code anzeigen'
},
paragraph: {
paragraph: 'Absatz',
outdent: 'Einzug vergrößern',
indent: 'Einzug verkleinern',
left: 'Links ausrichten',
center: 'Zentriert ausrichten',
right: 'Rechts ausrichten',
justify: 'Blocksatz'
},
color: {
recent: 'Letzte Farbe',
more: 'Mehr Farben',
background: 'Hintergrundfarbe',
foreground: 'Schriftfarbe',
transparent: 'Transparenz',
setTransparent: 'Transparenz setzen',
reset: 'Zurücksetzen',
resetToDefault: 'Auf Standard zurücksetzen'
},
shortcut: {
shortcuts: 'Tastenkürzel',
close: 'Schließen',
textFormatting: 'Textformatierung',
action: 'Aktion',
paragraphFormatting: 'Absatzformatierung',
documentStyle: 'Dokumentenstil'
},
history: {
undo: 'Rückgängig',
redo: 'Wiederholen'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-es-ES.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'es-ES': {
font: {
bold: 'Negrita',
italic: 'Cursiva',
underline: 'Subrayado',
clear: 'Quitar estilo de fuente',
height: 'Altura de línea',
name: 'Fuente',
strikethrough: 'Tachado',
superscript: 'Superíndice',
subscript: 'Subíndice',
size: 'Tamaño de la fuente'
},
image: {
image: 'Imagen',
insert: 'Insertar imagen',
resizeFull: 'Redimensionar a tamaño completo',
resizeHalf: 'Redimensionar a la mitad',
resizeQuarter: 'Redimensionar a un cuarto',
floatLeft: 'Flotar a la izquierda',
floatRight: 'Flotar a la derecha',
floatNone: 'No flotar',
dragImageHere: 'Arrastrar una imagen aquí',
selectFromFiles: 'Seleccionar desde los archivos',
url: 'URL de la imagen'
},
link: {
link: 'Link',
insert: 'Insertar link',
unlink: 'Quitar link',
edit: 'Editar',
textToDisplay: 'Texto para mostrar',
url: '¿Hacia que URL lleva el link?',
openInNewWindow: 'Abrir en una nueva ventana'
},
table: {
table: 'Tabla'
},
hr: {
insert: 'Insertar línea horizontal'
},
style: {
style: 'Estilo',
normal: 'Normal',
blockquote: 'Cita',
pre: 'Código',
h1: 'Título 1',
h2: 'Título 2',
h3: 'Título 3',
h4: 'Título 4',
h5: 'Título 5',
h6: 'Título 6'
},
lists: {
unordered: 'Lista desordenada',
ordered: 'Lista ordenada'
},
options: {
help: 'Ayuda',
fullscreen: 'Pantalla completa',
codeview: 'Ver código fuente'
},
paragraph: {
paragraph: 'Párrafo',
outdent: 'Menos tabulación',
indent: 'Más tabulación',
left: 'Alinear a la izquierda',
center: 'Alinear al centro',
right: 'Alinear a la derecha',
justify: 'Justificar'
},
color: {
recent: 'Último color',
more: 'Más colores',
background: 'Color de fondo',
foreground: 'Color de fuente',
transparent: 'Transparente',
setTransparent: 'Establecer transparente',
reset: 'Restaurar',
resetToDefault: 'Restaurar por defecto'
},
shortcut: {
shortcuts: 'Atajos de teclado',
close: 'Cerrar',
textFormatting: 'Formato de texto',
action: 'Acción',
paragraphFormatting: 'Formato de párrafo',
documentStyle: 'Estilo de documento'
},
history: {
undo: 'Deshacer',
redo: 'Rehacer'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-es-EU.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'es-EU': {
font: {
bold: 'Lodia',
italic: 'Etzana',
underline: 'Azpimarratua',
clear: 'Estiloa kendu',
height: 'Lerro altuera',
name: 'Tipografia',
strikethrough: 'Marratua',
size: 'Letren neurria'
},
image: {
image: 'Irudia',
insert: 'Irudi bat txertatu',
resizeFull: 'Jatorrizko neurrira aldatu',
resizeHalf: 'Neurria erdira aldatu',
resizeQuarter: 'Neurria laurdenera aldatu',
floatLeft: 'Ezkerrean kokatu',
floatRight: 'Eskuinean kokatu',
floatNone: 'Kokapenik ez ezarri',
dragImageHere: 'Irudi bat ezarri hemen',
selectFromFiles: 'Zure fitxategi bat aukeratu',
url: 'Irudiaren URL helbidea'
},
link: {
link: 'Esteka',
insert: 'Esteka bat txertatu',
unlink: 'Esteka ezabatu',
edit: 'Editatu',
textToDisplay: 'Estekaren testua',
url: 'Estekaren URL helbidea',
openInNewWindow: 'Leiho berri batean ireki'
},
table: {
table: 'Taula' //Tabla
},
hr: {
insert: 'Marra horizontala txertatu' //Insertar línea horizontal
},
style: {
style: 'Estiloa',
normal: 'Normal',
blockquote: 'Aipamena',
pre: 'Kodea',
h1: '1. izenburua',
h2: '2. izenburua',
h3: '3. izenburua',
h4: '4. izenburua',
h5: '5. izenburua',
h6: '6. izenburua'
},
lists: {
unordered: 'Ordenatu gabeko zerrenda',
ordered: 'Zerrenda ordenatua'
},
options: {
help: 'Laguntza',
fullscreen: 'Pantaila osoa',
codeview: 'Kodea ikusi'
},
paragraph: {
paragraph: 'Paragrafoa',
outdent: 'Koska txikiagoa',
indent: 'Koska handiagoa',
left: 'Ezkerrean kokatu',
center: 'Erdian kokatu',
right: 'Eskuinean kokatu',
justify: 'Justifikatu'
},
color: {
recent: 'Azken kolorea',
more: 'Kolore gehiago',
background: 'Atzeko planoa',
foreground: 'Aurreko planoa',
transparent: 'Gardena',
setTransparent: 'Gardendu',
reset: 'Lehengoratu',
resetToDefault: 'Berrezarri lehenetsia'
},
shortcut: {
shortcuts: 'Lasterbideak',
close: 'Itxi',
textFormatting: 'Testuaren formatua',
action: 'Ekintza',
paragraphFormatting: 'Paragrafoaren formatua',
documentStyle: 'Dokumentuaren estiloa'
},
history: {
undo: 'Desegin',
redo: 'Berregin'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-fa-IR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'fa-IR': {
font: {
bold: 'درشت',
italic: 'خمیده',
underline: 'میان خط',
clear: 'پاک کردن فرمت فونت',
height: 'فاصله ی خطی',
name: 'اسم فونت',
strikethrough: 'Strike',
size: 'اندازه ی فونت'
},
image: {
image: 'تصویر',
insert: 'وارد کردن تصویر',
resizeFull: 'تغییر به اندازه ی کامل',
resizeHalf: 'تغییر به اندازه نصف',
resizeQuarter: 'تغییر به اندازه یک چهارم',
floatLeft: 'چسباندن به چپ',
floatRight: 'چسباندن به راست',
floatNone: 'بدون چسبندگی',
dragImageHere: 'یک تصویر را اینجا بکشید',
selectFromFiles: 'فایل ها را انتخاب کنید',
url: 'آدرس تصویر',
remove: 'حذف تصویر'
},
link: {
link: 'لینک',
insert: 'اضافه کردن لینک',
unlink: 'حذف لینک',
edit: 'ویرایش',
textToDisplay: 'متن جهت نمایش',
url: 'این لینک به چه آدرسی باید برود ؟',
openInNewWindow: 'در یک پنجره ی جدید باز شود'
},
table: {
table: 'جدول'
},
hr: {
insert: 'افزودن خط افقی'
},
style: {
style: 'استیل',
normal: 'نرمال',
blockquote: 'نقل قول',
pre: 'کد',
h1: 'سرتیتر 1',
h2: 'سرتیتر 2',
h3: 'سرتیتر 3',
h4: 'سرتیتر 4',
h5: 'سرتیتر 5',
h6: 'سرتیتر 6'
},
lists: {
unordered: 'لیست غیر ترتیبی',
ordered: 'لیست ترتیبی'
},
options: {
help: 'راهنما',
fullscreen: 'نمایش تمام صفحه',
codeview: 'مشاهده ی کد'
},
paragraph: {
paragraph: 'پاراگراف',
outdent: 'کاهش تو رفتگی',
indent: 'افزایش تو رفتگی',
left: 'چپ چین',
center: 'میان چین',
right: 'راست چین',
justify: 'بلوک چین'
},
color: {
recent: 'رنگ اخیرا استفاده شده',
more: 'رنگ بیشتر',
background: 'رنگ پس زمینه',
foreground: 'رنگ متن',
transparent: 'بی رنگ',
setTransparent: 'تنظیم حالت بی رنگ',
reset: 'بازنشاندن',
resetToDefault: 'حالت پیش فرض'
},
shortcut: {
shortcuts: 'دکمه های میان بر',
close: 'بستن',
textFormatting: 'فرمت متن',
action: 'عملیات',
paragraphFormatting: 'فرمت پاراگراف',
documentStyle: 'استیل سند'
},
history: {
undo: 'واچیدن',
redo: 'بازچیدن'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-fi-FI.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'fi-FI': {
font: {
bold: 'Lihavoitu',
italic: 'Kursiivi',
underline: 'Alleviivaa',
clear: 'Tyhjennä muotoilu',
height: 'Riviväli',
name: 'Kirjasintyyppi',
strikethrough: 'Yliviivaus',
size: 'Kirjasinkoko'
},
image: {
image: 'Kuva',
insert: 'Lisää kuva',
resizeFull: 'Koko leveys',
resizeHalf: 'Puolikas leveys',
resizeQuarter: 'Neljäsosa leveys',
floatLeft: 'Sijoita vasemmalle',
floatRight: 'Sijoita oikealle',
floatNone: 'Ei sijoitusta',
dragImageHere: 'Vedä kuva tähän',
selectFromFiles: 'Valitse tiedostoista',
url: 'URL-osoitteen mukaan',
remove: 'Poista kuva'
},
link: {
link: 'Linkki',
insert: 'Lisää linkki',
unlink: 'Poista linkki',
edit: 'Muokkaa',
textToDisplay: 'Näytettävä teksti',
url: 'Linkin URL-osoite?',
openInNewWindow: 'Avaa uudessa ikkunassa'
},
table: {
table: 'Taulukko'
},
hr: {
insert: 'Lisää vaakaviiva'
},
style: {
style: 'Tyyli',
normal: 'Normaali',
blockquote: 'Lainaus',
pre: 'Koodi',
h1: 'Otsikko 1',
h2: 'Otsikko 2',
h3: 'Otsikko 3',
h4: 'Otsikko 4',
h5: 'Otsikko 5',
h6: 'Otsikko 6'
},
lists: {
unordered: 'Luettelomerkitty luettelo',
ordered: 'Numeroitu luettelo'
},
options: {
help: 'Ohje',
fullscreen: 'Koko näyttö',
codeview: 'HTML-näkymä'
},
paragraph: {
paragraph: 'Kappale',
outdent: 'Pienennä sisennystä',
indent: 'Suurenna sisennystä',
left: 'Tasaus vasemmalle',
center: 'Keskitä',
right: 'Tasaus oikealle',
justify: 'Tasaa'
},
color: {
recent: 'Viimeisin väri',
more: 'Lisää värejä',
background: 'Taustaväri',
foreground: 'Tekstin väri',
transparent: 'Läpinäkyvä',
setTransparent: 'Aseta läpinäkyväksi',
reset: 'Palauta',
resetToDefault: 'Palauta oletusarvoksi'
},
shortcut: {
shortcuts: 'Pikanäppäimet',
close: 'Sulje',
textFormatting: 'Tekstin muotoilu',
action: 'Toiminto',
paragraphFormatting: 'Kappaleen muotoilu',
documentStyle: 'Asiakirjan tyyli'
},
history: {
undo: 'Kumoa',
redo: 'Toista'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-fr-FR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'fr-FR': {
font: {
bold: 'Gras',
italic: 'Italique',
underline: 'Souligné',
clear: 'Effacer la mise en forme',
height: 'Interligne',
name: 'Famille de police',
strikethrough: 'Barré',
superscript: 'Exposant',
subscript: 'Indice',
size: 'Taille de police'
},
image: {
image: 'Image',
insert: 'Insérer une image',
resizeFull: 'Taille originale',
resizeHalf: 'Redimensionner à 50 %',
resizeQuarter: 'Redimensionner à 25 %',
floatLeft: 'Aligné à gauche',
floatRight: 'Aligné à droite',
floatNone: 'Pas d\'alignement',
shapeRounded: 'Forme: Rectangle arrondie',
shapeCircle: 'Forme: Cercle',
shapeThumbnail: 'Forme: Vignette',
shapeNone: 'Forme: Aucune',
dragImageHere: 'Faites glisser une image ou un texte dans ce cadre',
dropImage: 'Lachez l\'image ou le texte',
selectFromFiles: 'Choisir un fichier',
maximumFileSize: 'Taille de fichier maximale',
maximumFileSizeError: 'Taille maximale du fichier dépassée',
url: 'URL de l\'image',
remove: 'Supprimer l\'image'
},
link: {
link: 'Lien',
insert: 'Insérer un lien',
unlink: 'Supprimer un lien',
edit: 'Modifier',
textToDisplay: 'Texte à afficher',
url: 'URL du lien',
openInNewWindow: 'Ouvrir dans une nouvelle fenêtre'
},
table: {
table: 'Tableau'
},
hr: {
insert: 'Insérer une ligne horizontale'
},
style: {
style: 'Style',
normal: 'Normal',
blockquote: 'Citation',
pre: 'Code source',
h1: 'Titre 1',
h2: 'Titre 2',
h3: 'Titre 3',
h4: 'Titre 4',
h5: 'Titre 5',
h6: 'Titre 6'
},
lists: {
unordered: 'Liste à puces',
ordered: 'Liste numérotée'
},
options: {
help: 'Aide',
fullscreen: 'Plein écran',
codeview: 'Afficher le code HTML'
},
paragraph: {
paragraph: 'Paragraphe',
outdent: 'Diminuer le retrait',
indent: 'Augmenter le retrait',
left: 'Aligner à gauche',
center: 'Centrer',
right: 'Aligner à droite',
justify: 'Justifier'
},
color: {
recent: 'Dernière couleur sélectionnée',
more: 'Plus de couleurs',
background: 'Couleur de fond',
foreground: 'Couleur de police',
transparent: 'Transparent',
setTransparent: 'Définir la transparence',
reset: 'Restaurer',
resetToDefault: 'Restaurer la couleur par défaut'
},
shortcut: {
shortcuts: 'Raccourcis',
close: 'Fermer',
textFormatting: 'Mise en forme du texte',
action: 'Action',
paragraphFormatting: 'Mise en forme des paragraphes',
documentStyle: 'Style du document',
extraKeys: 'Touches supplémentaires'
},
history: {
undo: 'Annuler la dernière action',
redo: 'Restaurer la dernière action annulée'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-he-IL.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'he-IL': {
font: {
bold: 'מודגש',
italic: 'נטוי',
underline: 'קו תחתון',
clear: 'נקה עיצוב',
height: 'גובה',
name: 'גופן',
strikethrough: 'קו חוצה',
subscript: 'כתב תחתי',
superscript: 'כתב עילי',
size: 'גודל גופן'
},
image: {
image: 'תמונה',
insert: 'הוסף תמונה',
resizeFull: 'גודל מלא',
resizeHalf: 'להקטין לחצי',
resizeQuarter: 'להקטין לרבע',
floatLeft: 'יישור לשמאל',
floatRight: 'יישור לימין',
floatNone: 'ישר',
dragImageHere: 'גרור תמונה לכאן',
selectFromFiles: 'בחר מתוך קבצים',
url: 'נתיב לתמונה',
remove: 'הסר תמונה'
},
link: {
link: 'קישור',
insert: 'הוסף קישור',
unlink: 'הסר קישור',
edit: 'ערוך',
textToDisplay: 'טקסט להציג',
url: 'קישור',
openInNewWindow: 'פתח בחלון חדש'
},
table: {
table: 'טבלה'
},
hr: {
insert: 'הוסף קו'
},
style: {
style: 'עיצוב',
normal: 'טקסט רגיל',
blockquote: 'ציטוט',
pre: 'קוד',
h1: 'כותרת 1',
h2: 'כותרת 2',
h3: 'כותרת 3',
h4: 'כותרת 4',
h5: 'כותרת 5',
h6: 'כותרת 6'
},
lists: {
unordered: 'רשימת תבליטים',
ordered: 'רשימה ממוספרת'
},
options: {
help: 'עזרה',
fullscreen: 'מסך מלא',
codeview: 'תצוגת קוד'
},
paragraph: {
paragraph: 'פסקה',
outdent: 'הקטן כניסה',
indent: 'הגדל כניסה',
left: 'יישור לשמאל',
center: 'יישור למרכז',
right: 'יישור לימין',
justify: 'מיושר'
},
color: {
recent: 'צבע טקסט אחרון',
more: 'עוד צבעים',
background: 'צבע רקע',
foreground: 'צבע טקסט',
transparent: 'שקוף',
setTransparent: 'קבע כשקוף',
reset: 'איפוס',
resetToDefault: 'אפס לברירת מחדל'
},
shortcut: {
shortcuts: 'קיצורי מקלדת',
close: 'סגור',
textFormatting: 'עיצוב הטקסט',
action: 'פעולה',
paragraphFormatting: 'סגנונות פסקה',
documentStyle: 'עיצוב המסמך',
extraKeys: 'קיצורים נוספים'
},
history: {
undo: 'בטל פעולה',
redo: 'בצע שוב'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-hu-HU.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'hu-HU': {
font: {
bold: 'Félkövér',
italic: 'Dőlt',
underline: 'Aláhúzott',
clear: 'Formázás törlése',
height: 'Sorköz',
name: 'Betűtípus',
strikethrough: 'Áthúzott',
size: 'Betűméret'
},
image: {
image: 'Kép',
insert: 'Kép beszúrása',
resizeFull: 'Átméretezés teljes méretre',
resizeHalf: 'Átméretezés felére',
resizeQuarter: 'Átméretezés negyedére',
floatLeft: 'Igazítás balra',
floatRight: 'Igazítás jobbra',
floatNone: 'Igazítás törlése',
dragImageHere: 'Ide húzhatod a képet',
selectFromFiles: 'Fájlok kiválasztása',
url: 'Kép URL címe',
remove: 'Kép törlése'
},
link: {
link: 'Hivatkozás',
insert: 'Hivatkozás beszúrása',
unlink: 'Hivatkozás megszüntetése',
edit: 'Szerkesztés',
textToDisplay: 'Megjelenítendő szöveg',
url: 'Milyen URL címre hivatkozzon?',
openInNewWindow: 'Megnyitás új ablakban'
},
table: {
table: 'Táblázat'
},
hr: {
insert: 'Elválasztó vonal beszúrása'
},
style: {
style: 'Stílus',
normal: 'Normál',
blockquote: 'Idézet',
pre: 'Kód',
h1: 'Fejléc 1',
h2: 'Fejléc 2',
h3: 'Fejléc 3',
h4: 'Fejléc 4',
h5: 'Fejléc 5',
h6: 'Fejléc 6'
},
lists: {
unordered: 'Listajeles lista',
ordered: 'Számozott lista'
},
options: {
help: 'Súgó',
fullscreen: 'Teljes képernyő',
codeview: 'Kód nézet'
},
paragraph: {
paragraph: 'Bekezdés',
outdent: 'Behúzás csökkentése',
indent: 'Behúzás növelése',
left: 'Igazítás balra',
center: 'Igazítás középre',
right: 'Igazítás jobbra',
justify: 'Sorkizárt'
},
color: {
recent: 'Jelenlegi szín',
more: 'További színek',
background: 'Háttérszín',
foreground: 'Betűszín',
transparent: 'Átlátszó',
setTransparent: 'Átlászóság beállítása',
reset: 'Visszaállítás',
resetToDefault: 'Alaphelyzetbe állítás'
},
shortcut: {
shortcuts: 'Gyorsbillentyű',
close: 'Bezárás',
textFormatting: 'Szöveg formázása',
action: 'Művelet',
paragraphFormatting: 'Bekezdés formázása',
documentStyle: 'Dokumentumstílus'
},
history: {
undo: 'Visszavonás',
redo: 'Újra'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-id-ID.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'id-ID': {
font: {
bold: 'Tebal',
italic: 'Miring',
underline: 'Garis bawah',
clear: 'Bersihkan gaya',
height: 'Jarak baris',
strikethrough: 'Coret',
size: 'Ukuran font'
},
image: {
image: 'Gambar',
insert: 'Sisipkan gambar',
resizeFull: 'Ukuran penuh',
resizeHalf: 'Ukuran 50%',
resizeQuarter: 'Ukuran 25%',
floatLeft: 'Rata kiri',
floatRight: 'Rata kanan',
floatNone: 'Tidak ada perataan',
dragImageHere: 'Tarik gambar pada area ini',
selectFromFiles: 'Pilih gambar dari berkas',
url: 'URL gambar',
remove: 'Hapus Gambar'
},
link: {
link: 'Tautan',
insert: 'Tambah tautan',
unlink: 'Hapus tautan',
edit: 'Edit',
textToDisplay: 'Tampilan teks',
url: 'Tautan tujuan',
openInNewWindow: 'Buka di jendela baru'
},
table: {
table: 'Tabel'
},
hr: {
insert: 'Masukkan garis horizontal'
},
style: {
style: 'Gaya',
normal: 'Normal',
blockquote: 'Kutipan',
pre: 'Kode',
h1: 'Heading 1',
h2: 'Heading 2',
h3: 'Heading 3',
h4: 'Heading 4',
h5: 'Heading 5',
h6: 'Heading 6'
},
lists: {
unordered: 'Pencacahan',
ordered: 'Penomoran'
},
options: {
help: 'Bantuan',
fullscreen: 'Layar penuh',
codeview: 'Kode HTML'
},
paragraph: {
paragraph: 'Paragraf',
outdent: 'Outdent',
indent: 'Indent',
left: 'Rata kiri',
center: 'Rata tengah',
right: 'Rata kanan',
justify: 'Rata kanan kiri'
},
color: {
recent: 'Warna sekarang',
more: 'Selengkapnya',
background: 'Warna latar',
foreground: 'Warna font',
transparent: 'Transparan',
setTransparent: 'Atur transparansi',
reset: 'Atur ulang',
resetToDefault: 'Kembalikan kesemula'
},
shortcut: {
shortcuts: 'Jalan pintas',
close: 'Keluar',
textFormatting: 'Format teks',
action: 'Aksi',
paragraphFormatting: 'Format paragraf',
documentStyle: 'Gaya dokumen'
},
history: {
undo: 'Kembali',
redo: 'Ulang'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-it-IT.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'it-IT': {
font: {
bold: 'Testo in grassetto',
italic: 'Testo in corsivo',
underline: 'Testo sottolineato',
clear: 'Elimina la formattazione del testo',
height: 'Altezza della linea di testo',
name: 'Famiglia Font',
strikethrough: 'Testo barrato',
size: 'Dimensione del carattere'
},
image: {
image: 'Immagine',
insert: 'Inserisci Immagine',
resizeFull: 'Dimensioni originali',
resizeHalf: 'Ridimensiona al 50%',
resizeQuarter: 'Ridimensiona al 25%',
floatLeft: 'Posiziona a sinistra',
floatRight: 'Posiziona a destra',
floatNone: 'Nessun posizionamento',
dragImageHere: 'Trascina qui un\'immagine',
selectFromFiles: 'Scegli dai Documenti',
url: 'URL dell\'immagine',
remove: 'Rimuovi immagine'
},
link: {
link: 'Collegamento',
insert: 'Inserisci Collegamento',
unlink: 'Elimina collegamento',
edit: 'Modifica collegamento',
textToDisplay: 'Testo del collegamento',
url: 'URL del collegamento',
openInNewWindow: 'Apri in una nuova finestra'
},
table: {
table: 'Tabella'
},
hr: {
insert: 'Inserisce una linea di separazione'
},
style: {
style: 'Stili',
normal: 'Normale',
blockquote: 'Citazione',
pre: 'Codice',
h1: 'Titolo 1',
h2: 'Titolo 2',
h3: 'Titolo 3',
h4: 'Titolo 4',
h5: 'Titolo 5',
h6: 'Titolo 6'
},
lists: {
unordered: 'Elenco non ordinato',
ordered: 'Elenco ordinato'
},
options: {
help: 'Aiuto',
fullscreen: 'Modalità a tutto schermo',
codeview: 'Visualizza codice'
},
paragraph: {
paragraph: 'Paragrafo',
outdent: 'Diminuisce il livello di rientro',
indent: 'Aumenta il livello di rientro',
left: 'Allinea a sinistra',
center: 'Centra',
right: 'Allinea a destra',
justify: 'Giustifica (allinea a destra e sinistra)'
},
color: {
recent: 'Ultimo colore utilizzato',
more: 'Altri colori',
background: 'Colore di sfondo',
foreground: 'Colore',
transparent: 'Trasparente',
setTransparent: 'Trasparente',
reset: 'Reimposta',
resetToDefault: 'Reimposta i colori'
},
shortcut: {
shortcuts: 'Scorciatoie da tastiera',
close: 'Chiudi',
textFormatting: 'Formattazione testo',
action: 'Azioni',
paragraphFormatting: 'Formattazione paragrafo',
documentStyle: 'Stili'
},
history: {
undo: 'Annulla',
redo: 'Ripristina'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ja-JP.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ja-JP': {
font: {
bold: '太字',
italic: '斜体',
underline: '下線',
clear: 'クリア',
height: '文字高',
name: 'フォント',
strikethrough: '取り消し線',
size: '大きさ'
},
image: {
image: '画像',
insert: '画像挿入',
resizeFull: '最大化',
resizeHalf: '1/2',
resizeQuarter: '1/4',
floatLeft: '左寄せ',
floatRight: '右寄せ',
floatNone: '寄せ解除',
dragImageHere: 'ここに画像をドラッグしてください',
selectFromFiles: '画像ファイルを選ぶ',
url: 'URLから画像を挿入する',
remove: '画像を削除する'
},
link: {
link: 'リンク',
insert: 'リンク挿入',
unlink: 'リンク解除',
edit: '編集',
textToDisplay: 'リンク文字列',
url: 'URLを入力してください',
openInNewWindow: '新しいウィンドウで開く'
},
table: {
table: 'テーブル'
},
hr: {
insert: '水平線の挿入'
},
style: {
style: 'スタイル',
normal: '標準',
blockquote: '引用',
pre: 'コード',
h1: '見出し1',
h2: '見出し2',
h3: '見出し3',
h4: '見出し4',
h5: '見出し5',
h6: '見出し6'
},
lists: {
unordered: '通常リスト',
ordered: '番号リスト'
},
options: {
help: 'ヘルプ',
fullscreen: 'フルスクリーン',
codeview: 'コード表示'
},
paragraph: {
paragraph: '文章',
outdent: '字上げ',
indent: '字下げ',
left: '左寄せ',
center: '中央寄せ',
right: '右寄せ',
justify: '均等割付'
},
color: {
recent: '現在の色',
more: 'もっと見る',
background: '背景色',
foreground: '文字色',
transparent: '透過率',
setTransparent: '透過率を設定',
reset: '標準',
resetToDefault: '標準に戻す'
},
shortcut: {
shortcuts: 'ショートカット',
close: '閉じる',
textFormatting: '文字フォーマット',
action: 'アクション',
paragraphFormatting: '文章フォーマット',
documentStyle: 'ドキュメント形式'
},
history: {
undo: '元に戻す',
redo: 'やり直す'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ko-KR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ko-KR': {
font: {
bold: '굵게',
italic: '기울임꼴',
underline: '밑줄',
clear: '글자 효과 없애기',
height: '줄간격',
name: '글꼴',
superscript: '위 첨자',
subscript: '아래 첨자',
strikethrough: '취소선',
size: '글자 크기'
},
image: {
image: '사진',
insert: '사진 추가',
resizeFull: '원본 크기로 변경',
resizeHalf: '50% 크기로 변경',
resizeQuarter: '25% 크기로 변경',
floatLeft: '왼쪽 정렬',
floatRight: '오른쪽 정렬',
floatNone: '정렬하지 않음',
shapeRounded: '스타일: 둥근 모서리',
shapeCircle: '스타일: 원형',
shapeThumbnail: '스타일: 액자',
shapeNone: '스타일: 없음',
dragImageHere: '사진을 이곳으로 끌어오세요',
selectFromFiles: '파일 선택',
url: '사진 URL',
remove: '사진 삭제'
},
link: {
link: '링크',
insert: '링크 추가',
unlink: '링크 삭제',
edit: '수정',
textToDisplay: '링크에 표시할 내용',
url: '이동할 URL',
openInNewWindow: '새창으로 열기'
},
table: {
table: '테이블'
},
hr: {
insert: '구분선 추가'
},
style: {
style: '스타일',
normal: '본문',
blockquote: '인용구',
pre: '코드',
h1: '제목 1',
h2: '제목 2',
h3: '제목 3',
h4: '제목 4',
h5: '제목 5',
h6: '제목 6'
},
lists: {
unordered: '글머리 기호',
ordered: '번호 매기기'
},
options: {
help: '도움말',
fullscreen: '전체 화면',
codeview: '코드 보기'
},
paragraph: {
paragraph: '문단 정렬',
outdent: '내어쓰기',
indent: '들여쓰기',
left: '왼쪽 정렬',
center: '가운데 정렬',
right: '오른쪽 정렬',
justify: '양쪽 정렬'
},
color: {
recent: '마지막으로 사용한 색',
more: '다른 색 선택',
background: '배경색',
foreground: '글자색',
transparent: '투명',
setTransparent: '투명',
reset: '취소',
resetToDefault: '기본 값으로 변경'
},
shortcut: {
shortcuts: '키보드 단축키',
close: '닫기',
textFormatting: '글자 스타일 적용',
action: '기능',
paragraphFormatting: '문단 스타일 적용',
documentStyle: '문서 스타일 적용'
},
history: {
undo: '실행 취소',
redo: '다시 실행'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-lt-LT.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'lt-LT': {
font: {
bold: 'Paryškintas',
italic: 'Kursyvas',
underline: 'Pabrėžtas',
clear: 'Be formatavimo',
height: 'Eilutės aukštis',
name: 'Šrifto pavadinimas',
strikethrough: 'Perbrauktas',
superscript: 'Viršutinis',
subscript: 'Indeksas',
size: 'Šrifto dydis'
},
image: {
image: 'Paveikslėlis',
insert: 'Įterpti paveikslėlį',
resizeFull: 'Pilnas dydis',
resizeHalf: 'Sumažinti dydį 50%',
resizeQuarter: 'Sumažinti dydį 25%',
floatLeft: 'Kairinis lygiavimas',
floatRight: 'Dešininis lygiavimas',
floatNone: 'Jokio lygiavimo',
shapeRounded: 'Forma: apvalūs kraštai',
shapeCircle: 'Forma: apskritimas',
shapeThumbnail: 'Forma: miniatiūra',
shapeNone: 'Forma: jokia',
dragImageHere: 'Vilkite paveikslėlį čia',
selectFromFiles: 'Pasirinkite failą',
maximumFileSize: 'Maskimalus failo dydis',
maximumFileSizeError: 'Maskimalus failo dydis viršytas!',
url: 'Paveikslėlio URL adresas',
remove: 'Ištrinti paveikslėlį'
},
link: {
link: 'Nuoroda',
insert: 'Įterpti nuorodą',
unlink: 'Pašalinti nuorodą',
edit: 'Redaguoti',
textToDisplay: 'Rodomas tekstas',
url: 'Koks URL adresas yra susietas?',
openInNewWindow: 'Atidaryti naujame lange'
},
table: {
table: 'Lentelė'
},
hr: {
insert: 'Įterpti horizontalią liniją'
},
style: {
style: 'Stilius',
normal: 'Normalus',
blockquote: 'Citata',
pre: 'Kodas',
h1: 'Antraštė 1',
h2: 'Antraštė 2',
h3: 'Antraštė 3',
h4: 'Antraštė 4',
h5: 'Antraštė 5',
h6: 'Antraštė 6'
},
lists: {
unordered: 'Suženklintasis sąrašas',
ordered: 'Sunumeruotas sąrašas'
},
options: {
help: 'Pagalba',
fullscreen: 'Viso ekrano režimas',
codeview: 'HTML kodo peržiūra'
},
paragraph: {
paragraph: 'Pastraipa',
outdent: 'Sumažinti įtrauką',
indent: 'Padidinti įtrauką',
left: 'Kairinė lygiuotė',
center: 'Centrinė lygiuotė',
right: 'Dešininė lygiuotė',
justify: 'Abipusis išlyginimas'
},
color: {
recent: 'Paskutinė naudota spalva',
more: 'Daugiau spalvų',
background: 'Fono spalva',
foreground: 'Šrifto spalva',
transparent: 'Permatoma',
setTransparent: 'Nustatyti skaidrumo intensyvumą',
reset: 'Atkurti',
resetToDefault: 'Atstatyti numatytąją spalvą'
},
shortcut: {
shortcuts: 'Spartieji klavišai',
close: 'Uždaryti',
textFormatting: 'Teksto formatavimas',
action: 'Veiksmas',
paragraphFormatting: 'Pastraipos formatavimas',
documentStyle: 'Dokumento stilius',
extraKeys: 'Papildomi klavišų deriniai'
},
history: {
undo: 'Anuliuoti veiksmą',
redo: 'Perdaryti veiksmą'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-nb-NO.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'nb-NO': {
font: {
bold: 'Fet',
italic: 'Kursiv',
underline: 'Understrek',
clear: 'Fjern formatering',
height: 'Linjehøyde',
name: 'Skrifttype',
strikethrough: 'Gjennomstrek',
size: 'Skriftstørrelse'
},
image: {
image: 'Bilde',
insert: 'Sett inn bilde',
resizeFull: 'Sett full størrelse',
resizeHalf: 'Sett halv størrelse',
resizeQuarter: 'Sett kvart størrelse',
floatLeft: 'Flyt til venstre',
floatRight: 'Flyt til høyre',
floatNone: 'Fjern flyt',
dragImageHere: 'Dra et bilde hit',
selectFromFiles: 'Velg fra filer',
url: 'Bilde-URL',
remove: 'Fjern bilde'
},
link: {
link: 'Lenke',
insert: 'Sett inn lenke',
unlink: 'Fjern lenke',
edit: 'Rediger',
textToDisplay: 'Visningstekst',
url: 'Til hvilken URL skal denne lenken peke?',
openInNewWindow: 'Åpne i nytt vindu'
},
table: {
table: 'Tabell'
},
hr: {
insert: 'Sett inn horisontal linje'
},
style: {
style: 'Stil',
normal: 'Normal',
blockquote: 'Sitat',
pre: 'Kode',
h1: 'Overskrift 1',
h2: 'Overskrift 2',
h3: 'Overskrift 3',
h4: 'Overskrift 4',
h5: 'Overskrift 5',
h6: 'Overskrift 6'
},
lists: {
unordered: 'Punktliste',
ordered: 'Nummerert liste'
},
options: {
help: 'Hjelp',
fullscreen: 'Fullskjerm',
codeview: 'HTML-visning'
},
paragraph: {
paragraph: 'Avsnitt',
outdent: 'Tilbakerykk',
indent: 'Innrykk',
left: 'Venstrejustert',
center: 'Midtstilt',
right: 'Høyrejustert',
justify: 'Blokkjustert'
},
color: {
recent: 'Nylig valgt farge',
more: 'Flere farger',
background: 'Bakgrunnsfarge',
foreground: 'Skriftfarge',
transparent: 'Gjennomsiktig',
setTransparent: 'Sett gjennomsiktig',
reset: 'Nullstill',
resetToDefault: 'Nullstill til standard'
},
shortcut: {
shortcuts: 'Hurtigtaster',
close: 'Lukk',
textFormatting: 'Tekstformatering',
action: 'Handling',
paragraphFormatting: 'Avsnittsformatering',
documentStyle: 'Dokumentstil'
},
history: {
undo: 'Angre',
redo: 'Gjør om'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-nl-NL.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'nl-NL': {
font: {
bold: 'Vet',
italic: 'Cursief',
underline: 'Onderstrepen',
clear: 'Stijl verwijderen',
height: 'Regelhoogte',
name: 'Lettertype',
strikethrough: 'Doorhalen',
size: 'Tekstgrootte'
},
image: {
image: 'Afbeelding',
insert: 'Afbeelding invoegen',
resizeFull: 'Volledige breedte',
resizeHalf: 'Halve breedte',
resizeQuarter: 'Kwart breedte',
floatLeft: 'Links uitlijnen',
floatRight: 'Rechts uitlijnen',
floatNone: 'Geen uitlijning',
dragImageHere: 'Sleep hier een afbeelding naar toe',
selectFromFiles: 'Selecteer een bestand',
url: 'URL van de afbeelding',
remove: 'Verwijder afbeelding'
},
link: {
link: 'Link',
insert: 'Link invoegen',
unlink: 'Link verwijderen',
edit: 'Wijzigen',
textToDisplay: 'Tekst van link',
url: 'Naar welke URL moet deze link verwijzen?',
openInNewWindow: 'Open in nieuw venster'
},
table: {
table: 'Tabel'
},
hr: {
insert: 'Horizontale lijn invoegen'
},
style: {
style: 'Stijl',
normal: 'Normaal',
blockquote: 'Quote',
pre: 'Code',
h1: 'Kop 1',
h2: 'Kop 2',
h3: 'Kop 3',
h4: 'Kop 4',
h5: 'Kop 5',
h6: 'Kop 6'
},
lists: {
unordered: 'Ongeordende lijst',
ordered: 'Geordende lijst'
},
options: {
help: 'Help',
fullscreen: 'Volledig scherm',
codeview: 'Bekijk Code'
},
paragraph: {
paragraph: 'Paragraaf',
outdent: 'Inspringen verkleinen',
indent: 'Inspringen vergroten',
left: 'Links uitlijnen',
center: 'Centreren',
right: 'Rechts uitlijnen',
justify: 'Uitvullen'
},
color: {
recent: 'Recente kleur',
more: 'Meer kleuren',
background: 'Achtergrond kleur',
foreground: 'Tekst kleur',
transparent: 'Transparant',
setTransparent: 'Transparant',
reset: 'Standaard',
resetToDefault: 'Standaard kleur'
},
shortcut: {
shortcuts: 'Toetsencombinaties',
close: 'sluiten',
textFormatting: 'Tekststijlen',
action: 'Acties',
paragraphFormatting: 'Paragraafstijlen',
documentStyle: 'Documentstijlen'
},
history: {
undo: 'Ongedaan maken',
redo: 'Opnieuw doorvoeren'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-pl-PL.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'pl-PL': {
font: {
bold: 'Pogrubienie',
italic: 'Pochylenie',
underline: 'Podkreślenie',
clear: 'Usuń formatowanie',
height: 'Interlinia',
name: 'Czcionka',
strikethrough: 'Przekreślenie',
size: 'Rozmiar'
},
image: {
image: 'Grafika',
insert: 'Wstaw grafikę',
resizeFull: 'Zmień rozmiar na 100%',
resizeHalf: 'Zmień rozmiar na 50%',
resizeQuarter: 'Zmień rozmiar na 25%',
floatLeft: 'Po lewej',
floatRight: 'Po prawej',
floatNone: 'Równo z tekstem',
shapeRounded: 'Kształt: zaokrąglone',
shapeCircle: 'Kształt: okrąg',
shapeThumbnail: 'Kształt: miniatura',
shapeNone: 'Kształt: brak',
dragImageHere: 'Przeciągnij grafikę lub tekst tutaj',
dropImage: 'Przeciągnij grafikę lub tekst',
selectFromFiles: 'Wybierz z dysku',
maximumFileSize: 'Limit wielkości pliku',
maximumFileSizeError: 'Przekroczono limit wielkości pliku.',
url: 'Adres URL grafiki',
remove: 'Usuń grafikę'
},
link: {
link: 'Odnośnik',
insert: 'Wstaw odnośnik',
unlink: 'Usuń odnośnik',
edit: 'Edytuj',
textToDisplay: 'Tekst do wyświetlenia',
url: 'Na jaki adres URL powinien przenosić ten odnośnik?',
openInNewWindow: 'Otwórz w nowym oknie'
},
table: {
table: 'Tabela'
},
hr: {
insert: 'Wstaw poziomą linię'
},
style: {
style: 'Style',
normal: 'Normalny',
blockquote: 'Cytat',
pre: 'Kod',
h1: 'Nagłówek 1',
h2: 'Nagłówek 2',
h3: 'Nagłówek 3',
h4: 'Nagłówek 4',
h5: 'Nagłówek 5',
h6: 'Nagłówek 6'
},
lists: {
unordered: 'Lista wypunktowana',
ordered: 'Lista numerowana'
},
options: {
help: 'Pomoc',
fullscreen: 'Pełny ekran',
codeview: 'Źródło'
},
paragraph: {
paragraph: 'Akapit',
outdent: 'Zmniejsz wcięcie',
indent: 'Zwiększ wcięcie',
left: 'Wyrównaj do lewej',
center: 'Wyrównaj do środka',
right: 'Wyrównaj do prawej',
justify: 'Wyrównaj do lewej i prawej'
},
color: {
recent: 'Ostani kolor',
more: 'Więcej kolorów',
background: 'Tło',
foreground: 'Czcionka',
transparent: 'Przeźroczysty',
setTransparent: 'Przeźroczyste',
reset: 'Reset',
resetToDefault: 'Domyślne'
},
shortcut: {
shortcuts: 'Skróty klawiaturowe',
close: 'Zamknij',
textFormatting: 'Formatowanie tekstu',
action: 'Akcja',
paragraphFormatting: 'Formatowanie akapitu',
documentStyle: 'Styl dokumentu',
extraKeys: 'Dodatkowe klawisze'
},
history: {
undo: 'Cofnij',
redo: 'Ponów'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-pt-BR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'pt-BR': {
font: {
bold: 'Negrito',
italic: 'Itálico',
underline: 'Sublinhado',
clear: 'Remover estilo da fonte',
height: 'Altura da linha',
name: 'Fonte',
strikethrough: 'Riscado',
size: 'Tamanho da fonte'
},
image: {
image: 'Imagem',
insert: 'Inserir imagem',
resizeFull: 'Resize Full',
resizeHalf: 'Resize Half',
resizeQuarter: 'Resize Quarter',
floatLeft: 'Float Left',
floatRight: 'Float Right',
floatNone: 'Float None',
dragImageHere: 'Arraste uma imagem para cá',
selectFromFiles: 'Selecione a partir dos arquivos',
url: 'URL da image'
},
link: {
link: 'Link',
insert: 'Inserir link',
unlink: 'Remover link',
edit: 'Editar',
textToDisplay: 'Texto para exibir',
url: 'Para qual URL esse link leva?',
openInNewWindow: 'Abrir em uma nova janela'
},
table: {
table: 'Tabela'
},
hr: {
insert: 'Inserir linha horizontal'
},
style: {
style: 'Estilo',
normal: 'Normal',
blockquote: 'Citação',
pre: 'Código',
h1: 'Título 1',
h2: 'Título 2',
h3: 'Título 3',
h4: 'Título 4',
h5: 'Título 5',
h6: 'Título 6'
},
lists: {
unordered: 'Lista com marcadores',
ordered: 'Lista numerada'
},
options: {
help: 'Ajuda',
fullscreen: 'Tela cheia',
codeview: 'Ver código-fonte'
},
paragraph: {
paragraph: 'Parágrafo',
outdent: 'Menor tabulação',
indent: 'Maior tabulação',
left: 'Alinhar à esquerda',
center: 'Alinhar ao centro',
right: 'Alinha à direita',
justify: 'Justificado'
},
color: {
recent: 'Cor recente',
more: 'Mais cores',
background: 'Fundo',
foreground: 'Fonte',
transparent: 'Transparente',
setTransparent: 'Fundo transparente',
reset: 'Restaurar',
resetToDefault: 'Restaurar padrão'
},
shortcut: {
shortcuts: 'Atalhos do teclado',
close: 'Fechar',
textFormatting: 'Formatação de texto',
action: 'Ação',
paragraphFormatting: 'Formatação de parágrafo',
documentStyle: 'Estilo de documento'
},
history: {
undo: 'Desfazer',
redo: 'Refazer'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-pt-PT.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'pt-PT': {
font: {
bold: 'Negrito',
italic: 'Itálico',
underline: 'Sublinhado',
clear: 'Remover estilo da fonte',
height: 'Altura da linha',
name: 'Fonte',
strikethrough: 'Riscado',
size: 'Tamanho da fonte'
},
image: {
image: 'Imagem',
insert: 'Inserir imagem',
resizeFull: 'Redimensionar Completo',
resizeHalf: 'Redimensionar Metade',
resizeQuarter: 'Redimensionar Um Quarto',
floatLeft: 'Float Esquerda',
floatRight: 'Float Direita',
floatNone: 'Sem Float',
dragImageHere: 'Arraste uma imagem para aqui',
selectFromFiles: 'Selecione a partir dos arquivos',
url: 'Endereço da imagem'
},
link: {
link: 'Link',
insert: 'Inserir ligação',
unlink: 'Remover ligação',
edit: 'Editar',
textToDisplay: 'Texto para exibir',
url: 'Que endereço esta licação leva?',
openInNewWindow: 'Abrir numa nova janela'
},
table: {
table: 'Tabela'
},
hr: {
insert: 'Inserir linha horizontal'
},
style: {
style: 'Estilo',
normal: 'Normal',
blockquote: 'Citação',
pre: 'Código',
h1: 'Título 1',
h2: 'Título 2',
h3: 'Título 3',
h4: 'Título 4',
h5: 'Título 5',
h6: 'Título 6'
},
lists: {
unordered: 'Lista com marcadores',
ordered: 'Lista numerada'
},
options: {
help: 'Ajuda',
fullscreen: 'Janela Completa',
codeview: 'Ver código-fonte'
},
paragraph: {
paragraph: 'Parágrafo',
outdent: 'Menor tabulação',
indent: 'Maior tabulação',
left: 'Alinhar à esquerda',
center: 'Alinhar ao centro',
right: 'Alinha à direita',
justify: 'Justificado'
},
color: {
recent: 'Cor recente',
more: 'Mais cores',
background: 'Fundo',
foreground: 'Fonte',
transparent: 'Transparente',
setTransparent: 'Fundo transparente',
reset: 'Restaurar',
resetToDefault: 'Restaurar padrão'
},
shortcut: {
shortcuts: 'Atalhos do teclado',
close: 'Fechar',
textFormatting: 'Formatação de texto',
action: 'Ação',
paragraphFormatting: 'Formatação de parágrafo',
documentStyle: 'Estilo de documento'
},
history: {
undo: 'Desfazer',
redo: 'Refazer'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ro-RO.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ro-RO': {
font: {
bold: 'Îngroșat',
italic: 'Înclinat',
underline: 'Subliniat',
clear: 'Înlătură formatare font',
height: 'Înălțime rând',
strikethrough: 'Tăiat',
size: 'Dimensiune font'
},
image: {
image: 'Imagine',
insert: 'Inserează imagine',
resizeFull: 'Redimensionează complet',
resizeHalf: 'Redimensionează 1/2',
resizeQuarter: 'Redimensionează 1/4',
floatLeft: 'Aliniere la stânga',
floatRight: 'Aliniere la dreapta',
floatNone: 'Fară aliniere',
dragImageHere: 'Trage o imagine aici',
selectFromFiles: 'Alege din fişiere',
url: 'URL imagine'
},
link: {
link: 'Link',
insert: 'Inserează link',
unlink: 'Înlătură link',
edit: 'Editează',
textToDisplay: 'Text ce va fi afişat',
url: 'Deschidere în fereastra nouă?'
},
table: {
table: 'Tabel'
},
hr: {
insert: 'Inserează o linie orizontală'
},
style: {
style: 'Stil',
normal: 'Normal',
blockquote: 'Citat',
pre: 'Preformatat',
h1: 'Titlu 1',
h2: 'Titlu 2',
h3: 'Titlu 3',
h4: 'Titlu 4',
h5: 'Titlu 5',
h6: 'Titlu 6'
},
lists: {
unordered: 'Listă neordonată',
ordered: 'Listă ordonată'
},
options: {
help: 'Ajutor',
fullscreen: 'Măreşte',
codeview: 'Sursă'
},
paragraph: {
paragraph: 'Paragraf',
outdent: 'Creşte identarea',
indent: 'Scade identarea',
left: 'Aliniere la stânga',
center: 'Aliniere centrală',
right: 'Aliniere la dreapta',
justify: 'Aliniere în bloc'
},
color: {
recent: 'Culoare recentă',
more: 'Mai multe culori',
background: 'Culoarea fundalului',
foreground: 'Culoarea textului',
transparent: 'Transparent',
setTransparent: 'Setează transparent',
reset: 'Resetează',
resetToDefault: 'Revino la iniţial'
},
shortcut: {
shortcuts: 'Scurtături tastatură',
close: 'Închide',
textFormatting: 'Formatare text',
action: 'Acţiuni',
paragraphFormatting: 'Formatare paragraf',
documentStyle: 'Stil paragraf'
},
history: {
undo: 'Starea anterioară',
redo: 'Starea ulterioară'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-ru-RU.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'ru-RU': {
font: {
bold: 'Полужирный',
italic: 'Курсив',
underline: 'Подчёркнутый',
clear: 'Убрать стили шрифта',
height: 'Высота линии',
name: 'Шрифт',
strikethrough: 'Зачёркнутый',
subscript: 'Нижний индекс',
superscript: 'Верхний индекс',
size: 'Размер шрифта'
},
image: {
image: 'Картинка',
insert: 'Вставить картинку',
resizeFull: 'Восстановить размер',
resizeHalf: 'Уменьшить до 50%',
resizeQuarter: 'Уменьшить до 25%',
floatLeft: 'Расположить слева',
floatRight: 'Расположить справа',
floatNone: 'Расположение по-умолчанию',
dragImageHere: 'Перетащите сюда картинку',
selectFromFiles: 'Выбрать из файлов',
url: 'URL картинки',
remove: 'Удалить картинку'
},
link: {
link: 'Ссылка',
insert: 'Вставить ссылку',
unlink: 'Убрать ссылку',
edit: 'Редактировать',
textToDisplay: 'Отображаемый текст',
url: 'URL для перехода',
openInNewWindow: 'Открывать в новом окне'
},
table: {
table: 'Таблица'
},
hr: {
insert: 'Вставить горизонтальную линию'
},
style: {
style: 'Стиль',
normal: 'Нормальный',
blockquote: 'Цитата',
pre: 'Код',
h1: 'Заголовок 1',
h2: 'Заголовок 2',
h3: 'Заголовок 3',
h4: 'Заголовок 4',
h5: 'Заголовок 5',
h6: 'Заголовок 6'
},
lists: {
unordered: 'Маркированный список',
ordered: 'Нумерованный список'
},
options: {
help: 'Помощь',
fullscreen: 'На весь экран',
codeview: 'Исходный код'
},
paragraph: {
paragraph: 'Параграф',
outdent: 'Уменьшить отступ',
indent: 'Увеличить отступ',
left: 'Выровнять по левому краю',
center: 'Выровнять по центру',
right: 'Выровнять по правому краю',
justify: 'Растянуть по ширине'
},
color: {
recent: 'Последний цвет',
more: 'Еще цвета',
background: 'Цвет фона',
foreground: 'Цвет шрифта',
transparent: 'Прозрачный',
setTransparent: 'Сделать прозрачным',
reset: 'Сброс',
resetToDefault: 'Восстановить умолчания'
},
shortcut: {
shortcuts: 'Сочетания клавиш',
close: 'Закрыть',
textFormatting: 'Форматирование текста',
action: 'Действие',
paragraphFormatting: 'Форматирование параграфа',
documentStyle: 'Стиль документа',
extraKeys: 'Дополнительные комбинации'
},
history: {
undo: 'Отменить',
redo: 'Повтор'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-sk-SK.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'sk-SK': {
font: {
bold: 'Tučné',
italic: 'Kurzíva',
underline: 'Podtržené',
clear: 'Odstrániť štýl písma',
height: 'Výška riadku',
strikethrough: 'Preškrtnuté',
size: 'Veľkosť písma'
},
image: {
image: 'Obrázok',
insert: 'Vložiť obrázok',
resizeFull: 'Pôvodná veľkosť',
resizeHalf: 'Polovičná veľkosť',
resizeQuarter: 'Štvrtinová veľkosť',
floatLeft: 'Umiestniť doľava',
floatRight: 'Umiestniť doprava',
floatNone: 'Bez zarovnania',
dragImageHere: 'Pretiahnuť sem obrázok',
selectFromFiles: 'Vybrať súbor',
url: 'URL obrázku'
},
link: {
link: 'Odkaz',
insert: 'Vytvoriť odkaz',
unlink: 'Zrušiť odkaz',
edit: 'Upraviť',
textToDisplay: 'Zobrazovaný text',
url: 'Na akú URL adresu má tento odkaz viesť?',
openInNewWindow: 'Otvoriť v novom okne'
},
table: {
table: 'Tabuľka'
},
hr: {
insert: 'Vložit vodorovnú čiaru'
},
style: {
style: 'Štýl',
normal: 'Normálny',
blockquote: 'Citácia',
pre: 'Kód',
h1: 'Nadpis 1',
h2: 'Nadpis 2',
h3: 'Nadpis 3',
h4: 'Nadpis 4',
h5: 'Nadpis 5',
h6: 'Nadpis 6'
},
lists: {
unordered: 'Odrážkový zoznam',
ordered: 'Číselný zoznam'
},
options: {
help: 'Pomoc',
fullscreen: 'Celá obrazovka',
codeview: 'HTML kód'
},
paragraph: {
paragraph: 'Odstavec',
outdent: 'Zvečiť odsadenie',
indent: 'Zmenšiť odsadenie',
left: 'Zarovnať doľava',
center: 'Zarovnať na stred',
right: 'Zarovnať doprava',
justify: 'Zarovnať obojstranne'
},
color: {
recent: 'Aktuálna farba',
more: 'Dalšie farby',
background: 'Farba pozadia',
foreground: 'Farba písma',
transparent: 'Priehľednosť',
setTransparent: 'Nastaviť priehľadnosť',
reset: 'Obnoviť',
resetToDefault: 'Obnoviť prednastavené'
},
shortcut: {
shortcuts: 'Klávesové skratky',
close: 'Zavrieť',
textFormatting: 'Formátovanie textu',
action: 'Akcia',
paragraphFormatting: 'Formátovánie odstavca',
documentStyle: 'Štýl dokumentu'
},
history: {
undo: 'Krok vzad',
redo: 'Krok dopredu'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-sl-SI.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'sl-SI': {
font: {
bold: 'Krepko',
italic: 'Ležeče',
underline: 'Podčrtano',
clear: 'Počisti oblikovanje izbire',
height: 'Razmik med vrsticami',
name: 'Pisava',
strikethrough: 'Prečrtano',
subscript: 'Podpisano',
superscript: 'Nadpisano',
size: 'Velikost pisave'
},
image: {
image: 'Slika',
insert: 'Vstavi sliko',
resizeFull: 'Razširi na polno velikost',
resizeHalf: 'Razširi na polovico velikosti',
resizeQuarter: 'Razširi na četrtino velikosti',
floatLeft: 'Leva poravnava',
floatRight: 'Desna poravnava',
floatNone: 'Brez poravnave',
dragImageHere: 'Sem povlecite sliko',
selectFromFiles: 'Izberi sliko za nalaganje',
url: 'URL naslov slike',
remove: 'Odstrani sliko'
},
link: {
link: 'Povezava',
insert: 'Vstavi povezavo',
unlink: 'Odstrani povezavo',
edit: 'Uredi',
textToDisplay: 'Prikazano besedilo',
url: 'Povezava',
openInNewWindow: 'Odpri v novem oknu'
},
table: {
table: 'Tabela'
},
hr: {
insert: 'Vstavi horizontalno črto'
},
style: {
style: 'Slogi',
normal: 'Navadno besedilo',
blockquote: 'Citat',
pre: 'Koda',
h1: 'Naslov 1',
h2: 'Naslov 2',
h3: 'Naslov 3',
h4: 'Naslov 4',
h5: 'Naslov 5',
h6: 'Naslov 6'
},
lists: {
unordered: 'Označen seznam',
ordered: 'Oštevilčen seznam'
},
options: {
help: 'Pomoč',
fullscreen: 'Celozaslonski način',
codeview: 'Pregled HTML kode'
},
paragraph: {
paragraph: 'Slogi odstavka',
outdent: 'Zmanjšaj odmik',
indent: 'Povečaj odmik',
left: 'Leva poravnava',
center: 'Desna poravnava',
right: 'Sredinska poravnava',
justify: 'Obojestranska poravnava'
},
color: {
recent: 'Uporabi zadnjo barvo',
more: 'Več barv',
background: 'Barva ozadja',
foreground: 'Barva besedila',
transparent: 'Brez barve',
setTransparent: 'Brez barve',
reset: 'Ponastavi',
resetToDefault: 'Ponastavi na privzeto'
},
shortcut: {
shortcuts: 'Bljižnice',
close: 'Zapri',
textFormatting: 'Oblikovanje besedila',
action: 'Dejanja',
paragraphFormatting: 'Oblikovanje odstavka',
documentStyle: 'Oblikovanje naslova'
},
history: {
undo: 'Razveljavi',
redo: 'Uveljavi'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-sr-RS-Latin.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'sr-RS': {
font: {
bold: 'Podebljano',
italic: 'Kurziv',
underline: 'Podvučeno',
clear: 'Ukloni stilove fonta',
height: 'Visina linije',
strikethrough: 'Precrtano',
size: 'Veličina fonta'
},
image: {
image: 'Slika',
insert: 'Umetni sliku',
resizeFull: 'Puna veličina',
resizeHalf: 'Umanji na 50%',
resizeQuarter: 'Umanji na 25%',
floatLeft: 'Uz levu ivicu',
floatRight: 'Uz desnu ivicu',
floatNone: 'Bez ravnanja',
dragImageHere: 'Prevuci sliku ovde',
selectFromFiles: 'Izaberi iz datoteke',
url: 'Adresa slike',
remove: 'Ukloni sliku'
},
link: {
link: 'Veza',
insert: 'Umetni vezu',
unlink: 'Ukloni vezu',
edit: 'Uredi',
textToDisplay: 'Tekst za prikaz',
url: 'Internet adresa',
openInNewWindow: 'Otvori u novom prozoru'
},
table: {
table: 'Tabela'
},
hr: {
insert: 'Umetni horizontalnu liniju'
},
style: {
style: 'Stil',
normal: 'Normalni',
blockquote: 'Citat',
pre: 'Kod',
h1: 'Zaglavlje 1',
h2: 'Zaglavlje 2',
h3: 'Zaglavlje 3',
h4: 'Zaglavlje 4',
h5: 'Zaglavlje 5',
h6: 'Zaglavlje 6'
},
lists: {
unordered: 'Obična lista',
ordered: 'Numerisana lista'
},
options: {
help: 'Pomoć',
fullscreen: 'Preko celog ekrana',
codeview: 'Izvorni kod'
},
paragraph: {
paragraph: 'Paragraf',
outdent: 'Smanji uvlačenje',
indent: 'Povečaj uvlačenje',
left: 'Poravnaj u levo',
center: 'Centrirano',
right: 'Poravnaj u desno',
justify: 'Poravnaj obostrano'
},
color: {
recent: 'Poslednja boja',
more: 'Više boja',
background: 'Boja pozadine',
foreground: 'Boja teksta',
transparent: 'Providna',
setTransparent: 'Providna',
reset: 'Opoziv',
resetToDefault: 'Podrazumevana'
},
shortcut: {
shortcuts: 'Prečice sa tastature',
close: 'Zatvori',
textFormatting: 'Formatiranje teksta',
action: 'Akcija',
paragraphFormatting: 'Formatiranje paragrafa',
documentStyle: 'Stil dokumenta',
extraKeys: 'Dodatne kombinacije'
},
history: {
undo: 'Poništi',
redo: 'Ponovi'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-sr-RS.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'sr-RS': {
font: {
bold: 'Подебљано',
italic: 'Курзив',
underline: 'Подвучено',
clear: 'Уклони стилове фонта',
height: 'Висина линије',
strikethrough: 'Прецртано',
size: 'Величина фонта'
},
image: {
image: 'Слика',
insert: 'Уметни слику',
resizeFull: 'Пуна величина',
resizeHalf: 'Умањи на 50%',
resizeQuarter: 'Умањи на 25%',
floatLeft: 'Уз леву ивицу',
floatRight: 'Уз десну ивицу',
floatNone: 'Без равнања',
dragImageHere: 'Превуци слику овде',
selectFromFiles: 'Изабери из датотеке',
url: 'Адреса слике',
remove: 'Уклони слику'
},
link: {
link: 'Веза',
insert: 'Уметни везу',
unlink: 'Уклони везу',
edit: 'Уреди',
textToDisplay: 'Текст за приказ',
url: 'Интернет адреса',
openInNewWindow: 'Отвори у новом прозору'
},
table: {
table: 'Табела'
},
hr: {
insert: 'Уметни хоризонталну линију'
},
style: {
style: 'Стил',
normal: 'Нормални',
blockquote: 'Цитат',
pre: 'Код',
h1: 'Заглавље 1',
h2: 'Заглавље 2',
h3: 'Заглавље 3',
h4: 'Заглавље 4',
h5: 'Заглавље 5',
h6: 'Заглавље 6'
},
lists: {
unordered: 'Обична листа',
ordered: 'Нумерисана листа'
},
options: {
help: 'Помоћ',
fullscreen: 'Преко целог екрана',
codeview: 'Изворни код'
},
paragraph: {
paragraph: 'Параграф',
outdent: 'Смањи увлачење',
indent: 'Повечај увлачење',
left: 'Поравнај у лево',
center: 'Центрирано',
right: 'Поравнај у десно',
justify: 'Поравнај обострано'
},
color: {
recent: 'Последња боја',
more: 'Више боја',
background: 'Боја позадине',
foreground: 'Боја текста',
transparent: 'Провидна',
setTransparent: 'Провидна',
reset: 'Опозив',
resetToDefault: 'Подразумевана'
},
shortcut: {
shortcuts: 'Пречице са тастатуре',
close: 'Затвори',
textFormatting: 'Форматирање текста',
action: 'Акција',
paragraphFormatting: 'Форматирање параграфа',
documentStyle: 'Стил документа',
extraKeys: 'Додатне комбинације'
},
history: {
undo: 'Поништи',
redo: 'Понови'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-sv-SE.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'sv-SE': {
font: {
bold: 'Fet',
italic: 'Kursiv',
underline: 'Understruken',
clear: 'Radera formatering',
height: 'Radavstånd',
name: 'Teckensnitt',
strikethrough: 'Genomstruken',
size: 'Teckenstorlek'
},
image: {
image: 'Bild',
insert: 'Infoga bild',
resizeFull: 'Full storlek',
resizeHalf: 'Halv storlek',
resizeQuarter: 'En fjärdedel i storlek',
floatLeft: 'Vänsterjusterad',
floatRight: 'Högerjusterad',
floatNone: 'Ingen justering',
dragImageHere: 'Dra en bild hit',
selectFromFiles: 'Välj från filer',
url: 'Länk till bild',
remove: 'Ta bort bild'
},
link: {
link: 'Länk',
insert: 'Infoga länk',
unlink: 'Ta bort länk',
edit: 'Redigera',
textToDisplay: 'Visningstext',
url: 'Till vilken URL ska denna länk peka?',
openInNewWindow: 'Öppna i ett nytt fönster'
},
table: {
table: 'Tabell'
},
hr: {
insert: 'Infoga horisontell linje'
},
style: {
style: 'Stil',
normal: 'Normal',
blockquote: 'Citat',
pre: 'Kod',
h1: 'Rubrik 1',
h2: 'Rubrik 2',
h3: 'Rubrik 3',
h4: 'Rubrik 4',
h5: 'Rubrik 5',
h6: 'Rubrik 6'
},
lists: {
unordered: 'Punktlista',
ordered: 'Numrerad lista'
},
options: {
help: 'Hjälp',
fullscreen: 'Fullskärm',
codeview: 'HTML-visning'
},
paragraph: {
paragraph: 'Justera text',
outdent: 'Minska indrag',
indent: 'Öka indrag',
left: 'Vänsterjusterad',
center: 'Centrerad',
right: 'Högerjusterad',
justify: 'Justera text'
},
color: {
recent: 'Senast använda färg',
more: 'Fler färger',
background: 'Bakgrundsfärg',
foreground: 'Teckenfärg',
transparent: 'Genomskinlig',
setTransparent: 'Gör genomskinlig',
reset: 'Nollställ',
resetToDefault: 'Återställ till standard'
},
shortcut: {
shortcuts: 'Kortkommandon',
close: 'Stäng',
textFormatting: 'Textformatering',
action: 'Funktion',
paragraphFormatting: 'Avsnittsformatering',
documentStyle: 'Dokumentstil'
},
history: {
undo: 'Ångra',
redo: 'Gör om'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-th-TH.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'th-TH': {
font: {
bold: 'ตัวหนา',
italic: 'ตัวเอียง',
underline: 'ขีดเส้นใต้',
clear: 'ล้างรูปแบบตัวอักษร',
height: 'ความสูงบรรทัด',
name: 'แบบตัวอักษร',
strikethrough: 'ขีดฆ่า',
subscript: 'ตัวห้อย',
superscript: 'ตัวยก',
size: 'ขนาดตัวอักษร'
},
image: {
image: 'รูปภาพ',
insert: 'แทรกรูปภาพ',
resizeFull: 'ปรับขนาดเท่าจริง',
resizeHalf: 'ปรับขนาดลง 50%',
resizeQuarter: 'ปรับขนาดลง 25%',
floatLeft: 'ชิดซ้าย',
floatRight: 'ชิดขวา',
floatNone: 'ไม่จัดตำแหน่ง',
dragImageHere: 'ลากรูปภาพที่ต้องการไว้ที่นี่',
selectFromFiles: 'เลือกไฟล์รูปภาพ',
url: 'ที่อยู่ URL ของรูปภาพ',
remove: 'ลบรูปภาพ'
},
link: {
link: 'ตัวเชื่อมโยง',
insert: 'แทรกตัวเชื่อมโยง',
unlink: 'ยกเลิกตัวเชื่อมโยง',
edit: 'แก้ไข',
textToDisplay: 'ข้อความที่ให้แสดง',
url: 'ที่อยู่เว็บไซต์ที่ต้องการให้เชื่อมโยงไปถึง?',
openInNewWindow: 'เปิดในหน้าต่างใหม่'
},
table: {
table: 'ตาราง'
},
hr: {
insert: 'แทรกเส้นคั่น'
},
style: {
style: 'รูปแบบ',
normal: 'ปกติ',
blockquote: 'ข้อความ',
pre: 'โค้ด',
h1: 'หัวข้อ 1',
h2: 'หัวข้อ 2',
h3: 'หัวข้อ 3',
h4: 'หัวข้อ 4',
h5: 'หัวข้อ 5',
h6: 'หัวข้อ 6'
},
lists: {
unordered: 'รายการแบบไม่มีลำดับ',
ordered: 'รายการแบบมีลำดับ'
},
options: {
help: 'ช่วยเหลือ',
fullscreen: 'ขยายเต็มหน้าจอ',
codeview: 'ซอร์สโค้ด'
},
paragraph: {
paragraph: 'ย่อหน้า',
outdent: 'เยื้องซ้าย',
indent: 'เยื้องขวา',
left: 'จัดหน้าชิดซ้าย',
center: 'จัดหน้ากึ่งกลาง',
right: 'จัดหน้าชิดขวา',
justify: 'จัดบรรทัดเสมอกัน'
},
color: {
recent: 'สีที่ใช้ล่าสุด',
more: 'สีอื่นๆ',
background: 'สีพื้นหลัง',
foreground: 'สีพื้นหน้า',
transparent: 'โปร่งแสง',
setTransparent: 'ตั้งค่าความโปร่งแสง',
reset: 'คืนค่า',
resetToDefault: 'คืนค่ามาตรฐาน'
},
shortcut: {
shortcuts: 'แป้นลัด',
close: 'ปิด',
textFormatting: 'การจัดรูปแบบข้อความ',
action: 'การกระทำ',
paragraphFormatting: 'การจัดรูปแบบย่อหน้า',
documentStyle: 'รูปแบบของเอกสาร'
},
history: {
undo: 'ยกเลิกการกระทำ',
redo: 'ทำซ้ำการกระทำ'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-tr-TR.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'tr-TR': {
font: {
bold: 'Kalın',
italic: 'İtalik',
underline: 'Altı çizili',
clear: 'Temizle',
height: 'Satır yüksekliği',
name: 'Yazı Tipi',
strikethrough: 'Üstü çizili',
subscript: 'Alt Simge',
superscript: 'Üst Simge',
size: 'Yazı tipi boyutu'
},
image: {
image: 'Resim',
insert: 'Resim ekle',
resizeFull: 'Orjinal boyut',
resizeHalf: '1/2 boyut',
resizeQuarter: '1/4 boyut',
floatLeft: 'Sola hizala',
floatRight: 'Sağa hizala',
floatNone: 'Hizalamayı kaldır',
shapeRounded: 'Şekil: Yuvarlatılmış Köşe',
shapeCircle: 'Şekil: Daire',
shapeThumbnail: 'Şekil: K.Resim',
shapeNone: 'Şekil: Yok',
dragImageHere: 'Buraya sürükleyin',
selectFromFiles: 'Dosya seçin',
url: 'Resim bağlantısı',
remove: 'Resimi Kaldır'
},
link: {
link: 'Bağlantı',
insert: 'Bağlantı ekle',
unlink: 'Bağlantıyı kaldır',
edit: 'Bağlantıyı düzenle',
textToDisplay: 'Görüntülemek için',
url: 'Bağlantı adresi?',
openInNewWindow: 'Yeni pencerede aç'
},
table: {
table: 'Tablo'
},
hr: {
insert: 'Yatay çizgi ekle'
},
style: {
style: 'Biçim',
normal: 'Normal',
blockquote: 'Alıntı',
pre: 'Önbiçimli',
h1: 'Başlık 1',
h2: 'Başlık 2',
h3: 'Başlık 3',
h4: 'Başlık 4',
h5: 'Başlık 5',
h6: 'Başlık 6'
},
lists: {
unordered: 'Madde işaretli liste',
ordered: 'Numaralı liste'
},
options: {
help: 'Yardım',
fullscreen: 'Tam ekran',
codeview: 'HTML Kodu'
},
paragraph: {
paragraph: 'Paragraf',
outdent: 'Girintiyi artır',
indent: 'Girintiyi azalt',
left: 'Sola hizala',
center: 'Ortaya hizala',
right: 'Sağa hizala',
justify: 'Yasla'
},
color: {
recent: 'Son renk',
more: 'Daha fazla renk',
background: 'Arka plan rengi',
foreground: 'Yazı rengi',
transparent: 'Seffaflık',
setTransparent: 'Şeffaflığı ayarla',
reset: 'Sıfırla',
resetToDefault: 'Varsayılanlara sıfırla'
},
shortcut: {
shortcuts: 'Kısayollar',
close: 'Kapat',
textFormatting: 'Yazı biçimlendirme',
action: 'Eylem',
paragraphFormatting: 'Paragraf biçimlendirme',
documentStyle: 'Biçim'
},
history: {
undo: 'Geri al',
redo: 'Yeniden yap'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-uk-UA.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'uk-UA': {
font: {
bold: 'Напівжирний',
italic: 'Курсив',
underline: 'Підкреслений',
clear: 'Прибрати стилі шрифту',
height: 'Висота лінії',
name: 'Шрифт',
strikethrough: 'Закреслений',
subscript: 'Нижній індекс',
superscript: 'Верхній індекс',
size: 'Розмір шрифту'
},
image: {
image: 'Картинка',
insert: 'Вставити картинку',
resizeFull: 'Відновити розмір',
resizeHalf: 'Зменшити до 50%',
resizeQuarter: 'Зменшити до 25%',
floatLeft: 'Розташувати ліворуч',
floatRight: 'Розташувати праворуч',
floatNone: 'Початкове розташування',
dragImageHere: 'Перетягніть сюди картинку',
selectFromFiles: 'Вибрати з файлів',
url: 'URL картинки',
remove: 'Видалити картинку'
},
link: {
link: 'Посилання',
insert: 'Вставити посилання',
unlink: 'Прибрати посилання',
edit: 'Редагувати',
textToDisplay: 'Текст, що відображається',
url: 'URL для переходу',
openInNewWindow: 'Відкривати у новому вікні'
},
table: {
table: 'Таблиця'
},
hr: {
insert: 'Вставити горизонтальну лінію'
},
style: {
style: 'Стиль',
normal: 'Нормальний',
blockquote: 'Цитата',
pre: 'Код',
h1: 'Заголовок 1',
h2: 'Заголовок 2',
h3: 'Заголовок 3',
h4: 'Заголовок 4',
h5: 'Заголовок 5',
h6: 'Заголовок 6'
},
lists: {
unordered: 'Маркований список',
ordered: 'Нумерований список'
},
options: {
help: 'Допомога',
fullscreen: 'На весь екран',
codeview: 'Початковий код'
},
paragraph: {
paragraph: 'Параграф',
outdent: 'Зменшити відступ',
indent: 'Збільшити відступ',
left: 'Вирівняти по лівому краю',
center: 'Вирівняти по центру',
right: 'Вирівняти по правому краю',
justify: 'Розтягнути по ширині'
},
color: {
recent: 'Останній колір',
more: 'Ще кольори',
background: 'Колір фону',
foreground: 'Колір шрифту',
transparent: 'Прозорий',
setTransparent: 'Зробити прозорим',
reset: 'Відновити',
resetToDefault: 'Відновити початкові'
},
shortcut: {
shortcuts: 'Комбінації клавіш',
close: 'Закрити',
textFormatting: 'Форматування тексту',
action: 'Дія',
paragraphFormatting: 'Форматування параграфу',
documentStyle: 'Стиль документу'
},
history: {
undo: 'Відмінити',
redo: 'Повторити'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-vi-VN.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'vi-VN': {
font: {
bold: 'In Đậm',
italic: 'In Nghiên',
underline: 'Gạch Dưới',
clear: 'Bỏ Định Dạng',
height: 'Khoảng Cách Hàng',
name: 'Phông Chữ',
strikethrough: 'Gạch Ngang',
size: 'Cỡ Chữ'
},
image: {
image: 'Hình Ảnh',
insert: 'Chèn',
resizeFull: '100%',
resizeHalf: '50%',
resizeQuarter: '25%',
floatLeft: 'Canh Trái',
floatRight: 'Canh Phải',
floatNone: 'Canh Đều',
dragImageHere: 'Thả Ảnh Ở Đây',
selectFromFiles: 'Chọn Từ Files',
url: 'URL',
remove: 'Ghỡ Bỏ'
},
link: {
link: 'Đường Dẫn',
insert: 'Chèn Đường Dẫn',
unlink: 'Ghỡ Đường Dẫn',
edit: 'Sửa',
textToDisplay: 'Text Hiển Thị',
url: 'URL',
openInNewWindow: 'Mở ở Cửa Sổ Mới'
},
table: {
table: 'Bảng'
},
hr: {
insert: 'Chèn Vào'
},
style: {
style: 'Kiểu Chữ',
normal: 'Chữ Thường',
blockquote: 'Đoạn Trích',
pre: 'Mã Code',
h1: 'H1',
h2: 'H2',
h3: 'H3',
h4: 'H4',
h5: 'H5',
h6: 'H6'
},
lists: {
unordered: 'Liệt Kê Danh Sách',
ordered: 'Liệt Kê Theo Số'
},
options: {
help: 'Trợ Giúp',
fullscreen: 'Đầy Màn Hình',
codeview: 'Xem Dạng Code'
},
paragraph: {
paragraph: 'Canh Lề',
outdent: 'Dịch Sang Trái',
indent: 'Dịch Sang Phải',
left: 'Canh Trái',
center: 'Canh Giữa',
right: 'Canh Phải',
justify: 'Canh Đều'
},
color: {
recent: 'Màu Chữ',
more: 'Mở Rộng',
background: 'Màu Nền',
foreground: 'Màu Chữ',
transparent: 'Trong Suốt',
setTransparent: 'Nền Trong Suốt',
reset: 'Thiệt Lập Lại',
resetToDefault: 'Trở Lại Ban Đầu'
},
shortcut: {
shortcuts: 'Phím Tắt',
close: 'Đóng',
textFormatting: 'Định Dạng Văn Bản',
action: 'Hành Động',
paragraphFormatting: 'Định Dạng',
documentStyle: 'Kiểu Văn Bản'
},
history: {
undo: 'Lùi Lại',
redo: 'Làm Lại'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-zh-CN.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'zh-CN': {
font: {
bold: '粗体',
italic: '斜体',
underline: '下划线',
clear: '清除格式',
height: '行高',
name: '字体',
strikethrough: '删除线',
subscript: '下标',
superscript: '上标',
size: '字号'
},
image: {
image: '图片',
insert: '插入图片',
resizeFull: '缩放至 100%',
resizeHalf: '缩放至 50%',
resizeQuarter: '缩放至 25%',
floatLeft: '靠左浮动',
floatRight: '靠右浮动',
floatNone: '取消浮动',
shapeRounded: '形状: 圆角',
shapeCircle: '形状: 圆',
shapeThumbnail: '形状: 缩略图',
shapeNone: '形状: 无',
dragImageHere: '将图片拖拽至此处',
selectFromFiles: '从本地上传',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '图片地址',
remove: '移除图片'
},
link: {
link: '链接',
insert: '插入链接',
unlink: '去除链接',
edit: '编辑链接',
textToDisplay: '显示文本',
url: '链接地址',
openInNewWindow: '在新窗口打开'
},
table: {
table: '表格'
},
hr: {
insert: '水平线'
},
style: {
style: '样式',
normal: '普通',
blockquote: '引用',
pre: '代码',
h1: '标题 1',
h2: '标题 2',
h3: '标题 3',
h4: '标题 4',
h5: '标题 5',
h6: '标题 6'
},
lists: {
unordered: '无序列表',
ordered: '有序列表'
},
options: {
help: '帮助',
fullscreen: '全屏',
codeview: '源代码'
},
paragraph: {
paragraph: '段落',
outdent: '减少缩进',
indent: '增加缩进',
left: '左对齐',
center: '居中对齐',
right: '右对齐',
justify: '两端对齐'
},
color: {
recent: '最近使用',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重置',
resetToDefault: '默认'
},
shortcut: {
shortcuts: '快捷键',
close: '关闭',
textFormatting: '文本格式',
action: '动作',
paragraphFormatting: '段落格式',
documentStyle: '文档样式',
extraKeys: '额外按键'
},
history: {
undo: '撤销',
redo: '重做'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/lang/summernote-zh-TW.js
================================================
(function ($) {
$.extend($.summernote.lang, {
'zh-TW': {
font: {
bold: '粗體',
italic: '斜體',
underline: '底線',
clear: '清除格式',
height: '行高',
name: '字體',
strikethrough: '刪除線',
subscript: '下標',
superscript: '上標',
size: '字號'
},
image: {
image: '圖片',
insert: '插入圖片',
resizeFull: '縮放至100%',
resizeHalf: '縮放至 50%',
resizeQuarter: '縮放至 25%',
floatLeft: '靠左浮動',
floatRight: '靠右浮動',
floatNone: '取消浮動',
shapeRounded: '形狀: 圓角',
shapeCircle: '形狀: 圓',
shapeThumbnail: '形狀: 縮略圖',
shapeNone: '形狀: 無',
dragImageHere: '將圖片拖曳至此處',
selectFromFiles: '從本機上傳',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '圖片網址',
remove: '移除圖片'
},
link: {
link: '連結',
insert: '插入連結',
unlink: '取消連結',
edit: '編輯連結',
textToDisplay: '顯示文字',
url: '連結網址',
openInNewWindow: '在新視窗開啟'
},
table: {
table: '表格'
},
hr: {
insert: '水平線'
},
style: {
style: '樣式',
normal: '一般',
blockquote: '引用區塊',
pre: '程式碼區塊',
h1: '標題 1',
h2: '標題 2',
h3: '標題 3',
h4: '標題 4',
h5: '標題 5',
h6: '標題 6'
},
lists: {
unordered: '項目清單',
ordered: '編號清單'
},
options: {
help: '幫助',
fullscreen: '全螢幕',
codeview: '原始碼'
},
paragraph: {
paragraph: '段落',
outdent: '取消縮排',
indent: '增加縮排',
left: '靠右對齊',
center: '靠中對齊',
right: '靠右對齊',
justify: '左右對齊'
},
color: {
recent: '字型顏色',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重設',
resetToDefault: '默認'
},
shortcut: {
shortcuts: '快捷鍵',
close: '關閉',
textFormatting: '文字格式',
action: '動作',
paragraphFormatting: '段落格式',
documentStyle: '文件格式',
extraKeys: '額外按鍵'
},
history: {
undo: '復原',
redo: '取消復原'
}
}
});
})(jQuery);
================================================
FILE: static/assets/plugins/summernote/meteor/README.md
================================================
Build + Meteor status: [](https://github.com/MeteorPackaging/summernote/tree/meteor-integration/meteor)
Packaging [summernote](http://summernote.org/) for [Meteor.js](http://meteor.com).
# Versions
* [summernote:summernote](https://atmospherejs.com/summernote/summernote) - includes jQuery and Bootstrap as dependencies
* [summernote:standalone](https://atmospherejs.com/summernote/standalone) - doesn't include any dependencies
# Meteor
If you're new to Meteor, here's what the excitement is all about -
[watch the first two minutes](https://www.youtube.com/watch?v=fsi0aJ9yr2o); you'll be hooked by 1:28.
That screencast is from 2012. In the meantime, Meteor has become a mature JavaScript-everywhere web
development framework. Read more at [Why Meteor](http://www.meteorpedia.com/read/Why_Meteor).
# Issues
If you encounter an issue while using this package, please CC @dandv when you file it in this repo.
# DONE
* Instantiation test
# TODO
* Make sure the library works with Meteor's reactivity - for example to auto-save to a collection
transparently after the text changes.
* Tests ensuring correct event handling on template re-rendering
================================================
FILE: static/assets/plugins/summernote/meteor/package-standalone.js
================================================
// package metadata file for Meteor.js
'use strict';
var packageName = 'summernote:standalone'; // http://atmospherejs.com/summernote:standalone
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
Package.describe({
name: packageName,
summary: 'summernote standalone (official): WYSIWYG editor with embedded images support, packaged without deps',
version: packageJson.version,
git: 'https://github.com/summernote/summernote.git'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
// no exports - summernote adds itself to jQuery
api.addFiles([
'dist/summernote.js',
'dist/summernote.css'
], where);
});
Package.onTest(function (api) {
// load dependencies for test only, before loading the package
api.use(['twbs:bootstrap@3.3.1', 'fortawesome:fontawesome@4.2.0'], where);
// load our package
api.use(packageName, where);
// load the test runner
api.use('tinytest', where);
api.addFiles('meteor/test.js', where);
});
================================================
FILE: static/assets/plugins/summernote/meteor/package.js
================================================
// package metadata file for Meteor.js
'use strict';
var packageName = 'summernote:summernote'; // http://atmospherejs.com/summernote:summernote
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
Package.describe({
name: packageName,
summary: 'summernote (official): jQuery+Bootstrap+FontAwesome WYSIWYG editor with embedded images support',
version: packageJson.version,
git: 'https://github.com/summernote/summernote.git'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.use([
'jquery',
'twbs:bootstrap@3.3.1',
'fortawesome:fontawesome@4.2.0'
], where);
// no exports - summernote adds itself to jQuery
api.addFiles([
'dist/summernote.js',
'dist/summernote.css'
], where);
});
Package.onTest(function (api) {
api.use(packageName, where);
api.use('tinytest', where);
api.addFiles('meteor/test.js', where);
});
================================================
FILE: static/assets/plugins/summernote/meteor/publish.sh
================================================
#!/bin/bash
# Publish package to Meteor's repository, Atmospherejs.com
# Make sure Meteor is installed, per https://www.meteor.com/install.
# The curl'ed script is totally safe; takes 2 minutes to read its source and check.
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
# sanity check: make sure we're in the root directory of the checkout
cd "$( dirname "$0" )/.."
ALL_EXIT_CODE=0
# test any package*.js packages we may have, e.g. package.js, package-compat.js
for PACKAGE_FILE in meteor/package*.js; do
# Meteor expects package.js to be in the root directory of the checkout, so copy there our package file under that name, temporarily
cp $PACKAGE_FILE ./package.js
# publish package, creating it if it's the first time we're publishing
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
echo "Publishing $PACKAGE_NAME..."
# Attempt to re-publish the package - the most common operation once the initial release has
# been made. If the package name was changed (rare), you'll have to pass the --create flag.
meteor publish "$@"; EXIT_CODE=$?
ALL_EXIT_CODE=$(( $ALL_EXIT_CODE + $EXIT_CODE ))
if (( $EXIT_CODE == 0 )); then
echo "Thanks for releasing a new version. You can see it at"
echo "https://atmospherejs.com/${PACKAGE_NAME/://}"
else
echo "We got an error. Please post it at https://github.com/raix/Meteor-community-discussions/issues/14"
fi
# rm the temporary build files and package.js
rm -rf ".build.$PACKAGE_NAME" versions.json package.js
done
exit $ALL_EXIT_CODE
================================================
FILE: static/assets/plugins/summernote/meteor/runtests.sh
================================================
#!/bin/sh
# Test Meteor package before publishing to Atmospherejs.com
# Make sure Meteor is installed, per https://www.meteor.com/install.
# The curl'ed script is totally safe; takes 2 minutes to read its source and check.
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
# sanity check: make sure we're in the root directory of the checkout
cd "$( dirname "$0" )/.."
ALL_EXIT_CODE=0
# test any package*.js packages we may have, e.g. package.js, package-standalone.js
for PACKAGE_FILE in meteor/package*.js; do
# Meteor expects package.js in the root dir of the checkout, so copy there our package file under that name, temporarily
cp $PACKAGE_FILE ./package.js
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
echo "### Testing $PACKAGE_NAME..."
# provide an invalid MONGO_URL so Meteor doesn't bog us down with an empty Mongo database
if [ $# -gt 0 ]; then
# interpret any parameter to mean we want an interactive test
MONGO_URL=mongodb:// meteor test-packages ./
else
# automated/CI test with phantomjs
spacejam --mongo-url mongodb:// test-packages ./
ALL_EXIT_CODES=$(( $ALL_EXIT_CODES + $? ))
fi
# delete temporary build files and package.js
rm -rf .build.* versions.json package.js
done
exit $ALL_EXIT_CODES
================================================
FILE: static/assets/plugins/summernote/meteor/test.js
================================================
'use strict';
Tinytest.add('Instantiation', function (test) {
var editor = document.createElement('div');
document.body.appendChild(editor);
$(editor).summernote();
test.equal(typeof $(editor).code(), 'string', 'Instantiation');
});
================================================
FILE: static/assets/plugins/summernote/plugin/summernote-ext-hello.js
================================================
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals: jQuery
factory(window.jQuery);
}
}(function ($) {
// template
var tmpl = $.summernote.renderer.getTemplate();
/**
* @class plugin.hello
*
* Hello Plugin
*/
$.summernote.addPlugin({
/** @property {String} name name of plugin */
name: 'hello',
/**
* @property {Object} buttons
* @property {Function} buttons.hello function to make button
* @property {Function} buttons.helloDropdown function to make button
* @property {Function} buttons.helloImage function to make button
*/
buttons: { // buttons
hello: function (lang, options) {
return tmpl.iconButton(options.iconPrefix + 'header', {
event : 'hello',
title: 'hello',
hide: true
});
},
helloDropdown: function (lang, options) {
var list = '
summernote ';
list += '
Code Mirror ';
var dropdown = '';
return tmpl.iconButton(options.iconPrefix + 'header', {
title: 'hello',
hide: true,
dropdown : dropdown
});
},
helloImage : function (lang, options) {
return tmpl.iconButton(options.iconPrefix + 'file-image-o', {
event : 'helloImage',
title: 'helloImage',
hide: true
});
}
},
/**
* @property {Object} events
* @property {Function} events.hello run function when button that has a 'hello' event name fires click
* @property {Function} events.helloDropdown run function when button that has a 'helloDropdown' event name fires click
* @property {Function} events.helloImage run function when button that has a 'helloImage' event name fires click
*/
events: { // events
hello: function (event, editor, layoutInfo) {
// Get current editable node
var $editable = layoutInfo.editable();
// Call insertText with 'hello'
editor.insertText($editable, 'hello ');
},
helloDropdown: function (event, editor, layoutInfo, value) {
// Get current editable node
var $editable = layoutInfo.editable();
// Call insertText with 'hello'
editor.insertText($editable, 'hello ' + value + '!!!!');
},
helloImage : function (event, editor, layoutInfo) {
var $editable = layoutInfo.editable();
var img = $('
');
editor.insertNode($editable, img[0]);
}
}
});
}));
================================================
FILE: static/assets/plugins/summernote/plugin/summernote-ext-hint.js
================================================
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals: jQuery
factory(window.jQuery);
}
}(function ($) {
// import core class
var range = $.summernote.core.range;
var KEY = {
UP: 38,
DOWN: 40,
ENTER: 13
};
var DROPDOWN_KEYCODES = [KEY.UP, KEY.DOWN, KEY.ENTER];
/**
* @class plugin.hint
*
* Hint Plugin
*/
$.summernote.addPlugin({
/**
* name name of plugin
* @property {String}
**/
name: 'hint',
/**
* @property {Regex}
* @interface
*/
match: /[a-z]+/g,
/**
* create list item template
*
* @interface
* @param {Object} search
* @returns {Array} created item list
*/
template: null,
/**
* create inserted content to add in summernote
*
* @interface
* @param {String} html
* @param {String} keyword
* @return {HTMLEleemnt|String}
*/
content: null,
/**
* load search list
*
* @interface
*/
load: null,
/**
* @param {jQuery} $node
*/
scrollTo: function ($node) {
var $parent = $node.parent();
$parent[0].scrollTop = $node[0].offsetTop - ($parent.innerHeight() / 2);
},
/**
* @param {jQuery} $popover
*/
moveDown: function ($popover) {
var index = $popover.find('.active').index();
this.activate($popover, (index === -1) ? 0 : (index + 1) % $popover.children().length);
},
/**
* @param {jQuery} $popover
*/
moveUp: function ($popover) {
var index = $popover.find('.active').index();
this.activate($popover, (index === -1) ? 0 : (index - 1) % $popover.children().length);
},
/**
* @param {jQuery} $popover
* @param {Number} i
*/
activate: function ($popover, idx) {
idx = idx || 0;
if (idx < 0) {
idx = $popover.children().length - 1;
}
$popover.children().removeClass('active');
var $activeItem = $popover.children().eq(idx);
$activeItem.addClass('active');
this.scrollTo($activeItem);
},
/**
* @param {jQuery} $popover
*/
replace: function ($popover) {
var wordRange = $popover.data('wordRange');
var $activeItem = $popover.find('.active');
var content = this.content($activeItem.data('item'));
if (typeof content === 'string') {
content = document.createTextNode(content);
}
$popover.removeData('wordRange');
wordRange.insertNode(content);
range.createFromNode(content).collapse().select();
},
/**
* @param {String} keyword
* @return {Object|null}
*/
searchKeyword: function (keyword, callback) {
if (this.match.test(keyword)) {
var matches = this.match.exec(keyword);
this.search(matches[1], callback);
} else {
callback();
}
},
createTemplate: function (list) {
var items = [];
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var $item = $('
');
$item.append(this.template(list[i]));
$item.data('item', list[i]);
items.push($item);
}
if (items.length) {
items[0].addClass('active');
}
return items;
},
search: function (keyword, callback) {
keyword = keyword || '';
callback();
},
init : function (layoutInfo) {
var self = this;
var $note = layoutInfo.holder();
var $popover = $('
').addClass('hint-group').css({
'position': 'absolute',
'max-height': 150,
'z-index' : 999,
'overflow' : 'hidden',
'display' : 'none',
'border' : '1px solid gray',
'border-radius' : '5px'
});
$popover.on('click', '.list-group-item', function HintItemClick() {
self.replace($popover);
$popover.hide();
$note.summernote('focus');
});
$(document).on('click', function HintClick() {
$popover.hide();
});
$note.on('summernote.keydown', function HintKeyDown(customEvent, nativeEvent) {
if ($popover.css('display') !== 'block') {
return true;
}
if (nativeEvent.keyCode === KEY.DOWN) {
nativeEvent.preventDefault();
self.moveDown($popover);
} else if (nativeEvent.keyCode === KEY.UP) {
nativeEvent.preventDefault();
self.moveUp($popover);
} else if (nativeEvent.keyCode === KEY.ENTER) {
nativeEvent.preventDefault();
self.replace($popover);
$popover.hide();
$note.summernote('focus');
}
});
var timer = null;
$note.on('summernote.keyup', function HintKeyUp(customEvent, nativeEvent) {
if (DROPDOWN_KEYCODES.indexOf(nativeEvent.keyCode) > -1) {
if (nativeEvent.keyCode === KEY.ENTER) {
if ($popover.css('display') === 'block') {
return false;
}
}
} else {
clearTimeout(timer);
timer = setTimeout(function () {
var range = $note.summernote('createRange');
var word = range.getWordRange();
self.searchKeyword(word.toString(), function (searchList) {
if (!searchList) {
$popover.hide();
return;
}
if (searchList && !searchList.length) {
$popover.hide();
return;
}
layoutInfo.popover().append($popover);
// popover below placeholder.
var rects = word.getClientRects();
var rect = rects[rects.length - 1];
$popover.html(self.createTemplate(searchList)).css({
left: rect.left,
top: rect.top + rect.height
}).data('wordRange', word).show();
});
}, self.throttle);
}
});
this.load($popover);
},
throttle : 50,
// FIXME Summernote doesn't support event pipeline yet.
// - Plugin -> Base Code
events: {
ENTER: function (e, editor, layoutInfo) {
if (layoutInfo.popover().find('.hint-group').css('display') !== 'block') {
// apply default enter key
layoutInfo.holder().summernote('insertParagraph');
}
// prevent ENTER key
return true;
}
}
});
}));
================================================
FILE: static/assets/plugins/summernote/plugin/summernote-ext-video.js
================================================
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals: jQuery
factory(window.jQuery);
}
}(function ($) {
// template
var tmpl = $.summernote.renderer.getTemplate();
// core functions: range, dom
var range = $.summernote.core.range;
var dom = $.summernote.core.dom;
/**
* createVideoNode
*
* @member plugin.video
* @private
* @param {String} url
* @return {Node}
*/
var createVideoNode = function (url) {
// video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)
var ytRegExp = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
var ytMatch = url.match(ytRegExp);
var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/;
var igMatch = url.match(igRegExp);
var vRegExp = /\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/;
var vMatch = url.match(vRegExp);
var vimRegExp = /\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/;
var vimMatch = url.match(vimRegExp);
var dmRegExp = /.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/;
var dmMatch = url.match(dmRegExp);
var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/;
var youkuMatch = url.match(youkuRegExp);
var mp4RegExp = /^.+.(mp4|m4v)$/;
var mp4Match = url.match(mp4RegExp);
var oggRegExp = /^.+.(ogg|ogv)$/;
var oggMatch = url.match(oggRegExp);
var webmRegExp = /^.+.(webm)$/;
var webmMatch = url.match(webmRegExp);
var $video;
if (ytMatch && ytMatch[1].length === 11) {
var youtubeId = ytMatch[1];
$video = $('