####stellar.js
代码简单,只有651行,依赖jQuery,配置简便
仓库地址:
https://github.com/markdalgleish/stellar.js
demo地址:
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Handlebars Partials Example</title> | |
</head> | |
<body> | |
<h1>Handlebars Partials Example!</h1> | |
<div id="list"> | |
</div> |
!SLIDE | |
# 前端组2012Q4工作总结 - 巩守强 | |
!SLIDE | |
## | |
[Picture Show ためしてみたお( ^ω^) ](http://d.hatena.ne.jp/xuwei/20110903/1315044919) |
// Feature detect + local reference | |
var storage, | |
fail, | |
uid; | |
try { | |
uid = new Date; | |
(storage = window.localStorage).setItem(uid, uid); | |
fail = storage.getItem(uid) != uid; | |
storage.removeItem(uid); | |
fail && (storage = false); |
define(['module'], function (module) { | |
'use strict'; | |
var storage = (function(){ | |
var uid = new Date, | |
result; | |
try { | |
localStorage.setItem(uid, uid); | |
result = localStorage.getItem(uid) == uid; | |
localStorage.removeItem(uid); |
function throttle( fn, time ) { | |
var t = 0; | |
return function() { | |
var args = arguments, ctx = this; | |
clearTimeout(t); | |
t = setTimeout( function() { | |
fn.apply( ctx, args ); | |
}, time ); | |
}; |
####stellar.js
代码简单,只有651行,依赖jQuery,配置简便
仓库地址:
https://github.com/markdalgleish/stellar.js
demo地址:
/*jslint debug: true, | |
undef: false */ | |
;(function(win, doc){ | |
var localStorageName = 'localStorage'; | |
var _util = { | |
isLocalStorageNameSupported: function() { | |
// 加try{}catch(){}的为了防止Firefox浏览器改配置dom.Storage = false时crash掉 | |
try { return (localStorageName in win && win[localStorageName]) } | |
catch(err) { return false } | |
}, |
// add this inlined to <head> and before all <links> | |
<script> | |
(function(document,navigator,standalone) { | |
// prevents links from apps from oppening in mobile safari | |
// this javascript must be the first script in your <head> | |
if ((standalone in navigator) && navigator[standalone]) { | |
var curnode, location=document.location, stop=/^(a|html)$/i; | |
document.addEventListener('click', function(e) { | |
curnode=e.target; | |
while (!(stop).test(curnode.nodeName)) { |
# 查找当前文件夹及其子文件夹下包含某个字符串的某类型文件 | |
# From http://www.ai7.org/wp/html/653.html | |
find . -name "*.js"|xargs grep require |
/** | |
* USAGE: | |
* 外部定义全局变量 RSINFO = { 'path': 'version' } | |
*/ | |
(function (win) { | |
var rslist, | |
RSLIST_KEY = 'rslist', | |
RSINFO = win.RSINFO || {}, | |
isLocalStorageSupported = (function() { |