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
| - Trailing commas are ok | |
| - No reserved words for property names | |
| - NaN, Infinity, undefined : are all constants | |
| - parseInt() defaults to radix 10 | |
| - /regexp/ produces new reg ex object every time | |
| - JSON.parse(), JSON.stringify() | |
| - Function.prototype.bind | |
| - String.prototype.trim | |
| - Array.prototype.every, filter, forEach, indexOf, lastIndexOf, map, reduce, reduceRight, some, | |
| - Date.now() |
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
| /* | |
| * XComponent | |
| * | |
| * 组件描述写在此处 | |
| */ | |
| ;(function(root){ | |
| 'use strict'; | |
| var RootClass = function(option){ |
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 isMobile = { | |
| Android: function() { | |
| return navigator.userAgent.match(/Android/i); | |
| }, | |
| BlackBerry: function() { | |
| return navigator.userAgent.match(/BlackBerry/i); | |
| }, | |
| iOS: function() { | |
| return navigator.userAgent.match(/iPhone|iPad|iPod/i); | |
| }, |
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参数 | |
| var QueryString = (function() { | |
| // This function is anonymous, is executed immediately and | |
| // the return value is assigned to QueryString! | |
| var quertString = {}; | |
| var query = window.location.search.substring(1); | |
| var vars = query.split('&'); | |
| for (var i = 0; i < vars.length; i++) { | |
| var pair = vars[i].split('='); | |
| // If first entry with this 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
| // bind event handler for a dom list. | |
| XICI.Event.addEvent(gas[i],"click",(function(i){ | |
| return function(){ | |
| var _option = gas[i].getAttribute('node-type'); | |
| var _title = gas[i].innerText || gas[i].getAttribute("title") || gas[i].getAttribute("alt") || ""; | |
| var _option3 = _title + "|" + gas[i].getAttribute("href"); | |
| _gaq.push(['_trackEvent',option1, _option, _option3]); | |
| } | |
| })(i)); |
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
| scrolltop = (((t = document.documentElement) || (t = document.body.parentNode)) typeof t.scrollTop == ‘number’ ? t : document.body).scrollTop |
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
| public static double getDistance(double wd1, double jd1, double wd2, double jd2) { | |
| double x, y, out; | |
| double PI = 3.14159265; | |
| double R = 6.371229 * 1e6; | |
| x = (jd2 - jd1) * PI * R * Math.cos(((wd1 + wd2) / 2) * PI / 180) / 180; | |
| y = (wd2 - wd1) * PI * R / 180; | |
| out = Math.hypot(x, y); | |
| out = out / 1000; | |
| return out; |