forked from Miserlou/LightWrite
-
Notifications
You must be signed in to change notification settings - Fork 10
/
light.html
125 lines (120 loc) · 4.5 KB
/
light.html
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>LightWrite - Gun.io</title>
<link href="/static/light.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="/static/jquery.textarea.js"></script>
<script>
$(document).ready(function(){
$.getJSON('/w/t/{{wash}}', function (data, textStatus, jqXHR) {
$('#writearea').val(data[0]['fields']['text'])
});
$('#writearea').focus();
$("#writearea").tabby();
$('#footer-items').hide();
$('#writearea').focus();
jQuery("#logoo").hover(function() {
jQuery('#logoo').attr("src", "/static/gunio2.png")
}, function(){
jQuery('#logoo').attr("src", "/static/gunio.png");
});
})
var light = true;
</script>
<script type="text/javascript">
function sendo(){
var writearea= $('textarea[name=writearea]');
var csrf= $('input[name=csrfmiddlewaretoken]');
var data = 'csrfmiddlewaretoken=' + csrf.val() + '&writearea=' + encodeURIComponent(writearea.val()) + '&save=Save+Online';
$.ajax({
url: "/w/{{wash}}",
type: "POST",
data: data,
cache: false,
});
smoke.signal('Saved!<br /><div id=sub>You can find this text at http://gun.io/w/{{wash}}</div> ');
return false;
}
</script>
<script type="text/javascript">
function save(){
$('#bodytext').submit();
}
</script>
<script type="text/javascript">
function lights(){
if(!light){
$('#writearea').css('background-color', '#ffffff');
$('body').css('background-color', '#ffffff');
$('#footer').css('background-color', '#ffffff');
$('#footer-items').css('background-color', '#ffffff');
$('#main form div textarea#writearea').css('color', '#000000');
$('#main form div textarea#writearea').css('text-shadow', '0 0 1px #666677');
light = true;
}
else{
$('#writearea').css('background-color', '#000000');
$('body').css('background-color', '#000000');
$('#footer').css('background-color', '#000000');
$('#footer-items').css('background-color', '#000000');
$('#main form div textarea#writearea').css('color', '#ffffff');
$('#main form div textarea#writearea').css('text-shadow', '0 0 1px #999988');
light = false;
}
}
</script>
<script TYPE="text/javascript">
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=600,scrollbars=yes');
return false;
}
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24979378-1']);
_gaq.push(['_setDomainName', '.gun.io']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link rel="stylesheet" href="/static/smoke.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/static/themes/dark.css" type="text/css" media="screen" />
<script src="/static/smoke.min.js" type="text/javascript"></script>
<link href="/static/favikon.ico" rel="SHORTCUT ICON">
</head>
<body>
<center>
<div id="main">
<form name="bodytext" method="post" action="/w/{{wash}}" id="bodytext" target="saver">
<div>{% csrf_token %}<textarea onclick="$('#footer-items').slideUp('fast');" cols="50" rows="20" id="writearea" name="writearea"></textarea>
</div>
<div>
<div id="footer" onmouseover="$('#footer-items').slideDown('slow');">
<div id="footer-items" style="display: block; width: 760px">
<div id="logo" style="float:left; clear: left">
<a href="http://gun.io" target="_blank"><img id="logoo" src="/static/gunio.png"></a>
</div>
</form>
<div id="buttons" style="width: 350px; text-align: center; margin-left: 100px; float: left;">
<button onClick="sendo()" type="button" class="clean-gray">Save Online</button>
<button onClick="save()" type="button" class="clean-gray">Export to File</button>
<button onClick="lights()" type="button" class="clean-gray">Lights</button>
</div>
<div id="about" style="float: right;">
<button onClick="javascript:popup('/w/a/about', 'About');" type="button" class="clean-gray">About</button>
</div>
</div>
</div>
</center>
</body>
</html>