forked from nezroy/EVEoj
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIGB.js
More file actions
44 lines (37 loc) · 1.04 KB
/
Copy pathIGB.js
File metadata and controls
44 lines (37 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* global jQuery: false */
/* global CCPEVE: false */
var $ = jQuery;
function IGBClick(ev) {
var corp_id,
chan,
cctype,
trustme,
trust_req = false,
href;
href = $(this).attr("href");
if (!href.match(/^eve:/i)) return; // huh.. that's odd
ev.preventDefault();
if (href.match(/^eve:trust:/i)) trust_req = true;
href = href.replace(/^eve:\s*/i, "").replace(/^trust:\s*/i, "");
/*
if (typeof(navigator) != 'undefined' && navigator.hasOwnProperty('userAgent') && !navigator.userAgent.match(/EVE\-IGB/)) {
// straight browser detection for IGB
return;
}
*/
if (typeof(CCPEVE) == "undefined") {
// impl based detection for IGB
return;
}
corp_id = $(this).data("igb-corpid");
chan = $(this).data("igb-chan");
cctype = $(this).data("igb-cctype");
trustme = $(this).data("igb-trustme");
if (corp_id && corp_id > 0) CCPEVE.showInfo(2, corp_id);
if (chan) CCPEVE.joinChannel(chan);
if (cctype) CCPEVE.createContract(cctype);
if (trustme) CCPEVE.requestTrust(trustme);
}
$(function() {
$("a[href^='eve:']").click(IGBClick);
});