|
1 | | -EVEoj.IGB = EVEoj.IGB || {}; |
2 | | -(function ($) { |
3 | | - var ME = EVEoj.IGB, |
4 | | - E = EVEoj, |
5 | | - |
6 | | - /* private functions */ |
7 | | - _IGBClick, // basic click handler for IGB scheme |
8 | | - _Ready // runs when DOM ready fires |
9 | | - ; |
10 | | - |
11 | | - _IGBClick = function (ev) { |
12 | | - var corp_id, |
13 | | - chan, |
14 | | - cctype, |
15 | | - trustme, |
16 | | - trust_req = false, |
17 | | - href |
18 | | - ; |
19 | | - |
20 | | - href = $(this).attr('href'); |
21 | | - if (!href.match(/^eve:/i)) return; // huh.. that's odd |
22 | | - ev.preventDefault(); |
| 1 | +/* global jQuery: false */ |
| 2 | +/* global CCPEVE: false */ |
| 3 | +'use strict'; |
| 4 | + |
| 5 | +var $ = jQuery; |
23 | 6 |
|
24 | | - if (href.match(/^eve:trust:/i)) trust_req = true; |
25 | | - href = href.replace(/^eve:\s*/i, '').replace(/^trust:\s*/i, ''); |
26 | | - |
27 | | - /* |
28 | | - if (typeof(navigator) != 'undefined' && navigator.hasOwnProperty('userAgent') && !navigator.userAgent.match(/EVE\-IGB/)) { |
29 | | - // straight browser detection for IGB |
30 | | - return; |
31 | | - } |
32 | | - */ |
33 | | - if (typeof(CCPEVE) == 'undefined') { |
34 | | - // impl based detection for IGB |
35 | | - return; |
36 | | - } |
37 | | - |
38 | | - corp_id = $(this).data('igb-corpid'); |
39 | | - chan = $(this).data('igb-chan'); |
40 | | - cctype = $(this).data('igb-cctype'); |
41 | | - trustme = $(this).data('igb-trustme'); |
| 7 | +function IGBClick(ev) { |
| 8 | + var corp_id, |
| 9 | + chan, |
| 10 | + cctype, |
| 11 | + trustme, |
| 12 | + trust_req = false, |
| 13 | + href |
| 14 | + ; |
42 | 15 |
|
43 | | - if (corp_id && corp_id > 0) CCPEVE.showInfo(2, corp_id); |
44 | | - if (chan) CCPEVE.joinChannel(chan); |
45 | | - if (cctype) CCPEVE.createContract(cctype); |
46 | | - if (trustme) CCPEVE.requestTrust(trustme); |
47 | | - }; |
| 16 | + href = $(this).attr('href'); |
| 17 | + if (!href.match(/^eve:/i)) return; // huh.. that's odd |
| 18 | + ev.preventDefault(); |
| 19 | + |
| 20 | + if (href.match(/^eve:trust:/i)) trust_req = true; |
| 21 | + href = href.replace(/^eve:\s*/i, '').replace(/^trust:\s*/i, ''); |
48 | 22 |
|
49 | | - _Ready = function () { |
50 | | - $("a[href^='eve:']").click(_IGBClick); |
51 | | - }; |
52 | | - |
53 | | - $(_Ready); |
| 23 | + /* |
| 24 | + if (typeof(navigator) != 'undefined' && navigator.hasOwnProperty('userAgent') && !navigator.userAgent.match(/EVE\-IGB/)) { |
| 25 | + // straight browser detection for IGB |
| 26 | + return; |
| 27 | + } |
| 28 | + */ |
| 29 | + if (typeof(CCPEVE) == 'undefined') { |
| 30 | + // impl based detection for IGB |
| 31 | + return; |
| 32 | + } |
54 | 33 |
|
55 | | -})(jQuery); |
| 34 | + corp_id = $(this).data('igb-corpid'); |
| 35 | + chan = $(this).data('igb-chan'); |
| 36 | + cctype = $(this).data('igb-cctype'); |
| 37 | + trustme = $(this).data('igb-trustme'); |
| 38 | + |
| 39 | + if (corp_id && corp_id > 0) CCPEVE.showInfo(2, corp_id); |
| 40 | + if (chan) CCPEVE.joinChannel(chan); |
| 41 | + if (cctype) CCPEVE.createContract(cctype); |
| 42 | + if (trustme) CCPEVE.requestTrust(trustme); |
| 43 | +} |
| 44 | + |
| 45 | +$(function () { |
| 46 | + $("a[href^='eve:']").click(IGBClick); |
| 47 | +}); |
0 commit comments