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
| /** | |
| * 执行远程或内敛javascript,支持script中包含document.write | |
| * 用于将js广告改为渲染到target, 基于tangram | |
| * | |
| * executeScript({ | |
| * 'target': baidu.g('ad'), | |
| * 'url': 'http://ecma.bdimg.com/adtest/0116fb68cf061c3ec55516d4c79946ca.js' | |
| * }); | |
| * | |
| * executeScript({ |
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
| /** | |
| * 使同域的iframe宽度撑满其所在容器,并且高度自适应其内容 | |
| * | |
| * @param {Element} iframe . | |
| */ | |
| function autoFitIframe(iframe) { | |
| var doc = iframe.contentDocument || iframe.contentWindow.document; | |
| // 设置iframe宽度 | |
| iframe.style.width = '100%'; |
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
| hasAttribute = function(node, attribute) { | |
| node = node.getAttributeNode(attribute); | |
| return !!(node && node.specified); | |
| }; |
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 fireClickEvent(el) { | |
| var event; | |
| // phantomjs目不支持new Event()的形式:https://github.com/ariya/phantomjs/issues/11289 | |
| if (document.createEvent) { | |
| event = document.createEvent('MouseEvent'); | |
| event.initEvent('click', true, true); | |
| el.dispatchEvent(event); | |
| } | |
| else if (el.fireEvent) { |
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> | |
| <script> | |
| (function(url) { | |
| if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ |
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
| atom sync-setting |
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
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] | |
| [email protected] |
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() { | |
| /** | |
| * 记录方法使用情况的类 | |
| * @param {Array.<boolean>} umMap 初始的使用情况 | |
| */ | |
| var UsageManager = function(umMap) { | |
| this.umMap = umMap || []; | |
| }; | |
| /** | |
| * 记录新的使用情况 |
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
| // copy from https://github.com/vuejs/vue/blob/v2.0.1/src/shared/util.js | |
| /** | |
| * Make a map and return a function for checking if a key | |
| * is in that map. | |
| */ | |
| export function makeMap ( | |
| str: string, | |
| expectsLowerCase?: boolean | |
| ): (key: string) => true | void { | |
| const map = Object.create(null) |
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 preg_quote( str ) { | |
| // http://kevin.vanzonneveld.net | |
| // + original by: booeyOH | |
| // + improved by: Ates Goral (http://magnetiq.com) | |
| // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
| // + bugfixed by: Onno Marsman | |
| // * example 1: preg_quote("$40"); | |
| // * returns 1: '\$40' | |
| // * example 2: preg_quote("*RRRING* Hello?"); | |
| // * returns 2: '\*RRRING\* Hello\?' |