This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Notification | |
* @author: ijse | |
* @require: Chrome10+ | |
* @params: Same as webkitNotifications.create[HTML]Notification() | |
* @usage: | |
* new Notify("http://www.baidu.com").onshow(function() { | |
* alert("show"); | |
* }).onclose(function() { | |
* alert("close"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function Extend based on Prototype | |
* @author ijse | |
*/ | |
exports.extend = function(sub, superclass) { | |
var F = function() {}; | |
F.prototype = superclass.prototype; | |
sub.prototype = new F(); | |
sub.prototype.constructor = sub; | |
sub.superclass = superclass.prototype; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//Object.extend comes from jQuery | |
extend: function () { | |
var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, | |
i = 1, | |
length = arguments.length, | |
deep = false, | |
toString = Object.prototype.toString, | |
hasOwn = Object.prototype.hasOwnProperty, | |
push = Array.prototype.push, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var pathSep = require('path').sep; | |
var Path = require("path"); | |
var directory = module.exports = {}; | |
directory.mkdirSync = function __directory_mkdirSync__(path) { | |
var dirs = Path.normalize(path).split(pathSep); | |
var root = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cyouCallback([ | |
{ | |
"url": "/ty/media/20130415/55113.shtml", | |
"date": "2013-04-15", | |
"title": "【优酷】超燃!玩家激情解说桃园竞技场", | |
"channel":"媒体" | |
}, | |
{ | |
"url": "/ty/media/20130415/55112.shtml", | |
"date": "2013-04-15", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var pathSep = require('path').sep; | |
var Path = require("path"); | |
var directory = module.exports = {}; | |
directory.mkdirSync = function __directory_mkdirSync__(path) { | |
var dirs = Path.normalize(path).split(pathSep); | |
var root = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert base64 encode image into Blob | |
* | |
* Usage: | |
* var dataURL = canvas.toDataURL('image/jpeg', 0.5); | |
* var blob = dataURItoBlob(dataURL); | |
* var fd = new FormData(document.forms[0]); | |
* fd.append("canvasImage", blob); | |
* | |
* See: http://stackoverflow.com/a/5100158/1063090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// template helper | |
function tpl(t, d) { | |
var s = t; | |
if (!d) return s; | |
for (k in d) { | |
s = s.replace(new RegExp('\\${' + k + '}', 'g'), d[k]); | |
} | |
return s; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 使用说明: | |
* 本程序以完成固定宽度布局的网页在iPhone/Android设备上浏览时可以适配设备屏幕宽度(竖屏浏览, 暂未支持横屏浏览) | |
* 为目的。正常运行的环境是: iPhone/Android设备的自带浏览器. | |
* 如有问题,意见或建议,请到我的博客页面留言,或发送邮件. | |
* 其他移动版浏览器的适配问题, 不在本程序处理范围, 若有相关问题, 请留言或发送邮件. | |
* | |
* 博客页面地址: | |
* http://www.cnblogs.com/plums/archive/2013/01/10/WebApp-fixed-width-layout-of-multi-terminal-adapter-since.html | |
* 邮箱: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p:nth-child(1) { | |
font-size: 12px; | |
margin: 20px; | |
width: 200px; | |
height: 150px; | |
-webkit-hyphens: auto; | |
-webkit-shape-inside: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); | |
overflow: hidden; | |
} |
OlderNewer