replace compass with node-sass.

create new build tools.
This commit is contained in:
joyqi
2020-05-14 14:30:19 +08:00
parent 77ef00e1a0
commit 38f959890d
109 changed files with 43818 additions and 42091 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

+301
View File
@@ -0,0 +1,301 @@
/**
* @preserve HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.0';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
}(this, document));
File diff suppressed because it is too large Load Diff
+4980
View File
File diff suppressed because it is too large Load Diff
+9184
View File
File diff suppressed because it is too large Load Diff
+11714
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+443
View File
@@ -0,0 +1,443 @@
// Generated by CoffeeScript 1.12.7
/*
paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
https://github.com/layerssss/paste.js
*/
(function() {
var $, Paste, createHiddenEditable, dataURLtoBlob, isFocusable;
$ = window.jQuery;
$.paste = function(pasteContainer) {
var pm;
if (typeof console !== "undefined" && console !== null) {
console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead.");
}
pm = Paste.mountNonInputable(pasteContainer);
return pm._container;
};
$.fn.pastableNonInputable = function() {
var el, j, len, ref;
ref = this;
for (j = 0, len = ref.length; j < len; j++) {
el = ref[j];
if (el._pastable || $(el).is('textarea, input:text, [contenteditable]')) {
continue;
}
Paste.mountNonInputable(el);
el._pastable = true;
}
return this;
};
$.fn.pastableTextarea = function() {
var el, j, len, ref;
ref = this;
for (j = 0, len = ref.length; j < len; j++) {
el = ref[j];
if (el._pastable || $(el).is(':not(textarea, input:text)')) {
continue;
}
Paste.mountTextarea(el);
el._pastable = true;
}
return this;
};
$.fn.pastableContenteditable = function() {
var el, j, len, ref;
ref = this;
for (j = 0, len = ref.length; j < len; j++) {
el = ref[j];
if (el._pastable || $(el).is(':not([contenteditable])')) {
continue;
}
Paste.mountContenteditable(el);
el._pastable = true;
}
return this;
};
dataURLtoBlob = function(dataURL, sliceSize) {
var b64Data, byteArray, byteArrays, byteCharacters, byteNumbers, contentType, i, m, offset, ref, slice;
if (sliceSize == null) {
sliceSize = 512;
}
if (!(m = dataURL.match(/^data\:([^\;]+)\;base64\,(.+)$/))) {
return null;
}
ref = m, m = ref[0], contentType = ref[1], b64Data = ref[2];
byteCharacters = atob(b64Data);
byteArrays = [];
offset = 0;
while (offset < byteCharacters.length) {
slice = byteCharacters.slice(offset, offset + sliceSize);
byteNumbers = new Array(slice.length);
i = 0;
while (i < slice.length) {
byteNumbers[i] = slice.charCodeAt(i);
i++;
}
byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
offset += sliceSize;
}
return new Blob(byteArrays, {
type: contentType
});
};
createHiddenEditable = function() {
return $(document.createElement('div')).attr('contenteditable', true).attr('aria-hidden', true).attr('tabindex', -1).css({
width: 1,
height: 1,
position: 'fixed',
left: -100,
overflow: 'hidden',
opacity: 1e-17
});
};
isFocusable = function(element, hasTabindex) {
var fieldset, focusableIfVisible, img, map, mapName, nodeName;
map = void 0;
mapName = void 0;
img = void 0;
focusableIfVisible = void 0;
fieldset = void 0;
nodeName = element.nodeName.toLowerCase();
if ('area' === nodeName) {
map = element.parentNode;
mapName = map.name;
if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
return false;
}
img = $('img[usemap=\'#' + mapName + '\']');
return img.length > 0 && img.is(':visible');
}
if (/^(input|select|textarea|button|object)$/.test(nodeName)) {
focusableIfVisible = !element.disabled;
if (focusableIfVisible) {
fieldset = $(element).closest('fieldset')[0];
if (fieldset) {
focusableIfVisible = !fieldset.disabled;
}
}
} else if ('a' === nodeName) {
focusableIfVisible = element.href || hasTabindex;
} else {
focusableIfVisible = hasTabindex;
}
focusableIfVisible = focusableIfVisible || $(element).is('[contenteditable]');
return focusableIfVisible && $(element).is(':visible');
};
Paste = (function() {
Paste.prototype._target = null;
Paste.prototype._container = null;
Paste.mountNonInputable = function(nonInputable) {
var paste;
paste = new Paste(createHiddenEditable().appendTo(nonInputable), nonInputable);
$(nonInputable).on('click', (function(_this) {
return function(ev) {
if (!(isFocusable(ev.target, false) || window.getSelection().toString())) {
return paste._container.focus();
}
};
})(this));
paste._container.on('focus', (function(_this) {
return function() {
return $(nonInputable).addClass('pastable-focus');
};
})(this));
return paste._container.on('blur', (function(_this) {
return function() {
return $(nonInputable).removeClass('pastable-focus');
};
})(this));
};
Paste.mountTextarea = function(textarea) {
var ctlDown, paste, ref, ref1;
if ((typeof DataTransfer !== "undefined" && DataTransfer !== null ? DataTransfer.prototype : void 0) && ((ref = Object.getOwnPropertyDescriptor) != null ? (ref1 = ref.call(Object, DataTransfer.prototype, 'items')) != null ? ref1.get : void 0 : void 0)) {
return this.mountContenteditable(textarea);
}
paste = new Paste(createHiddenEditable().insertBefore(textarea), textarea);
ctlDown = false;
$(textarea).on('keyup', function(ev) {
var ref2;
if ((ref2 = ev.keyCode) === 17 || ref2 === 224) {
ctlDown = false;
}
return null;
});
$(textarea).on('keydown', function(ev) {
var ref2;
if ((ref2 = ev.keyCode) === 17 || ref2 === 224) {
ctlDown = true;
}
if ((ev.ctrlKey != null) && (ev.metaKey != null)) {
ctlDown = ev.ctrlKey || ev.metaKey;
}
if (ctlDown && ev.keyCode === 86) {
paste._textarea_focus_stolen = true;
paste._container.focus();
paste._paste_event_fired = false;
setTimeout((function(_this) {
return function() {
if (!paste._paste_event_fired) {
$(textarea).focus();
return paste._textarea_focus_stolen = false;
}
};
})(this), 1);
}
return null;
});
$(textarea).on('paste', (function(_this) {
return function() {};
})(this));
$(textarea).on('focus', (function(_this) {
return function() {
if (!paste._textarea_focus_stolen) {
return $(textarea).addClass('pastable-focus');
}
};
})(this));
$(textarea).on('blur', (function(_this) {
return function() {
if (!paste._textarea_focus_stolen) {
return $(textarea).removeClass('pastable-focus');
}
};
})(this));
$(paste._target).on('_pasteCheckContainerDone', (function(_this) {
return function() {
$(textarea).focus();
return paste._textarea_focus_stolen = false;
};
})(this));
return $(paste._target).on('pasteText', (function(_this) {
return function(ev, data) {
var content, curEnd, curStart;
curStart = $(textarea).prop('selectionStart');
curEnd = $(textarea).prop('selectionEnd');
content = $(textarea).val();
$(textarea).val("" + content.slice(0, curStart) + data.text + content.slice(curEnd));
$(textarea)[0].setSelectionRange(curStart + data.text.length, curStart + data.text.length);
return $(textarea).trigger('change');
};
})(this));
};
Paste.mountContenteditable = function(contenteditable) {
var paste;
paste = new Paste(contenteditable, contenteditable);
$(contenteditable).on('focus', (function(_this) {
return function() {
return $(contenteditable).addClass('pastable-focus');
};
})(this));
return $(contenteditable).on('blur', (function(_this) {
return function() {
return $(contenteditable).removeClass('pastable-focus');
};
})(this));
};
function Paste(_container, _target) {
this._container = _container;
this._target = _target;
this._container = $(this._container);
this._target = $(this._target).addClass('pastable');
this._container.on('paste', (function(_this) {
return function(ev) {
var _i, clipboardData, file, fileType, item, j, k, l, len, len1, len2, pastedFilename, reader, ref, ref1, ref2, ref3, ref4, stringIsFilename, text;
_this.originalEvent = (ev.originalEvent !== null ? ev.originalEvent : null);
_this._paste_event_fired = true;
if (((ref = ev.originalEvent) != null ? ref.clipboardData : void 0) != null) {
clipboardData = ev.originalEvent.clipboardData;
if (clipboardData.items) {
pastedFilename = null;
_this.originalEvent.pastedTypes = [];
ref1 = clipboardData.items;
for (j = 0, len = ref1.length; j < len; j++) {
item = ref1[j];
if (item.type.match(/^text\/(plain|rtf|html)/)) {
_this.originalEvent.pastedTypes.push(item.type);
}
}
ref2 = clipboardData.items;
for (_i = k = 0, len1 = ref2.length; k < len1; _i = ++k) {
item = ref2[_i];
if (item.type.match(/^image\//)) {
reader = new FileReader();
reader.onload = function(event) {
return _this._handleImage(event.target.result, _this.originalEvent, pastedFilename);
};
try {
reader.readAsDataURL(item.getAsFile());
} catch (error) {}
ev.preventDefault();
break;
}
if (item.type === 'text/plain') {
if (_i === 0 && clipboardData.items.length > 1 && clipboardData.items[1].type.match(/^image\//)) {
stringIsFilename = true;
fileType = clipboardData.items[1].type;
}
item.getAsString(function(string) {
if (stringIsFilename) {
pastedFilename = string;
return _this._target.trigger('pasteText', {
text: string,
isFilename: true,
fileType: fileType,
originalEvent: _this.originalEvent
});
} else {
return _this._target.trigger('pasteText', {
text: string,
originalEvent: _this.originalEvent
});
}
});
}
if (item.type === 'text/rtf') {
item.getAsString(function(string) {
return _this._target.trigger('pasteTextRich', {
text: string,
originalEvent: _this.originalEvent
});
});
}
if (item.type === 'text/html') {
item.getAsString(function(string) {
return _this._target.trigger('pasteTextHtml', {
text: string,
originalEvent: _this.originalEvent
});
});
}
}
} else {
if (-1 !== Array.prototype.indexOf.call(clipboardData.types, 'text/plain')) {
text = clipboardData.getData('Text');
setTimeout(function() {
return _this._target.trigger('pasteText', {
text: text,
originalEvent: _this.originalEvent
});
}, 1);
}
_this._checkImagesInContainer(function(src) {
return _this._handleImage(src, _this.originalEvent);
});
}
}
if (clipboardData = window.clipboardData) {
if ((ref3 = (text = clipboardData.getData('Text'))) != null ? ref3.length : void 0) {
setTimeout(function() {
_this._target.trigger('pasteText', {
text: text,
originalEvent: _this.originalEvent
});
return _this._target.trigger('_pasteCheckContainerDone');
}, 1);
} else {
ref4 = clipboardData.files;
for (l = 0, len2 = ref4.length; l < len2; l++) {
file = ref4[l];
_this._handleImage(URL.createObjectURL(file), _this.originalEvent);
}
_this._checkImagesInContainer(function(src) {});
}
}
return null;
};
})(this));
}
Paste.prototype._handleImage = function(src, e, name) {
var loader;
if (src.match(/^webkit\-fake\-url\:\/\//)) {
return this._target.trigger('pasteImageError', {
message: "You are trying to paste an image in Safari, however we are unable to retieve its data."
});
}
this._target.trigger('pasteImageStart');
loader = new Image();
loader.crossOrigin = "anonymous";
loader.onload = (function(_this) {
return function() {
var blob, canvas, ctx, dataURL;
canvas = document.createElement('canvas');
canvas.width = loader.width;
canvas.height = loader.height;
ctx = canvas.getContext('2d');
ctx.drawImage(loader, 0, 0, canvas.width, canvas.height);
dataURL = null;
try {
dataURL = canvas.toDataURL('image/png');
blob = dataURLtoBlob(dataURL);
} catch (error) {}
if (dataURL) {
_this._target.trigger('pasteImage', {
blob: blob,
dataURL: dataURL,
width: loader.width,
height: loader.height,
originalEvent: e,
name: name
});
}
return _this._target.trigger('pasteImageEnd');
};
})(this);
loader.onerror = (function(_this) {
return function() {
_this._target.trigger('pasteImageError', {
message: "Failed to get image from: " + src,
url: src
});
return _this._target.trigger('pasteImageEnd');
};
})(this);
return loader.src = src;
};
Paste.prototype._checkImagesInContainer = function(cb) {
var img, j, len, ref, timespan;
timespan = Math.floor(1000 * Math.random());
ref = this._container.find('img');
for (j = 0, len = ref.length; j < len; j++) {
img = ref[j];
img["_paste_marked_" + timespan] = true;
}
return setTimeout((function(_this) {
return function() {
var k, len1, ref1;
ref1 = _this._container.find('img');
for (k = 0, len1 = ref1.length; k < len1; k++) {
img = ref1[k];
if (!img["_paste_marked_" + timespan]) {
cb(img.src);
$(img).remove();
}
}
return _this._target.trigger('_pasteCheckContainerDone');
};
})(this), 1);
};
return Paste;
})();
}).call(this);
+2497
View File
File diff suppressed because it is too large Load Diff
+237
View File
@@ -0,0 +1,237 @@
/*! Respond.js v1.4.2: min/max-width media query polyfill
* Copyright 2013 Scott Jehl
* Licensed under MIT
* http://j.mp/respondjs */
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
(function(w) {
"use strict";
w.matchMedia = w.matchMedia || function(doc, undefined) {
var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
div.id = "mq-test-1";
div.style.cssText = "position:absolute;top:-100em";
fakeBody.style.background = "none";
fakeBody.appendChild(div);
return function(q) {
div.innerHTML = '&shy;<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';
docElem.insertBefore(fakeBody, refNode);
bool = div.offsetWidth === 42;
docElem.removeChild(fakeBody);
return {
matches: bool,
media: q
};
};
}(w.document);
})(this);
(function(w) {
"use strict";
var respond = {};
w.respond = respond;
respond.update = function() {};
var requestQueue = [], xmlHttp = function() {
var xmlhttpmethod = false;
try {
xmlhttpmethod = new w.XMLHttpRequest();
} catch (e) {
xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
}
return function() {
return xmlhttpmethod;
};
}(), ajax = function(url, callback) {
var req = xmlHttp();
if (!req) {
return;
}
req.open("GET", url, true);
req.onreadystatechange = function() {
if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
return;
}
callback(req.responseText);
};
if (req.readyState === 4) {
return;
}
req.send(null);
}, isUnsupportedMediaQuery = function(query) {
return query.replace(respond.regex.minmaxwh, "").match(respond.regex.other);
};
respond.ajax = ajax;
respond.queue = requestQueue;
respond.unsupportedmq = isUnsupportedMediaQuery;
respond.regex = {
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
only: /(only\s+)?([a-zA-Z]+)\s?/,
minw: /\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
maxw: /\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
minmaxwh: /\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,
other: /\([^\)]*\)/g
};
respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
if (respond.mediaQueriesSupported) {
return;
}
var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
div.style.cssText = "position:absolute;font-size:1em;width:1em";
if (!body) {
body = fakeUsed = doc.createElement("body");
body.style.background = "none";
}
docElem.style.fontSize = "100%";
body.style.fontSize = "100%";
body.appendChild(div);
if (fakeUsed) {
docElem.insertBefore(body, docElem.firstChild);
}
ret = div.offsetWidth;
if (fakeUsed) {
docElem.removeChild(body);
} else {
body.removeChild(div);
}
docElem.style.fontSize = originalHTMLFontSize;
if (originalBodyFontSize) {
body.style.fontSize = originalBodyFontSize;
}
ret = eminpx = parseFloat(ret);
return ret;
}, applyMedia = function(fromResize) {
var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
if (fromResize && lastCall && now - lastCall < resizeThrottle) {
w.clearTimeout(resizeDefer);
resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
return;
} else {
lastCall = now;
}
for (var i in mediastyles) {
if (mediastyles.hasOwnProperty(i)) {
var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
if (!!min) {
min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
}
if (!!max) {
max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
}
if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
if (!styleBlocks[thisstyle.media]) {
styleBlocks[thisstyle.media] = [];
}
styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
}
}
}
for (var j in appendedEls) {
if (appendedEls.hasOwnProperty(j)) {
if (appendedEls[j] && appendedEls[j].parentNode === head) {
head.removeChild(appendedEls[j]);
}
}
}
appendedEls.length = 0;
for (var k in styleBlocks) {
if (styleBlocks.hasOwnProperty(k)) {
var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
ss.type = "text/css";
ss.media = k;
head.insertBefore(ss, lastLink.nextSibling);
if (ss.styleSheet) {
ss.styleSheet.cssText = css;
} else {
ss.appendChild(doc.createTextNode(css));
}
appendedEls.push(ss);
}
}
}, translate = function(styles, href, media) {
var qs = styles.replace(respond.regex.comments, "").replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
href = href.substring(0, href.lastIndexOf("/"));
var repUrls = function(css) {
return css.replace(respond.regex.urls, "$1" + href + "$2$3");
}, useMedia = !ql && media;
if (href.length) {
href += "/";
}
if (useMedia) {
ql = 1;
}
for (var i = 0; i < ql; i++) {
var fullq, thisq, eachq, eql;
if (useMedia) {
fullq = media;
rules.push(repUrls(styles));
} else {
fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
rules.push(RegExp.$2 && repUrls(RegExp.$2));
}
eachq = fullq.split(",");
eql = eachq.length;
for (var j = 0; j < eql; j++) {
thisq = eachq[j];
if (isUnsupportedMediaQuery(thisq)) {
continue;
}
mediastyles.push({
media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
rules: rules.length - 1,
hasquery: thisq.indexOf("(") > -1,
minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
});
}
}
applyMedia();
}, makeRequests = function() {
if (requestQueue.length) {
var thisRequest = requestQueue.shift();
ajax(thisRequest.href, function(styles) {
translate(styles, thisRequest.href, thisRequest.media);
parsedSheets[thisRequest.href] = true;
w.setTimeout(function() {
makeRequests();
}, 0);
});
}
}, ripCSS = function() {
for (var i = 0; i < links.length; i++) {
var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
if (!!href && isCSS && !parsedSheets[href]) {
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
translate(sheet.styleSheet.rawCssText, href, media);
parsedSheets[href] = true;
} else {
if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
if (href.substring(0, 2) === "//") {
href = w.location.protocol + href;
}
requestQueue.push({
href: href,
media: media
});
}
}
}
}
makeRequests();
};
ripCSS();
respond.update = ripCSS;
respond.getEmValue = getEmValue;
function callMedia() {
applyMedia(true);
}
if (w.addEventListener) {
w.addEventListener("resize", callMedia, false);
} else if (w.attachEvent) {
w.attachEvent("onresize", callMedia);
}
})(this);
File diff suppressed because it is too large Load Diff
+877
View File
@@ -0,0 +1,877 @@
/*
* jQuery Plugin: Tokenizing Autocomplete Text Entry
* Version 1.6.0
*
* Copyright (c) 2009 James Smith (http://loopj.com)
* Licensed jointly under the GPL and MIT licenses,
* choose which one suits your project best!
*
*/
(function ($) {
// Default settings
var DEFAULT_SETTINGS = {
// Search settings
method: "GET",
contentType: "json",
queryParam: "q",
searchDelay: 300,
minChars: 1,
propertyToSearch: "name",
jsonContainer: null,
// Display settings
hintText: "Type in a search term",
noResultsText: "No results",
searchingText: "Searching...",
deleteText: "&times;",
animateDropdown: true,
// Tokenization settings
tokenLimit: null,
tokenDelimiter: ",",
preventDuplicates: false,
// Output settings
tokenValue: "id",
// Prepopulation settings
prePopulate: null,
processPrePopulate: false,
// Manipulation settings
idPrefix: "token-input-",
// Formatters
resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
// Callbacks
onResult: null,
onAdd: null,
onDelete: null,
onReady: null
};
// Default classes to use when theming
var DEFAULT_CLASSES = {
tokenList: "token-input-list",
token: "token-input-token",
tokenDelete: "token-input-delete-token",
selectedToken: "token-input-selected-token",
highlightedToken: "token-input-highlighted-token",
dropdown: "token-input-dropdown",
dropdownItem: "token-input-dropdown-item",
dropdownItem2: "token-input-dropdown-item2",
selectedDropdownItem: "token-input-selected-dropdown-item",
inputToken: "token-input-input-token"
};
// Input box position "enum"
var POSITION = {
BEFORE: 0,
AFTER: 1,
END: 2
};
// Keys "enum"
var KEY = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
ESCAPE: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
NUMPAD_ENTER: 108,
COMMA: 188
};
// Additional public (exposed) methods
var methods = {
init: function(url_or_data_or_function, options) {
var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
return this.each(function () {
$(this).data("tokenInputObject", new $.TokenList(this, url_or_data_or_function, settings));
});
},
clear: function() {
this.data("tokenInputObject").clear();
return this;
},
add: function(item) {
this.data("tokenInputObject").add(item);
return this;
},
remove: function(item) {
this.data("tokenInputObject").remove(item);
return this;
},
get: function() {
return this.data("tokenInputObject").getTokens();
}
}
// Expose the .tokenInput function to jQuery as a plugin
$.fn.tokenInput = function (method) {
// Method calling and initialization logic
if(methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else {
return methods.init.apply(this, arguments);
}
};
// TokenList class for each input
$.TokenList = function (input, url_or_data, settings) {
//
// Initialization
//
// Configure the data source
if($.type(url_or_data) === "string" || $.type(url_or_data) === "function") {
// Set the url to query against
settings.url = url_or_data;
// If the URL is a function, evaluate it here to do our initalization work
var url = computeURL();
// Make a smart guess about cross-domain if it wasn't explicitly specified
if(settings.crossDomain === undefined) {
if(url.indexOf("://") === -1) {
settings.crossDomain = false;
} else {
settings.crossDomain = (location.href.split(/\/+/g)[1] !== url.split(/\/+/g)[1]);
}
}
} else if(typeof(url_or_data) === "object") {
// Set the local data to search through
settings.local_data = url_or_data;
}
// Build class names
if(settings.classes) {
// Use custom class names
settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
} else if(settings.theme) {
// Use theme-suffixed default class names
settings.classes = {};
$.each(DEFAULT_CLASSES, function(key, value) {
settings.classes[key] = value + "-" + settings.theme;
});
} else {
settings.classes = DEFAULT_CLASSES;
}
// Save the tokens
var saved_tokens = [];
// Keep track of the number of tokens in the list
var token_count = 0;
// Basic cache to save on db hits
var cache = new $.TokenList.Cache();
// Keep track of the timeout, old vals
var timeout;
var input_val;
// Create a new text input an attach keyup events
var input_box = $("<input type=\"text\" autocomplete=\"off\">")
.css({
outline: "none"
})
.attr("id", settings.idPrefix + input.id)
.focus(function () {
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
show_dropdown_hint();
}
})
.blur(function () {
hide_dropdown();
$(this).val("");
})
// .bind("keyup keydown blur update", resize_input)
.keydown(function (event) {
var previous_token;
var next_token;
switch(event.keyCode) {
case KEY.LEFT:
case KEY.RIGHT:
case KEY.UP:
case KEY.DOWN:
if(!$(this).val()) {
previous_token = input_token.prev();
next_token = input_token.next();
if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
// Check if there is a previous/next token and it is selected
if(event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
deselect_token($(selected_token), POSITION.BEFORE);
} else {
deselect_token($(selected_token), POSITION.AFTER);
}
} else if((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
// We are moving left, select the previous token if it exists
select_token($(previous_token.get(0)));
} else if((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
// We are moving right, select the next token if it exists
select_token($(next_token.get(0)));
}
} else {
var dropdown_item = null;
if(event.keyCode === KEY.DOWN || event.keyCode === KEY.RIGHT) {
dropdown_item = $(selected_dropdown_item).next();
} else {
dropdown_item = $(selected_dropdown_item).prev();
}
if(dropdown_item.length) {
select_dropdown_item(dropdown_item);
}
return false;
}
break;
case KEY.BACKSPACE:
previous_token = input_token.prev();
if(!$(this).val().length) {
if(selected_token) {
delete_token($(selected_token));
hidden_input.change();
} else if(previous_token.length) {
select_token($(previous_token.get(0)));
}
return false;
} else if($(this).val().length === 1) {
hide_dropdown();
} else {
// set a timeout just long enough to let this function finish.
setTimeout(function(){do_search();}, 5);
}
break;
// case KEY.TAB:
case KEY.ENTER:
case KEY.NUMPAD_ENTER:
case KEY.COMMA:
if(selected_dropdown_item) {
add_token($(selected_dropdown_item).data("tokeninput"));
hidden_input.change();
return false;
} else {
add_token(null);
return false;
}
break;
case KEY.ESCAPE:
hide_dropdown();
return true;
default:
if(String.fromCharCode(event.which)) {
// set a timeout just long enough to let this function finish.
setTimeout(function(){do_search();}, 5);
}
break;
}
});
// Keep a reference to the original input box
var hidden_input = $(input)
.hide()
.val("")
.focus(function () {
input_box.focus();
})
.blur(function () {
input_box.blur();
});
// Keep a reference to the selected token and dropdown item
var selected_token = null;
var selected_token_index = 0;
var selected_dropdown_item = null;
// The list to store the token items in
var token_list = $("<ul />")
.addClass(settings.classes.tokenList)
.click(function (event) {
var li = $(event.target).closest("li");
if(li && li.get(0) && $.data(li.get(0), "tokeninput")) {
toggle_select_token(li);
} else {
// Deselect selected token
if(selected_token) {
deselect_token($(selected_token), POSITION.END);
}
// Focus input box
input_box.focus();
}
})
.mouseover(function (event) {
var li = $(event.target).closest("li");
if(li && selected_token !== this) {
li.addClass(settings.classes.highlightedToken);
}
})
.mouseout(function (event) {
var li = $(event.target).closest("li");
if(li && selected_token !== this) {
li.removeClass(settings.classes.highlightedToken);
}
})
.insertBefore(hidden_input);
// The token holding the input box
var input_token = $("<li />")
.addClass(settings.classes.inputToken)
.appendTo(token_list)
.append(input_box);
// The list to store the dropdown items in
var dropdown = $("<div>")
.addClass(settings.classes.dropdown)
.appendTo("body")
.hide();
// Magic element to help us resize the text input
var input_resizer = $("<tester/>")
.insertAfter(input_box)
.css({
position: "absolute",
top: -9999,
left: -9999,
width: "auto",
fontSize: input_box.css("fontSize"),
fontFamily: input_box.css("fontFamily"),
fontWeight: input_box.css("fontWeight"),
letterSpacing: input_box.css("letterSpacing"),
whiteSpace: "nowrap"
});
// Pre-populate list if items exist
hidden_input.val("");
var li_data = settings.prePopulate || hidden_input.data("pre");
if(settings.processPrePopulate && $.isFunction(settings.onResult)) {
li_data = settings.onResult.call(hidden_input, li_data);
}
if(li_data && li_data.length) {
$.each(li_data, function (index, value) {
insert_token(value);
checkTokenLimit();
});
}
// Initialization is done
if($.isFunction(settings.onReady)) {
settings.onReady.call();
}
//
// Public functions
//
this.clear = function() {
token_list.children("li").each(function() {
if ($(this).children("input").length === 0) {
delete_token($(this));
}
});
}
this.add = function(item) {
add_token(item);
}
this.remove = function(item) {
token_list.children("li").each(function() {
if ($(this).children("input").length === 0) {
var currToken = $(this).data("tokeninput");
var match = true;
for (var prop in item) {
if (item[prop] !== currToken[prop]) {
match = false;
break;
}
}
if (match) {
delete_token($(this));
}
}
});
}
this.getTokens = function() {
return saved_tokens;
}
//
// Private functions
//
function checkTokenLimit() {
if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
input_box.hide();
hide_dropdown();
return;
}
}
function resize_input() {
if(input_val === (input_val = input_box.val())) {return;}
// Enter new content into resizer and resize input accordingly
var escaped = input_val.replace(/&/g, '&amp;').replace(/\s/g,' ').replace(/</g, '&lt;').replace(/>/g, '&gt;');
input_resizer.html(escaped);
input_box.width(input_resizer.width() + 30);
}
function is_printable_character(keycode) {
return ((keycode >= 48 && keycode <= 90) || // 0-1a-z
(keycode >= 96 && keycode <= 111) || // numpad 0-9 + - / * .
(keycode >= 186 && keycode <= 192) || // ; = , - . / ^
(keycode >= 219 && keycode <= 222)); // ( \ ) '
}
// Inner function to a token to the list
function insert_token(item) {
var this_token = settings.tokenFormatter(item);
this_token = $(this_token)
.addClass(settings.classes.token)
.insertBefore(input_token);
// The 'delete token' button
$("<span>" + settings.deleteText + "</span>")
.addClass(settings.classes.tokenDelete)
.appendTo(this_token)
.click(function () {
delete_token($(this).parent());
hidden_input.change();
return false;
});
// Store data on the token
var token_data = {"id": item.id};
token_data[settings.propertyToSearch] = item[settings.propertyToSearch];
$.data(this_token.get(0), "tokeninput", item);
// Save this token for duplicate checking
saved_tokens = saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
selected_token_index++;
// Update the hidden input
update_hidden_input(saved_tokens, hidden_input);
token_count += 1;
// Check the token limit
if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
input_box.hide();
hide_dropdown();
}
return this_token;
}
// Add a token to the token list based on user input
function add_token (item) {
var callback = settings.onAdd;
// fix null bug
if (!item && input_box.val().length > 0) {
item = {
id : input_box.val()
};
item[settings.propertyToSearch] = input_box.val();
}
if (!item) {
return false;
}
// See if the token already exists and select it if we don't want duplicates
if(token_count > 0 && settings.preventDuplicates) {
var found_existing_token = null;
token_list.children().each(function () {
var existing_token = $(this);
var existing_data = $.data(existing_token.get(0), "tokeninput");
if(existing_data && existing_data.id === item.id) {
found_existing_token = existing_token;
return false;
}
});
if(found_existing_token) {
select_token(found_existing_token);
input_token.insertAfter(found_existing_token);
input_box.focus();
return;
}
}
// Insert the new tokens
if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
insert_token(item);
checkTokenLimit();
}
// Clear input box
input_box.val("");
// Don't show the help dropdown, they've got the idea
hide_dropdown();
// Execute the onAdd callback if defined
if($.isFunction(callback)) {
callback.call(hidden_input,item);
}
}
// Select a token in the token list
function select_token (token) {
token.addClass(settings.classes.selectedToken);
selected_token = token.get(0);
// Hide input box
input_box.val("");
// Hide dropdown if it is visible (eg if we clicked to select token)
hide_dropdown();
}
// Deselect a token in the token list
function deselect_token (token, position) {
token.removeClass(settings.classes.selectedToken);
selected_token = null;
if(position === POSITION.BEFORE) {
input_token.insertBefore(token);
selected_token_index--;
} else if(position === POSITION.AFTER) {
input_token.insertAfter(token);
selected_token_index++;
} else {
input_token.appendTo(token_list);
selected_token_index = token_count;
}
// Show the input box and give it focus again
input_box.focus();
}
// Toggle selection of a token in the token list
function toggle_select_token(token) {
var previous_selected_token = selected_token;
if(selected_token) {
deselect_token($(selected_token), POSITION.END);
}
if(previous_selected_token === token.get(0)) {
deselect_token(token, POSITION.END);
} else {
select_token(token);
}
}
// Delete a token from the token list
function delete_token (token) {
// Remove the id from the saved list
var token_data = $.data(token.get(0), "tokeninput");
var callback = settings.onDelete;
var index = token.prevAll().length;
if(index > selected_token_index) index--;
// Delete the token
token.remove();
selected_token = null;
// Show the input box and give it focus again
input_box.focus();
// Remove this token from the saved list
saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
if(index < selected_token_index) selected_token_index--;
// Update the hidden input
update_hidden_input(saved_tokens, hidden_input);
token_count -= 1;
if(settings.tokenLimit !== null) {
input_box
.show()
.val("")
.focus();
}
// Execute the onDelete callback if defined
if($.isFunction(callback)) {
callback.call(hidden_input,token_data);
}
}
// Update the hidden input box value
function update_hidden_input(saved_tokens, hidden_input) {
var token_values = $.map(saved_tokens, function (el) {
return el[settings.tokenValue];
});
hidden_input.val(token_values.join(settings.tokenDelimiter));
}
// Hide and clear the results dropdown
function hide_dropdown () {
dropdown.hide().empty();
selected_dropdown_item = null;
}
function show_dropdown() {
dropdown
.css({
position: "absolute",
top: $(token_list).offset().top + $(token_list).outerHeight(),
left: $(token_list).offset().left,
zindex: 999
})
.show();
}
function show_dropdown_searching () {
if(settings.searchingText) {
dropdown.html("<p>"+settings.searchingText+"</p>");
show_dropdown();
}
}
function show_dropdown_hint () {
if(settings.hintText) {
dropdown.html("<p>"+settings.hintText+"</p>");
show_dropdown();
}
}
// Highlight the query part of the search term
function highlight_term(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
}
function find_value_and_highlight_term(template, value, term) {
return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + value + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term));
}
// Populate the results dropdown with some results
function populate_dropdown (query, results) {
if(results && results.length) {
dropdown.empty();
var dropdown_ul = $("<ul>")
.appendTo(dropdown)
.mouseover(function (event) {
select_dropdown_item($(event.target).closest("li"));
})
.mousedown(function (event) {
add_token($(event.target).closest("li").data("tokeninput"));
hidden_input.change();
return false;
})
.hide();
$.each(results, function(index, value) {
var this_li = settings.resultsFormatter(value);
this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);
this_li = $(this_li).appendTo(dropdown_ul);
if(index % 2) {
this_li.addClass(settings.classes.dropdownItem);
} else {
this_li.addClass(settings.classes.dropdownItem2);
}
if(index === 0) {
select_dropdown_item(this_li);
}
$.data(this_li.get(0), "tokeninput", value);
});
show_dropdown();
if(settings.animateDropdown) {
dropdown_ul.slideDown("fast");
} else {
dropdown_ul.show();
}
} else {
if(settings.noResultsText) {
dropdown.html("<p>"+settings.noResultsText+"</p>");
show_dropdown();
}
}
}
// Highlight an item in the results dropdown
function select_dropdown_item (item) {
if(item) {
if(selected_dropdown_item) {
deselect_dropdown_item($(selected_dropdown_item));
}
item.addClass(settings.classes.selectedDropdownItem);
selected_dropdown_item = item.get(0);
}
}
// Remove highlighting from an item in the results dropdown
function deselect_dropdown_item (item) {
item.removeClass(settings.classes.selectedDropdownItem);
selected_dropdown_item = null;
}
// Do a search and show the "searching" dropdown if the input is longer
// than settings.minChars
function do_search() {
var val = input_box.val(), query = val.toLowerCase();
if(query && query.length) {
if(selected_token) {
deselect_token($(selected_token), POSITION.AFTER);
}
if(query.length >= settings.minChars) {
show_dropdown_searching();
clearTimeout(timeout);
timeout = setTimeout(function(){
run_search(query, val);
}, settings.searchDelay);
} else {
hide_dropdown();
}
}
}
// Do the actual search
function run_search(query, val) {
var cache_key = val + computeURL();
var cached_results = cache.get(cache_key);
if(cached_results) {
populate_dropdown(query, cached_results);
} else {
// Are we doing an ajax search or local data search?
if(settings.url) {
var url = computeURL();
// Extract exisiting get params
var ajax_params = {};
ajax_params.data = {};
if(url.indexOf("?") > -1) {
var parts = url.split("?");
ajax_params.url = parts[0];
var param_array = parts[1].split("&");
$.each(param_array, function (index, value) {
var kv = value.split("=");
ajax_params.data[kv[0]] = kv[1];
});
} else {
ajax_params.url = url;
}
// Prepare the request
ajax_params.data[settings.queryParam] = query;
ajax_params.type = settings.method;
ajax_params.dataType = settings.contentType;
if(settings.crossDomain) {
ajax_params.dataType = "jsonp";
}
// Attach the success callback
ajax_params.success = function(results) {
if($.isFunction(settings.onResult)) {
results = settings.onResult.call(hidden_input, results, query, val);
}
cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);
// only populate the dropdown if the results are associated with the active search query
if(input_box.val().toLowerCase() === query) {
populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
}
};
// Make the request
$.ajax(ajax_params);
} else if(settings.local_data) {
// Do the search through local data
var results = $.grep(settings.local_data, function (row) {
return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
});
if($.isFunction(settings.onResult)) {
results = settings.onResult.call(hidden_input, results, query, val);
}
cache.add(cache_key, results);
populate_dropdown(query, results);
}
}
}
// compute the dynamic URL
function computeURL() {
var url = settings.url;
if(typeof settings.url == 'function') {
url = settings.url.call();
}
return url;
}
};
// Really basic cache for the results
$.TokenList.Cache = function (options) {
var settings = $.extend({
max_size: 500
}, options);
var data = {};
var size = 0;
var flush = function () {
data = {};
size = 0;
};
this.add = function (query, results) {
if(size > settings.max_size) {
flush();
}
if(!data[query]) {
size += 1;
}
data[query] = results;
};
this.get = function (query) {
return data[query];
};
};
}(jQuery));
File diff suppressed because it is too large Load Diff
+112
View File
@@ -0,0 +1,112 @@
/**
* Buttons
*/
@mixin button($color) {
border: none;
background-color: $color;
cursor: pointer;
border-radius: 2px;
// @include transition-property(background-color);
&:hover {
transition-duration: .4s;
background-color: darken($color, 6%);
}
&:active, &.active {
background-color: darken($color, 8%);
}
&:disabled {
background-color: lighten($color, 6%);
cursor: default;
}
}
.btn {
@include button(#E9E9E6);
display: inline-block;
padding: 0 12px;
height: 32px;
color: #666;
vertical-align: middle;
zoom: 1;
&:disabled {
color: #999;
}
}
.btn-xs {
padding: 0 10px;
height: 25px;
font-size: 13px;
}
.btn-s { height: 28px; }
.btn-l {
height: 40px;
font-size: 1.14286em;
font-weight: bold;
}
.primary {
@include button(#467B96);
color: #FFF;
}
.btn-group {
display: inline-block;
}
.btn-warn {
@include button(#B94A48);
color: #FFF;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active,
.btn-link.active {
background-color: transparent;
}
/* 下拉菜单 */
.btn-drop {
position: relative;
}
.dropdown-toggle {
padding-right: 8px;
}
.dropdown-menu {
list-style: none;
position: absolute;
z-index: 2;
left: 0;
margin: 0;
padding: 0;
border: 1px solid #D9D9D6;
background: #FFF;
text-align: left;
min-width: 108px;
display: none;
li {
white-space: nowrap;
&.multiline {
padding: 5px 12px 12px;
}
}
a {
display: block;
padding: 5px 12px;
color: #666;
&:hover {
background: #F6F6F3;
text-decoration: none !important;
}
}
}
+3
View File
@@ -0,0 +1,3 @@
@import "components/editor";
@import "components/timepicker";
@import "components/tokeninput";
+20
View File
@@ -0,0 +1,20 @@
/**
* 注脚
*/
.typecho-foot {
padding: 4em 0 3em;
color: #999;
line-height: 1.8;
text-align: center;
.copyright p {
margin: 10px 0 0;
}
.resource {
color: #CCC;
}
.resource a {
margin: 0 3px;
color: #999;
}
}
+47
View File
@@ -0,0 +1,47 @@
/**
* Forms
*/
input[type=text], input[type=password], input[type=email],
textarea {
background: #FFF;
border: 1px solid #D9D9D6;
padding: 7px;
border-radius: 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
textarea {
resize: vertical;
line-height: 1.5;
}
input[type="radio"], input[type="checkbox"] { margin-right: 3px; }
input, textarea {
&.text-s { padding: 5px; }
&.text-l {
padding: 10px;
font-size: 1.14286em;
}
}
.w-10 { width: 10%; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-40 { width: 40%;}
.w-50 { width: 50%;}
.w-60 { width: 60%;}
.w-70 { width: 70%;}
.w-80 { width: 80%;}
.w-90 { width: 90%;}
.w-100 { width: 100%;}
select {
border: 1px solid #CCC;
height: 28px;
}
+109
View File
@@ -0,0 +1,109 @@
/**
* 后台头部导航
*/
.typecho-head-nav {
padding: 0 10px;
background: #292D33;
}
.typecho-head-nav a {
color: #BBB;
}
.typecho-head-nav a:hover,
.typecho-head-nav a:focus {
color: #FFF;
text-decoration: none;
}
#typecho-nav-list {
float: left;
ul {
list-style: none;
margin: 0;
padding: 0;
}
}
#typecho-nav-list ul:first-child {
border-left: 1px solid #383D45;
}
#typecho-nav-list .root {
position: relative;
float: left;
}
#typecho-nav-list .parent a {
display: block;
float: left;
padding: 0 20px;
border-right: 1px solid #383D45;
height: 36px;
line-height: 36px;
color: #BBB;
}
#typecho-nav-list .parent a:hover,
#typecho-nav-list .focus .parent a,
#typecho-nav-list .root:hover .parent a {
background: #202328;
color: #FFF;
text-decoration: none;
}
#typecho-nav-list .focus .parent a {
font-weight: bold;
}
#typecho-nav-list .child {
position: absolute;
top: 36px;
display: none;
margin: 0;
min-width: 160px;
max-width: 240px;
background: #202328;
z-index: 250;
}
#typecho-nav-list .root:hover .child {
display: block;
}
#typecho-nav-list .child li a {
color: #BBB;
display: block;
padding: 0 20px;
overflow: hidden;
text-overflow : ellipsis;
white-space: nowrap;
height: 36px;
line-height: 36px;
}
#typecho-nav-list .child li a:hover,
#typecho-nav-list .child li a:focus {
background: #292D33;
color: #FFF;
}
#typecho-nav-list .child li.focus a {
color: #6DA1BB;
font-weight: bold;
}
.typecho-head-nav .operate {
float: right;
}
.typecho-head-nav .operate a {
display: inline-block;
margin-left: -1px;
padding: 0 20px;
border: 1px solid #383D45;
border-width: 0 1px;
line-height: 36px;
color: #BBB;
}
.typecho-head-nav .operate a:hover {
background-color: #202328;
color: #FFF;
}
+46
View File
@@ -0,0 +1,46 @@
/*
* Hide from both screenreaders and browsers: h5bp.com/u
*/
.hidden {
display: none;
// display: none !important;
// visibility: hidden;
}
/*
* Hide only visually, but have it available for screenreaders: h5bp.com/v
*/
.sr-only {
border: 0;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/*
* Extends the .sr-only class to allow the element to be focusable
* when navigated to via the keyboard: h5bp.com/p
*/
.sr-only.focusable:active,
.sr-only.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
}
/*
* Hide visually and from screenreaders, but maintain layout
*/
.invisible {
visibility: hidden;
}
+185
View File
@@ -0,0 +1,185 @@
/**
* icons
*/
@import "icons/*.png";
@include all-icons-sprites(true);
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "icons-2x/*.png";
@include all-icons-sprites();
}
/*
@mixin sprite-background($name) {
// background-image: sprite-url($sprites);
// background-position: sprite-position($sprites, $name);
@include icons-sprite($name);
// background-repeat: no-repeat;
// display: block;
// height: image-height(sprite-file($sprites, $name));
// width: image-width(sprite-file($sprites, $name));
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@include icons-2x-sprite($name);
// Workaround for https://gist.github.com/2140082
//@if (sprite-position($sprites, $name) != sprite-position($sprites-retina, $name)) {
// $ypos: round(nth(sprite-position($sprites-retina, $name), 2) / 2);
// background-position: 0 $ypos;
//}
// Hard coded width of the normal sprite image. There must be a smarter way to do this.
// @include background-size(auto 256px);
// background-image: sprite-url($sprites-retina);
}
}
*/
%i-base {
display: inline-block;
vertical-align: text-bottom;
text-indent: -9999em;
&:hover {
opacity: 0.75;
}
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
// Hard coded width of the normal sprite image. There must be a smarter way to do this.
background-size: auto 256px;
}
}
%i-16 {
@extend %i-base;
width: 16px;
height: 16px;
}
%i-24 {
@extend %i-base;
width: 24px;
height: 24px;
}
.i-edit {
@extend %i-16;
@include icons-sprite(icon-edit);
}
.i-delete {
@extend %i-16;
@include icons-sprite(icon-delete);
}
// 大号上传按钮
.i-upload {
@extend %i-24;
@include icons-sprite(icon-upload);
}
.i-upload-active {
@extend %i-24;
@include icons-sprite(icon-upload-active);
}
// 小箭头
.i-caret-up, .i-caret-down, .i-caret-left, .i-caret-right {
display: inline-block;
border-style: solid;
border-color: transparent transparent #BBB transparent;
border-width: 3px 4px 5px;
}
.i-caret-down {
border-color: #BBB transparent transparent transparent;
border-width: 5px 4px 3px;
}
.i-caret-left {
border-color: transparent #BBB transparent transparent;
border-width: 4px 5px 4px 3px;
}
.i-caret-right {
border-color: transparent transparent transparent #BBB;
border-width: 4px 3px 4px 5px;
}
.i-exlink {
@extend %i-16;
@include icons-sprite(icon-exlink);
}
/* 文件类型图标 */
.mime-office {
@extend %i-16;
@include icons-sprite(mime-office);
}
.mime-text {
@extend %i-16;
@include icons-sprite(mime-text);
}
.mime-image {
@extend %i-16;
@include icons-sprite(mime-image);
}
.mime-html {
@extend %i-16;
@include icons-sprite(mime-html);
}
.mime-archive {
@extend %i-16;
@include icons-sprite(mime-archive);
}
.mime-application {
@extend %i-16;
@include icons-sprite(mime-application);
}
.mime-audio {
@extend %i-16;
@include icons-sprite(mime-audio);
}
.mime-script {
@extend %i-16;
@include icons-sprite(mime-script);
}
.mime-video {
@extend %i-16;
@include icons-sprite(mime-video);
}
.mime-unknow {
@extend %i-16;
@include icons-sprite(mime-unknow);
}
/* Logo 图标 */
.i-logo, .i-logo-s {
width: 169px;
height: 40px;
display: inline-block;
background: url("../img/typecho-logo.svg") no-repeat;
text-indent: -9999em;
background-size: auto 40px;
opacity: .15;
&:hover {
opacity: .2;
}
}
.i-logo-s {
width: 26px;
height: 26px;
background-size: auto 26px;
}
+49
View File
@@ -0,0 +1,49 @@
/**
* 提示信息框
*/
.message {
padding: 8px 10px;
border-radius: 2px;
}
.message a {
font-weight: bold;
text-decoration: underline;
}
.error {
background: #FBE3E4;
color: #8A1F11;
}
.error a { color: #8A1F11; }
.notice {
background: #FFF6BF;
color: #8A6D3B;
}
.notice a { color: #8A6D3B; }
.success {
background: #E6EFC2;
color: #264409;
}
.success a { color: #264409; }
// 气泡
.balloon {
display: inline-block;
padding: 0 4px;
min-width: 10px;
height: 14px;
line-height: 14px;
background: #B9B9B6;
vertical-align: text-top;
text-align: center;
font-size: 12px;
color: #FFF;
border-radius: 20px;
}
+36
View File
@@ -0,0 +1,36 @@
/**
* 后台分页
*/
.typecho-pager {
list-style: none;
float: right;
margin: 0;
padding: 0;
line-height: 1;
text-align: center;
zoom: 1;
}
.typecho-pager li {
display: inline-block;
margin: 0 3px;
height: 28px;
line-height: 28px;
}
.typecho-pager a {
display: block;
padding: 0 10px;
border-radius: 2px;
}
.typecho-pager a:hover {
text-decoration: none;
background: #E9E9E6;
}
.typecho-pager li.current a {
background: #E9E9E6;
color: #444;
}
+281
View File
@@ -0,0 +1,281 @@
/*
* Editor
*/
.editor {
margin-bottom: -0.5em;
}
.wmd-button-row {
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
li {
display: inline-block;
margin-right: 4px;
padding: 3px;
cursor: pointer;
vertical-align: middle;
border-radius: 2px;
&:hover {
background-color: #E9E9E6;
}
&.wmd-spacer {
height: 20px;
margin: 0 10px 0 6px;
padding: 0;
width: 1px;
background: #E9E9E6;
cursor: default;
}
}
}
#wmd-button-row span {
display: block;
width: 20px;
height: 20px;
background: transparent url(../img/editor.png) no-repeat;
}
#btn-cancel-preview { display: none }
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
#wmd-button-row span {
background-image: url(../img/editor@2x.png);
background-size: 320px auto;
}
}
// 撰写预览切换 tab
.wmd-edittab {
float: right;
margin-top: 3px;
font-size: .92857em;
a {
display: inline-block;
padding: 0 8px;
margin-left: 5px;
height: 20px;
line-height: 20px;
&:hover {
text-decoration: none;
}
&.active {
background: #E9E9E6;
color: #999;
}
}
}
// 控制被隐藏的 tab全屏时显示
.wmd-hidetab {
display: none;
}
// 隐藏编辑器但占位
.wmd-visualhide {
visibility: hidden;
}
/* 对话框 */
.wmd-prompt-background {
background-color: #000;
}
.wmd-prompt-dialog {
position: fixed;
z-index: 1001;
top: 50%;
left: 50%;
margin-top: -95px;
margin-left: -200px;
padding: 20px;
width: 360px;
background: #F6F6F3;
p { margin: 0 0 5px; }
form { margin-top: 10px; }
input[type="text"] {
margin-bottom: 10px;
width: 100%;
}
button { margin-right: 10px; }
}
/* 预览 */
#wmd-preview {
background: #FFF;
margin: 1em 0;
padding: 0 15px;
word-wrap: break-word;
overflow: auto;
border-radius: 2px;
img { max-width: 100%; }
code, pre {
padding: 2px 4px;
background: #DDD;
font-size: 14px;
}
code { color: #C13; }
pre {
padding: 1em;
code {
padding: 0;
color: #444;
}
}
blockquote {
margin: 1em 1.5em;
padding-left: 1.5em;
border-left: 4px solid #E9E9E6;
color: #777;
}
hr {
margin: 2em auto;
width: 100px;
border: 1px solid #E9E9E6;
border-width: 2px 0 0 0;
}
.summary:after {
display: block;
margin: 2em 0;
background: #FFF9E8;
color: darken(#FFF9E8, 55%);
font-size: .85714em;
text-align: center;
content: "- more -";
}
table {
width: 100%;
}
table th, table td {
border: 1px solid #DDD;
padding: 5px 8px;
word-break: break-all;
}
table th {
background: #EEE;
}
span.line {
display: inline;
height: 1px;
line-height: 1px;
position: absolute;
}
.focus, .focus * {
background-color: rgba(255,230,0,0.5) !important;
}
}
/* 上传面板动画效果 */
@keyframes fullscreen-upload {
0% { right: -280px; }
100% { right: -1px; }
}
@-moz-keyframes fullscreen-upload {
0% { right: -280px; }
100% { right: -1px; }
}
@-webkit-keyframes fullscreen-upload {
0% { right: -280px; }
100% { right: -1px; }
}
@-o-keyframes fullscreen-upload {
0% { right: -280px; }
100% { right: -1px; }
}
/* 编辑器全屏 */
.fullscreen {
#wmd-button-bar, #text, #wmd-preview, .submit {
// position: fixed;
position: absolute;
top: 0;
width: 50%;
background: #FFF;
z-index: 999;
box-sizing: border-box;
border-radius: 0;
}
#wmd-button-bar {
left: 0;
padding: 13px 20px;
border-bottom: 1px solid #F3F3F0;
z-index: 1000;
}
#text {
top: 53px;
left: 0;
padding: 20px;
border: none;
outline: none;
}
#wmd-preview {
top: 53px;
right: 0;
margin: 0;
padding: 5px 20px;
border: none;
border-left: 1px solid #F3F3F0;
background: #F6F6F3;
overflow: auto;
}
.submit {
right: 0;
margin: 0;
padding: 10px 20px;
border-bottom: 1px solid #F3F3F0;
}
#upload-panel {
-webkit-box-shadow: 0 4px 16px rgba(0,0,0,0.225);
box-shadow: 0 4px 16px rgba(0,0,0,0.225);
border-style: solid;
}
// 全屏附件上传
#tab-files {
position: absolute;
top: 52px;
right: -1px;
width: 280px;
z-index: 1001;
animation: fullscreen-upload 0.5s;
-moz-animation: fullscreen-upload 0.5s;
-webkit-animation: fullscreen-upload 0.5s;
-o-animation: fullscreen-upload 0.5s;
}
.wmd-edittab,
.typecho-post-option,
.title,
.url-slug,
.typecho-page-title,
.typecho-head-nav,
.message { display: none; }
.wmd-hidetab { display: block; }
.wmd-visualhide,
#btn-fullscreen-upload {
visibility: visible;
}
}
.preview {
.submit { width: 100%; background: #FFFFDD }
#wmd-button-bar, #wmd-preview, #text, #upload-panel, #tab-files, #btn-preview, #btn-fullscreen-upload, #auto-save-message { display: none }
.preview-frame { width: 100%; border: 0; padding: 0; margin: 0;
background: #fff; z-index: 999; position: absolute; top: 53px; left: 0 }
.preview-loading { background-image: url(../img/ajax-loader.gif); background-position: center; background-repeat: no-repeat }
#btn-cancel-preview { display: inline-block }
}
+12
View File
@@ -0,0 +1,12 @@
@import "compass/css3/background-size";
@mixin image-2x($image, $width, $height) {
@media (-webkit-min-device-pixel-ratio: 1.3),
(min-resolution: 124.8dpi),
(min-resolution: 1.3dppx) {
& {
background-image: url($image);
@include background-size($width $height);
}
}
}
@@ -0,0 +1,84 @@
/**
* Jquery Timepicker
*/
#ui-datepicker-div {
display: none;
margin-top: -1px;
padding: 10px;
border: 1px solid #D9D9D6;
background: #FFF;
}
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; }
.ui-timepicker-div dl dd { margin: 0 0 10px 40%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
#ui-datepicker-div .ui-datepicker-header {
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #EEE;
}
#ui-datepicker-div .ui-datepicker-prev { float: left; cursor: pointer; }
#ui-datepicker-div .ui-datepicker-next { float: right; cursor: pointer; }
#ui-datepicker-div .ui-datepicker-title {
font-weight: bold;
text-align: center;
}
#ui-datepicker-div .ui-datepicker-calendar th { line-height: 24px; }
#ui-datepicker-div .ui-datepicker-calendar a {
display: block;
width: 30px;
background-color: #F3F3F0;
line-height: 24px;
text-align: center;
}
#ui-datepicker-div .ui-datepicker-calendar a:hover {
background-color: #E9E9E6;
text-decoration: none;
}
#ui-datepicker-div .ui-datepicker-today a {
background-color: #E9E9E6;
color: #444;
}
#ui-datepicker-div .ui-datepicker-current-day a {
background-color: #467B96 !important;
color: #FFF;
}
#ui-datepicker-div .ui-timepicker-div {
margin-top: 20px;
border-top: 1px solid #EEE;
}
#ui-datepicker-div .ui-slider {
position: relative;
margin-top: 18px;
border: 1px solid #E9E9E6;
background-color: #F6F6F3;
height: 4px;
}
#ui-datepicker-div .ui-slider .ui-slider-handle {
position: absolute;
top: -7px;
margin-left: -5px;
z-index: 2;
width: 10px;
height: 16px;
background-color: #467B96;
}
#ui-datepicker-div .ui-datepicker-buttonpane {
padding-top: 10px;
border-top: 1px solid #EEE;
}
#ui-datepicker-div .ui-datepicker-current,
#ui-datepicker-div .ui-datepicker-close {
float: left;
@extend .btn;
@extend .btn-xs;
}
#ui-datepicker-div .ui-datepicker-close {
float: right;
}
.ui-effects-transfer { border: 2px dotted #ccc; }
+106
View File
@@ -0,0 +1,106 @@
/**
* Jquery Tokeninput
*/
ul.token-input-list {
list-style: none;
margin: 0;
padding: 0 4px;
min-height: 32px;
border: 1px solid #D9D9D6;
cursor: text;
z-index: 999;
background-color: #FFF;
clear: left;
border-radius: 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
li {
margin: 4px 0;
}
}
ul.token-input-list li input {
padding: 0;
border: 0;
width: 100%;
-webkit-appearance: caret;
}
li.token-input-token {
padding: 0 6px;
height: 27px;
line-height: 27px;
background-color: #F3F3F0;
cursor: default;
font-size: .92857em;
text-align: right;
white-space: nowrap;
p {
float: left;
display: inline;
margin: 0;
}
span {
color: #BBB;
font-weight: bold;
cursor: pointer;
}
}
li.token-input-selected-token {
background-color: #E9E9E6;
}
li.token-input-input-token {
padding: 0 4px;
}
div.token-input-dropdown {
position: absolute;
background-color: #FFF;
overflow: hidden;
border: 1px solid #D9D9D6;
border-top-width: 0;
cursor: default;
z-index: 1;
font-size: .92857em;
}
div.token-input-dropdown p {
margin: 0;
padding: 5px 10px;
color: #777;
font-weight: bold;
}
div.token-input-dropdown ul {
list-style: none;
margin: 0;
padding: 0;
}
div.token-input-dropdown ul li {
padding: 4px 10px;
background-color: #FFF;
}
div.token-input-dropdown ul li.token-input-dropdown-item {
background-color: #FFF;
}
div.token-input-dropdown ul li em {
font-style: normal;
}
div.token-input-dropdown ul li.token-input-selected-dropdown-item {
background-color: #467B96;
color: #FFF;
}
+226
View File
@@ -0,0 +1,226 @@
/*
* Bento Grid System
* Source: https://github.com/fenbox/bento
* Version: 1.2.8
* Update: 2013.11.25
*/
//
// Config
//
$columns: 12;
$column-width: 100% / $columns;
$gutter-width: 20px;
// Break point
$screen-tablet: 768px;
$screen-desktop: 992px;
$screen-wide: 1200px;
// Mixins
%box-sizing {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
// Container
.container {
margin-left: auto;
margin-right: auto;
padding-left: $gutter-width / 2;
padding-right: $gutter-width / 2;
@extend %box-sizing;
}
// Column group
.row {
margin-right: $gutter-width / -2;
margin-left: $gutter-width / -2;
@extend .clearfix;
}
.row [class*="col-"] {
float: left;
min-height: 1px;
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
@extend %box-sizing;
}
.row [class*="-push-"],
.row [class*="-pull-"] {
position: relative;
}
/*
* Mobile and up
*/
@for $index from 1 through $columns {
.col-mb-#{$index} {
width: $column-width * $index;
}
}
/*
* Tablet and up
*/
@media (min-width: $screen-tablet) {
.container {
max-width: $screen-tablet - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-tb-#{$index} {
width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-tb-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-tb-pull-#{$index} {
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-tb-push-#{$index} {
left: $column-width * $index;
}
}
}
/*
* Desktop and up
*/
@media (min-width: $screen-desktop) {
.container {
max-width: $screen-desktop - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-#{$index} {
width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-pull-#{$index} {
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-push-#{$index} {
left: $column-width * $index;
}
}
}
/*
* Widescreen and up
*/
@media (min-width: $screen-wide) {
.container {
max-width: $screen-wide - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-wd-#{$index} {
width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-wd-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-wd-pull-#{$index} {
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-wd-push-#{$index} {
left: $column-width * $index;
}
}
}
/*
* Responsive kit
*/
// Hidden in mobile and down
@media (max-width: $screen-tablet - 1px) {
.kit-hidden-mb {
display: none;
}
}
// Hidden in tablet and down
@media (max-width: $screen-desktop - 1px) {
.kit-hidden-tb {
display: none;
}
}
// Hidden in descktop and down
@media (max-width: $screen-wide - 1px) {
.kit-hidden {
display: none;
}
}
/*
* Clearfix
*/
.clearfix {
zoom: 1;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
+963
View File
@@ -0,0 +1,963 @@
/* vim: set et sw=2 ts=2 sts=2 fdm=marker ff=unix fenc=utf8 */
/**
* Typecho 后台样式
*
* @author Typecho Team
* @since 2008-09-26
* @update 2013-11-02
* @link http://www.typecho.org/
* @version 0.9
*/
/**
* Typecho 全局样式
*/
html {
height: 100%;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #F6F6F3;
color: #444;
font-size: 87.5%;
line-height: 1.5;
}
a {
color: #467B96;
text-decoration: none;
&:hover {
color: #499BC3;
text-decoration: underline;
}
}
code, pre, .mono {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.p { margin: 1em 0; }
.body-100 {
height: 100%;
}
a.balloon-button {
display: inline-block;
padding: 0 6px;
min-width: 12px;
height: 18px;
line-height: 18px;
background: #D8E7EE;
font-size: .85714em;
text-align: center;
text-decoration: none;
/** 修正ie中文不对齐 */
zoom:1;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
white-space: nowrap;
}
a.button:hover, a.balloon-button:hover {
background-color: #A5CADC;
color: #FFF;
text-decoration: none;
}
@import "forms";
@import "buttons";
@import "messages";
@import "pagenavi";
@import "header";
@import "footer";
/* 低版本浏览器升级提示 */
.browsehappy {
border: none;
text-align: center;
}
/** 顶部消息样式 by 70 */
.popup {
display: none;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 8px 0;
border: none;
width: 100%;
z-index: 10;
text-align: center;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.popup ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
.popup ul li {
display: inline-block;
margin-right: 10px;
}
/**
* logo 的样式
*/
.logo {
}
/**
* 载入状态
*/
.loading {
padding-left: 20px !important;
background: transparent url(../img/ajax-loader.gif) no-repeat left center;
}
/**
* 典型配置选项
*/
.typecho-option {
list-style: none;
margin: 1em 0;
padding: 0;
}
.typecho-option li {
}
.typecho-option-submit li {
border-bottom: none;
}
.typecho-option label.typecho-label {
display: block;
margin-bottom: .5em;
font-weight: bold;
}
.typecho-option label.required:after {
content: " *";
color: #B94A48;
}
.typecho-option label.typecho-label+input {
}
.typecho-option span { margin-right: 15px; }
.typecho-option .description {
margin: .5em 0 0;
color: #999;
font-size: .92857em;
}
.typecho-option input.file {
width: 100%;
margin: .7em 0;
}
.front-archive {
padding-left: 1.5em;
}
.profile-avatar {
border: 1px dashed #D9D9D6;
max-width: 100%;
}
/** 增加配置面板内部的错误样式 by 70 */
/**
* 安装样式
*
* @author mingcheng
* @date 2008-09-06
*/
/**
* 安装向导
*/
.typecho-install {
padding-bottom: 2em;
}
.typecho-install-patch {
margin-bottom: 2em;
padding: 2em 0;
background-color: #292D33;
color: #FFF;
text-align: center;
}
.typecho-install-patch ol {
list-style: none;
margin: 3em 0 1em;
padding: 0;
color: #999;
}
.typecho-install-patch li {
display: inline-block;
margin: 0 .8em;
}
.typecho-install-patch span {
display: inline-block;
margin-right: 5px;
width: 20px;
height: 20px;
line-height: 20px;
border: 2px solid #999;
text-align: center;
border-radius: 2em;
}
.typecho-install-patch li.current {
color: #FFF;
font-weight: bold;
}
.typecho-install-patch li.current span {
border-color: #FFF;
}
/**
* 安装主体内容
*/
.typecho-install .typecho-install-body input {
width: 100%;
}
.typecho-install-body .typecho-option li {
margin: 1em 0;
}
/**
* 欢迎界面
*/
#typecho-welcome {
margin: 1em 0;
padding: 1em 2em;
background-color: #E9E9E6;
}
.welcome-board {
color: #999;
font-size: 1.15em;
em {
color: #444;
font-size: 2em;
font-style: normal;
font-family: Georgia, serif;
}
}
#start-link {
margin-bottom: 25px;
padding: 0 0 35px;
border-bottom: 1px solid #ECECEC;
li {
float: left;
margin-right: 1.5em;
}
.balloon {
margin-top: 2px;
}
}
.latest-link {
li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
span {
display: inline-block;
margin-right: 4px;
padding-right: 8px;
border-right: 1px solid #ECECEC;
width: 37px;
text-align: right;
color: #999;
}
}
.update-check {
font-size: 14px;
}
/**
* 登录框
*/
.typecho-login-wrap {
display: table;
margin: 0 auto;
height: 100%;
}
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
}
}
.typecho-login .more-link {
margin-top: 2em;
color: #CCC;
}
.typecho-login .more-link a { margin: 0 3px; }
/**
* 标题
*/
.typecho-page-title {
}
.typecho-page-title h2 {
margin: 25px 0 10px;
font-size: 1.28571em;
}
.typecho-page-title h2 a {
margin-left: 10px;
padding: 3px 8px;
background: #E9E9E6;
font-size: .8em;
border-radius: 2px;
}
.typecho-page-title h2 a:hover {
text-decoration: none;
}
/**
* 后台页面主体
*/
/**
* 主页主体
*/
.typecho-dashboard {
}
.typecho-dashboard ul {
list-style: none;
padding: 0;
}
.typecho-dashboard li {
margin-bottom: 5px;
}
/**
* 标签页
*/
.typecho-option-tabs {
list-style: none;
margin: 1em 0 0;
padding: 0;
font-size: 13px;
text-align: center;
&.fix-tabs {
margin-bottom: 1em;
}
}
.typecho-option-tabs a {
display: block;
margin-right: -1px;
border: 1px solid #D9D9D6;
padding: 0 15px;
height: 26px;
line-height: 26px;
color: #666;
box-sizing: border-box;
}
.typecho-option-tabs a:hover {
background-color: #E9E9E6;
color: #666;
text-decoration: none;
}
.typecho-option-tabs li {
float: left;
&:first-child a {
border-radius: 2px 0 0 2px;
}
&:last-child a {
border-radius: 0 2px 2px 0;
}
}
.typecho-option-tabs.right {
float: right;
}
.typecho-option-tabs li.current a,
.typecho-option-tabs li.active a {
background-color: #E9E9E6;
}
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.typecho-list .typecho-pager {
}
.typecho-list-operate {
margin: 1em 0;
}
.typecho-list-operate input,
.typecho-list-operate button,
.typecho-list-operate select {
vertical-align: bottom;
}
.typecho-list-operate input[type="checkbox"] {
vertical-align: text-top;
}
.typecho-list-operate .operate {
float: left;
}
.typecho-list-operate .search {
float: right;
}
.typecho-list-operate span.operate-delete, a.operate-delete,
.typecho-list-operate span.operate-button-delete, a.operate-button-delete {
color: #B94A48;
}
a.operate-edit {
color: #007700;
}
a.operate-reply {
color: #545c30;
}
.typecho-list-operate a:hover {
text-decoration: none;
}
/**
* 列表表格
*/
/** 增加表格标题 by 70 */
.typecho-list-table-title {
margin: 1em 0;
color: #999;
text-align: center;
}
.typecho-table-wrap {
padding: 30px;
background: #FFF;
}
.typecho-list-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
&.deactivate {
color: #999;
}
.right {
text-align: right;
}
th {
padding: 0 10px 10px;
border-bottom: 2px solid #F0F0EC;
text-align: left;
}
td {
padding: 10px;
border-top: 1px solid #F0F0EC;
word-break: break-all;
pre {
overflow: auto;
}
}
.status {
margin-left: 5px;
color: #999;
font-size: .92857em;
font-style: normal;
}
tbody tr:hover td {
background-color: #F6F6F3;
}
tbody tr.checked td {
background-color: #FFF9E8;
}
tr td .hidden-by-mouse {
opacity: 0;
}
tr:hover td .hidden-by-mouse {
opacity: 1;
}
}
.warning {
color: #B94A48;
}
/**
* 评论管理
*/
.comment-reply-content {
position: relative;
margin: 1em 0;
padding: 0 1em;
border: 1px solid transparent;
background-color: #F0F0EC;
}
.comment-reply-content:after {
position: absolute;
right: 1em;
border: 8px solid #F0F0EC;
border-color: #F0F0EC #F0F0EC transparent transparent;
content: " ";
}
.comment-meta span,
.comment-date {
font-size: .92857em;
color: #999;
}
.comment-action a, .comment-action span { margin-right: 4px; }
.comment-edit label {
display: block;
}
.comment-content img {
max-width: 100%;
}
/**
* 评论回复
*/
#typecho-respond {
padding: 10px;
display: none;
}
/**
* 模板列表
*/
.typecho-theme-list {
}
.typecho-theme-list .theme-item {
}
.typecho-theme-list td {
}
.typecho-theme-list img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
.typecho-theme-list cite {
font-style: normal;
color: #999;
}
.typecho-theme-list tbody tr.current td {
background-color: #FFF9E8;
}
/**
* 后台配置项
*/
.typecho-page-main .typecho-option input.text {
width: 100%;
}
.typecho-page-main .typecho-option input.num {
width: 40px;
}
.typecho-page-main .typecho-option textarea {
width: 100%;
height: 100px;
}
.typecho-page-main .typecho-option .multiline {
display: block;
margin: .3em 0;
&.hidden {
display: none;
}
}
/**
* 编辑模板
*/
.typecho-select-theme {
height: 25px;
line-height: 25px;
margin: 15px 0px;
}
.typecho-select-theme h5 {
color: #E47E00;
font-weight: bold;
float: left;
font-size: 14px;
width: 120px;
margin-right: 10px;
}
.typecho-select-theme select {
width: 150px;
}
/**
* 编辑模板编辑详情
*/
.typecho-edit-theme ul {
list-style: none;
margin: 0;
padding: 0;
}
.typecho-edit-theme li {
padding: 3px 10px;
}
.typecho-edit-theme .current {
background-color: #E6E6E3;
}
.typecho-edit-theme .current a {
color: #444;
}
.typecho-edit-theme textarea {
font-size: .92857em;
line-height: 1.2;
height: 500px;
}
/**
* 编写页面
*/
.typecho-post-area .edit-draft-notice {
color: #999;
font-size: .92857em;
}
.typecho-post-area .edit-draft-notice a { color: #B94A48; }
.typecho-post-area .typecho-label {
display: block;
margin: 1em 0 -0.5em;
font-weight: bold;
}
.typecho-post-area #auto-save-message {
display: block;
margin-top: 0.5em;
color: #999;
font-size: .92857em;
}
.typecho-post-area .submit .right button {
margin-left: 5px;
}
.typecho-post-area .right {
float: right;
padding-left: 24px;
}
.typecho-post-area .left {
float: left;
}
.typecho-post-area input.text {
}
.typecho-post-area .out-date {
border: 1px solid #D3DBB3;
padding: 3px;
background: #fff;
}
.typecho-post-area input.title {
font-size: 1.17em;
font-weight: bold;
}
.typecho-post-area .url-slug {
margin-top: -0.5em;
color: #AAA;
font-size: .92857em;
word-break: break-word;
}
.typecho-post-area #slug {
padding: 2px;
border: none;
background: #FFFBCC;
color: #666;
}
.typecho-post-area #text {
resize: none;
}
#advance-panel {
display: none;
}
#custom-field {
margin: 1em 0;
padding: 10px 15px;
background: #FFF;
&.fold {
table, .description { display: none; }
}
.description {
margin-top: 10px;
text-align: right;
button {
float: left;
}
}
p.description {
text-align: left;
}
.typecho-label {
margin: 0;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
table {
margin-top: 10px;
}
td {
padding: 10px 5px;
font-size: .92857em;
border-bottom: 1px solid #F0F0EC;
vertical-align: top;
label {
font-size: 1em;
font-weight: normal;
}
}
select { height: 27px; }
}
.typecho-post-area .is-draft {
background: #FFF1A8;
}
.typecho-post-option .description {
margin-top: -0.5em;
color: #999;
font-size: .92857em;
}
.category-option ul {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
}
.category-option li {
margin: 3px 0;
}
.visibility-option ul,
.allow-option ul {
list-style: none;
padding: 0;
}
/**
* 标签列表
*/
.typecho-page-main ul.tag-list {
list-style: none;
margin: 0;
padding: 20px;
background-color: #FFF;
}
.typecho-page-main ul.tag-list li {
display: inline-block;
margin: 0 0 5px 0;
padding: 5px 5px 5px 10px;
cursor: pointer;
}
.typecho-page-main ul.tag-list li:hover {
background-color: #E9E9E6;
}
.typecho-page-main ul.tag-list li input {
display: none;
}
.typecho-page-main ul.tag-list li.checked {
background-color: #FFFBCC;
}
.typecho-page-main ul.tag-list li.size-5 { font-size: 1em; }
.typecho-page-main ul.tag-list li.size-10 { font-size: 1.2em; }
.typecho-page-main ul.tag-list li.size-20 { font-size: 1.4em; }
.typecho-page-main ul.tag-list li.size-30 { font-size: 1.6em; }
.typecho-page-main ul.tag-list li.size-0 { font-size: 1.8em; }
.typecho-page-main .tag-edit-link { visibility: hidden; }
.typecho-page-main li:hover .tag-edit-link { visibility: visible; }
.typecho-attachment-photo {
border: 1px solid #E6E6E3;
max-width: 100%;
}
/*
* Upload
*/
#upload-panel {
border: 1px dashed #D9D9D6;
background-color: #FFF;
color: #999;
font-size: .92857em;
&.drag {
background-color: #FFFBCC;
}
}
.upload-area {
padding: 15px;
text-align: center;
}
#file-list {
list-style: none;
margin: 0 10px;
padding: 0;
max-height: 450px;
overflow: auto;
word-break: break-all;
li,
.insert {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
li {
padding: 8px 0;
border-top: 1px dashed #D9D9D6;
}
.insert {
display: block;
max-width: 100%;
}
.file {
margin-left: 5px;
}
.info {
text-transform: uppercase;
}
}
#btn-fullscreen-upload {
visibility: hidden;
}
/**
* 附件管理
*/
.edit-media button { margin-right: 6px; }
/* 拖动调整 textarea 大小 */
.resize {
display: block;
margin: 2px auto 0;
padding: 2px 0;
border: 1px solid #D9D9D6;
border-width: 1px 0;
width: 60px;
cursor: row-resize;
i {
display: block;
height: 1px;
background-color: #D9D9D6;
}
}
/* 拖动排序 */
.tDnD_whileDrag {
background-color: #FFFBCC;
}
/**
* 导入扩展样式
*/
@import "icons";
@import "components";
@import "hidden";