Merge pull request #45 from EvanCarroll/gh-pages
repackaged without coffeescript, or grunt stuff
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
2015-10-20 v0.3.3
|
||||
|
||||
ECARROLL- Updated to remove Grunt, and coffeescript stuff.
|
||||
@@ -1,65 +0,0 @@
|
||||
fs = require("fs")
|
||||
|
||||
#global module:false
|
||||
module.exports = (grunt) ->
|
||||
|
||||
# Project configuration.
|
||||
grunt.initConfig
|
||||
pkg: grunt.file.readJSON('package.json')
|
||||
banner:
|
||||
"/** <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy/mm/dd\") %>\n"+
|
||||
" * <%= pkg.homepage %>\n" +
|
||||
" * Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %> - MIT\n"+
|
||||
" */\n"
|
||||
|
||||
coffee:
|
||||
options:
|
||||
bare: true
|
||||
compile:
|
||||
expand: true,
|
||||
flatten: false,
|
||||
cwd: 'src',
|
||||
src: ['**/*.coffee'],
|
||||
dest: 'dist/',
|
||||
ext: '.js'
|
||||
|
||||
wrap:
|
||||
dist:
|
||||
src: 'dist/<%= pkg.name %>.js'
|
||||
dest: '.'
|
||||
wrapper: [
|
||||
"<%= banner %>(function(window,document,$,undefined) {\n"
|
||||
"\n}(window,document,jQuery));"
|
||||
]
|
||||
|
||||
concat:
|
||||
combined:
|
||||
src: ['dist/<%= pkg.name %>.js', 'dist/styles/bootstrap/<%= pkg.name %>-bootstrap.js']
|
||||
dest: 'dist/<%= pkg.name %>-combined.js'
|
||||
|
||||
uglify:
|
||||
options:
|
||||
stripBanners: true
|
||||
banner: '<%= banner %>'
|
||||
|
||||
dist:
|
||||
src: "dist/<%= pkg.name %>.js"
|
||||
dest: "dist/<%= pkg.name %>.min.js"
|
||||
|
||||
combined:
|
||||
src: "dist/<%= pkg.name %>-combined.js"
|
||||
dest: "dist/<%= pkg.name %>-combined.min.js"
|
||||
|
||||
watch:
|
||||
scripts:
|
||||
files: 'src/**/*.coffee'
|
||||
tasks: 'default'
|
||||
|
||||
grunt.loadNpmTasks "grunt-contrib-concat"
|
||||
grunt.loadNpmTasks "grunt-contrib-watch"
|
||||
grunt.loadNpmTasks "grunt-contrib-uglify"
|
||||
grunt.loadNpmTasks "grunt-contrib-coffee"
|
||||
grunt.loadNpmTasks "grunt-wrap"
|
||||
|
||||
# Default task.
|
||||
grunt.registerTask "default", "coffee wrap concat uglify".split(' ')
|
||||
@@ -0,0 +1,66 @@
|
||||
var fs = require("fs");
|
||||
var process = require("process");
|
||||
|
||||
|
||||
console.log("This file is now deprecated.. We no longer have a build system because we're not using coffee script.");
|
||||
process.exit();
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
banner: "/** <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy/mm/dd\") %>\n" + " * <%= pkg.homepage %>\n" + " * Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %> - MIT\n" + " */\n",
|
||||
coffee: {
|
||||
options: {
|
||||
bare: true
|
||||
},
|
||||
compile: {
|
||||
expand: true,
|
||||
flatten: false,
|
||||
cwd: 'src',
|
||||
src: ['**/*.coffee'],
|
||||
dest: 'dist/',
|
||||
ext: '.js'
|
||||
}
|
||||
},
|
||||
wrap: {
|
||||
dist: {
|
||||
src: 'dist/<%= pkg.name %>.js',
|
||||
dest: '.',
|
||||
wrapper: ["<%= banner %>(function(window,document,$,undefined) {\n", "\n}(window,document,jQuery));"]
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
combined: {
|
||||
src: ['dist/<%= pkg.name %>.js', 'dist/styles/bootstrap/<%= pkg.name %>-bootstrap.js'],
|
||||
dest: 'dist/<%= pkg.name %>-combined.js'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
stripBanners: true,
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
dist: {
|
||||
src: "dist/<%= pkg.name %>.js",
|
||||
dest: "dist/<%= pkg.name %>.min.js"
|
||||
},
|
||||
combined: {
|
||||
src: "dist/<%= pkg.name %>-combined.js",
|
||||
dest: "dist/<%= pkg.name %>-combined.min.js"
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
scripts: {
|
||||
files: 'src/**/*.coffee',
|
||||
tasks: 'default'
|
||||
}
|
||||
}
|
||||
});
|
||||
grunt.loadNpmTasks("grunt-contrib-concat");
|
||||
grunt.loadNpmTasks("grunt-contrib-watch");
|
||||
grunt.loadNpmTasks("grunt-contrib-uglify");
|
||||
grunt.loadNpmTasks("grunt-contrib-coffee");
|
||||
grunt.loadNpmTasks("grunt-wrap");
|
||||
return grunt.registerTask("default", "coffee wrap concat uglify".split(' '));
|
||||
};
|
||||
|
||||
Vendored
-593
@@ -1,593 +0,0 @@
|
||||
/** 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: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>",
|
||||
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, '<br/>');
|
||||
}
|
||||
}
|
||||
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: "<div>\n<span data-notify-text></span>\n</div>",
|
||||
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)"
|
||||
}
|
||||
}
|
||||
});
|
||||
Vendored
-5
File diff suppressed because one or more lines are too long
Vendored
-4
@@ -1,7 +1,3 @@
|
||||
/** Notify.js - v0.3.1 - 2014/06/29
|
||||
* http://notifyjs.com/
|
||||
* Copyright (c) 2014 Jaime Pillora - MIT
|
||||
*/
|
||||
(function(window,document,$,undefined) {
|
||||
'use strict';
|
||||
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+3
-27
@@ -22,7 +22,7 @@
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=jpillora&type=follow" allowtransparency="true" frameborder="0" scrolling="0" width="130" height="20"></iframe></span><span>
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=jpillora&repo=notifyjs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="80" height="20"></iframe></span><span><a href="https://twitter.com/share" data-url="http://notifyjs.com" data-text="Notify.js - A simple, versatile notification library" data-hashtags="notifyjs" class="twitter-share-button">Tweet</a>
|
||||
<script>
|
||||
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||
|
||||
</script></span></div>
|
||||
<hr>
|
||||
@@ -430,34 +430,10 @@ $.notify({
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="dist/notify.js"></script>
|
||||
<script src="dist/styles/bootstrap/notify-bootstrap.js"></script>
|
||||
<script src="docs/js/app.js"></script>
|
||||
<script defered src="http://jpillora.com/compilejs/dist/compile.js"></script>
|
||||
<script defered src="http://jpillora.com/compilejs/dist/tasks/compile.uglify.js"></script>
|
||||
<script defered src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script>
|
||||
<script>
|
||||
//async fonts
|
||||
WebFontConfig = { google: { families: [ 'Droid+Sans+Mono::latin' ] } };
|
||||
(function() {
|
||||
var wf = document.createElement('script');
|
||||
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
|
||||
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
|
||||
wf.type = 'text/javascript';
|
||||
wf.async = 'true';
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(wf, s);
|
||||
})();
|
||||
//ga
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-38709761-6', 'notifyjs.com');
|
||||
ga('send', 'pageview');
|
||||
|
||||
|
||||
</script>
|
||||
<script defered src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
+9
-13
@@ -1,22 +1,18 @@
|
||||
{
|
||||
"title": "Notify.js",
|
||||
"name": "notify",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"author": {
|
||||
"name": "Jaime Pillora"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Evan Carroll"
|
||||
, "url": "http://www.evancarroll.com"
|
||||
, "email": "me@evancarroll.com"
|
||||
}
|
||||
],
|
||||
"homepage": "http://notifyjs.com/",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.x",
|
||||
"grunt-contrib-watch": "~0.1.4",
|
||||
"grunt-contrib-uglify": "~0.1.1rc6",
|
||||
"grunt-contrib-jshint": "~0.1.0",
|
||||
"grunt-contrib-concat": "~0.1.1",
|
||||
"grunt-contrib-coffee": "~0.4.0rc7",
|
||||
"grunt-wrap": "~0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"grunt-contrib-concat": "~0.3.0"
|
||||
}
|
||||
"main": "dist/notify.js"
|
||||
}
|
||||
|
||||
@@ -1,571 +0,0 @@
|
||||
|
||||
'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: """
|
||||
<div class="#{pluginClassName}-wrapper">
|
||||
<div class="#{pluginClassName}-arrow"></div>
|
||||
<div class="#{pluginClassName}-container"></div>
|
||||
</div>
|
||||
"""
|
||||
# <div class="#{pluginClassName}-debug"></div>
|
||||
# .#{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,'<br/>') 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
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
* Styles in CoffeeScript go here, which will be compiled into `dist/styles`
|
||||
* Styles in JavaScript can go straight in `dist/styles/`
|
||||
@@ -1,40 +0,0 @@
|
||||
|
||||
$.notify.addStyle "bootstrap",
|
||||
html: """
|
||||
<div>
|
||||
<span data-notify-text></span>
|
||||
</div>
|
||||
"""
|
||||
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)"
|
||||
Reference in New Issue
Block a user