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
| /* | |
| * @Author: @schumilin | |
| * @Date: 2015-01-28 14:20:50 | |
| * @Last Modified by: midare | |
| * @Last Modified time: 2015-05-19 13:49:55 | |
| */ | |
| /*global $, jQuery, ga, _gaq*/ | |
| /* jshint ignore:start */ |
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
| // <script src="/javascripts/www/campaign/jquery-1.11.1.min.js"></script> | |
| // <script src="/components/underscore/underscore-min.js"></script> | |
| // <script src="/components/fastclick/lib/fastclick.js"></script> | |
| // <script src="/components/history.js/scripts/bundled-uncompressed/html4+html5/jquery.history.js"></script> | |
| // <script src="/components/velocity/velocity.min.js"></script> | |
| // <script src="/components/velocity/velocity.ui.min.js"></script> | |
| // <script src="/javascripts/www/campaign/avos.min.js"></script> | |
| // <script src="/javascripts/www/jweixin-1.0.0.js"></script> | |
| // <script src="/javascripts/www/campaign/scrollTo.min.js"></script> | |
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 moment(timestamp) { | |
| var dateTarget = new Date(timestamp.replace(/-/g, '/')); // fix for iOS e.g: http://stackoverflow.com/questions/5324178/javascript-date-parsing-on-iphone | |
| var dateCurrent = new Date(); | |
| var textMinute = dateTarget.getMinutes(); | |
| var textHour = dateTarget.getHours(); | |
| if (textMinute < 10) { | |
| textMinute = '0' + dateTarget.getMinutes(); | |
| } |
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 j = window.navigator.userAgent; | |
| var g = { | |
| android: j.match(/(Android);?[\s\/]+([\d.]+)?/), | |
| iphone: j.match(/(iPhone\sOS)\s([\d_]+)/) | |
| }; | |
| var d = { | |
| aliapp: j.match(/\AliApp\(([^\/]+)\/([\d\.\w]+)\)/), | |
| xiami: j.match(/(AliApp)\((XM)\/([0-9.]+)\)*/), | |
| weibo: j.match(/.*?(weibo\_\_([0-9.]+))\s*/), | |
| weixin: j.match(/.*?(MicroMessenger\/([0-9.]+))\s*/) |
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 ispc = false; | |
| (function(){ | |
| var SUA = navigator.userAgent, SUA_OF = function(s){return SUA.indexOf(s) > -1}; | |
| if (SUA_OF('Android') && SUA_OF('Mobile') || SUA_OF('iPhone') || SUA_OF('iPod') || SUA_OF('Symbian') || SUA_OF('IEMobile')){ | |
| }else{ | |
| ispc = true; | |
| } | |
| })(); | |
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
| /* | |
| * @Author: [email protected] | |
| * @Date: 2014-12-17 19:50:08 | |
| * @Last Modified by: [email protected] | |
| * @Last Modified time: 2014-12-17 20:04:19 | |
| */ | |
| // 判断是不是在 P4 中 | |
| if (window.campaignPlugin) { |
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
| // 微博分享 | |
| trackEvent({category: 'movie2014', action: 'share', label: 'weibo'}); | |
| // 微信好友分享 | |
| trackEvent({category: 'movie2014', action: 'share', label: 'wechat-friend'}); | |
| // 微信朋友圈分享 | |
| trackEvent({category: 'movie2014', action: 'share', label: 'wechat-timeline'}); | |
| // 每个电影点击喜欢的 的数据 |
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
| // GA 统计 | |
| var trackEvent = function (opt) { | |
| if (typeof ga !== 'undefined' && ga) { | |
| var _act, _cat, _lbl, _val; | |
| if (opt) { | |
| _cat = opt.category || ''; | |
| _act = opt.action || ''; | |
| _lbl = opt.label || ''; | |
| _val = opt.value || 0; | |
| return ga('send', 'event', _cat, _act, _lbl, _val); |