Skip to content

Instantly share code, notes, and snippets.

View xiaojue's full-sized avatar
🤚
waiting

xiaojue xiaojue

🤚
waiting
View GitHub Profile
javascript:alert("xss");
@xiaojue
xiaojue / gruntfile.js
Created August 21, 2013 01:42
grunt file
var lithe = require('lithe');
var path = require('path');
var tool = lithe.tool;
var hfs = lithe.hfs;
var litheOptions = tool.options;
var dir = __dirname;
var basepath = path.resolve(dir, 'src');
var distpath = path.resolve(dir, 'dist');
var config = require(basepath + '/config.js');
var banner = '/* <%=pkg.name%> | <%=pkg.description%> | vserion <%=pkg.version%>*/\r\n';
@xiaojue
xiaojue / widget.js
Created May 30, 2013 09:59
ui class
/*
* @UI class
* @author [email protected]
**/
(function() {
//class类,所有UI组件均基于class创建实例.
function Class(o) {
//把一个普通类,转换为符合Class的格式的类
if (! (this instanceof Class) && sjs.isFunction(o)) {
<style>
.num {width:100px;position:relative;}
.num .leftpart{width:44px;position:absolute;left:0px;text-align:right;}
.num .rightpart{width:44px;position:absolute;right:0px;text-align:left;}
.num .split{width:2px;position:absolute:right:46px;text-align:center;}
</style>
<script>
function splitNum(selector){
var num = $(selector).text(),parts=num.split("."),leftpart = parts[0],rightpart = parts[1];
$(selector).html("<span class='leftpart'>"+leftpart+"</span><span style='split'>.</span><span class='rightpart'>"+rightpart+"</span>")
define(function(require, exports, module) {
var $ = require('jquery'),
face = require('mods/face/face'),
Mu = require('mustache');
require('vendor/jquery.jscrollbar');
var chatWindow = function() {
//发言间隔time object
define(function(require, exports, module) {
//web chat基础类,不负责业务层和UI
var $ = require('jquery'),
Events = require('events'),
chatlist = require('mods/chat/chat-list'),
chatwindow = require('mods/chat/chat-window');
require('vendor/jquery.comet');
var chat = function(config) {
define(function(require, exports, module) {
var jQuery = require('jquery'),
Events = require('events');
//基于jquery.ui
require('vendor/jquery.ui');
require('vendor/jquery.mousewhell');
(function($) {
var scrollbar = function(config) {
var config = require('./config.js'),
xml2js = require('xml2js'),
http = require('http');
var baiduZm = function() {
this.root = "box.zhangmen.baidu.com";
};
baiduZm.prototype = {
constructor: baiduZm,
(function() {
$.fn.grayScan = function(options) {
var _config = {
direction: 'top',
timer: 10
},
T = null;
<!doctype html>
<html>
<head>
<title>demo</title>
<script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
<script src="Gray.js"></script>
</head>
<style>
*{margin:0px;padding:0px;}
</style>