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 getBrowserInfo = function() { | |
var ua = navigator.userAgent; | |
// Ref: http://www.useragentstring.com/pages/useragentstring.php | |
var token = [ // 顺序有关 | |
"Opera", // 某些版本会伪装成 MSIE, Firefox | |
"Chrome", // 某些版本会伪装成 Safari | |
"Safari", // 某些版本会伪装成 Firefox | |
"MSIE 6", | |
"MSIE 7", | |
"MSIE 8", |
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 getOSInfo = function() { | |
var ua = navigator.userAgent; | |
// Ref: http://msdn.microsoft.com/en-us/library/ms537503%28VS.85%29.aspx | |
var token = [ | |
// 顺序无关,根据占用率排列 | |
["Windows NT 5.1", "WinXP"], | |
["Windows NT 6.0", "WinVista"], | |
["Windows NT 6.1", "Win7"], | |
["Windows NT 5.2", "Win2003"], | |
["Windows NT 5.0", "Win2000"], |
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 getScreenInfo = function() { | |
var screen = window.screen; | |
return screen ? screen.width + 'x' + screen.height : ''; | |
}; |
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.keys = (function () { | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !({toString:null}).propertyIsEnumerable('toString'), | |
dontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', | |
'hasOwnProperty', | |
'isPrototypeOf', | |
'propertyIsEnumerable', |
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 regExpMatch(url, pattern) { | |
try { return new RegExp(pattern).test(url); } catch(ex) { return false; } | |
} | |
function FindProxyForURL(url, host) { | |
if (shExpMatch(url, "*://*.google.com/*") || shExpMatch(url, "*://google.com/*")) return 'PROXY 127.0.0.1:8087'; | |
if (shExpMatch(url, "*://*.google.com.*/*") || shExpMatch(url, "*://google.com.*/*")) return 'PROXY 127.0.0.1:8087'; | |
if (shExpMatch(url, "*://*.google-analytics.com/*") || shExpMatch(url, "*://google-analytics.com/*")) return 'PROXY 127.0.0.1:8087'; | |
if (shExpMatch(url, "*://*.googleapis.com/*") || shExpMatch(url, "*://googleapis.com/*")) return 'PROXY 127.0.0.1:8087'; | |
if (shExpMatch(url, "*://*.googlecode.com/*") || shExpMatch(url, "*://googlecode.com/*")) return 'PROXY 127.0.0.1:8087'; |
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
/** | |
* IE6 Hover fix | |
* @depend KISSY | |
* @author 隐若 <yinruo.nyj@taobao.com> | |
*/ | |
(function( S ){ | |
'use strict'; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw | |
IDEAEAGAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj | |
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa |
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
/** | |
* 文本替换 | |
* @param target 需要搜索的文本 | |
* @param keywords 关键字 | |
* @param decorator 对搜索到的关键词进行构造 | |
* @param ifSensitive 大小写是否区分,默认不区分 | |
* @return {*} | |
*/ | |
function textReplace( target, keywords, decorator, ifSensitive ){ |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
meta: { | |
version: '0.1.0', | |
banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
'* http://www.jvsoftware.com/\n' + |
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
// 所有的mixin | |
^\s*\.([\w\s-_]*\s*\([\s\$,\w-_\:]*\)\s*\{) --> @mixin $1 | |
// 所有对于mixin的调用 | |
^\s*\.([\w-_]*\(.*\);) --> @include $1; | |
// 所有不需要参数的mixin | |
^\s*(\.[\w-_]*;) --> @extend $1; |