This file contains hidden or 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
/* | |
* dom操作虚拟类 | |
* contructor Elem Node | |
* 依赖 DOMUtil Util dtd filterHtml | |
* @author luying1@staff | |
**/ | |
(function() { | |
/* | |
* Elem |
This file contains hidden or 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 Event = { | |
map: {}, | |
_addqueue: function(el, type, fn, init) { | |
var queue = Event.map[type + el]; | |
if (!queue) { | |
queue = []; | |
init(); | |
} | |
queue.push(fn); | |
}, |
This file contains hidden or 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
/** | |
* Clipboard.js | |
* | |
* Copyright, Moxiecode Systems AB | |
* Released under LGPL License. | |
* | |
* License: http://www.tinymce.com/license | |
* Contributing: http://www.tinymce.com/contributing | |
*/ |
This file contains hidden or 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 combine = addModule('css-combine'); | |
var u = require('url'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var qs = require('querystring'); | |
logger.log(123); | |
route(function(req,res){ | |
var file = decodeURIComponent(qs.parse(u.parse(req.url).query).file) + '.css'; | |
file = path.resolve(__dirname,file); |
This file contains hidden or 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
<html> | |
<head> | |
<title>canvas demo</title> | |
</head> | |
<body> | |
<textarea id="text" style="width:300px;height:100px;"></textarea> | |
<br> | |
<button id="toImg">转化</button> | |
<br> | |
<canvas style="border:#ccc solid 1px;" id="weiboText"></canvas> |
This file contains hidden or 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
define('mods/xss',function(require,exports,module){ | |
/** | |
* 过滤XSS攻击 | |
* | |
* @author 老雷<[email protected]> | |
*/ | |
/* | |
* 默认HTML标签白名单 | |
* 标签名=>属性列表 |
This file contains hidden or 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 xlsx = require('node-xlsx'); | |
var fs = require('fs'); | |
var optimist = require('optimist').argv; | |
var src = optimist.src; | |
var target = optimist.target; | |
var json = fs.readFileSync(src).toString(); | |
String.prototype.decodeHTML = function() { | |
var map = { | |
"gt": ">", |
This file contains hidden or 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(global,undef){ | |
var isBrowser = !! (typeof window !== undef && global.navigator && global.document); | |
var debug = isBrowser ? (/debug/).test(location.search) : null; | |
var mod = { | |
alias:{}, | |
basepath: debug ? 'path/src/' : 'path/dist' | |
}; | |
if (global.define && isBrowser) { | |
define('config',function(){ | |
return mod; |
This file contains hidden or 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
define("someapp.js",["a","b","c","d","e","f","g","h","i","j","k"],function(a,b,c,d,e,f,g,h,i,j,k){ | |
}); | |
//what the fuck? 这书写维护起来。。简直了。 | |
//a.js | |
define("a",[],function(){ | |
var a = document.getElementById("a"); |
This file contains hidden or 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 moduleA(){} // a.js | |
function moduleB(){} // b.js | |
//<script src="a.js"></script> | |
//<script src="b.js"></script> | |
//根据需要手动调整删改a,b...的顺序位置。 |