-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathremote.js
More file actions
27 lines (27 loc) · 747 Bytes
/
remote.js
File metadata and controls
27 lines (27 loc) · 747 Bytes
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
(function() {
var getHost, saveHost;
getHost = function() {
return window.localStorage.getItem('host');
};
saveHost = function(host) {
return window.localStorage.setItem('host', host);
};
$('#main').live('pagecreate', function() {
$('#heading a').append(" " + getHost());
if (!getHost()) {
return jQuery.mobile.changePage($('#popup'));
}
});
$('button').bind('click', function() {
var url;
url = getHost() + 'cgi-bin/rc?' + $(this).data('btn');
console.log(url);
return $.get(url);
});
$('#popup').live('pagecreate', function() {
$('#host').val(getHost());
return $('#save-host').bind('click', function() {
return saveHost($('#host').val());
});
});
}).call(this);