-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
106 lines (56 loc) · 1.67 KB
/
script.js
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$(document).ready(function() {
function addResCheck () {
$.get( "http://localhost:8080/DCT/tests/GoogleChromeExt/extension-unpacked/myApp/injectScript.js", function(sScriptBody,
textStatus, jsXHR){
chrome.tabs.executeScript(null, {code: sScriptBody} );
} , "text");
}
var windowResolution = function () {
function myfunction () {
setTimeout(function() {
chrome.tabs.executeScript(null, {file:"injectSript.js"} );
//chrome.tabs.executeScript(null,{code:"addResCheck()"});
}, 400);
}
chrome.tabs.executeScript(null, {file:"jquery.min.js"}, myfunction() );
chrome.tabs.insertCSS(null, {file:"/injectCss.css"} );
}
var callbackhey = function () {
setTimeout(function () {
//chrome.tabs.executeScript(null,{code:"document.body.style.backgroundColor='green'"});
//chrome.tabs.executeScript(null, {file:"injectSript.js"} );
//chrome.tabs.executeScript(null, {"file":"/jquery.min.js"});
//alert('jquery added');
}, 1000)
}
//app events
$('.addjquery').bind('click', function () {
addResCheck();
//callbackhey();
});
$('.showRes').bind('click', function () {
var check = $('.resWrap').length;
if(check === 0) {
windowResolution();
} else {
return null;
}
});
$('.workTabs').bind('click', function () {
chrome.tabs.create({
"url":"http://www.facebook.com",
"pinned":true,
"active": false
});
chrome.tabs.create({
"url":"http://www.bugherd.com/projects/14760/kanban",
"pinned":true,
"active": false
});
chrome.tabs.create({
"url":"https://www.youtube.com/?feature=ytca",
"pinned":true,
"active": false
});
});
});