forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (72 loc) · 3.04 KB
/
index.html
File metadata and controls
86 lines (72 loc) · 3.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test case for source maps</title>
<link rel="stylesheet" href="styles/style.css">
</head>
<body>
<p id="wait" style="font-size:1.5em">Please wait to be closed.</p>
<input type="text" id="color" placeholder="css color"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
var gui = require('nw.gui');
var win = gui.Window.get();
var results = new Array();
<!-- load devtools into iframe -->
win.showDevTools('', true);
win.on("devtools-opened", function(url) {
var iframe_devtools = document.createElement("iframe");
iframe_devtools.id = 'devtools';
iframe_devtools.src = url;
iframe_devtools.height = '1000';
iframe_devtools.width = '1000';
function get_scripts() {
var scripts = devtools.document.getElementsByClassName('scripts');
<!-- make sure it is complete -->
if(scripts == undefined || scripts[0] == undefined || scripts[0].click == undefined)
setTimeout(get_scripts, 3000);
else {
// open settitng
devtools.WebInspector.SettingsController.prototype.showSettingsScreen();
// source map feature must be enabled first
// We cannot to reload it automatically or it will crash
if(!devtools.document.getElementsByName('Enable JS source maps')[0].checked || !devtools.document.getElementsByName('Enable CSS source maps')[0].checked) {
devtools.document.getElementsByName('Enable JS source maps')[0].checked = true;
devtools.document.getElementsByName('Enable CSS source maps')[0].checked = true;
}
else {
// open scripts panel
scripts[0].click();
devtools.document.getElementsByClassName('scripts-navigator-show-hide-button')[0].click();
devtools.document.getElementsByClassName('parent navigator-folder-tree-item')[1].treeElement.expand();
var scripts_files = devtools.document.getElementsByClassName('navigator-script-tree-item');
for (var i = 0; i < scripts_files.length; i++)
results.push(scripts_files[i].childNodes[2].innerHTML);
results.sort();
}
win.showDevTools(); <!-- why? -->
var client = require('../../nw_test_app').createClient({
argv: gui.App.argv,
data: results
});
}
}
iframe_devtools.onload = get_scripts;
document.getElementById("wait").appendChild(iframe_devtools);
});
</script>
<!-- Comment the line below and uncomment the Options A to E one at a time -->
<!-- <script src="scripts/script.js"></script> -->
<!-- Option A: Closure Compile -->
<script src="scripts/script.closure.js"></script>
<!-- Option B: JSMin and Grunt -->
<script src="scripts/script.jsmin-grunt.js"></script>
<!-- Option C: Uglifyjs -->
<script src="scripts/script.uglify.js"></script>
<!-- Option D: CoffeeScript -->
<script src="scripts/script.coffee.min.js"></script>
<!-- Option E: TypeScript -->
<script src="scripts/script.typescript.min.js"></script>
</body>
</html>