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
| url = url + '?cacheTime=' + Math.ceil(new Date() / 3600000); |
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
| /*************************************************************************** | |
| * | |
| * Copyright (c) 2013 Baidu.com, Inc. All Rights Reserved | |
| * $Id$ | |
| * | |
| **************************************************************************/ | |
| goog.provide('ad.fx.Timeline'); | |
| goog.provide('ad.fx.moveTo'); | |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <div class="book"> | |
| <h1>背影</h1> | |
| <p>我与父亲不相见已二年余了,我最不能忘记的是他的背影。</p> |
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
| if (typeof module === 'object' && module && typeof module.exports === 'object') { | |
| // Node.js module pattern | |
| module.exports = jQuery; | |
| } else { | |
| // AMD | |
| if (typeof define === 'function' && define.amd) { | |
| define('jquery-onscreen', [], function() { return jQuery; }); | |
| } | |
| } |
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 Deferred = require('./Deferred'); // 支持Promise api的库都可以,例如q(http://documentup.com/kriskowal/q/) | |
| var exec = require('child_process').exec; | |
| /** | |
| * 猜测当前目录使用了哪个版本控制系统 | |
| * | |
| * @return {string} svn/git/hg/cvs, 如果检测不到返回空字符串 | |
| */ | |
| function guessVcsName() { | |
| var svnDef = new Deferred(); |
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 resolvePath = function () { | |
| function resolve(pathA, pathB) { | |
| // 先做split,得到的结果如下几种 | |
| // ‘a’ => ['a'] | |
| // 'a/b' => ['a', 'b'] | |
| // '/a/b' => ['', 'a', 'b'] | |
| // '/a/b/' => ['', 'a', 'b', ''] | |
| pathB = pathB.split('/'); | |
| if (pathB[0] === '') { | |
| // 如果pathB是想对于根目录 |
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 inView = function (e) { | |
| var clientW = baidu.page.getViewWith(); | |
| var clientH = baidu.page.getViewHeight(); | |
| var rect = e.getBoundingClientRect(); | |
| return (rect.bottom > 0 && rect.top < clientH) | |
| && (rect.right > 0 && rect.left < clientW); | |
| }; |
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
| /*! | |
| * jQuery JavaScript Library v2.1.1pre | |
| * http://jquery.com/ | |
| * | |
| * Includes Sizzle.js | |
| * http://sizzlejs.com/ | |
| * | |
| * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | |
| * Released under the MIT license | |
| * http://jquery.org/license |
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(win) { | |
| // Do something with the global | |
| })(Function('return this')()); |
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
| // http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json/11616993#11616993 | |
| var o = {}; | |
| o.o = o; | |
| var cache = []; | |
| JSON.stringify(o, function(key, value) { | |
| if (typeof value === 'object' && value !== null) { | |
| if (cache.indexOf(value) !== -1) { | |
| // Circular reference found, discard key | |
| return; |