Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
case 'text-align:right;':
[12500] Fix | Delete
allign = '---:';
[12501] Fix | Delete
break;
[12502] Fix | Delete
case 'text-align:center;':
[12503] Fix | Delete
allign = ':---:';
[12504] Fix | Delete
break;
[12505] Fix | Delete
}
[12506] Fix | Delete
}
[12507] Fix | Delete
tableArray[0][i] = headContent.trim();
[12508] Fix | Delete
tableArray[1][i] = allign;
[12509] Fix | Delete
}
[12510] Fix | Delete
[12511] Fix | Delete
for (i = 0; i < rows.length; ++i) {
[12512] Fix | Delete
var r = tableArray.push([]) - 1,
[12513] Fix | Delete
cols = rows[i].getElementsByTagName('td');
[12514] Fix | Delete
[12515] Fix | Delete
for (ii = 0; ii < headings.length; ++ii) {
[12516] Fix | Delete
var cellContent = ' ';
[12517] Fix | Delete
if (typeof cols[ii] !== 'undefined') {
[12518] Fix | Delete
cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
[12519] Fix | Delete
}
[12520] Fix | Delete
tableArray[r].push(cellContent);
[12521] Fix | Delete
}
[12522] Fix | Delete
}
[12523] Fix | Delete
[12524] Fix | Delete
var cellSpacesCount = 3;
[12525] Fix | Delete
for (i = 0; i < tableArray.length; ++i) {
[12526] Fix | Delete
for (ii = 0; ii < tableArray[i].length; ++ii) {
[12527] Fix | Delete
var strLen = tableArray[i][ii].length;
[12528] Fix | Delete
if (strLen > cellSpacesCount) {
[12529] Fix | Delete
cellSpacesCount = strLen;
[12530] Fix | Delete
}
[12531] Fix | Delete
}
[12532] Fix | Delete
}
[12533] Fix | Delete
[12534] Fix | Delete
for (i = 0; i < tableArray.length; ++i) {
[12535] Fix | Delete
for (ii = 0; ii < tableArray[i].length; ++ii) {
[12536] Fix | Delete
if (i === 1) {
[12537] Fix | Delete
if (tableArray[i][ii].slice(-1) === ':') {
[12538] Fix | Delete
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
[12539] Fix | Delete
} else {
[12540] Fix | Delete
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
[12541] Fix | Delete
}
[12542] Fix | Delete
} else {
[12543] Fix | Delete
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
[12544] Fix | Delete
}
[12545] Fix | Delete
}
[12546] Fix | Delete
txt += '| ' + tableArray[i].join(' | ') + ' |\n';
[12547] Fix | Delete
}
[12548] Fix | Delete
[12549] Fix | Delete
return txt.trim();
[12550] Fix | Delete
});
[12551] Fix | Delete
[12552] Fix | Delete
showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
[12553] Fix | Delete
'use strict';
[12554] Fix | Delete
[12555] Fix | Delete
var txt = '';
[12556] Fix | Delete
if (!node.hasChildNodes()) {
[12557] Fix | Delete
return '';
[12558] Fix | Delete
}
[12559] Fix | Delete
var children = node.childNodes,
[12560] Fix | Delete
childrenLength = children.length;
[12561] Fix | Delete
[12562] Fix | Delete
for (var i = 0; i < childrenLength; ++i) {
[12563] Fix | Delete
txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
[12564] Fix | Delete
}
[12565] Fix | Delete
return txt.trim();
[12566] Fix | Delete
});
[12567] Fix | Delete
[12568] Fix | Delete
showdown.subParser('makeMarkdown.txt', function (node) {
[12569] Fix | Delete
'use strict';
[12570] Fix | Delete
[12571] Fix | Delete
var txt = node.nodeValue;
[12572] Fix | Delete
[12573] Fix | Delete
// multiple spaces are collapsed
[12574] Fix | Delete
txt = txt.replace(/ +/g, ' ');
[12575] Fix | Delete
[12576] Fix | Delete
// replace the custom ¨NBSP; with a space
[12577] Fix | Delete
txt = txt.replace(/¨NBSP;/g, ' ');
[12578] Fix | Delete
[12579] Fix | Delete
// ", <, > and & should replace escaped html entities
[12580] Fix | Delete
txt = showdown.helper.unescapeHTMLEntities(txt);
[12581] Fix | Delete
[12582] Fix | Delete
// escape markdown magic characters
[12583] Fix | Delete
// emphasis, strong and strikethrough - can appear everywhere
[12584] Fix | Delete
// we also escape pipe (|) because of tables
[12585] Fix | Delete
// and escape ` because of code blocks and spans
[12586] Fix | Delete
txt = txt.replace(/([*_~|`])/g, '\\$1');
[12587] Fix | Delete
[12588] Fix | Delete
// escape > because of blockquotes
[12589] Fix | Delete
txt = txt.replace(/^(\s*)>/g, '\\$1>');
[12590] Fix | Delete
[12591] Fix | Delete
// hash character, only troublesome at the beginning of a line because of headers
[12592] Fix | Delete
txt = txt.replace(/^#/gm, '\\#');
[12593] Fix | Delete
[12594] Fix | Delete
// horizontal rules
[12595] Fix | Delete
txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
[12596] Fix | Delete
[12597] Fix | Delete
// dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
[12598] Fix | Delete
txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
[12599] Fix | Delete
[12600] Fix | Delete
// +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
[12601] Fix | Delete
txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
[12602] Fix | Delete
[12603] Fix | Delete
// images and links, ] followed by ( is problematic, so we escape it
[12604] Fix | Delete
txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
[12605] Fix | Delete
[12606] Fix | Delete
// reference URIs must also be escaped
[12607] Fix | Delete
txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
[12608] Fix | Delete
[12609] Fix | Delete
return txt;
[12610] Fix | Delete
});
[12611] Fix | Delete
[12612] Fix | Delete
var root = this;
[12613] Fix | Delete
[12614] Fix | Delete
// AMD Loader
[12615] Fix | Delete
if (true) {
[12616] Fix | Delete
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
[12617] Fix | Delete
'use strict';
[12618] Fix | Delete
return showdown;
[12619] Fix | Delete
}).call(exports, __webpack_require__, exports, module),
[12620] Fix | Delete
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
[12621] Fix | Delete
[12622] Fix | Delete
// CommonJS/nodeJS Loader
[12623] Fix | Delete
} else {}
[12624] Fix | Delete
}).call(this);
[12625] Fix | Delete
[12626] Fix | Delete
[12627] Fix | Delete
[12628] Fix | Delete
[12629] Fix | Delete
/***/ }),
[12630] Fix | Delete
[12631] Fix | Delete
/***/ "NMb1":
[12632] Fix | Delete
/***/ (function(module, exports) {
[12633] Fix | Delete
[12634] Fix | Delete
(function() { module.exports = window["wp"]["deprecated"]; }());
[12635] Fix | Delete
[12636] Fix | Delete
/***/ }),
[12637] Fix | Delete
[12638] Fix | Delete
/***/ "ODXe":
[12639] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[12640] Fix | Delete
[12641] Fix | Delete
"use strict";
[12642] Fix | Delete
[12643] Fix | Delete
// EXPORTS
[12644] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
[12645] Fix | Delete
[12646] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
[12647] Fix | Delete
var arrayWithHoles = __webpack_require__("DSFK");
[12648] Fix | Delete
[12649] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
[12650] Fix | Delete
function _iterableToArrayLimit(arr, i) {
[12651] Fix | Delete
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
[12652] Fix | Delete
var _arr = [];
[12653] Fix | Delete
var _n = true;
[12654] Fix | Delete
var _d = false;
[12655] Fix | Delete
var _e = undefined;
[12656] Fix | Delete
[12657] Fix | Delete
try {
[12658] Fix | Delete
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
[12659] Fix | Delete
_arr.push(_s.value);
[12660] Fix | Delete
[12661] Fix | Delete
if (i && _arr.length === i) break;
[12662] Fix | Delete
}
[12663] Fix | Delete
} catch (err) {
[12664] Fix | Delete
_d = true;
[12665] Fix | Delete
_e = err;
[12666] Fix | Delete
} finally {
[12667] Fix | Delete
try {
[12668] Fix | Delete
if (!_n && _i["return"] != null) _i["return"]();
[12669] Fix | Delete
} finally {
[12670] Fix | Delete
if (_d) throw _e;
[12671] Fix | Delete
}
[12672] Fix | Delete
}
[12673] Fix | Delete
[12674] Fix | Delete
return _arr;
[12675] Fix | Delete
}
[12676] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
[12677] Fix | Delete
var unsupportedIterableToArray = __webpack_require__("BsWD");
[12678] Fix | Delete
[12679] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
[12680] Fix | Delete
var nonIterableRest = __webpack_require__("PYwp");
[12681] Fix | Delete
[12682] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
[12683] Fix | Delete
[12684] Fix | Delete
[12685] Fix | Delete
[12686] Fix | Delete
[12687] Fix | Delete
function _slicedToArray(arr, i) {
[12688] Fix | Delete
return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
[12689] Fix | Delete
}
[12690] Fix | Delete
[12691] Fix | Delete
/***/ }),
[12692] Fix | Delete
[12693] Fix | Delete
/***/ "PYwp":
[12694] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[12695] Fix | Delete
[12696] Fix | Delete
"use strict";
[12697] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
[12698] Fix | Delete
function _nonIterableRest() {
[12699] Fix | Delete
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
[12700] Fix | Delete
}
[12701] Fix | Delete
[12702] Fix | Delete
/***/ }),
[12703] Fix | Delete
[12704] Fix | Delete
/***/ "SVSp":
[12705] Fix | Delete
/***/ (function(module, exports) {
[12706] Fix | Delete
[12707] Fix | Delete
(function() { module.exports = window["wp"]["shortcode"]; }());
[12708] Fix | Delete
[12709] Fix | Delete
/***/ }),
[12710] Fix | Delete
[12711] Fix | Delete
/***/ "T5bk":
[12712] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[12713] Fix | Delete
[12714] Fix | Delete
"use strict";
[12715] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toArray; });
[12716] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("DSFK");
[12717] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("25BE");
[12718] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BsWD");
[12719] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_nonIterableRest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("PYwp");
[12720] Fix | Delete
[12721] Fix | Delete
[12722] Fix | Delete
[12723] Fix | Delete
[12724] Fix | Delete
function _toArray(arr) {
[12725] Fix | Delete
return Object(_babel_runtime_helpers_esm_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(arr) || Object(_babel_runtime_helpers_esm_iterableToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(arr) || Object(_babel_runtime_helpers_esm_unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(arr) || Object(_babel_runtime_helpers_esm_nonIterableRest__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])();
[12726] Fix | Delete
}
[12727] Fix | Delete
[12728] Fix | Delete
/***/ }),
[12729] Fix | Delete
[12730] Fix | Delete
/***/ "Tqx9":
[12731] Fix | Delete
/***/ (function(module, exports) {
[12732] Fix | Delete
[12733] Fix | Delete
(function() { module.exports = window["wp"]["primitives"]; }());
[12734] Fix | Delete
[12735] Fix | Delete
/***/ }),
[12736] Fix | Delete
[12737] Fix | Delete
/***/ "UuzZ":
[12738] Fix | Delete
/***/ (function(module, exports) {
[12739] Fix | Delete
[12740] Fix | Delete
(function() { module.exports = window["wp"]["autop"]; }());
[12741] Fix | Delete
[12742] Fix | Delete
/***/ }),
[12743] Fix | Delete
[12744] Fix | Delete
/***/ "YLtl":
[12745] Fix | Delete
/***/ (function(module, exports) {
[12746] Fix | Delete
[12747] Fix | Delete
(function() { module.exports = window["lodash"]; }());
[12748] Fix | Delete
[12749] Fix | Delete
/***/ }),
[12750] Fix | Delete
[12751] Fix | Delete
/***/ "Zss7":
[12752] Fix | Delete
/***/ (function(module, exports, __webpack_require__) {
[12753] Fix | Delete
[12754] Fix | Delete
var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2
[12755] Fix | Delete
// https://github.com/bgrins/TinyColor
[12756] Fix | Delete
// Brian Grinstead, MIT License
[12757] Fix | Delete
[12758] Fix | Delete
(function(Math) {
[12759] Fix | Delete
[12760] Fix | Delete
var trimLeft = /^\s+/,
[12761] Fix | Delete
trimRight = /\s+$/,
[12762] Fix | Delete
tinyCounter = 0,
[12763] Fix | Delete
mathRound = Math.round,
[12764] Fix | Delete
mathMin = Math.min,
[12765] Fix | Delete
mathMax = Math.max,
[12766] Fix | Delete
mathRandom = Math.random;
[12767] Fix | Delete
[12768] Fix | Delete
function tinycolor (color, opts) {
[12769] Fix | Delete
[12770] Fix | Delete
color = (color) ? color : '';
[12771] Fix | Delete
opts = opts || { };
[12772] Fix | Delete
[12773] Fix | Delete
// If input is already a tinycolor, return itself
[12774] Fix | Delete
if (color instanceof tinycolor) {
[12775] Fix | Delete
return color;
[12776] Fix | Delete
}
[12777] Fix | Delete
// If we are called as a function, call using new instead
[12778] Fix | Delete
if (!(this instanceof tinycolor)) {
[12779] Fix | Delete
return new tinycolor(color, opts);
[12780] Fix | Delete
}
[12781] Fix | Delete
[12782] Fix | Delete
var rgb = inputToRGB(color);
[12783] Fix | Delete
this._originalInput = color,
[12784] Fix | Delete
this._r = rgb.r,
[12785] Fix | Delete
this._g = rgb.g,
[12786] Fix | Delete
this._b = rgb.b,
[12787] Fix | Delete
this._a = rgb.a,
[12788] Fix | Delete
this._roundA = mathRound(100*this._a) / 100,
[12789] Fix | Delete
this._format = opts.format || rgb.format;
[12790] Fix | Delete
this._gradientType = opts.gradientType;
[12791] Fix | Delete
[12792] Fix | Delete
// Don't let the range of [0,255] come back in [0,1].
[12793] Fix | Delete
// Potentially lose a little bit of precision here, but will fix issues where
[12794] Fix | Delete
// .5 gets interpreted as half of the total, instead of half of 1
[12795] Fix | Delete
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
[12796] Fix | Delete
if (this._r < 1) { this._r = mathRound(this._r); }
[12797] Fix | Delete
if (this._g < 1) { this._g = mathRound(this._g); }
[12798] Fix | Delete
if (this._b < 1) { this._b = mathRound(this._b); }
[12799] Fix | Delete
[12800] Fix | Delete
this._ok = rgb.ok;
[12801] Fix | Delete
this._tc_id = tinyCounter++;
[12802] Fix | Delete
}
[12803] Fix | Delete
[12804] Fix | Delete
tinycolor.prototype = {
[12805] Fix | Delete
isDark: function() {
[12806] Fix | Delete
return this.getBrightness() < 128;
[12807] Fix | Delete
},
[12808] Fix | Delete
isLight: function() {
[12809] Fix | Delete
return !this.isDark();
[12810] Fix | Delete
},
[12811] Fix | Delete
isValid: function() {
[12812] Fix | Delete
return this._ok;
[12813] Fix | Delete
},
[12814] Fix | Delete
getOriginalInput: function() {
[12815] Fix | Delete
return this._originalInput;
[12816] Fix | Delete
},
[12817] Fix | Delete
getFormat: function() {
[12818] Fix | Delete
return this._format;
[12819] Fix | Delete
},
[12820] Fix | Delete
getAlpha: function() {
[12821] Fix | Delete
return this._a;
[12822] Fix | Delete
},
[12823] Fix | Delete
getBrightness: function() {
[12824] Fix | Delete
//http://www.w3.org/TR/AERT#color-contrast
[12825] Fix | Delete
var rgb = this.toRgb();
[12826] Fix | Delete
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
[12827] Fix | Delete
},
[12828] Fix | Delete
getLuminance: function() {
[12829] Fix | Delete
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
[12830] Fix | Delete
var rgb = this.toRgb();
[12831] Fix | Delete
var RsRGB, GsRGB, BsRGB, R, G, B;
[12832] Fix | Delete
RsRGB = rgb.r/255;
[12833] Fix | Delete
GsRGB = rgb.g/255;
[12834] Fix | Delete
BsRGB = rgb.b/255;
[12835] Fix | Delete
[12836] Fix | Delete
if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
[12837] Fix | Delete
if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
[12838] Fix | Delete
if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
[12839] Fix | Delete
return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
[12840] Fix | Delete
},
[12841] Fix | Delete
setAlpha: function(value) {
[12842] Fix | Delete
this._a = boundAlpha(value);
[12843] Fix | Delete
this._roundA = mathRound(100*this._a) / 100;
[12844] Fix | Delete
return this;
[12845] Fix | Delete
},
[12846] Fix | Delete
toHsv: function() {
[12847] Fix | Delete
var hsv = rgbToHsv(this._r, this._g, this._b);
[12848] Fix | Delete
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
[12849] Fix | Delete
},
[12850] Fix | Delete
toHsvString: function() {
[12851] Fix | Delete
var hsv = rgbToHsv(this._r, this._g, this._b);
[12852] Fix | Delete
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
[12853] Fix | Delete
return (this._a == 1) ?
[12854] Fix | Delete
"hsv(" + h + ", " + s + "%, " + v + "%)" :
[12855] Fix | Delete
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
[12856] Fix | Delete
},
[12857] Fix | Delete
toHsl: function() {
[12858] Fix | Delete
var hsl = rgbToHsl(this._r, this._g, this._b);
[12859] Fix | Delete
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
[12860] Fix | Delete
},
[12861] Fix | Delete
toHslString: function() {
[12862] Fix | Delete
var hsl = rgbToHsl(this._r, this._g, this._b);
[12863] Fix | Delete
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
[12864] Fix | Delete
return (this._a == 1) ?
[12865] Fix | Delete
"hsl(" + h + ", " + s + "%, " + l + "%)" :
[12866] Fix | Delete
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
[12867] Fix | Delete
},
[12868] Fix | Delete
toHex: function(allow3Char) {
[12869] Fix | Delete
return rgbToHex(this._r, this._g, this._b, allow3Char);
[12870] Fix | Delete
},
[12871] Fix | Delete
toHexString: function(allow3Char) {
[12872] Fix | Delete
return '#' + this.toHex(allow3Char);
[12873] Fix | Delete
},
[12874] Fix | Delete
toHex8: function(allow4Char) {
[12875] Fix | Delete
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
[12876] Fix | Delete
},
[12877] Fix | Delete
toHex8String: function(allow4Char) {
[12878] Fix | Delete
return '#' + this.toHex8(allow4Char);
[12879] Fix | Delete
},
[12880] Fix | Delete
toRgb: function() {
[12881] Fix | Delete
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
[12882] Fix | Delete
},
[12883] Fix | Delete
toRgbString: function() {
[12884] Fix | Delete
return (this._a == 1) ?
[12885] Fix | Delete
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
[12886] Fix | Delete
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
[12887] Fix | Delete
},
[12888] Fix | Delete
toPercentageRgb: function() {
[12889] Fix | Delete
return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
[12890] Fix | Delete
},
[12891] Fix | Delete
toPercentageRgbString: function() {
[12892] Fix | Delete
return (this._a == 1) ?
[12893] Fix | Delete
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
[12894] Fix | Delete
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
[12895] Fix | Delete
},
[12896] Fix | Delete
toName: function() {
[12897] Fix | Delete
if (this._a === 0) {
[12898] Fix | Delete
return "transparent";
[12899] Fix | Delete
}
[12900] Fix | Delete
[12901] Fix | Delete
if (this._a < 1) {
[12902] Fix | Delete
return false;
[12903] Fix | Delete
}
[12904] Fix | Delete
[12905] Fix | Delete
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
[12906] Fix | Delete
},
[12907] Fix | Delete
toFilter: function(secondColor) {
[12908] Fix | Delete
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
[12909] Fix | Delete
var secondHex8String = hex8String;
[12910] Fix | Delete
var gradientType = this._gradientType ? "GradientType = 1, " : "";
[12911] Fix | Delete
[12912] Fix | Delete
if (secondColor) {
[12913] Fix | Delete
var s = tinycolor(secondColor);
[12914] Fix | Delete
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
[12915] Fix | Delete
}
[12916] Fix | Delete
[12917] Fix | Delete
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
[12918] Fix | Delete
},
[12919] Fix | Delete
toString: function(format) {
[12920] Fix | Delete
var formatSet = !!format;
[12921] Fix | Delete
format = format || this._format;
[12922] Fix | Delete
[12923] Fix | Delete
var formattedString = false;
[12924] Fix | Delete
var hasAlpha = this._a < 1 && this._a >= 0;
[12925] Fix | Delete
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
[12926] Fix | Delete
[12927] Fix | Delete
if (needsAlphaFormat) {
[12928] Fix | Delete
// Special case for "transparent", all other non-alpha formats
[12929] Fix | Delete
// will return rgba when there is transparency.
[12930] Fix | Delete
if (format === "name" && this._a === 0) {
[12931] Fix | Delete
return this.toName();
[12932] Fix | Delete
}
[12933] Fix | Delete
return this.toRgbString();
[12934] Fix | Delete
}
[12935] Fix | Delete
if (format === "rgb") {
[12936] Fix | Delete
formattedString = this.toRgbString();
[12937] Fix | Delete
}
[12938] Fix | Delete
if (format === "prgb") {
[12939] Fix | Delete
formattedString = this.toPercentageRgbString();
[12940] Fix | Delete
}
[12941] Fix | Delete
if (format === "hex" || format === "hex6") {
[12942] Fix | Delete
formattedString = this.toHexString();
[12943] Fix | Delete
}
[12944] Fix | Delete
if (format === "hex3") {
[12945] Fix | Delete
formattedString = this.toHexString(true);
[12946] Fix | Delete
}
[12947] Fix | Delete
if (format === "hex4") {
[12948] Fix | Delete
formattedString = this.toHex8String(true);
[12949] Fix | Delete
}
[12950] Fix | Delete
if (format === "hex8") {
[12951] Fix | Delete
formattedString = this.toHex8String();
[12952] Fix | Delete
}
[12953] Fix | Delete
if (format === "name") {
[12954] Fix | Delete
formattedString = this.toName();
[12955] Fix | Delete
}
[12956] Fix | Delete
if (format === "hsl") {
[12957] Fix | Delete
formattedString = this.toHslString();
[12958] Fix | Delete
}
[12959] Fix | Delete
if (format === "hsv") {
[12960] Fix | Delete
formattedString = this.toHsvString();
[12961] Fix | Delete
}
[12962] Fix | Delete
[12963] Fix | Delete
return formattedString || this.toHexString();
[12964] Fix | Delete
},
[12965] Fix | Delete
clone: function() {
[12966] Fix | Delete
return tinycolor(this.toString());
[12967] Fix | Delete
},
[12968] Fix | Delete
[12969] Fix | Delete
_applyModification: function(fn, args) {
[12970] Fix | Delete
var color = fn.apply(null, [this].concat([].slice.call(args)));
[12971] Fix | Delete
this._r = color._r;
[12972] Fix | Delete
this._g = color._g;
[12973] Fix | Delete
this._b = color._b;
[12974] Fix | Delete
this.setAlpha(color._a);
[12975] Fix | Delete
return this;
[12976] Fix | Delete
},
[12977] Fix | Delete
lighten: function() {
[12978] Fix | Delete
return this._applyModification(lighten, arguments);
[12979] Fix | Delete
},
[12980] Fix | Delete
brighten: function() {
[12981] Fix | Delete
return this._applyModification(brighten, arguments);
[12982] Fix | Delete
},
[12983] Fix | Delete
darken: function() {
[12984] Fix | Delete
return this._applyModification(darken, arguments);
[12985] Fix | Delete
},
[12986] Fix | Delete
desaturate: function() {
[12987] Fix | Delete
return this._applyModification(desaturate, arguments);
[12988] Fix | Delete
},
[12989] Fix | Delete
saturate: function() {
[12990] Fix | Delete
return this._applyModification(saturate, arguments);
[12991] Fix | Delete
},
[12992] Fix | Delete
greyscale: function() {
[12993] Fix | Delete
return this._applyModification(greyscale, arguments);
[12994] Fix | Delete
},
[12995] Fix | Delete
spin: function() {
[12996] Fix | Delete
return this._applyModification(spin, arguments);
[12997] Fix | Delete
},
[12998] Fix | Delete
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function