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
//"babel-loader": "6.2.4" | |
//"babel-plugin-transform-runtime": "6.7.5" | |
//"babel-preset-es2015": "6.6.0" | |
var path = require('path') | |
var glob = require('globby') | |
var webpack = require('webpack') | |
var JS_PATH = path.join(__dirname, './fe/js') | |
function getEntries() { |
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($, _) { | |
var tmpl_error = '<div class="item-info text-red"><i class="iconfont icon-wrong"></i> {{msg}}</div>' | |
var tmpl_option = '<div class="item-info text-orange"><i class="iconfont icon-caution"></i> {{msg}}</div>' | |
function cancelZoom() { | |
var d = document, | |
viewport, | |
content, | |
maxScale = ',maximum-scale=', | |
maxScaleRegex = /,*maximum\-scale\=\d*\.*\d*/; |
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($, window) { | |
'use strict'; | |
var defalut_rules = { | |
require: { | |
test: function(val) { | |
return !val; | |
}, | |
msg: '{{name}}是必填项,请您填写' | |
}, |
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
<table border="0" cellpadding="0" cellspacing="0" width="500" class="wrapper"> | |
<tr> | |
<td>…Content…</td> | |
</tr> | |
</table> | |
@media screen and (max-width:525px) { | |
table[class=“wrapper”] { | |
width:100% !important; | |
} |
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($){ | |
$.fn.outside = function(ename, cb){ | |
return this.each(function(){ | |
var $this = $(this), | |
self = this; | |
$(document).bind(ename, function tempo(e){ | |
if(e.target !== self && !$.contains(self, e.target)){ | |
cb.apply(self, [e]); | |
if(!self.parentNode) $(document.body).unbind(ename, tempo); |
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
'哈哈'.replace(/[^\x00-\xff]/g, '豆瓣') //豆瓣豆瓣 |
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
.arrow-outter, | |
.arrow-inner { | |
left: 285px; | |
border: 8px dashed transparent; | |
display: block; | |
position: absolute; | |
height: 0; | |
width: 0; | |
} | |
.arrow-inner { |
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 TemplateEngine = function(html, options) { | |
var re = /<%([^%>]+)?%>/g, reExp = /(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g | |
, code = 'var r=[];\n', cursor = 0; | |
var add = function(line, js) { | |
js? (code += line.match(reExp) ? line + '\n' : 'r.push(' + line + ');\n') : | |
(code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : ''); | |
return add; | |
} | |
while(match = re.exec(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 ua = navigator.userAgent; | |
if( ua.indexOf("Android") >= 0 ) { | |
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8)); | |
if (androidversion < 2.3) { | |
// do whatever | |
} | |
} |
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
$('#favorite').click(function(e){ | |
e.preventDefault(); | |
var url = 'http://github.com'; | |
var title = 'GitHub'; | |
var ctrl = (window.navigator.userAgent.toLowerCase()).indexOf('mac') !== -1 ? 'Command' : 'Ctrl'; | |
var info = 'Sorry, your browser is not supported. Please use' + ctrl + '+D to add favorite'; | |
try { | |
window.external.addFavorite(url, title); |
NewerOlder